$npx -y skills add gotalab/cc-sdd --skill kiro-spec-quickQuick spec generation with interactive or automatic mode
| 1 | # Quick Spec Generator |
| 2 | |
| 3 | <instructions> |
| 4 | ## CRITICAL: Automatic Mode Execution Rules |
| 5 | |
| 6 | **If `--auto` flag is present in `$ARGUMENTS`, you are in AUTOMATIC MODE.** |
| 7 | |
| 8 | In Automatic Mode: |
| 9 | - Execute ALL 4 phases in a continuous loop without stopping |
| 10 | - Display progress after each phase (e.g., "Phase 1/4 complete: spec initialized") |
| 11 | - IGNORE any "Next Step" messages from Phase 2-4 (they are for standalone usage) |
| 12 | - After Phase 4, run the final sanity review before exiting |
| 13 | - Stop ONLY after the sanity review completes or if error occurs |
| 14 | |
| 15 | --- |
| 16 | |
| 17 | ## Core Task |
| 18 | Execute 4 spec phases sequentially. In automatic mode, execute all phases without stopping. In interactive mode, prompt user for approval between phases. |
| 19 | |
| 20 | Before claiming quick generation is complete, run one lightweight sanity review over the generated requirements, design, and tasks. If the host supports fresh sub-agents, use one. Otherwise run the sanity review inline. |
| 21 | |
| 22 | ## Execution Steps |
| 23 | |
| 24 | ### Step 1: Parse Arguments and Initialize |
| 25 | |
| 26 | Parse `$ARGUMENTS`: |
| 27 | - If contains `--auto`: **Automatic Mode** (execute all 4 phases) |
| 28 | - Otherwise: **Interactive Mode** (prompt at each phase) |
| 29 | - Extract description (remove `--auto` flag if present) |
| 30 | |
| 31 | Example: |
| 32 | ``` |
| 33 | "User profile with avatar upload --auto" → mode=automatic, description="User profile with avatar upload" |
| 34 | "User profile feature" → mode=interactive, description="User profile feature" |
| 35 | ``` |
| 36 | |
| 37 | Display mode banner and proceed to Step 2. |
| 38 | |
| 39 | ### Step 2: Execute Phase Loop |
| 40 | |
| 41 | Execute these 4 phases in order: |
| 42 | |
| 43 | --- |
| 44 | |
| 45 | #### Phase 1: Initialize Spec (Direct Implementation) |
| 46 | |
| 47 | **Core Logic**: |
| 48 | |
| 49 | 1. **Check for Brief**: |
| 50 | - If `{{KIRO_DIR}}/specs/{feature-name}/brief.md` exists (created by `/kiro-discovery`), read it for discovery context (problem, approach, scope, constraints) |
| 51 | - Use brief content as the project description instead of `$ARGUMENTS` |
| 52 | |
| 53 | 2. **Generate Feature Name**: |
| 54 | - Convert description to kebab-case |
| 55 | - Example: "User profile with avatar upload" → "user-profile-avatar-upload" |
| 56 | - Keep name concise (2-4 words ideally) |
| 57 | |
| 58 | 3. **Check Uniqueness**: |
| 59 | - Use Glob to check `{{KIRO_DIR}}/specs/*/` |
| 60 | - If directory exists with only `brief.md` (no `spec.json`), use that directory (discovery created it) |
| 61 | - Otherwise if feature name exists, append `-2`, `-3`, etc. |
| 62 | |
| 63 | 4. **Create Directory**: |
| 64 | - Use Bash: `mkdir -p {{KIRO_DIR}}/specs/{feature-name}` (skip if already exists from discovery) |
| 65 | |
| 66 | 5. **Initialize Files from Templates**: |
| 67 | |
| 68 | a. Read templates: |
| 69 | ``` |
| 70 | - {{KIRO_DIR}}/settings/templates/specs/init.json |
| 71 | - {{KIRO_DIR}}/settings/templates/specs/requirements-init.md |
| 72 | ``` |
| 73 | |
| 74 | b. Replace placeholders: |
| 75 | ``` |
| 76 | {{FEATURE_NAME}} → feature-name |
| 77 | {{TIMESTAMP}} → current ISO 8601 timestamp (use `date -u +"%Y-%m-%dT%H:%M:%SZ"`) |
| 78 | {{PROJECT_DESCRIPTION}} → description |
| 79 | {{LANG_CODE}} → language code (detect from user's input language, default to `en`) |
| 80 | ``` |
| 81 | |
| 82 | c. Write files using Write tool: |
| 83 | ``` |
| 84 | - {{KIRO_DIR}}/specs/{feature-name}/spec.json |
| 85 | - {{KIRO_DIR}}/specs/{feature-name}/requirements.md |
| 86 | ``` |
| 87 | |
| 88 | 6. **Output Progress**: "Phase 1/4 complete: Spec initialized at {{KIRO_DIR}}/specs/{feature-name}/" |
| 89 | |
| 90 | **Automatic Mode**: IMMEDIATELY continue to Phase 2. |
| 91 | |
| 92 | **Interactive Mode**: Prompt "Continue to requirements generation? (yes/no)" |
| 93 | - If "no": Stop, show current state |
| 94 | - If "yes": Continue to Phase 2 |
| 95 | |
| 96 | --- |
| 97 | |
| 98 | #### Phase 2: Generate Requirements |
| 99 | |
| 100 | Invoke `/kiro-spec-requirements {feature-name}`. |
| 101 | |
| 102 | Wait for completion. IGNORE any "Next Step" message (it is for standalone usage). |
| 103 | |
| 104 | **Output Progress**: "Phase 2/4 complete: Requirements generated" |
| 105 | |
| 106 | **Automatic Mode**: IMMEDIATELY continue to Phase 3. |
| 107 | |
| 108 | **Interactive Mode**: Prompt "Continue to design generation? (yes/no)" |
| 109 | - If "no": Stop, show current state |
| 110 | - If "yes": Continue to Phase 3 |
| 111 | |
| 112 | --- |
| 113 | |
| 114 | #### Phase 3: Generate Design |
| 115 | |
| 116 | Invoke `/kiro-spec-design {feature-name} -y`. The `-y` flag auto-approves requirements. |
| 117 | |
| 118 | Wait for completion. IGNORE any "Next Step" message. |
| 119 | |
| 120 | **Output Progress**: "Phase 3/4 complete: Design generated" |
| 121 | |
| 122 | **Automatic Mode**: IMMEDIATELY continue to Phase 4. |
| 123 | |
| 124 | **Interactive Mode**: Prompt "Continue to tasks generation? (yes/no)" |
| 125 | - If "no": Stop, show current state |
| 126 | - If "yes": Continue to Phase 4 |
| 127 | |
| 128 | --- |
| 129 | |
| 130 | #### Phase 4: Generate Tasks |
| 131 | |
| 132 | Invoke `/kiro-spec-tasks {feature-name} -y`. The `-y` flag auto-approves requirements, design, and tasks. |
| 133 | |
| 134 | Wait for completion. |
| 135 | |
| 136 | **Output Progress**: "Phase 4/4 complete: Tasks generated" |
| 137 | |
| 138 | #### Final Sanity Review |
| 139 | |
| 140 | After Phase 4, run a lightweight sanity review before claiming completion. |
| 141 | |
| 142 | - Review `requirements.md`, `design.md`, and `tasks.md` directly from disk. If `brief.md` exists, use it only as supporting context. |
| 143 | - Prefer a fresh review sub-agent when the host supports it. Pass only file paths and the review objective; the reviewer should read the generated files itself. |
| 144 | - Review focus: |
| 145 | - Do requirements, design, and tasks tell a coherent |