@@ -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
386402async 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
400418async 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
428446function 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+
455504function 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
471515Context:
472516Task: 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
480524Context:
481525Task: Implement user registration
@@ -504,13 +548,13 @@ Select workflow template:
504548` ` `
505549Template: coupled
506550Steps:
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
515559Proceed? [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
0 commit comments