spec
Turn ideas into structured specs and execute them — conduct interviews to refine requirements, import existing plans, or run task lists via subagents. Use whenever starting a feature, planning implementation, or managing task execution.
What this skill does
## Quick Reference
```
/spec "idea" # Start interview from idea description
/spec @file.md # Start interview from file content
/spec run @SPEC-*.md # Execute tasks in specified SPEC file
/spec import @plan.md # Import Claude Code plan file to SPEC format
```
# Spec Skill - Requirements Refinement & Task Execution
Route to the appropriate mode based on `$ARGUMENTS`:
## Mode Routing
### 1. Run Mode
**Trigger**: `$ARGUMENTS` starts with `run`
**Example**: `run @SPEC-user-auth.md`
**Required**: Must specify a SPEC file. If not provided, prompt user to specify one.
### 2. Import Mode
**Trigger**: `$ARGUMENTS` starts with `import`
**Example**: `import @plan.md`
**Required**: Must specify a plan file to import.
### 3. Interview Mode (Default)
**Trigger**: All other cases
- `@file` - Start from file content
- Plain text - Start from idea description
---
## Mode 1: Interview Mode
### Input Handling
- **Idea mode**: Use text from `$ARGUMENTS` directly
- **File mode**: Read file content as starting point
### Interview Process
Conduct adaptive interviews using AskUserQuestion. No fixed rounds — continue until the user signals completion.
**Core Principles**:
- Ask 1-3 focused questions per round
- Dig deep rather than staying surface-level
- Challenge assumptions and explore alternatives
- Before each round, briefly summarize what has been collected so far
**Topic Areas to Explore** (adapt order and depth based on context):
- Problem definition and success criteria
- Target users and their needs
- Technical constraints and integration points
- User experience and interaction patterns
- Risks, tradeoffs, and scope boundaries
- Dependencies and open questions
### Slug Generation
Generate a short English slug: lowercase, hyphen-separated, 2-4 words (e.g., `user-auth`, `dark-mode`, `api-rate-limit`).
### Plan Mode Handling
If plan mode is currently active, call ExitPlanMode before generating the SPEC file. The spec interview process itself serves as the planning phase — the SPEC document is the deliverable, not a plan file.
### Output File
Ensure directory exists, then generate **SPEC-{slug}.md** using the template in `references/spec-template.md`. Adapt sections based on the interview — omit sections that are not relevant, expand those that are.
---
## Mode 2: Import Mode
Import a Claude Code plan file and convert it to SPEC format for subagent execution. This enables isolated execution of each task with fresh context, avoiding context window overflow.
### Execution Flow
1. **Read plan file** — Parse the specified file
2. **Extract content** — Title from first heading, background from pre-task text, tasks from checkbox/numbered items
3. **Generate slug** — Derive from title or ask user
4. **Convert to SPEC format** — Create SPEC-{slug}.md with requirements, task list, and empty execution log
5. **Save and confirm** — Write to `./plans/SPEC-{slug}.md` and show summary
### Task Conversion Rules
| Plan Format | SPEC Format |
|-------------|-------------|
| `- [ ] Task` | ⬜ Pending |
| `- [x] Task` | ✅ Completed |
| `1. Task` | ⬜ Pending |
| Nested items | Merged into Notes column |
---
## Mode 3: Run Mode
Execute tasks sequentially using subagents. Main context handles scheduling and progress tracking only.
### Execution Flow
#### Phase 1: Parse and Plan
1. **Locate SPEC file** — Must be specified in the command. If missing, prompt user.
2. **Parse tasks** — Extract all tasks, identify status (⬜/🔄/✅), count pending.
3. **Display execution plan** — Show task table with status. Ask user to confirm before proceeding.
#### Phase 2: Sequential Execution
For each pending task in order:
1. **Update status** — Change to 🔄, write file immediately.
2. **Execute via subagent** — Use Task tool with task description, acceptance criteria, and relevant spec context.
3. **Handle result**:
- **Success**: Update to ✅, add timestamp, update progress count and `last-updated`
- **Failure**: Keep as 🔄, stop execution immediately, display error report with recovery instructions
4. **Report progress** — Show completion status after each task.
### Error Handling
On failure, stop and report: which task failed, error details, current progress, and how to retry (`/spec run @SPEC-xxx.md` resumes from the failed task).
---
## Guidelines
### File Handling
- If file exists, ask user: Overwrite / Use new slug / Cancel
- Auto-create directory if it doesn't exist
- Single SPEC file contains both requirements and tasks
### Task Table Format
- Use table format for all tasks
- Status icons: ⬜ Pending | 🔄 In Progress | ✅ Completed
- Include acceptance criteria in Notes column
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.