claude-code-workflow 7.2.23 → 7.2.24
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.
- package/.codex/skills/team-arch-opt/SKILL.md +242 -175
- package/.codex/skills/team-arch-opt/roles/analyzer/role.md +78 -78
- package/.codex/skills/team-arch-opt/roles/coordinator/commands/analyze.md +57 -57
- package/.codex/skills/team-arch-opt/roles/coordinator/commands/monitor.md +246 -204
- package/.codex/skills/team-arch-opt/roles/coordinator/role.md +196 -184
- package/.codex/skills/team-arch-opt/roles/designer/role.md +115 -115
- package/.codex/skills/team-arch-opt/roles/refactorer/role.md +102 -102
- package/.codex/skills/team-arch-opt/roles/reviewer/role.md +111 -111
- package/.codex/skills/team-arch-opt/roles/validator/role.md +115 -115
- package/.codex/skills/team-arch-opt/specs/pipelines.md +102 -102
- package/.codex/skills/team-brainstorm/SKILL.md +72 -4
- package/.codex/skills/team-brainstorm/roles/challenger/role.md +61 -61
- package/.codex/skills/team-brainstorm/roles/coordinator/commands/analyze.md +58 -58
- package/.codex/skills/team-brainstorm/roles/coordinator/commands/monitor.md +212 -171
- package/.codex/skills/team-brainstorm/roles/coordinator/role.md +172 -160
- package/.codex/skills/team-brainstorm/roles/evaluator/role.md +56 -56
- package/.codex/skills/team-brainstorm/roles/ideator/role.md +69 -69
- package/.codex/skills/team-brainstorm/roles/synthesizer/role.md +57 -57
- package/.codex/skills/team-brainstorm/specs/pipelines.md +72 -72
- package/.codex/skills/team-coordinate/SKILL.md +71 -3
- package/.codex/skills/team-coordinate/roles/coordinator/commands/monitor.md +45 -5
- package/.codex/skills/team-coordinate/roles/coordinator/role.md +402 -389
- package/.codex/skills/team-coordinate/specs/knowledge-transfer.md +111 -111
- package/.codex/skills/team-coordinate/specs/pipelines.md +97 -97
- package/.codex/skills/team-coordinate/specs/quality-gates.md +112 -112
- package/.codex/skills/team-designer/SKILL.md +153 -153
- package/.codex/skills/team-designer/phases/01-requirements-analysis.md +250 -250
- package/.codex/skills/team-designer/phases/02-scaffold-generation.md +228 -228
- package/.codex/skills/team-designer/phases/03-content-generation.md +330 -330
- package/.codex/skills/team-designer/phases/04-validation.md +320 -320
- package/.codex/skills/team-executor/SKILL.md +29 -2
- package/.codex/skills/team-executor/roles/executor/commands/monitor.md +23 -15
- package/.codex/skills/team-frontend/SKILL.md +77 -3
- package/.codex/skills/team-frontend/roles/analyst/role.md +92 -92
- package/.codex/skills/team-frontend/roles/architect/role.md +86 -86
- package/.codex/skills/team-frontend/roles/coordinator/commands/analyze.md +52 -52
- package/.codex/skills/team-frontend/roles/coordinator/commands/monitor.md +222 -188
- package/.codex/skills/team-frontend/roles/coordinator/role.md +189 -177
- package/.codex/skills/team-frontend/roles/developer/role.md +93 -93
- package/.codex/skills/team-frontend/roles/qa/role.md +79 -79
- package/.codex/skills/team-frontend/specs/pipelines.md +76 -76
- package/.codex/skills/team-frontend-debug/SKILL.md +66 -3
- package/.codex/skills/team-frontend-debug/roles/analyzer/role.md +208 -208
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/analyze.md +174 -174
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/dispatch.md +198 -198
- package/.codex/skills/team-frontend-debug/roles/coordinator/commands/monitor.md +177 -143
- package/.codex/skills/team-frontend-debug/roles/coordinator/role.md +164 -152
- package/.codex/skills/team-frontend-debug/roles/fixer/role.md +147 -147
- package/.codex/skills/team-frontend-debug/roles/reproducer/role.md +147 -147
- package/.codex/skills/team-frontend-debug/roles/tester/role.md +231 -231
- package/.codex/skills/team-frontend-debug/roles/verifier/role.md +172 -172
- package/.codex/skills/team-frontend-debug/specs/debug-tools.md +215 -215
- package/.codex/skills/team-frontend-debug/specs/pipelines.md +94 -94
- package/.codex/skills/team-issue/SKILL.md +83 -4
- package/.codex/skills/team-issue/roles/coordinator/commands/analyze.md +64 -64
- package/.codex/skills/team-issue/roles/coordinator/commands/dispatch.md +273 -273
- package/.codex/skills/team-issue/roles/coordinator/commands/monitor.md +235 -194
- package/.codex/skills/team-issue/roles/coordinator/role.md +206 -194
- package/.codex/skills/team-issue/roles/explorer/role.md +94 -94
- package/.codex/skills/team-issue/roles/implementer/role.md +87 -87
- package/.codex/skills/team-issue/roles/integrator/role.md +84 -84
- package/.codex/skills/team-issue/roles/planner/role.md +81 -81
- package/.codex/skills/team-issue/roles/reviewer/role.md +86 -86
- package/.codex/skills/team-issue/specs/pipelines.md +124 -124
- package/.codex/skills/team-iterdev/SKILL.md +64 -3
- package/.codex/skills/team-iterdev/roles/architect/role.md +65 -65
- package/.codex/skills/team-iterdev/roles/coordinator/commands/analyze.md +62 -62
- package/.codex/skills/team-iterdev/roles/coordinator/commands/monitor.md +227 -186
- package/.codex/skills/team-iterdev/roles/coordinator/role.md +193 -181
- package/.codex/skills/team-iterdev/roles/developer/role.md +74 -74
- package/.codex/skills/team-iterdev/roles/reviewer/role.md +66 -66
- package/.codex/skills/team-iterdev/roles/tester/role.md +88 -88
- package/.codex/skills/team-iterdev/specs/pipelines.md +94 -94
- package/.codex/skills/team-lifecycle-v4/MIGRATION-PLAN.md +6 -6
- package/.codex/skills/team-lifecycle-v4/SKILL.md +305 -242
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +1 -1
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +66 -24
- package/.codex/skills/team-lifecycle-v4/roles/coordinator/role.md +13 -1
- package/.codex/skills/team-lifecycle-v4/roles/supervisor/role.md +1 -1
- package/.codex/skills/team-lifecycle-v4/templates/architecture.md +254 -254
- package/.codex/skills/team-lifecycle-v4/templates/epics.md +196 -196
- package/.codex/skills/team-lifecycle-v4/templates/product-brief.md +133 -133
- package/.codex/skills/team-lifecycle-v4/templates/requirements.md +224 -224
- package/.codex/skills/team-perf-opt/SKILL.md +68 -3
- package/.codex/skills/team-perf-opt/roles/benchmarker/role.md +89 -89
- package/.codex/skills/team-perf-opt/roles/coordinator/commands/analyze.md +61 -61
- package/.codex/skills/team-perf-opt/roles/coordinator/commands/monitor.md +35 -1
- package/.codex/skills/team-perf-opt/roles/coordinator/role.md +179 -167
- package/.codex/skills/team-perf-opt/roles/optimizer/role.md +97 -97
- package/.codex/skills/team-perf-opt/roles/profiler/role.md +73 -73
- package/.codex/skills/team-perf-opt/roles/reviewer/role.md +75 -75
- package/.codex/skills/team-perf-opt/roles/strategist/role.md +94 -94
- package/.codex/skills/team-perf-opt/specs/pipelines.md +65 -65
- package/.codex/skills/team-planex/SKILL.md +65 -3
- package/.codex/skills/team-planex/roles/coordinator/commands/analyze.md +52 -52
- package/.codex/skills/team-planex/roles/coordinator/commands/monitor.md +210 -164
- package/.codex/skills/team-planex/roles/coordinator/role.md +171 -159
- package/.codex/skills/team-planex/roles/executor/role.md +91 -91
- package/.codex/skills/team-planex/roles/planner/role.md +112 -112
- package/.codex/skills/team-planex/specs/pipelines.md +93 -93
- package/.codex/skills/team-quality-assurance/SKILL.md +60 -3
- package/.codex/skills/team-quality-assurance/roles/analyst/role.md +80 -80
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -72
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +108 -108
- package/.codex/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +243 -209
- package/.codex/skills/team-quality-assurance/roles/coordinator/role.md +176 -164
- package/.codex/skills/team-quality-assurance/roles/executor/role.md +66 -66
- package/.codex/skills/team-quality-assurance/roles/generator/role.md +68 -68
- package/.codex/skills/team-quality-assurance/roles/scout/role.md +67 -67
- package/.codex/skills/team-quality-assurance/roles/strategist/role.md +71 -71
- package/.codex/skills/team-quality-assurance/specs/pipelines.md +115 -115
- package/.codex/skills/team-review/SKILL.md +58 -3
- package/.codex/skills/team-review/roles/coordinator/commands/analyze.md +71 -71
- package/.codex/skills/team-review/roles/coordinator/commands/dispatch.md +90 -90
- package/.codex/skills/team-review/roles/coordinator/commands/monitor.md +225 -185
- package/.codex/skills/team-review/roles/coordinator/role.md +175 -163
- package/.codex/skills/team-review/roles/fixer/role.md +76 -76
- package/.codex/skills/team-review/roles/reviewer/role.md +68 -68
- package/.codex/skills/team-review/roles/scanner/role.md +71 -71
- package/.codex/skills/team-review/specs/pipelines.md +102 -102
- package/.codex/skills/team-roadmap-dev/SKILL.md +55 -3
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/analyze.md +61 -61
- package/.codex/skills/team-roadmap-dev/roles/coordinator/commands/monitor.md +502 -468
- package/.codex/skills/team-roadmap-dev/roles/coordinator/role.md +335 -322
- package/.codex/skills/team-roadmap-dev/roles/executor/role.md +71 -71
- package/.codex/skills/team-roadmap-dev/roles/planner/role.md +76 -76
- package/.codex/skills/team-roadmap-dev/roles/verifier/role.md +74 -74
- package/.codex/skills/team-roadmap-dev/specs/pipelines.md +93 -93
- package/.codex/skills/team-tech-debt/SKILL.md +56 -3
- package/.codex/skills/team-tech-debt/roles/assessor/role.md +69 -69
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -47
- package/.codex/skills/team-tech-debt/roles/coordinator/commands/monitor.md +272 -231
- package/.codex/skills/team-tech-debt/roles/coordinator/role.md +172 -160
- package/.codex/skills/team-tech-debt/roles/executor/role.md +76 -76
- package/.codex/skills/team-tech-debt/roles/planner/role.md +69 -69
- package/.codex/skills/team-tech-debt/roles/scanner/role.md +82 -82
- package/.codex/skills/team-tech-debt/roles/validator/role.md +75 -75
- package/.codex/skills/team-tech-debt/specs/pipelines.md +47 -47
- package/.codex/skills/team-testing/SKILL.md +72 -3
- package/.codex/skills/team-testing/roles/analyst/role.md +95 -95
- package/.codex/skills/team-testing/roles/coordinator/commands/analyze.md +70 -70
- package/.codex/skills/team-testing/roles/coordinator/commands/dispatch.md +106 -106
- package/.codex/skills/team-testing/roles/coordinator/commands/monitor.md +283 -242
- package/.codex/skills/team-testing/roles/coordinator/role.md +184 -172
- package/.codex/skills/team-testing/roles/executor/role.md +96 -96
- package/.codex/skills/team-testing/roles/generator/role.md +95 -95
- package/.codex/skills/team-testing/roles/strategist/role.md +83 -83
- package/.codex/skills/team-testing/specs/pipelines.md +101 -101
- package/.codex/skills/team-uidesign/SKILL.md +65 -3
- package/.codex/skills/team-uidesign/roles/coordinator/commands/analyze.md +59 -59
- package/.codex/skills/team-uidesign/roles/coordinator/commands/dispatch.md +156 -156
- package/.codex/skills/team-uidesign/roles/coordinator/commands/monitor.md +234 -194
- package/.codex/skills/team-uidesign/roles/coordinator/role.md +211 -199
- package/.codex/skills/team-uidesign/roles/designer/role.md +69 -69
- package/.codex/skills/team-uidesign/roles/implementer/role.md +72 -72
- package/.codex/skills/team-uidesign/roles/researcher/role.md +82 -82
- package/.codex/skills/team-uidesign/roles/reviewer/role.md +67 -67
- package/.codex/skills/team-uidesign/specs/pipelines.md +76 -76
- package/.codex/skills/team-ultra-analyze/SKILL.md +73 -3
- package/.codex/skills/team-ultra-analyze/roles/analyst/role.md +90 -90
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/analyze.md +73 -73
- package/.codex/skills/team-ultra-analyze/roles/coordinator/commands/monitor.md +50 -9
- package/.codex/skills/team-ultra-analyze/roles/coordinator/role.md +255 -243
- package/.codex/skills/team-ultra-analyze/roles/discussant/role.md +104 -104
- package/.codex/skills/team-ultra-analyze/roles/explorer/role.md +74 -74
- package/.codex/skills/team-ultra-analyze/roles/synthesizer/role.md +78 -78
- package/.codex/skills/team-ultra-analyze/specs/pipelines.md +64 -64
- package/.codex/skills/team-ux-improve/SKILL.md +64 -3
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/analyze.md +62 -62
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/dispatch.md +233 -233
- package/.codex/skills/team-ux-improve/roles/coordinator/commands/monitor.md +195 -160
- package/.codex/skills/team-ux-improve/roles/coordinator/role.md +170 -158
- package/.codex/skills/team-ux-improve/roles/designer/role.md +122 -122
- package/.codex/skills/team-ux-improve/roles/diagnoser/role.md +93 -93
- package/.codex/skills/team-ux-improve/roles/explorer/role.md +77 -77
- package/.codex/skills/team-ux-improve/roles/implementer/role.md +102 -102
- package/.codex/skills/team-ux-improve/roles/scanner/role.md +93 -93
- package/.codex/skills/team-ux-improve/roles/tester/role.md +84 -84
- package/.codex/skills/team-ux-improve/specs/pipelines.md +54 -54
- package/README.md +1 -0
- package/package.json +1 -1
|
@@ -1,250 +1,250 @@
|
|
|
1
|
-
# Phase 1: Requirements Analysis
|
|
2
|
-
|
|
3
|
-
Gather team skill requirements from user input and build the `teamConfig` data structure that drives all subsequent phases.
|
|
4
|
-
|
|
5
|
-
## Objective
|
|
6
|
-
|
|
7
|
-
- Parse user input (text description, reference skill, or interactive)
|
|
8
|
-
- Determine roles, pipelines, specs, templates
|
|
9
|
-
- Auto-decide commands distribution (inline vs commands/ folder)
|
|
10
|
-
- Build comprehensive `teamConfig` object
|
|
11
|
-
- Confirm with user before proceeding
|
|
12
|
-
|
|
13
|
-
## Step 1.1: Detect Input Source
|
|
14
|
-
|
|
15
|
-
```javascript
|
|
16
|
-
function detectInputSource(userInput) {
|
|
17
|
-
// Source A: Reference to existing skill
|
|
18
|
-
if (userInput.includes('based on') || userInput.includes('参考') || userInput.includes('like')) {
|
|
19
|
-
return { type: 'reference', refSkill: extractSkillName(userInput) };
|
|
20
|
-
}
|
|
21
|
-
// Source B: Structured input with roles/pipelines
|
|
22
|
-
if (userInput.includes('ROLES:') || userInput.includes('PIPELINES:')) {
|
|
23
|
-
return { type: 'structured', data: parseStructuredInput(userInput) };
|
|
24
|
-
}
|
|
25
|
-
// Source C: Natural language description
|
|
26
|
-
return { type: 'natural', description: userInput };
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
**For reference source**: Read the referenced skill's SKILL.md and role files to extract structure.
|
|
31
|
-
|
|
32
|
-
**For natural language**: Use request_user_input to gather missing details interactively.
|
|
33
|
-
|
|
34
|
-
## Step 1.2: Gather Core Identity
|
|
35
|
-
|
|
36
|
-
```javascript
|
|
37
|
-
const skillNameResponse = request_user_input({
|
|
38
|
-
prompt: `团队技能名称?(kebab-case, e.g., team-code-review)\n\nSuggested: ${suggestedName}\nOr enter a custom name.`
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const prefixResponse = request_user_input({
|
|
42
|
-
prompt: `会话前缀?(3-4字符用于任务ID, e.g., TCR)\n\nSuggested: ${suggestedPrefix}\nOr enter a custom prefix.`
|
|
43
|
-
});
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
If user provided clear name/prefix in input, skip this step.
|
|
47
|
-
|
|
48
|
-
## Step 1.3: Determine Roles
|
|
49
|
-
|
|
50
|
-
### Role Discovery from Domain
|
|
51
|
-
|
|
52
|
-
Analyze domain description to identify required roles:
|
|
53
|
-
|
|
54
|
-
```javascript
|
|
55
|
-
function discoverRoles(domain) {
|
|
56
|
-
const rolePatterns = {
|
|
57
|
-
'analyst': ['分析', 'analyze', 'research', 'explore', 'investigate', 'scan'],
|
|
58
|
-
'planner': ['规划', 'plan', 'design', 'architect', 'decompose'],
|
|
59
|
-
'writer': ['文档', 'write', 'document', 'draft', 'spec', 'report'],
|
|
60
|
-
'executor': ['实现', 'implement', 'execute', 'build', 'code', 'develop'],
|
|
61
|
-
'tester': ['测试', 'test', 'verify', 'validate', 'qa'],
|
|
62
|
-
'reviewer': ['审查', 'review', 'quality', 'check', 'audit', 'inspect'],
|
|
63
|
-
'security-expert': ['安全', 'security', 'vulnerability', 'penetration'],
|
|
64
|
-
'performance-optimizer': ['性能', 'performance', 'optimize', 'benchmark'],
|
|
65
|
-
'data-engineer': ['数据', 'data', 'pipeline', 'etl', 'migration'],
|
|
66
|
-
'devops-engineer': ['部署', 'devops', 'deploy', 'ci/cd', 'infrastructure'],
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const matched = [];
|
|
70
|
-
for (const [role, keywords] of Object.entries(rolePatterns)) {
|
|
71
|
-
if (keywords.some(kw => domain.toLowerCase().includes(kw))) {
|
|
72
|
-
matched.push(role);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return matched;
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### Role Configuration
|
|
80
|
-
|
|
81
|
-
For each discovered role, determine:
|
|
82
|
-
|
|
83
|
-
```javascript
|
|
84
|
-
function configureRole(roleName) {
|
|
85
|
-
return {
|
|
86
|
-
name: roleName,
|
|
87
|
-
prefix: determinePrefix(roleName),
|
|
88
|
-
inner_loop: determineInnerLoop(roleName),
|
|
89
|
-
hasCommands: false, // determined in Step 1.5
|
|
90
|
-
commands: [],
|
|
91
|
-
message_types: determineMessageTypes(roleName),
|
|
92
|
-
path: `roles/${roleName}/role.md`
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// Standard prefix mapping
|
|
97
|
-
const prefixMap = {
|
|
98
|
-
'analyst': 'RESEARCH',
|
|
99
|
-
'writer': 'DRAFT',
|
|
100
|
-
'planner': 'PLAN',
|
|
101
|
-
'executor': 'IMPL',
|
|
102
|
-
'tester': 'TEST',
|
|
103
|
-
'reviewer': 'REVIEW',
|
|
104
|
-
// Dynamic roles use uppercase role name
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
// Inner loop: roles that process multiple tasks sequentially
|
|
108
|
-
const innerLoopRoles = ['executor', 'writer', 'planner'];
|
|
109
|
-
|
|
110
|
-
// Message types the role handles
|
|
111
|
-
const messageMap = {
|
|
112
|
-
'analyst': ['state_update'],
|
|
113
|
-
'writer': ['state_update', 'discuss_response'],
|
|
114
|
-
'planner': ['state_update'],
|
|
115
|
-
'executor': ['state_update', 'revision_request'],
|
|
116
|
-
'tester': ['state_update'],
|
|
117
|
-
'reviewer': ['state_update', 'discuss_request'],
|
|
118
|
-
};
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Step 1.4: Define Pipelines
|
|
122
|
-
|
|
123
|
-
### Pipeline Types from Role Combination
|
|
124
|
-
|
|
125
|
-
```javascript
|
|
126
|
-
function definePipelines(roles, domain) {
|
|
127
|
-
const has = name => roles.some(r => r.name === name);
|
|
128
|
-
|
|
129
|
-
// Full lifecycle: analyst → writer → planner → executor → tester → reviewer
|
|
130
|
-
if (has('analyst') && has('writer') && has('planner') && has('executor'))
|
|
131
|
-
return [{ name: 'full-lifecycle', tasks: buildFullLifecycleTasks(roles) }];
|
|
132
|
-
|
|
133
|
-
// Spec-only: analyst → writer → reviewer
|
|
134
|
-
if (has('analyst') && has('writer') && !has('executor'))
|
|
135
|
-
return [{ name: 'spec-only', tasks: buildSpecOnlyTasks(roles) }];
|
|
136
|
-
|
|
137
|
-
// Impl-only: planner → executor → tester → reviewer
|
|
138
|
-
if (has('planner') && has('executor') && !has('analyst'))
|
|
139
|
-
return [{ name: 'impl-only', tasks: buildImplOnlyTasks(roles) }];
|
|
140
|
-
|
|
141
|
-
// Custom: user-defined
|
|
142
|
-
return [{ name: 'custom', tasks: buildCustomTasks(roles, domain) }];
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Task Schema
|
|
147
|
-
|
|
148
|
-
```javascript
|
|
149
|
-
const taskSchema = {
|
|
150
|
-
id: 'PREFIX-NNN', // e.g., RESEARCH-001
|
|
151
|
-
role: 'analyst', // which role executes
|
|
152
|
-
name: 'Seed Analysis', // human-readable name
|
|
153
|
-
dependsOn: [], // task IDs that must complete first
|
|
154
|
-
isCheckpoint: false, // true for quality gates
|
|
155
|
-
isConditional: false, // true for routing decisions
|
|
156
|
-
description: '...'
|
|
157
|
-
};
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## Step 1.5: Determine Commands Distribution
|
|
161
|
-
|
|
162
|
-
**Rule**: 1 action → inline in role.md. 2+ distinct actions → commands/ folder.
|
|
163
|
-
|
|
164
|
-
```javascript
|
|
165
|
-
function determineCommandsDistribution(roles) {
|
|
166
|
-
// Coordinator: always has commands/
|
|
167
|
-
// coordinator.commands = ['analyze', 'dispatch', 'monitor']
|
|
168
|
-
|
|
169
|
-
// Standard multi-action roles:
|
|
170
|
-
// executor → implement + fix → commands/
|
|
171
|
-
// reviewer (if both code & spec review) → review-code + review-spec → commands/
|
|
172
|
-
// All others → typically inline
|
|
173
|
-
|
|
174
|
-
for (const role of roles) {
|
|
175
|
-
const actions = countDistinctActions(role);
|
|
176
|
-
if (actions.length >= 2) {
|
|
177
|
-
role.hasCommands = true;
|
|
178
|
-
role.commands = actions.map(a => a.name);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
## Step 1.6: Determine Specs and Templates
|
|
185
|
-
|
|
186
|
-
```javascript
|
|
187
|
-
// Specs: always include pipelines, add domain-specific
|
|
188
|
-
const specs = ['pipelines'];
|
|
189
|
-
if (hasQualityGates) specs.push('quality-gates');
|
|
190
|
-
if (hasKnowledgeTransfer) specs.push('knowledge-transfer');
|
|
191
|
-
|
|
192
|
-
// Templates: only if writer role exists
|
|
193
|
-
const templates = [];
|
|
194
|
-
if (has('writer')) {
|
|
195
|
-
// Detect from domain keywords
|
|
196
|
-
if (domain.includes('product')) templates.push('product-brief');
|
|
197
|
-
if (domain.includes('requirement')) templates.push('requirements');
|
|
198
|
-
if (domain.includes('architecture')) templates.push('architecture');
|
|
199
|
-
if (domain.includes('epic')) templates.push('epics');
|
|
200
|
-
}
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## Step 1.7: Build teamConfig
|
|
204
|
-
|
|
205
|
-
```javascript
|
|
206
|
-
const teamConfig = {
|
|
207
|
-
skillName: string, // e.g., "team-code-review"
|
|
208
|
-
sessionPrefix: string, // e.g., "TCR"
|
|
209
|
-
domain: string, // domain description
|
|
210
|
-
title: string, // e.g., "Code Review Team"
|
|
211
|
-
roles: Array<RoleConfig>, // includes coordinator
|
|
212
|
-
pipelines: Array<Pipeline>,
|
|
213
|
-
specs: Array<string>, // filenames without .md
|
|
214
|
-
templates: Array<string>, // filenames without .md
|
|
215
|
-
conditionalRouting: boolean,
|
|
216
|
-
dynamicSpecialists: Array<string>,
|
|
217
|
-
};
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
## Step 1.8: Confirm with User
|
|
221
|
-
|
|
222
|
-
```
|
|
223
|
-
╔══════════════════════════════════════════╗
|
|
224
|
-
║ Team Skill Configuration Summary ║
|
|
225
|
-
╠══════════════════════════════════════════╣
|
|
226
|
-
|
|
227
|
-
Skill Name: ${skillName}
|
|
228
|
-
Session Prefix: ${sessionPrefix}
|
|
229
|
-
Domain: ${domain}
|
|
230
|
-
|
|
231
|
-
Roles (N):
|
|
232
|
-
├─ coordinator (commands: analyze, dispatch, monitor)
|
|
233
|
-
├─ role-a [PREFIX-*] (inline) 🔄
|
|
234
|
-
└─ role-b [PREFIX-*] (commands: cmd1, cmd2)
|
|
235
|
-
|
|
236
|
-
Pipelines:
|
|
237
|
-
└─ pipeline-name: TASK-001 → TASK-002 → TASK-003
|
|
238
|
-
|
|
239
|
-
Specs: pipelines, quality-gates
|
|
240
|
-
Templates: (none)
|
|
241
|
-
|
|
242
|
-
╚══════════════════════════════════════════╝
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
Use request_user_input to confirm or allow modifications.
|
|
246
|
-
|
|
247
|
-
## Output
|
|
248
|
-
|
|
249
|
-
- **Variable**: `teamConfig` — complete configuration for all subsequent phases
|
|
250
|
-
- **Next**: Phase 2 - Scaffold Generation
|
|
1
|
+
# Phase 1: Requirements Analysis
|
|
2
|
+
|
|
3
|
+
Gather team skill requirements from user input and build the `teamConfig` data structure that drives all subsequent phases.
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
- Parse user input (text description, reference skill, or interactive)
|
|
8
|
+
- Determine roles, pipelines, specs, templates
|
|
9
|
+
- Auto-decide commands distribution (inline vs commands/ folder)
|
|
10
|
+
- Build comprehensive `teamConfig` object
|
|
11
|
+
- Confirm with user before proceeding
|
|
12
|
+
|
|
13
|
+
## Step 1.1: Detect Input Source
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
function detectInputSource(userInput) {
|
|
17
|
+
// Source A: Reference to existing skill
|
|
18
|
+
if (userInput.includes('based on') || userInput.includes('参考') || userInput.includes('like')) {
|
|
19
|
+
return { type: 'reference', refSkill: extractSkillName(userInput) };
|
|
20
|
+
}
|
|
21
|
+
// Source B: Structured input with roles/pipelines
|
|
22
|
+
if (userInput.includes('ROLES:') || userInput.includes('PIPELINES:')) {
|
|
23
|
+
return { type: 'structured', data: parseStructuredInput(userInput) };
|
|
24
|
+
}
|
|
25
|
+
// Source C: Natural language description
|
|
26
|
+
return { type: 'natural', description: userInput };
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**For reference source**: Read the referenced skill's SKILL.md and role files to extract structure.
|
|
31
|
+
|
|
32
|
+
**For natural language**: Use request_user_input to gather missing details interactively.
|
|
33
|
+
|
|
34
|
+
## Step 1.2: Gather Core Identity
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
const skillNameResponse = request_user_input({
|
|
38
|
+
prompt: `团队技能名称?(kebab-case, e.g., team-code-review)\n\nSuggested: ${suggestedName}\nOr enter a custom name.`
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const prefixResponse = request_user_input({
|
|
42
|
+
prompt: `会话前缀?(3-4字符用于任务ID, e.g., TCR)\n\nSuggested: ${suggestedPrefix}\nOr enter a custom prefix.`
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
If user provided clear name/prefix in input, skip this step.
|
|
47
|
+
|
|
48
|
+
## Step 1.3: Determine Roles
|
|
49
|
+
|
|
50
|
+
### Role Discovery from Domain
|
|
51
|
+
|
|
52
|
+
Analyze domain description to identify required roles:
|
|
53
|
+
|
|
54
|
+
```javascript
|
|
55
|
+
function discoverRoles(domain) {
|
|
56
|
+
const rolePatterns = {
|
|
57
|
+
'analyst': ['分析', 'analyze', 'research', 'explore', 'investigate', 'scan'],
|
|
58
|
+
'planner': ['规划', 'plan', 'design', 'architect', 'decompose'],
|
|
59
|
+
'writer': ['文档', 'write', 'document', 'draft', 'spec', 'report'],
|
|
60
|
+
'executor': ['实现', 'implement', 'execute', 'build', 'code', 'develop'],
|
|
61
|
+
'tester': ['测试', 'test', 'verify', 'validate', 'qa'],
|
|
62
|
+
'reviewer': ['审查', 'review', 'quality', 'check', 'audit', 'inspect'],
|
|
63
|
+
'security-expert': ['安全', 'security', 'vulnerability', 'penetration'],
|
|
64
|
+
'performance-optimizer': ['性能', 'performance', 'optimize', 'benchmark'],
|
|
65
|
+
'data-engineer': ['数据', 'data', 'pipeline', 'etl', 'migration'],
|
|
66
|
+
'devops-engineer': ['部署', 'devops', 'deploy', 'ci/cd', 'infrastructure'],
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const matched = [];
|
|
70
|
+
for (const [role, keywords] of Object.entries(rolePatterns)) {
|
|
71
|
+
if (keywords.some(kw => domain.toLowerCase().includes(kw))) {
|
|
72
|
+
matched.push(role);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return matched;
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Role Configuration
|
|
80
|
+
|
|
81
|
+
For each discovered role, determine:
|
|
82
|
+
|
|
83
|
+
```javascript
|
|
84
|
+
function configureRole(roleName) {
|
|
85
|
+
return {
|
|
86
|
+
name: roleName,
|
|
87
|
+
prefix: determinePrefix(roleName),
|
|
88
|
+
inner_loop: determineInnerLoop(roleName),
|
|
89
|
+
hasCommands: false, // determined in Step 1.5
|
|
90
|
+
commands: [],
|
|
91
|
+
message_types: determineMessageTypes(roleName),
|
|
92
|
+
path: `roles/${roleName}/role.md`
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Standard prefix mapping
|
|
97
|
+
const prefixMap = {
|
|
98
|
+
'analyst': 'RESEARCH',
|
|
99
|
+
'writer': 'DRAFT',
|
|
100
|
+
'planner': 'PLAN',
|
|
101
|
+
'executor': 'IMPL',
|
|
102
|
+
'tester': 'TEST',
|
|
103
|
+
'reviewer': 'REVIEW',
|
|
104
|
+
// Dynamic roles use uppercase role name
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Inner loop: roles that process multiple tasks sequentially
|
|
108
|
+
const innerLoopRoles = ['executor', 'writer', 'planner'];
|
|
109
|
+
|
|
110
|
+
// Message types the role handles
|
|
111
|
+
const messageMap = {
|
|
112
|
+
'analyst': ['state_update'],
|
|
113
|
+
'writer': ['state_update', 'discuss_response'],
|
|
114
|
+
'planner': ['state_update'],
|
|
115
|
+
'executor': ['state_update', 'revision_request'],
|
|
116
|
+
'tester': ['state_update'],
|
|
117
|
+
'reviewer': ['state_update', 'discuss_request'],
|
|
118
|
+
};
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Step 1.4: Define Pipelines
|
|
122
|
+
|
|
123
|
+
### Pipeline Types from Role Combination
|
|
124
|
+
|
|
125
|
+
```javascript
|
|
126
|
+
function definePipelines(roles, domain) {
|
|
127
|
+
const has = name => roles.some(r => r.name === name);
|
|
128
|
+
|
|
129
|
+
// Full lifecycle: analyst → writer → planner → executor → tester → reviewer
|
|
130
|
+
if (has('analyst') && has('writer') && has('planner') && has('executor'))
|
|
131
|
+
return [{ name: 'full-lifecycle', tasks: buildFullLifecycleTasks(roles) }];
|
|
132
|
+
|
|
133
|
+
// Spec-only: analyst → writer → reviewer
|
|
134
|
+
if (has('analyst') && has('writer') && !has('executor'))
|
|
135
|
+
return [{ name: 'spec-only', tasks: buildSpecOnlyTasks(roles) }];
|
|
136
|
+
|
|
137
|
+
// Impl-only: planner → executor → tester → reviewer
|
|
138
|
+
if (has('planner') && has('executor') && !has('analyst'))
|
|
139
|
+
return [{ name: 'impl-only', tasks: buildImplOnlyTasks(roles) }];
|
|
140
|
+
|
|
141
|
+
// Custom: user-defined
|
|
142
|
+
return [{ name: 'custom', tasks: buildCustomTasks(roles, domain) }];
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Task Schema
|
|
147
|
+
|
|
148
|
+
```javascript
|
|
149
|
+
const taskSchema = {
|
|
150
|
+
id: 'PREFIX-NNN', // e.g., RESEARCH-001
|
|
151
|
+
role: 'analyst', // which role executes
|
|
152
|
+
name: 'Seed Analysis', // human-readable name
|
|
153
|
+
dependsOn: [], // task IDs that must complete first
|
|
154
|
+
isCheckpoint: false, // true for quality gates
|
|
155
|
+
isConditional: false, // true for routing decisions
|
|
156
|
+
description: '...'
|
|
157
|
+
};
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Step 1.5: Determine Commands Distribution
|
|
161
|
+
|
|
162
|
+
**Rule**: 1 action → inline in role.md. 2+ distinct actions → commands/ folder.
|
|
163
|
+
|
|
164
|
+
```javascript
|
|
165
|
+
function determineCommandsDistribution(roles) {
|
|
166
|
+
// Coordinator: always has commands/
|
|
167
|
+
// coordinator.commands = ['analyze', 'dispatch', 'monitor']
|
|
168
|
+
|
|
169
|
+
// Standard multi-action roles:
|
|
170
|
+
// executor → implement + fix → commands/
|
|
171
|
+
// reviewer (if both code & spec review) → review-code + review-spec → commands/
|
|
172
|
+
// All others → typically inline
|
|
173
|
+
|
|
174
|
+
for (const role of roles) {
|
|
175
|
+
const actions = countDistinctActions(role);
|
|
176
|
+
if (actions.length >= 2) {
|
|
177
|
+
role.hasCommands = true;
|
|
178
|
+
role.commands = actions.map(a => a.name);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## Step 1.6: Determine Specs and Templates
|
|
185
|
+
|
|
186
|
+
```javascript
|
|
187
|
+
// Specs: always include pipelines, add domain-specific
|
|
188
|
+
const specs = ['pipelines'];
|
|
189
|
+
if (hasQualityGates) specs.push('quality-gates');
|
|
190
|
+
if (hasKnowledgeTransfer) specs.push('knowledge-transfer');
|
|
191
|
+
|
|
192
|
+
// Templates: only if writer role exists
|
|
193
|
+
const templates = [];
|
|
194
|
+
if (has('writer')) {
|
|
195
|
+
// Detect from domain keywords
|
|
196
|
+
if (domain.includes('product')) templates.push('product-brief');
|
|
197
|
+
if (domain.includes('requirement')) templates.push('requirements');
|
|
198
|
+
if (domain.includes('architecture')) templates.push('architecture');
|
|
199
|
+
if (domain.includes('epic')) templates.push('epics');
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Step 1.7: Build teamConfig
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
const teamConfig = {
|
|
207
|
+
skillName: string, // e.g., "team-code-review"
|
|
208
|
+
sessionPrefix: string, // e.g., "TCR"
|
|
209
|
+
domain: string, // domain description
|
|
210
|
+
title: string, // e.g., "Code Review Team"
|
|
211
|
+
roles: Array<RoleConfig>, // includes coordinator
|
|
212
|
+
pipelines: Array<Pipeline>,
|
|
213
|
+
specs: Array<string>, // filenames without .md
|
|
214
|
+
templates: Array<string>, // filenames without .md
|
|
215
|
+
conditionalRouting: boolean,
|
|
216
|
+
dynamicSpecialists: Array<string>,
|
|
217
|
+
};
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Step 1.8: Confirm with User
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
╔══════════════════════════════════════════╗
|
|
224
|
+
║ Team Skill Configuration Summary ║
|
|
225
|
+
╠══════════════════════════════════════════╣
|
|
226
|
+
|
|
227
|
+
Skill Name: ${skillName}
|
|
228
|
+
Session Prefix: ${sessionPrefix}
|
|
229
|
+
Domain: ${domain}
|
|
230
|
+
|
|
231
|
+
Roles (N):
|
|
232
|
+
├─ coordinator (commands: analyze, dispatch, monitor)
|
|
233
|
+
├─ role-a [PREFIX-*] (inline) 🔄
|
|
234
|
+
└─ role-b [PREFIX-*] (commands: cmd1, cmd2)
|
|
235
|
+
|
|
236
|
+
Pipelines:
|
|
237
|
+
└─ pipeline-name: TASK-001 → TASK-002 → TASK-003
|
|
238
|
+
|
|
239
|
+
Specs: pipelines, quality-gates
|
|
240
|
+
Templates: (none)
|
|
241
|
+
|
|
242
|
+
╚══════════════════════════════════════════╝
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Use request_user_input to confirm or allow modifications.
|
|
246
|
+
|
|
247
|
+
## Output
|
|
248
|
+
|
|
249
|
+
- **Variable**: `teamConfig` — complete configuration for all subsequent phases
|
|
250
|
+
- **Next**: Phase 2 - Scaffold Generation
|