Adept writing tests
Skill itaywol/adeptability/.adeptability/staging/skills/adept-writing-tests
How to write tests in the adept Go codebase — table-driven tests with testify, golden fixtures under testdata/, the cmd/adept e2e harness, temp-dir/HOME isolation, and coverage gates. Apply when adding or changing Go tests here. (matches: **/*_test.go)From its SKILL.md
npx -y skills add itaywol/adeptability --skill adept-writing-testsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 9 stars9 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.3 KB, 512 tokens by cl100k_base, as published. Nobody here has run it
Writing tests for adept
Defaults
- Table-driven tests with
github.com/stretchr/testify/require. Onet.Run(tc.name, …)per case; name cases for the behavior they pin. - Put unit tests in the same package (
package foo) for white-box access; usepackage foo_testwhen you want to assert only the public surface. - Use
t.TempDir()for any filesystem work — never write into the repo or a shared path. - No network in unit tests. Use
net/http/httptestfor HTTP clients, and the package's interfaces + fakes forgit, the registry, and the LLM provider (see howDepsis wired).
Golden fixtures
Renderers are pinned by golden files in each internal/render/<id>/testdata/. When you
change rendered output on purpose:
- Update the fixture in the same PR.
- Explain why in the commit message.
Never loosen an assertion to make a diff pass — fix the code or update the golden deliberately.
End-to-end tests
cmd/adept/*_test.go build the real binary and drive commands against temp dirs with an
isolated environment:
env := []string{
"PATH=" + os.Getenv("PATH"),
"HOME=" + t.TempDir(), // isolate user config
"ADEPT_LIBRARY=" + libRoot, // isolate the library
}
Guard the slow ones so go test -short skips them:
if testing.Short() { t.Skip("skipping e2e under -short") }
Assert on observable behavior — exit codes, files on disk, stdout/JSON — not internals.
Exit codes: 0 clean · 1 error · 2 drift/dirty or merge conflict.
Run them
go test ./... # fast
go test -race ./... # CI gate
go test -run E2E ./cmd/adept # e2e only
go test -cover ./... # per-package coverage
Coverage gates
Keep ≥80% on internal/render, internal/status, internal/budget, internal/locks, and
internal/canonical. Prefer tests that would actually catch a regression (error paths, edge
cases, round-trips) over coverage-padding happy-path calls.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most docs writing skills give in 512 tokens
Counted across 1,637 of the 3,044 authors here whose files we hold, read 2026-08-07
- Announce the skill at startin 54 of 1637, across 26 files
- Convert legacy doc files before editingin 45 of 1637, across 7 files
- Predict questions readers might askin 42 of 1637, across 4 files
- Generate clarifying questions for initial contextin 42 of 1637, across 3 files
- Create document scaffold with placeholder textin 42 of 1637, across 3 files
- Brainstorm content options for each sectionin 42 of 1637, across 3 files
- Test the document with a fresh context-less instancein 42 of 1637, across 3 files
- Include exact file paths in every taskin 42 of 1637, across 15 files
- Ask interview questions one at a timein 42 of 1637, across 27 files
- Apply surgical edits during refinementin 41 of 1637, across 2 files
- Offer structured workflow or freeformin 40 of 1637, across 1 file
- Ask for document meta-contextin 40 of 1637, across 2 files
Said here and by no other author read
- run one subtest per case
- name cases for the pinned behavior
- place unit tests in the same package for white-box access
- use t.TempDir() for filesystem work
- skip slow end-to-end tests under the short flag
- update golden fixtures when changing rendered output
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.