[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6JNW45GMCMH7M3QKDGPE96M":3,"skill-same:01M6JNW45GMCMH7M3QKDGPE96M":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":44,"commitSha":45,"skillDirectory":46,"forksCount":14,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":49,"updatedAt":50,"install":51,"resources":64},"01M6JNW45GMCMH7M3QKDGPE96M","code-archaeology",null,"Understand unfamiliar or legacy code before changing it — map entry points, mine git history (blame, churn, log -S), trace data flow, recover the why behind odd code, pin current behavior with characterization tests, find seams for safe change. Triggers: understand this codebase, legacy code, inherited this project, what does this code do, why is it written this way, nobody knows how this works, onboard to this repo, is it safe to change this. Prioritizing debt → technical-debt-review; improving code you already understand → refactoring.","SWEStash\u002Fswe-workflow-skills","SWEStash","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F272895713?v=4","01M6JNRQ84JN5WFK9S1V5H4G46","SWE Stash","01M6JNRQCM45X8WPNHY30TSAB0",1,"MIT","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Farchitect\u002Fskills\u002Fcode-archaeology\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"code archaeology","code","log","legacy code","you","churn","mine","project","map","technical-debt","do","review","refactoring","why","how","data","flow","git","change","safe","2026-11-10 10:12:30",false,"---\nname: code-archaeology\ndescription: \"Understand unfamiliar or legacy code before changing it — map entry points, mine git history (blame, churn, log -S), trace data flow, recover the why behind odd code, pin current behavior with characterization tests, find seams for safe change. Triggers: understand this codebase, legacy code, inherited this project, what does this code do, why is it written this way, nobody knows how this works, onboard to this repo, is it safe to change this. Prioritizing debt → technical-debt-review; improving code you already understand → refactoring.\"\n---\n\n# Code Archaeology\n\nBuild a working model of code nobody fully understands — *before* changing it.\nThe cardinal rule: **the code is the way it is for reasons; find them before\noverriding them.** Chesterton's fence applies — weird code is usually a bug fix\nwhose bug report is lost, and \"cleaning it up\" reintroduces the bug. Boundary\nwith siblings: `technical-debt-review` assesses and prioritizes what to fix;\n`refactoring` improves code you already understand; this skill produces the\nunderstanding both depend on.\n\n## Workflow\n\n### Step 1: Survey Before Digging\n\nGet the shape of the territory without reading line-by-line: entry points\n(main, routes, handlers, cron, consumers), the dependency skeleton (what are\nthe load-bearing modules — imported by everything), build\u002Frun\u002Ftest commands\n(does the test suite even pass? that's data), and the directory map with sizes.\nResist starting at file one and reading forward — comprehension follows the\ncall graph, not the alphabet.\n\n### Step 2: Mine the History — the Code's Memory\n\nGit knows what the docs forgot. The high-yield digs:\n\n- `git log --follow -p -- \u003Cfile>` — a file's life story; the commit that\n  introduced the odd code usually says why (and links a ticket).\n- `git log -S '\u003Cstring>'` (pickaxe) — when a magic value or weird guard\n  appeared, and what else changed with it.\n- **Churn analysis** — files with the most commits are the active organs\n  (`git log --format= --name-only | sort | uniq -c | sort -rn | head`);\n  high-churn + large = where understanding pays most (same hotspot logic as\n  `technical-debt-review`).\n- `git blame -w -C` (ignore whitespace, follow copies) — who last touched this\n  line *and in what commit context*; blame the commit, then read its message\n  and siblings.\n- Merge\u002FPR references in messages — the review thread often holds the design\n  discussion that never made it into the code.\n\n### Step 3: Trace, Don't Guess\n\nFor the specific behavior you need to understand, follow the data: pick one\nconcrete input (a request, an event, a row) and trace it end to end — through\nhandlers, transformations, side effects, and persistence. Use the debugger or\nstrategic log statements over static reading when the control flow is dynamic\n(dispatch tables, DI containers, metaprogramming). Write the trace down as you\ngo; a data-flow narrative (\"the order enters here, gets enriched here, forks\nhere\") is worth ten class diagrams.\n\n### Step 4: Interrogate the Oddities\n\nFor each \"why on earth\" you hit, run the checklist before concluding it's\nsenseless: What does history say (Step 2)? Does a test encode it as intended\nbehavior? Do comments\u002Ftickets\u002FADRs reference it? Does production data depend on\nit (that dead-looking branch may handle the 2019 records)? Only after all four\ncome up empty may you *suspect* it's vestigial — and even then you prove it\n(logging\u002Ftelemetry on the branch) rather than assume it.\n\n### Step 5: Pin Behavior with Characterization Tests\n\nBefore changing anything you don't fully understand, write tests that capture\nwhat the code **currently does** — not what it should do. Feed it\nrepresentative inputs (including the weird ones from production), assert the\nobserved outputs, and lock in today's behavior as the baseline. These tests\nare your tripwire: if a \"safe cleanup\" changes an output, you learn it in CI,\nnot in production. Golden-master\u002Fsnapshot testing works well when outputs are\nlarge or numerous. (For designing the suite around them long-term:\n`test-suite-design`.)\n\n### Step 6: Leave the Map Better Than You Found It\n\nRecord what you learned where the next archaeologist will find it: a short\narchitecture note or README-in-the-directory (the data-flow narrative from\nStep 3, the load-bearing oddities from Step 4 and *why they exist*), backfilled\nADRs for the big recovered decisions (`architecture-design`), and comments only\non the genuinely non-obvious constraints. Then, with understanding and\ncharacterization tests in place, changes proceed via `refactoring` (seams,\nsafe transformations) or `dependency-impact-analysis` (blast radius) as normal.\n\n## Principles Applied\n\n- **Chesterton's fence**: understand why the fence is there before removing\n  it; lost context is not absent context.\n- **Evidence over inference**: history, traces, and tests beat reading-and-\n  guessing — the code's actual behavior outranks anyone's model of it.\n- **Capture as you go**: understanding that lives in one head (or one session)\n  is re-excavated at full cost next time.\n\n## Cross-Skill References\n\n- `technical-debt-review` — assess and prioritize what to fix once understood\n- `refactoring` — the safe-change patterns applied after comprehension\n- `test-suite-design` — growing characterization tests into a real suite\n- `dependency-impact-analysis` — blast radius before changing a shared piece\n- `architecture-documentation` — recording the recovered architecture (C4, flows)\n- `bug-investigating` — when the goal narrows to one specific misbehavior\n","# Code Archaeology\n\nBuild a working model of code nobody fully understands — *before* changing it.\nThe cardinal rule: **the code is the way it is for reasons; find them before\noverriding them.** Chesterton's fence applies — weird code is usually a bug fix\nwhose bug report is lost, and \"cleaning it up\" reintroduces the bug. Boundary\nwith siblings: `technical-debt-review` assesses and prioritizes what to fix;\n`refactoring` improves code you already understand; this skill produces the\nunderstanding both depend on.\n\n## Workflow\n\n### Step 1: Survey Before Digging\n\nGet the shape of the territory without reading line-by-line: entry points\n(main, routes, handlers, cron, consumers), the dependency skeleton (what are\nthe load-bearing modules — imported by everything), build\u002Frun\u002Ftest commands\n(does the test suite even pass? that's data), and the directory map with sizes.\nResist starting at file one and reading forward — comprehension follows the\ncall graph, not the alphabet.\n\n### Step 2: Mine the History — the Code's Memory\n\nGit knows what the docs forgot. The high-yield digs:\n\n- `git log --follow -p -- \u003Cfile>` — a file's life story; the commit that\n  introduced the odd code usually says why (and links a ticket).\n- `git log -S '\u003Cstring>'` (pickaxe) — when a magic value or weird guard\n  appeared, and what else changed with it.\n- **Churn analysis** — files with the most commits are the active organs\n  (`git log --format= --name-only | sort | uniq -c | sort -rn | head`);\n  high-churn + large = where understanding pays most (same hotspot logic as\n  `technical-debt-review`).\n- `git blame -w -C` (ignore whitespace, follow copies) — who last touched this\n  line *and in what commit context*; blame the commit, then read its message\n  and siblings.\n- Merge\u002FPR references in messages — the review thread often holds the design\n  discussion that never made it into the code.\n\n### Step 3: Trace, Don't Guess\n\nFor the specific behavior you need to understand, follow the data: pick one\nconcrete input (a request, an event, a row) and trace it end to end — through\nhandlers, transformations, side effects, and persistence. Use the debugger or\nstrategic log statements over static reading when the control flow is dynamic\n(dispatch tables, DI containers, metaprogramming). Write the trace down as you\ngo; a data-flow narrative (\"the order enters here, gets enriched here, forks\nhere\") is worth ten class diagrams.\n\n### Step 4: Interrogate the Oddities\n\nFor each \"why on earth\" you hit, run the checklist before concluding it's\nsenseless: What does history say (Step 2)? Does a test encode it as intended\nbehavior? Do comments\u002Ftickets\u002FADRs reference it? Does production data depend on\nit (that dead-looking branch may handle the 2019 records)? Only after all four\ncome up empty may you *suspect* it's vestigial — and even then you prove it\n(logging\u002Ftelemetry on the branch) rather than assume it.\n\n### Step 5: Pin Behavior with Characterization Tests\n\nBefore changing anything you don't fully understand, write tests that capture\nwhat the code **currently does** — not what it should do. Feed it\nrepresentative inputs (including the weird ones from production), assert the\nobserved outputs, and lock in today's behavior as the baseline. These tests\nare your tripwire: if a \"safe cleanup\" changes an output, you learn it in CI,\nnot in production. Golden-master\u002Fsnapshot testing works well when outputs are\nlarge or numerous. (For designing the suite around them long-term:\n`test-suite-design`.)\n\n### Step 6: Leave the Map Better Than You Found It\n\nRecord what you learned where the next archaeologist will find it: a short\narchitecture note or README-in-the-directory (the data-flow narrative from\nStep 3, the load-bearing oddities from Step 4 and *why they exist*), backfilled\nADRs for the big recovered decisions (`architecture-design`), and comments only\non the genuinely non-obvious constraints. Then, with understanding and\ncharacterization tests in place, changes proceed via `refactoring` (seams,\nsafe transformations) or `dependency-impact-analysis` (blast radius) as normal.\n\n## Principles Applied\n\n- **Chesterton's fence**: understand why the fence is there before removing\n  it; lost context is not absent context.\n- **Evidence over inference**: history, traces, and tests beat reading-and-\n  guessing — the code's actual behavior outranks anyone's model of it.\n- **Capture as you go**: understanding that lives in one head (or one session)\n  is re-excavated at full cost next time.\n\n## Cross-Skill References\n\n- `technical-debt-review` — assess and prioritize what to fix once understood\n- `refactoring` — the safe-change patterns applied after comprehension\n- `test-suite-design` — growing characterization tests into a real suite\n- `dependency-impact-analysis` — blast radius before changing a shared piece\n- `architecture-documentation` — recording the recovered architecture (C4, flows)\n- `bug-investigating` — when the goal narrows to one specific misbehavior\n",{"name":5,"description":7},"main","800dc9ad0ca2914d6ad15b8c5159d9b57bb104c2","plugins\u002Farchitect\u002Fskills\u002Fcode-archaeology","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills","https:\u002F\u002Fgithub.com\u002FSWEStash","A stash of things we felt like building","2026-11-12 00:14:33",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add SWEStash\u002Fswe-workflow-skills --skill code-archaeology",{"tool":57,"command":58},"bunx","bunx skills add SWEStash\u002Fswe-workflow-skills --skill code-archaeology",{"tool":60,"command":61},"pnpm","pnpm dlx skills add SWEStash\u002Fswe-workflow-skills --skill code-archaeology","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Farchitect\u002Fskills\u002Fcode-archaeology\u002FSKILL.md",true,[65],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"evals\u002Fevals.json","REFERENCE","参考文档",5754,"https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fplugins\u002Farchitect\u002Fskills\u002Fcode-archaeology\u002Fevals\u002Fevals.json",[72,99,122,144,169,193],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":39},"01M6JQFADV3T1MS9V1BNZS1232","writing-skills","Use when authoring, editing, or reviewing a skill in this library — a new SKILL.md, one that under-triggers, or hardening an existing one. Covers description and listing-budget rules, frontmatter, progressive disclosure, the 3-eval rule, and pressure-testing against rationalizations.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98],"writing","writing skills","testing","eval","write","edit","Budget","authoring","new skill","library","frontmatter","editing","triggers","use","Existing","Rules","write a skill","when","listing","progressive disclosure",{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":39},"01M6JQF5DGMXPMQQVZBP8DH9SY","working-agreement","Define and validate how a multi-session project is run — where plans, status and decisions live, session routines, new work, milestone close. README\u002FCONTRIBUTING → project-documentation.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fworking-agreement\u002FSKILL.md",[],[106,26,107,108,109,110,111,112,33,113,114,115,116,117,118,29,119,120,91,121],"working agreement","definition of done","done","milestone","documentation","work","progress","contributing","close","run","sync","status","live","README","session","routines",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":39},"01M6JQF0SMRHN82RBSWMABC4J0","verification-before-completion","Evidence gate before any claim that work is done, fixed, passing, or deployed. Route here when a message declares the work finished or asks to commit, push, merge, ship, or close it out, including a brief sign-off, and before git-workflow or release-management act on it. Writing the commit message or PR text itself → git-workflow.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[129,130,131,132,133,134,79,135,108,136,137,138,111,139,114,140,141,36,142,143],"verification","verification before completion","brief","ready","fix","claim","workflow","commit","text","route","message","merge","release","act","ship",{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":39},"01M6JQEVGE9NJZ11DV60AE6VWC","ui-ux-design","Design user experiences from an engineer's perspective — user flows, wireframes, interaction patterns, responsive strategy, navigation, loading\u002Ferror\u002Fempty states. Triggers: design the UI, user flow, wireframe, how should this screen look, loading state, error state, empty state, responsive design, navigation, page layout, form design, mockup.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fui-ux-design\u002FSKILL.md",[],[151,152,153,154,155,156,157,158,159,160,161,162,33,163,35,164,165,166,167,168],"design","ux","ui","ui ux design","error","states","loading","flows","engineer","interaction","layout","responsive design","screen","patterns","mockup","responsive","form","page",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":39},"01M6JQEN4HVFTZWQYWGTDS76K9","threat-modeling","Design-time security analysis of a system or feature before it's built — trust boundaries, attack surface, STRIDE per element, abuse cases, prioritized mitigations that become security requirements. Triggers: threat model, STRIDE, trust boundary, attack surface, what could go wrong security-wise, security design review, abuse case, secure this design, security requirements. Reviewing EXISTING code\u002Fconfig for vulnerabilities → security-audit; use this skill while the design is still on the whiteboard.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Fthreat-modeling\u002FSKILL.md",[],[176,177,178,179,180,181,151,182,183,184,20,30,185,186,187,188,189,190,191,192],"modeling","threat modeling","threat","model","time","element","whiteboard","security analysis","analysis","threat model","audit","security-audit","secure","config","go","security","trust",{"skillNo":194,"name":195,"nameZh":6,"description":196,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":197,"categories":198,"keywords":199,"publishedAt":39},"01M6JQEFT7VT3FQM16170EG9FW","test-suite-design","Design comprehensive test suites for existing code — strategy across unit\u002Fintegration\u002Fe2e, fixtures, factories, helpers. Triggers: add tests, write tests for, increase coverage, test this module, testing strategy, test plan, what tests do I need, test infrastructure, test helpers, this has no tests. Not for TDD — use tdd-workflow.","https:\u002F\u002Fgithub.com\u002FSWEStash\u002Fswe-workflow-skills\u002Fblob\u002Fmain\u002Fskills\u002Ftest-suite-design\u002FSKILL.md",[],[151,200,201,202,203,204,81,205,206,135,20,207,208,83,209,210,29,211,212,91],"test suite","test","test suite design","coverage","unit","write tests","testing strategy","across","plan","add","infrastructure","test plan","for"]