pi-maestro-flow 0.2.0 → 0.3.1
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/README.md +44 -72
- package/agents/cross-role-reviewer.md +1 -1
- package/agents/impeccable-agent.md +1 -1
- package/agents/ralph-executor.md +1 -1
- package/agents/team-worker.md +1 -1
- package/agents/workflow-analyzer.md +1 -1
- package/agents/workflow-codebase-mapper.md +1 -1
- package/agents/workflow-collab-planner.md +1 -1
- package/agents/workflow-debugger.md +1 -1
- package/agents/workflow-executor.md +1 -1
- package/agents/workflow-integration-checker.md +1 -1
- package/agents/workflow-nyquist-auditor.md +1 -1
- package/agents/workflow-phase-researcher.md +1 -1
- package/agents/workflow-planner.md +1 -1
- package/agents/workflow-project-researcher.md +1 -1
- package/agents/workflow-reviewer.md +1 -1
- package/agents/workflow-verifier.md +1 -1
- package/package.json +18 -4
- package/skills/codify-to-knowhow/SKILL.md +1 -1
- package/skills/delegation-check/SKILL.md +1 -1
- package/skills/domain-add/SKILL.md +5 -5
- package/skills/insight-challenge/SKILL.md +1 -1
- package/skills/learn-decompose/SKILL.md +4 -4
- package/skills/learn-follow/SKILL.md +5 -5
- package/skills/learn-investigate/SKILL.md +5 -5
- package/skills/learn-second-opinion/SKILL.md +5 -5
- package/skills/maestro/SKILL.md +8 -8
- package/skills/maestro-amend/SKILL.md +4 -4
- package/skills/maestro-analyze/SKILL.md +9 -9
- package/skills/maestro-blueprint/SKILL.md +7 -7
- package/skills/maestro-brainstorm/SKILL.md +10 -10
- package/skills/maestro-collab/SKILL.md +4 -4
- package/skills/maestro-companion/SKILL.md +3 -3
- package/skills/maestro-composer/SKILL.md +10 -10
- package/skills/maestro-execute/SKILL.md +8 -8
- package/skills/maestro-fork/SKILL.md +7 -7
- package/skills/maestro-grill/SKILL.md +12 -12
- package/skills/maestro-guard/SKILL.md +5 -5
- package/skills/maestro-help/SKILL.md +3 -3
- package/skills/maestro-impeccable/SKILL.md +7 -7
- package/skills/maestro-init/SKILL.md +8 -8
- package/skills/maestro-merge/SKILL.md +6 -6
- package/skills/maestro-milestone-audit/SKILL.md +3 -3
- package/skills/maestro-milestone-complete/SKILL.md +8 -8
- package/skills/maestro-milestone-release/SKILL.md +9 -9
- package/skills/maestro-next/SKILL.md +5 -5
- package/skills/maestro-overlay/SKILL.md +19 -19
- package/skills/maestro-plan/SKILL.md +8 -8
- package/skills/maestro-player/SKILL.md +5 -5
- package/skills/maestro-quick/SKILL.md +5 -5
- package/skills/maestro-ralph/SKILL.md +15 -15
- package/skills/maestro-ralph-cli/SKILL.md +6 -6
- package/skills/maestro-ralph-cli-execute/SKILL.md +2 -2
- package/skills/maestro-ralph-execute/SKILL.md +4 -4
- package/skills/maestro-ralph-v2/SKILL.md +17 -17
- package/skills/maestro-roadmap/SKILL.md +7 -7
- package/skills/maestro-swarm-workflow/SKILL.md +9 -9
- package/skills/maestro-tools-execute/SKILL.md +5 -5
- package/skills/maestro-tools-register/SKILL.md +7 -7
- package/skills/maestro-ui-codify/SKILL.md +8 -8
- package/skills/maestro-universal-workflow/SKILL.md +15 -15
- package/skills/maestro-update/SKILL.md +10 -10
- package/skills/manage-codebase-rebuild/SKILL.md +4 -4
- package/skills/manage-drift-realign/SKILL.md +7 -7
- package/skills/manage-harvest/SKILL.md +5 -5
- package/skills/manage-issue/SKILL.md +4 -4
- package/skills/manage-issue-discover/SKILL.md +7 -7
- package/skills/manage-kg-extractors/SKILL.md +3 -3
- package/skills/manage-knowhow/SKILL.md +3 -3
- package/skills/manage-knowhow-capture/SKILL.md +4 -4
- package/skills/manage-knowledge-audit/SKILL.md +5 -5
- package/skills/manage-status/SKILL.md +3 -3
- package/skills/manage-wiki/SKILL.md +5 -5
- package/skills/odyssey-debug/SKILL.md +13 -13
- package/skills/odyssey-improve/SKILL.md +15 -15
- package/skills/odyssey-planex/SKILL.md +16 -16
- package/skills/odyssey-review-test-fix/SKILL.md +11 -11
- package/skills/odyssey-ui/SKILL.md +10 -10
- package/skills/prompt-generator/SKILL.md +5 -5
- package/skills/quality-auto-test/SKILL.md +3 -3
- package/skills/quality-debug/SKILL.md +3 -3
- package/skills/quality-refactor/SKILL.md +3 -3
- package/skills/quality-retrospective/SKILL.md +9 -9
- package/skills/quality-review/SKILL.md +4 -4
- package/skills/quality-sync/SKILL.md +3 -3
- package/skills/quality-test/SKILL.md +4 -4
- package/skills/scholar-anti-ai-writing/SKILL.md +1 -1
- package/skills/scholar-citation-verify/SKILL.md +1 -1
- package/skills/scholar-experiment/SKILL.md +2 -2
- package/skills/scholar-ideation/SKILL.md +7 -7
- package/skills/scholar-latex-organizer/SKILL.md +1 -1
- package/skills/scholar-publish/SKILL.md +3 -3
- package/skills/scholar-rebuttal-pro/SKILL.md +3 -3
- package/skills/scholar-review/SKILL.md +1 -1
- package/skills/scholar-writing/SKILL.md +1 -1
- package/skills/security-audit/SKILL.md +2 -2
- package/skills/skill-generator/SKILL.md +3 -3
- package/skills/skill-iter-tune/SKILL.md +3 -3
- package/skills/skill-simplify/SKILL.md +1 -1
- package/skills/skill-tuning/SKILL.md +1 -1
- package/skills/spec-add/SKILL.md +5 -5
- package/skills/spec-load/SKILL.md +3 -3
- package/skills/spec-remove/SKILL.md +4 -4
- package/skills/spec-setup/SKILL.md +6 -6
- package/skills/team-adversarial-swarm/SKILL.md +5 -5
- package/skills/team-arch-opt/SKILL.md +2 -2
- package/skills/team-brainstorm/SKILL.md +3 -3
- package/skills/team-coordinate/SKILL.md +4 -4
- package/skills/team-designer/SKILL.md +1 -1
- package/skills/team-executor/SKILL.md +3 -3
- package/skills/team-frontend/SKILL.md +2 -2
- package/skills/team-frontend-debug/SKILL.md +3 -3
- package/skills/team-interactive-craft/SKILL.md +2 -2
- package/skills/team-issue/SKILL.md +3 -3
- package/skills/team-lifecycle-v4/SKILL.md +4 -4
- package/skills/team-motion-design/SKILL.md +2 -2
- package/skills/team-perf-opt/SKILL.md +3 -3
- package/skills/team-planex/SKILL.md +2 -2
- package/skills/team-quality-assurance/SKILL.md +3 -3
- package/skills/team-review/SKILL.md +3 -3
- package/skills/team-roadmap-dev/SKILL.md +3 -3
- package/skills/team-swarm/SKILL.md +4 -4
- package/skills/team-tech-debt/SKILL.md +2 -2
- package/skills/team-testing/SKILL.md +3 -3
- package/skills/team-ui-polish/SKILL.md +2 -2
- package/skills/team-uidesign/SKILL.md +2 -2
- package/skills/team-ultra-analyze/SKILL.md +4 -4
- package/skills/team-ux-improve/SKILL.md +3 -3
- package/skills/team-visual-a11y/SKILL.md +2 -2
- package/skills/workflow-skill-designer/SKILL.md +8 -8
- package/templates/business-test-report.json +68 -0
- package/templates/config.json +48 -0
- package/templates/context.md +16 -0
- package/templates/doc-index.json +11 -0
- package/templates/index.json +68 -0
- package/templates/issue.json +36 -0
- package/templates/plan.json +38 -0
- package/templates/project.md +60 -0
- package/templates/reflection-log.md +20 -0
- package/templates/roadmap.md +45 -0
- package/templates/scratch-index.json +19 -0
- package/templates/search-tool.json +1 -0
- package/templates/search-tools.md +47 -0
- package/templates/state.json +18 -0
- package/templates/task-summary.md +21 -0
- package/templates/task.json +89 -0
- package/templates/terminology-template.json +22 -0
- package/templates/uat.md +21 -0
- package/templates/validation.json +31 -0
- package/templates/verification.json +37 -0
- package/templates/workflow.md +14 -0
- package/templates/worktree-scope.json +9 -0
- package/templates/worktrees.json +26 -0
- package/workflows/agy-instructions.md +156 -0
- package/workflows/analyze.md +768 -0
- package/workflows/auto-test.md +705 -0
- package/workflows/blueprint.md +406 -0
- package/workflows/boundary-grill.md +50 -0
- package/workflows/brainstorm.md +508 -0
- package/workflows/business-test.md +574 -0
- package/workflows/chinese-response.md +25 -0
- package/workflows/claude-instructions.md +167 -0
- package/workflows/codebase-rebuild.md +267 -0
- package/workflows/codebase-refresh.md +168 -0
- package/workflows/codex-instructions.md +156 -0
- package/workflows/coding-philosophy.md +70 -0
- package/workflows/command-authoring.md +823 -0
- package/workflows/debug.md +409 -0
- package/workflows/delegate-usage.md +99 -0
- package/workflows/domain-add.md +121 -0
- package/workflows/drift-realign.md +396 -0
- package/workflows/execute.md +631 -0
- package/workflows/explore-usage.md +93 -0
- package/workflows/finish-work.md +124 -0
- package/workflows/fork.md +162 -0
- package/workflows/grill.md +494 -0
- package/workflows/harvest.md +478 -0
- package/workflows/impeccable.md +168 -0
- package/workflows/init.md +157 -0
- package/workflows/instruction-authoring-guide.md +97 -0
- package/workflows/integration-test.md +186 -0
- package/workflows/interview-mechanics.md +8 -0
- package/workflows/issue-analyze.md +20 -0
- package/workflows/issue-discover.md +238 -0
- package/workflows/issue-execute.md +110 -0
- package/workflows/issue-gaps-analyze.codex.md +256 -0
- package/workflows/issue-gaps-analyze.md +215 -0
- package/workflows/issue-plan.md +110 -0
- package/workflows/issue.md +338 -0
- package/workflows/knowhow.md +429 -0
- package/workflows/knowledge-audit.md +355 -0
- package/workflows/learn.md +271 -0
- package/workflows/maestro-chain-execute.md +20 -0
- package/workflows/maestro-link-coordinate.md +114 -0
- package/workflows/maestro-super.md +120 -0
- package/workflows/maestro.md +501 -0
- package/workflows/map.md +74 -0
- package/workflows/merge.md +122 -0
- package/workflows/milestone-audit.md +155 -0
- package/workflows/milestone-complete.md +167 -0
- package/workflows/milestone-release.md +82 -0
- package/workflows/odyssey-base-codex.md +305 -0
- package/workflows/odyssey-base.md +256 -0
- package/workflows/overlays.md +109 -0
- package/workflows/plan.md +520 -0
- package/workflows/quick.md +350 -0
- package/workflows/ralph-amend-goal.md +177 -0
- package/workflows/refactor.md +87 -0
- package/workflows/retrospective.md +471 -0
- package/workflows/review.md +448 -0
- package/workflows/roadmap-common.md +193 -0
- package/workflows/roadmap.md +106 -0
- package/workflows/shell-exec-protocol.md +30 -0
- package/workflows/skill-authoring.md +265 -0
- package/workflows/spec-generate.md +475 -0
- package/workflows/specs-add.md +123 -0
- package/workflows/specs-load.md +76 -0
- package/workflows/specs-remove.md +104 -0
- package/workflows/specs-setup.md +316 -0
- package/workflows/status.md +149 -0
- package/workflows/sync.md +116 -0
- package/workflows/tdd.md +255 -0
- package/workflows/test-gen.md +226 -0
- package/workflows/test.md +385 -0
- package/workflows/tools-spec.md +70 -0
- package/workflows/ui-codify-extract.md +372 -0
- package/workflows/ui-codify-knowhow.md +258 -0
- package/workflows/ui-codify-package.md +159 -0
- package/workflows/ui-codify.md +227 -0
- package/workflows/ui-design.md +393 -0
- package/workflows/ui-style.md +201 -0
- package/workflows/verify.md +557 -0
- package/workflows/wiki-connect.md +153 -0
- package/workflows/wiki-digest.md +180 -0
- package/workflows/wiki-manage.md +113 -0
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# Quick Task Workflow
|
|
2
|
+
|
|
3
|
+
Execute small, ad-hoc tasks with workflow guarantees (atomic commits, state tracking). Quick mode spawns workflow-planner (quick mode) + workflow-executor(s), tracks tasks in `.workflow/scratch/`, and updates state.json.
|
|
4
|
+
|
|
5
|
+
With `--discuss`: lightweight decision extraction before planning. Identifies gray areas, conducts interactive discussion, classifies decisions as Locked/Free/Deferred in context.md so the planner treats Locked decisions as constraints and Free decisions as implementer discretion.
|
|
6
|
+
|
|
7
|
+
With `--full`: enables plan-checking (max 2 iterations) and post-execution verification.
|
|
8
|
+
|
|
9
|
+
Flags are composable: `--discuss --full` gives discussion + plan-checking + verification.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- `.workflow/state.json` must exist (project initialized)
|
|
16
|
+
- Quick tasks can run mid-phase -- validation only checks project exists, not phase status
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
### Step 1: Parse Arguments
|
|
21
|
+
|
|
22
|
+
**Parse $ARGUMENTS for flags and description:**
|
|
23
|
+
|
|
24
|
+
Extract:
|
|
25
|
+
- `--full` flag -> store as `$FULL_MODE` (true/false)
|
|
26
|
+
- `--discuss` flag -> store as `$DISCUSS_MODE` (true/false)
|
|
27
|
+
- Remaining text -> use as `$DESCRIPTION`
|
|
28
|
+
|
|
29
|
+
If `$DESCRIPTION` is empty after parsing:
|
|
30
|
+
```
|
|
31
|
+
AskUserQuestion(
|
|
32
|
+
header: "Quick Task",
|
|
33
|
+
question: "What do you want to do?",
|
|
34
|
+
followUp: null
|
|
35
|
+
)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Store response as `$DESCRIPTION`.
|
|
39
|
+
If still empty, re-prompt: "Please provide a task description."
|
|
40
|
+
|
|
41
|
+
Display banner: `WORKFLOW > QUICK TASK` with active flag suffix:
|
|
42
|
+
|
|
43
|
+
| Flags | Banner Suffix | Subtitle |
|
|
44
|
+
|-------|--------------|----------|
|
|
45
|
+
| --discuss + --full | `(DISCUSS + FULL)` | Discussion + plan checking + verification enabled |
|
|
46
|
+
| --discuss only | `(DISCUSS)` | Discussion phase enabled -- surfacing gray areas before planning |
|
|
47
|
+
| --full only | `(FULL MODE)` | Plan checking + verification enabled |
|
|
48
|
+
| none | _(no suffix)_ | _(no subtitle)_ |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### Step 2: Validate Project
|
|
53
|
+
|
|
54
|
+
**Validate project state:**
|
|
55
|
+
|
|
56
|
+
Check .workflow/ exists and has state.json:
|
|
57
|
+
```bash
|
|
58
|
+
test -f .workflow/state.json && echo "exists" || echo "missing"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
If missing: Error -- "Quick mode requires an initialized project. Run /workflow:init first."
|
|
62
|
+
|
|
63
|
+
Quick tasks can run mid-phase -- validation only checks project exists, not phase status.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
### Step 3: Create Scratch Directory
|
|
68
|
+
|
|
69
|
+
**Create scratch directory:**
|
|
70
|
+
|
|
71
|
+
Generate slug from $DESCRIPTION (lowercase, hyphens, max 40 chars).
|
|
72
|
+
Set date to current date (YYYYMMDD).
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
QUICK_DIR=".workflow/scratch/${date}-quick-${slug}"
|
|
76
|
+
mkdir -p "$QUICK_DIR/.task"
|
|
77
|
+
mkdir -p "$QUICK_DIR/.summaries"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Write index.json:
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"id": "{YYYYMMDD}-quick-{slug}",
|
|
84
|
+
"type": "quick",
|
|
85
|
+
"title": "{$DESCRIPTION}",
|
|
86
|
+
"status": "active",
|
|
87
|
+
"created_at": "{ISO timestamp}",
|
|
88
|
+
"updated_at": "{ISO timestamp}",
|
|
89
|
+
"flags": {
|
|
90
|
+
"discuss": {$DISCUSS_MODE},
|
|
91
|
+
"full": {$FULL_MODE}
|
|
92
|
+
},
|
|
93
|
+
"plan": {
|
|
94
|
+
"task_ids": [],
|
|
95
|
+
"task_count": 0
|
|
96
|
+
},
|
|
97
|
+
"execution": {
|
|
98
|
+
"method": "agent",
|
|
99
|
+
"tasks_completed": 0,
|
|
100
|
+
"tasks_total": 0
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Report: "Creating quick task: {$DESCRIPTION}\nDirectory: {$QUICK_DIR}"
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Step 4: Discussion Phase (only when $DISCUSS_MODE)
|
|
110
|
+
|
|
111
|
+
**Lightweight discussion:**
|
|
112
|
+
|
|
113
|
+
Skip entirely if NOT $DISCUSS_MODE.
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
------------------------------------------------------------
|
|
117
|
+
WORKFLOW > DISCUSSING QUICK TASK
|
|
118
|
+
------------------------------------------------------------
|
|
119
|
+
Surfacing gray areas for: {$DESCRIPTION}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
**4a. Identify gray areas:**
|
|
123
|
+
|
|
124
|
+
Analyze $DESCRIPTION to identify 2-4 gray areas -- implementation decisions that would change the outcome. Use domain-aware heuristic:
|
|
125
|
+
- Something users **SEE** -> layout, density, interactions, states
|
|
126
|
+
- Something users **CALL** -> responses, errors, auth, versioning
|
|
127
|
+
- Something users **RUN** -> output format, flags, modes, error handling
|
|
128
|
+
- Something users **READ** -> structure, tone, depth, flow
|
|
129
|
+
- Something being **ORGANIZED** -> criteria, grouping, naming, exceptions
|
|
130
|
+
|
|
131
|
+
**4b. Present gray areas:**
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
AskUserQuestion(
|
|
135
|
+
header: "Gray Areas",
|
|
136
|
+
question: "Which areas need clarification before planning?",
|
|
137
|
+
options: [
|
|
138
|
+
{ label: "{area_1}", description: "{why_it_matters}" },
|
|
139
|
+
{ label: "{area_2}", description: "{why_it_matters}" },
|
|
140
|
+
{ label: "{area_3}", description: "{why_it_matters}" },
|
|
141
|
+
{ label: "All clear", description: "Skip discussion -- I know what I want" }
|
|
142
|
+
],
|
|
143
|
+
multiSelect: true
|
|
144
|
+
)
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
If user selects "All clear" -> skip to Step 5 (no context.md written).
|
|
148
|
+
|
|
149
|
+
**4c. Discuss selected areas:**
|
|
150
|
+
|
|
151
|
+
For each selected area, ask 1-2 focused questions:
|
|
152
|
+
```
|
|
153
|
+
AskUserQuestion(
|
|
154
|
+
header: "{area_name}",
|
|
155
|
+
question: "{specific question}",
|
|
156
|
+
options: [
|
|
157
|
+
{ label: "{choice_1}", description: "{what this means}" },
|
|
158
|
+
{ label: "{choice_2}", description: "{what this means}" },
|
|
159
|
+
{ label: "You decide", description: "Claude's discretion" }
|
|
160
|
+
]
|
|
161
|
+
)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Max 2 questions per area. Collect all decisions.
|
|
165
|
+
|
|
166
|
+
**4d. Classify decisions:**
|
|
167
|
+
|
|
168
|
+
- **Locked**: firm decisions that cannot be changed during implementation
|
|
169
|
+
- **Free**: open for implementation discretion (implementer can choose)
|
|
170
|
+
- **Deferred**: postponed (captured but not acted on in this quick task)
|
|
171
|
+
|
|
172
|
+
**4e. Write context.md:**
|
|
173
|
+
|
|
174
|
+
```markdown
|
|
175
|
+
# Quick Task: {$DESCRIPTION} - Context
|
|
176
|
+
|
|
177
|
+
**Gathered:** {date}
|
|
178
|
+
**Status:** Ready for planning
|
|
179
|
+
|
|
180
|
+
## Task Boundary
|
|
181
|
+
|
|
182
|
+
{$DESCRIPTION}
|
|
183
|
+
|
|
184
|
+
## Constraints
|
|
185
|
+
|
|
186
|
+
### Locked
|
|
187
|
+
{decisions that are final and must be followed}
|
|
188
|
+
|
|
189
|
+
### Free
|
|
190
|
+
{decisions left to implementer discretion, including "You decide" areas}
|
|
191
|
+
|
|
192
|
+
### Deferred
|
|
193
|
+
{ideas captured but out of scope for this quick task}
|
|
194
|
+
|
|
195
|
+
## Code Context
|
|
196
|
+
{relevant code references from discussion, if any}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Write to `${QUICK_DIR}/context.md`.
|
|
200
|
+
Report: "Context captured: ${QUICK_DIR}/context.md"
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### Step 4.5: Load Project Specs
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
specs_content = maestro spec load --category coding
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Passed inline to planner agent in Step 5.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### Step 5: Spawn Planner
|
|
215
|
+
|
|
216
|
+
**Spawn workflow-planner in quick mode:**
|
|
217
|
+
|
|
218
|
+
MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn `workflow-planner` agent with:
|
|
219
|
+
|
|
220
|
+
- **Context**: mode (`quick` or `quick-full`), directory, description, state.json, CLAUDE.md, specs, context.md (if discuss mode)
|
|
221
|
+
- **Constraints**: single plan with 1-3 atomic tasks, no research phase. Full mode: ~40% context usage + require files/action/convergence.criteria/implementation per task. Default: ~30% context usage.
|
|
222
|
+
- **Output**: `${QUICK_DIR}/plan.json`, `${QUICK_DIR}/.task/TASK-{NNN}.json`. Return `## PLANNING COMPLETE` with plan path.
|
|
223
|
+
|
|
224
|
+
After planner returns:
|
|
225
|
+
1. Verify plan.json exists at `${QUICK_DIR}/plan.json`
|
|
226
|
+
2. Update index.json plan fields
|
|
227
|
+
3. Report: "Plan created: ${QUICK_DIR}/plan.json"
|
|
228
|
+
|
|
229
|
+
If plan not found: "Planner failed to create plan.json"
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
### Step 6: Plan Checker (only when $FULL_MODE)
|
|
234
|
+
|
|
235
|
+
**Plan-checker loop:**
|
|
236
|
+
|
|
237
|
+
Skip entirely if NOT $FULL_MODE.
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
------------------------------------------------------------
|
|
241
|
+
WORKFLOW > CHECKING PLAN
|
|
242
|
+
------------------------------------------------------------
|
|
243
|
+
Spawning plan checker...
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn `workflow-plan-checker` agent to verify plan.json and TASK-*.json:
|
|
247
|
+
|
|
248
|
+
- **Check dimensions**: requirement coverage, task completeness (files/action/convergence.criteria/implementation), scope sanity (1-3 tasks), context compliance (if discuss mode).
|
|
249
|
+
- **Return**: `## VERIFICATION PASSED` or `## ISSUES FOUND` with structured issue list.
|
|
250
|
+
|
|
251
|
+
**Handle checker return:**
|
|
252
|
+
|
|
253
|
+
- **VERIFICATION PASSED:** Continue to Step 7.
|
|
254
|
+
- **ISSUES FOUND:** Enter revision loop.
|
|
255
|
+
|
|
256
|
+
**Revision loop (max 2 iterations):**
|
|
257
|
+
|
|
258
|
+
If iteration_count < 2:
|
|
259
|
+
- Display: "Sending back to planner for revision... (iteration {N}/2)"
|
|
260
|
+
- Spawn planner with revision context + checker issues
|
|
261
|
+
- Re-check with checker
|
|
262
|
+
- Increment iteration_count
|
|
263
|
+
|
|
264
|
+
If iteration_count >= 2:
|
|
265
|
+
- Display: "Max iterations reached. {N} issues remain."
|
|
266
|
+
- Offer: 1) Force proceed, 2) Abort; if Force proceed, flag plan as [LOW CONFIDENCE] (remaining issues)
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
**GATE Step 6→7**: REQUIRED plan.json verified by plan-checker BEFORE execution; BLOCKED if plan.json not verified
|
|
271
|
+
|
|
272
|
+
### Step 7: Spawn Executor
|
|
273
|
+
|
|
274
|
+
**Spawn workflow-executor:**
|
|
275
|
+
|
|
276
|
+
MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn `workflow-executor` agent:
|
|
277
|
+
|
|
278
|
+
- **Read**: plan.json, TASK-*.json, state.json, CLAUDE.md
|
|
279
|
+
- **Constraints**: execute all tasks, atomic commits per task, write summaries to `${QUICK_DIR}/.summaries/TASK-{NNN}-summary.md`
|
|
280
|
+
|
|
281
|
+
After executor returns:
|
|
282
|
+
1. Verify summaries exist
|
|
283
|
+
2. Update index.json execution fields
|
|
284
|
+
3. Report completion status
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
### Step 8: Verification (only when $FULL_MODE)
|
|
289
|
+
|
|
290
|
+
**Post-execution verification:**
|
|
291
|
+
|
|
292
|
+
Skip entirely if NOT $FULL_MODE.
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
------------------------------------------------------------
|
|
296
|
+
WORKFLOW > VERIFYING RESULTS
|
|
297
|
+
------------------------------------------------------------
|
|
298
|
+
Spawning verifier...
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Spawn `workflow-verifier` agent: check plan objectives against actual codebase using plan.json and summaries. Write result to `${QUICK_DIR}/verification.json`.
|
|
302
|
+
|
|
303
|
+
Read verification result:
|
|
304
|
+
| Status | Action |
|
|
305
|
+
|--------|--------|
|
|
306
|
+
| passed | Store "Verified", continue |
|
|
307
|
+
| gaps_found | Display gaps, offer: 1) Re-run executor, 2) Accept as-is; if Accept as-is, flag execution as [LOW CONFIDENCE] (gaps unresolved) |
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
### Step 9: Update State
|
|
312
|
+
|
|
313
|
+
**Update state.json:**
|
|
314
|
+
|
|
315
|
+
Read state.json. Add quick task to accumulated_context or quick_tasks array.
|
|
316
|
+
|
|
317
|
+
Record:
|
|
318
|
+
```json
|
|
319
|
+
{
|
|
320
|
+
"id": "{YYYYMMDD}-quick-{slug}",
|
|
321
|
+
"description": "{$DESCRIPTION}",
|
|
322
|
+
"completed_at": "{ISO timestamp}",
|
|
323
|
+
"directory": "{$QUICK_DIR}",
|
|
324
|
+
"verified": {$FULL_MODE ? verification_status : "skipped"}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Update last_updated timestamp.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
### Step 10: Commit and Complete
|
|
333
|
+
|
|
334
|
+
**Final commit and completion:**
|
|
335
|
+
|
|
336
|
+
Update index.json status to "completed".
|
|
337
|
+
|
|
338
|
+
Commit quick task artifacts:
|
|
339
|
+
```bash
|
|
340
|
+
git add "${QUICK_DIR}/" .workflow/state.json
|
|
341
|
+
git commit -m "quick({slug}): ${DESCRIPTION}"
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Display completion:
|
|
345
|
+
|
|
346
|
+
Display completion banner `WORKFLOW > QUICK TASK COMPLETE` (with `(FULL MODE)` suffix if applicable):
|
|
347
|
+
- Show: Quick Task name, Summary path (`${QUICK_DIR}/.summaries/`), Directory path
|
|
348
|
+
- Full mode also shows: Verification path + status (`${QUICK_DIR}/verification.json`)
|
|
349
|
+
- Footer: `Ready for next task: /workflow:quick`
|
|
350
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
# Ralph Goal Amendment Flow
|
|
2
|
+
|
|
3
|
+
`A_AMEND_GOAL` 详细流程。加载方式:`maestro-ralph.md` S_AMEND_GOAL via `<deferred_reading>`。
|
|
4
|
+
|
|
5
|
+
触发:`/maestro-ralph --amend [change_request]`
|
|
6
|
+
GUARD: running ralph session 存在
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Phase 1 — 快照
|
|
11
|
+
|
|
12
|
+
1. 定位最新 running ralph session
|
|
13
|
+
2. Read: `task_decomposition` WHERE `status != "superseded"`, `boundary_contract`, completed steps `completion_summary`
|
|
14
|
+
3. Display:
|
|
15
|
+
```
|
|
16
|
+
📍 Session: {session_id}
|
|
17
|
+
进度: {completed}/{total} steps
|
|
18
|
+
目标:
|
|
19
|
+
{for g in active_goals:}
|
|
20
|
+
[{status_icon}] {g.id}: {g.goal} — done_when: {g.done_when}
|
|
21
|
+
{end for}
|
|
22
|
+
边界: in_scope={count}, out_of_scope={count}
|
|
23
|
+
修改历史: {goal_changelog.length} 次
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Phase 2 — 解析
|
|
27
|
+
|
|
28
|
+
| Condition | 行为 |
|
|
29
|
+
|-----------|------|
|
|
30
|
+
| `change_request` 非空 | 直接使用 |
|
|
31
|
+
| `change_request` 为空 | AskUserQuestion(4 选项 + 自由输入追加) |
|
|
32
|
+
|
|
33
|
+
AskUserQuestion options:
|
|
34
|
+
|
|
35
|
+
| label | description |
|
|
36
|
+
|-------|-------------|
|
|
37
|
+
| 修改现有目标 | 调整子目标范围或完成条件 |
|
|
38
|
+
| 新增目标 | 追加新子目标 |
|
|
39
|
+
| 移除目标 | 取消未完成子目标 |
|
|
40
|
+
| 调整边界 | 修改 in_scope / out_of_scope / constraints |
|
|
41
|
+
|
|
42
|
+
## Phase 3 — Mini Grill
|
|
43
|
+
|
|
44
|
+
MANDATORY, NOT SUBSTITUTABLE by manual Read/Grep: Delegate (run_in_background, STOP, wait):
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
maestro delegate "PURPOSE: 评估目标变更影响
|
|
48
|
+
TASK:
|
|
49
|
+
1. 对比 current_goals 与 change_request,识别冲突/缺口
|
|
50
|
+
2. 判定已完成 steps 在新目标下是否有效(基于 completion_summary + completion_decisions)
|
|
51
|
+
3. 判定 pending steps 是否需重建/跳过
|
|
52
|
+
4. 评估 risk_level
|
|
53
|
+
CONTEXT:
|
|
54
|
+
intent = {session.intent}
|
|
55
|
+
current_goals = {task_decomposition where status != superseded}
|
|
56
|
+
completed_steps = [{index, skill, stage, completion_summary, completion_decisions}]
|
|
57
|
+
pending_steps = [{index, skill, stage, goal_ref}]
|
|
58
|
+
boundary_contract = {boundary_contract}
|
|
59
|
+
change_request = {change_request}
|
|
60
|
+
EXPECTED:
|
|
61
|
+
---IMPACT---
|
|
62
|
+
CHANGE_TYPE=modify|add|remove|boundary
|
|
63
|
+
AFFECTED_GOALS=[{id, action: modify|supersede|keep, new_goal?, new_done_when?}]
|
|
64
|
+
INVALIDATED_STEPS=[{index, reason}]
|
|
65
|
+
NEW_GAPS=[{goal_id, description, suggested_stages: [analyze|plan|execute|...]}]
|
|
66
|
+
BOUNDARY_CHANGES={in_scope_add:[], out_of_scope_add:[], constraints_add:[]}
|
|
67
|
+
RISK_LEVEL=low|medium|high
|
|
68
|
+
RISK_REASON=...
|
|
69
|
+
---END---
|
|
70
|
+
CONSTRAINTS:
|
|
71
|
+
- 只评估不修改
|
|
72
|
+
- high: 已完成工作与新目标直接冲突
|
|
73
|
+
- medium: 部分 steps 需跳过/重建,已完成工作可保留
|
|
74
|
+
- low: 纯增量,已有工作不受影响"
|
|
75
|
+
--role analyze --mode analysis
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**GATE Phase 3→4**: REQUIRED impact_assessment complete; BLOCKED if delegate output missing
|
|
79
|
+
|
|
80
|
+
## Phase 4 — 确认
|
|
81
|
+
|
|
82
|
+
Display: 影响摘要(risk_level, affected, invalidated, new_gaps)。AskUserQuestion:
|
|
83
|
+
|
|
84
|
+
| label | description |
|
|
85
|
+
|-------|-------------|
|
|
86
|
+
| 应用并继续 | 归档旧目标 → 写入新目标 → 重建链路 → handoff |
|
|
87
|
+
| 仅改目标 | 更新目标,保留链路不变 |
|
|
88
|
+
| 取消 | 无修改 |
|
|
89
|
+
|
|
90
|
+
GUARD: `RISK_LEVEL == high` → auto_confirm 无效
|
|
91
|
+
|
|
92
|
+
## Phase 5 — 应用
|
|
93
|
+
|
|
94
|
+
### 5.1 Changelog entry
|
|
95
|
+
|
|
96
|
+
Append to `session.goal_changelog[]`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"id": "CHG-{NNN}",
|
|
101
|
+
"timestamp": "{ISO}",
|
|
102
|
+
"change_type": "{CHANGE_TYPE}",
|
|
103
|
+
"reason": "{change_request}",
|
|
104
|
+
"impact_assessment": { "risk_level": "...", "invalidated_steps": [...], "new_steps_inserted": 0, "evidence_source": "delegate impact assessment output" },
|
|
105
|
+
"before": { "goals": [{"id":"...","goal":"...","done_when":"..."}] },
|
|
106
|
+
"after": { "goals": [{"id":"...","goal":"...","done_when":"..."}] }
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
`NNN` = `(goal_changelog.length + 1).toString().padStart(3, '0')`
|
|
111
|
+
|
|
112
|
+
**GATE 5.1→5.2**: REQUIRED goal_changelog written; BLOCKED if changelog entry missing
|
|
113
|
+
|
|
114
|
+
### 5.2 归档
|
|
115
|
+
|
|
116
|
+
对 AFFECTED_GOALS 中 `action ∈ {modify, supersede}` 的条目:
|
|
117
|
+
- Set `status: "superseded"`, `superseded_by: "CHG-{NNN}"`, `superseded_at: now`
|
|
118
|
+
- GUARD: `status == "done"` 的目标不可 supersede(skip + warn)
|
|
119
|
+
|
|
120
|
+
### 5.3 写入新目标
|
|
121
|
+
|
|
122
|
+
| action | 处理 |
|
|
123
|
+
|--------|------|
|
|
124
|
+
| `modify` | 新条目 `id: "{original_id}v{version}"`, `origin: "CHG-{NNN}"`, `status: "pending"` |
|
|
125
|
+
| `add` | 新条目 `id: "G{next_num}"`, `origin: "CHG-{NNN}"`, `status: "pending"` |
|
|
126
|
+
| `remove` | 仅 supersede,不新增 |
|
|
127
|
+
| `keep` | 不变 |
|
|
128
|
+
|
|
129
|
+
### 5.4 重建链路
|
|
130
|
+
|
|
131
|
+
GUARD: 用户选"应用并继续"
|
|
132
|
+
|
|
133
|
+
1. INVALIDATED_STEPS 中 pending step → set `status: "skipped"`
|
|
134
|
+
2. NEW_GAPS → 按 `suggested_stages` 插入 steps + decision nodes
|
|
135
|
+
- 按 A_BUILD_STEPS 规则构建(goal_ref + command_path 解析 + command_scope 校验)
|
|
136
|
+
- 插入位置:当前 active step 之后、`post-goal-audit` 之前
|
|
137
|
+
3. 原链路有 `post-goal-audit` → 保留
|
|
138
|
+
4. 原链路无 `post-goal-audit` AND `task_decomposition` 存在 → 在 `milestone-complete` 前插入
|
|
139
|
+
5. Reindex all steps
|
|
140
|
+
|
|
141
|
+
### 5.5 Boundary
|
|
142
|
+
|
|
143
|
+
`BOUNDARY_CHANGES` 非空时:
|
|
144
|
+
- `in_scope_add` → append to `boundary_contract.in_scope`
|
|
145
|
+
- `out_of_scope_add` → append to `boundary_contract.out_of_scope`
|
|
146
|
+
- `constraints_add` → append to `boundary_contract.constraints`
|
|
147
|
+
|
|
148
|
+
### 5.6 Persist + Handoff
|
|
149
|
+
|
|
150
|
+
1. Write status.json
|
|
151
|
+
2. Display:
|
|
152
|
+
```
|
|
153
|
+
◆ Goal amendment: {CHG-NNN}
|
|
154
|
+
{change_type} — {reason}
|
|
155
|
+
Risk: {RISK_LEVEL} | Superseded: {n} | Added: {n} | Skipped steps: {n} | Inserted steps: {n}
|
|
156
|
+
```
|
|
157
|
+
3. Handoff → maestro-ralph-execute(平台适配:Claude 用 `Skill()`,Codex 用 `$` 直调)
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Anchor 呈现规则
|
|
162
|
+
|
|
163
|
+
Goals Overview 输出格式(CLI `buildSessionAnchor` 自动生成):
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
**Goals Overview**:
|
|
167
|
+
- [✓] G1: 实现搜索 API — done_when: 测试通过
|
|
168
|
+
- [superseded] G2: 前端搜索页 → 被 CHG-001 替换
|
|
169
|
+
- [○] G2v2: 前端搜索页+迁移兼容 — done_when: 新旧数据均可检索 (via CHG-001)
|
|
170
|
+
- [○] G3: 旧数据迁移脚本 — done_when: 全量测试通过 (via CHG-001)
|
|
171
|
+
- Course corrections: 1 applied
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
规则:
|
|
175
|
+
- `superseded` 目标 → 单行标注,不展开细节
|
|
176
|
+
- 新目标 → 标注 `(via CHG-xxx)`
|
|
177
|
+
- re-grounding / goal-audit → 仅取 `status != "superseded"`
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Refactor Workflow
|
|
2
|
+
|
|
3
|
+
Reduce tech debt through scope analysis, task planning, and reflection-driven execution. Tests MUST pass after every change.
|
|
4
|
+
|
|
5
|
+
Output: `scratch/{YYYYMMDD}-refactor-{slug}/` with index.json + reflection-log.md + .task/ + .summaries/
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
### Step 1: Parse Scope
|
|
10
|
+
|
|
11
|
+
| Input | Action |
|
|
12
|
+
|-------|--------|
|
|
13
|
+
| Module path (e.g., "src/auth") | Scan that directory |
|
|
14
|
+
| Feature area (e.g., "authentication") | Search for related files |
|
|
15
|
+
| "all" | Full codebase scan |
|
|
16
|
+
| Empty | Prompt user |
|
|
17
|
+
|
|
18
|
+
Generate slug (lowercase, hyphens, max 40 chars). Set date = YYYYMMDD.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### Step 2: Create Scratch Directory
|
|
23
|
+
|
|
24
|
+
Create `REFACTOR_DIR=".workflow/scratch/${date}-refactor-${slug}"` with `.task/` and `.summaries/` subdirs.
|
|
25
|
+
|
|
26
|
+
Write index.json: id, type="refactor", title, status="active", scope, plan (empty task_ids), execution (method=agent, counts=0), reflection (rounds=0).
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### Step 2.5: Load Project Specs
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
specs_content = maestro spec load --category coding
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
### Step 3: Scope Analysis
|
|
39
|
+
|
|
40
|
+
Read all files in scope. Use specs_content to detect convention violations. Categorize:
|
|
41
|
+
|
|
42
|
+
1. **Duplication** - copy-paste patterns
|
|
43
|
+
2. **Complexity** - long functions, deep nesting, high cyclomatic complexity
|
|
44
|
+
3. **Naming** - inconsistent or unclear names
|
|
45
|
+
4. **Dependencies** - circular deps, tight coupling, god objects
|
|
46
|
+
5. **Dead code** - unused functions, unreachable branches
|
|
47
|
+
6. **Pattern violations** - inconsistent with specs/ conventions
|
|
48
|
+
|
|
49
|
+
Present summary table. Confirm with user before planning.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
### Step 4: Plan Refactoring
|
|
54
|
+
|
|
55
|
+
Write plan.json + `.task/TASK-{NNN}.json` per issue (id, title, status=pending, type=refactor, category, files, convergence criteria, risk level).
|
|
56
|
+
|
|
57
|
+
Order: quick wins first, high risk last, dependencies respected.
|
|
58
|
+
|
|
59
|
+
Present plan to user (affected files, risk areas, dependency impacts). Ask: approve / modify / reject.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
### Step 5: Execute with Reflection
|
|
64
|
+
|
|
65
|
+
For each task:
|
|
66
|
+
- **5a.** Implement the change
|
|
67
|
+
- **5b.** Run test suite
|
|
68
|
+
- **5c.** Record in reflection-log.md: strategy, result, test status, adjustment, files changed
|
|
69
|
+
- **5d.** On test failure: revert, retry with adjusted strategy (max 2 retries). Still failing → mark "blocked"
|
|
70
|
+
- **5e.** Update task status, write summary, update index.json
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### Step 6: Final Verification
|
|
75
|
+
|
|
76
|
+
Run full test suite. Record final state in reflection-log.md.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
### Step 7: Complete
|
|
81
|
+
|
|
82
|
+
Glob plan.json AND .summaries/ MUST exist before marking completed; BLOCKED if missing.
|
|
83
|
+
|
|
84
|
+
Update index.json: `status="completed"`.
|
|
85
|
+
|
|
86
|
+
Present: tasks completed/blocked, reflection rounds, strategy adjustments, test status, key learnings. If regressions: list affected tests, suggest quality-debug.
|
|
87
|
+
|