maestro-flow 0.3.37 → 0.3.39
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/.claude/agents/workflow-analyzer.md +2 -0
- package/.claude/agents/workflow-debugger.md +2 -0
- package/.claude/agents/workflow-executor.md +2 -0
- package/.claude/agents/workflow-integration-checker.md +1 -0
- package/.claude/agents/workflow-nyquist-auditor.md +1 -0
- package/.claude/agents/workflow-planner.md +2 -0
- package/.claude/agents/workflow-reviewer.md +2 -0
- package/.claude/agents/workflow-verifier.md +2 -0
- package/.claude/commands/learn-decompose.md +176 -176
- package/.claude/commands/learn-follow.md +167 -167
- package/.claude/commands/learn-investigate.md +221 -221
- package/.claude/commands/learn-retro.md +303 -303
- package/.claude/commands/learn-second-opinion.md +167 -167
- package/.claude/commands/maestro-amend.md +300 -300
- package/.claude/commands/maestro-analyze.md +126 -126
- package/.claude/commands/maestro-brainstorm.md +100 -100
- package/.claude/commands/maestro-composer.md +354 -354
- package/.claude/commands/maestro-execute.md +120 -114
- package/.claude/commands/maestro-fork.md +86 -86
- package/.claude/commands/maestro-init.md +78 -78
- package/.claude/commands/maestro-learn.md +140 -140
- package/.claude/commands/maestro-link-coordinate.md +1 -1
- package/.claude/commands/maestro-merge.md +61 -61
- package/.claude/commands/maestro-milestone-release.md +96 -96
- package/.claude/commands/maestro-overlay.md +178 -178
- package/.claude/commands/maestro-plan.md +150 -138
- package/.claude/commands/maestro-player.md +404 -404
- package/.claude/commands/maestro-quick.md +56 -56
- package/.claude/commands/maestro-ralph-execute.md +7 -18
- package/.claude/commands/maestro-ralph.md +9 -3
- package/.claude/commands/maestro-roadmap.md +1 -1
- package/.claude/commands/maestro-ui-design.md +93 -93
- package/.claude/commands/maestro-update.md +176 -176
- package/.claude/commands/maestro-verify.md +96 -90
- package/.claude/commands/maestro.md +121 -121
- package/.claude/commands/manage-codebase-rebuild.md +75 -75
- package/.claude/commands/manage-codebase-refresh.md +57 -57
- package/.claude/commands/manage-harvest.md +94 -94
- package/.claude/commands/manage-issue-discover.md +77 -77
- package/.claude/commands/manage-issue.md +73 -73
- package/.claude/commands/manage-knowhow-capture.md +193 -193
- package/.claude/commands/manage-knowhow.md +77 -77
- package/.claude/commands/manage-learn.md +67 -67
- package/.claude/commands/manage-status.md +51 -51
- package/.claude/commands/manage-wiki.md +62 -62
- package/.claude/commands/quality-auto-test.md +1 -1
- package/.claude/commands/quality-debug.md +121 -115
- package/.claude/commands/quality-refactor.md +55 -55
- package/.claude/commands/quality-retrospective.md +78 -78
- package/.claude/commands/quality-review.md +114 -108
- package/.claude/commands/quality-sync.md +51 -51
- package/.claude/commands/quality-test.md +103 -103
- package/.claude/commands/spec-add.md +49 -49
- package/.claude/commands/spec-load.md +51 -51
- package/.claude/commands/spec-remove.md +51 -51
- package/.claude/commands/spec-setup.md +51 -51
- package/.claude/commands/wiki-connect.md +62 -62
- package/.claude/commands/wiki-digest.md +69 -69
- package/.codex/skills/learn-decompose/SKILL.md +113 -113
- package/.codex/skills/learn-follow/SKILL.md +1 -1
- package/.codex/skills/learn-investigate/SKILL.md +83 -83
- package/.codex/skills/learn-retro/SKILL.md +83 -83
- package/.codex/skills/learn-second-opinion/SKILL.md +86 -86
- package/.codex/skills/maestro/SKILL.md +304 -304
- package/.codex/skills/maestro-analyze/SKILL.md +9 -8
- package/.codex/skills/maestro-brainstorm/SKILL.md +442 -397
- package/.codex/skills/maestro-composer/SKILL.md +213 -213
- package/.codex/skills/maestro-execute/SKILL.md +346 -318
- package/.codex/skills/maestro-fork/SKILL.md +56 -2
- package/.codex/skills/maestro-init/SKILL.md +40 -16
- package/.codex/skills/maestro-learn/SKILL.md +80 -80
- package/.codex/skills/maestro-link-coordinate/SKILL.md +257 -257
- package/.codex/skills/maestro-merge/SKILL.md +1 -1
- package/.codex/skills/maestro-milestone-audit/SKILL.md +1 -1
- package/.codex/skills/maestro-milestone-complete/SKILL.md +40 -9
- package/.codex/skills/maestro-milestone-release/SKILL.md +70 -70
- package/.codex/skills/maestro-overlay/SKILL.md +1 -1
- package/.codex/skills/maestro-plan/SKILL.md +19 -4
- package/.codex/skills/maestro-player/SKILL.md +323 -323
- package/.codex/skills/maestro-quick/SKILL.md +1 -1
- package/.codex/skills/maestro-ralph/SKILL.md +681 -578
- package/.codex/skills/maestro-roadmap/SKILL.md +518 -468
- package/.codex/skills/maestro-ui-design/SKILL.md +109 -12
- package/.codex/skills/maestro-verify/SKILL.md +27 -9
- package/.codex/skills/manage-codebase-rebuild/SKILL.md +3 -2
- package/.codex/skills/manage-codebase-refresh/SKILL.md +1 -1
- package/.codex/skills/manage-harvest/SKILL.md +91 -91
- package/.codex/skills/manage-issue/SKILL.md +19 -6
- package/.codex/skills/manage-issue-discover/SKILL.md +1 -1
- package/.codex/skills/manage-knowhow/SKILL.md +95 -95
- package/.codex/skills/manage-knowhow-capture/SKILL.md +110 -110
- package/.codex/skills/manage-learn/SKILL.md +1 -1
- package/.codex/skills/manage-status/SKILL.md +1 -1
- package/.codex/skills/manage-wiki/SKILL.md +55 -55
- package/.codex/skills/quality-auto-test/SKILL.md +547 -547
- package/.codex/skills/quality-debug/SKILL.md +339 -334
- package/.codex/skills/quality-refactor/SKILL.md +1 -1
- package/.codex/skills/quality-retrospective/SKILL.md +292 -292
- package/.codex/skills/quality-review/SKILL.md +365 -364
- package/.codex/skills/quality-sync/SKILL.md +1 -1
- package/.codex/skills/quality-test/SKILL.md +498 -498
- package/.codex/skills/spec-add/SKILL.md +101 -101
- package/.codex/skills/spec-load/SKILL.md +77 -77
- package/.codex/skills/spec-map/SKILL.md +1 -1
- package/.codex/skills/spec-remove/SKILL.md +69 -69
- package/.codex/skills/spec-setup/SKILL.md +1 -1
- package/.codex/skills/team-coordinate/SKILL.md +2 -1
- package/.codex/skills/team-executor/SKILL.md +116 -115
- package/.codex/skills/team-lifecycle-v4/SKILL.md +2 -1
- package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +14 -6
- package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +16 -4
- package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +7 -1
- package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +16 -4
- package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +8 -2
- package/.codex/skills/team-quality-assurance/SKILL.md +2 -1
- package/.codex/skills/team-quality-assurance/roles/scout/role.md +9 -2
- package/.codex/skills/team-review/SKILL.md +2 -1
- package/.codex/skills/team-review/roles/reviewer/role.md +10 -1
- package/.codex/skills/team-review/roles/scanner/role.md +10 -1
- package/.codex/skills/team-tech-debt/SKILL.md +144 -143
- package/.codex/skills/team-tech-debt/roles/executor/role.md +9 -5
- package/.codex/skills/team-tech-debt/roles/scanner/role.md +10 -0
- package/.codex/skills/team-tech-debt/roles/validator/role.md +8 -2
- package/.codex/skills/team-testing/SKILL.md +2 -1
- package/.codex/skills/team-testing/roles/executor/role.md +8 -2
- package/.codex/skills/team-testing/roles/generator/role.md +8 -2
- package/.codex/skills/wiki-connect/SKILL.md +73 -73
- package/.codex/skills/wiki-digest/SKILL.md +87 -87
- package/README.md +6 -0
- package/README.zh-CN.md +6 -0
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js +4 -0
- package/dashboard/dist-server/dashboard/src/server/agents/claude-code-adapter.js.map +1 -1
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js +118 -7
- package/dashboard/dist-server/dashboard/src/server/agents/codex-cli-adapter.js.map +1 -1
- package/dashboard/dist-server/shared/agent-types.d.ts +2 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.d.ts +2 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js +4 -0
- package/dashboard/dist-server/src/agents/cli-agent-runner.js.map +1 -1
- package/dashboard/dist-server/src/commands/delegate.d.ts +2 -0
- package/dashboard/dist-server/src/commands/delegate.js +18 -0
- package/dashboard/dist-server/src/commands/delegate.js.map +1 -1
- package/dashboard/dist-server/src/config/cli-tools-config.d.ts +6 -0
- package/dashboard/dist-server/src/config/cli-tools-config.js +2 -0
- package/dashboard/dist-server/src/config/cli-tools-config.js.map +1 -1
- package/dist/shared/agent-types.d.ts +2 -0
- package/dist/shared/agent-types.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.d.ts +2 -0
- package/dist/src/agents/cli-agent-runner.d.ts.map +1 -1
- package/dist/src/agents/cli-agent-runner.js +4 -0
- package/dist/src/agents/cli-agent-runner.js.map +1 -1
- package/dist/src/commands/config.d.ts.map +1 -1
- package/dist/src/commands/config.js +29 -1
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/delegate.d.ts +2 -0
- package/dist/src/commands/delegate.d.ts.map +1 -1
- package/dist/src/commands/delegate.js +18 -0
- package/dist/src/commands/delegate.js.map +1 -1
- package/dist/src/commands/launcher.d.ts.map +1 -1
- package/dist/src/commands/launcher.js +27 -4
- package/dist/src/commands/launcher.js.map +1 -1
- package/dist/src/config/cli-tools-config.d.ts +6 -0
- package/dist/src/config/cli-tools-config.d.ts.map +1 -1
- package/dist/src/config/cli-tools-config.js +2 -0
- package/dist/src/config/cli-tools-config.js.map +1 -1
- package/dist/src/core/overlay/applier.d.ts.map +1 -1
- package/dist/src/core/overlay/applier.js +65 -5
- package/dist/src/core/overlay/applier.js.map +1 -1
- package/dist/src/core/overlay/loader.d.ts.map +1 -1
- package/dist/src/core/overlay/loader.js +9 -4
- package/dist/src/core/overlay/loader.js.map +1 -1
- package/dist/src/core/overlay/types.d.ts +2 -0
- package/dist/src/core/overlay/types.d.ts.map +1 -1
- package/dist/src/core/overlay/types.js +2 -0
- package/dist/src/core/overlay/types.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js +1 -1
- package/dist/src/tui/tools-ui/ToolsDashboard.js.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.d.ts.map +1 -1
- package/dist/src/tui/tools-ui/ToolsOverview.js +51 -4
- package/dist/src/tui/tools-ui/ToolsOverview.js.map +1 -1
- package/package.json +1 -1
- package/shared/agent-types.ts +2 -0
- package/workflows/delegate-protocol.codex.md +65 -0
- package/workflows/issue-analyze.md +2 -3
- package/workflows/issue-gaps-analyze.codex.md +260 -0
- package/workflows/issue-gaps-analyze.md +214 -0
|
@@ -1,178 +1,178 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: maestro-overlay
|
|
3
|
-
description: Create or edit
|
|
4
|
-
argument-hint: "<intent>"
|
|
5
|
-
allowed-tools:
|
|
6
|
-
- Read
|
|
7
|
-
- Write
|
|
8
|
-
- Bash
|
|
9
|
-
- Glob
|
|
10
|
-
- Grep
|
|
11
|
-
- AskUserQuestion
|
|
12
|
-
---
|
|
13
|
-
<purpose>
|
|
14
|
-
Turn a user's natural-language instruction into a command overlay — a JSON patch file that augments one or more `.claude/commands/*.md` files non-invasively. Overlays live at `~/.maestro/overlays/` and are auto-applied by every `maestro install` run, so injected steps survive reinstalls. Use this skill when the user says things like "always run CLI verification after `/maestro-execute`", "require reading doc X before `/maestro-plan`", or "add a `ccw cli` quality check at the end of every quality-review".
|
|
15
|
-
</purpose>
|
|
16
|
-
|
|
17
|
-
<required_reading>
|
|
18
|
-
@~/.maestro/workflows/overlays.md
|
|
19
|
-
@~/.maestro/cli-tools.json
|
|
20
|
-
</required_reading>
|
|
21
|
-
|
|
22
|
-
<context>
|
|
23
|
-
**Overlay model** — an overlay is a JSON file with a `name`, one or more `targets` (command names without `.md`), and a list of `patches`. Each patch targets an XML section (`execution`, `required_reading`, `context`, `success_criteria`, etc.), a mode (`append`, `prepend`, `replace`, `new-section`), and `content`. On apply, the patcher wraps the content in hashed HTML-comment markers so re-apply is idempotent and removal is surgical.
|
|
24
|
-
|
|
25
|
-
**Where overlays live**
|
|
26
|
-
- User overlays: `~/.maestro/overlays/*.json` — created by this skill
|
|
27
|
-
- Shared docs: `~/.maestro/overlays/docs/*.md` — referenced via `@~/.maestro/overlays/docs/*.md` inside patch content
|
|
28
|
-
- Shipped examples: `~/.maestro/overlays/_shipped/` — read-only, do not edit
|
|
29
|
-
|
|
30
|
-
**Management** — listing and removing overlays is handled by `maestro overlay list` (ink TUI with interactive delete). This skill focuses solely on creation.
|
|
31
|
-
|
|
32
|
-
**Available sections** (for `section:` in patches): `purpose`, `required_reading`, `deferred_reading`, `context`, `execution`, `error_codes`, `success_criteria`.
|
|
33
|
-
</context>
|
|
34
|
-
|
|
35
|
-
<execution>
|
|
36
|
-
### 1. Parse user intent
|
|
37
|
-
|
|
38
|
-
Treat the argument as natural-language intent. If unclear, ask up to 2 questions with AskUserQuestion: (a) which command(s) to target, (b) where in the command flow the injection should happen.
|
|
39
|
-
|
|
40
|
-
### 2. Identify targets, injection points, and visualize
|
|
41
|
-
|
|
42
|
-
For each likely target command, read the pristine source from `$PKG_ROOT/.claude/commands/<name>.md` (preferred — untouched by overlays) or fall back to `~/.claude/commands/<name>.md`. Inspect the XML sections and pick the right one:
|
|
43
|
-
|
|
44
|
-
- **New step after execution** → `section: execution`, `mode: append`
|
|
45
|
-
- **Required reading** → `section: required_reading`, `mode: append`
|
|
46
|
-
- **Preconditions / gating** → `section: context`, `mode: append`
|
|
47
|
-
- **Output quality gate** → `section: success_criteria`, `mode: append`
|
|
48
|
-
|
|
49
|
-
If the user wants a whole new section, use `mode: new-section` with `afterSection: execution` (or whichever anchor makes sense).
|
|
50
|
-
|
|
51
|
-
**Injection point preview** — after selecting section + mode, render the target command's section map showing existing overlays and the new injection point:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
=== maestro-execute.md (1 overlay exists) ===
|
|
55
|
-
|
|
56
|
-
<purpose>
|
|
57
|
-
<required_reading>
|
|
58
|
-
<context>
|
|
59
|
-
<execution>
|
|
60
|
-
├─ [existing] cli-verify #1 "CLI Verification step"
|
|
61
|
-
>>> NEW: append here (your overlay)
|
|
62
|
-
<success_criteria>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Use AskUserQuestion to confirm:
|
|
66
|
-
- **"Confirm"** — proceed with this injection point
|
|
67
|
-
- **"Pick different section"** — re-select section/mode
|
|
68
|
-
- **"Cancel"** — abort
|
|
69
|
-
|
|
70
|
-
### 2.5. Skill chain configuration
|
|
71
|
-
|
|
72
|
-
After confirming the injection point, ask whether this overlay should chain to another skill upon completion. This enables the overlay's injected content to hand off to a skill via AskUserQuestion at runtime — similar to how `/maestro` chains commands via `Skill({ skill: "...", args: "..." })`.
|
|
73
|
-
|
|
74
|
-
Use AskUserQuestion:
|
|
75
|
-
- **"No chain"** — standard overlay, no skill handoff
|
|
76
|
-
- **"Chain to skill"** → ask for the target skill name (e.g., `quality-review`, `maestro-verify`, `quality-test`)
|
|
77
|
-
- **"Chain with alternatives"** → ask for primary skill + 1-2 alternative skills
|
|
78
|
-
|
|
79
|
-
If chain is selected, record the skill name(s) for use in Step 3.
|
|
80
|
-
|
|
81
|
-
### 3. Draft the overlay JSON
|
|
82
|
-
|
|
83
|
-
Build a slug from the user's intent (kebab-case, lowercase). Write to `~/.maestro/overlays/<slug>.json`:
|
|
84
|
-
|
|
85
|
-
```json
|
|
86
|
-
{
|
|
87
|
-
"name": "<slug>",
|
|
88
|
-
"description": "<short summary of what and why>",
|
|
89
|
-
"targets": ["maestro-execute"],
|
|
90
|
-
"priority": 50,
|
|
91
|
-
"enabled": true,
|
|
92
|
-
"patches": [
|
|
93
|
-
{
|
|
94
|
-
"section": "execution",
|
|
95
|
-
"mode": "append",
|
|
96
|
-
"content": "## CLI Verification (overlay)\n\nAfter execution, run:\n```\nccw cli -p \"PURPOSE: ...\" --mode analysis --rule analysis-review-code-quality\n```"
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
**Content guidelines**
|
|
103
|
-
- Lead the injected block with a heading that includes `(overlay)` so readers see it's machine-injected
|
|
104
|
-
- Keep content concise — overlays should add a step, not rewrite the command
|
|
105
|
-
- `@~/.maestro/...` references are encouraged for pointing at docs
|
|
106
|
-
- Escape `\n` in JSON strings; use a HEREDOC via Bash if content is long
|
|
107
|
-
|
|
108
|
-
**Skill chain content** — if a chain was configured in Step 2.5, append a Skill Handoff block at the end of the patch `content`. The handoff uses AskUserQuestion so the user controls whether to proceed:
|
|
109
|
-
|
|
110
|
-
```markdown
|
|
111
|
-
---
|
|
112
|
-
|
|
113
|
-
**Skill Handoff** (overlay)
|
|
114
|
-
|
|
115
|
-
After the above step completes, use AskUserQuestion:
|
|
116
|
-
- "Proceed to /quality-review" — Hand off to quality review
|
|
117
|
-
- "Skip" — Continue with current command flow
|
|
118
|
-
- "Alternative: /maestro-verify" — Run verification instead
|
|
119
|
-
|
|
120
|
-
On user selection:
|
|
121
|
-
- Proceed → Skill({ skill: "quality-review", args: "{phase}" })
|
|
122
|
-
- Alternative → Skill({ skill: "maestro-verify", args: "{phase}" })
|
|
123
|
-
- Skip → continue normally
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
Handoff rules:
|
|
127
|
-
- Always include a **"Skip"** option — the user can always decline the chain
|
|
128
|
-
- Use `Skill({ skill: "<name>", args: "..." })` syntax consistent with maestro.md chainMap
|
|
129
|
-
- Mark handoff heading with `(overlay)` tag
|
|
130
|
-
- Support runtime variable placeholders: `{phase}`, `{description}`, `{session_id}`
|
|
131
|
-
- Keep handoff block under 10 lines of markdown
|
|
132
|
-
|
|
133
|
-
### 4. Install via `maestro overlay add`
|
|
134
|
-
|
|
135
|
-
Run:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
maestro overlay add ~/.maestro/overlays/<slug>.json
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
This validates the overlay, copies it into place (idempotent), and applies it across all known install scopes. On validation failure, fix the JSON and re-run.
|
|
142
|
-
|
|
143
|
-
### 5. Report
|
|
144
|
-
|
|
145
|
-
Show the user:
|
|
146
|
-
- Path of the saved overlay JSON
|
|
147
|
-
- Which targets were patched and which were skipped (missing/disabled)
|
|
148
|
-
- Skill chain info (if configured)
|
|
149
|
-
- A reminder that `maestro install` will auto-reapply on every run
|
|
150
|
-
- How to remove: `maestro overlay remove <slug>`
|
|
151
|
-
|
|
152
|
-
**Report format**
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
=== OVERLAY INSTALLED ===
|
|
156
|
-
Name: <slug>
|
|
157
|
-
Path: ~/.maestro/overlays/<slug>.json
|
|
158
|
-
Targets: maestro-execute (applied), maestro-plan (skipped: missing)
|
|
159
|
-
Chain: quality-review (via AskUserQuestion) | none
|
|
160
|
-
Scopes: [global]
|
|
161
|
-
|
|
162
|
-
Re-apply: maestro overlay apply
|
|
163
|
-
Remove: maestro overlay remove <slug>
|
|
164
|
-
Inspect: maestro overlay list
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
After the report, remind the user they can run `maestro overlay list` for the interactive TUI showing section maps and overlay management.
|
|
168
|
-
</execution>
|
|
169
|
-
|
|
170
|
-
<success_criteria>
|
|
171
|
-
- [ ] Overlay JSON written to `~/.maestro/overlays/<slug>.json` and validates
|
|
172
|
-
- [ ] `maestro overlay add` exited successfully and applied to at least one scope
|
|
173
|
-
- [ ] Target command file(s) contain `<!-- maestro-overlay:<slug>#N hash=... -->` markers
|
|
174
|
-
- [ ] Re-running `maestro overlay apply` produces no file changes (idempotent)
|
|
175
|
-
- [ ] User shown the report with target list and removal instructions
|
|
176
|
-
- [ ] Injection point preview shown (with existing overlays + `>>>` marker) and confirmed before drafting
|
|
177
|
-
- [ ] If chain configured, `content` includes Skill Handoff block with AskUserQuestion + Skip option + `Skill()` calls
|
|
178
|
-
</success_criteria>
|
|
1
|
+
---
|
|
2
|
+
name: maestro-overlay
|
|
3
|
+
description: Create or edit command overlays from natural language
|
|
4
|
+
argument-hint: "<intent>"
|
|
5
|
+
allowed-tools:
|
|
6
|
+
- Read
|
|
7
|
+
- Write
|
|
8
|
+
- Bash
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- AskUserQuestion
|
|
12
|
+
---
|
|
13
|
+
<purpose>
|
|
14
|
+
Turn a user's natural-language instruction into a command overlay — a JSON patch file that augments one or more `.claude/commands/*.md` files non-invasively. Overlays live at `~/.maestro/overlays/` and are auto-applied by every `maestro install` run, so injected steps survive reinstalls. Use this skill when the user says things like "always run CLI verification after `/maestro-execute`", "require reading doc X before `/maestro-plan`", or "add a `ccw cli` quality check at the end of every quality-review".
|
|
15
|
+
</purpose>
|
|
16
|
+
|
|
17
|
+
<required_reading>
|
|
18
|
+
@~/.maestro/workflows/overlays.md
|
|
19
|
+
@~/.maestro/cli-tools.json
|
|
20
|
+
</required_reading>
|
|
21
|
+
|
|
22
|
+
<context>
|
|
23
|
+
**Overlay model** — an overlay is a JSON file with a `name`, one or more `targets` (command names without `.md`), and a list of `patches`. Each patch targets an XML section (`execution`, `required_reading`, `context`, `success_criteria`, etc.), a mode (`append`, `prepend`, `replace`, `new-section`), and `content`. On apply, the patcher wraps the content in hashed HTML-comment markers so re-apply is idempotent and removal is surgical.
|
|
24
|
+
|
|
25
|
+
**Where overlays live**
|
|
26
|
+
- User overlays: `~/.maestro/overlays/*.json` — created by this skill
|
|
27
|
+
- Shared docs: `~/.maestro/overlays/docs/*.md` — referenced via `@~/.maestro/overlays/docs/*.md` inside patch content
|
|
28
|
+
- Shipped examples: `~/.maestro/overlays/_shipped/` — read-only, do not edit
|
|
29
|
+
|
|
30
|
+
**Management** — listing and removing overlays is handled by `maestro overlay list` (ink TUI with interactive delete). This skill focuses solely on creation.
|
|
31
|
+
|
|
32
|
+
**Available sections** (for `section:` in patches): `purpose`, `required_reading`, `deferred_reading`, `context`, `execution`, `error_codes`, `success_criteria`.
|
|
33
|
+
</context>
|
|
34
|
+
|
|
35
|
+
<execution>
|
|
36
|
+
### 1. Parse user intent
|
|
37
|
+
|
|
38
|
+
Treat the argument as natural-language intent. If unclear, ask up to 2 questions with AskUserQuestion: (a) which command(s) to target, (b) where in the command flow the injection should happen.
|
|
39
|
+
|
|
40
|
+
### 2. Identify targets, injection points, and visualize
|
|
41
|
+
|
|
42
|
+
For each likely target command, read the pristine source from `$PKG_ROOT/.claude/commands/<name>.md` (preferred — untouched by overlays) or fall back to `~/.claude/commands/<name>.md`. Inspect the XML sections and pick the right one:
|
|
43
|
+
|
|
44
|
+
- **New step after execution** → `section: execution`, `mode: append`
|
|
45
|
+
- **Required reading** → `section: required_reading`, `mode: append`
|
|
46
|
+
- **Preconditions / gating** → `section: context`, `mode: append`
|
|
47
|
+
- **Output quality gate** → `section: success_criteria`, `mode: append`
|
|
48
|
+
|
|
49
|
+
If the user wants a whole new section, use `mode: new-section` with `afterSection: execution` (or whichever anchor makes sense).
|
|
50
|
+
|
|
51
|
+
**Injection point preview** — after selecting section + mode, render the target command's section map showing existing overlays and the new injection point:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
=== maestro-execute.md (1 overlay exists) ===
|
|
55
|
+
|
|
56
|
+
<purpose>
|
|
57
|
+
<required_reading>
|
|
58
|
+
<context>
|
|
59
|
+
<execution>
|
|
60
|
+
├─ [existing] cli-verify #1 "CLI Verification step"
|
|
61
|
+
>>> NEW: append here (your overlay)
|
|
62
|
+
<success_criteria>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Use AskUserQuestion to confirm:
|
|
66
|
+
- **"Confirm"** — proceed with this injection point
|
|
67
|
+
- **"Pick different section"** — re-select section/mode
|
|
68
|
+
- **"Cancel"** — abort
|
|
69
|
+
|
|
70
|
+
### 2.5. Skill chain configuration
|
|
71
|
+
|
|
72
|
+
After confirming the injection point, ask whether this overlay should chain to another skill upon completion. This enables the overlay's injected content to hand off to a skill via AskUserQuestion at runtime — similar to how `/maestro` chains commands via `Skill({ skill: "...", args: "..." })`.
|
|
73
|
+
|
|
74
|
+
Use AskUserQuestion:
|
|
75
|
+
- **"No chain"** — standard overlay, no skill handoff
|
|
76
|
+
- **"Chain to skill"** → ask for the target skill name (e.g., `quality-review`, `maestro-verify`, `quality-test`)
|
|
77
|
+
- **"Chain with alternatives"** → ask for primary skill + 1-2 alternative skills
|
|
78
|
+
|
|
79
|
+
If chain is selected, record the skill name(s) for use in Step 3.
|
|
80
|
+
|
|
81
|
+
### 3. Draft the overlay JSON
|
|
82
|
+
|
|
83
|
+
Build a slug from the user's intent (kebab-case, lowercase). Write to `~/.maestro/overlays/<slug>.json`:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"name": "<slug>",
|
|
88
|
+
"description": "<short summary of what and why>",
|
|
89
|
+
"targets": ["maestro-execute"],
|
|
90
|
+
"priority": 50,
|
|
91
|
+
"enabled": true,
|
|
92
|
+
"patches": [
|
|
93
|
+
{
|
|
94
|
+
"section": "execution",
|
|
95
|
+
"mode": "append",
|
|
96
|
+
"content": "## CLI Verification (overlay)\n\nAfter execution, run:\n```\nccw cli -p \"PURPOSE: ...\" --mode analysis --rule analysis-review-code-quality\n```"
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Content guidelines**
|
|
103
|
+
- Lead the injected block with a heading that includes `(overlay)` so readers see it's machine-injected
|
|
104
|
+
- Keep content concise — overlays should add a step, not rewrite the command
|
|
105
|
+
- `@~/.maestro/...` references are encouraged for pointing at docs
|
|
106
|
+
- Escape `\n` in JSON strings; use a HEREDOC via Bash if content is long
|
|
107
|
+
|
|
108
|
+
**Skill chain content** — if a chain was configured in Step 2.5, append a Skill Handoff block at the end of the patch `content`. The handoff uses AskUserQuestion so the user controls whether to proceed:
|
|
109
|
+
|
|
110
|
+
```markdown
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
**Skill Handoff** (overlay)
|
|
114
|
+
|
|
115
|
+
After the above step completes, use AskUserQuestion:
|
|
116
|
+
- "Proceed to /quality-review" — Hand off to quality review
|
|
117
|
+
- "Skip" — Continue with current command flow
|
|
118
|
+
- "Alternative: /maestro-verify" — Run verification instead
|
|
119
|
+
|
|
120
|
+
On user selection:
|
|
121
|
+
- Proceed → Skill({ skill: "quality-review", args: "{phase}" })
|
|
122
|
+
- Alternative → Skill({ skill: "maestro-verify", args: "{phase}" })
|
|
123
|
+
- Skip → continue normally
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Handoff rules:
|
|
127
|
+
- Always include a **"Skip"** option — the user can always decline the chain
|
|
128
|
+
- Use `Skill({ skill: "<name>", args: "..." })` syntax consistent with maestro.md chainMap
|
|
129
|
+
- Mark handoff heading with `(overlay)` tag
|
|
130
|
+
- Support runtime variable placeholders: `{phase}`, `{description}`, `{session_id}`
|
|
131
|
+
- Keep handoff block under 10 lines of markdown
|
|
132
|
+
|
|
133
|
+
### 4. Install via `maestro overlay add`
|
|
134
|
+
|
|
135
|
+
Run:
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
maestro overlay add ~/.maestro/overlays/<slug>.json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
This validates the overlay, copies it into place (idempotent), and applies it across all known install scopes. On validation failure, fix the JSON and re-run.
|
|
142
|
+
|
|
143
|
+
### 5. Report
|
|
144
|
+
|
|
145
|
+
Show the user:
|
|
146
|
+
- Path of the saved overlay JSON
|
|
147
|
+
- Which targets were patched and which were skipped (missing/disabled)
|
|
148
|
+
- Skill chain info (if configured)
|
|
149
|
+
- A reminder that `maestro install` will auto-reapply on every run
|
|
150
|
+
- How to remove: `maestro overlay remove <slug>`
|
|
151
|
+
|
|
152
|
+
**Report format**
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
=== OVERLAY INSTALLED ===
|
|
156
|
+
Name: <slug>
|
|
157
|
+
Path: ~/.maestro/overlays/<slug>.json
|
|
158
|
+
Targets: maestro-execute (applied), maestro-plan (skipped: missing)
|
|
159
|
+
Chain: quality-review (via AskUserQuestion) | none
|
|
160
|
+
Scopes: [global]
|
|
161
|
+
|
|
162
|
+
Re-apply: maestro overlay apply
|
|
163
|
+
Remove: maestro overlay remove <slug>
|
|
164
|
+
Inspect: maestro overlay list
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
After the report, remind the user they can run `maestro overlay list` for the interactive TUI showing section maps and overlay management.
|
|
168
|
+
</execution>
|
|
169
|
+
|
|
170
|
+
<success_criteria>
|
|
171
|
+
- [ ] Overlay JSON written to `~/.maestro/overlays/<slug>.json` and validates
|
|
172
|
+
- [ ] `maestro overlay add` exited successfully and applied to at least one scope
|
|
173
|
+
- [ ] Target command file(s) contain `<!-- maestro-overlay:<slug>#N hash=... -->` markers
|
|
174
|
+
- [ ] Re-running `maestro overlay apply` produces no file changes (idempotent)
|
|
175
|
+
- [ ] User shown the report with target list and removal instructions
|
|
176
|
+
- [ ] Injection point preview shown (with existing overlays + `>>>` marker) and confirmed before drafting
|
|
177
|
+
- [ ] If chain configured, `content` includes Skill Handoff block with AskUserQuestion + Skip option + `Skill()` calls
|
|
178
|
+
</success_criteria>
|