maestro-flow 0.4.9 → 0.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/.agy/agents/cli-explore-agent.md +186 -0
  2. package/.agy/agents/conceptual-planning-agent.md +244 -0
  3. package/.agy/agents/impeccable-agent.md +97 -0
  4. package/.agy/agents/team-supervisor.md +142 -0
  5. package/.agy/agents/team-worker.md +236 -0
  6. package/.agy/agents/ui-design-agent.md +286 -0
  7. package/.agy/agents/workflow-analyzer.md +114 -0
  8. package/.agy/agents/workflow-codebase-mapper.md +76 -0
  9. package/.agy/agents/workflow-collab-planner.md +142 -0
  10. package/.agy/agents/workflow-debugger.md +102 -0
  11. package/.agy/agents/workflow-executor.md +131 -0
  12. package/.agy/agents/workflow-external-researcher.md +86 -0
  13. package/.agy/agents/workflow-integration-checker.md +82 -0
  14. package/.agy/agents/workflow-nyquist-auditor.md +84 -0
  15. package/.agy/agents/workflow-phase-researcher.md +84 -0
  16. package/.agy/agents/workflow-plan-checker.md +89 -0
  17. package/.agy/agents/workflow-planner.md +194 -0
  18. package/.agy/agents/workflow-project-researcher.md +73 -0
  19. package/.agy/agents/workflow-research-synthesizer.md +70 -0
  20. package/.agy/agents/workflow-reviewer.md +81 -0
  21. package/.agy/agents/workflow-roadmapper.md +81 -0
  22. package/.agy/agents/workflow-verifier.md +119 -0
  23. package/.agy/skills/codify-to-knowhow/SKILL.md +172 -0
  24. package/.agy/skills/codify-to-knowhow/phases/01-load-manifest.md +101 -0
  25. package/.agy/skills/codify-to-knowhow/phases/02-generate-knowhow.md +97 -0
  26. package/.agy/skills/codify-to-knowhow/phases/03-generate-specs.md +92 -0
  27. package/.agy/skills/codify-to-knowhow/phases/04-index-verify.md +119 -0
  28. package/.agy/skills/learn-decompose/SKILL.md +118 -0
  29. package/.agy/skills/learn-follow/SKILL.md +129 -0
  30. package/.agy/skills/learn-investigate/SKILL.md +154 -0
  31. package/.agy/skills/learn-retro/SKILL.md +159 -0
  32. package/.agy/skills/learn-second-opinion/SKILL.md +124 -0
  33. package/.agy/skills/maestro/SKILL.md +221 -0
  34. package/.agy/skills/maestro-amend/SKILL.md +162 -0
  35. package/.agy/skills/maestro-analyze/SKILL.md +135 -0
  36. package/.agy/skills/maestro-brainstorm/SKILL.md +118 -0
  37. package/.agy/skills/maestro-collab/SKILL.md +174 -0
  38. package/.agy/skills/maestro-composer/SKILL.md +180 -0
  39. package/.agy/skills/maestro-execute/SKILL.md +133 -0
  40. package/.agy/skills/maestro-fork/SKILL.md +88 -0
  41. package/.agy/skills/maestro-guard/SKILL.md +101 -0
  42. package/.agy/skills/maestro-help/SKILL.md +267 -0
  43. package/.agy/skills/maestro-help/index/catalog.json +184 -0
  44. package/.agy/skills/maestro-help/phases/01-parse-intent.md +122 -0
  45. package/.agy/skills/maestro-help/phases/02-search-present.md +181 -0
  46. package/.agy/skills/maestro-help/phases/03-workflow-guide.md +186 -0
  47. package/.agy/skills/maestro-impeccable/SKILL.md +250 -0
  48. package/.agy/skills/maestro-init/SKILL.md +80 -0
  49. package/.agy/skills/maestro-learn/SKILL.md +142 -0
  50. package/.agy/skills/maestro-merge/SKILL.md +66 -0
  51. package/.agy/skills/maestro-milestone-audit/SKILL.md +70 -0
  52. package/.agy/skills/maestro-milestone-complete/SKILL.md +77 -0
  53. package/.agy/skills/maestro-milestone-release/SKILL.md +98 -0
  54. package/.agy/skills/maestro-overlay/SKILL.md +177 -0
  55. package/.agy/skills/maestro-plan/SKILL.md +172 -0
  56. package/.agy/skills/maestro-player/SKILL.md +176 -0
  57. package/.agy/skills/maestro-quick/SKILL.md +67 -0
  58. package/.agy/skills/maestro-ralph/SKILL.md +546 -0
  59. package/.agy/skills/maestro-ralph-execute/SKILL.md +255 -0
  60. package/.agy/skills/maestro-roadmap/SKILL.md +170 -0
  61. package/.agy/skills/maestro-tools-execute/SKILL.md +119 -0
  62. package/.agy/skills/maestro-tools-register/SKILL.md +159 -0
  63. package/.agy/skills/maestro-ui-codify/SKILL.md +81 -0
  64. package/.agy/skills/maestro-update/SKILL.md +175 -0
  65. package/.agy/skills/maestro-verify/SKILL.md +111 -0
  66. package/.agy/skills/manage-codebase-rebuild/SKILL.md +77 -0
  67. package/.agy/skills/manage-codebase-refresh/SKILL.md +59 -0
  68. package/.agy/skills/manage-harvest/SKILL.md +96 -0
  69. package/.agy/skills/manage-issue/SKILL.md +72 -0
  70. package/.agy/skills/manage-issue-discover/SKILL.md +83 -0
  71. package/.agy/skills/manage-knowhow/SKILL.md +76 -0
  72. package/.agy/skills/manage-knowhow-capture/SKILL.md +78 -0
  73. package/.agy/skills/manage-learn/SKILL.md +64 -0
  74. package/.agy/skills/manage-status/SKILL.md +51 -0
  75. package/.agy/skills/manage-wiki/SKILL.md +61 -0
  76. package/.agy/skills/quality-auto-test/SKILL.md +135 -0
  77. package/.agy/skills/quality-debug/SKILL.md +122 -0
  78. package/.agy/skills/quality-refactor/SKILL.md +69 -0
  79. package/.agy/skills/quality-retrospective/SKILL.md +79 -0
  80. package/.agy/skills/quality-review/SKILL.md +130 -0
  81. package/.agy/skills/quality-sync/SKILL.md +53 -0
  82. package/.agy/skills/quality-test/SKILL.md +119 -0
  83. package/.agy/skills/security-audit/SKILL.md +157 -0
  84. package/.agy/skills/skill-iter-tune/SKILL.md +381 -0
  85. package/.agy/skills/skill-iter-tune/phases/01-setup.md +144 -0
  86. package/.agy/skills/skill-iter-tune/phases/02-execute.md +292 -0
  87. package/.agy/skills/skill-iter-tune/phases/03-evaluate.md +312 -0
  88. package/.agy/skills/skill-iter-tune/phases/04-improve.md +198 -0
  89. package/.agy/skills/skill-iter-tune/phases/05-report.md +166 -0
  90. package/.agy/skills/skill-iter-tune/specs/evaluation-criteria.md +63 -0
  91. package/.agy/skills/skill-iter-tune/templates/eval-prompt.md +134 -0
  92. package/.agy/skills/skill-iter-tune/templates/execute-prompt.md +97 -0
  93. package/.agy/skills/spec-add/SKILL.md +67 -0
  94. package/.agy/skills/spec-load/SKILL.md +70 -0
  95. package/.agy/skills/spec-remove/SKILL.md +50 -0
  96. package/.agy/skills/spec-setup/SKILL.md +47 -0
  97. package/.agy/skills/team-coordinate/SKILL.md +267 -0
  98. package/.agy/skills/team-coordinate/roles/coordinator/commands/analyze-task.md +247 -0
  99. package/.agy/skills/team-coordinate/roles/coordinator/commands/dispatch.md +131 -0
  100. package/.agy/skills/team-coordinate/roles/coordinator/commands/monitor.md +348 -0
  101. package/.agy/skills/team-coordinate/roles/coordinator/role.md +362 -0
  102. package/.agy/skills/team-coordinate/specs/knowledge-transfer.md +111 -0
  103. package/.agy/skills/team-coordinate/specs/pipelines.md +97 -0
  104. package/.agy/skills/team-coordinate/specs/quality-gates.md +112 -0
  105. package/.agy/skills/team-coordinate/specs/role-spec-template.md +198 -0
  106. package/.agy/skills/team-executor/SKILL.md +180 -0
  107. package/.agy/skills/team-executor/roles/executor/commands/monitor.md +235 -0
  108. package/.agy/skills/team-executor/roles/executor/role.md +171 -0
  109. package/.agy/skills/team-executor/specs/session-schema.md +264 -0
  110. package/.agy/skills/team-lifecycle-v4/SKILL.md +189 -0
  111. package/.agy/skills/team-lifecycle-v4/roles/analyst/role.md +92 -0
  112. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/analyze.md +56 -0
  113. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/dispatch.md +56 -0
  114. package/.agy/skills/team-lifecycle-v4/roles/coordinator/commands/monitor.md +206 -0
  115. package/.agy/skills/team-lifecycle-v4/roles/coordinator/role.md +130 -0
  116. package/.agy/skills/team-lifecycle-v4/roles/executor/commands/fix.md +35 -0
  117. package/.agy/skills/team-lifecycle-v4/roles/executor/commands/implement.md +62 -0
  118. package/.agy/skills/team-lifecycle-v4/roles/executor/role.md +64 -0
  119. package/.agy/skills/team-lifecycle-v4/roles/planner/role.md +82 -0
  120. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-code.md +34 -0
  121. package/.agy/skills/team-lifecycle-v4/roles/reviewer/commands/review-spec.md +44 -0
  122. package/.agy/skills/team-lifecycle-v4/roles/reviewer/role.md +65 -0
  123. package/.agy/skills/team-lifecycle-v4/roles/supervisor/role.md +188 -0
  124. package/.agy/skills/team-lifecycle-v4/roles/tester/role.md +84 -0
  125. package/.agy/skills/team-lifecycle-v4/roles/writer/role.md +92 -0
  126. package/.agy/skills/team-lifecycle-v4/specs/knowledge-transfer.md +114 -0
  127. package/.agy/skills/team-lifecycle-v4/specs/pipelines.md +140 -0
  128. package/.agy/skills/team-lifecycle-v4/specs/quality-gates.md +130 -0
  129. package/.agy/skills/team-lifecycle-v4/templates/architecture.md +254 -0
  130. package/.agy/skills/team-lifecycle-v4/templates/epics.md +196 -0
  131. package/.agy/skills/team-lifecycle-v4/templates/product-brief.md +133 -0
  132. package/.agy/skills/team-lifecycle-v4/templates/requirements.md +224 -0
  133. package/.agy/skills/team-quality-assurance/SKILL.md +148 -0
  134. package/.agy/skills/team-quality-assurance/roles/analyst/role.md +85 -0
  135. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/analyze.md +72 -0
  136. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/dispatch.md +111 -0
  137. package/.agy/skills/team-quality-assurance/roles/coordinator/commands/monitor.md +235 -0
  138. package/.agy/skills/team-quality-assurance/roles/coordinator/role.md +143 -0
  139. package/.agy/skills/team-quality-assurance/roles/executor/role.md +62 -0
  140. package/.agy/skills/team-quality-assurance/roles/generator/role.md +65 -0
  141. package/.agy/skills/team-quality-assurance/roles/scout/role.md +72 -0
  142. package/.agy/skills/team-quality-assurance/roles/strategist/role.md +69 -0
  143. package/.agy/skills/team-quality-assurance/specs/pipelines.md +115 -0
  144. package/.agy/skills/team-quality-assurance/specs/team-config.json +131 -0
  145. package/.agy/skills/team-review/SKILL.md +149 -0
  146. package/.agy/skills/team-review/roles/coordinator/commands/analyze.md +71 -0
  147. package/.agy/skills/team-review/roles/coordinator/commands/dispatch.md +91 -0
  148. package/.agy/skills/team-review/roles/coordinator/commands/monitor.md +209 -0
  149. package/.agy/skills/team-review/roles/coordinator/role.md +132 -0
  150. package/.agy/skills/team-review/roles/fixer/role.md +74 -0
  151. package/.agy/skills/team-review/roles/reviewer/role.md +66 -0
  152. package/.agy/skills/team-review/roles/scanner/role.md +77 -0
  153. package/.agy/skills/team-review/specs/dimensions.md +82 -0
  154. package/.agy/skills/team-review/specs/finding-schema.json +82 -0
  155. package/.agy/skills/team-review/specs/pipelines.md +102 -0
  156. package/.agy/skills/team-review/specs/team-config.json +27 -0
  157. package/.agy/skills/team-tech-debt/SKILL.md +133 -0
  158. package/.agy/skills/team-tech-debt/roles/assessor/role.md +76 -0
  159. package/.agy/skills/team-tech-debt/roles/coordinator/commands/analyze.md +47 -0
  160. package/.agy/skills/team-tech-debt/roles/coordinator/commands/dispatch.md +156 -0
  161. package/.agy/skills/team-tech-debt/roles/coordinator/commands/monitor.md +198 -0
  162. package/.agy/skills/team-tech-debt/roles/coordinator/role.md +123 -0
  163. package/.agy/skills/team-tech-debt/roles/executor/role.md +76 -0
  164. package/.agy/skills/team-tech-debt/roles/planner/role.md +68 -0
  165. package/.agy/skills/team-tech-debt/roles/scanner/role.md +90 -0
  166. package/.agy/skills/team-tech-debt/roles/validator/role.md +78 -0
  167. package/.agy/skills/team-tech-debt/specs/pipelines.md +47 -0
  168. package/.agy/skills/team-tech-debt/specs/team-config.json +129 -0
  169. package/.agy/skills/team-testing/SKILL.md +144 -0
  170. package/.agy/skills/team-testing/roles/analyst/role.md +101 -0
  171. package/.agy/skills/team-testing/roles/coordinator/commands/analyze.md +70 -0
  172. package/.agy/skills/team-testing/roles/coordinator/commands/dispatch.md +108 -0
  173. package/.agy/skills/team-testing/roles/coordinator/commands/monitor.md +242 -0
  174. package/.agy/skills/team-testing/roles/coordinator/role.md +134 -0
  175. package/.agy/skills/team-testing/roles/executor/role.md +95 -0
  176. package/.agy/skills/team-testing/roles/generator/role.md +95 -0
  177. package/.agy/skills/team-testing/roles/strategist/role.md +81 -0
  178. package/.agy/skills/team-testing/specs/pipelines.md +101 -0
  179. package/.agy/skills/team-testing/specs/team-config.json +93 -0
  180. package/.agy/skills/wiki-connect/SKILL.md +64 -0
  181. package/.agy/skills/wiki-digest/SKILL.md +70 -0
  182. package/.agy/skills/workflow-skill-designer/SKILL.md +506 -0
  183. package/.agy/skills/workflow-skill-designer/phases/01-requirements-analysis.md +356 -0
  184. package/.agy/skills/workflow-skill-designer/phases/02-orchestrator-design.md +444 -0
  185. package/.agy/skills/workflow-skill-designer/phases/03-phase-design.md +458 -0
  186. package/.agy/skills/workflow-skill-designer/phases/04-validation.md +471 -0
  187. package/package.json +3 -1
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: workflow-roadmapper
3
+ description: Creates project roadmap with phased milestones from research and requirements
4
+ allowed-tools:
5
+ - run_command
6
+ - view_file
7
+ - write_to_file
8
+ ---
9
+
10
+ # Roadmapper
11
+
12
+ ## Role
13
+ You create a phased project roadmap from research findings and requirements. You define phases with clear goals, success criteria, dependencies, and effort estimates. You may ask the user for clarification on priorities and scope trade-offs.
14
+
15
+ ## Process
16
+
17
+ 1. **Gather context** -- Read research summary, project description, and any existing requirements
18
+ 2. **Define phases** -- Break the project into sequential phases, each with a clear milestone
19
+ 3. **Number phases** -- Assign each phase a directory-safe identifier in the format `{NN}-{slug}` (e.g., `01-auth`, `02-api`, `03-ui-components`)
20
+ 4. **Set success criteria** -- Define measurable done-when conditions for each phase
21
+ 5. **Map dependencies** -- Identify cross-phase dependencies and prerequisites
22
+ 6. **Estimate effort** -- Provide relative sizing (S/M/L/XL) for each phase
23
+ 7. **Seek confirmation** -- Ask user to validate priorities and scope decisions
24
+ 8. **Write roadmap** -- Produce the roadmap document
25
+
26
+ ## Input
27
+ - `.workflow/research/SUMMARY.md` (synthesized research)
28
+ - `.workflow/codebase/` documents (if available)
29
+ - Project description and goals
30
+ - User priorities and constraints
31
+
32
+ ## Output
33
+ `.workflow/roadmap.md` with the following structure:
34
+ ```
35
+ # Roadmap
36
+
37
+ ## Vision
38
+ <1-2 sentence project vision>
39
+
40
+ ## Phases
41
+
42
+ ### Phase 01-auth: Authentication (Size: M)
43
+ - **Goal**: <what this phase achieves>
44
+ - **Success Criteria**: <measurable conditions>
45
+ - **Key Deliverables**: <artifacts produced>
46
+ - **Dependencies**: <prerequisites>
47
+ - **Risks**: <phase-specific risks>
48
+
49
+ ### Phase 02-api: API Layer (Size: L)
50
+ ...
51
+
52
+ ## Phase Dependencies
53
+ <Dependency graph or ordered list>
54
+
55
+ ## Scope Decisions
56
+ - In scope: <included items>
57
+ - Deferred: <items for later phases>
58
+ - Out of scope: <excluded items>
59
+ ```
60
+
61
+ Phase identifiers use lowercase kebab-case slug names (e.g., `auth`, `api-layer`, `ui-components`).
62
+
63
+ These identifiers become scratch directory names under `.workflow/scratch/{slug}/` (resolved via state.json artifact registry).
64
+
65
+ ## Schema Reference
66
+ `@templates/roadmap.md` -- roadmap template
67
+
68
+ ## Output Location
69
+ `.workflow/roadmap.md`
70
+
71
+ ## Error Behavior
72
+ - If research summary (`.workflow/research/SUMMARY.md`) is not available, ask the user for priorities directly
73
+ - If codebase documents are unavailable, proceed with user-provided context only
74
+ - If user does not respond to confirmation prompt, document assumptions and proceed
75
+
76
+ ## Constraints
77
+ - Each phase must be independently valuable (deliverable milestone)
78
+ - Success criteria must be specific and verifiable, not vague
79
+ - Phases should be ordered by dependency and risk (tackle high-risk early)
80
+ - **Minimum-phase principle**: Default 1 phase, max 2, exceptional 3 with justification. Phase = synchronization barrier (plan→execute→verify cycle). Wave DAG inside each phase handles task ordering. Only split when hard dependency exists: (1) runtime dependency that cannot be mocked, (2) not parallelizable via contract/interface, (3) full barrier — all of Phase A must complete before any of Phase B starts.
81
+ - Do not define implementation tasks; that is the planner's job
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: workflow-verifier
3
+ description: Goal-backward verification across three layers (existence, substance, connection)
4
+ allowed-tools:
5
+ - grep_search
6
+ - run_command
7
+ - view_file
8
+ ---
9
+
10
+ # Workflow Verifier
11
+
12
+ ## Role
13
+ You perform goal-backward verification of completed work using a three-layer checking approach. You verify that artifacts exist, contain real substance, and are properly connected to the rest of the system. You also validate each task's convergence criteria individually. You are read-only and never modify project files.
14
+
15
+ ## Search Tools
16
+ @~/.maestro/templates/search-tools.md — Follow search tool priority and selection patterns.
17
+
18
+ ## Process
19
+
20
+ 1. **Load goals** -- Read the phase/task goals, success criteria, must_haves, and `convergence.criteria` from each task JSON
21
+ 2. **Layer 1 - Existence** -- Verify all expected artifacts exist:
22
+ - Files created as specified in task `files[].path` where `files[].action` is "create"
23
+ - Functions/classes/modules present at `files[].target`
24
+ - Configuration entries added
25
+ 3. **Layer 2 - Substance** -- Verify artifacts are non-trivial:
26
+ - Files contain meaningful implementation (not stubs or TODOs)
27
+ - Functions have real logic (not empty bodies or pass-through)
28
+ - Tests actually test behavior (not empty test cases)
29
+ 4. **Layer 3 - Connection** -- Verify artifacts are properly wired:
30
+ - Imports resolve correctly
31
+ - New modules are registered/exported
32
+ - Routes are mounted, handlers are connected
33
+ - Configuration is loaded and used
34
+ 5. **Per-task convergence validation** -- For each completed task, verify every item in `convergence.criteria`:
35
+ - Run `convergence.verification` command if defined
36
+ - Check each criterion individually (pass/fail with evidence)
37
+ - Cross-reference with task summaries in `.summaries/`
38
+ 6. **Check must_haves** -- Verify each must_have category:
39
+ - `truths`: Invariants that must hold
40
+ - `artifacts`: Files/outputs that must exist
41
+ - `key_links`: Connections that must be wired
42
+ 7. **Write report** -- Output verification.json with results
43
+
44
+ ## Input
45
+ - Phase or task goals with must_haves definition
46
+ - `.task/TASK-{NNN}.json` files with `convergence.criteria` to validate
47
+ - Completed code/artifacts to verify
48
+ - Task summaries from `.summaries/`
49
+ - **Project specs** — `maestro spec load --category quality`: verification criteria, acceptance standards. Must verify code complies with loaded constraints.
50
+ - **Codebase docs** (if `.workflow/codebase/` exists) — Read `ARCHITECTURE.md` for expected module wiring and `FEATURES.md` for component mapping; use in Layer 3 (Connection) checks
51
+ - **Wiki constraints** (if `maestro wiki` available) — `maestro wiki search "architecture constraint"` for documented invariants to include as additional truth checks
52
+
53
+ ## Output
54
+ `verification.json`:
55
+ ```json
56
+ {
57
+ "phase": "<phase-id>",
58
+ "status": "pass|fail",
59
+ "layers": {
60
+ "existence": {"pass": true, "checks": [...]},
61
+ "substance": {"pass": true, "checks": [...]},
62
+ "connection": {"pass": false, "checks": [...]}
63
+ },
64
+ "convergence_check": {
65
+ "TASK-001": {
66
+ "status": "pass",
67
+ "criteria": [
68
+ {"criterion": "File src/tools/new-tool.ts exports NewTool class", "pass": true, "evidence": "grep confirms export at line 15"},
69
+ {"criterion": "npm run build completes without errors", "pass": true, "evidence": "build exit code 0"}
70
+ ]
71
+ },
72
+ "TASK-002": {
73
+ "status": "fail",
74
+ "criteria": [
75
+ {"criterion": "GET /api/health returns 200", "pass": true, "evidence": "curl test passed"},
76
+ {"criterion": "Response includes version field", "pass": false, "evidence": "Response body missing 'version' key"}
77
+ ]
78
+ }
79
+ },
80
+ "must_haves": {
81
+ "truths": [{"claim": "...", "verified": true}],
82
+ "artifacts": [{"path": "...", "exists": true, "substantial": true}],
83
+ "key_links": [{"from": "...", "to": "...", "connected": false}]
84
+ },
85
+ "gaps": [
86
+ {"layer": "connection", "description": "Router not mounted in app.ts", "severity": "high", "task": "TASK-002"}
87
+ ]
88
+ }
89
+ ```
90
+
91
+ ## Constraints
92
+ - Read-only; never modify project files
93
+ - Every check must have evidence (file:line reference or command output)
94
+ - Layer 2 checks must go beyond file existence (actually read content)
95
+ - Layer 3 checks must trace import/require chains
96
+ - Verify each `convergence.criteria` item from task JSON individually
97
+ - Report gaps with severity (high/medium/low), specific location, and originating task ID
98
+ - Do not suggest fixes; only identify gaps
99
+
100
+ ## Schema Reference
101
+ - **Task schema**: `templates/task.json` -- Used to locate `convergence.criteria` and `files` for verification
102
+ - Key fields consumed during verification:
103
+ - `convergence.criteria` -- Array of testable conditions to check per task (replaces deprecated `done_when`)
104
+ - `convergence.verification` -- Command or steps to run for automated checking
105
+ - `files[].{path, action, target}` -- Expected file operations to verify
106
+ - `status` -- Top-level task status (only verify tasks with status "completed")
107
+ - **Verification template**: `templates/verification.json` -- Output format reference
108
+
109
+ ## Output Location
110
+ - **Scratch verification**: `.workflow/scratch/{slug}/verification.json`
111
+ - **Per-task verification**: Embedded in the `convergence_check` block within verification.json (not separate files)
112
+
113
+ ## Error Behavior
114
+ - **Task JSON missing or malformed**: Skip task, log as gap with severity "high" and description "Task definition missing or unreadable"
115
+ - **convergence.verification command fails**: Log command error output as evidence, mark criterion as "fail"
116
+ - **Cannot determine pass/fail for a criterion**: Mark as "inconclusive" with explanation; count as fail for overall status
117
+ - **Build/test environment unavailable**: Log as gap with severity "medium", skip automated checks, perform static checks only
118
+ - **All tasks pass all layers**: Set status to "pass" and report clean verification
119
+ - **Any gap found**: Set status to "fail" regardless of gap severity; list all gaps for resolution
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: codify-to-knowhow
3
+ description: Manifest-driven knowledge asset generator — converts any structured package into maestro knowhow + spec entries with ref linking. Triggers on "codify-to-knowhow", "style to knowhow", "知识固化".
4
+ allowed-tools:
5
+ - grep_search
6
+ - replace_file_content
7
+ - run_command
8
+ - view_file
9
+ - write_to_file
10
+ auto-continue: true
11
+ ---
12
+
13
+ # Codify to Knowhow
14
+
15
+ 通用 manifest 驱动的知识资产生成器。读取 `knowhow-manifest.json`,按声明创建 knowhow 文件和 spec 条目,通过 ref 建立索引-详文桥梁。
16
+
17
+ **适用场景**: 任何工作流产出需要固化为知识资产时使用。上游 skill(如 `maestro-ui-codify`)负责生成 manifest,本 skill 负责执行知识写入。
18
+
19
+ ## Architecture Overview
20
+
21
+ ```
22
+ ┌─────────────────────────────────────────────────────────────┐
23
+ │ Codify to Knowhow (SKILL.md) — Manifest-Driven │
24
+ │ → Read manifest → Create knowhow → Create specs → Verify │
25
+ └──────────────────────────┬──────────────────────────────────┘
26
+
27
+ ┌──────────┬───────────┼───────────┬──────────┐
28
+ ↓ ↓ ↓ ↓ │
29
+ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ │
30
+ │Phase 1 │ │Phase 2 │ │Phase 3 │ │Phase 4 │ │
31
+ │ Load │ │Generate│ │Generate│ │ Index │ │
32
+ │Manifest│ │Knowhow │ │ Specs │ │ Verify │ │
33
+ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘ │
34
+ │ │ │ │ │
35
+ manifest AST-/DCS- spec-entry verified │
36
+ parsed files + ref assets │
37
+ ```
38
+
39
+ ## Key Design Principles
40
+
41
+ 1. **Manifest 驱动**: 所有行为由 `knowhow-manifest.json` 声明,不含硬编码领域知识
42
+ 2. **幂等执行**: 每个写入前按 slug 检查已存在资产,存在则跳过
43
+ 3. **ref 桥梁**: spec-entry 通过 `ref` 引用 knowhow 详文
44
+ 4. **闭合标签**: 所有条目使用 `<spec-entry>`/`<knowhow-entry>` 闭合标签
45
+ 5. **上游生成 manifest**: 本 skill 不做知识提取,只做知识写入
46
+
47
+ ## Manifest Format
48
+
49
+ `knowhow-manifest.json` 由上游 skill 生成,放在 package 目录中:
50
+
51
+ ```json
52
+ {
53
+ "slug": "my-style-v1",
54
+ "domain": "ui-design",
55
+ "roles": ["implement", "review"],
56
+ "packagePath": ".workflow/reference_style/my-style-v1",
57
+
58
+ "knowhow": [
59
+ {
60
+ "prefix": "AST",
61
+ "fileSlug": "tokens",
62
+ "title": "Design Tokens",
63
+ "category": "asset",
64
+ "assetType": "design-tokens",
65
+ "codePaths": ["src/styles/"],
66
+ "tags": ["design-tokens", "colors"],
67
+ "entries": [
68
+ {
69
+ "category": "pattern",
70
+ "keywords": "colors,tokens",
71
+ "title": "Color System",
72
+ "body": "## Colors\n\n..."
73
+ }
74
+ ]
75
+ }
76
+ ],
77
+
78
+ "specs": [
79
+ {
80
+ "category": "coding",
81
+ "keywords": "colors,design-tokens",
82
+ "title": "颜色编码约定",
83
+ "ref": "knowhow/AST-my-style-v1-tokens.md",
84
+ "body": "主色使用 var(--color-primary)..."
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ ## Execution Flow
91
+
92
+ ```
93
+ Input: <package-path> (must contain knowhow-manifest.json)
94
+
95
+ Phase 1: Load and Validate Manifest
96
+ └─ Ref: phases/01-load-manifest.md
97
+ ├─ Validate package path and manifest existence
98
+ ├─ Parse knowhow-manifest.json
99
+ └─ Output: manifest object
100
+
101
+ Phase 2: Generate Knowhow Assets
102
+ └─ Ref: phases/02-generate-knowhow.md
103
+ ├─ Idempotency check per file
104
+ ├─ Write knowhow files per manifest.knowhow[]
105
+ └─ Output: knowhowPaths[]
106
+
107
+ Phase 3: Generate Spec Entries
108
+ └─ Ref: phases/03-generate-specs.md
109
+ ├─ Idempotency check per entry
110
+ ├─ Write spec entries per manifest.specs[]
111
+ └─ Output: specEntryCount
112
+
113
+ Phase 4: Index and Verify
114
+ └─ Ref: phases/04-index-verify.md
115
+ └─ Output: verification report
116
+ ```
117
+
118
+ **Phase Reference Documents**:
119
+
120
+ | Phase | Document | Purpose |
121
+ |-------|----------|---------|
122
+ | 1 | [phases/01-load-manifest.md](phases/01-load-manifest.md) | Load and validate manifest |
123
+ | 2 | [phases/02-generate-knowhow.md](phases/02-generate-knowhow.md) | Create knowhow files |
124
+ | 3 | [phases/03-generate-specs.md](phases/03-generate-specs.md) | Create spec entries with ref |
125
+ | 4 | [phases/04-index-verify.md](phases/04-index-verify.md) | Verify assets and index |
126
+
127
+ ## Core Rules
128
+
129
+ 1. **Manifest 必需**: 无 manifest 则报错退出
130
+ 2. **幂等写入**: 同 slug 文件存在则跳过
131
+ 3. **闭合标签**: 所有 entry 使用闭合标签格式
132
+ 4. **Auto-Continue**: Phase 完成后自动执行下一 Phase
133
+ 5. **不提取知识**: 本 skill 只写入,知识提取由上游完成
134
+
135
+ ## Data Flow
136
+
137
+ ```
138
+ Input (packagePath)
139
+
140
+ Phase 1 → manifest: { slug, knowhow[], specs[] }
141
+
142
+ Phase 2 → knowhowPaths: string[], knowhowIds: string[]
143
+
144
+ Phase 3 → specEntryCount: number
145
+
146
+ Phase 4 → verificationResult
147
+
148
+ Completion report
149
+ ```
150
+
151
+ ## TodoWrite Pattern
152
+
153
+ ```json
154
+ [
155
+ {"content": "Phase 1: 加载 Manifest", "status": "in_progress"},
156
+ {"content": "Phase 2: 生成 Knowhow 资产", "status": "pending"},
157
+ {"content": "Phase 3: 生成 Spec 条目", "status": "pending"},
158
+ {"content": "Phase 4: 索引验证", "status": "pending"}
159
+ ]
160
+ ```
161
+
162
+ ## Error Handling
163
+
164
+ - **Manifest 不存在**: 报告错误,提示上游 skill 需先生成 manifest
165
+ - **Manifest 格式错误**: 报告缺失字段
166
+ - **幂等冲突**: 跳过已存在资产,报告跳过数量
167
+ - **CLI 失败**: 回退到 Write tool 直接写文件
168
+
169
+ ## Related Commands
170
+
171
+ **上游**: `maestro-ui-codify`, `learn-decompose`, 或任何生成 manifest 的 skill
172
+ **后续**: `maestro wiki list --category coding`, `maestro spec load --keyword <slug>`
@@ -0,0 +1,101 @@
1
+ # Phase 1: Load and Validate Manifest
2
+
3
+ 读取和验证 `knowhow-manifest.json`。
4
+
5
+ ## Objective
6
+
7
+ - 验证 package path 存在
8
+ - 验证 `knowhow-manifest.json` 存在并可解析
9
+ - 提取 manifest 结构供后续 phase 使用
10
+
11
+ ## Execution
12
+
13
+ ### Step 1.1: Validate Package Path
14
+
15
+ ```bash
16
+ package_path="${PACKAGE_PATH}"
17
+
18
+ # 验证目录存在
19
+ test -d "$package_path" || { echo "ERROR: Package path not found: $package_path"; exit 1; }
20
+
21
+ # 验证 manifest 存在
22
+ manifest_file="${package_path}/knowhow-manifest.json"
23
+ test -f "$manifest_file" || { echo "ERROR: knowhow-manifest.json not found in $package_path"; exit 1; }
24
+
25
+ echo "Package: $package_path"
26
+ echo "Manifest: $manifest_file"
27
+ ```
28
+
29
+ ### Step 1.2: Read and Parse Manifest
30
+
31
+ ```javascript
32
+ view_file("${package_path}/knowhow-manifest.json")
33
+ ```
34
+
35
+ **必需字段验证**:
36
+
37
+ | 字段 | 必需 | 说明 |
38
+ |------|------|------|
39
+ | `slug` | 是 | 包名 slug,用于文件命名 |
40
+ | `roles` | 是 | 角色标注数组 |
41
+ | `knowhow` | 是 | knowhow 资产声明数组(可为空) |
42
+ | `specs` | 是 | spec 条目声明数组(可为空) |
43
+ | `domain` | 否 | 领域标识(如 ui-design, api, data) |
44
+ | `packagePath` | 否 | 原始包路径(元数据) |
45
+
46
+ **knowhow[] 每项必需字段**:
47
+
48
+ | 字段 | 说明 |
49
+ |------|------|
50
+ | `prefix` | 文件前缀: AST, DCS, BLP, TIP, RCP, REF 等 |
51
+ | `fileSlug` | 文件名后缀(如 "tokens" → AST-{slug}-tokens.md) |
52
+ | `title` | 文档标题 |
53
+ | `category` | knowhow 类别: asset, decision, blueprint, tip, recipe, reference |
54
+ | `tags` | 标签数组 |
55
+ | `body` | Markdown 正文内容 |
56
+
57
+ **可选字段**: `assetType`, `codePaths`, `entries[]`(`<knowhow-entry>` 子条目)
58
+
59
+ **specs[] 每项必需字段**:
60
+
61
+ | 字段 | 说明 |
62
+ |------|------|
63
+ | `category` | spec 类别: coding, arch, quality, debug, test, review, learning |
64
+ | `title` | 条目标题 |
65
+ | `keywords` | 关键词(逗号分隔字符串) |
66
+ | `body` | 条目正文 |
67
+
68
+ **可选字段**: `ref`(引用 knowhow 文件路径)
69
+
70
+ ### Step 1.3: Validate and Summarize
71
+
72
+ ```javascript
73
+ const manifest = JSON.parse(manifestContent);
74
+
75
+ // 必需字段检查
76
+ const required = ['slug', 'roles', 'knowhow', 'specs'];
77
+ const missing = required.filter(f => !manifest[f]);
78
+ if (missing.length > 0) {
79
+ REPORT("ERROR: Missing required fields: " + missing.join(', '));
80
+ EXIT(1);
81
+ }
82
+
83
+ // 摘要
84
+ REPORT(`Manifest loaded:
85
+ Slug: ${manifest.slug}
86
+ Domain: ${manifest.domain || 'generic'}
87
+ Roles: ${manifest.roles.join(', ')}
88
+ Knowhow assets: ${manifest.knowhow.length}
89
+ Spec entries: ${manifest.specs.length}
90
+ `);
91
+ ```
92
+
93
+ ## Output
94
+
95
+ - **Variable**: `manifest` — 解析后的 manifest 对象
96
+ - **Variable**: `slug` — `manifest.slug`
97
+ - **TodoWrite**: Mark Phase 1 completed, Phase 2 in_progress
98
+
99
+ ## Next Phase
100
+
101
+ Return to orchestrator, then auto-continue to [Phase 2: Generate Knowhow](02-generate-knowhow.md).
@@ -0,0 +1,97 @@
1
+ # Phase 2: Generate Knowhow Assets
2
+
3
+ 按 `manifest.knowhow[]` 声明创建 knowhow 文件。
4
+
5
+ ## Objective
6
+
7
+ - 遍历 `manifest.knowhow[]` 数组
8
+ - 每个条目生成对应的 knowhow 文件
9
+ - 幂等:同名文件存在则跳过
10
+
11
+ ## Execution
12
+
13
+ ### Step 2.1: Ensure Directory
14
+
15
+ ```bash
16
+ mkdir -p .workflow/knowhow
17
+ ```
18
+
19
+ ### Step 2.2: Iterate and Write
20
+
21
+ 对 `manifest.knowhow[]` 中的每一项执行:
22
+
23
+ ```javascript
24
+ for (const asset of manifest.knowhow) {
25
+ const filename = `${asset.prefix}-${manifest.slug}-${asset.fileSlug}.md`;
26
+ const filepath = `.workflow/knowhow/${filename}`;
27
+
28
+ // 幂等检查
29
+ if (fileExists(filepath)) {
30
+ REPORT(`SKIP: ${filename} (already exists)`);
31
+ continue;
32
+ }
33
+
34
+ // 构建 frontmatter
35
+ let frontmatter = `---
36
+ title: ${asset.title}
37
+ type: ${asset.category}`;
38
+
39
+ if (asset.assetType) {
40
+ frontmatter += `\nassetType: ${asset.assetType}`;
41
+ }
42
+
43
+ frontmatter += `\nroles: [${manifest.roles.join(', ')}]`;
44
+
45
+ if (asset.codePaths && asset.codePaths.length > 0) {
46
+ frontmatter += `\ncodePaths:`;
47
+ for (const cp of asset.codePaths) {
48
+ frontmatter += `\n - ${cp}`;
49
+ }
50
+ }
51
+
52
+ frontmatter += `\ntags: [${asset.tags.join(', ')}]`;
53
+ frontmatter += `\n---`;
54
+
55
+ // 构建 body
56
+ let body = asset.body || '';
57
+
58
+ // 如果有 entries[],生成 <knowhow-entry> 闭合标签
59
+ if (asset.entries && asset.entries.length > 0) {
60
+ const today = new Date().toISOString().split('T')[0];
61
+ for (let i = 0; i < asset.entries.length; i++) {
62
+ const entry = asset.entries[i];
63
+ const entryId = `${asset.prefix}-${manifest.slug}-${String(i + 1).padStart(3, '0')}`;
64
+ body += `\n\n<knowhow-entry keywords="${entry.category},${entry.keywords}" date="${today}" id="${entryId}" roles="${manifest.roles.join(',')}" source="codify-to-knowhow">
65
+
66
+ ### ${entry.title}
67
+
68
+ ${entry.body}
69
+
70
+ </knowhow-entry>`;
71
+ }
72
+ }
73
+
74
+ const content = `${frontmatter}\n\n${body}`;
75
+ write_to_file(filepath, content);
76
+ REPORT(`CREATED: ${filename}`);
77
+ knowhowPaths.push(filepath);
78
+ }
79
+ ```
80
+
81
+ ### Step 2.3: Collect Results
82
+
83
+ ```javascript
84
+ const knowhowPaths = []; // 已创建的文件路径
85
+ const skippedCount = manifest.knowhow.length - knowhowPaths.length;
86
+
87
+ REPORT(`Knowhow assets: ${knowhowPaths.length} created, ${skippedCount} skipped`);
88
+ ```
89
+
90
+ ## Output
91
+
92
+ - **Variable**: `knowhowPaths` — 已创建的文件路径列表
93
+ - **TodoWrite**: Mark Phase 2 completed, Phase 3 in_progress
94
+
95
+ ## Next Phase
96
+
97
+ Return to orchestrator, then auto-continue to [Phase 3: Generate Specs](03-generate-specs.md).
@@ -0,0 +1,92 @@
1
+ # Phase 3: Generate Spec Entries
2
+
3
+ 按 `manifest.specs[]` 声明写入 spec 条目。
4
+
5
+ ## Objective
6
+
7
+ - 遍历 `manifest.specs[]` 数组
8
+ - 每个条目追加到对应的 spec 文件
9
+ - 幂等:同 title 的条目已存在则跳过
10
+ - 使用 `<spec-entry>` 闭合标签格式
11
+
12
+ ## Execution
13
+
14
+ ### Step 3.1: Idempotency Check
15
+
16
+ 对每个 spec 条目,检查是否已存在同 title 的 entry:
17
+
18
+ ```bash
19
+ # 按 keyword 搜索
20
+ maestro spec load --keyword "${manifest.slug}" --json 2>/dev/null | head -5
21
+ ```
22
+
23
+ ### Step 3.2: Iterate and Write
24
+
25
+ 对 `manifest.specs[]` 中的每一项执行:
26
+
27
+ ```javascript
28
+ const today = new Date().toISOString().split('T')[0];
29
+ let specEntryCount = 0;
30
+
31
+ for (const spec of manifest.specs) {
32
+ // spec.category 决定目标文件
33
+ const categoryFileMap = {
34
+ coding: 'coding-conventions.md',
35
+ arch: 'architecture-constraints.md',
36
+ quality: 'quality-rules.md',
37
+ debug: 'debug-notes.md',
38
+ test: 'test-conventions.md',
39
+ review: 'review-standards.md',
40
+ learning: 'learnings.md'
41
+ };
42
+
43
+ const targetFile = `.workflow/specs/${categoryFileMap[spec.category]}`;
44
+
45
+ // 幂等检查:grep title 是否已存在
46
+ const titleExists = run_command(`grep -q "${spec.title}" "${targetFile}" 2>/dev/null && echo "exists" || echo "new"`);
47
+
48
+ if (titleExists.trim() === 'exists') {
49
+ REPORT(`SKIP spec: "${spec.title}" (already exists in ${spec.category})`);
50
+ continue;
51
+ }
52
+
53
+ // 构建 spec-entry 闭合标签
54
+ let refAttr = '';
55
+ if (spec.ref) {
56
+ refAttr = `\n ref="${spec.ref}"`;
57
+ }
58
+
59
+ const entryBlock = `
60
+
61
+ <spec-entry category="${spec.category}" keywords="${spec.keywords}" date="${today}"${refAttr}>
62
+
63
+ ### ${spec.title}
64
+
65
+ ${spec.body}
66
+
67
+ </spec-entry>`;
68
+
69
+ // 追加到目标文件
70
+ // 优先使用 maestro spec add CLI
71
+ const cliResult = run_command(`maestro spec add ${spec.category} "${spec.title}" "${spec.body}" --keywords "${spec.keywords}" 2>/dev/null`);
72
+
73
+ if (cliResult.exitCode !== 0) {
74
+ // 回退:直接追加到文件
75
+ replace_file_content(targetFile, { append: entryBlock });
76
+ }
77
+
78
+ specEntryCount++;
79
+ REPORT(`CREATED spec: "${spec.title}" → ${spec.category}`);
80
+ }
81
+
82
+ REPORT(`Spec entries: ${specEntryCount} created`);
83
+ ```
84
+
85
+ ## Output
86
+
87
+ - **Variable**: `specEntryCount` — 创建的 spec 条目数量
88
+ - **TodoWrite**: Mark Phase 3 completed, Phase 4 in_progress
89
+
90
+ ## Next Phase
91
+
92
+ Return to orchestrator, then auto-continue to [Phase 4: Index and Verify](04-index-verify.md).