[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78CG9XW7KDMSQNWVPCKGJMW":3,"skill-same:01M78CG9XW7KDMSQNWVPCKGJMW":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M78CG9XW7KDMSQNWVPCKGJMW","test",null,"Use when writing or reviewing tests, or when asked how to write a good single test. Encodes the per-test rules behind the \"test the contract \u002F responsibility, not the implementation\" principle — name and structure one behavior per `it`, drive through the public surface, stub only true external boundaries, control time and config via documented knobs, and keep tests clear, isolated, and refactor-resilient. The same rules drive both authoring (write mode) and auditing existing tests (review mode).","NitrogenT7\u002Fkimi-code-security","NitrogenT7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F289338396?v=4","01M78CFQ0EEM77XTKQSACG4MCE","01M78CFQ17MCHBS0YCKT2SCBYN",19,"MIT","https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fagent-core-review\u002Ftest\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: test\ndescription: Use when writing or reviewing tests, or when asked how to write a good single test. Encodes the per-test rules behind the \"test the contract \u002F responsibility, not the implementation\" principle — name and structure one behavior per `it`, drive through the public surface, stub only true external boundaries, control time and config via documented knobs, and keep tests clear, isolated, and refactor-resilient. The same rules drive both authoring (write mode) and auditing existing tests (review mode).\n---\n\n# Tests — write & review\n\nPer-test rules that operationalize one principle: **test the contract \u002F responsibility, not the implementation**. This is the how-to for a single `it`, and the lens for reviewing one.\n\n## Two modes, one rule set\n\n- **Write mode** — authoring a test. Apply the rules below to produce it.\n- **Review mode** — auditing an existing test or test diff. Apply the same rules as a checklist; report each violation with `file:line`, the rule it breaks, and the fix. See \"Review mode\" near the end.\n\nThe rules are identical in both modes — only the posture changes (produce vs. audit).\n\n## Test contract, not implementation\n\n- Drive the system through its **public control plane** and assert on **observable effects** (returned values, persisted state, emitted events, injected messages), never on source details.\n- Resolve collaborators through their contract — the interface plus its identifier — not the module that binds a concrete implementation.\n- Do not reach into private fields or add backdoors \"for testing\". If you feel the need, the seam is wrong — fix the design, not the test.\n\n## One behavior per `it`\n\nEach `it` covers exactly one responsibility \u002F scenario. If the name needs \"and\", split it.\n\n```ts\nit('returns 401 when the caller is unauthorized', ...);\nit('does not double-fire when the same tick repeats', ...);\n```\n\n## Name and structure\n\n- `describe('\u003Cslice> (\u003Cresponsibilities>)'` — name the **responsibility**, not the class.\n- An `it(...)` reads as a sentence, but it must still encode three things — the **behavior \u002F method**, the **state or condition**, and the **expected outcome**: `it('\u003Cbehavior> when \u003Ccondition>, \u003Coutcome>')`. A name like `does X when Y` with no result is too vague to fail usefully.\n  - Use spaces, not the Java-style `method_state_outcome` underscores — that convention exists only because Java test methods cannot contain spaces. A string-named test reads fine as a sentence.\n  - Good: `it('returns 401 when the caller is unauthorized')` · `it('advances the cursor and does not double-fire on a repeat tick')`\n  - Bad: `it('works')` · `it('handles auth correctly')` — no condition, no outcome\n- Arrange \u002F Act \u002F Assert. A short `\u002F\u002F Given` `\u002F\u002F When` `\u002F\u002F Then` is fine when it aids reading; do not paste it mechanically on trivial tests.\n\n## Build a small rig\n\nWhen several tests share setup, write a factory (`rig()`, `createHost()`, whatever fits the codebase) that returns the **smallest surface the test needs**. Tests reach into the rig; they do not rebuild the world each time. Keep the rig dumb: wiring only, no assertions.\n\n## Stub only the real external boundary\n\nDefault to real collaborators wired the way production wires them. Stub the **minimum seam** that is genuinely external:\n\n- A remote \u002F model \u002F service boundary — spy on the contract method (the interface), and capture what the system sends across it. Do not stand up the real external thing.\n- Network \u002F other-process boundaries — stub at the boundary, not the internals.\n- Time, timers, jitter — use the documented control knobs the system exposes (env, an injected clock, a manual tick). Do **not** use fake timers or real `setTimeout` to drive time.\n- Env \u002F config knobs are usually snapshotted at bootstrap — set them **before** building the system under test, and restore them in `afterEach`.\n\n## Keep tests DAMP and keep cause next to effect\n\n- DAMP over DRY: use **literal expected values** in assertions; do not compute the expectation with the same logic as the code under test.\n- Keep the key preconditions inside the `it` (or its rig), where the reader can see cause next to effect. Reserve `beforeEach` for cross-cutting plumbing (env snapshot, cleanup), not for hiding the scenario's setup.\n\n```ts\n\u002F\u002F Good — the expected value is a literal the reader can check.\nexpect(discount).toBe(15);\n\u002F\u002F Bad — re-derives the expectation; mirrors the implementation.\nexpect(discount).toBe(price * rate);\n```\n\n## Assert only what is relevant\n\nAssert the effect that proves the contract. Use matchers \u002F partial-object matching to ignore incidental fields. Do not assert internal counters, call orders, or shapes the user cannot rely on.\n\n## Isolate and clean up (no flakes)\n\nEvery test must be hermetic and order-independent. In `afterEach`:\n\n- restore every mock \u002F spy\n- restore every env var you touched (snapshot in `beforeEach`)\n- dispose the host \u002F container and reset its reference\n\nNo dependence on wall-clock time, run order, or leftover on-disk state — give each scenario its own isolated identity \u002F workspace when state persists.\n\n## Quality bar: CCCR\n\nBefore finishing, check each test against:\n\n- **Clarity** — a stranger can tell what broke from the failure message alone.\n- **Completeness** — covers the responsibility's success, error, and boundary paths.\n- **Conciseness** — no duplicate or speculative cases; one scenario per `it`.\n- **Resilience** — survives an internal refactor with no test change (because it asserts contract, not implementation).\n\n## Per-file scenario header\n\nStart each test file with a short header comment: the **scenario**, the **responsibilities** asserted, the **wiring** (which collaborators are real vs. the single stubbed boundary), and how to run it.\n\n## Review mode — auditing existing tests\n\nApply the rules above as a checklist against each test in scope (a file, a diff, or a named `it`). For every hit, report `file:line` + the rule it breaks + the fix; do not rewrite unless asked. Lead with the contract question: *what observable behavior does this test prove, and would it survive a refactor?*\n\nCheck, in order:\n\n1. **Contract, not implementation** — asserts observable effects, not private fields, call order, or internal shapes the user cannot rely on.\n2. **One behavior per `it`** — the name carries behavior + condition + outcome; \"and\" in the name means a split is owed.\n3. **Boundary discipline** — only the true external seam is stubbed; time is driven by documented knobs, not fake timers \u002F real `setTimeout`.\n4. **DAMP expectations** — expected values are literals, not re-derived by the code under test's logic.\n5. **Isolation** — mocks \u002F spies \u002F env \u002F host restored in `afterEach`; no wall-clock, run-order, or leftover on-disk dependence.\n6. **CCCR read-through** — Clarity, Completeness (success \u002F error \u002F boundary), Conciseness, Resilience.\n\nReport findings as evidence + fix, e.g. \"`foo.test.ts:42` asserts on `service.internalMap` (contract) — assert the returned value instead.\" If a test passes the lens, say so briefly; silence on a rule means it held.\n\n## Quick checklist (write & review)\n\n- Resolved through the contract; no concrete-impl import\n- One behavior per `it`; name carries behavior + condition + outcome; AAA\n- Stubbed only the true external seam; time via knobs, not fake timers\n- Literal expectations; relevant assertions only\n- Mocks \u002F env \u002F host restored in `afterEach`; hermetic, no flakes\n- CCCR read-through done\n","# Tests — write & review\n\nPer-test rules that operationalize one principle: **test the contract \u002F responsibility, not the implementation**. This is the how-to for a single `it`, and the lens for reviewing one.\n\n## Two modes, one rule set\n\n- **Write mode** — authoring a test. Apply the rules below to produce it.\n- **Review mode** — auditing an existing test or test diff. Apply the same rules as a checklist; report each violation with `file:line`, the rule it breaks, and the fix. See \"Review mode\" near the end.\n\nThe rules are identical in both modes — only the posture changes (produce vs. audit).\n\n## Test contract, not implementation\n\n- Drive the system through its **public control plane** and assert on **observable effects** (returned values, persisted state, emitted events, injected messages), never on source details.\n- Resolve collaborators through their contract — the interface plus its identifier — not the module that binds a concrete implementation.\n- Do not reach into private fields or add backdoors \"for testing\". If you feel the need, the seam is wrong — fix the design, not the test.\n\n## One behavior per `it`\n\nEach `it` covers exactly one responsibility \u002F scenario. If the name needs \"and\", split it.\n\n```ts\nit('returns 401 when the caller is unauthorized', ...);\nit('does not double-fire when the same tick repeats', ...);\n```\n\n## Name and structure\n\n- `describe('\u003Cslice> (\u003Cresponsibilities>)'` — name the **responsibility**, not the class.\n- An `it(...)` reads as a sentence, but it must still encode three things — the **behavior \u002F method**, the **state or condition**, and the **expected outcome**: `it('\u003Cbehavior> when \u003Ccondition>, \u003Coutcome>')`. A name like `does X when Y` with no result is too vague to fail usefully.\n  - Use spaces, not the Java-style `method_state_outcome` underscores — that convention exists only because Java test methods cannot contain spaces. A string-named test reads fine as a sentence.\n  - Good: `it('returns 401 when the caller is unauthorized')` · `it('advances the cursor and does not double-fire on a repeat tick')`\n  - Bad: `it('works')` · `it('handles auth correctly')` — no condition, no outcome\n- Arrange \u002F Act \u002F Assert. A short `\u002F\u002F Given` `\u002F\u002F When` `\u002F\u002F Then` is fine when it aids reading; do not paste it mechanically on trivial tests.\n\n## Build a small rig\n\nWhen several tests share setup, write a factory (`rig()`, `createHost()`, whatever fits the codebase) that returns the **smallest surface the test needs**. Tests reach into the rig; they do not rebuild the world each time. Keep the rig dumb: wiring only, no assertions.\n\n## Stub only the real external boundary\n\nDefault to real collaborators wired the way production wires them. Stub the **minimum seam** that is genuinely external:\n\n- A remote \u002F model \u002F service boundary — spy on the contract method (the interface), and capture what the system sends across it. Do not stand up the real external thing.\n- Network \u002F other-process boundaries — stub at the boundary, not the internals.\n- Time, timers, jitter — use the documented control knobs the system exposes (env, an injected clock, a manual tick). Do **not** use fake timers or real `setTimeout` to drive time.\n- Env \u002F config knobs are usually snapshotted at bootstrap — set them **before** building the system under test, and restore them in `afterEach`.\n\n## Keep tests DAMP and keep cause next to effect\n\n- DAMP over DRY: use **literal expected values** in assertions; do not compute the expectation with the same logic as the code under test.\n- Keep the key preconditions inside the `it` (or its rig), where the reader can see cause next to effect. Reserve `beforeEach` for cross-cutting plumbing (env snapshot, cleanup), not for hiding the scenario's setup.\n\n```ts\n\u002F\u002F Good — the expected value is a literal the reader can check.\nexpect(discount).toBe(15);\n\u002F\u002F Bad — re-derives the expectation; mirrors the implementation.\nexpect(discount).toBe(price * rate);\n```\n\n## Assert only what is relevant\n\nAssert the effect that proves the contract. Use matchers \u002F partial-object matching to ignore incidental fields. Do not assert internal counters, call orders, or shapes the user cannot rely on.\n\n## Isolate and clean up (no flakes)\n\nEvery test must be hermetic and order-independent. In `afterEach`:\n\n- restore every mock \u002F spy\n- restore every env var you touched (snapshot in `beforeEach`)\n- dispose the host \u002F container and reset its reference\n\nNo dependence on wall-clock time, run order, or leftover on-disk state — give each scenario its own isolated identity \u002F workspace when state persists.\n\n## Quality bar: CCCR\n\nBefore finishing, check each test against:\n\n- **Clarity** — a stranger can tell what broke from the failure message alone.\n- **Completeness** — covers the responsibility's success, error, and boundary paths.\n- **Conciseness** — no duplicate or speculative cases; one scenario per `it`.\n- **Resilience** — survives an internal refactor with no test change (because it asserts contract, not implementation).\n\n## Per-file scenario header\n\nStart each test file with a short header comment: the **scenario**, the **responsibilities** asserted, the **wiring** (which collaborators are real vs. the single stubbed boundary), and how to run it.\n\n## Review mode — auditing existing tests\n\nApply the rules above as a checklist against each test in scope (a file, a diff, or a named `it`). For every hit, report `file:line` + the rule it breaks + the fix; do not rewrite unless asked. Lead with the contract question: *what observable behavior does this test prove, and would it survive a refactor?*\n\nCheck, in order:\n\n1. **Contract, not implementation** — asserts observable effects, not private fields, call order, or internal shapes the user cannot rely on.\n2. **One behavior per `it`** — the name carries behavior + condition + outcome; \"and\" in the name means a split is owed.\n3. **Boundary discipline** — only the true external seam is stubbed; time is driven by documented knobs, not fake timers \u002F real `setTimeout`.\n4. **DAMP expectations** — expected values are literals, not re-derived by the code under test's logic.\n5. **Isolation** — mocks \u002F spies \u002F env \u002F host restored in `afterEach`; no wall-clock, run-order, or leftover on-disk dependence.\n6. **CCCR read-through** — Clarity, Completeness (success \u002F error \u002F boundary), Conciseness, Resilience.\n\nReport findings as evidence + fix, e.g. \"`foo.test.ts:42` asserts on `service.internalMap` (contract) — assert the returned value instead.\" If a test passes the lens, say so briefly; silence on a rule means it held.\n\n## Quick checklist (write & review)\n\n- Resolved through the contract; no concrete-impl import\n- One behavior per `it`; name carries behavior + condition + outcome; AAA\n- Stubbed only the true external seam; time via knobs, not fake timers\n- Literal expectations; relevant assertions only\n- Mocks \u002F env \u002F host restored in `afterEach`; hermetic, no flakes\n- CCCR read-through done\n",{"name":5,"description":7},"main","cac122702fd7c1bb910d4331d42d31f4d65ef199",".agents\u002Fskills\u002Fagent-core-review\u002Ftest",1,"https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security","https:\u002F\u002Fgithub.com\u002FNitrogenT7","2026-09-23 16:08:07",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add NitrogenT7\u002Fkimi-code-security --skill test",{"tool":36,"command":37},"bunx","bunx skills add NitrogenT7\u002Fkimi-code-security --skill test",{"tool":39,"command":40},"pnpm","pnpm dlx skills add NitrogenT7\u002Fkimi-code-security --skill test","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fagent-core-review\u002Ftest\u002FSKILL.md",true,[],[45,52,59,66,72,79],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":18},"01M78CM022SAPQANCX0CYBBZD8","kimi-webbridge","Kimi WebBridge lets AI control the user's real browser — navigate, click, type, read, screenshot, and interact with any website using the user's actual login sessions. Use this skill whenever the user wants to interact with websites, automate browser tasks, scrape web content, or perform any action requiring a real browser. Also use when the user mentions \"browser\", \"webpage\", \"open URL\", \"screenshot\", or asks to read\u002Finteract with any website. Use even for simple-sounding browser requests — the daemon handles all complexity.","https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002Fplugins\u002Fofficial\u002Fkimi-webbridge\u002Fskills\u002Fkimi-webbridge\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M78CKTEFA3QGTBQ3XYAKMCRK","kimi-datasource","Universal data-source assistant for stocks (Wind, S&P, SEC EDGAR), macro (World Bank, IMF, FRED, NBS), Chinese government data and standards (GB\u002FHB\u002FDB\u002FTT), corporate, academic, legal, WHO\u002FFAO\u002FOECD and other IGO data, financial news (Xinhua, Caixin).\nThis plugin exposes tools via MCP server `plugin-kimi-datasource_data`; call them in the flow `mcp__plugin-kimi-datasource_data__get_data_source_desc` → `mcp__plugin-kimi-datasource_data__call_data_source_tool`.","https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002Fplugins\u002Fofficial\u002Fkimi-datasource\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M78CKSF8Q6FGM97MJ7ZD095K","golden-skill","Golden fixture skill","https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002Fpackages\u002Fmigration-legacy\u002Ftest\u002Ffixtures\u002Fgolden\u002F.kimi\u002Fskills\u002Fgolden-skill\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":18},"01M78CKRHACG31TNA9266YY8YR","tools","https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002Fpackages\u002Fagent-core-v2\u002Fsrc\u002Ffeatures\u002Fskill\u002Ftools\u002Fskill.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M78CKNZ2549R5P70N4JMT1FT","review","Analyze the available skill set and recommend candidate groups that could be consolidated into sub-skill bundles. Read-only — proposes a plan, does not move files.","https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002Fpackages\u002Fagent-core-v2\u002Fsrc\u002Ffeatures\u002Fskill\u002Fcatalog\u002Fbuiltin\u002Fsub-skill\u002Freview\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M78CKKHZZHB0BEY72HXGTJE6","consolidate","Apply an approved sub-skill grouping by moving user-specified skills into a parent bundle, with timestamped backups of every modified directory.","https:\u002F\u002Fgithub.com\u002FNitrogenT7\u002Fkimi-code-security\u002Fblob\u002Fmain\u002Fpackages\u002Fagent-core-v2\u002Fsrc\u002Ffeatures\u002Fskill\u002Fcatalog\u002Fbuiltin\u002Fsub-skill\u002Fconsolidate\u002FSKILL.md",[],[]]