spec-driven
Skill4 starsChanged 8 months agoMITView on GitHub
Contract-first, schema-driven development methodology. Four pillars: Spec (human intent), Schema (machine validation), Registry (discovery), and Isolated Modules (testable units). Use this skill when designing new modules, APIs, or features from scratch. Also trigger when the user mentions: "spec first", "contract first", "schema driven", "API design", "new module", "new feature architecture", "how should I structure this", or when building something that needs clear boundaries between components. Especially useful for AI-assisted development because schemas become the shared language between human intent and machine implementation.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- adeonir/agent-skillstheir own version, first seen Nov 6, 2026
- Snowflake-Labs/coco-skillstheir own version, first seen Nov 1, 2026
- NoatToan/claude-code-pluginstheir own version, first seen Nov 1, 2026
- stoa-platform/stoatheir own version, first seen Nov 1, 2026
- microsoft/FSQtheir own version, first seen Oct 13, 2026
- aprameyak/coding-skillstheir own version, first seen Oct 2, 2026
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- agencia-conversion/agentic-seo-skills★ 51same name
- Snowflake-Labs/coco-skills★ 49same name
- microsoft/FSQ★ 23same name
- stoa-platform/stoa★ 9same name
- adeonir/agent-skills★ 8same name
- zazzcode/zazz-skills★ 4same name
- 90sRehem/agent-skills★ 2same name
- b12consulting/skills★ 2same name
- hbarbosa02/alaz-mcp-nestjs★ 2same name
- aprameyak/coding-skills★ 1same name
4 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 repository4 other files it gives its agents.
- debug-loopSkill
- implementSkill
- lean-typescriptSkill
- roadmapSkill
The file
Files
Spec-Driven Development
Define the contract before writing the implementation. This methodology ensures that both humans and AI agents work from the same source of truth — the schema.
The 4 Pillars
1. SPEC — Human-Readable Intent
A plain-language document describing what the module does, why it exists, and what its boundaries are. Written in markdown.
# Payment Processing Module
## Purpose
Process credit card payments through Stripe, with fallback to manual invoice.
## Boundaries
- Accepts: validated payment requests (amount, currency, token)
- Returns: payment result (success with ID, or failure with reason)
- Does NOT: handle user authentication, manage subscriptions, send emails
## Dependencies
- Stripe API client (injected)
- Database connection (injected)The spec answers three questions:
- What does this module accept and return?
- What is explicitly outside its responsibility?
- What does it depend on (injected, not imported)?
2. SCHEMA — Machine-Readable Validation
The spec, translated into runtime-checkable contracts. In TypeScript, use Zod. In Python, use Pydantic.
import { z } from 'zod';
export const PaymentRequestSchema = z.object({
amount: z.number().positive(),
currency: z.enum(['USD', 'EUR', 'GBP']),
token: z.string().min(1),
});
export const PaymentResultSchema = z.discriminatedUnion('status', [
z.object({ status: z.literal('success'), paymentId: z.string() }),
z.object({ status: z.literal('failure'), reason: z.string() }),
]);
export type PaymentRequest = z.infer<typeof PaymentRequestSchema>;
export type PaymentResult = z.infer<typeof PaymentResultSchema>;The schema is the single source of truth for types. Never hand-write a TypeScript
interface that duplicates what Zod already defines — use z.infer<>.
3. REGISTRY — Discovery & Wiring
A manifest that tells the system (and AI agents) what modules exist, what they expose, and how to find them.
{
"modules": [
{
"id": "payments",
"entry": "src/payments/index.ts",
"schemas": "src/payments/types.ts",
"depends_on": ["database", "stripe-client"],
"exposes": ["processPayment", "refundPayment"]
}
]
}The registry enables:
- AI agents to discover what already exists before creating new code
- Humans to navigate the codebase without reading every file
- Tools to validate dependencies and detect circular imports
4. ISOLATED MODULE — Single-Responsibility Unit
The implementation. Every module:
- Receives dependencies via injection (constructor args or function params)
- Imports only from shared types — never reaches into another module's internals
- Has one public entry point (
index.tswith named exports) - Is testable in isolation — mock the injected deps, test the logic
// src/payments/process.ts
export async function processPayment(
provider: PaymentProvider,
db: Database,
request: PaymentRequest
): Promise<PaymentResult> {
const result = await provider.charge(request.amount, request.currency, request.token);
if (result.ok) {
await db.payments.insert({ id: result.value, ...request });
return { status: 'success', paymentId: result.value };
}
return { status: 'failure', reason: result.error.message };
}The Flow
Human writes SPEC (what & why)
↓
Developer/AI creates SCHEMA (Zod/Pydantic types)
↓
Register module in REGISTRY (discovery manifest)
↓
Implement ISOLATED MODULE against the schema
↓
Test against the schema contract
↓
If schema drifts from intent → update SPEC → repeatWhy This Works for AI-Assisted Development
| Without spec-driven | With spec-driven |
| AI guesses module boundaries | AI reads the spec and knows exactly what to build |
| Duplicate modules appear | Registry prevents creating what already exists |
| Types drift from validation | Schema is the single source for both |
| Tests mock random internals | Tests validate against the contract |
| Refactoring breaks unknown consumers | Registry tracks dependencies explicitly |
Per-Module Artifact Checklist
For each new module, create:
spec.md— plain-language description of purpose, boundaries, dependenciestypes.ts— Zod schemas + inferred types (orschemas.pyfor Pydantic)index.ts— public API (named exports only)- Registry entry in project manifest
- At least one test per schema-defined behavior
Anti-Patterns
- Schema after implementation — defeats the purpose; the schema is the design
- God schemas that validate everything in one file — one schema per boundary
- Registry that nobody updates — enforce in CI or don't bother
- Modules that import from sibling internals — always go through the public API
- Specs that describe how instead of what — implementation details belong in code, not specs
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.

