Collect and validate detailed requirements for the active feature through structured dialogue
Collect detailed, structured requirements for the current feature through iterative dialogue until understanding reaches >95%.
$ARGUMENTS — Feature name (optional, detected from branch if on feature/*)feature/<name>, use as feature name (unless $ARGUMENTS overrides)project_flow__feature_get to verify the feature is registered
/claude-project-flow:feature-init first and stopproject_flow__settings_get to resolve the docs path:
project_overrides[project_name] firstdefault_projects_path/project_name/FEATURE_DIR = <resolved_path>/features/<feature_name>/FEATURE_DIR exists — if not, suggest /claude-project-flow:feature-initRead FEATURE_DIR/context/.requirements-status.json if it exists:
{
"status": "incomplete" | "complete",
"coverage": 0-100,
"last_updated": "ISO date",
"completion_reason": "string",
"pending_questions": ["question1", "question2"]
}
Attenzione: I requisiti di questa feature non sono ancora completi (copertura: X%). Domande ancora aperte:
- question1
- question2
I requisiti sono stati completati (copertura: X%). Vuoi:
- Rivedere i requisiti esistenti
- Aggiungere nuovi requisiti
- Modificare requisiti esistenti
Before starting the collection, search the knowledge base for similar requirements already defined in other projects.
project_flow__knowledge_search with:
query: feature name + keywords from feature-definition.mdcategory: requirementRequisiti simili trovati in altri progetti:
Progetto: <project_name> — Feature: <feature_name>
- FR-1: <title> — <brief description>
- FR-2: <title> — <brief description>
- File:
<file_path>Progetto: <other_project> — Feature: <other_feature>
- ...
Vuoi:
- Approfondire una soluzione esistente (leggo i dettagli dal progetto originale)
- Ignorare e partire da zero con una nuova implementazione
- Proseguire — tengo presente come riferimento ma non vincola
requirements.md from the matched feature's directorySoluzione trovata in {project}/{feature}: [summary of requirements, approach, key decisions]
Vuoi:
- Riusare questi requisiti come base (li copio e adatto)
- Solo come riferimento — proseguo con raccolta nuova
IMPORTED with source reference, then go to Step 4 for gap-fillingFEATURE_DIR/feature-definition.md for the descriptionDeduzione iniziale da "{feature_name}":
[deduction summary as bullet points]
Questa è la mia comprensione iniziale. Ora ho bisogno di una descrizione dettagliata da te per costruire i requisiti completi.
Ask the user:
Descrivi in dettaglio cosa deve fare questa feature. Includi: obiettivi, comportamento atteso, vincoli, edge case noti, e qualsiasi dettaglio che ritieni importante. Più informazioni fornisci ora, meno domande saranno necessarie dopo.
After the user responds, analyze the input and estimate a coverage percentage based on:
Generate targeted questions to fill the gaps. Present them as a numbered checklist grouped by category:
Comprensione attuale: X%. Ho bisogno di chiarimenti su questi punti:
Comportamento funzionale:
- 1. [question about missing behavior]
- 2. [question about missing behavior]
Edge case e gestione errori:
- 3. [question about edge case]
Vincoli tecnici:
- 4. [question about constraints]
Criteri di accettazione:
- 5. [question about acceptance criteria]
Confini di scope:
- 6. [question about what's excluded]
Rispondi ai punti che ritieni importanti. Puoi anche dire "non rilevante" per quelli che vuoi saltare.
After each round of answers:
Important: Save progress after each round by updating .requirements-status.json with current coverage and remaining questions. This ensures continuity if the session is interrupted.
Create FEATURE_DIR/requirements/requirements.md:
# Requirements: <feature_name>
> Coverage: X% | Status: complete/incomplete | Last updated: <ISO date>
## Functional Requirements
### FR-1: <title>
<description>
**Acceptance criteria:**
- [ ] <testable condition>
### FR-2: <title>
...
## Non-Functional Requirements
### NFR-1: <title>
<description>
## Edge Cases
### EC-1: <title>
<expected behavior>
## Out of Scope
- <explicitly excluded item>
## Open Questions
- <any remaining uncertainty, only if coverage < 95%>
---
## Changelog
| Date | Type | ID | Description |
|------|------|----|-------------|
| <ISO date> | CREATED | ALL | Initial requirements generation |
| <ISO date> | IMPORTED | FR-N | Imported from <project>/<feature> (if applicable) |
Changelog types:
CREATED — Initial generationIMPORTED — Requirement imported from another project (with source reference)ADDED — New requirement added post-completionMODIFIED — Existing requirement changedREMOVED — Requirement removed (strikethrough, not deleted)After generating:
When adding or modifying requirements after initial completion:
| <ISO date> | ADDED | FR-N | <brief description> |
| <ISO date> | MODIFIED | FR-N | <what changed and why> |
| <ISO date> | REMOVED | FR-N | <reason for removal> |
After any change, re-evaluate coverage and update .requirements-status.json.
Update FEATURE_DIR/context/.requirements-status.json with final state.
{
"status": "complete",
"coverage": <percentage>,
"last_updated": "<ISO date>",
"completion_reason": "All requirement areas sufficiently covered",
"pending_questions": []
}
{
"status": "incomplete",
"coverage": <percentage>,
"last_updated": "<ISO date>",
"completion_reason": null,
"pending_questions": ["remaining question 1", "remaining question 2"]
}
When requirements are complete (coverage >= 95%) or after any post-completion change, index the requirements into the knowledge base for cross-project search.
Call project_flow__knowledge_index with:
path: FEATURE_DIR/requirements/requirements.mdThis makes the requirements searchable from other projects via knowledge_search, enabling Step 3's cross-project discovery.
Knowledge entry metadata:
project: current project namecategory: requirementtitle: Requirements: <feature_name>content: full requirements document textThis indexing is what powers the cross-project search in Step 3. Every completed requirements set becomes discoverable by future features across all projects.
Call project_flow__feature_update with:
project: project namename: feature namestatus: requirements-done if complete, keep current status if incompleteRequisiti {feature_name}: {status}
- Copertura: X%
- Requisiti funzionali: N
- Requisiti non-funzionali: N
- Edge case: N
- File:
requirements/requirements.md{if incomplete: "Riprendi con
/claude-project-flow:feature-requirementsnella prossima sessione."} {if complete: "Prossimo passo: pianificazione implementazione."}