Skip to content

Commit 126a357

Browse files
author
catlog22
committed
feat: Migrate flow-coordinator templates from deleted command paths to Skill names
All 16 template JSON files updated: - Migrated Skills: /workflow:lite-plan → workflow-lite-plan (hyphen format) - Existing commands: /issue:discover → issue:discover (removed leading /) - Added route field for multi-mode Skill routing (lite-execute, plan-verify, etc.) SKILL.md updated: - TemplateStep schema adds route field and cmd naming rules - Execution logic uses Skill() invocation instead of SlashCommand() - Prompt building supports route-based routing - Available Templates table uses new Skill name format
1 parent 4ddd2e9 commit 126a357

17 files changed

Lines changed: 162 additions & 87 deletions

.claude/skills/flow-coordinator/SKILL.md

Lines changed: 88 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -344,29 +344,45 @@ async function selectTemplate(templates) {
344344
**Templates stored in**: `templates/*.json` (discovered at runtime via Glob)
345345
346346
**TemplateStep Fields**:
347-
- `cmd`: Full command path (e.g., `/workflow:lite-plan`, `/workflow:execute`)
347+
- `cmd`: Skill name or command path (e.g., `workflow-lite-plan`, `workflow:debug-with-file`, `issue:discover`)
348+
- `route?`: Sub-mode for multi-mode Skills (e.g., `lite-execute`, `plan-verify`, `test-cycle-execute`)
348349
- `args?`: Arguments with `{{goal}}` and `{{prev}}` placeholders
349350
- `unit?`: Minimum execution unit name (groups related commands)
350351
- `optional?`: Can be skipped by user
351352
- `execution`: Type and mode configuration
352-
- `type`: Always `'slash-command'` (for all workflow commands)
353+
- `type`: Always `'slash-command'` (invoked via Skill tool)
353354
- `mode`: `'mainprocess'` (blocking) or `'async'` (background)
354355
- `contextHint?`: Natural language guidance for context assembly
355356
357+
**cmd 命名规则**:
358+
- **Skills(已迁移)**: 使用连字符格式 Skill 名称,如 `workflow-lite-plan`、`review-cycle`
359+
- **Commands(仍存在)**: 使用冒号格式命令路径,如 `workflow:brainstorm-with-file`、`issue:discover`
360+
361+
**route 字段**:
362+
多模式 Skill 通过 `route` 区分子模式。同一 Skill 的不同步骤共享 `cmd`,通过 `route` 路由:
363+
| Skill | 默认模式 (无 route) | route 值 |
364+
|-------|-------------------|----------|
365+
| `workflow-lite-plan` | lite-plan | `lite-execute` |
366+
| `workflow-plan` | plan | `plan-verify`, `replan` |
367+
| `workflow-test-fix` | test-fix-gen | `test-cycle-execute` |
368+
| `workflow-tdd` | tdd-plan | `tdd-verify` |
369+
| `review-cycle` | - | `session`, `module`, `fix` |
370+
356371
**Template Example**:
357372
```json
358373
{
359374
"name": "rapid",
360375
"steps": [
361376
{
362-
"cmd": "/workflow:lite-plan",
377+
"cmd": "workflow-lite-plan",
363378
"args": "\"{{goal}}\"",
364379
"unit": "quick-implementation",
365380
"execution": { "type": "slash-command", "mode": "mainprocess" },
366381
"contextHint": "Create lightweight implementation plan"
367382
},
368383
{
369-
"cmd": "/workflow:lite-execute",
384+
"cmd": "workflow-lite-plan",
385+
"route": "lite-execute",
370386
"args": "--in-memory",
371387
"unit": "quick-implementation",
372388
"execution": { "type": "slash-command", "mode": "async" },
@@ -384,9 +400,11 @@ async function selectTemplate(templates) {
384400
385401
```javascript
386402
async function executeSlashCommandSync(step, status) {
387-
// Build command: /workflow:cmd -y args
388-
const cmd = buildCommand(step, status);
389-
const result = await SlashCommand({ command: cmd });
403+
// Build Skill invocation args
404+
const args = buildSkillArgs(step, status);
405+
406+
// Invoke via Skill tool: step.cmd is skill name or command path
407+
const result = await Skill({ skill: step.cmd, args: args });
390408
391409
step.session = result.session_id;
392410
step.status = 'done';
@@ -398,7 +416,7 @@ async function executeSlashCommandSync(step, status) {
398416
399417
```javascript
400418
async function executeSlashCommandAsync(step, status, statusPath) {
401-
// Build prompt: /workflow:cmd -y args + context
419+
// Build prompt for ccw cli: /<cmd> [--route <route>] args + context
402420
const prompt = buildCommandPrompt(step, status);
403421
404422
step.status = 'running';
@@ -413,7 +431,7 @@ async function executeSlashCommandAsync(step, status, statusPath) {
413431
step.taskId = taskId;
414432
write(statusPath, JSON.stringify(status, null, 2));
415433
416-
console.log(`Executing: ${step.cmd} (async)`);
434+
console.log(`Executing: ${step.cmd}${step.route ? ' --route ' + step.route : ''} (async)`);
417435
console.log(`Resume: /flow-coordinator --resume ${status.id}`);
418436
}
419437
```
@@ -422,12 +440,19 @@ async function executeSlashCommandAsync(step, status, statusPath) {
422440
423441
## Prompt Building
424442
425-
Prompts are built in format: `/workflow:cmd -y args` + context
443+
Prompts are built in format: `/<cmd> [--route <route>] -y args` + context
426444
427445
```javascript
428446
function buildCommandPrompt(step, status) {
429-
// step.cmd already contains full path: /workflow:lite-plan, /workflow:execute, etc.
430-
let prompt = `${step.cmd} -y`;
447+
// step.cmd is skill name or command path
448+
let prompt = `/${step.cmd}`;
449+
450+
// Add route for multi-mode Skills
451+
if (step.route) {
452+
prompt += ` --route ${step.route}`;
453+
}
454+
455+
prompt += ' -y';
431456
432457
// Add arguments (with placeholder replacement)
433458
if (step.args) {
@@ -452,21 +477,40 @@ function buildCommandPrompt(step, status) {
452477
return prompt;
453478
}
454479
480+
/**
481+
* Build args for Skill() invocation (mainprocess mode)
482+
*/
483+
function buildSkillArgs(step, status) {
484+
let args = '';
485+
486+
// Add route for multi-mode Skills
487+
if (step.route) {
488+
args += `--route ${step.route} `;
489+
}
490+
491+
args += '-y';
492+
493+
// Add step arguments
494+
if (step.args) {
495+
const resolvedArgs = step.args
496+
.replace('{{goal}}', status.goal)
497+
.replace('{{prev}}', getPreviousSessionId(status));
498+
args += ` ${resolvedArgs}`;
499+
}
500+
501+
return args;
502+
}
503+
455504
function buildContextFromHint(hint, status) {
456505
// Parse contextHint instruction and build context accordingly
457-
// Examples:
458-
// "Summarize IMPL_PLAN.md" → read and summarize plan
459-
// "List test coverage gaps" → analyze previous test results
460-
// "Pass session ID" → just return session reference
461-
462506
return parseAndBuildContext(hint, status);
463507
}
464508
```
465509
466510
### Example Prompt Output
467511
468512
```
469-
/workflow:lite-plan -y "Implement user registration"
513+
/workflow-lite-plan -y "Implement user registration"
470514

471515
Context:
472516
Task: Implement user registration
@@ -475,7 +519,7 @@ Previous results:
475519
```
476520
477521
```
478-
/workflow:execute -y --in-memory
522+
/workflow-lite-plan --route lite-execute -y --in-memory
479523

480524
Context:
481525
Task: Implement user registration
@@ -504,13 +548,13 @@ Select workflow template:
504548
```
505549
Template: coupled
506550
Steps:
507-
1. /workflow:plan (slash-command mainprocess)
508-
2. /workflow:plan-verify (slash-command mainprocess)
509-
3. /workflow:execute (slash-command async)
510-
4. /workflow:review-session-cycle (slash-command mainprocess)
511-
5. /workflow:review-cycle-fix (slash-command mainprocess)
512-
6. /workflow:test-fix-gen (slash-command mainprocess)
513-
7. /workflow:test-cycle-execute (slash-command async)
551+
1. workflow-plan (mainprocess)
552+
2. workflow-plan --route plan-verify (mainprocess)
553+
3. workflow-execute (async)
554+
4. review-cycle --route session (mainprocess)
555+
5. review-cycle --route fix (mainprocess)
556+
6. workflow-test-fix (mainprocess)
557+
7. workflow-test-fix --route test-cycle-execute (async)
514558

515559
Proceed? [Confirm / Cancel]
516560
```
@@ -544,15 +588,24 @@ Templates discovered from `templates/*.json`:
544588
545589
| Template | Use Case | Steps |
546590
|----------|----------|-------|
547-
| rapid | Simple feature | /workflow:lite-plan → /workflow:lite-execute → /workflow:test-cycle-execute |
548-
| coupled | Complex feature | /workflow:plan → /workflow:plan-verify → /workflow:execute → /workflow:review-session-cycle → /workflow:test-fix-gen |
549-
| bugfix | Bug fix | /workflow:lite-plan --bugfix → /workflow:lite-execute → /workflow:test-cycle-execute |
550-
| tdd | Test-driven | /workflow:tdd-plan → /workflow:execute → /workflow:tdd-verify |
551-
| test-fix | Fix failing tests | /workflow:test-fix-gen → /workflow:test-cycle-execute |
552-
| brainstorm | Exploration | /workflow:brainstorm-with-file |
553-
| debug | Debug with docs | /workflow:debug-with-file |
554-
| analyze | Collaborative analysis | /workflow:analyze-with-file |
555-
| issue | Issue workflow | /issue:discover → /issue:plan → /issue:queue → /issue:execute |
591+
| rapid | Simple feature | workflow-lite-plan → workflow-lite-plan[lite-execute] → workflow-test-fix → workflow-test-fix[test-cycle-execute] |
592+
| coupled | Complex feature | workflow-plan → workflow-plan[plan-verify] → workflow-execute → review-cycle[session] → review-cycle[fix] → workflow-test-fix → workflow-test-fix[test-cycle-execute] |
593+
| bugfix | Bug fix | workflow-lite-plan --bugfix → workflow-lite-plan[lite-execute] → workflow-test-fix → workflow-test-fix[test-cycle-execute] |
594+
| bugfix-hotfix | Urgent hotfix | workflow-lite-plan --hotfix |
595+
| tdd | Test-driven | workflow-tdd → workflow-execute → workflow-tdd[tdd-verify] |
596+
| test-fix | Fix failing tests | workflow-test-fix → workflow-test-fix[test-cycle-execute] |
597+
| review | Code review | review-cycle[session] → review-cycle[fix] → workflow-test-fix → workflow-test-fix[test-cycle-execute] |
598+
| multi-cli-plan | Multi-perspective planning | workflow-multi-cli-plan → workflow-lite-plan[lite-execute] → workflow-test-fix → workflow-test-fix[test-cycle-execute] |
599+
| full | Complete workflow | brainstorm → workflow-plan → workflow-plan[plan-verify] → workflow-execute → workflow-test-fix → workflow-test-fix[test-cycle-execute] |
600+
| docs | Documentation | workflow-lite-plan → workflow-lite-plan[lite-execute] |
601+
| brainstorm | Exploration | workflow:brainstorm-with-file |
602+
| debug | Debug with docs | workflow:debug-with-file |
603+
| analyze | Collaborative analysis | workflow:analyze-with-file |
604+
| issue | Issue workflow | issue:discover → issue:plan → issue:queue → issue:execute |
605+
| rapid-to-issue | Plan to issue bridge | workflow-lite-plan → issue:convert-to-plan → issue:queue → issue:execute |
606+
| brainstorm-to-issue | Brainstorm to issue | issue:from-brainstorm → issue:queue → issue:execute |
607+
608+
**注**: `[route]` 表示该步骤使用 `route` 字段路由到多模式 Skill 的特定子模式。
556609
557610
---
558611

.claude/skills/flow-coordinator/templates/analyze.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"level": 3,
55
"steps": [
66
{
7-
"cmd": "/workflow:analyze-with-file",
7+
"cmd": "workflow:analyze-with-file",
88
"args": "\"{{goal}}\"",
9+
"unit": "analyze-with-file",
910
"execution": {
1011
"type": "slash-command",
1112
"mode": "mainprocess"

.claude/skills/flow-coordinator/templates/brainstorm-to-issue.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"level": 4,
55
"steps": [
66
{
7-
"cmd": "/issue:from-brainstorm",
7+
"cmd": "issue:from-brainstorm",
88
"args": "--auto",
99
"unit": "brainstorm-to-issue",
1010
"execution": {
@@ -14,7 +14,7 @@
1414
"contextHint": "Convert brainstorm session findings into issue plans and solutions"
1515
},
1616
{
17-
"cmd": "/issue:queue",
17+
"cmd": "issue:queue",
1818
"unit": "brainstorm-to-issue",
1919
"execution": {
2020
"type": "slash-command",
@@ -23,7 +23,7 @@
2323
"contextHint": "Build execution queue from converted brainstorm issues"
2424
},
2525
{
26-
"cmd": "/issue:execute",
26+
"cmd": "issue:execute",
2727
"args": "--queue auto",
2828
"unit": "brainstorm-to-issue",
2929
"execution": {

.claude/skills/flow-coordinator/templates/brainstorm.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"level": 4,
55
"steps": [
66
{
7-
"cmd": "/workflow:brainstorm-with-file",
7+
"cmd": "workflow:brainstorm-with-file",
88
"args": "\"{{goal}}\"",
9+
"unit": "brainstorm-with-file",
910
"execution": {
1011
"type": "slash-command",
1112
"mode": "mainprocess"

.claude/skills/flow-coordinator/templates/bugfix-hotfix.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"level": 1,
55
"steps": [
66
{
7-
"cmd": "/workflow:lite-plan",
7+
"cmd": "workflow-lite-plan",
88
"args": "--hotfix \"{{goal}}\"",
9+
"unit": "standalone",
910
"execution": {
1011
"type": "slash-command",
1112
"mode": "async"

.claude/skills/flow-coordinator/templates/bugfix.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"level": 2,
55
"steps": [
66
{
7-
"cmd": "/workflow:lite-plan",
7+
"cmd": "workflow-lite-plan",
88
"args": "--bugfix \"{{goal}}\"",
99
"unit": "bug-fix",
1010
"execution": {
@@ -14,7 +14,8 @@
1414
"contextHint": "Analyze bug report, trace execution flow, identify root cause with fix strategy"
1515
},
1616
{
17-
"cmd": "/workflow:lite-execute",
17+
"cmd": "workflow-lite-plan",
18+
"route": "lite-execute",
1819
"args": "--in-memory",
1920
"unit": "bug-fix",
2021
"execution": {
@@ -24,7 +25,7 @@
2425
"contextHint": "Implement fix based on diagnosis. Execute against in-memory state from lite-plan analysis."
2526
},
2627
{
27-
"cmd": "/workflow:test-fix-gen",
28+
"cmd": "workflow-test-fix",
2829
"unit": "test-validation",
2930
"optional": true,
3031
"execution": {
@@ -34,7 +35,8 @@
3435
"contextHint": "Generate test tasks to verify bug fix and prevent regression"
3536
},
3637
{
37-
"cmd": "/workflow:test-cycle-execute",
38+
"cmd": "workflow-test-fix",
39+
"route": "test-cycle-execute",
3840
"unit": "test-validation",
3941
"optional": true,
4042
"execution": {

.claude/skills/flow-coordinator/templates/coupled.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"level": 3,
55
"steps": [
66
{
7-
"cmd": "/workflow:plan",
7+
"cmd": "workflow-plan",
88
"args": "\"{{goal}}\"",
99
"unit": "verified-planning-execution",
1010
"execution": {
@@ -14,7 +14,8 @@
1414
"contextHint": "Create detailed implementation plan with architecture design, file structure, dependencies, and milestones"
1515
},
1616
{
17-
"cmd": "/workflow:plan-verify",
17+
"cmd": "workflow-plan",
18+
"route": "plan-verify",
1819
"unit": "verified-planning-execution",
1920
"execution": {
2021
"type": "slash-command",
@@ -23,7 +24,7 @@
2324
"contextHint": "Verify IMPL_PLAN.md against requirements, check for missing details, conflicts, and quality gates"
2425
},
2526
{
26-
"cmd": "/workflow:execute",
27+
"cmd": "workflow-execute",
2728
"unit": "verified-planning-execution",
2829
"execution": {
2930
"type": "slash-command",
@@ -32,7 +33,8 @@
3233
"contextHint": "Execute implementation based on verified plan. Resume from planning session with all context preserved."
3334
},
3435
{
35-
"cmd": "/workflow:review-session-cycle",
36+
"cmd": "review-cycle",
37+
"route": "session",
3638
"unit": "code-review",
3739
"execution": {
3840
"type": "slash-command",
@@ -41,7 +43,8 @@
4143
"contextHint": "Perform multi-dimensional code review across correctness, security, performance, maintainability. Reference execution session for full code context."
4244
},
4345
{
44-
"cmd": "/workflow:review-cycle-fix",
46+
"cmd": "review-cycle",
47+
"route": "fix",
4548
"unit": "code-review",
4649
"execution": {
4750
"type": "slash-command",
@@ -50,7 +53,7 @@
5053
"contextHint": "Fix issues identified in review findings with prioritization by severity levels"
5154
},
5255
{
53-
"cmd": "/workflow:test-fix-gen",
56+
"cmd": "workflow-test-fix",
5457
"unit": "test-validation",
5558
"execution": {
5659
"type": "slash-command",
@@ -59,7 +62,8 @@
5962
"contextHint": "Generate comprehensive test tasks for the implementation with coverage analysis"
6063
},
6164
{
62-
"cmd": "/workflow:test-cycle-execute",
65+
"cmd": "workflow-test-fix",
66+
"route": "test-cycle-execute",
6367
"unit": "test-validation",
6468
"execution": {
6569
"type": "slash-command",

.claude/skills/flow-coordinator/templates/debug.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"level": 3,
55
"steps": [
66
{
7-
"cmd": "/workflow:debug-with-file",
7+
"cmd": "workflow:debug-with-file",
88
"args": "\"{{goal}}\"",
9+
"unit": "debug-with-file",
910
"execution": {
1011
"type": "slash-command",
1112
"mode": "mainprocess"

0 commit comments

Comments
 (0)