spec-writing
Skill1 starsChanged 3 months agoMITView on GitHub
How to write entity Behavior cases that produce good tests. Use when adding an entity page, refining behavior during /project:interview, or splitting a vague case into testable ones. Trigger on "behavior cases", "spec", "entity behavior", "acceptance criteria", "what does this entity do".
11 other projects use a version of this.
Adopted by
Most recently taken up by
- crbnos/carbontheir own version, first seen Oct 4, 2026
- converge-ai-labs/agent-foundationtheir own version, first seen Sep 30, 2026
- aditya-deokar/software-factorytheir own version, first seen Sep 29, 2026
- mariomile/builder-ostheir own version, first seen Sep 24, 2026
- khuynh22/agent-dev-teamtheir own version, first seen Aug 31, 2026
- anyoneanderson/agent-skillstheir own version, first seen Jul 30, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- crbnos/carbon★ 2.7ksame name
- converge-ai-labs/agent-foundation★ 143same name
- itseffi/agentic-os★ 115same name
- damienlaine/agentic-sprint★ 18same name
- khuynh22/agent-dev-team★ 9same name
- Lion-1209/Lion-Skills★ 5same name
- anyoneanderson/agent-skills★ 2same name
- mariomile/builder-os★ 2same name
- aditya-deokar/software-factory★ 1same name
- bedomax/webdesigner-agent★ 1same name
1 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 repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-reviewSkill
- clean-architectureSkill
- decision-recordingSkill
- design-system-checkSkill
- feature-branchingSkill
- finding-dispositionSkill
- git-recoverySkill
- gotcha-recordingSkill
- human-checkpointSkill
- plan-reviewSkill
- plan-writingSkill
- pr-createSkill
- tdd-loopSkill
- update-toolkitSkill
- wiki-updateSkill
- worker-dispatchSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 40
Every case has a failing assertion: If you can't write it, you don't have a case.
“Common” is measured: kept by at least 6 in 10 of the 10 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
Writing Behavior Cases
Behavior cases on an entity page are the spec, and each one becomes a failing test. A vague case makes a vague test and vague code.
Read first
docs/wiki/requirements.md— the cases must serve a requirement.docs/wiki/architecture.md— the testing strategy sets the granularity (unit vs integration).- Existing entity pages in the same domain — match their phrasing.
Shape
- [ ] B<N>: When <condition>, <subject> <observable outcome>.Good:
- [ ] B1: When a user submits valid credentials, the server responds 200 and sets the session cookie.- [ ] B2: When a user submits an unknown email, the server responds 401 and sets no session cookie.- [ ] B3: When an IP has 5 failed logins in the last 60 seconds, the next attempt gets 429.
Bad: Logins work correctly. (untestable) · The login function validates inputs, hashes the password, looks up the user and returns a session. (four cases) · The login flow is fast. (no threshold).
Rules
- One observable behavior per case. An "and" or an "or" in the outcome, or a test needing two assertion groups → split it.
- When/Then. Name the trigger and the outcome.
- No implementation language. "Calls
validate_email()" is how, not what — a case is what an external caller observes. - Measurable. "Should be fast" → "completes in <200ms for ≤1KB input".
- One layer. A case at the HTTP boundary is not the case for the function behind it.
- Explicit state. "When the user is already logged in and submits the form, …".
- Errors are cases of their own, never "(also handles errors)".
- Every case has a failing assertion. If you can't write it, you don't have a case.
States and numbering
[ ] defined, no test · [~] test written and confirmed failing · [x] passing, with the wiki updated in the same commit. Each transition happens once, and a case never moves backwards: changed behavior gets a new case (the next free B<N>), and the old one is struck through with a one-line pointer to its replacement — never edit a shipped [x] case in place.
Numbers are unique per page and never reused or renumbered: append new cases at the end (B7 stays B7 even after B3 is struck). Test names, commits and logs cite them.
Tie cases to tests
## Tests
- B1 → `test_login_succeeds_with_valid_credentials`
- B2 → `test_login_fails_with_unknown_email`A test name that no longer matches its case means the spec and the tests have drifted.
After writing cases
Bump the entity's updated:, and update docs/wiki/requirements.md if a case exposes a missing requirement. The command that invoked you logs the change.
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.

