[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6GXRG4QPGKHVCJPRCEWBW2S":3,"skill-same:01M6GXRG4QPGKHVCJPRCEWBW2S":82},{"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":23,"publishedAt":41,"linkOnly":42,"markdownContent":43,"markdownBody":44,"frontMatter":45,"refName":50,"commitSha":51,"skillDirectory":52,"forksCount":53,"repositoryHtmlUrl":54,"repositoryHomepageUrl":55,"ownerHtmlUrl":56,"ownerBlogUrl":55,"ownerDescription":57,"updatedAt":58,"install":59,"resources":71},"01M6GXRG4QPGKHVCJPRCEWBW2S","test-gen",null,"Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns","SethGammon\u002FCitadel","SethGammon","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5523585?v=4","01M6GXJ90FD2CE9QF5GQERWN06","Seth Gammon","01M6GXJ94VXYGK5KAW14EYE901",929,"MIT","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftest-gen\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40],"test","test gen","path","true","error","add","paths","tests","project","patterns","generate tests","write","verify","edge","framework","generate","write tests","2026-11-10 10:12:30",false,"---\nname: test-gen\nlicense: MIT\ndescription: Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns\nuser-invocable: true\ntrigger_keywords:\n  - \u002Ftest-gen\n  - generate tests\n  - write tests\n  - add tests\n  - test\n---\n\n# Identity\n\nYou write tests that run on the first try. Match the project's test style exactly — framework, assertion library, describe\u002Fit nesting, import patterns. Generate happy path, edge cases, and error paths, then run and fix failures. Never ship a red suite. Mock only external services, I\u002FO, and time.\n\n## Orientation\n\n**Use when:** generating initial test coverage for a module -- happy path, edge cases, and error paths from scratch.\n**Don't use when:** tests already exist and need updating (use \u002Freview or \u002Fimprove); writing integration tests across services (use \u002Fmarshal with an explicit test plan).\n\n# Orientation\n\n**Input**: A test target — one of:\n- A file path (`\u002Ftest-gen src\u002Fauth\u002Fsession.ts`)\n- A specific function (`\u002Ftest-gen src\u002Fauth\u002Fsession.ts:validateToken`)\n- A directory (`\u002Ftest-gen src\u002Futils\u002F`) — generates tests for each exported module\n\n**Output**: One or more test files that pass, covering happy path, edge cases, and error paths for every exported function\u002Fclass in scope.\n\n**Constraints**:\n- Tests must run and pass before delivery — no \"these should work\" handoffs\n- Maximum 3 fix iterations per test file. If a test still fails after 3 attempts, mark it as `.skip` with a comment explaining why, and move on\n- Never modify the source code to make tests pass. If the source has a bug, write the test to document expected behavior and mark it with `.todo` or `.skip` plus a note\n\n## Protocol\n\n## Step 1 — Detect test framework\n\nCheck config files (`jest.config.*`, `vitest.config.*`, `pytest.ini`, etc.), `package.json` devDependencies, and the nearest existing test file. Capture: framework, runner command, file naming, file location, import style, assertion style, mocking style, describe\u002Fit nesting. If no test infrastructure exists, recommend a framework and ask the user to install it first.\n\n## Step 2 — Analyze the target\n\nFor each exported function\u002Fclass\u002Fmethod, extract: signature, branches (if\u002Fswitch\u002Fternary\u002Ftry\u002Fcatch\u002Fearly return), dependencies (internal vs external), side effects, error conditions. Map every branch to at least one test case before writing code.\n\n## Step 3 — Generate tests\n\nWrite the test file following the project's exact patterns. Organize into three sections per function:\n\n### Happy Path\n- Primary use case with typical, valid input; multiple input shapes if behavior differs\n- Verify return value AND expected side effects\n\n### Edge Cases\n- Boundary values: 0, 1, -1, empty string\u002Farray\u002Fobject, MAX_SAFE_INTEGER, very long strings\n- Null\u002Fundefined for every parameter that could receive them (only if reachable given the type system)\n- Collection: empty, single element, duplicates, very large\n- String: whitespace-only, unicode, special characters\n- Concurrent access if function manages shared state\n\n### Error Paths\n- Invalid input (at untyped boundaries), out-of-range values, malformed data\n- Dependency failures: throws, returns null, times out, unexpected data\n- State precondition violations: wrong method order, closed\u002Fdisposed resources\n- Verify error type\u002Fmessage, not just that it throws\n\n### Mocking rules\n- Mock: HTTP clients, DB connections, file system, timers, random number generators\n- Do NOT mock: internal utilities, data transformations, pure functions, the module under test\n- Prefer fakes over mocks when available. Reset mocks in `beforeEach`\u002F`afterEach`. Type mocks to match the real interface.\n\n## Step 4 — Write the test file\n\nOne file per source file. Group with `describe` blocks per function\u002Fclass. Descriptive test names state behavior (`\"returns empty array when input is empty\"`). Shared fixtures in `beforeEach`. Each test independent. Extract helpers for setups over 15 lines.\n\n## Step 5 — Run and verify\n\nRun only the generated file. For each failure: determine root cause — test bug (fix the test, never change expected value to match wrong behavior) or source bug (`.skip` with `\u002F\u002F SKIP: source bug — {description}`). Up to 3 iterations. After 3 failed attempts: `.skip` with `\u002F\u002F SKIP: could not resolve after 3 attempts — {last error}`.\n\n## Step 6 — Coverage check\n\nIf a coverage tool is configured, run it for the target file. Add tests for meaningful uncovered branches. Skip if no coverage tool exists — do not install one.\n\n## Contextual Gates\n\n**Disclosure:** \"Generating tests for [target]. Creates new test files; no existing files modified.\"\n**Reversibility:** green — creates new test files only; delete the generated test files to undo\n**Trust gates:**\n- Any: generate tests for any target file or directory\n\n## Quality Gates\n\n1. All tests pass — final run with `node scripts\u002Frun-with-timeout.js 300 \u003Ctest-cmd>`. Skips must have documented reasons.\n2. No snapshot-only tests — every test asserts specific behavior.\n3. No implementation coupling — tests don't break on internal refactors. Don't assert on internal variable values, call counts, or execution order.\n4. No test interdependence — each test runnable in isolation.\n5. Mocks are minimal — only external boundaries. Internal functions: remove the mock and test through real code.\n6. Test names are self-documenting — the describe\u002Fit tree explains behavior without reading source.\n\n## Exit Protocol\n\nDeliver:\n\n```\n## Tests Generated: {target}\n\n**Framework**: {detected framework}\n**Test file**: {path to generated test file}\n**Results**: {N passed}, {N skipped} of {N total}\n\n### Coverage\n- {function\u002Fmethod name}: {branches covered} \u002F {total branches}\n- ...\n\n### Skipped Tests\n- {test name}: {reason}\n- ...\n(or \"None — all tests pass.\")\n```\n\nIf any tests were skipped due to source bugs, call them out clearly — these are findings, not failures of test generation:\n\n```\n### Source Issues Found\n- **{file}:{line}**: {description of the bug the test exposed}\n```\n\nDo not offer to fix source bugs unless asked. The tests are the deliverable.\n","# Identity\n\nYou write tests that run on the first try. Match the project's test style exactly — framework, assertion library, describe\u002Fit nesting, import patterns. Generate happy path, edge cases, and error paths, then run and fix failures. Never ship a red suite. Mock only external services, I\u002FO, and time.\n\n## Orientation\n\n**Use when:** generating initial test coverage for a module -- happy path, edge cases, and error paths from scratch.\n**Don't use when:** tests already exist and need updating (use \u002Freview or \u002Fimprove); writing integration tests across services (use \u002Fmarshal with an explicit test plan).\n\n# Orientation\n\n**Input**: A test target — one of:\n- A file path (`\u002Ftest-gen src\u002Fauth\u002Fsession.ts`)\n- A specific function (`\u002Ftest-gen src\u002Fauth\u002Fsession.ts:validateToken`)\n- A directory (`\u002Ftest-gen src\u002Futils\u002F`) — generates tests for each exported module\n\n**Output**: One or more test files that pass, covering happy path, edge cases, and error paths for every exported function\u002Fclass in scope.\n\n**Constraints**:\n- Tests must run and pass before delivery — no \"these should work\" handoffs\n- Maximum 3 fix iterations per test file. If a test still fails after 3 attempts, mark it as `.skip` with a comment explaining why, and move on\n- Never modify the source code to make tests pass. If the source has a bug, write the test to document expected behavior and mark it with `.todo` or `.skip` plus a note\n\n## Protocol\n\n## Step 1 — Detect test framework\n\nCheck config files (`jest.config.*`, `vitest.config.*`, `pytest.ini`, etc.), `package.json` devDependencies, and the nearest existing test file. Capture: framework, runner command, file naming, file location, import style, assertion style, mocking style, describe\u002Fit nesting. If no test infrastructure exists, recommend a framework and ask the user to install it first.\n\n## Step 2 — Analyze the target\n\nFor each exported function\u002Fclass\u002Fmethod, extract: signature, branches (if\u002Fswitch\u002Fternary\u002Ftry\u002Fcatch\u002Fearly return), dependencies (internal vs external), side effects, error conditions. Map every branch to at least one test case before writing code.\n\n## Step 3 — Generate tests\n\nWrite the test file following the project's exact patterns. Organize into three sections per function:\n\n### Happy Path\n- Primary use case with typical, valid input; multiple input shapes if behavior differs\n- Verify return value AND expected side effects\n\n### Edge Cases\n- Boundary values: 0, 1, -1, empty string\u002Farray\u002Fobject, MAX_SAFE_INTEGER, very long strings\n- Null\u002Fundefined for every parameter that could receive them (only if reachable given the type system)\n- Collection: empty, single element, duplicates, very large\n- String: whitespace-only, unicode, special characters\n- Concurrent access if function manages shared state\n\n### Error Paths\n- Invalid input (at untyped boundaries), out-of-range values, malformed data\n- Dependency failures: throws, returns null, times out, unexpected data\n- State precondition violations: wrong method order, closed\u002Fdisposed resources\n- Verify error type\u002Fmessage, not just that it throws\n\n### Mocking rules\n- Mock: HTTP clients, DB connections, file system, timers, random number generators\n- Do NOT mock: internal utilities, data transformations, pure functions, the module under test\n- Prefer fakes over mocks when available. Reset mocks in `beforeEach`\u002F`afterEach`. Type mocks to match the real interface.\n\n## Step 4 — Write the test file\n\nOne file per source file. Group with `describe` blocks per function\u002Fclass. Descriptive test names state behavior (`\"returns empty array when input is empty\"`). Shared fixtures in `beforeEach`. Each test independent. Extract helpers for setups over 15 lines.\n\n## Step 5 — Run and verify\n\nRun only the generated file. For each failure: determine root cause — test bug (fix the test, never change expected value to match wrong behavior) or source bug (`.skip` with `\u002F\u002F SKIP: source bug — {description}`). Up to 3 iterations. After 3 failed attempts: `.skip` with `\u002F\u002F SKIP: could not resolve after 3 attempts — {last error}`.\n\n## Step 6 — Coverage check\n\nIf a coverage tool is configured, run it for the target file. Add tests for meaningful uncovered branches. Skip if no coverage tool exists — do not install one.\n\n## Contextual Gates\n\n**Disclosure:** \"Generating tests for [target]. Creates new test files; no existing files modified.\"\n**Reversibility:** green — creates new test files only; delete the generated test files to undo\n**Trust gates:**\n- Any: generate tests for any target file or directory\n\n## Quality Gates\n\n1. All tests pass — final run with `node scripts\u002Frun-with-timeout.js 300 \u003Ctest-cmd>`. Skips must have documented reasons.\n2. No snapshot-only tests — every test asserts specific behavior.\n3. No implementation coupling — tests don't break on internal refactors. Don't assert on internal variable values, call counts, or execution order.\n4. No test interdependence — each test runnable in isolation.\n5. Mocks are minimal — only external boundaries. Internal functions: remove the mock and test through real code.\n6. Test names are self-documenting — the describe\u002Fit tree explains behavior without reading source.\n\n## Exit Protocol\n\nDeliver:\n\n```\n## Tests Generated: {target}\n\n**Framework**: {detected framework}\n**Test file**: {path to generated test file}\n**Results**: {N passed}, {N skipped} of {N total}\n\n### Coverage\n- {function\u002Fmethod name}: {branches covered} \u002F {total branches}\n- ...\n\n### Skipped Tests\n- {test name}: {reason}\n- ...\n(or \"None — all tests pass.\")\n```\n\nIf any tests were skipped due to source bugs, call them out clearly — these are findings, not failures of test generation:\n\n```\n### Source Issues Found\n- **{file}:{line}**: {description of the bug the test exposed}\n```\n\nDo not offer to fix source bugs unless asked. The tests are the deliverable.\n",{"name":5,"license":15,"description":7,"user-invocable":46,"trigger_keywords":47},true,[48,34,40,49,24],"\u002Ftest-gen","add tests","main","e1a3d45697a0f323aaedcbea0ab6a0387b5fe722","skills\u002Ftest-gen",84,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel","https:\u002F\u002Fsethgammon.github.io\u002FCitadel\u002F","https:\u002F\u002Fgithub.com\u002FSethGammon","Building Citadel, the repo-local operating layer for Claude Code and Codex. Persistent work, routing, verification, and coordinated agent fleets.","2026-11-06 02:04:44",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":46},[61,64,67],{"tool":62,"command":63},"npx","npx skills add SethGammon\u002FCitadel --skill test-gen",{"tool":65,"command":66},"bunx","bunx skills add SethGammon\u002FCitadel --skill test-gen",{"tool":68,"command":69},"pnpm","pnpm dlx skills add SethGammon\u002FCitadel --skill test-gen","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftest-gen\u002FSKILL.md",[72,78],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"__benchmarks__\u002Fno-source.md","REFERENCE","参考文档",689,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftest-gen\u002F__benchmarks__\u002Fno-source.md",{"path":79,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":80,"sourceHtmlUrl":81},"__benchmarks__\u002Fspecific-file.md",864,"https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftest-gen\u002F__benchmarks__\u002Fspecific-file.md",[83,108,134,158,180,199],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":41},"01M6GXSBKE9A2HQWF8QRAZ4WJ5","workspace","Multi-repo campaign coordinator. Same lifecycle as fleet -- scope claims, discovery relay, wave-based execution -- but the unit of work is a repo, not a file. Coordinates campaigns across repositories with shared context.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fworkspace\u002FSKILL.md",[],[85,90,91,92,93,94,95,96,97,98,99,100,101,102,103,29,104,105,106,107],"repos","snowflake","multi-repo","work","context","campaign","coordinate","but","across","campaigns","shared","as","false","scope","unit","coordinator","fleet","claims",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":117,"publishedAt":41},"01M6GXS873AD1Y6RTM6GV47F3E","wiki","Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to ~400K words.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwiki\u002FSKILL.md",[114],{"categoryNo":115,"categoryName":116,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",[110,118,119,120,121,122,123,124,125,126,127,128,129,130,32,131,101,102,132,133],"vector","embeddings","librarian","markdown","knowledge","karpathy","knowledge management","karpathy wiki","up","files","maintain","self","knowledge base","db","sources","native",{"skillNo":135,"name":136,"nameZh":6,"description":137,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":138,"categories":139,"keywords":140,"publishedAt":41},"01M6GXS2840SJ61285SZ43EJC3","watch","File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through \u002Fdo. Use for automatic reactions to file changes; do NOT use for one-off inspection or tasks needing human judgment per file.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fwatch\u002FSKILL.md",[],[136,141,142,143,144,145,146,147,148,149,150,151,127,152,153,154,155,156,102,157],"directory","commit","tasks","git","batch","actions","start","sentinel","diff","auto","stop","do","scan","human","judgment","reactions","processing",{"skillNo":159,"name":36,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":164,"publishedAt":41},"01M6GXRXHYJ5RD9RZP81S2VFSW","Self-test the Citadel hook pipeline from within a live session. Exercises real tool calls (Write, Edit, Bash, Read) and checks that hooks fired, telemetry accumulated, and no errors occurred. Reports HOOK HEALTH: PASS or HOOK HEALTH: FAIL with a per-hook breakdown.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Fverify\u002FSKILL.md",[163],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[36,165,166,167,168,169,170,171,35,172,173,174,175,129,176,102,177,178,179,27],"citadel","telemetry","harness","pipeline","Bash","tool","read","edit","session","hooks","reports","live","hook","errors","calls",{"skillNo":181,"name":182,"nameZh":6,"description":183,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":184,"categories":185,"keywords":186,"publishedAt":41},"01M6GXRS9MCJFMQZ917H2XH3AC","unharness","Safely leave Citadel using the active adoption receipt. Produces a no-write, reviewable plan, preserves a portable archive, removes only exact owned material, and reports modified or externally registered surfaces as retained or unknown. Legacy installs must be imported before exact leave is claimed.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Funharness\u002FSKILL.md",[],[182,187,165,167,188,189,190,191,192,126,175,193,194,195,196,197,101,102,198,27],"uninstall","adoption","plan","archive","remove","only","Legacy","surfaces","clean","imported","active","material",{"skillNo":200,"name":201,"nameZh":6,"description":202,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":203,"categories":204,"keywords":213,"publishedAt":41},"01M6GXRMEJ2VHD43R9FNPD4910","triage","GitHub issue and PR investigator. Pulls open issues\u002FPRs, classifies them, searches the codebase for root cause or reviews contributed code, proposes fixes with file:line references, and optionally implements fixes. Use for investigating GitHub issues and reviewing PRs; do NOT use for general code review unrelated to GitHub issues.","https:\u002F\u002Fgithub.com\u002FSethGammon\u002FCitadel\u002Fblob\u002Fmain\u002Fskills\u002Ftriage\u002FSKILL.md",[205,208],{"categoryNo":206,"categoryName":207,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查",{"categoryNo":209,"categoryName":210,"taxonomyType":211,"taxonomyTypeDesc":212},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[201,214,215,216,217,218,219,220,221,222,223,224,225,226,152,102,227,228,229,27],"code review","review","review pr","pr","code","github issues","issues","open","use","unrelated","issue","general","references","line","investigator","reviews"]