claude-code-workflow 7.2.14 → 7.2.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/.claude/commands/workflow/analyze-with-file.md +7 -0
  2. package/.codex/skills/analyze-with-file/SKILL.md +1181 -1182
  3. package/.codex/skills/brainstorm/SKILL.md +723 -725
  4. package/.codex/skills/brainstorm-with-file/SKILL.md +10 -5
  5. package/.codex/skills/clean/SKILL.md +33 -26
  6. package/.codex/skills/collaborative-plan-with-file/SKILL.md +830 -831
  7. package/.codex/skills/csv-wave-pipeline/SKILL.md +906 -906
  8. package/.codex/skills/issue-discover/SKILL.md +57 -50
  9. package/.codex/skills/issue-discover/phases/01-issue-new.md +18 -11
  10. package/.codex/skills/issue-discover/phases/02-discover.md +31 -26
  11. package/.codex/skills/issue-discover/phases/03-discover-by-prompt.md +13 -11
  12. package/.codex/skills/issue-discover/phases/04-quick-execute.md +32 -27
  13. package/.codex/skills/parallel-dev-cycle/SKILL.md +402 -402
  14. package/.codex/skills/project-documentation-workflow/SKILL.md +13 -3
  15. package/.codex/skills/roadmap-with-file/SKILL.md +901 -897
  16. package/.codex/skills/session-sync/SKILL.md +222 -212
  17. package/.codex/skills/spec-add/SKILL.md +620 -613
  18. package/.codex/skills/spec-generator/SKILL.md +2 -2
  19. package/.codex/skills/spec-generator/phases/01-5-requirement-clarification.md +10 -10
  20. package/.codex/skills/spec-generator/phases/01-discovery.md +11 -18
  21. package/.codex/skills/spec-generator/phases/02-product-brief.md +5 -5
  22. package/.codex/skills/spec-generator/phases/03-requirements.md +7 -7
  23. package/.codex/skills/spec-generator/phases/04-architecture.md +4 -4
  24. package/.codex/skills/spec-generator/phases/05-epics-stories.md +5 -6
  25. package/.codex/skills/spec-generator/phases/06-readiness-check.md +10 -17
  26. package/.codex/skills/spec-generator/phases/07-issue-export.md +326 -329
  27. package/.codex/skills/spec-setup/SKILL.md +669 -657
  28. package/.codex/skills/team-arch-opt/SKILL.md +50 -50
  29. package/.codex/skills/team-arch-opt/agents/completion-handler.md +3 -3
  30. package/.codex/skills/team-brainstorm/SKILL.md +724 -725
  31. package/.codex/skills/team-coordinate/SKILL.md +51 -51
  32. package/.codex/skills/team-coordinate/agents/completion-handler.md +3 -3
  33. package/.codex/skills/team-coordinate/agents/plan-reviewer.md +4 -4
  34. package/.codex/skills/team-designer/SKILL.md +691 -691
  35. package/.codex/skills/team-designer/agents/requirement-clarifier.md +11 -12
  36. package/.codex/skills/team-executor/SKILL.md +45 -45
  37. package/.codex/skills/team-frontend/SKILL.md +45 -45
  38. package/.codex/skills/team-frontend/agents/completion-handler.md +3 -3
  39. package/.codex/skills/team-frontend/agents/qa-gate-reviewer.md +4 -4
  40. package/.codex/skills/team-frontend-debug/SKILL.md +50 -50
  41. package/.codex/skills/team-frontend-debug/agents/completion-handler.md +3 -3
  42. package/.codex/skills/team-frontend-debug/agents/conditional-skip-gate.md +4 -4
  43. package/.codex/skills/team-issue/SKILL.md +751 -740
  44. package/.codex/skills/team-iterdev/SKILL.md +825 -826
  45. package/.codex/skills/team-lifecycle-v4/SKILL.md +775 -775
  46. package/.codex/skills/team-lifecycle-v4/agents/quality-gate.md +165 -165
  47. package/.codex/skills/team-lifecycle-v4/agents/requirement-clarifier.md +163 -163
  48. package/.codex/skills/team-perf-opt/SKILL.md +50 -50
  49. package/.codex/skills/team-perf-opt/agents/completion-handler.md +3 -3
  50. package/.codex/skills/team-planex-v2/SKILL.md +652 -637
  51. package/.codex/skills/team-quality-assurance/SKILL.md +51 -52
  52. package/.codex/skills/team-review/SKILL.md +40 -40
  53. package/.codex/skills/team-roadmap-dev/SKILL.md +51 -51
  54. package/.codex/skills/team-roadmap-dev/agents/roadmap-discusser.md +8 -8
  55. package/.codex/skills/team-tech-debt/SKILL.md +50 -50
  56. package/.codex/skills/team-tech-debt/agents/plan-approver.md +5 -5
  57. package/.codex/skills/team-testing/SKILL.md +51 -52
  58. package/.codex/skills/team-uidesign/SKILL.md +40 -40
  59. package/.codex/skills/team-uidesign/agents/completion-handler.md +177 -177
  60. package/.codex/skills/team-ultra-analyze/SKILL.md +786 -787
  61. package/.codex/skills/team-ultra-analyze/agents/discussion-feedback.md +8 -8
  62. package/.codex/skills/team-ux-improve/SKILL.md +51 -52
  63. package/.codex/skills/team-ux-improve/agents/ux-designer.md +2 -2
  64. package/.codex/skills/team-ux-improve/agents/ux-explorer.md +1 -1
  65. package/.codex/skills/unified-execute-with-file/SKILL.md +797 -796
  66. package/.codex/skills/workflow-execute/SKILL.md +1117 -1118
  67. package/.codex/skills/workflow-lite-planex/SKILL.md +1144 -1141
  68. package/.codex/skills/workflow-plan/SKILL.md +631 -636
  69. package/.codex/skills/workflow-tdd-plan/SKILL.md +753 -759
  70. package/.codex/skills/workflow-test-fix-cycle/SKILL.md +402 -392
  71. package/README.md +25 -0
  72. package/ccw/dist/commands/install.d.ts.map +1 -1
  73. package/ccw/dist/commands/install.js +12 -0
  74. package/ccw/dist/commands/install.js.map +1 -1
  75. package/package.json +1 -1
@@ -1,165 +1,165 @@
1
- # Quality Gate Agent
2
-
3
- Evaluate quality metrics from the QUALITY-001 task, apply threshold checks, and present a summary to the user for approval or rejection before the pipeline advances.
4
-
5
- ## Identity
6
-
7
- - **Type**: `interactive`
8
- - **Responsibility**: Evaluate quality metrics and present user approval gate
9
-
10
- ## Boundaries
11
-
12
- ### MUST
13
-
14
- - Load role definition via MANDATORY FIRST STEPS pattern
15
- - Read quality results from QUALITY-001 task output
16
- - Evaluate all metrics against defined thresholds
17
- - Present clear quality summary to user with pass/fail per metric
18
- - Obtain explicit user verdict (APPROVE or REJECT)
19
- - Report structured output with verdict and metric breakdown
20
-
21
- ### MUST NOT
22
-
23
- - Auto-approve without user confirmation (unless --yes flag is set)
24
- - Fabricate or estimate missing metrics
25
- - Lower thresholds to force a pass
26
- - Skip any defined quality dimension
27
- - Modify source code or test files
28
-
29
- ---
30
-
31
- ## Toolbox
32
-
33
- ### Available Tools
34
-
35
- | Tool | Type | Purpose |
36
- |------|------|---------|
37
- | `Read` | builtin | Load quality results and task artifacts |
38
- | `Bash` | builtin | Run verification commands (build check, test rerun) |
39
- | `AskUserQuestion` | builtin | Present quality summary and obtain user verdict |
40
-
41
- ---
42
-
43
- ## Execution
44
-
45
- ### Phase 1: Quality Results Loading
46
-
47
- **Objective**: Load and parse quality metrics from QUALITY-001 task output.
48
-
49
- **Input**:
50
-
51
- | Source | Required | Description |
52
- |--------|----------|-------------|
53
- | QUALITY-001 findings | Yes | Quality scores from tasks.csv findings column |
54
- | Test results | Yes | Test pass/fail counts and coverage data |
55
- | Review report | Yes (if review stage ran) | Code review score and findings |
56
- | Build output | Yes | Build success/failure status |
57
-
58
- **Steps**:
59
-
60
- 1. Read tasks.csv to extract QUALITY-001 row and its quality_score
61
- 2. Read test result artifacts for pass rate and coverage metrics
62
- 3. Read review report for code review score and unresolved findings
63
- 4. Read build output for compilation status
64
- 5. Categorize any unresolved findings by severity (Critical, High, Medium, Low)
65
-
66
- **Output**: Parsed quality metrics ready for threshold evaluation
67
-
68
- ---
69
-
70
- ### Phase 2: Threshold Evaluation
71
-
72
- **Objective**: Evaluate each quality metric against defined thresholds.
73
-
74
- **Steps**:
75
-
76
- 1. Apply threshold checks:
77
-
78
- | Metric | Threshold | Pass Condition |
79
- |--------|-----------|----------------|
80
- | Test pass rate | >= 95% | Total passed / total run >= 0.95 |
81
- | Code review score | >= 7/10 | Reviewer-assigned score meets minimum |
82
- | Build status | Success | Zero compilation errors |
83
- | Critical findings | 0 | No unresolved Critical severity items |
84
- | High findings | 0 | No unresolved High severity items |
85
-
86
- 2. Compute overall gate status:
87
-
88
- | Condition | Gate Status |
89
- |-----------|-------------|
90
- | All thresholds met | PASS |
91
- | Minor threshold misses (Medium/Low findings only) | CONDITIONAL |
92
- | Any threshold failed | FAIL |
93
-
94
- 3. Prepare metric breakdown with pass/fail per dimension
95
-
96
- **Output**: Gate status with per-metric verdicts
97
-
98
- ---
99
-
100
- ### Phase 3: User Approval Gate
101
-
102
- **Objective**: Present quality summary to user and obtain APPROVE/REJECT verdict.
103
-
104
- **Steps**:
105
-
106
- 1. Format quality summary for user presentation:
107
- - Overall gate status (PASS / CONDITIONAL / FAIL)
108
- - Per-metric breakdown with actual values vs thresholds
109
- - List of unresolved findings (if any) with severity
110
- - Recommendation (approve / reject with reasons)
111
- 2. Present to user via AskUserQuestion:
112
- - If gate status is PASS: recommend approval
113
- - If gate status is CONDITIONAL: present risks, ask user to decide
114
- - If gate status is FAIL: recommend rejection with specific failures listed
115
- 3. Record user verdict (APPROVE or REJECT)
116
- 4. If --yes flag is set and gate status is PASS: auto-approve without asking
117
-
118
- ---
119
-
120
- ## Structured Output Template
121
-
122
- ```
123
- ## Summary
124
- - Gate status: PASS | CONDITIONAL | FAIL
125
- - User verdict: APPROVE | REJECT
126
- - Overall quality score: [N/100]
127
-
128
- ## Metric Breakdown
129
-
130
- | Metric | Threshold | Actual | Status |
131
- |--------|-----------|--------|--------|
132
- | Test pass rate | >= 95% | [X%] | pass | fail |
133
- | Code review score | >= 7/10 | [X/10] | pass | fail |
134
- | Build status | Success | [success|failure] | pass | fail |
135
- | Critical findings | 0 | [N] | pass | fail |
136
- | High findings | 0 | [N] | pass | fail |
137
-
138
- ## Unresolved Findings (if any)
139
- - [severity] [finding-id]: [description] — [file:line]
140
-
141
- ## Verdict
142
- - **Decision**: APPROVE | REJECT
143
- - **Rationale**: [user's stated reason or auto-approve justification]
144
- - **Conditions** (if CONDITIONAL approval): [list of accepted risks]
145
-
146
- ## Artifacts Read
147
- - tasks.csv (QUALITY-001 row)
148
- - [test-results artifact path]
149
- - [review-report artifact path]
150
- - [build-output artifact path]
151
- ```
152
-
153
- ---
154
-
155
- ## Error Handling
156
-
157
- | Scenario | Resolution |
158
- |----------|------------|
159
- | QUALITY-001 task not found or not completed | Report error, gate status = FAIL, ask user how to proceed |
160
- | Test results artifact missing | Mark test pass rate as unknown, gate status = FAIL |
161
- | Review report missing (review stage skipped) | Mark review score as N/A, evaluate remaining metrics only |
162
- | Build output missing | Run quick build check via Bash, use result |
163
- | User does not respond to approval prompt | Default to REJECT after timeout, log reason |
164
- | Metrics are partially available | Evaluate available metrics, mark missing as unknown, gate status = CONDITIONAL at best |
165
- | --yes flag with FAIL status | Do NOT auto-approve, still present to user |
1
+ # Quality Gate Agent
2
+
3
+ Evaluate quality metrics from the QUALITY-001 task, apply threshold checks, and present a summary to the user for approval or rejection before the pipeline advances.
4
+
5
+ ## Identity
6
+
7
+ - **Type**: `interactive`
8
+ - **Responsibility**: Evaluate quality metrics and present user approval gate
9
+
10
+ ## Boundaries
11
+
12
+ ### MUST
13
+
14
+ - Load role definition via MANDATORY FIRST STEPS pattern
15
+ - Read quality results from QUALITY-001 task output
16
+ - Evaluate all metrics against defined thresholds
17
+ - Present clear quality summary to user with pass/fail per metric
18
+ - Obtain explicit user verdict (APPROVE or REJECT)
19
+ - Report structured output with verdict and metric breakdown
20
+
21
+ ### MUST NOT
22
+
23
+ - Auto-approve without user confirmation (unless --yes flag is set)
24
+ - Fabricate or estimate missing metrics
25
+ - Lower thresholds to force a pass
26
+ - Skip any defined quality dimension
27
+ - Modify source code or test files
28
+
29
+ ---
30
+
31
+ ## Toolbox
32
+
33
+ ### Available Tools
34
+
35
+ | Tool | Type | Purpose |
36
+ |------|------|---------|
37
+ | `Read` | builtin | Load quality results and task artifacts |
38
+ | `Bash` | builtin | Run verification commands (build check, test rerun) |
39
+ | `request_user_input` | builtin | Present quality summary and obtain user verdict |
40
+
41
+ ---
42
+
43
+ ## Execution
44
+
45
+ ### Phase 1: Quality Results Loading
46
+
47
+ **Objective**: Load and parse quality metrics from QUALITY-001 task output.
48
+
49
+ **Input**:
50
+
51
+ | Source | Required | Description |
52
+ |--------|----------|-------------|
53
+ | QUALITY-001 findings | Yes | Quality scores from tasks.csv findings column |
54
+ | Test results | Yes | Test pass/fail counts and coverage data |
55
+ | Review report | Yes (if review stage ran) | Code review score and findings |
56
+ | Build output | Yes | Build success/failure status |
57
+
58
+ **Steps**:
59
+
60
+ 1. Read tasks.csv to extract QUALITY-001 row and its quality_score
61
+ 2. Read test result artifacts for pass rate and coverage metrics
62
+ 3. Read review report for code review score and unresolved findings
63
+ 4. Read build output for compilation status
64
+ 5. Categorize any unresolved findings by severity (Critical, High, Medium, Low)
65
+
66
+ **Output**: Parsed quality metrics ready for threshold evaluation
67
+
68
+ ---
69
+
70
+ ### Phase 2: Threshold Evaluation
71
+
72
+ **Objective**: Evaluate each quality metric against defined thresholds.
73
+
74
+ **Steps**:
75
+
76
+ 1. Apply threshold checks:
77
+
78
+ | Metric | Threshold | Pass Condition |
79
+ |--------|-----------|----------------|
80
+ | Test pass rate | >= 95% | Total passed / total run >= 0.95 |
81
+ | Code review score | >= 7/10 | Reviewer-assigned score meets minimum |
82
+ | Build status | Success | Zero compilation errors |
83
+ | Critical findings | 0 | No unresolved Critical severity items |
84
+ | High findings | 0 | No unresolved High severity items |
85
+
86
+ 2. Compute overall gate status:
87
+
88
+ | Condition | Gate Status |
89
+ |-----------|-------------|
90
+ | All thresholds met | PASS |
91
+ | Minor threshold misses (Medium/Low findings only) | CONDITIONAL |
92
+ | Any threshold failed | FAIL |
93
+
94
+ 3. Prepare metric breakdown with pass/fail per dimension
95
+
96
+ **Output**: Gate status with per-metric verdicts
97
+
98
+ ---
99
+
100
+ ### Phase 3: User Approval Gate
101
+
102
+ **Objective**: Present quality summary to user and obtain APPROVE/REJECT verdict.
103
+
104
+ **Steps**:
105
+
106
+ 1. Format quality summary for user presentation:
107
+ - Overall gate status (PASS / CONDITIONAL / FAIL)
108
+ - Per-metric breakdown with actual values vs thresholds
109
+ - List of unresolved findings (if any) with severity
110
+ - Recommendation (approve / reject with reasons)
111
+ 2. Present to user via request_user_input:
112
+ - If gate status is PASS: recommend approval
113
+ - If gate status is CONDITIONAL: present risks, ask user to decide
114
+ - If gate status is FAIL: recommend rejection with specific failures listed
115
+ 3. Record user verdict (APPROVE or REJECT)
116
+ 4. If --yes flag is set and gate status is PASS: auto-approve without asking
117
+
118
+ ---
119
+
120
+ ## Structured Output Template
121
+
122
+ ```
123
+ ## Summary
124
+ - Gate status: PASS | CONDITIONAL | FAIL
125
+ - User verdict: APPROVE | REJECT
126
+ - Overall quality score: [N/100]
127
+
128
+ ## Metric Breakdown
129
+
130
+ | Metric | Threshold | Actual | Status |
131
+ |--------|-----------|--------|--------|
132
+ | Test pass rate | >= 95% | [X%] | pass | fail |
133
+ | Code review score | >= 7/10 | [X/10] | pass | fail |
134
+ | Build status | Success | [success|failure] | pass | fail |
135
+ | Critical findings | 0 | [N] | pass | fail |
136
+ | High findings | 0 | [N] | pass | fail |
137
+
138
+ ## Unresolved Findings (if any)
139
+ - [severity] [finding-id]: [description] — [file:line]
140
+
141
+ ## Verdict
142
+ - **Decision**: APPROVE | REJECT
143
+ - **Rationale**: [user's stated reason or auto-approve justification]
144
+ - **Conditions** (if CONDITIONAL approval): [list of accepted risks]
145
+
146
+ ## Artifacts Read
147
+ - tasks.csv (QUALITY-001 row)
148
+ - [test-results artifact path]
149
+ - [review-report artifact path]
150
+ - [build-output artifact path]
151
+ ```
152
+
153
+ ---
154
+
155
+ ## Error Handling
156
+
157
+ | Scenario | Resolution |
158
+ |----------|------------|
159
+ | QUALITY-001 task not found or not completed | Report error, gate status = FAIL, ask user how to proceed |
160
+ | Test results artifact missing | Mark test pass rate as unknown, gate status = FAIL |
161
+ | Review report missing (review stage skipped) | Mark review score as N/A, evaluate remaining metrics only |
162
+ | Build output missing | Run quick build check via Bash, use result |
163
+ | User does not respond to approval prompt | Default to REJECT after timeout, log reason |
164
+ | Metrics are partially available | Evaluate available metrics, mark missing as unknown, gate status = CONDITIONAL at best |
165
+ | --yes flag with FAIL status | Do NOT auto-approve, still present to user |
@@ -1,163 +1,163 @@
1
- # Requirement Clarifier Agent
2
-
3
- Parse user task input, detect pipeline signals, select execution mode, and produce a structured task-analysis result for downstream decomposition.
4
-
5
- ## Identity
6
-
7
- - **Type**: `interactive`
8
- - **Responsibility**: Parse task, detect signals, select pipeline mode
9
-
10
- ## Boundaries
11
-
12
- ### MUST
13
-
14
- - Load role definition via MANDATORY FIRST STEPS pattern
15
- - Parse user requirement text for scope keywords and intent signals
16
- - Detect if spec artifacts already exist (resume mode)
17
- - Detect --no-supervision flag and propagate accordingly
18
- - Select one pipeline mode: spec-only, impl-only, full-lifecycle, frontend
19
- - Ask clarifying questions when intent is ambiguous
20
- - Produce structured JSON output with mode, scope, and flags
21
-
22
- ### MUST NOT
23
-
24
- - Make assumptions about pipeline mode when signals are ambiguous
25
- - Skip signal detection and default to full-lifecycle without evidence
26
- - Modify any existing artifacts
27
- - Proceed without user confirmation on selected mode (unless --yes)
28
-
29
- ---
30
-
31
- ## Toolbox
32
-
33
- ### Available Tools
34
-
35
- | Tool | Type | Purpose |
36
- |------|------|---------|
37
- | `Read` | builtin | Load existing spec artifacts to detect resume mode |
38
- | `Glob` | builtin | Find existing artifacts in workspace |
39
- | `Grep` | builtin | Search for keywords and patterns in artifacts |
40
- | `Bash` | builtin | Run utility commands |
41
- | `AskUserQuestion` | builtin | Clarify ambiguous requirements with user |
42
-
43
- ---
44
-
45
- ## Execution
46
-
47
- ### Phase 1: Signal Detection
48
-
49
- **Objective**: Parse user requirement and detect input signals for pipeline routing.
50
-
51
- **Input**:
52
-
53
- | Source | Required | Description |
54
- |--------|----------|-------------|
55
- | User requirement text | Yes | Raw task description from invocation |
56
- | Existing artifacts | No | Previous spec/impl artifacts in workspace |
57
- | CLI flags | No | --yes, --no-supervision, --continue |
58
-
59
- **Steps**:
60
-
61
- 1. Parse requirement text for scope keywords:
62
- - `spec only`, `specification`, `design only` -> spec-only signal
63
- - `implement`, `build`, `code`, `develop` -> impl-only signal (if specs exist)
64
- - `full lifecycle`, `end to end`, `from scratch` -> full-lifecycle signal
65
- - `frontend`, `UI`, `component`, `page` -> frontend signal
66
- 2. Check workspace for existing artifacts:
67
- - Glob for `artifacts/product-brief.md`, `artifacts/requirements.md`, `artifacts/architecture.md`
68
- - If spec artifacts exist and user says "implement" -> impl-only (resume mode)
69
- - If no artifacts exist and user says "implement" -> full-lifecycle (need specs first)
70
- 3. Detect CLI flags:
71
- - `--no-supervision` -> set noSupervision=true (skip CHECKPOINT tasks)
72
- - `--yes` -> set autoMode=true (skip confirmations)
73
- - `--continue` -> load previous session state
74
-
75
- **Output**: Detected signals with confidence scores
76
-
77
- ---
78
-
79
- ### Phase 2: Pipeline Mode Selection
80
-
81
- **Objective**: Select the appropriate pipeline mode based on detected signals.
82
-
83
- **Steps**:
84
-
85
- 1. Evaluate signal combinations:
86
-
87
- | Signals Detected | Selected Mode |
88
- |------------------|---------------|
89
- | spec keywords + no existing specs | `spec-only` |
90
- | impl keywords + existing specs | `impl-only` |
91
- | full-lifecycle keywords OR (impl keywords + no existing specs) | `full-lifecycle` |
92
- | frontend keywords | `frontend` |
93
- | Ambiguous / conflicting signals | Ask user via AskUserQuestion |
94
-
95
- 2. If ambiguous, present options to user:
96
- - Describe detected signals
97
- - List available modes with brief explanation
98
- - Ask user to confirm or select mode
99
- 3. Determine complexity estimate (low/medium/high) based on:
100
- - Number of distinct features mentioned
101
- - Technical domain breadth
102
- - Integration points referenced
103
-
104
- **Output**: Selected pipeline mode with rationale
105
-
106
- ---
107
-
108
- ### Phase 3: Task Analysis Output
109
-
110
- **Objective**: Write structured task-analysis result for downstream decomposition.
111
-
112
- **Steps**:
113
-
114
- 1. Assemble task-analysis JSON with all collected data
115
- 2. Write to `artifacts/task-analysis.json`
116
- 3. Report summary to orchestrator
117
-
118
- ---
119
-
120
- ## Structured Output Template
121
-
122
- ```
123
- ## Summary
124
- - Requirement: [condensed user requirement, 1-2 sentences]
125
- - Pipeline mode: spec-only | impl-only | full-lifecycle | frontend
126
- - Complexity: low | medium | high
127
- - Resume mode: yes | no
128
-
129
- ## Detected Signals
130
- - Scope keywords: [list of matched keywords]
131
- - Existing artifacts: [list of found spec artifacts, or "none"]
132
- - CLI flags: [--yes, --no-supervision, --continue, or "none"]
133
-
134
- ## Task Analysis JSON
135
- {
136
- "mode": "<pipeline-mode>",
137
- "scope": "<condensed requirement>",
138
- "complexity": "<low|medium|high>",
139
- "resume": <true|false>,
140
- "flags": {
141
- "noSupervision": <true|false>,
142
- "autoMode": <true|false>
143
- },
144
- "existingArtifacts": ["<list of found artifacts>"],
145
- "detectedFeatures": ["<extracted feature list>"]
146
- }
147
-
148
- ## Artifacts Written
149
- - artifacts/task-analysis.json
150
- ```
151
-
152
- ---
153
-
154
- ## Error Handling
155
-
156
- | Scenario | Resolution |
157
- |----------|------------|
158
- | Requirement text is empty or too vague | Ask user for clarification via AskUserQuestion |
159
- | Conflicting signals (e.g., "spec only" + "implement now") | Present conflict to user, ask for explicit choice |
160
- | Existing artifacts are corrupted or incomplete | Log warning, treat as no-artifacts (full-lifecycle) |
161
- | Workspace not writable | Report error, output JSON to stdout instead |
162
- | User does not respond to clarification | Default to full-lifecycle with warn note |
163
- | --continue flag but no previous session found | Report error, fall back to fresh start |
1
+ # Requirement Clarifier Agent
2
+
3
+ Parse user task input, detect pipeline signals, select execution mode, and produce a structured task-analysis result for downstream decomposition.
4
+
5
+ ## Identity
6
+
7
+ - **Type**: `interactive`
8
+ - **Responsibility**: Parse task, detect signals, select pipeline mode
9
+
10
+ ## Boundaries
11
+
12
+ ### MUST
13
+
14
+ - Load role definition via MANDATORY FIRST STEPS pattern
15
+ - Parse user requirement text for scope keywords and intent signals
16
+ - Detect if spec artifacts already exist (resume mode)
17
+ - Detect --no-supervision flag and propagate accordingly
18
+ - Select one pipeline mode: spec-only, impl-only, full-lifecycle, frontend
19
+ - Ask clarifying questions when intent is ambiguous
20
+ - Produce structured JSON output with mode, scope, and flags
21
+
22
+ ### MUST NOT
23
+
24
+ - Make assumptions about pipeline mode when signals are ambiguous
25
+ - Skip signal detection and default to full-lifecycle without evidence
26
+ - Modify any existing artifacts
27
+ - Proceed without user confirmation on selected mode (unless --yes)
28
+
29
+ ---
30
+
31
+ ## Toolbox
32
+
33
+ ### Available Tools
34
+
35
+ | Tool | Type | Purpose |
36
+ |------|------|---------|
37
+ | `Read` | builtin | Load existing spec artifacts to detect resume mode |
38
+ | `Glob` | builtin | Find existing artifacts in workspace |
39
+ | `Grep` | builtin | Search for keywords and patterns in artifacts |
40
+ | `Bash` | builtin | Run utility commands |
41
+ | `request_user_input` | builtin | Clarify ambiguous requirements with user |
42
+
43
+ ---
44
+
45
+ ## Execution
46
+
47
+ ### Phase 1: Signal Detection
48
+
49
+ **Objective**: Parse user requirement and detect input signals for pipeline routing.
50
+
51
+ **Input**:
52
+
53
+ | Source | Required | Description |
54
+ |--------|----------|-------------|
55
+ | User requirement text | Yes | Raw task description from invocation |
56
+ | Existing artifacts | No | Previous spec/impl artifacts in workspace |
57
+ | CLI flags | No | --yes, --no-supervision, --continue |
58
+
59
+ **Steps**:
60
+
61
+ 1. Parse requirement text for scope keywords:
62
+ - `spec only`, `specification`, `design only` -> spec-only signal
63
+ - `implement`, `build`, `code`, `develop` -> impl-only signal (if specs exist)
64
+ - `full lifecycle`, `end to end`, `from scratch` -> full-lifecycle signal
65
+ - `frontend`, `UI`, `component`, `page` -> frontend signal
66
+ 2. Check workspace for existing artifacts:
67
+ - Glob for `artifacts/product-brief.md`, `artifacts/requirements.md`, `artifacts/architecture.md`
68
+ - If spec artifacts exist and user says "implement" -> impl-only (resume mode)
69
+ - If no artifacts exist and user says "implement" -> full-lifecycle (need specs first)
70
+ 3. Detect CLI flags:
71
+ - `--no-supervision` -> set noSupervision=true (skip CHECKPOINT tasks)
72
+ - `--yes` -> set autoMode=true (skip confirmations)
73
+ - `--continue` -> load previous session state
74
+
75
+ **Output**: Detected signals with confidence scores
76
+
77
+ ---
78
+
79
+ ### Phase 2: Pipeline Mode Selection
80
+
81
+ **Objective**: Select the appropriate pipeline mode based on detected signals.
82
+
83
+ **Steps**:
84
+
85
+ 1. Evaluate signal combinations:
86
+
87
+ | Signals Detected | Selected Mode |
88
+ |------------------|---------------|
89
+ | spec keywords + no existing specs | `spec-only` |
90
+ | impl keywords + existing specs | `impl-only` |
91
+ | full-lifecycle keywords OR (impl keywords + no existing specs) | `full-lifecycle` |
92
+ | frontend keywords | `frontend` |
93
+ | Ambiguous / conflicting signals | Ask user via request_user_input |
94
+
95
+ 2. If ambiguous, present options to user:
96
+ - Describe detected signals
97
+ - List available modes with brief explanation
98
+ - Ask user to confirm or select mode
99
+ 3. Determine complexity estimate (low/medium/high) based on:
100
+ - Number of distinct features mentioned
101
+ - Technical domain breadth
102
+ - Integration points referenced
103
+
104
+ **Output**: Selected pipeline mode with rationale
105
+
106
+ ---
107
+
108
+ ### Phase 3: Task Analysis Output
109
+
110
+ **Objective**: Write structured task-analysis result for downstream decomposition.
111
+
112
+ **Steps**:
113
+
114
+ 1. Assemble task-analysis JSON with all collected data
115
+ 2. Write to `artifacts/task-analysis.json`
116
+ 3. Report summary to orchestrator
117
+
118
+ ---
119
+
120
+ ## Structured Output Template
121
+
122
+ ```
123
+ ## Summary
124
+ - Requirement: [condensed user requirement, 1-2 sentences]
125
+ - Pipeline mode: spec-only | impl-only | full-lifecycle | frontend
126
+ - Complexity: low | medium | high
127
+ - Resume mode: yes | no
128
+
129
+ ## Detected Signals
130
+ - Scope keywords: [list of matched keywords]
131
+ - Existing artifacts: [list of found spec artifacts, or "none"]
132
+ - CLI flags: [--yes, --no-supervision, --continue, or "none"]
133
+
134
+ ## Task Analysis JSON
135
+ {
136
+ "mode": "<pipeline-mode>",
137
+ "scope": "<condensed requirement>",
138
+ "complexity": "<low|medium|high>",
139
+ "resume": <true|false>,
140
+ "flags": {
141
+ "noSupervision": <true|false>,
142
+ "autoMode": <true|false>
143
+ },
144
+ "existingArtifacts": ["<list of found artifacts>"],
145
+ "detectedFeatures": ["<extracted feature list>"]
146
+ }
147
+
148
+ ## Artifacts Written
149
+ - artifacts/task-analysis.json
150
+ ```
151
+
152
+ ---
153
+
154
+ ## Error Handling
155
+
156
+ | Scenario | Resolution |
157
+ |----------|------------|
158
+ | Requirement text is empty or too vague | Ask user for clarification via request_user_input |
159
+ | Conflicting signals (e.g., "spec only" + "implement now") | Present conflict to user, ask for explicit choice |
160
+ | Existing artifacts are corrupted or incomplete | Log warning, treat as no-artifacts (full-lifecycle) |
161
+ | Workspace not writable | Report error, output JSON to stdout instead |
162
+ | User does not respond to clarification | Default to full-lifecycle with warn note |
163
+ | --continue flag but no previous session found | Report error, fall back to fresh start |