From autospec
Spec-driven coding for Claude Code. Paste a spec from any source (Google Docs, Jira, Slack, markdown, email), get reviewed and verified code. Reviews specs for gaps, asks clarifying questions, routes to implementation based on prescriptiveness. Trigger phrases: "spec", "implement this spec", "here's the spec", "my boss sent", "build from spec", "execute this spec".
How this skill is triggered — by the user, by Claude, or both
Slash command
/autospec:specThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Spec-driven coding. Paste a spec, get reviewed and verified code.
Spec-driven coding. Paste a spec, get reviewed and verified code.
Spec: $ARGUMENTS
.autospec/.autospec/session.md.autospec/log.jsonl.autospec/config.json.autospec/spec.mdautospec/<task-slug>-<date>Every event appended to log.jsonl must follow one of these schemas:
{"type":"intake","timestamp":<epoch>,"raw_length":<chars>,"classification":"prescriptive|directional|open-ended","gap_count":<N>,"blocking_gaps":<N>}
{"type":"interrogation","timestamp":<epoch>,"round":<N>,"questions_asked":<N>,"questions_answered":<N>,"gaps_remaining":<N>}
{"type":"spec_refined","timestamp":<epoch>,"spec_path":".autospec/spec.md","classification":"prescriptive|directional|open-ended"}
{"type":"routing","timestamp":<epoch>,"classification":"prescriptive|directional|open-ended","route":"direct|light_research|full_research","user_choice":<1|2|3>}
{"type":"research","timestamp":<epoch>,"agent":"researcher-N","topic":"<topic>","summary":"<text>"}
{"type":"evaluation","timestamp":<epoch>,"ranking":[<names>],"recommendation":"<name>"}
{"type":"research_routed","timestamp":<epoch>,"reason":"<why research was needed>","task_description":"<synthesized task for full research>"}
{"type":"plan","timestamp":<epoch>,"files_to_create":[<paths>],"files_to_modify":[<paths>],"key_decisions":[<strings>]}
{"type":"implement","timestamp":<epoch>,"commit":"<hash>","description":"<text>","files_changed":<N>}
{"type":"verify","timestamp":<epoch>,"overall":"PASS|FAIL|WARN","tests":"pass|fail","typecheck":"pass|fail|skipped","lint":"pass|fail|skipped","blocking_issues":[<strings>],"warnings":[<strings>]}
{"type":"autofix","timestamp":<epoch>,"retry":<N>,"trigger":"<failure description>"}
{"type":"complete","timestamp":<epoch>,"status":"success|failed|escalated"}
First, check if there's an existing session to resume:
.autospec/session.md — if it exists, check .autospec/log.jsonl for the last event type| Last event | Resume at |
|---|---|
intake | Phase 2 (interrogation) |
interrogation | Phase 2 (continue questions from last round) |
spec_refined | Phase 3 (routing) |
routing | Resume based on route field: direct → Phase 4, light_research → dispatch researchers, full_research → dispatch autoresearch agents |
research | Check if all researchers returned; if so dispatch evaluator, else re-run remaining researchers |
evaluation | Phase 4 (present implementation plan) |
research_routed | Check for evaluation event in log; if found → Phase 4, else continue research |
plan | Phase 5 (implementation) — plan was already approved in previous session |
implement | Phase 6 (verification) |
verify with FAIL | Auto-fix loop |
verify with PASS | Final report |
autofix | Continue auto-fix loop from last retry number |
complete | Inform user the session is already complete; suggest /spec clear to start fresh |
/spec clear cleanup:
If the user runs /spec clear:
.autospec/ directory: rm -rf .autospec/git branch --list 'autospec/*' | xargs -r git branch -Dgit worktree list --porcelain | grep -B2 'autospec/' | grep '^worktree ' | sed 's/^worktree //' | xargs -I{} git worktree remove --force {}Goal: Parse the spec, scan the codebase, classify prescriptiveness, detect gaps.
Parse the task: Extract the raw spec text from $ARGUMENTS.
Minimum input threshold: If the raw spec is under ~50 words with no concrete requirements, prompt the user before proceeding:
That's pretty brief — can you paste the full spec or give me more detail on what needs to be built?
Wait for their response, then continue with the full input.
Scan the codebase:
package.json for current dependencies and frameworksRead config (if exists): Check .autospec/config.json for user overrides:
{ "maxRetries": 3, "maxImplementerTurns": 50, "maxInterrogationRounds": 5, "maxResearchers": 3 }
Use defaults if the file doesn't exist.
Dispatch the analyzer agent with the raw spec and codebase context:
Analyze the following spec for prescriptiveness and gaps.
**Raw Spec:**
[full spec text]
**Codebase Context:**
[relevant files found, frameworks, package.json summary, existing patterns]
Collect analyzer output (classification + gap analysis). The analyzer returns text — you parse it.
Initialize state:
.autospec/ directory.autospec/ to .gitignore if not already presentsession.md using the template belowintake event to log.jsonlNO user checkpoint here — flow directly into Phase 2.
session.md template:
# Autospec: <task summary>
## Objective
<What we're building and why>
## Classification
<prescriptive/directional/open-ended>
## Gap Analysis Summary
<Key gaps found and how they were resolved>
## Refined Spec
See .autospec/spec.md
## Research Findings
<To be updated if research is needed>
## Implementation Plan
<To be updated after Phase 4>
## Implementation Log
<To be updated after Phase 5>
## Verification Results
<To be updated after Phase 6>
Goal: Fill all blocking gaps through targeted Q&A, produce a refined spec.
Interrogation loop:
Dispatch the interrogator agent with the analyzer output and original spec:
Generate clarifying questions for this spec based on the gap analysis.
**Original Spec:**
[raw spec text]
**Analyzer Output:**
[full gap analysis and classification from Phase 1]
**User Answers So Far:**
[answers from previous rounds, if any]
Present questions to the user. The interrogator returns a numbered list — present it as-is. Collect the user's answers.
Append interrogation event to log.jsonl with the round number, questions asked, questions answered, and gaps remaining.
Check blocking gaps remaining:
maxInterrogationRounds: re-dispatch the interrogator with original analysis + all answers accumulated so far, asking it to generate follow-up questions for remaining blocking gaps. Loop back to step 2.maxInterrogationRounds: proceed with best-effort defaults, warn the user: "Proceeding with best-effort defaults for unresolved gaps — review .autospec/spec.md before approving the plan."Write the refined spec to .autospec/spec.md: Incorporate all original spec content plus resolved gap answers. This is the authoritative document for all subsequent phases.
Append spec_refined event to log.jsonl. Update the "Gap Analysis Summary" section in session.md.
Goal: Determine research needs and get user buy-in on the approach.
Based on the prescriptiveness classification from Phase 1, present one of the following to the user:
Prescriptive:
## Spec Classification: Prescriptive
Your spec is clear and specific — it names technologies, has detailed criteria, and leaves little room for interpretation. Going straight to implementation planning.
(Want me to research alternatives first? Just say so.)
Route: direct. Skip to Phase 4. Log routing event with route: "direct" and user_choice: 1.
Directional:
## Spec Classification: Directional
Your spec describes what to build but leaves some technical choices open.
I'd like to do a quick research pass on [specific topic] before implementing.
Options:
1. Quick research (recommended) — I'll check best approaches for [topic]
2. Skip research — just implement with [my best guess default]
3. Full research — run the complete research pipeline
Which approach? (1/2/3)
Wait for user selection. Log routing event with route based on choice (choice 1 → light_research, choice 2 → direct, choice 3 → full_research).
Open-ended:
## Spec Classification: Open-ended
Your spec describes a goal but doesn't prescribe an approach. I'd like to research options before implementing.
Options:
1. Full research (recommended) — evaluate multiple approaches, present ranked options
2. Quick research — brief look at best practices, then implement
3. Skip research — I'll pick an approach and go
Which approach? (1/2/3)
Wait for user selection. Log routing event with route based on choice (choice 1 → full_research, choice 2 → light_research, choice 3 → direct).
For light research (directional default route or user choice):
Dispatch autospec's own researcher agent(s) in PARALLEL — one per specific technical question surfaced by the analyzer. Use up to maxResearchers agents (default: 3).
For each question, dispatch the researcher agent:
Research the following technical question to inform implementation:
**Question:** [specific technical question from gap analysis / spec]
**Spec Context:** [relevant excerpt from spec.md]
**Codebase Context:** [relevant stack, existing patterns]
Collect results. Fold findings into .autospec/spec.md as a "## Research Addendum" section. Log each result as a research event.
For full research (open-ended route or user choice):
../autoresearch/agents/researcher/researcher.md exists.../autoresearch/agents/researcher/researcher.md and ../autoresearch/agents/evaluator/evaluator.mdresearch_routed event with reason and synthesized task descriptionmaxResearchers)research eventevaluation event## Research Complete — Choose Your Approach
[evaluator's comparison table and option details]
### Your Options:
1. **[Top pick]** (Recommended) — [one-line summary]
2. **[Second]** — [one-line summary]
3. **[Third]** — [one-line summary]
4. **Build Custom** — [effort estimate], [one-line summary]
Which option? (1/2/3/4)
.autospec/spec.md as a "## Research Addendum" section.researcher agent for light research (same as light research path above).All research results are logged to autospec's own .autospec/log.jsonl — NOT to .autoresearch/.
Goal: Get explicit user approval on what will be built before any code is written.
Present a concrete plan derived from .autospec/spec.md:
## Implementation Plan
Based on the refined spec, here's what I'm going to build:
### Files to Create
- [path] — [purpose]
### Files to Modify
- [path] — [what changes and why]
### Order of Operations
1. [step]
2. [step]
...
### Key Decisions
- [decision derived from spec, e.g., "Using Prisma for the subscription model per spec requirement"]
### Assumptions
- [anything not explicitly stated in the spec that you're inferring]
Does this plan look right? Adjust anything before I start implementing.
Wait for user approval. User may request adjustments — incorporate them, then confirm before proceeding.
Append plan event to log.jsonl with files_to_create, files_to_modify, and key_decisions. Update "Implementation Plan" section in session.md.
Goal: Execute the refined spec in an isolated git worktree using the Opus implementer.
Build the implementer prompt based on context:
For initial implementation:
Implement the following spec:
**Refined Spec:**
[full contents of .autospec/spec.md]
**Implementation Plan:**
[plan details from Phase 4 — files to create/modify, order of operations]
**Files in Scope:** [list from plan]
**Codebase Context:** [relevant patterns, frameworks, conventions found during Phase 1 scan]
**Constraints:** [constraints from spec, e.g., "must not change the public API", "TypeScript strict mode"]
For auto-fix retry (Phase 6 loop):
Fix the verification failures from the previous implementation attempt:
**Verification Failure Report:**
[full verifier output including all error messages and blocking issues]
**Previous Implementation:** Check git log on this branch for what was done.
**Focus:** ONLY fix the issues identified. Don't redo work that already passed.
**Spec:** [full contents of .autospec/spec.md for reference]
Dispatch the implementer agent with the appropriate prompt.
Collect implementation summary (commit hash, files changed, description). The implementer works in an isolated worktree on branch autospec/<task-slug>-<date>.
Append implement event to log.jsonl. Update "Implementation Log" section in session.md.
Goal: Run the verification pipeline. Auto-fix on failure. Deliver final report on pass.
Dispatch the verifier agent:
Verify the implementation changes.
**Implementation Summary:** [what was changed, from implementer output]
**Spec:** [path to .autospec/spec.md — verifier checks implementation matches spec]
**Worktree Path:** [path to the worktree where changes were made]
**Files Changed:** [list from implementer summary]
Collect verification report. Append verify event to log.jsonl. Update "Verification Results" in session.md.
Evaluate results:
Read maxRetries from .autospec/config.json (default: 3).
autofix event to log.jsonl with current retry number and failure trigger (summary of blocking issues)implementer agent with the auto-fix retry prompt (includes full verification failure report)implement event. Update session.md.verifier agentverify event. Update session.md.complete event with status: "escalated", present escalation report:## Auto-Fix Exhausted
After [N] attempts, the following issues remain unresolved:
[blocking issues from last verification report]
**Options:**
- Review and fix manually on branch `autospec/<branch-name>`
- Run `/spec` again with an adjusted spec
- Run `/spec clear` to reset and start over
Append complete event with status: "success" to log.jsonl.
## Autospec Complete
**Spec:** [one-line summary of what was built]
**Classification:** [prescriptive/directional/open-ended]
**Branch:** `autospec/<task-slug>-<date>`
### Refined Spec
See `.autospec/spec.md`
### Verification Results
[full verification report — tests, typecheck, lint, any warnings]
### Changes Summary
- Files changed: [count]
- Commits: [count]
- [key changes listed]
### Next Steps
- Review the changes: `git diff main...autospec/<branch>`
- Merge when ready: `git merge autospec/<branch>`
- Or discard: `git branch -D autospec/<branch>`
.autospec/session.md and .autospec/log.jsonl. Never instruct agents to write to these files.log.jsonl — every phase transition, every agent result, every retry, every routing decision.log.jsonl and pick up from the last logged event type. Do not re-run completed phases..autospec/spec.md is the source of truth for implementation. The implementer executes the spec, not the raw user input./spec clear removes all state, branches, and worktrees. Always confirm before clearing if there is an active session with uncommitted work.analyzer, interrogator, researcher, implementer, verifier. For full research via autoresearch cross-plugin delegation, agent prompts are read from ../autoresearch/agents/ and dispatched directly.npx claudepluginhub zainw/ai-plugins --plugin autospecGuides GitHub Spec-Kit CLI integration for 7-phase constitution-based spec-driven feature development, managing .specify/specs/ directories with phases: Constitution, Specify, Clarify, Plan, Tasks, Analyze, Implement.
Transforms ideas into structured specifications (requirements, design, tasks) before implementation. Use when building features, fixing bugs, refactoring, or designing systems.
Guides specification-driven AI development workflows by breaking projects into 2-4 hour sessions using 13 commands like /plansession, /implement, /validate, and /phasebuild.