[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M756TN7PRZNM44HWWHP10C4V":3,"skill-same:01M756TN7PRZNM44HWWHP10C4V":55},{"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":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":36,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":39,"updatedAt":40,"install":41,"resources":54},"01M756TN7PRZNM44HWWHP10C4V","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\u002Fskills\u002Fadept-writing-tests\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nid: 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)\"\nactivation: agent\nallowed-tools:\n  - \"Read\"\n  - \"Grep\"\n  - \"Edit\"\n  - \"Write\"\n  - \"Bash\"\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",{"id":5,"activation":24,"description":7,"allowed-tools":25},"agent",[26,27,28,29,30],"Read","Grep","Edit","Write","Bash","main","c5b1b81b2e0ae71bd8afeeade28eaea6f8fd1bf5",".adeptability\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":42,"prompt":52,"zipAvailable":53},[43,46,49],{"tool":44,"command":45},"npx","npx skills add itaywol\u002Fadeptability --skill adept-writing-tests",{"tool":47,"command":48},"bunx","bunx skills add itaywol\u002Fadeptability --skill adept-writing-tests",{"tool":50,"command":51},"pnpm","pnpm dlx skills add itaywol\u002Fadeptability --skill adept-writing-tests","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002F.adeptability\u002Fskills\u002Fadept-writing-tests\u002FSKILL.md",true,[],[56,62,68,73,79,85],{"skillNo":57,"name":58,"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":59,"categories":60,"keywords":61,"publishedAt":19},"01M756YHZ76TMVP0KK718K6KN0","using-adept","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fusing-adept\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"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":65,"categories":66,"keywords":67,"publishedAt":19},"01M756YG9YGBG4783SFH8RE5PM","agents","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fagents\u002FSKILL.md",[],[],{"skillNo":69,"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":70,"categories":71,"keywords":72,"publishedAt":19},"01M756YD5MDX9ANB4QPVN34YQX","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fadept-writing-tests\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"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":76,"categories":77,"keywords":78,"publishedAt":19},"01M756YB57DN31BKNT4GHM9N2S","adept-contributing","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fadept-contributing\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"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":82,"categories":83,"keywords":84,"publishedAt":19},"01M756Y9VM8W6E2HWMVYH0PH6H","adept-code-style","https:\u002F\u002Fgithub.com\u002Fitaywol\u002Fadeptability\u002Fblob\u002Fmain\u002Fskills\u002Fadept-code-style\u002FSKILL.md",[],[],{"skillNo":86,"name":58,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"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",[],[]]