epci:spec
Create comprehensive technical specifications from CDC (Cahier des Charges) or brief output. Decomposes features into 1-2h atomic tasks with 15-30min steps. Generates Markdown specs (index.md + task-X
Files18
View on GitHubSKILL.mdsrc/skills/spec/SKILL.md
GitHubSpec โ Technical Specification Generator
Transform CDC/brief documents into executable technical specifications with Ralph-ready artifacts.
Quick Start
/spec auth-oauth # From description
/spec auth-oauth @docs/briefs/auth/brief.md # From brief file
/spec auth-oauth @"OAuth integration for users" # From inline description
MANDATORY EXECUTION RULES (READ FIRST):
- ๐ด NEVER generate specs without understanding the source
- ๐ด NEVER skip @decompose-validator before generation
- ๐ด NEVER create circular dependencies in task DAG
- ๐ด NEVER exceed granularity limits (tasks 1-2h, steps 15-30min)
- ๐ด NEVER call EnterPlanMode during skill execution
- โ ALWAYS start with step-00-init.md
- โ ALWAYS follow next_step from each step
- โ ALWAYS present breakpoints at phase transitions
- โ ALWAYS validate with @decompose-validator before generation
- โ FORBIDDEN generating PRD.json with missing acceptance criteria
- ๐ต YOU ARE A METHODICAL SPECIFICATION WRITER following EPCI discipline
- ๐ญ FOCUS on one phase at a time, complete before proceeding
EXECUTION PROTOCOLS:
- Load step-00-init.md
- Execute current step protocols completely
- Present breakpoint if specified in step
- Evaluate next step trigger conditions
- Proceed to next_step or conditional_next
CONTEXT BOUNDARIES:
- IN scope: Transforming CDC/briefs into specs, task decomposition, Ralph artifacts
- OUT scope: Ideation (use /brainstorm), implementation (use /implement or /quick)
Input Detection
INPUT
โโโ @docs/briefs/*.md โ BRIEF-FIRST workflow
โ โโ Parse CDC sections, extract requirements
โโโ @"text description" โ TEXT workflow
โ โโ Clarify with clarification-engine, then proceed
โโโ feature-slug only โ DISCOVERY workflow
โโ Search for existing brief, else ask for input
Workflow Overview
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SPEC WORKFLOW (3 Phases) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ Step 00: INIT โ
โ โโ Parse input, detect source type โ
โ โโ Load project context via project-memory โ
โ โโ If no source โ ask for brief/description โ
โ โ
โ Step 01: ANALYZE & DECOMPOSE โ
โ โโ Parse CDC/brief structure โ
โ โโ Calculate complexity via complexity-calculator โ
โ โโ Decompose into tasks (1-2h) with steps (15-30min) โ
โ โโ Build DAG (dependency graph) โ
โ โโ Validate with @decompose-validator โ
โ โโ BREAKPOINT: Decomposition review โ
โ โ
โ Step 02: GENERATE SPECS โ
โ โโ Create docs/specs/{slug}/ directory โ
โ โโ Generate index.md (orchestrator) โ
โ โโ Generate task-XXX.md for each task โ
โ โโ Generate {slug}.prd.json (machine-readable) โ
โ โโ BREAKPOINT: Specs review โ
โ โ
โ Step 03: GENERATE RALPH โ
โ โโ Detect project stack โ
โ โโ Create .ralph/{slug}/ directory โ
โ โโ Generate PROMPT.md (stack-aware) โ
โ โโ Generate MEMORY.md (template) โ
โ โโ Generate ralph.sh (runner) โ
โ โโ Update .ralph/index.json โ
โ โโ BREAKPOINT: Completion summary with routing โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Steps
| Step | Name | Description |
|---|---|---|
| 00 | init | Parse input, detect source, load context |
| 01 | analyze | Decompose into tasks, build DAG, validate |
| 02 | generate-specs | Create index.md, task-XXX.md, PRD.json |
| 03 | generate-ralph | Create Ralph artifacts |
Granularity Rules
| Level | Duration | Purpose |
|---|---|---|
| Task | 1-2 hours | Human-readable units, complete deliverables |
| Step | 15-30 minutes | Atomic execution units for Ralph |
Task Structure
Each task-XXX.md contains:
- YAML frontmatter (id, title, deps, complexity, effort)
- Objective section
- Acceptance Criteria (Given-When-Then or checklist)
- Steps section (numbered 15-30min steps)
- Files to modify/create
- Test approach
Step Structure
Each step within a task:
- Action verb title
- Expected duration
- Input requirements
- Output deliverable
- Validation criteria
Decision Tree
IF source is brief (@*.md):
โ Parse sections, extract requirements
โ Calculate complexity
โ Proceed to decomposition
ELSE IF source is text (@"..."):
โ Clarify with clarification-engine if needed
โ Convert to structured requirements
โ Proceed to decomposition
ELSE IF no source:
โ Search for existing brief in docs/briefs/{slug}/
โ If found โ use it
โ If not found โ ask user for input
Step Files
- steps/step-00-init.md โ Initialization
- steps/step-01-analyze.md โ Analysis & Decomposition
- steps/step-02-generate-specs.md โ Specs Generation
- steps/step-03-generate-ralph.md โ Ralph Generation
Reference Files
- references/task-format.md โ Task file format
- references/prd-schema.md โ PRD.json schema
- references/ralph-generation.md โ Ralph artifacts guide
Templates
- templates/index.md.template โ Index template
- templates/task.md.template โ Task template
- templates/prompt.md.template โ Ralph PROMPT template
Output Structure
docs/specs/{feature-slug}/
โโโ index.md # Orchestrator (table + Mermaid DAG + context)
โโโ task-001-{slug}.md # Task 1 (1-2h, with Steps)
โโโ task-002-{slug}.md # Task 2
โโโ ...
โโโ {feature-slug}.prd.json # Machine version (Ralph-ready)
.ralph/{feature-slug}/
โโโ PROMPT.md # Claude Code instructions (stack-aware)
โโโ MEMORY.md # Persistent context (template)
โโโ ralph.sh # Runner script
Shared Components Used
epci:complexity-calculatorโ Scope estimation for routingepci:project-memoryโ Velocity calibration, conventionsepci:clarification-engineโ Input clarification if neededepci:breakpoint-systemโ Phase checkpoints@decompose-validatorโ DAG validation
Subagents
| Agent | Model | Usage |
|---|---|---|
| @decompose-validator | Opus | Validate DAG before generation |
| @Explore | - | Codebase analysis for context |
Breakpoints
This skill uses these breakpoint types:
- decomposition: Task table + DAG review (Step 01)
- plan-review: Specs preview (Step 02)
- validation: Completion summary with routing (Step 03)
Complexity Routing (at completion)
| Complexity | Workflow |
|---|---|
| TINY/SMALL | Recommend /quick |
| STANDARD/LARGE | Recommend /implement |
Error Handling
| Error | Cause | Recovery |
|---|---|---|
| @decompose-validator NEEDS_REVISION | Circular deps, missing coverage | Fix issues, re-decompose |
| Brief parsing failure | Malformed brief | Ask for clarification |
| Stack detection failure | No project markers | Use generic templates |
| Granularity violation | Task too large/small | Split or merge tasks |
Constraints
| Constraint | Value | Rationale |
|---|---|---|
| Max tasks | 20 | Avoid overwhelming complexity |
| Min tasks | 2 | At least 2 for meaningful spec |
| Task duration | 1-2h | Goldilocks zone |
| Step duration | 15-30min | Atomic execution |
| AC per task | >= 2 | Quality gate |
INVOCATION PROTOCOL (CRITICAL)
Les syntaxes @skill:epci:xxx et @agent:xxx dans les step files sont DOCUMENTAIRES SEULEMENT.
Claude interprรจte les blocs de code comme des exemples, pas comme des instructions d'exรฉcution.
Pour invoquer rรฉellement:
| Type | Syntaxe documentaire | Invocation rรฉelle |
|---|---|---|
| Breakpoints | @skill:epci:breakpoint-system |
Section impรฉrative + AskUserQuestion explicite |
| Agents | @agent:decompose-validator |
Task({ subagent_type: "decompose-validator", ... }) |
| Core skills | @skill:epci:project-memory |
Read(".claude/state/...") pour fichiers d'รฉtat |
Rรจgle pour auteurs de step files:
- Utiliser le format impรฉratif direct (pas dans bloc de code)
- Afficher les boรฎtes ASCII hors bloc exรฉcutable
- Appeler AskUserQuestion explicitement
- Ajouter
โธ๏ธ ATTENDS la rรฉponseaprรจs chaque breakpoint
Limitations
This skill does NOT:
- Ideate or explore (use /brainstorm)
- Implement code (use /implement or /quick)
- Debug existing code (use /debug)
- Create new skills (use /factory)
- Execute Ralph batches (use ralph.sh directly)