Quick spec generation with interactive or automatic mode
If --auto flag is present in $ARGUMENTS, you are in AUTOMATIC MODE.
In Automatic Mode:
Execute 4 spec phases sequentially. In automatic mode, execute all phases without stopping. In interactive mode, prompt user for approval between phases.
Before claiming quick generation is complete, run one lightweight sanity review over the generated requirements, design, and tasks. If multi-agent is available, use a fresh sub-agent. Otherwise run the sanity review inline.
Parse $ARGUMENTS:
--auto: Automatic Mode (execute all 4 phases)--auto flag if present)Example:
"User profile with avatar upload --auto" → mode=automatic, description="User profile with avatar upload"
"User profile feature" → mode=interactive, description="User profile feature"
Display mode banner and proceed to Step 2.
Execute these 4 phases in order:
Core Logic:
Check for Brief:
{{KIRO_DIR}}/specs/{feature-name}/brief.md exists (created by $kiro-discovery), read it for discovery context (problem, approach, scope, constraints)$ARGUMENTSGenerate Feature Name:
Check Uniqueness:
{{KIRO_DIR}}/specs/*/brief.md (no spec.json), use that directory (discovery created it)-2, -3, etc.Create Directory:
mkdir -p {{KIRO_DIR}}/specs/{feature-name} (skip if already exists from discovery)Initialize Files from Templates:
a. Read templates:
- {{KIRO_DIR}}/settings/templates/specs/init.json
- {{KIRO_DIR}}/settings/templates/specs/requirements-init.md
b. Replace placeholders:
{{FEATURE_NAME}} → feature-name
{{TIMESTAMP}} → current ISO 8601 timestamp (use `date -u +"%Y-%m-%dT%H:%M:%SZ"`)
{{PROJECT_DESCRIPTION}} → description
{{LANG_CODE}} → language code (detect from user's input language, default to `en`)
c. Write files using Write tool:
- {{KIRO_DIR}}/specs/{feature-name}/spec.json
- {{KIRO_DIR}}/specs/{feature-name}/requirements.md
Output Progress: "Phase 1/4 complete: Spec initialized at {{KIRO_DIR}}/specs/{feature-name}/"
Automatic Mode: IMMEDIATELY continue to Phase 2.
Interactive Mode: Prompt "Continue to requirements generation? (yes/no)"
Invoke $kiro-spec-requirements {feature-name}.
Wait for completion. IGNORE any "Next Step" message (it is for standalone usage).
Output Progress: "Phase 2/4 complete: Requirements generated"
Automatic Mode: IMMEDIATELY continue to Phase 3.
Interactive Mode: Prompt "Continue to design generation? (yes/no)"
Invoke $kiro-spec-design {feature-name} -y. The -y flag auto-approves requirements.
Wait for completion. IGNORE any "Next Step" message.
Output Progress: "Phase 3/4 complete: Design generated"
Automatic Mode: IMMEDIATELY continue to Phase 4.
Interactive Mode: Prompt "Continue to tasks generation? (yes/no)"
Invoke $kiro-spec-tasks {feature-name} -y. The -y flag auto-approves requirements, design, and tasks.
Wait for completion.
Output Progress: "Phase 4/4 complete: Tasks generated"
After Phase 4, run a lightweight sanity review before claiming completion.
requirements.md, design.md, and tasks.md directly from disk. If brief.md exists, use it only as supporting context._Depends:_, _Boundary:_, and (P) markers plausible for implementation?tasks.md once, then re-run the sanity review.All 4 phases plus sanity review complete.
Output final completion summary (see Output Description section) and exit.
Interactive Mode:
Quick Spec Generation (Interactive Mode)
You will be prompted at each phase.
Note: Skips gap analysis and design validation.
Automatic Mode:
Quick Spec Generation (Automatic Mode)
All phases execute automatically without prompts.
Note: Skips optional validations (gap analysis, design review) and user approval prompts. Internal review gates still run.
Final sanity review still runs.
After each phase, show brief progress:
Spec initialized at {{KIRO_DIR}}/specs/{feature}/
Requirements generated → Continuing to design...
Design generated → Continuing to tasks...
Provide output in the language specified in spec.json:
Quick Spec Generation Complete!
## Generated Files:
- {{KIRO_DIR}}/specs/{feature}/spec.json
- {{KIRO_DIR}}/specs/{feature}/requirements.md ({X} requirements)
- {{KIRO_DIR}}/specs/{feature}/design.md ({Y} components, {Z} endpoints)
- {{KIRO_DIR}}/specs/{feature}/tasks.md ({N} tasks)
Quick generation skipped:
- `$kiro-validate-gap` - Gap analysis (integration check)
- `$kiro-validate-design` - Design review (architecture validation)
Sanity review: PASSED | FOLLOW-UP REQUIRED
## Next Steps:
1. Review generated specs (especially design.md)
2. Optional validation:
- `$kiro-validate-gap {feature}` - Check integration with existing codebase
- `$kiro-validate-design {feature}` - Verify architecture quality
3. Start implementation: `$kiro-impl {feature}`
Template Missing:
{{KIRO_DIR}}/settings/templates/specs/ existsDirectory Creation Failed:
Phase Execution Failed (Phase 2-4):
$kiro-spec-{next-phase} {feature}"Sanity Review Failed:
$kiro-spec-design {feature}, $kiro-spec-tasks {feature}, or manual edits depending on the findingUser Cancellation (Interactive Mode):