core/capabilities/planning/specify/SKILL.md
Structures elicitation output into a formal specification defining WHAT to build and WHY. Use after quick-elicit or deep-elicit completes, or when the user provides requirements and says "write a spec", "define requirements", "create a PRD", or "specify this feature".
npx skillsauth add xoai/sage specifyInstall 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.
Define WHAT to build and WHY — without deciding HOW (technology choices).
Core Principle: Specifications are the source of truth. Code serves the spec, not the other way around. A clear spec prevents more bugs than any testing framework. The same spec can produce multiple implementations on different branches.
Every spec declares what it produces. Infer this from context:
Deliverable: code | document | mixed
Code: The output is source code — components, APIs, scripts, configs. This is the default. The plan will use TDD, implementation, commits, and full quality gates.
Document: The output is a written artifact — a PRD, competitive analysis, strategy doc, content brief, report. The plan will use drafting, review against criteria, and checklist verification. No TDD, no code gates.
Mixed: Some tasks produce code, some produce documents. A site audit produces a findings document; the fixes produce code. The plan marks each task with its type and applies the appropriate workflow per task.
How to infer: if the user says "write", "draft", "analyze", "research", "audit", "create a document/report/brief/PRD" → likely document. If they say "build", "implement", "add", "fix", "create a feature/page/component" → likely code. If they say "audit and fix", "research then implement" → likely mixed. When unclear, ask.
At the start of BUILD or ARCHITECT workflows, after codebase-scan and elicitation. The elicitation output (from quick-elicit or deep-elicit) becomes the raw input for a structured spec.
Before running elicitation, check if a PRD already exists for this initiative:
.sage/work/<YYYYMMDD>-<slug>/brief.md.sage/docs/ for briefs that cover this workIf a PRD exists → PRD-to-Spec path (skip elicitation):
The PRD already defines WHAT to build and WHY. The specify skill's job becomes: translate the PRD into a technical spec that defines HOW.
Load the PRD. Read the requirements (job stories R1-RN), functional requirements (FR1-FRN), acceptance scenarios, constraints, and dependencies.
Resolve open questions. The PRD's ⚠️ NEEDS CLARIFICATION markers (Q1-QN) are engineering decisions that must be resolved before implementation. For each open question:
.sage/docs/Design the technical architecture. For each PRD requirement, determine:
Map "Delivers value independently" to milestones. Requirements marked "Yes" in the PRD's "Shippable Alone?" column become natural milestone boundaries. Requirements marked "No" (foundational) come first. The spec should note the milestone structure for the plan skill to consume.
Write the spec using the standard template but with:
Show to human for approval. "Here's the technical spec based on the PRD. I've resolved the open questions as follows: [summary]. The component map traces every requirement to its implementation. Ready to plan?"
If no PRD exists → standard elicitation path (current behavior):
Proceed with BUILD or ARCHITECT mode elicitation as described below.
Input: Quick-elicit output (intent + boundaries + acceptance criteria)
Structure the elicitation output into the minimal spec template:
Check against constitution — does any requirement conflict with project principles? If so, flag the conflict and ask the human to resolve.
Save to .sage/work/<YYYYMMDD>-<slug>/spec.md
Show to human for final approval: "Here's the spec. Ready to plan, or adjustments needed?"
Use the full spec template. Guide the human through:
Problem Statement: What problem exists? Who has it? How painful is it? Use Socratic questioning — ask WHY until you reach the real problem.
User Personas: Who are the distinct users? What are their goals, constraints, and pain points? Push for specificity — "users" is not a persona.
User Stories: For each persona, what stories describe their interactions? Format: "As [persona], I want to [action] so that [outcome]."
Functional Requirements: What must the system do? Be explicit and testable. Each requirement gets a unique ID for traceability.
Non-Functional Requirements: Performance, security, scalability, accessibility, compliance. Pull from the constitution — many of these are already defined there.
Boundaries: What is explicitly OUT of scope? What will NOT be built? This prevents scope creep during implementation.
Success Metrics: How will we know this worked? Quantitative where possible.
Risks: What could go wrong? What assumptions are we making?
Present each section for validation before proceeding to the next. The human must approve each section — don't rush through to get to implementation.
Save to .sage/work/<YYYYMMDD>-<slug>/spec.md (or .sage/specs/brief.md for
project-level briefs).
tools
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the sage-memory skill — they share the same MCP backend but serve different purposes (sage-memory = codebase knowledge, sage-self-learning = agent mistakes and gotchas).
development
Typed knowledge graph stored in sage-memory. Use when creating or querying structured entities (Person, Project, Task, Event, Document), linking related objects, checking dependencies, planning multi-step actions as graph transformations, or when skills need to share structured state. Trigger on "remember that X is Y", "what do I know about", "link X to Y", "show dependencies", "what blocks X", entity CRUD, cross-skill data access, or any request involving structured relationships between things.
tools
Integrates sage-memory into Sage workflows. Teaches the agent when to remember (store findings during work), when to recall (search memory at session start and task start), and how to learn (structured knowledge capture via sage learn). Use when the user mentions memory, remember, recall, learn, capture knowledge, onboard to codebase, or when starting any session where sage-memory MCP tools are available.
tools
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the sage-memory skill — they share the same MCP backend but serve different purposes (sage-memory = codebase knowledge, sage-self-learning = agent mistakes and gotchas).