/agentspec:sdd-definefrom agentspec
Transforms unstructured input into validated requirements with MoSCoW goals, acceptance tests, and clarity scoring. Run /define to start Phase 1 of the SDD workflow.
Ships in agentspec. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Transform unstructured input into validated, actionable requirements with explicit scope boundaries and measurable success criteria. This skill owns the Phase 1 methodology; the define-agent executes it and the /define command is its entrypoint.
Phase 0: /brainstorm → .claude/sdd/features/BRAINSTORM_{FEATURE}.md (optional)
Phase 1: /define → .claude/sdd/features/DEFINE_{FEATURE}.md (THIS SKILL)
Phase 2: /design → .claude/sdd/features/DESIGN_{FEATURE}.md
Phase 3: /build → Code + .claude/sdd/reports/BUILD_REPORT_{FEATURE}.md
Phase 4: /ship → .claude/sdd/archive/{FEATURE}/SHIPPED_{DATE}.md
Define combines what used to be Intake + PRD + Refine into a single, iterative phase. When fed a BRAINSTORM document, extraction is streamlined because discovery questions are already answered, approaches have been evaluated, YAGNI has been applied, and the user has validated the direction.
Follow KB-first resolution — it is mandatory, not optional, because the Design phase depends on the KB domains selected here.
┌─────────────────────────────────────────────────────────────────────┐
│ KNOWLEDGE RESOLUTION ORDER │
├─────────────────────────────────────────────────────────────────────┤
│ │
│ 1. KB DISCOVERY (identify applicable domains) │
│ └─ Read: ${CLAUDE_PLUGIN_ROOT}/kb/_index.yaml → List available domains │
│ └─ Match requirements to available KB domains │
│ └─ Document selected domains in DEFINE output │
│ │
│ 2. TEMPLATE LOADING (ensure consistent structure) │
│ └─ Read: ${CLAUDE_PLUGIN_ROOT}/sdd/templates/DEFINE_TEMPLATE.md │
│ └─ Read: .claude/CLAUDE.md → Project context │
│ │
│ 3. CONFIDENCE ASSIGNMENT │
│ ├─ All entities extracted clearly → 0.95 → Proceed │
│ ├─ Some gaps, clarification needed → 0.80 → Ask questions │
│ └─ Major ambiguity, unclear scope → 0.60 → Block, clarify │
│ │
└─────────────────────────────────────────────────────────────────────┘
| Score | Status | Action |
|---|---|---|
| 12-15/15 | HIGH | Proceed to /design |
| 9-11/15 | MEDIUM | Ask targeted questions |
| 0-8/15 | LOW | Cannot proceed, clarify |
Read(${CLAUDE_PLUGIN_ROOT}/sdd/templates/DEFINE_TEMPLATE.md)
Read(CLAUDE.md)
# If file provided:
Read(<input-file>)
Identify the input type to guide extraction:
| Input Type | Pattern | Focus |
|---|---|---|
brainstorm_document | BRAINSTORM_*.md from /brainstorm | Pre-validated, extract directly |
meeting_notes | Bullet points, action items | Decisions, requirements |
email_thread | Re:, Fwd:, signatures | Requests, constraints |
conversation | Informal language | Core problem, users |
direct_requirement | Structured request | All elements present |
mixed_sources | Multiple formats | Consolidate, deduplicate |
Pull structured data from the input using these patterns:
| Entity | Look For |
|---|---|
| Problem | "We're struggling with...", "The issue is...", "Pain point:" |
| Users | "For the team...", "Customers want...", "Users need..." |
| Goals | "We need to...", "Must have...", "Should have..." |
| Success Criteria | "Success means...", "We'll know when...", "Measured by..." |
| Acceptance Tests | "Given/When/Then", "Test case:", "Scenario:" |
| Constraints | "Must work with...", "Can't change...", "Limited by..." |
| Out of Scope | "Not including...", "Deferred to...", "Excluded:" |
| Assumptions | "Assuming that...", "We expect...", "If X then...", "Depends on..." |
Classify every goal with MoSCoW priority:
| Priority | Meaning |
|---|---|
| MUST | MVP fails without this (non-negotiable) |
| SHOULD | Important, but a workaround exists |
| COULD | Nice-to-have, cut first if timeline is tight |
Formalize assumptions into a trackable risk register (ID, statement, impact if wrong, validated checkbox). BRAINSTORM captures exploratory assumptions; DEFINE turns them into trackable risks.
Ask three questions (skip any the input already answers):
Why these three:
Trigger: the requirements mention data pipelines, ETL, analytics, warehouses, data quality, schemas, or data sources.
| Entity | Look For |
|---|---|
| Source Systems | "from Postgres...", "Kafka topic...", "S3 bucket...", "API endpoint..." |
| Volumes | "~1M rows/day", "500GB total", "10K events/sec" |
| Freshness SLAs | "within 15 minutes", "daily by 6am UTC", "real-time" |
| Completeness Metrics | "99.9% of records", "no nulls in PK", "all sources present" |
| Schema Contracts | "order_id is INT", "status ENUM", "amount DECIMAL(18,2)" |
| Source Inventory | "3 Postgres tables + 1 Kafka topic + S3 clickstream" |
Record the findings in the DEFINE document's "Data Contract (if applicable)" section — source inventory, schema contract, freshness SLAs, completeness metrics, lineage requirements. The section's shape lives in the template; do not invent a parallel format.
Score each element 0-3 points:
| Element | Score | Meaning |
|---|---|---|
| Problem | 0-3 | Clear, specific, actionable |
| Users | 0-3 | Identified with pain points |
| Goals | 0-3 | Measurable outcomes |
| Success | 0-3 | Testable criteria |
| Scope | 0-3 | Explicit boundaries |
Scoring guide:
Total: 15 points. Minimum to proceed: 12/15 (80%). Record the per-element breakdown with notes in the document's Clarity Score Breakdown section.
Use AskUserQuestion with specific options, targeting the lowest-scoring elements first:
Example questions:
- "Who is the primary user: (a) internal team, (b) customers, (c) both?"
- "What's the timeline: (a) this sprint, (b) this quarter, (c) no deadline?"
Re-score after each round of answers. Never pad entities to reach the gate — a fabricated requirement is worse than an honest "Needs Clarification".
Write the structured document following the template, then save:
Write(.claude/sdd/features/DEFINE_{FEATURE_NAME}.md)
Then update statuses (see Status transitions) and hand off (see Handoff).
| Obligation | Value |
|---|---|
| File | .claude/sdd/features/DEFINE_{FEATURE_NAME}.md |
| Feature name | SCREAMING_SNAKE_CASE (e.g., USER_NOTIFICATIONS) |
| Structure | ${CLAUDE_PLUGIN_ROOT}/sdd/templates/DEFINE_TEMPLATE.md — the template owns the document format; follow it rather than re-creating sections here |
| Status values | Draft, In Progress, Needs Clarification, Ready for Design |
Required sections (per WORKFLOW_CONTRACTS.yaml): metadata, problem statement, target users, goals (MoSCoW), success criteria, acceptance tests, out of scope, constraints, assumptions, clarity score breakdown, open questions, revision history.
Completing Define carries two status obligations, per ${CLAUDE_PLUGIN_ROOT}/sdd/architecture/WORKFLOW_CONTRACTS.yaml (status_transitions and update_rules). Skipping them leaves stale "Ready for X" statuses that break the workflow.
Status field to Ready for Design when clarity >= 12/15, or Needs Clarification when below the gate.BRAINSTORM_{FEATURE}.md and set its Status field to ✅ Complete (Defined).Before generating the DEFINE document:
PRE-FLIGHT CHECK
├─ [ ] Problem statement is one clear sentence
├─ [ ] At least one user persona with pain point
├─ [ ] Goals have MoSCoW priority (MUST/SHOULD/COULD)
├─ [ ] Success criteria are measurable (numbers, %)
├─ [ ] Acceptance tests are testable
├─ [ ] Out of scope is explicit (not empty)
├─ [ ] Assumptions documented with impact if wrong
├─ [ ] KB domains identified for Design phase
├─ [ ] Technical context gathered (location, IaC impact)
└─ [ ] Clarity score >= 12/15
The clarity gate is hard: below 12/15 the phase does not complete — ask, iterate, or mark the document Needs Clarification and state what is missing.
Before handing off to /design, validate the document just written against this phase's contract — artifact DEFINE_{FEATURE_NAME}.md, phase define:
${CLAUDE_PLUGIN_ROOT}/tools/spec-linter/spec-lint .claude/sdd/features/DEFINE_{FEATURE_NAME}.md --phase define \
--contracts-file ${CLAUDE_PLUGIN_ROOT}/sdd/architecture/WORKFLOW_CONTRACTS.yaml
Run it as ${CLAUDE_PLUGIN_ROOT}/tools/spec-linter/USAGE.md documents, and act on the verdict exactly as defined there. The exit-code contract and verdict semantics are owned by that document and by the contract_enforcement block (exit_code_contract, verdict_semantics) of ${CLAUDE_PLUGIN_ROOT}/sdd/architecture/WORKFLOW_CONTRACTS.yaml — which is also where this phase's binding is declared. Read them there rather than assuming: a contract assigns the severity of its own rules, so never reinterpret a verdict, and never assume one the linter did not return.
| Never Do | Why | Instead |
|---|---|---|
| Vague language ("improve", "better") | Unmeasurable | Use specific metrics |
| Skip clarity scoring | Proceed with gaps | Always calculate score |
| Assume implementation details | That's DESIGN phase | Keep requirements-focused |
| Empty out-of-scope | Scope creep risk | Explicitly list exclusions |
| Skip KB domain selection | Design lacks patterns | Always identify domains |
| No identified users | Requirements without an audience | Name at least one persona with a pain point |
| Untestable success criteria | Cannot verify done | Rewrite until measurable |
Once the DEFINE document is saved with clarity >= 12/15 and statuses are updated, suggest the next phase:
/design .claude/sdd/features/DEFINE_{FEATURE_NAME}.md
Design (Phase 2, design-agent) turns the validated requirements into architecture and a technical specification.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub luanmorenommaciel/agentspec --plugin agentspec16 skills in this plugin
/agent-routerIntelligent agent routing -- automatically matches tasks to the best specialist agent based on file patterns, intent keywords, and domain context. Loaded every session to give Claude explicit routing rules for all 58 AgentSpec agents./component-modelDecides where new logic lives in the component model — agent, skill, command, KB, or
template — and how to keep components in their layer, routing each decision to the
right authoring resource and running the fat-to-thin refactor when a component has
outgrown its layer. Loaded by the authoring flows (create-skill, create-agent,
kb-build, create-kb) as their layer-decision gate. Use for "should this be an agent
or a skill", "where does this logic go", adding a new component, "this agent is too
big", or restructuring/refactoring an agent into skills. Do not use to author the
chosen component itself — that is create-skill, create-agent, or /create-kb.
/data-engineering-guideOther plugins' skills for the same job