code-contracts
Skill9 starsChanged 2 months agoApache-2.0View on GitHub
Use when code contains @cc or CONTRACTS, when the user asks to record obligations beside code, or when contract compliance must be verified.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ghuntley/loomtheir own version, first seen Oct 17, 2026
- dust-tt/dusttheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- ghuntley/loom★ 1.7ksame name
- dust-tt/dust★ 1.5ksame name
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 repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- check-for-updatesSkill
- api-designSkill
- bddSkill
- blueprintSkill
- brainstormingSkill
- browser-usageSkill
- clarify-codeSkill
- cleanupSkill
- codebase-designSkill
- code-reviewSkill
- commitSkill
- confluence-exportSkill
- database-proSkill
- datadogSkill
- diagnosing-bugsSkill
- diagram-designSkill
- e2e-testSkill
- explain-code-flowSkill
- explain-simplySkill
- frontend-slidesSkill
- glabSkill
- grill-meSkill
- handoffSkill
- herdrSkill
- i-have-adhdSkill
- impeccableSkill
- implementSkill
- improve-codebase-architectureSkill
- jiraSkill
- loomSkill
- markitdownSkill
- mermaid-skillSkill
- modularity-designSkill
- modularity-reviewSkill
- plannotatorSkill
- ponytailSkill
- prototypeSkill
- qmdSkill
- refactorSkill
- releaseSkill
- researchSkill
- security-reviewSkill
- show-meSkill
- skill-doctorSkill
- stop-the-slopSkill
- tddSkill
- teachSkill
- terraform-engineerSkill
- ticket-overviewSkill
- to-specSkill
- to-ticketsSkill
- update-docstringsSkill
- wayfinderSkill
- write-documentationSkill
- write-readmeSkill
- write-simplySkill
- writing-for-agentsSkill
- wtfSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
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 12
Discover: Before designing, changing, or reviewing code, find every applicable contract on the target declaration, its enclosing …
- Distinctive: line 15
Enforce: Keep code, tests, and contract prose coherent.
- Very specific: line 16
Verify: When loom contracts supports the target language, run loom contracts check and confirm discoverability with loom contracts list.
- Very specific: line 20
Before writing or editing contracts, read references/format.md.
- Distinctive: line 24
Keep a proposed contract only when a reviewer can identify both:
- Very specific: line 29
When materializing a contract, set owner from the authenticated GitHub identity when available and ask rather than guess.
- Distinctive: line 33
Before completing work, account for every applicable contract and every durable obligation surfaced by the obligation sweep: represented by …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code contracts
Record durable obligations beside the code they govern. Contracts are structured natural-language specifications, not runtime checks or formal proofs; keep tests, types, and validation that can enforce the same behavior mechanically.
Workflow
- Discover. Before designing, changing, or reviewing code, find every applicable contract on the target declaration, its enclosing declarations, ancestor
CONTRACTSfiles, and relevant called symbols. Treat them as simultaneous obligations. Surface conflicts instead of choosing silently. - Obligation sweep. While planning or implementing, inspect the affected behavior for assumptions, requirements, invariants, input/output guarantees, error and fallback behavior, side effects, state transitions, security rules, and architectural boundaries worth preserving. Do not restrict the sweep to exceptional or high-risk behavior. Propose every concrete obligation that future changes must continue to satisfy.
- Place. Put declaration-specific contracts in supported documentation comments or docstrings. Put directory-wide obligations in
CONTRACTS. Use the narrowest boundary that governs the behavior. Once a blueprint direction is approved, materialize its contracts in existing code before handoff when possible; leave only contracts whose target code does not exist or whose assumptions remain unresolved for the implementation agent. - Enforce. Keep code, tests, and contract prose coherent. Update contracts with intentional behavior changes. Never weaken or remove a contract merely to make an implementation appear compliant; fix the mismatch or surface it.
- Verify. When
loom contractssupports the target language, runloom contracts checkand confirm discoverability withloom contracts list; otherwise inspect manually and disclose the tooling limit. For$code-contracts verifyor a contract review, read and followreferences/verification.md.
Writing contracts
Before writing or editing contracts, read references/format.md.
Each contract carries one concrete obligation. Include decisive conditions, boundaries, missing-data behavior, errors, fallbacks, or effects when they determine compliance. Preserve intent across implementations: omit purpose-only documentation, rationale, algorithm narration, and accidental implementation details unless they impose a real constraint.
Keep a proposed contract only when a reviewer can identify both:
- a concrete change that would violate it; and
- an alternative implementation that would satisfy it.
When materializing a contract, set owner from the authenticated GitHub identity when available and ask rather than guess. A blueprint may omit unknown ownership metadata. Set notify only when the user explicitly requests violation notifications.
Completion
Before completing work, account for every applicable contract and every durable obligation surfaced by the obligation sweep: represented by a satisfied or intentionally updated contract, rejected by the violation-and-alternative test, or surfaced as conflicting, obsolete, or impossible. Syntax validation alone does not establish semantic compliance.
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.

