[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M756WNFEH8J3DQTMK8V2ESH7":3,"skill-same:01M756WNFEH8J3DQTMK8V2ESH7":54},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":33,"repositoryHtmlUrl":34,"repositoryHomepageUrl":35,"ownerHtmlUrl":36,"ownerBlogUrl":37,"ownerDescription":38,"updatedAt":39,"install":40,"resources":53},"01M756WNFEH8J3DQTMK8V2ESH7","adept-writing-tests",null,"How to write tests in the adept Go codebase — table-driven tests with testify, golden fixtures under testdata\u002F, the cmd\u002Fadept e2e harness, temp-dir\u002FHOME isolation, and coverage gates. Apply when adding or changing Go tests here. (matches: **\u002F*_test.go)","itaywol\u002Fadeptability","itaywol","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6410154?v=4","01M756SKJABTDMYHWVMHBA0M6E","Itay Wolfish","01M756SKKJFSV073PS3KYR896D",9,"MIT","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002F.adeptability\u002Fstaging\u002Fskills\u002Fadept-writing-tests\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: adept-writing-tests\ndescription: 'How to write tests in the adept Go codebase — table-driven tests with testify, golden fixtures under testdata\u002F, the cmd\u002Fadept e2e harness, temp-dir\u002FHOME isolation, and coverage gates. Apply when adding or changing Go tests here. (matches: **\u002F*_test.go)'\nallowed-tools: [Read, Grep, Edit, Write, Bash]\n---\n\n\n# Writing tests for adept\n\n## Defaults\n\n- **Table-driven** tests with `github.com\u002Fstretchr\u002Ftestify\u002Frequire`. One `t.Run(tc.name, …)`\n  per case; name cases for the behavior they pin.\n- Put unit tests in the same package (`package foo`) for white-box access; use\n  `package foo_test` when you want to assert only the public surface.\n- Use `t.TempDir()` for any filesystem work — never write into the repo or a shared path.\n- No network in unit tests. Use `net\u002Fhttp\u002Fhttptest` for HTTP clients, and the package's\n  interfaces + fakes for `git`, the registry, and the LLM provider (see how `Deps` is wired).\n\n## Golden fixtures\n\nRenderers are pinned by golden files in each `internal\u002Frender\u002F\u003Cid>\u002Ftestdata\u002F`. When you\nchange rendered output **on purpose**:\n\n1. Update the fixture in the same PR.\n2. Explain why in the commit message.\n\nNever loosen an assertion to make a diff pass — fix the code or update the golden deliberately.\n\n## End-to-end tests\n\n`cmd\u002Fadept\u002F*_test.go` build the real binary and drive commands against temp dirs with an\nisolated environment:\n\n```go\nenv := []string{\n    \"PATH=\" + os.Getenv(\"PATH\"),\n    \"HOME=\" + t.TempDir(),          \u002F\u002F isolate user config\n    \"ADEPT_LIBRARY=\" + libRoot,     \u002F\u002F isolate the library\n}\n```\n\nGuard the slow ones so `go test -short` skips them:\n\n```go\nif testing.Short() { t.Skip(\"skipping e2e under -short\") }\n```\n\nAssert on **observable behavior** — exit codes, files on disk, stdout\u002FJSON — not internals.\nExit codes: `0` clean · `1` error · `2` drift\u002Fdirty or merge conflict.\n\n## Run them\n\n```bash\ngo test .\u002F...                  # fast\ngo test -race .\u002F...            # CI gate\ngo test -run E2E .\u002Fcmd\u002Fadept   # e2e only\ngo test -cover .\u002F...           # per-package coverage\n```\n\n## Coverage gates\n\nKeep ≥80% on `internal\u002Frender`, `internal\u002Fstatus`, `internal\u002Fbudget`, `internal\u002Flocks`, and\n`internal\u002Fcanonical`. Prefer tests that would actually catch a regression (error paths, edge\ncases, round-trips) over coverage-padding happy-path calls.\n","# Writing tests for adept\n\n## Defaults\n\n- **Table-driven** tests with `github.com\u002Fstretchr\u002Ftestify\u002Frequire`. One `t.Run(tc.name, …)`\n  per case; name cases for the behavior they pin.\n- Put unit tests in the same package (`package foo`) for white-box access; use\n  `package foo_test` when you want to assert only the public surface.\n- Use `t.TempDir()` for any filesystem work — never write into the repo or a shared path.\n- No network in unit tests. Use `net\u002Fhttp\u002Fhttptest` for HTTP clients, and the package's\n  interfaces + fakes for `git`, the registry, and the LLM provider (see how `Deps` is wired).\n\n## Golden fixtures\n\nRenderers are pinned by golden files in each `internal\u002Frender\u002F\u003Cid>\u002Ftestdata\u002F`. When you\nchange rendered output **on purpose**:\n\n1. Update the fixture in the same PR.\n2. Explain why in the commit message.\n\nNever loosen an assertion to make a diff pass — fix the code or update the golden deliberately.\n\n## End-to-end tests\n\n`cmd\u002Fadept\u002F*_test.go` build the real binary and drive commands against temp dirs with an\nisolated environment:\n\n```go\nenv := []string{\n    \"PATH=\" + os.Getenv(\"PATH\"),\n    \"HOME=\" + t.TempDir(),          \u002F\u002F isolate user config\n    \"ADEPT_LIBRARY=\" + libRoot,     \u002F\u002F isolate the library\n}\n```\n\nGuard the slow ones so `go test -short` skips them:\n\n```go\nif testing.Short() { t.Skip(\"skipping e2e under -short\") }\n```\n\nAssert on **observable behavior** — exit codes, files on disk, stdout\u002FJSON — not internals.\nExit codes: `0` clean · `1` error · `2` drift\u002Fdirty or merge conflict.\n\n## Run them\n\n```bash\ngo test .\u002F...                  # fast\ngo test -race .\u002F...            # CI gate\ngo test -run E2E .\u002Fcmd\u002Fadept   # e2e only\ngo test -cover .\u002F...           # per-package coverage\n```\n\n## Coverage gates\n\nKeep ≥80% on `internal\u002Frender`, `internal\u002Fstatus`, `internal\u002Fbudget`, `internal\u002Flocks`, and\n`internal\u002Fcanonical`. Prefer tests that would actually catch a regression (error paths, edge\ncases, round-trips) over coverage-padding happy-path calls.\n",{"name":5,"description":7,"allowed-tools":24},[25,26,27,28,29],"Read","Grep","Edit","Write","Bash","main","c5b1b81b2e0ae71bd8afeeade28eaea6f8fd1bf5",".adeptability\u002Fstaging\u002Fskills\u002Fadept-writing-tests",0,"https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability","https:\u002F\u002Fpkg.go.dev\u002Fgithub.com\u002Fitaywol\u002Fadeptability","https:\u002F\u002Fgithub.com\u002Fitaywol","https:\u002F\u002Fitaywol.com","Founding Engineer @ Echo","2026-07-25 15:28:37",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add itaywol\u002Fadeptability --skill adept-writing-tests",{"tool":46,"command":47},"bunx","bunx skills add itaywol\u002Fadeptability --skill adept-writing-tests",{"tool":49,"command":50},"pnpm","pnpm dlx skills add itaywol\u002Fadeptability --skill adept-writing-tests","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002F.adeptability\u002Fstaging\u002Fskills\u002Fadept-writing-tests\u002FSKILL.md",true,[],[55,61,67,72,78,84],{"skillNo":56,"name":57,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M756YHZ76TMVP0KK718K6KN0","using-adept","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fusing-adept\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M756YG9YGBG4783SFH8RE5PM","agents","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fagents\u002FSKILL.md",[],[],{"skillNo":68,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M756YD5MDX9ANB4QPVN34YQX","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fadept-writing-tests\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M756YB57DN31BKNT4GHM9N2S","adept-contributing","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fadept-contributing\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M756Y9VM8W6E2HWMVYH0PH6H","adept-code-style","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fadept-code-style\u002FSKILL.md",[],[],{"skillNo":85,"name":57,"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":19},"01M756Y76FNSH8VWP77TX1A8Z1","Use the `adept` CLI to author an AI skill once and render it into Claude Code, Cursor, Codex, Copilot, OpenCode, and 45+ agents. Apply when installing\u002Fsyncing skills, editing SKILL.md, or touching .adeptability\u002F.","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Finternal\u002Fdefaultskills\u002Fassets\u002Fusing-adept\u002FSKILL.md",[],[]]