.codex/skills/spec/SKILL.md
Define what you want to build. Creates ./.gtd/<task_name>/SPEC.md. User manually trigger, do not auto invoke this.
npx skillsauth add Hoang604/get-thing-done specInstall 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.
Core responsibilities:
SPEC.md only after explicit user confirmationFlow: Context -> Frame Reality -> Interview -> Optional Research -> Mirror -> Confirm -> Write </objective>
<context> Task naming: - Derive the task name from the request - Use kebab-case - Keep it short and descriptive, usually 2-4 wordsOutput:
./.gtd/<task_name>/SPEC.md
</context>
Use request_user_input for structured choices when available.
If unavailable in the current mode, ask directly in plain-text chat.
Rules:
SPEC.mdUse spawn_agent for domain research when needed.
const research_agent = spawn_agent({ agent_type: "explorer", message: "<research query block>" })
wait({ ids: [research_agent.id], timeout_ms: 3600000 })
close_agent({ id: research_agent.id })```
For existing-system, bug-fix, or constraint-heavy work, prefer **problem-framing research** over broad exploration.
Rules:
- Use **at most 1-2 agents**
- Do **not** fan out to many specialists
- Prefer the smallest specialist that collapses ambiguity
- If local specialist agents are unavailable, fall back to `explorer`
Preferred specialists when available:
- `incident_debugging` -> when the request is triggered by a failure, regression, or raw error evidence
- `architecture` -> when existing boundaries, ownership, or migration constraints shape the solution
- `correctness` -> when semantic invariants, ordering, or edge-case behavior are central
- `reliability` -> when retries, idempotency, crash recovery, or external I/O guarantees matter
</tools>
<philosophy>
## Solve the Right Problem
The requested feature is not automatically the right solution.
If the proposed feature does not clearly advance the user's ultimate goal, challenge it before writing the spec.
## Ask Only What The Codebase Cannot Tell You
When the user references an existing component, module, route, command, workflow, file, symbol, or feature in the repository:
- inspect the codebase first
- infer its current role, scope, and constraints from local evidence
- do **not** ask the user to explain what it is unless the repository cannot resolve it
Ask the user only for what cannot be learned reliably from local context, such as:
- why they want it changed
- what outcome they want
- what must not break
- which of multiple plausible interpretations is correct
## SPEC Is the Contract
`SPEC.md` is the single source of truth for downstream workflow.
`ROADMAP.md`, `PLAN.md`, and execution must derive from it rather than reinterpret it.
## Define Reality, Not Just Desire
A good spec does not only say what should be built.
It must also capture what is already true and must remain true:
- current pain or failure being addressed
- evidence of that pain when available
- hard constraints from the existing system
- invariants that must be preserved
- approaches that are explicitly out of scope
## Use EARS for Requirements
All Must-Have and Nice-to-Have requirements must use EARS-style phrasing.
Patterns:
- Ubiquitous: `The <System> shall <Response>.`
- Event-driven: `When <Trigger>, the <System> shall <Response>.`
- State-driven: `While <State>, the <System> shall <Response>.`
- Unwanted: `If <Condition>, then the <System> shall <Response>.`
- Optional: `Where <Feature>, the <System> shall <Response>.`
## Mirror Before Writing
Before writing, restate:
- Current Problem
- Ultimate Goal
- Target Feature
- Must-Haves
- Nice-to-Haves
- Won't-Haves
- Constraints
- Invariants / Must-Preserve truths
- Rejected approaches / Non-goals
- Done criteria
Do not write the file until the user explicitly confirms the summary.
</philosophy>
<process>
## 1. Determine Mode
Use MODIFY mode if runtime arguments include `--modify` or the user clearly asked to update an existing spec.
Otherwise use NEW mode.
### MODIFY mode
- Ask which task is being modified if not already clear
- Verify `./.gtd/<task_name>/SPEC.md` exists
- If missing, stop with a clear error
- Load the existing spec before discussing changes
### NEW mode
- Continue to context gathering
## 2. Gather Existing Context
Read these files if they exist:
- `./.gtd/PRODUCT.md`
- `./.gtd/CODEBASE.md`
Use them to reduce unnecessary questions, not to skip user confirmation.
## 3. Resolve Referenced Artifacts First
If the user mentions an existing code artifact by name or path, inspect the repository before asking clarifying questions about that artifact.
Examples:
- component or module name
- route or endpoint
- command or job
- file path
- class, function, or service name
Do this before the interview:
- find the artifact in code
- read only the minimum files needed to understand its current purpose
- identify obvious constraints, dependencies, and must-not-break behavior
Only ask the user what the codebase cannot answer:
- desired outcome
- business reason for the change
- priority among ambiguous interpretations
- hidden constraints not visible in code
If the artifact cannot be found, or multiple candidates exist, say that briefly and ask the minimal disambiguating question.
## 4. Frame Current Reality
Before collecting requirements, determine whether this work changes an existing behavior, flow, or system constraint.
If YES, capture the minimum reality context:
- What is painful, broken, or currently missing?
- What evidence exists? (user report, failing test, stack trace, production symptom, codebase constraint)
- What behavior must remain unchanged?
- What system boundary or ownership rule appears load-bearing?
If this is greenfield work with no meaningful existing constraint, keep this step brief and continue.
## 5. Interview the User
Collect the minimum information needed to produce a planning-grade spec.
Required topics:
- Current problem or opportunity
- Ultimate Goal
- Target Feature
- Must-Have requirements
- Nice-to-Have requirements
- Won't-Have scope boundaries
- Constraints
- Invariants / Must-Preserve truths
- Done criteria
Interview rules:
- Ask concise grouped questions
- Ask only questions that remain unknown after reading the local code/context
- Infer sensible wording, then ask the user to confirm or correct it
- Keep going until every required topic is clear enough to write
- If a requirement remains ambiguous, keep the ambiguity visible and resolve it before writing
Additional rule for existing-system work:
- Prefer asking for the current pain, evidence, and must-not-break behavior before discussing the proposed solution in detail
- Do not ask "what is component X?" if the repository already answers that question clearly
## 6. Optional Problem-Framing Research
Do research only if one of these is true:
- Feasibility is unclear from the interview
- Existing architecture may constrain the solution
- There may be reusable patterns in the codebase
- Hidden dependencies could affect scope
- The request is driven by a bug, regression, or production failure
- The important constraints are really invariants or failure semantics, not just feature scope
Before researching, summarize:
- The current pain or evidence
- The user's goal
- Current must-haves
- Known constraints
- Known invariants / must-preserve truths
- Candidate scope paths
Research output should answer:
- What problem reality the spec must respect
- What existing modules or patterns are relevant
- What constraints or hidden dependencies exist
- What must remain true after the change
- Whether the proposed feature still fits the goal
When using specialists:
- Use at most 1-2 agents
- Choose only the agents that collapse the specific ambiguity
- Distill their output into short bullets:
- Current pain / evidence
- Constraints
- Invariants
- Scope hints
- Rejected naive approaches
If research changes the framing, bring that change back into the mirror step.
## 7. Challenge the Fit
Before mirroring, verify that the Target Feature is still the best route to the Ultimate Goal.
Check:
- Does it directly advance the goal?
- Is there a simpler path?
- Did research reveal a conflict with the current approach?
- Are we preserving the important invariants?
- Are we solving the actual pain rather than a guessed solution?
If the fit is weak, stop and discuss alternatives with the user before writing.
## 8. Mirror Understanding
Determine the task name automatically.
Do not ask the user to approve the task name unless it affects meaning.
For NEW mode, summarize:
- Task
- Current Problem
- Ultimate Goal
- Target Feature
- Must Have
- Nice to Have
- Won't Have
- Constraints
- Invariants / Must-Preserve truths
- Rejected approaches / Non-goals
- Done criteria
For MODIFY mode, summarize:
- Existing task
- Current problem or reason for change
- Sections being changed
- Exact content being changed
- Reason for the change
- Any invariant or constraint that must remain true
- Whether roadmap or plans may need regeneration
Then require explicit confirmation.
## 9. Write or Update SPEC.md
For NEW mode:
- Create `./.gtd/<task_name>/`
- Write `SPEC.md`
- Set status to `FINALIZED`
For MODIFY mode:
- Update only the confirmed sections
- Set status to `UPDATED`
- Add `Last Updated`
- Preserve untouched sections unless the user explicitly changes them
Use this structure:
```markdown
# Specification
**Status:** FINALIZED
**Created:** {date}
## Synopsis
{2-3 sentence summary of the user-facing value}
## Current Problem
{The pain, gap, or existing-system reality this spec addresses. If greenfield, state the opportunity clearly.}
## Ultimate Goal
{North-star outcome}
## Target Feature
{What will be built}
## Requirements
### Must Have
- [ ] **When** ...
### Nice to Have
- [ ] **Where** ...
### Won't Have
- ...
## Constraints
- ...
## Invariants & Must Preserve
- ...
## Non-Goals / Rejected Approaches
- ...
## Done Criteria
- ...
## Open Questions
- None
Writing rules:
Constraints should capture hard limits from system reality, not wishlist preferencesInvariants & Must Preserve should capture truths that downstream planning must not violateNon-Goals / Rejected Approaches should stay short and only include meaningful scope or design exclusionsOpen Questions should be None unless the user explicitly accepts unresolved itemsBefore finishing, verify:
roadmapIf not, fix the spec before offering the next step.
</process><offer_next>
For NEW mode:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GTD ► SPEC COMPLETE ✓
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Specification written to ./.gtd/<task_name>/SPEC.md
Acceptance Criteria: {N} items defined
─────────────────────────────────────────────────────
▶ Next Up
$roadmap — create phases from this spec
─────────────────────────────────────────────────────
For MODIFY mode:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
GTD ► SPEC UPDATED ✓
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Specification updated: ./.gtd/<task_name>/SPEC.md
Changes applied: {N} sections modified
─────────────────────────────────────────────────────
⚠ Note: Rebuild roadmap or plans manually if the change affects phase structure
─────────────────────────────────────────────────────
▶ Next Up
$roadmap — regenerate phases from this spec if needed
─────────────────────────────────────────────────────
</offer_next>
<forced_stop> STOP. The workflow is complete. Do NOT automatically run the next command. Wait for the user. </forced_stop>
testing
manual trigger by user, do not auto invoke
tools
manual trigger by user, do not auto invoke
development
Trace execution paths and document how code actually behaves. Use when you need to understand how features work, walk through code flows, explain component behavior, trace where data comes from, understand relationships between components, or audit for orphaned events and dead code.
testing
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.