maestro-flow 0.4.10 → 0.4.11
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/.agents/agents/cli-explore-agent.md +189 -0
- package/.agents/agents/conceptual-planning-agent.md +247 -0
- package/.agents/agents/impeccable-agent.md +101 -0
- package/.agents/agents/team-supervisor.md +145 -0
- package/.agents/agents/team-worker.md +239 -0
- package/.agents/agents/ui-design-agent.md +289 -0
- package/.agents/agents/workflow-analyzer.md +117 -0
- package/.agents/agents/workflow-codebase-mapper.md +79 -0
- package/.agents/agents/workflow-collab-planner.md +145 -0
- package/.agents/agents/workflow-debugger.md +105 -0
- package/.agents/agents/workflow-executor.md +134 -0
- package/.agents/agents/workflow-external-researcher.md +88 -0
- package/.agents/agents/workflow-integration-checker.md +85 -0
- package/.agents/agents/workflow-nyquist-auditor.md +87 -0
- package/.agents/agents/workflow-phase-researcher.md +87 -0
- package/.agents/agents/workflow-plan-checker.md +92 -0
- package/.agents/agents/workflow-planner.md +197 -0
- package/.agents/agents/workflow-project-researcher.md +76 -0
- package/.agents/agents/workflow-research-synthesizer.md +72 -0
- package/.agents/agents/workflow-reviewer.md +84 -0
- package/.agents/agents/workflow-roadmapper.md +83 -0
- package/.agents/agents/workflow-verifier.md +122 -0
- package/.agents/skills/codify-to-knowhow/SKILL.md +169 -0
- package/.agents/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
- package/.agents/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
- package/.agents/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
- package/.agents/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
- package/.agents/skills/learn-decompose/SKILL.md +118 -0
- package/.agents/skills/learn-follow/SKILL.md +129 -0
- package/.agents/skills/learn-investigate/SKILL.md +154 -0
- package/.agents/skills/learn-retro/SKILL.md +159 -0
- package/.agents/skills/learn-second-opinion/SKILL.md +124 -0
- package/.agents/skills/maestro/SKILL.md +224 -0
- package/.agents/skills/maestro-amend/SKILL.md +165 -0
- package/.agents/skills/maestro-analyze/SKILL.md +135 -0
- package/.agents/skills/maestro-brainstorm/SKILL.md +118 -0
- package/.agents/skills/maestro-collab/SKILL.md +174 -0
- package/.agents/skills/maestro-composer/SKILL.md +181 -0
- package/.agents/skills/maestro-execute/SKILL.md +133 -0
- package/.agents/skills/maestro-fork/SKILL.md +88 -0
- package/.agents/skills/maestro-guard/SKILL.md +103 -0
- package/.agents/skills/maestro-help/SKILL.md +266 -0
- package/.agents/skills/maestro-help/index/catalog.json +184 -0
- package/.agents/skills/maestro-help/phases/01-parse-intent.md +122 -0
- package/.agents/skills/maestro-help/phases/02-search-present.md +181 -0
- package/.agents/skills/maestro-help/phases/03-workflow-guide.md +186 -0
- package/.agents/skills/maestro-impeccable/SKILL.md +251 -0
- package/.agents/skills/maestro-init/SKILL.md +80 -0
- package/.agents/skills/maestro-learn/SKILL.md +142 -0
- package/.agents/skills/maestro-merge/SKILL.md +66 -0
- package/.agents/skills/maestro-milestone-audit/SKILL.md +70 -0
- package/.agents/skills/maestro-milestone-complete/SKILL.md +77 -0
- package/.agents/skills/maestro-milestone-release/SKILL.md +98 -0
- package/.agents/skills/maestro-overlay/SKILL.md +180 -0
- package/.agents/skills/maestro-plan/SKILL.md +172 -0
- package/.agents/skills/maestro-player/SKILL.md +177 -0
- package/.agents/skills/maestro-quick/SKILL.md +67 -0
- package/.agents/skills/maestro-ralph/SKILL.md +685 -0
- package/.agents/skills/maestro-ralph-execute/SKILL.md +259 -0
- package/.agents/skills/maestro-roadmap/SKILL.md +170 -0
- package/.agents/skills/maestro-tools-execute/SKILL.md +119 -0
- package/.agents/skills/maestro-tools-register/SKILL.md +159 -0
- package/.agents/skills/maestro-ui-codify/SKILL.md +82 -0
- package/.agents/skills/maestro-update/SKILL.md +178 -0
- package/.agents/skills/maestro-verify/SKILL.md +111 -0
- package/.agents/skills/manage-codebase-rebuild/SKILL.md +77 -0
- package/.agents/skills/manage-codebase-refresh/SKILL.md +59 -0
- package/.agents/skills/manage-harvest/SKILL.md +96 -0
- package/.agents/skills/manage-issue/SKILL.md +75 -0
- package/.agents/skills/manage-issue-discover/SKILL.md +83 -0
- package/.agents/skills/manage-knowhow/SKILL.md +79 -0
- package/.agents/skills/manage-knowhow-capture/SKILL.md +81 -0
- package/.agents/skills/manage-learn/SKILL.md +67 -0
- package/.agents/skills/manage-status/SKILL.md +54 -0
- package/.agents/skills/manage-wiki/SKILL.md +64 -0
- package/.agents/skills/quality-auto-test/SKILL.md +138 -0
- package/.agents/skills/quality-debug/SKILL.md +122 -0
- package/.agents/skills/quality-refactor/SKILL.md +69 -0
- package/.agents/skills/quality-retrospective/SKILL.md +79 -0
- package/.agents/skills/quality-review/SKILL.md +130 -0
- package/.agents/skills/quality-sync/SKILL.md +53 -0
- package/.agents/skills/quality-test/SKILL.md +119 -0
- package/.agents/skills/security-audit/SKILL.md +157 -0
- package/.agents/skills/skill-iter-tune/SKILL.md +384 -0
- package/.agents/skills/skill-iter-tune/phases/01-setup.md +144 -0
- package/.agents/skills/skill-iter-tune/phases/02-execute.md +292 -0
- package/.agents/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
- package/.agents/skills/skill-iter-tune/phases/04-improve.md +186 -0
- package/.agents/skills/skill-iter-tune/phases/05-report.md +166 -0
- package/.agents/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
- package/.agents/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
- package/.agents/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
- package/.agents/skills/spec-add/SKILL.md +70 -0
- package/.agents/skills/spec-load/SKILL.md +73 -0
- package/.agents/skills/spec-remove/SKILL.md +53 -0
- package/.agents/skills/spec-setup/SKILL.md +50 -0
- package/.agents/skills/team-coordinate/SKILL.md +268 -0
- package/.agents/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
- package/.agents/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
- package/.agents/skills/team-coordinate/roles/coordinator/commands/monitor.md +358 -0
- package/.agents/skills/team-coordinate/roles/coordinator/role.md +365 -0
- package/.agents/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
- package/.agents/skills/team-coordinate/specs/pipelines.md +97 -0
- package/.agents/skills/team-coordinate/specs/quality-gates.md +112 -0
- package/.agents/skills/team-coordinate/specs/role-spec-template.md +198 -0
- package/.agents/skills/team-executor/SKILL.md +191 -0
- package/.agents/skills/team-executor/roles/executor/commands/monitor.md +239 -0
- package/.agents/skills/team-executor/roles/executor/role.md +171 -0
- package/.agents/skills/team-executor/specs/session-schema.md +264 -0
- package/.agents/skills/team-lifecycle-v4/SKILL.md +211 -0
- package/.agents/skills/team-lifecycle-v4/roles/analyst/role.md +96 -0
- package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
- package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
- package/.agents/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
- package/.agents/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
- package/.agents/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
- package/.agents/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
- package/.agents/skills/team-lifecycle-v4/roles/executor/role.md +69 -0
- package/.agents/skills/team-lifecycle-v4/roles/planner/role.md +87 -0
- package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
- package/.agents/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
- package/.agents/skills/team-lifecycle-v4/roles/reviewer/role.md +71 -0
- package/.agents/skills/team-lifecycle-v4/roles/supervisor/role.md +194 -0
- package/.agents/skills/team-lifecycle-v4/roles/tester/role.md +89 -0
- package/.agents/skills/team-lifecycle-v4/roles/writer/role.md +97 -0
- package/.agents/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
- package/.agents/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
- package/.agents/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
- package/.agents/skills/team-lifecycle-v4/templates/architecture.md +254 -0
- package/.agents/skills/team-lifecycle-v4/templates/epics.md +196 -0
- package/.agents/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
- package/.agents/skills/team-lifecycle-v4/templates/requirements.md +224 -0
- package/.agents/skills/team-quality-assurance/SKILL.md +149 -0
- package/.agents/skills/team-quality-assurance/roles/analyst/role.md +90 -0
- package/.agents/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
- package/.agents/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
- package/.agents/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +250 -0
- package/.agents/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
- package/.agents/skills/team-quality-assurance/roles/executor/role.md +68 -0
- package/.agents/skills/team-quality-assurance/roles/generator/role.md +70 -0
- package/.agents/skills/team-quality-assurance/roles/scout/role.md +77 -0
- package/.agents/skills/team-quality-assurance/roles/strategist/role.md +73 -0
- package/.agents/skills/team-quality-assurance/specs/pipelines.md +115 -0
- package/.agents/skills/team-quality-assurance/specs/team-config.json +131 -0
- package/.agents/skills/team-review/SKILL.md +149 -0
- package/.agents/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
- package/.agents/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
- package/.agents/skills/team-review/roles/coordinator/commands/monitor.md +224 -0
- package/.agents/skills/team-review/roles/coordinator/role.md +132 -0
- package/.agents/skills/team-review/roles/fixer/role.md +78 -0
- package/.agents/skills/team-review/roles/reviewer/role.md +70 -0
- package/.agents/skills/team-review/roles/scanner/role.md +81 -0
- package/.agents/skills/team-review/specs/dimensions.md +82 -0
- package/.agents/skills/team-review/specs/finding-schema.json +82 -0
- package/.agents/skills/team-review/specs/pipelines.md +102 -0
- package/.agents/skills/team-review/specs/team-config.json +27 -0
- package/.agents/skills/team-tech-debt/SKILL.md +130 -0
- package/.agents/skills/team-tech-debt/roles/assessor/role.md +79 -0
- package/.agents/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
- package/.agents/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
- package/.agents/skills/team-tech-debt/roles/coordinator/commands/monitor.md +209 -0
- package/.agents/skills/team-tech-debt/roles/coordinator/role.md +123 -0
- package/.agents/skills/team-tech-debt/roles/executor/role.md +78 -0
- package/.agents/skills/team-tech-debt/roles/planner/role.md +71 -0
- package/.agents/skills/team-tech-debt/roles/scanner/role.md +92 -0
- package/.agents/skills/team-tech-debt/roles/validator/role.md +80 -0
- package/.agents/skills/team-tech-debt/specs/pipelines.md +47 -0
- package/.agents/skills/team-tech-debt/specs/team-config.json +129 -0
- package/.agents/skills/team-testing/SKILL.md +145 -0
- package/.agents/skills/team-testing/roles/analyst/role.md +105 -0
- package/.agents/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
- package/.agents/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
- package/.agents/skills/team-testing/roles/coordinator/commands/monitor.md +257 -0
- package/.agents/skills/team-testing/roles/coordinator/role.md +134 -0
- package/.agents/skills/team-testing/roles/executor/role.md +101 -0
- package/.agents/skills/team-testing/roles/generator/role.md +100 -0
- package/.agents/skills/team-testing/roles/strategist/role.md +85 -0
- package/.agents/skills/team-testing/specs/pipelines.md +101 -0
- package/.agents/skills/team-testing/specs/team-config.json +93 -0
- package/.agents/skills/wiki-connect/SKILL.md +64 -0
- package/.agents/skills/wiki-digest/SKILL.md +70 -0
- package/.agents/skills/workflow-skill-designer/SKILL.md +498 -0
- package/.agents/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
- package/.agents/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
- package/.agents/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
- package/.agents/skills/workflow-skill-designer/phases/04-validation.md +471 -0
- package/.agy/skills/maestro/SKILL.md +13 -11
- package/.agy/skills/maestro-ralph/SKILL.md +222 -87
- package/.claude/commands/maestro-ralph.md +222 -87
- package/.claude/commands/maestro.md +13 -11
- package/.codex/skills/maestro/SKILL.md +23 -17
- package/.codex/skills/maestro-ralph/SKILL.md +177 -67
- package/dist/src/commands/install-backend.d.ts +12 -0
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +144 -0
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/core/component-defs.d.ts +6 -0
- package/dist/src/core/component-defs.d.ts.map +1 -1
- package/dist/src/core/component-defs.js +97 -0
- package/dist/src/core/component-defs.js.map +1 -1
- package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts +11 -0
- package/dist/src/tui/install-ui/ExtraMcpConfig.d.ts.map +1 -0
- package/dist/src/tui/install-ui/ExtraMcpConfig.js +61 -0
- package/dist/src/tui/install-ui/ExtraMcpConfig.js.map +1 -0
- package/dist/src/tui/install-ui/InstallConfirm.d.ts +3 -0
- package/dist/src/tui/install-ui/InstallConfirm.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js +1 -1
- package/dist/src/tui/install-ui/InstallConfirm.js.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.d.ts +2 -0
- package/dist/src/tui/install-ui/InstallExecution.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallExecution.js +14 -2
- package/dist/src/tui/install-ui/InstallExecution.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +16 -3
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.d.ts +2 -0
- package/dist/src/tui/install-ui/InstallHub.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallHub.js +8 -0
- package/dist/src/tui/install-ui/InstallHub.js.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallResult.js +3 -1
- package/dist/src/tui/install-ui/InstallResult.js.map +1 -1
- package/dist/src/utils/update-notices.js +19 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
# Phase 3: Phase Files Design
|
|
2
|
+
|
|
3
|
+
Generate phase files in `phases/` directory, preserving full execution detail from source content. Each phase file is a complete execution instruction.
|
|
4
|
+
|
|
5
|
+
## Objective
|
|
6
|
+
|
|
7
|
+
- Create `phases/0N-{slug}.md` for each phase in workflowConfig
|
|
8
|
+
- Preserve full source content (agent prompts, bash commands, code, validation)
|
|
9
|
+
- Add standard phase structure (header, objective, output, next phase)
|
|
10
|
+
- Handle different source types (command extraction vs new generation)
|
|
11
|
+
|
|
12
|
+
## Critical Rule
|
|
13
|
+
|
|
14
|
+
**Content Fidelity**: Phase files must be **content-faithful** to their source. Do NOT summarize, abbreviate, or simplify execution detail. The phase file IS the execution instruction.
|
|
15
|
+
|
|
16
|
+
| Content Type | Rule |
|
|
17
|
+
|-------------|------|
|
|
18
|
+
| Agent prompts (Task calls) | Preserve **verbatim** including all prompt text, variables, constraints |
|
|
19
|
+
| Bash command blocks | Preserve **verbatim** including all flags, paths, error handling |
|
|
20
|
+
| Code implementations | Preserve **verbatim** including all functions, validation logic |
|
|
21
|
+
| Validation checklists | Preserve **verbatim** including all check items |
|
|
22
|
+
| Error handling details | Preserve **verbatim** including recovery strategies |
|
|
23
|
+
| Tables and specifications | Preserve **verbatim** including all rows and columns |
|
|
24
|
+
| Comments and notes | Preserve **verbatim** including inline documentation |
|
|
25
|
+
|
|
26
|
+
**Anti-Pattern**: Creating a phase file that says "See original command for details" or "Execute the agent with appropriate parameters" - this defeats the purpose of the skill structure. The phase file must be self-contained.
|
|
27
|
+
|
|
28
|
+
## Phase File Content Restrictions
|
|
29
|
+
|
|
30
|
+
Phase files are internal execution documents. They MUST NOT contain the following prohibited content:
|
|
31
|
+
|
|
32
|
+
| Prohibited Pattern | Detection | Correct Location |
|
|
33
|
+
|-------------------|-----------|-----------------|
|
|
34
|
+
| Flag parsing (`$ARGUMENTS.includes(...)`) | Grep: `\$ARGUMENTS\.includes` | SKILL.md via ask_user → `workflowPreferences` |
|
|
35
|
+
| Invocation syntax (`/skill-name "..."`) | Grep: `\/\w+[\-:]\w+\s+"` | Removed entirely (phase files are not user-facing) |
|
|
36
|
+
| Conversion provenance (`Source: Converted from...`) | Grep: `Source:.*Converted from` | Removed entirely (implementation detail) |
|
|
37
|
+
| Skill routing for inter-phase (`invoke_skill(skill="...")`) | Grep: `Skill\(skill=` | Direct `read_file("phases/0N-xxx.md")` |
|
|
38
|
+
|
|
39
|
+
### Preference Reference Pattern
|
|
40
|
+
|
|
41
|
+
Phase files may **reference** workflow preferences but must NOT **parse** them from arguments:
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
// CORRECT: Reference workflowPreferences (set by SKILL.md)
|
|
45
|
+
const autoYes = workflowPreferences.autoYes
|
|
46
|
+
const forceExplore = workflowPreferences.forceExplore
|
|
47
|
+
|
|
48
|
+
// WRONG: Parse from $ARGUMENTS
|
|
49
|
+
const autoYes = $ARGUMENTS.includes('--yes') || $ARGUMENTS.includes('-y')
|
|
50
|
+
const forceExplore = $ARGUMENTS.includes('--explore') || $ARGUMENTS.includes('-e')
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Inter-Phase Handoff Pattern
|
|
54
|
+
|
|
55
|
+
When phase N needs to invoke phase M, use direct phase reading:
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
// CORRECT: Direct handoff (executionContext already set)
|
|
59
|
+
read_file("phases/02-lite-execute.md")
|
|
60
|
+
// Execute with executionContext (Mode 1)
|
|
61
|
+
|
|
62
|
+
// WRONG: Skill routing (unnecessary round-trip)
|
|
63
|
+
invoke_skill(skill="workflow-lite-plan", args="--in-memory")
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Content Restriction Enforcement
|
|
67
|
+
|
|
68
|
+
When extracting from commands (Step 3.2), apply content sanitization after verbatim extraction:
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
function sanitizePhaseContent(content) {
|
|
72
|
+
let sanitized = content;
|
|
73
|
+
|
|
74
|
+
// Remove flag parsing blocks
|
|
75
|
+
sanitized = sanitized.replace(
|
|
76
|
+
/\/\/.*flag.*parsing[\s\S]*?\n(?=\n)/gi, ''
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
// Remove invocation syntax examples
|
|
80
|
+
sanitized = sanitized.replace(
|
|
81
|
+
/^.*\/\w+[\-:]\w+\s+"[^"]*".*$/gm, ''
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
// Remove conversion provenance notes
|
|
85
|
+
sanitized = sanitized.replace(
|
|
86
|
+
/^\*\*Source\*\*:.*Converted from.*$/gm, ''
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
// Replace all $ARGUMENTS.includes patterns with workflowPreferences reference
|
|
90
|
+
// Handles any flag name, not just --yes/-y
|
|
91
|
+
sanitized = sanitized.replace(
|
|
92
|
+
/\$ARGUMENTS\.includes\(['"]--?([^"']+)['"]\)/g,
|
|
93
|
+
(match, flagName) => {
|
|
94
|
+
// Map common flag names to workflowPreferences keys
|
|
95
|
+
const flagMap = {
|
|
96
|
+
'yes': 'workflowPreferences.autoYes',
|
|
97
|
+
'y': 'workflowPreferences.autoYes',
|
|
98
|
+
'explore': 'workflowPreferences.forceExplore',
|
|
99
|
+
'e': 'workflowPreferences.forceExplore'
|
|
100
|
+
};
|
|
101
|
+
return flagMap[flagName] || `workflowPreferences.${flagName}`;
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
// Also clean up residual || chains from multi-flag expressions
|
|
105
|
+
sanitized = sanitized.replace(
|
|
106
|
+
/workflowPreferences\.(\w+)\s*\|\|\s*workflowPreferences\.\1/g,
|
|
107
|
+
'workflowPreferences.$1'
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// Replace invoke_skill() inter-phase routing with direct read_file(with or without args)
|
|
111
|
+
sanitized = sanitized.replace(
|
|
112
|
+
/Skill\(skill=["']([^"']+)["'](?:,\s*args=["']([^"']+)["'])?\)/g,
|
|
113
|
+
(match, skillName) => `read_file("phases/0N-xxx.md")\n// Execute with context`
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
return sanitized;
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Step 3.1: Phase File Generation Strategy
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
function selectGenerationStrategy(phase, config) {
|
|
124
|
+
if (config.source.type === 'command_set' && phase.sourcePath) {
|
|
125
|
+
return 'extract'; // Extract from existing command file
|
|
126
|
+
} else if (config.source.type === 'text_description') {
|
|
127
|
+
return 'generate'; // Generate from requirements
|
|
128
|
+
} else if (config.source.type === 'existing_skill') {
|
|
129
|
+
return 'restructure'; // Restructure existing content
|
|
130
|
+
}
|
|
131
|
+
return 'generate';
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Step 3.2: Mode A - Extract from Command
|
|
136
|
+
|
|
137
|
+
When source is an existing command file, transform its content into phase file format:
|
|
138
|
+
|
|
139
|
+
```javascript
|
|
140
|
+
function extractPhaseFromCommand(phase, config) {
|
|
141
|
+
const sourceContent = read_file(phase.sourcePath);
|
|
142
|
+
const sourceFrontmatter = extractYAMLFrontmatter(sourceContent);
|
|
143
|
+
const sourceBody = removeYAMLFrontmatter(sourceContent);
|
|
144
|
+
|
|
145
|
+
// Phase file structure:
|
|
146
|
+
// 1. Phase header (new)
|
|
147
|
+
// 2. Source body content (preserved verbatim)
|
|
148
|
+
// 3. Output section (extracted or added)
|
|
149
|
+
// 4. Next Phase link (new)
|
|
150
|
+
|
|
151
|
+
let phaseContent = '';
|
|
152
|
+
|
|
153
|
+
// 1. Phase header
|
|
154
|
+
phaseContent += `# Phase ${phase.number}: ${phase.name}\n\n`;
|
|
155
|
+
phaseContent += `${phase.description}.\n\n`;
|
|
156
|
+
|
|
157
|
+
// 2. Source body content - PRESERVED VERBATIM
|
|
158
|
+
// Only modifications:
|
|
159
|
+
// a. Remove original H1 title (replaced by phase header)
|
|
160
|
+
// b. Remove command-specific frontmatter references
|
|
161
|
+
// c. Preserve everything else as-is
|
|
162
|
+
|
|
163
|
+
// Remove original H1 title line(s)
|
|
164
|
+
let bodyContent = sourceBody;
|
|
165
|
+
bodyContent = bodyContent.replace(/^# .+\n+/, '');
|
|
166
|
+
|
|
167
|
+
// Remove command-specific overview if it just restates what the phase header says
|
|
168
|
+
// But KEEP any overview content that adds execution detail
|
|
169
|
+
|
|
170
|
+
phaseContent += bodyContent;
|
|
171
|
+
|
|
172
|
+
// 2.5. Ensure Objective section exists
|
|
173
|
+
if (!bodyContent.includes('## Objective')) {
|
|
174
|
+
// Insert Objective after phase header, before main content
|
|
175
|
+
const objectiveSection = `## Objective\n\n- ${phase.description}\n`;
|
|
176
|
+
phaseContent = phaseContent.replace(
|
|
177
|
+
`${phase.description}.\n\n${bodyContent}`,
|
|
178
|
+
`${phase.description}.\n\n${objectiveSection}\n${bodyContent}`
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// 3. Ensure Output section exists
|
|
183
|
+
if (!bodyContent.includes('## Output')) {
|
|
184
|
+
phaseContent += '\n## Output\n\n';
|
|
185
|
+
if (phase.outputVariables.length > 0) {
|
|
186
|
+
phaseContent += phase.outputVariables.map(v => `- **Variable**: \`${v}\``).join('\n') + '\n';
|
|
187
|
+
}
|
|
188
|
+
if (phase.outputFiles.length > 0) {
|
|
189
|
+
phaseContent += phase.outputFiles.map(f => `- **File**: \`${f}\``).join('\n') + '\n';
|
|
190
|
+
}
|
|
191
|
+
phaseContent += `- **track_tasks**: Mark Phase ${phase.number} completed, Phase ${phase.number + 1} in_progress\n`;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// 4. Ensure Next Phase link exists
|
|
195
|
+
if (!bodyContent.includes('## Next Phase')) {
|
|
196
|
+
const nextPhase = config.phases.find(p => p.number === phase.number + 1);
|
|
197
|
+
if (nextPhase) {
|
|
198
|
+
const nextFilename = `${String(nextPhase.number).padStart(2, '0')}-${nextPhase.slug}.md`;
|
|
199
|
+
phaseContent += `\n## Next Phase\n\n`;
|
|
200
|
+
phaseContent += `Return to orchestrator, then auto-continue to [Phase ${nextPhase.number}: ${nextPhase.name}](${nextFilename}).\n`;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return phaseContent;
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Content Preservation Checklist
|
|
209
|
+
|
|
210
|
+
When extracting from commands, verify these content types are preserved:
|
|
211
|
+
|
|
212
|
+
```javascript
|
|
213
|
+
function verifyContentPreservation(sourceContent, phaseContent) {
|
|
214
|
+
const checks = {
|
|
215
|
+
// Count code blocks
|
|
216
|
+
sourceCodeBlocks: (sourceContent.match(/```/g) || []).length / 2,
|
|
217
|
+
phaseCodeBlocks: (phaseContent.match(/```/g) || []).length / 2,
|
|
218
|
+
|
|
219
|
+
// Count Task/Agent calls
|
|
220
|
+
sourceAgentCalls: (sourceContent.match(/Task\(/g) || []).length,
|
|
221
|
+
phaseAgentCalls: (phaseContent.match(/Task\(/g) || []).length,
|
|
222
|
+
|
|
223
|
+
// Count bash commands
|
|
224
|
+
sourceBashBlocks: (sourceContent.match(/```bash/g) || []).length,
|
|
225
|
+
phaseBashBlocks: (phaseContent.match(/```bash/g) || []).length,
|
|
226
|
+
|
|
227
|
+
// Count tables
|
|
228
|
+
sourceTables: (sourceContent.match(/\|.*\|.*\|/g) || []).length,
|
|
229
|
+
phaseTables: (phaseContent.match(/\|.*\|.*\|/g) || []).length,
|
|
230
|
+
|
|
231
|
+
// Count ask_user calls
|
|
232
|
+
sourceAUQ: (sourceContent.match(/ask_user/g) || []).length,
|
|
233
|
+
phaseAUQ: (phaseContent.match(/ask_user/g) || []).length,
|
|
234
|
+
|
|
235
|
+
// Line count comparison (phase should be >= source minus frontmatter)
|
|
236
|
+
sourceLines: sourceContent.split('\n').length,
|
|
237
|
+
phaseLines: phaseContent.split('\n').length
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const issues = [];
|
|
241
|
+
if (checks.phaseCodeBlocks < checks.sourceCodeBlocks) {
|
|
242
|
+
issues.push(`Missing code blocks: source=${checks.sourceCodeBlocks}, phase=${checks.phaseCodeBlocks}`);
|
|
243
|
+
}
|
|
244
|
+
if (checks.phaseAgentCalls < checks.sourceAgentCalls) {
|
|
245
|
+
issues.push(`Missing agent calls: source=${checks.sourceAgentCalls}, phase=${checks.phaseAgentCalls}`);
|
|
246
|
+
}
|
|
247
|
+
if (checks.phaseBashBlocks < checks.sourceBashBlocks) {
|
|
248
|
+
issues.push(`Missing bash blocks: source=${checks.sourceBashBlocks}, phase=${checks.phaseBashBlocks}`);
|
|
249
|
+
}
|
|
250
|
+
if (checks.phaseTables < checks.sourceTables * 0.8) {
|
|
251
|
+
issues.push(`Missing tables: source=${checks.sourceTables}, phase=${checks.phaseTables}`);
|
|
252
|
+
}
|
|
253
|
+
if (checks.phaseAUQ < checks.sourceAUQ) {
|
|
254
|
+
issues.push(`Missing ask_user: source=${checks.sourceAUQ}, phase=${checks.phaseAUQ}`);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return { checks, issues, passed: issues.length === 0 };
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Handling Orchestrator-Level Content in Source Commands
|
|
262
|
+
|
|
263
|
+
Some commands mix orchestrator-level instructions (coordination, track_tasks) with execution detail. Separation rules:
|
|
264
|
+
|
|
265
|
+
| Content in Source Command | Goes To | Rule |
|
|
266
|
+
|---------------------------|---------|------|
|
|
267
|
+
| Phase execution steps, agent prompts, bash commands | **Phase file** | Preserve verbatim |
|
|
268
|
+
| track_tasks update examples specific to this phase | **Phase file** (optional) | Keep if useful for context |
|
|
269
|
+
| Inter-phase data passing code | **SKILL.md** Post-Phase Updates | Extract to orchestrator |
|
|
270
|
+
| Coordinator instructions ("after this phase, auto-continue") | **SKILL.md** Core Rules | Extract to orchestrator |
|
|
271
|
+
| Conditional logic ("if conflict_risk >= medium") | **SKILL.md** Execution Flow | Extract to orchestrator |
|
|
272
|
+
|
|
273
|
+
When in doubt, **keep content in the phase file**. It's better to have slight overlap than to lose execution detail.
|
|
274
|
+
|
|
275
|
+
## Step 3.3: Mode B - Generate from Requirements
|
|
276
|
+
|
|
277
|
+
When source is a text description, generate phase files interactively:
|
|
278
|
+
|
|
279
|
+
```javascript
|
|
280
|
+
function generatePhaseFromRequirements(phase, config) {
|
|
281
|
+
let phaseContent = '';
|
|
282
|
+
|
|
283
|
+
// Phase header
|
|
284
|
+
phaseContent += `# Phase ${phase.number}: ${phase.name}\n\n`;
|
|
285
|
+
phaseContent += `${phase.description}.\n\n`;
|
|
286
|
+
|
|
287
|
+
// Objective
|
|
288
|
+
phaseContent += `## Objective\n\n`;
|
|
289
|
+
phaseContent += `- ${phase.description}\n`;
|
|
290
|
+
if (phase.outputVariables.length > 0) {
|
|
291
|
+
phaseContent += `- Produce: ${phase.outputVariables.join(', ')}\n`;
|
|
292
|
+
}
|
|
293
|
+
if (phase.outputFiles.length > 0) {
|
|
294
|
+
phaseContent += `- Generate: ${phase.outputFiles.join(', ')}\n`;
|
|
295
|
+
}
|
|
296
|
+
phaseContent += '\n';
|
|
297
|
+
|
|
298
|
+
// Execution steps
|
|
299
|
+
phaseContent += `## Execution\n\n`;
|
|
300
|
+
|
|
301
|
+
if (phase.usesAgents) {
|
|
302
|
+
// Generate agent delegation skeleton
|
|
303
|
+
for (const agentType of phase.agentTypes) {
|
|
304
|
+
phaseContent += `### Step: ${agentType} Delegation\n\n`;
|
|
305
|
+
phaseContent += '```javascript\n';
|
|
306
|
+
phaseContent += `const result = delegate_subagent({\n`;
|
|
307
|
+
phaseContent += ` subagent_type: "${mapAgentType(agentType)}",\n`;
|
|
308
|
+
phaseContent += ` prompt: \`\n`;
|
|
309
|
+
phaseContent += ` [ROLE] ${agentType}\n`;
|
|
310
|
+
phaseContent += ` [TASK] ${phase.description}\n`;
|
|
311
|
+
phaseContent += ` [INPUT] \${inputData}\n`;
|
|
312
|
+
phaseContent += ` [OUTPUT] \${outputPath}\n`;
|
|
313
|
+
phaseContent += ` \`,\n`;
|
|
314
|
+
phaseContent += ` run_in_background: false\n`;
|
|
315
|
+
phaseContent += `});\n`;
|
|
316
|
+
phaseContent += '```\n\n';
|
|
317
|
+
}
|
|
318
|
+
} else {
|
|
319
|
+
// Generate direct execution skeleton
|
|
320
|
+
phaseContent += `### Step ${phase.number}.1: Execute\n\n`;
|
|
321
|
+
phaseContent += `TODO: Add execution detail for ${phase.name}\n\n`;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Output
|
|
325
|
+
phaseContent += `## Output\n\n`;
|
|
326
|
+
phase.outputVariables.forEach(v => {
|
|
327
|
+
phaseContent += `- **Variable**: \`${v}\`\n`;
|
|
328
|
+
});
|
|
329
|
+
phase.outputFiles.forEach(f => {
|
|
330
|
+
phaseContent += `- **File**: \`${f}\`\n`;
|
|
331
|
+
});
|
|
332
|
+
phaseContent += `- **track_tasks**: Mark Phase ${phase.number} completed\n\n`;
|
|
333
|
+
|
|
334
|
+
// Next Phase
|
|
335
|
+
const nextPhase = config.phases.find(p => p.number === phase.number + 1);
|
|
336
|
+
if (nextPhase) {
|
|
337
|
+
const nextFilename = `${String(nextPhase.number).padStart(2, '0')}-${nextPhase.slug}.md`;
|
|
338
|
+
phaseContent += `## Next Phase\n\n`;
|
|
339
|
+
phaseContent += `Return to orchestrator, then auto-continue to [Phase ${nextPhase.number}: ${nextPhase.name}](${nextFilename}).\n`;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return phaseContent;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// Map custom agent type names to Task subagent_types
|
|
346
|
+
function mapAgentType(agentType) {
|
|
347
|
+
const mapping = {
|
|
348
|
+
'cli-explore-agent': 'cli-explore-agent',
|
|
349
|
+
'context-search-agent': 'context-search-agent',
|
|
350
|
+
'cli-execution-agent': 'cli-execution-agent',
|
|
351
|
+
'action-planning-agent': 'action-planning-agent',
|
|
352
|
+
'code-developer': 'code-developer',
|
|
353
|
+
'test-fix-agent': 'test-fix-agent',
|
|
354
|
+
'general-purpose': 'general-purpose',
|
|
355
|
+
'Explore': 'Explore'
|
|
356
|
+
};
|
|
357
|
+
return mapping[agentType] || 'general-purpose';
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Step 3.4: Write Phase Files
|
|
362
|
+
|
|
363
|
+
```javascript
|
|
364
|
+
function writePhaseFiles(config) {
|
|
365
|
+
const skillDir = `.claude/skills/${config.skillName}`;
|
|
366
|
+
|
|
367
|
+
for (const phase of config.phases) {
|
|
368
|
+
const filename = `${String(phase.number).padStart(2, '0')}-${phase.slug}.md`;
|
|
369
|
+
const filepath = `${skillDir}/phases/${filename}`;
|
|
370
|
+
|
|
371
|
+
const strategy = selectGenerationStrategy(phase, config);
|
|
372
|
+
let content;
|
|
373
|
+
|
|
374
|
+
switch (strategy) {
|
|
375
|
+
case 'extract':
|
|
376
|
+
content = extractPhaseFromCommand(phase, config);
|
|
377
|
+
// Verify content preservation
|
|
378
|
+
const sourceContent = read_file(phase.sourcePath);
|
|
379
|
+
const verification = verifyContentPreservation(sourceContent, content);
|
|
380
|
+
if (!verification.passed) {
|
|
381
|
+
console.warn(`⚠️ Content preservation issues for Phase ${phase.number}:`);
|
|
382
|
+
verification.issues.forEach(issue => console.warn(` - ${issue}`));
|
|
383
|
+
// Re-extract with more aggressive preservation
|
|
384
|
+
content = extractPhaseFromCommand(phase, config, { aggressive: true });
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
|
|
388
|
+
case 'generate':
|
|
389
|
+
content = generatePhaseFromRequirements(phase, config);
|
|
390
|
+
break;
|
|
391
|
+
|
|
392
|
+
case 'restructure':
|
|
393
|
+
content = restructureExistingPhase(phase, config);
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
write_file(filepath, content);
|
|
398
|
+
console.log(`✓ Generated: ${filepath} (${content.split('\n').length} lines)`);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
## Step 3.5: Cross-Phase Consistency Check
|
|
404
|
+
|
|
405
|
+
After generating all phase files, verify cross-phase consistency:
|
|
406
|
+
|
|
407
|
+
```javascript
|
|
408
|
+
function checkCrossPhaseConsistency(config) {
|
|
409
|
+
const skillDir = `.claude/skills/${config.skillName}`;
|
|
410
|
+
const issues = [];
|
|
411
|
+
|
|
412
|
+
for (const phase of config.phases) {
|
|
413
|
+
const filename = `${String(phase.number).padStart(2, '0')}-${phase.slug}.md`;
|
|
414
|
+
const content = read_file(`${skillDir}/phases/${filename}`);
|
|
415
|
+
|
|
416
|
+
// Check: Next Phase links point to correct file
|
|
417
|
+
const nextPhaseMatch = content.match(/\[Phase (\d+): (.+?)\]\((.+?)\)/);
|
|
418
|
+
if (nextPhaseMatch) {
|
|
419
|
+
const nextNum = parseInt(nextPhaseMatch[1]);
|
|
420
|
+
const nextPhase = config.phases.find(p => p.number === nextNum);
|
|
421
|
+
if (!nextPhase) {
|
|
422
|
+
issues.push(`Phase ${phase.number}: Next Phase link points to non-existent Phase ${nextNum}`);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// Check: Output variables match config
|
|
427
|
+
for (const varName of phase.outputVariables) {
|
|
428
|
+
if (!content.includes(varName)) {
|
|
429
|
+
issues.push(`Phase ${phase.number}: Output variable '${varName}' not mentioned in content`);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
return issues;
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
## Size Comparison Reference
|
|
439
|
+
|
|
440
|
+
Expected phase file sizes relative to their source commands:
|
|
441
|
+
|
|
442
|
+
| Scenario | Phase File Size vs Source | Reason |
|
|
443
|
+
|----------|--------------------------|--------|
|
|
444
|
+
| Command extraction | ≥ 90% of source | Minor removals (H1 title, frontmatter) |
|
|
445
|
+
| New generation (with agents) | 50-200 lines | Agent prompt skeletons |
|
|
446
|
+
| New generation (direct) | 30-80 lines | Step skeletons |
|
|
447
|
+
| Restructure | ~100% of source | Content reorganization only |
|
|
448
|
+
|
|
449
|
+
**Red Flag**: If a phase file is significantly smaller than its source (< 70%), content was likely lost during extraction. Re-check with `verifyContentPreservation()`.
|
|
450
|
+
|
|
451
|
+
## Output
|
|
452
|
+
|
|
453
|
+
- **Files**: `.claude/skills/{skillName}/phases/0N-{slug}.md` for each phase
|
|
454
|
+
- **track_tasks**: Mark Phase 3 completed, Phase 4 in_progress
|
|
455
|
+
|
|
456
|
+
## Next Phase
|
|
457
|
+
|
|
458
|
+
Return to orchestrator, then auto-continue to [Phase 4: Validation & Integration](04-validation.md).
|