[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758M4VS0DHKBJYZ22FQSKJS":3,"skill-same:01M758M4VS0DHKBJYZ22FQSKJS":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":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":43},"01M758M4VS0DHKBJYZ22FQSKJS","principle-test-behavior-not-implementation",null,"Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe against a literal expected value. If the test would still pass when every imported function returns undefined, rewrite the assertion or delete the test.","BainaryTD\u002Fbainary-skill","BainaryTD","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121595278?v=4","01M758GV0FS7DF77TMEYD2JPWJ","01M758GV1EY6NXCX50681D0VV4",0,"MIT","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fprinciple-test-behavior-not-implementation\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: principle-test-behavior-not-implementation\ndescription: \"Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe against a literal expected value. If the test would still pass when every imported function returns undefined, rewrite the assertion or delete the test.\"\ndisable-model-invocation: true\n---\n\n# Test Behavior, Not Implementation\n\nA test calls the code the way its users do and asserts the result they observe against a literal expected value. A test that asserts which calls the code made, or restates a constant the code contains, does neither.\n\nThe check: before you keep a test, ask whether it would still pass if every function it imports returned `undefined`. If yes, it observes no behavior and cannot fail for a defect. Rewrite the assertion or delete the test.\n\n**Why:** A test that cannot fail for a defect costs CI time and review attention and catches nothing. A constant pin also fails when someone edits the constant or the prompt it restates, so it prevents that edit.\n\n**Five shapes that still pass when every imported function returns `undefined`:**\n\n- **Weak or no assertion.** No `expect`, or only `toBeDefined`, `toBeTruthy`, `not.toThrow`, `toBeInstanceOf`, `toBeGreaterThan(0)`.\n- **Mock or absence only.** Only `toHaveBeenCalled`, `not.toHaveBeenCalled`, `toBeUndefined`, `toEqual([])`, `toHaveLength(0)`, `not.toBe(wrongValue)`.\n- **Self-referential.** The expected value comes from the code under test: `expect(f(a)).toBe(f(a))`, `expect(parsed.url).toBe(buildUrl(...))`.\n- **Constant pin.** The assertion restates a hand-maintained constant, config default, table row, or prompt string: `expect(LIMITS.maxTools).toBe(8)`, `expect(PROMPT).toContain(\"You are\")`.\n- **Fixture asserts fixture.** The assertion reads data the test built or a value computed in `beforeEach`, and the subject never runs inside the body.\n\n**The fix:** call the subject inside the test body with one concrete input and assert the literal output or the observable effect, `expect(slugify(\"Hello, World!\")).toBe(\"hello-world\")`. For an absence, assert the presence on the other input in the same test. For a constant, test the mechanism that reads it with one input instead of restating the value. For a mock, assert the payload it received or the state after the call, not that it was called. When no such assertion exists, delete the test.\n\n**Keep** a test of a relation across a table's rows (a key present in two tables, a parent that exists), and a compile-time check in a `*.test-d.ts` file.\n","# Test Behavior, Not Implementation\n\nA test calls the code the way its users do and asserts the result they observe against a literal expected value. A test that asserts which calls the code made, or restates a constant the code contains, does neither.\n\nThe check: before you keep a test, ask whether it would still pass if every function it imports returned `undefined`. If yes, it observes no behavior and cannot fail for a defect. Rewrite the assertion or delete the test.\n\n**Why:** A test that cannot fail for a defect costs CI time and review attention and catches nothing. A constant pin also fails when someone edits the constant or the prompt it restates, so it prevents that edit.\n\n**Five shapes that still pass when every imported function returns `undefined`:**\n\n- **Weak or no assertion.** No `expect`, or only `toBeDefined`, `toBeTruthy`, `not.toThrow`, `toBeInstanceOf`, `toBeGreaterThan(0)`.\n- **Mock or absence only.** Only `toHaveBeenCalled`, `not.toHaveBeenCalled`, `toBeUndefined`, `toEqual([])`, `toHaveLength(0)`, `not.toBe(wrongValue)`.\n- **Self-referential.** The expected value comes from the code under test: `expect(f(a)).toBe(f(a))`, `expect(parsed.url).toBe(buildUrl(...))`.\n- **Constant pin.** The assertion restates a hand-maintained constant, config default, table row, or prompt string: `expect(LIMITS.maxTools).toBe(8)`, `expect(PROMPT).toContain(\"You are\")`.\n- **Fixture asserts fixture.** The assertion reads data the test built or a value computed in `beforeEach`, and the subject never runs inside the body.\n\n**The fix:** call the subject inside the test body with one concrete input and assert the literal output or the observable effect, `expect(slugify(\"Hello, World!\")).toBe(\"hello-world\")`. For an absence, assert the presence on the other input in the same test. For a constant, test the mechanism that reads it with one input instead of restating the value. For a mock, assert the payload it received or the state after the call, not that it was called. When no such assertion exists, delete the test.\n\n**Keep** a test of a relation across a table's rows (a key present in two tables, a parent that exists), and a compile-time check in a `*.test-d.ts` file.\n",{"name":5,"description":7,"disable-model-invocation":23},true,"main","6e59af6cd45e52f0f16c811134303a409e90292a","skills\u002Fpstack\u002Fprinciple-test-behavior-not-implementation","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill","https:\u002F\u002Fgithub.com\u002FBainaryTD","https:\u002F\u002Fcodecrafthorizon.com","2026-10-06 12:07:04",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":23},[33,36,39],{"tool":34,"command":35},"npx","npx skills add BainaryTD\u002Fbainary-skill --skill principle-test-behavior-not-implementation",{"tool":37,"command":38},"bunx","bunx skills add BainaryTD\u002Fbainary-skill --skill principle-test-behavior-not-implementation",{"tool":40,"command":41},"pnpm","pnpm dlx skills add BainaryTD\u002Fbainary-skill --skill principle-test-behavior-not-implementation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fprinciple-test-behavior-not-implementation\u002FSKILL.md",[],[45,52,59,66,73,80],{"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},"01M758N5F1RT27WBHE9JR4693P","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Discovers available MCPs and queries each evidence category (source control, issue tracker, long-form docs, real-time chat, infrastructure observability, error tracking, product analytics warehouse) in parallel, then returns a cited read on decisions and tradeoffs. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fwhy\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},"01M758N3PPB7JET89EQ3AFF188","unslop","Cut AI tells from any writing. Must always apply.","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Funslop\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},"01M758N26N2FV8AHEEXK8XY55E","typescript-best-practices","TypeScript best practices. Use when reading or editing any .ts or .tsx file.","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Ftypescript-best-practices\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M758MZC2N6ZWDV2APPZ2RVM0","technical-writing","Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use for \u002Ftechnical-writing or when writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages.","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Ftechnical-writing\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M758MVGBVV3HSMS1S6RHFXQN","teach","Explain a body of work plainly so a person actually understands it. Runs the `how` and `why` skills and weaves what they find into one clear explanation. Use for 'teach me this', 'help me really understand X', 'explain this change or subsystem to me'.","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Fteach\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M758MQ808137A88YPFJRCMHR","tdd","Use only when the user explicitly asks for TDD, a failing test, or a regression test, OR when the bug has an obvious cheap local test target. Skip when the test path is unclear, expensive, integration-heavy, or not requested.","https:\u002F\u002Fgithub.com\u002FBainaryTD\u002Fbainary-skill\u002Fblob\u002Fmain\u002Fskills\u002Fpstack\u002Ftdd\u002FSKILL.md",[],[]]