test-gen
Skill4 starsChanged 4 months agoMITView on GitHub
Generate and verify tests — happy path, edge cases, error paths — using the project's own framework and patterns
15 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- SethGammon/Citadelword for word, first seen Nov 4, 2026
- chidekina/aria-superpowerstheir own version, first seen Oct 13, 2026
- allysgrandiose674/Armoryedited, first seen Oct 13, 2026
- AllThingsSmitty/proven-skillstheir own version, first seen Oct 6, 2026
- ngc-shj/claude-code-configtheir own version, first seen Aug 31, 2026
- Jinbae10/skillstheir own version, first seen Jul 7, 2026
Other versions15 projects use a version of this.
Word for word · 1
- SethGammon/Citadel★ 927100% same
Edited · 2
- SethGammon/Armory★ 1925% same
- allysgrandiose674/Armory★ 125% same
Wrote their own version · 12
- EvildoerXiaoyy/reasonix-skills★ 4same name
- kronus-tech/kronus★ 4same name
- chidekina/aria-superpowers★ 2same name
- liogogogo/claude-code-enhancement★ 2same name
- Pradnyeshp/Claude-Skills★ 2same name
- AllThingsSmitty/proven-skills★ 1same name
- ngc-shj/claude-code-config★ 1same name
- 354685856-sn/claude-code-skills★ 0same name
- Jinbae10/skills★ 0same name
- MrCipherSmith/goodai-base★ 0same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectSkill
- archonSkill
- ascii-diagramSkill
- autopilotSkill
- costSkill
- create-appSkill
- create-skillSkill
- daemonSkill
- dashboardSkill
- decision-mapSkill
- deploy-stewardSkill
- designSkill
- doc-genSkill
- doSkill
- evolveSkill
- experimentSkill
- fleetSkill
- grillSkill
- housecleanSkill
- improveSkill
- infra-auditSkill
- learnSkill
- live-previewSkill
- loopSkill
- mapSkill
- marshalSkill
- merge-reviewSkill
- organizeSkill
- postmortemSkill
- prdSkill
- pr-watchSkill
- qaSkill
- refactorSkill
- research-fleetSkill
- researchSkill
- reviewSkill
- scaffoldSkill
- scheduleSkill
- session-handoffSkill
- setupSkill
- systematic-debuggingSkill
- telemetrySkill
- triageSkill
- unharnessSkill
- verifySkill
- watchSkill
- wikiSkill
- workspaceSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 11 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
11
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Never modify the source code to make tests pass.
- Distinctive: line 49
Write the test file following the project's exact patterns.
- Distinctive: line 53
Verify return value AND expected side effects
- Distinctive: line 66
Verify error type/message, not just that it throws
- Distinctive: line 70
Do NOT mock: internal utilities, data transformations, pure functions, the module under test
- Very specific: line 71
Prefer fakes over mocks when available.
- Very specific: line 79
Run only the generated file.
- Distinctive: line 83
If a coverage tool is configured, run it for the target file.
- Very specific: line 94
All tests pass — final run with node scripts/run-with-timeout.js 300 <test-cmd>.
- Distinctive: line 95
No snapshot-only tests — every test asserts specific behavior.
- Distinctive: line 96
No implementation coupling — tests don't break on internal refactors.
- Distinctive: line 97
No test interdependence — each test runnable in isolation.
- Distinctive: line 99
Test names are self-documenting — the describe/it tree explains behavior without reading source.
- Distinctive: line 122
If any tests were skipped due to source bugs, call them out clearly — these are findings, not failures of test generation:
- Distinctive: line 129
Do not offer to fix source bugs unless asked.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Identity
You write tests that run on the first try. Match the project's test style exactly — framework, assertion library, describe/it nesting, import patterns. Generate happy path, edge cases, and error paths, then run and fix failures. Never ship a red suite. Mock only external services, I/O, and time.
Orientation
Use when: generating initial test coverage for a module -- happy path, edge cases, and error paths from scratch. Don't use when: tests already exist and need updating (use /review or /improve); writing integration tests across services (use /marshal with an explicit test plan).
Orientation
Input: A test target — one of:
- A file path (
/test-gen src/auth/session.ts) - A specific function (
/test-gen src/auth/session.ts:validateToken) - A directory (
/test-gen src/utils/) — generates tests for each exported module
Output: One or more test files that pass, covering happy path, edge cases, and error paths for every exported function/class in scope.
Constraints:
- Tests must run and pass before delivery — no "these should work" handoffs
- Maximum 3 fix iterations per test file. If a test still fails after 3 attempts, mark it as
.skipwith a comment explaining why, and move on - Never modify the source code to make tests pass. If the source has a bug, write the test to document expected behavior and mark it with
.todoor.skipplus a note
Protocol
Step 1 — Detect test framework
Check config files (jest.config.*, vitest.config.*, pytest.ini, etc.), package.json devDependencies, and the nearest existing test file. Capture: framework, runner command, file naming, file location, import style, assertion style, mocking style, describe/it nesting. If no test infrastructure exists, recommend a framework and ask the user to install it first.
Step 2 — Analyze the target
For each exported function/class/method, extract: signature, branches (if/switch/ternary/try/catch/early return), dependencies (internal vs external), side effects, error conditions. Map every branch to at least one test case before writing code.
Step 3 — Generate tests
Write the test file following the project's exact patterns. Organize into three sections per function:
Happy Path
- Primary use case with typical, valid input; multiple input shapes if behavior differs
- Verify return value AND expected side effects
Edge Cases
- Boundary values: 0, 1, -1, empty string/array/object, MAX_SAFE_INTEGER, very long strings
- Null/undefined for every parameter that could receive them (only if reachable given the type system)
- Collection: empty, single element, duplicates, very large
- String: whitespace-only, unicode, special characters
- Concurrent access if function manages shared state
Error Paths
- Invalid input (at untyped boundaries), out-of-range values, malformed data
- Dependency failures: throws, returns null, times out, unexpected data
- State precondition violations: wrong method order, closed/disposed resources
- Verify error type/message, not just that it throws
Mocking rules
- Mock: HTTP clients, DB connections, file system, timers, random number generators
- Do NOT mock: internal utilities, data transformations, pure functions, the module under test
- Prefer fakes over mocks when available. Reset mocks in
beforeEach/afterEach. Type mocks to match the real interface.
Step 4 — Write the test file
One file per source file. Group with describe blocks per function/class. Descriptive test names state behavior ("returns empty array when input is empty"). Shared fixtures in beforeEach. Each test independent. Extract helpers for setups over 15 lines.
Step 5 — Run and verify
Run only the generated file. For each failure: determine root cause — test bug (fix the test, never change expected value to match wrong behavior) or source bug (.skip with // SKIP: source bug — {description}). Up to 3 iterations. After 3 failed attempts: .skip with // SKIP: could not resolve after 3 attempts — {last error}.
Step 6 — Coverage check
If a coverage tool is configured, run it for the target file. Add tests for meaningful uncovered branches. Skip if no coverage tool exists — do not install one.
Contextual Gates
Disclosure: "Generating tests for [target]. Creates new test files; no existing files modified." Reversibility: green — creates new test files only; delete the generated test files to undo Trust gates:
- Any: generate tests for any target file or directory
Quality Gates
- All tests pass — final run with
node scripts/run-with-timeout.js 300 <test-cmd>. Skips must have documented reasons. - No snapshot-only tests — every test asserts specific behavior.
- No implementation coupling — tests don't break on internal refactors. Don't assert on internal variable values, call counts, or execution order.
- No test interdependence — each test runnable in isolation.
- Mocks are minimal — only external boundaries. Internal functions: remove the mock and test through real code.
- Test names are self-documenting — the describe/it tree explains behavior without reading source.
Exit Protocol
Deliver:
## Tests Generated: {target}
**Framework**: {detected framework}
**Test file**: {path to generated test file}
**Results**: {N passed}, {N skipped} of {N total}
### Coverage
- {function/method name}: {branches covered} / {total branches}
- ...
### Skipped Tests
- {test name}: {reason}
- ...
(or "None — all tests pass.")If any tests were skipped due to source bugs, call them out clearly — these are findings, not failures of test generation:
### Source Issues Found
- **{file}:{line}**: {description of the bug the test exposed}Do not offer to fix source bugs unless asked. The tests are the deliverable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

