bundles/ai-agents/skills/spec-first/SKILL.md
Enforces a spec → plan → execute → verify loop before writing code, preventing "looks right" failures. Activates on "build X", "implement...", "add a feature that...", or any multi-file/unclear-requirements request. Creates spec.md, todo.md, and decisions.md as durable artifacts.
npx skillsauth add shipshitdev/library spec-firstInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Inputs:
Outputs:
spec-[feature-name].md content for .agents/memory/.todo.md checklist with per-step verification commands.Creates/Modifies:
.agents/memory/spec-[feature-name].md (spec artifact)..agents/memory/decisions-[feature-name].md (decision log).External Side Effects:
Confirmation Required:
Delegates To:
prd-task-creator for PRD-style issue creation.executing-plans for Stage D autonomous execution.A structured workflow for LLM-assisted coding that delays implementation until decisions are explicit.
Delay implementation until tradeoffs are explicit — Use conversation to clarify constraints, compare options, surface risks. Only then write code.
Treat the model like a junior engineer with infinite typing speed — Provide structure: clear interfaces, small tasks, explicit acceptance criteria. Code is cheap; understanding and correctness are scarce.
Specs beat prompts — For anything non-trivial, create a durable artifact (spec file) that can be re-fed, diffed, and reused across sessions.
Generated code is disposable; tests are not — Assume rewrites. Design for easy replacement: small modules, minimal coupling, clean seams, strong tests.
The model is over-confident; reality is the judge — Everything important gets verified by execution: tests, linters, typecheckers, reproducible builds.
Goal: Decide before you implement.
Prompts that work:
Output: Decision notes in .agents/memory/decisions-[feature-name].md
Goal: Turn decisions into unambiguous requirements.
File: .agents/memory/spec-[feature-name].md
# [Feature Name] Spec
## Purpose
One paragraph: what this is for.
## Non-Goals
Explicitly state what you are NOT building.
## Interfaces
Inputs/outputs, data types, file formats, API endpoints, CLI commands.
## Key Decisions
Libraries, architecture, persistence choices, constraints.
## Edge Cases and Failure Modes
Timeouts, retries, partial failures, invalid input, concurrency, idempotency.
## Acceptance Criteria
Bullet list of EARS statements (`WHEN`/`WHILE`/`WHERE`/`IF … THE SYSTEM SHALL …`,
or a bare `THE SYSTEM SHALL …`) — testable, pass/fail, no judgement.
Avoid "should be fast." Prefer: "WHEN given 1k items THE SYSTEM SHALL process them under 2s on M1 Mac."
## Test Plan
Unit/integration boundaries, fixtures, golden files, what must be mocked.
Goal: Stepwise checklist where each step has a verification command.
Tracking: a GitHub Issue per feature — the checklist below is the issue body.
# [Feature Name] TODO
- [ ] Add project scaffolding (build/run/test commands)
Verify: `bun run build && bun run test`
- [ ] Implement module X with interface Y
Verify: `bun run test -- --grep "module X"`
- [ ] Add tests for edge cases A/B/C
Verify: `bun run test -- --grep "edge cases"`
- [ ] Wire integration
Verify: `bun run integration`
- [ ] Add docs
Verify: `bun run docs && open docs/index.html`
Each item must be independently checkable. This prevents "looks right" progress.
Goal: Small diffs, frequent verification, controlled context.
Rules:
For large codebases:
Goal: Force the model to try to break its own work.
Prompts:
Goal: Keep the system easy to delete and rewrite.
Heuristics:
Durable spec + decisions live in .agents/memory/ (not project root); the stepwise todo is tracked as a GitHub Issue:
.agents/memory/
├── spec-[feature-name].md # what/why/constraints
└── decisions-[feature-name].md # tradeoffs, rejected options, assumptions
GitHub Issue (one per feature) # steps + verification commands (checklist body)
Naming: Use the feature/task name (e.g., user-auth, api-refactor) as the filename suffix and the issue title.
Why memory/ + Issues:
.agents/memory/ (the source of truth)Before running autonomous/agentic execution, verify:
| Dimension | Question | If No... | |-----------|----------|----------| | Intent | Do you have acceptance criteria and a test harness? | Don't run agent | | Memory | Do you have durable artifacts (spec/todo) so it can resume? | It will thrash | | Planning | Can it produce/update a plan with checkpoints? | It will improvise badly | | Authority | Is what it can do restricted (edit, test, commit)? | Too risky | | Control Flow | Does it decide next step based on tool output? | It's just generating blobs | | Tools | Does it have minimum necessary tooling and nothing extra? | Attack surface too large |
Approve at meaningful checkpoints (end of todo item, after test suite passes), not every micro-step.
Authoritarian (for correctness):
Edit these files: [paths]
Interface: [exact signatures]
Acceptance criteria: [list]
Required tests: [list]
Don't change anything else.
Options and tradeoffs (for design):
Give me 3 options and a recommendation.
Make the recommendation conditional on constraints A/B/C.
Context discipline (for large codebases):
Only use the files I provided.
If you need more context, ask for a specific file and explain why.
Make it provable:
Add a test that fails on the buggy version and passes on the correct one.
When this skill activates, produce:
SPEC-FIRST WORKFLOW
STAGE A - FRAMING:
[3 approaches with tradeoffs]
[Recommendation]
STAGE B - SPEC:
[Draft spec.md content]
STAGE C - TODO:
[Draft todo.md with verification commands]
Ready to proceed to Stage D (execution)?
development
TypeScript refactoring and modernization guidelines from a principal specialist perspective. This skill should be used when refactoring, reviewing, or modernizing TypeScript code to ensure type safety, compiler performance, and idiomatic patterns. Triggers on tasks involving TypeScript type architecture, narrowing, generics, error handling, or migration to modern TypeScript features.
tools
Resolves TypeScript and JavaScript problems across type-level programming, performance, monorepo management, migration, and modern tooling. Invoke when diagnosing "type instantiation excessively deep" errors, migrating JS to TS, configuring strict tsconfig, debugging module resolution, or choosing between Biome/ESLint/Turborepo/Nx.
tools
Turborepo monorepo build system guidance. Triggers on: `turbo.json`, task pipelines, `dependsOn`, caching, remote cache, the `turbo` CLI, `--filter`, `--affected`, CI optimization, environment variables, internal packages, monorepo structure, and package boundaries. Use when the user configures tasks or workflows, creates packages, sets up a monorepo, shares code between apps, runs changed packages, debugs cache behavior, or works in an `apps/` plus `packages/` workspace.
tools
Provides Tailwind CSS v4 performance optimization and best practices guidelines. Triggers when writing, reviewing, or refactoring Tailwind CSS v4 code; when working with Tailwind configuration, @theme directive, utility classes, responsive design, dark mode, container queries, or CSS generation optimization.