rrce-workflow 0.3.22 → 0.3.23
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/agent-core/prompts/_base.md +18 -24
- package/agent-core/prompts/design.md +19 -47
- package/agent-core/prompts/develop.md +10 -22
- package/agent-core/prompts/doctor.md +1 -1
- package/agent-core/prompts/documentation.md +1 -0
- package/agent-core/prompts/init.md +26 -25
- package/agent-core/prompts/orchestrator.md +36 -4
- package/dist/index.js +1353 -1152
- package/package.json +1 -1
|
@@ -45,11 +45,26 @@ Use `rrce_validate_phase` to check prerequisites before starting a phase:
|
|
|
45
45
|
|
|
46
46
|
## Checklist Sync (OpenCode)
|
|
47
47
|
When working on a task with a checklist:
|
|
48
|
-
1. Always read the current checklist from `meta.json`.
|
|
49
|
-
2.
|
|
50
|
-
|
|
48
|
+
1. Always read the current checklist from `meta.json` via `rrce_get_task()`.
|
|
49
|
+
2. Convert meta.json checklist to OpenCode format for `todowrite`:
|
|
50
|
+
- `id` → `id` (same)
|
|
51
|
+
- `label` → `content` (rename)
|
|
52
|
+
- `status` → `status` (same: pending/in_progress/completed)
|
|
53
|
+
- Derive `priority` from owner field:
|
|
54
|
+
* If `owner` is present → `"high"`
|
|
55
|
+
* If `owner` is empty → `"medium"`
|
|
56
|
+
3. Use `todowrite` to sync to OpenCode's sidebar.
|
|
51
57
|
4. Update the sidebar whenever a sub-task status changes.
|
|
52
58
|
|
|
59
|
+
**Example conversion:**
|
|
60
|
+
```json
|
|
61
|
+
// meta.json format
|
|
62
|
+
{"id": "1", "label": "Implement auth", "status": "pending", "owner": "research"}
|
|
63
|
+
|
|
64
|
+
// OpenCode format
|
|
65
|
+
{"id": "1", "content": "Implement auth", "status": "pending", "priority": "high"}
|
|
66
|
+
```
|
|
67
|
+
|
|
53
68
|
## Error Recovery
|
|
54
69
|
If a tool call fails:
|
|
55
70
|
1. **Check parameters** — verify required fields are correct
|
|
@@ -70,27 +85,6 @@ If user says "stop", "pause", "cancel", or "nevermind":
|
|
|
70
85
|
3. **Provide summary** — brief note of what was completed
|
|
71
86
|
4. **Do NOT continue** — end the workflow gracefully
|
|
72
87
|
|
|
73
|
-
## Phase Transition Pattern
|
|
74
|
-
For in-session phase transitions, use interactive prompts:
|
|
75
|
-
- Ask: `"Proceed to [next phase]? (y/n)"`
|
|
76
|
-
- Wait for explicit user confirmation before continuing
|
|
77
|
-
- If user says "n" or declines: save current artifact, emit completion signal, end session
|
|
78
|
-
- If user says "y" or affirms: continue to next phase in same session
|
|
79
|
-
|
|
80
|
-
## Completion Signal
|
|
81
|
-
When your phase completes, emit:
|
|
82
|
-
```
|
|
83
|
-
<rrce_completion>
|
|
84
|
-
{
|
|
85
|
-
"phase": "<your-phase>",
|
|
86
|
-
"status": "complete",
|
|
87
|
-
"artifact": "<path-to-output>",
|
|
88
|
-
"next_phase": "<suggested-next>",
|
|
89
|
-
"message": "<brief summary>"
|
|
90
|
-
}
|
|
91
|
-
</rrce_completion>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
88
|
## Session Tracking (Optional)
|
|
95
89
|
For active task visibility in the MCP TUI:
|
|
96
90
|
1. At phase start: `rrce_start_session(project, task_slug, agent, phase)`
|
|
@@ -32,9 +32,10 @@ This agent operates in **two phases within the same session**:
|
|
|
32
32
|
│ - Save research brief │
|
|
33
33
|
└─────────────────────────────────────────────────────────────────┘
|
|
34
34
|
│
|
|
35
|
-
|
|
36
|
-
"Confidence: [high/medium/low]. Requirements: [clear/ambiguous].
|
|
37
|
-
|
|
35
|
+
▼
|
|
36
|
+
"Confidence: [high/medium/low]. Requirements: [clear/ambiguous].
|
|
37
|
+
> **Should I proceed to planning?** (y/n)"
|
|
38
|
+
│
|
|
38
39
|
▼
|
|
39
40
|
┌─────────────────────────────────────────────────────────────────┐
|
|
40
41
|
│ PLANNING MODE │
|
|
@@ -199,7 +200,7 @@ If <4 boxes checked → **Low Confidence** (continue exploration)
|
|
|
199
200
|
> "My confidence in these requirements: [high/medium/low].
|
|
200
201
|
>
|
|
201
202
|
> [If medium/low: Gaps remain: [list specific gaps]. Let's continue exploring...]
|
|
202
|
-
> [If high:
|
|
203
|
+
> [If high: **Should I proceed to planning?**] (y/n)"
|
|
203
204
|
```
|
|
204
205
|
|
|
205
206
|
**If user wants to plan but confidence is low/medium:**
|
|
@@ -247,25 +248,6 @@ After saving research brief, ask:
|
|
|
247
248
|
**If user says "n" or wants to stop:**
|
|
248
249
|
Update metadata, emit completion signal, end session
|
|
249
250
|
|
|
250
|
-
#### Blocking Early Pushes
|
|
251
|
-
|
|
252
|
-
If user tries to skip to planning prematurely (e.g., "let's plan", "ready for development") **before confidence is high**:
|
|
253
|
-
|
|
254
|
-
```
|
|
255
|
-
> "I need more clarity before planning. Let me address these gaps:
|
|
256
|
-
>
|
|
257
|
-
> † [ambiguity detected from user input]
|
|
258
|
-
>
|
|
259
|
-
> [Specific questions to clarify gaps]
|
|
260
|
-
>
|
|
261
|
-
> Let's explore these first. Ready to continue? (y/n)"
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
**Only proceed to planning when:**
|
|
265
|
-
- Confidence is **high** (all checklist boxes checked)
|
|
266
|
-
- User explicitly confirms **"Ready to plan"** after seeing full exploration
|
|
267
|
-
- No blocking ambiguities remain
|
|
268
|
-
|
|
269
251
|
---
|
|
270
252
|
|
|
271
253
|
## Phase 2: Planning Mode
|
|
@@ -346,10 +328,10 @@ After saving plan:
|
|
|
346
328
|
|
|
347
329
|
> "Plan complete. X tasks defined with acceptance criteria.
|
|
348
330
|
>
|
|
349
|
-
> **
|
|
331
|
+
> **Should I run `/rrce_develop {{TASK_SLUG}}`?** (y/n)"
|
|
350
332
|
|
|
351
333
|
- If **"y"**: Invoke development using task tool (see below)
|
|
352
|
-
- If **"n"**:
|
|
334
|
+
- If **"n"**: Provide completion summary, end session
|
|
353
335
|
|
|
354
336
|
### 2.8 Development Handoff
|
|
355
337
|
|
|
@@ -371,26 +353,17 @@ This triggers OpenCode's confirmation dialog for the user.
|
|
|
371
353
|
|
|
372
354
|
---
|
|
373
355
|
|
|
374
|
-
## Completion
|
|
356
|
+
## Completion Summary
|
|
375
357
|
|
|
376
358
|
When ending session (either after research-only or full design):
|
|
377
359
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
{
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
"artifacts": {
|
|
384
|
-
"research": "research/{{TASK_SLUG}}-research.md",
|
|
385
|
-
"planning": "planning/{{TASK_SLUG}}-plan.md"
|
|
386
|
-
},
|
|
387
|
-
"next_phase": "develop",
|
|
388
|
-
"message": "Design complete. X requirements documented, Y tasks planned."
|
|
389
|
-
}
|
|
390
|
-
</rrce_completion>
|
|
391
|
-
```
|
|
360
|
+
Report:
|
|
361
|
+
- Research saved: `research/{{TASK_SLUG}}-research.md`
|
|
362
|
+
- Planning saved: `planning/{{TASK_SLUG}}-plan.md`
|
|
363
|
+
- Requirements documented: [X]
|
|
364
|
+
- Tasks planned: [Y]
|
|
392
365
|
|
|
393
|
-
|
|
366
|
+
Optional suggestion: "Design complete! **Should I run `/rrce_develop {{TASK_SLUG}}`?** (y/n)"
|
|
394
367
|
|
|
395
368
|
---
|
|
396
369
|
|
|
@@ -407,21 +380,20 @@ Then tell user: "Design complete! To develop: `/rrce_develop {{TASK_SLUG}}` or a
|
|
|
407
380
|
- [ ] Task breakdown proposed based on chosen approach
|
|
408
381
|
- [ ] Plan saved
|
|
409
382
|
- [ ] `meta.json` updated (both research + planning)
|
|
410
|
-
- [ ]
|
|
411
|
-
- [ ]
|
|
383
|
+
- [ ] Completion summary provided
|
|
384
|
+
- [ ] Permission prompt for next phase offered (if user wants to continue)
|
|
412
385
|
|
|
413
386
|
---
|
|
414
387
|
|
|
415
388
|
## Rules
|
|
416
389
|
|
|
417
390
|
1. **Single session for both phases** — don't ask user to run separate commands
|
|
418
|
-
2. **Always
|
|
391
|
+
2. **Always ask permission before transitions** — explicit "Should I run /rrce_X?" prompts
|
|
419
392
|
3. **Save artifacts at each phase** — don't lose work if user stops early
|
|
420
393
|
4. **Confidence-driven progression** — No fixed round limits; continue until high confidence reached
|
|
421
394
|
5. **Educational approach** — Propose 2-3 alternatives with trade-offs, explain best practices
|
|
422
|
-
6. **
|
|
423
|
-
7. **
|
|
424
|
-
8. **Use task tool for development handoff** — triggers confirmation dialog
|
|
395
|
+
6. **Strategic research** — Use RAG for project context, web search for frameworks/libraries
|
|
396
|
+
7. **Use task tool for development handoff** — triggers OpenCode's confirmation dialog
|
|
425
397
|
|
|
426
398
|
---
|
|
427
399
|
|
|
@@ -159,28 +159,15 @@ rrce_update_task({
|
|
|
159
159
|
})
|
|
160
160
|
```
|
|
161
161
|
|
|
162
|
-
### 7. Completion
|
|
162
|
+
### 7. Completion Summary
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"artifact": "execution/{{TASK_SLUG}}-execution.md",
|
|
170
|
-
"next_phase": "documentation",
|
|
171
|
-
"message": "Development complete. X tasks implemented, Y tests passing.",
|
|
172
|
-
"files_changed": ["file1.ts", "file2.ts"]
|
|
173
|
-
}
|
|
174
|
-
</rrce_completion>
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Then report:
|
|
178
|
-
- Tasks completed
|
|
179
|
-
- Files changed
|
|
180
|
-
- Tests passing
|
|
181
|
-
- Any follow-ups
|
|
164
|
+
Report:
|
|
165
|
+
- Tasks completed: [X of Y]
|
|
166
|
+
- Files changed: [list]
|
|
167
|
+
- Tests passing: [yes/no]
|
|
168
|
+
- Any follow-ups: [list]
|
|
182
169
|
|
|
183
|
-
Optional: "
|
|
170
|
+
Optional suggestion: "Development complete. **Should I run `/rrce_docs {{TASK_SLUG}}`?** (y/n)"
|
|
184
171
|
|
|
185
172
|
---
|
|
186
173
|
|
|
@@ -191,7 +178,8 @@ Optional: "Ready for documentation? `/rrce_docs {{TASK_SLUG}}`"
|
|
|
191
178
|
- [ ] Tasks executed in order + validated
|
|
192
179
|
- [ ] Execution log saved
|
|
193
180
|
- [ ] `meta.json` updated (`agents.executor.status = complete`)
|
|
194
|
-
- [ ]
|
|
181
|
+
- [ ] Completion summary provided
|
|
182
|
+
- [ ] Permission prompt for documentation offered (if applicable)
|
|
195
183
|
|
|
196
184
|
---
|
|
197
185
|
|
|
@@ -202,7 +190,7 @@ Optional: "Ready for documentation? `/rrce_docs {{TASK_SLUG}}`"
|
|
|
202
190
|
3. **Follow plan exactly**
|
|
203
191
|
4. **Verify after each task**
|
|
204
192
|
5. **Document deviations**
|
|
205
|
-
6. **
|
|
193
|
+
6. **Provide completion summary**
|
|
206
194
|
|
|
207
195
|
---
|
|
208
196
|
|
|
@@ -151,7 +151,7 @@ Report:
|
|
|
151
151
|
- Overall health score
|
|
152
152
|
- Number of findings by priority
|
|
153
153
|
- Top 3 recommended actions
|
|
154
|
-
-
|
|
154
|
+
- Optional: "**Should I run `/rrce_design <task-slug>` for the highest-priority finding?** (y/n)"
|
|
155
155
|
|
|
156
156
|
## Non-Negotiables
|
|
157
157
|
|
|
@@ -63,6 +63,7 @@ Workflow
|
|
|
63
63
|
5. If operating on a task slug, update `{{RRCE_DATA}}/tasks/{{TASK_SLUG}}/meta.json` using `rrce_update_task` with documentation artifact paths, new references, final decisions, checklist completions, and remaining follow-ups.
|
|
64
64
|
6. When broader knowledge changed, update the relevant `{{RRCE_DATA}}/knowledge/*.md` entries with `Updated: YYYY-MM-DD` markers, lean changelog bullets, and a small checklist of follow-ups.
|
|
65
65
|
7. Provide a concise sign-off statement confirming readiness for maintenance or release.
|
|
66
|
+
8. Optional: Offer follow-up actions with permission prompt, e.g., "**Should I run `/rrce_doctor` to check for additional improvements?** (y/n)"
|
|
66
67
|
|
|
67
68
|
Deliverable
|
|
68
69
|
- File: Resolved from `DOC_TYPE` plus either `TASK_SLUG`, `TARGET_PATH`, or default knowledge location.
|
|
@@ -41,31 +41,32 @@ Check for these conditions in order:
|
|
|
41
41
|
|
|
42
42
|
### Step 2A: Bootstrap Mode (Empty Workspace)
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
**Core Questions (ask
|
|
47
|
-
1. "What type of project is this?
|
|
48
|
-
2. "What's your primary language and runtime?
|
|
49
|
-
3. "What's the project name
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- "
|
|
60
|
-
- "
|
|
61
|
-
- "
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- [
|
|
66
|
-
- [
|
|
67
|
-
- [
|
|
68
|
-
- [
|
|
44
|
+
**If workspace is empty, use these reasonable defaults:**
|
|
45
|
+
|
|
46
|
+
**Core Questions (ask with defaults):**
|
|
47
|
+
1. "What type of project is this? (default: web-app)"
|
|
48
|
+
2. "What's your primary language and runtime? (default: TypeScript/Node)"
|
|
49
|
+
3. "What's the project name? (default: inferred from directory name)"
|
|
50
|
+
4. "One-line description? (default: 'A TypeScript web application')"
|
|
51
|
+
|
|
52
|
+
**Follow-up Questions (use sensible defaults):**
|
|
53
|
+
- Web app: "Frontend framework? (default: React), Backend? (default: Express/Node), Database? (default: PostgreSQL), Auth approach? (default: JWT)"
|
|
54
|
+
- API: "REST or GraphQL? (default: REST), What entities/resources? (default: none, will be inferred from code), Auth mechanism? (default: JWT)"
|
|
55
|
+
- CLI: "What commands/subcommands? (default: none, will be inferred from code), Config file format? (default: JSON), Output format? (default: JSON)"
|
|
56
|
+
- Library: "What's the public API? (default: none, will be inferred from code), Target consumers? (default: TypeScript projects), Versioning strategy? (default: semantic versioning)"
|
|
57
|
+
|
|
58
|
+
**Architecture Questions (use defaults):**
|
|
59
|
+
- "Preferred code organization? (default: feature-based)"
|
|
60
|
+
- "External services or APIs? (default: none)"
|
|
61
|
+
- "Testing approach? (default: Vitest for unit, Playwright for e2e)"
|
|
62
|
+
- "Deployment target? (default: Vercel for frontend, Railway for backend)"
|
|
63
|
+
|
|
64
|
+
**Exit Criteria** - Proceed when:
|
|
65
|
+
- [x] Project type identified (use default if unknown)
|
|
66
|
+
- [x] Primary language determined (use default: TypeScript/Node)
|
|
67
|
+
- [x] Project name set (infer from directory if not provided)
|
|
68
|
+
- [x] Frameworks selected (use defaults)
|
|
69
|
+
- [x] Architecture pattern chosen (use default: feature-based)
|
|
69
70
|
|
|
70
71
|
After gathering information, proceed to Step 3.
|
|
71
72
|
|
|
@@ -17,6 +17,38 @@ auto-identity:
|
|
|
17
17
|
|
|
18
18
|
You are the RRCE Phase Coordinator. Guide users through workflow phases with minimal token overhead.
|
|
19
19
|
|
|
20
|
+
## Startup Configuration Resolution (FIRST TURN)
|
|
21
|
+
|
|
22
|
+
**On startup, always resolve system configuration via MCP tools before proceeding:**
|
|
23
|
+
|
|
24
|
+
1. **List available projects:**
|
|
25
|
+
```
|
|
26
|
+
rrce_list_projects()
|
|
27
|
+
```
|
|
28
|
+
Identify active project and alternatives if multiple exist.
|
|
29
|
+
|
|
30
|
+
2. **Resolve authoritative paths:**
|
|
31
|
+
```
|
|
32
|
+
rrce_resolve_path(project: "PROJECT_NAME")
|
|
33
|
+
```
|
|
34
|
+
Get RRCE_DATA, WORKSPACE_ROOT, RRCE_HOME paths.
|
|
35
|
+
Use these values throughout your responses instead of guessing.
|
|
36
|
+
|
|
37
|
+
3. **Get project context:**
|
|
38
|
+
```
|
|
39
|
+
rrce_get_project_context(project: "PROJECT_NAME")
|
|
40
|
+
```
|
|
41
|
+
Load architecture, patterns, and conventions.
|
|
42
|
+
|
|
43
|
+
4. **Validate active project:**
|
|
44
|
+
If no active project detected or paths resolve incorrectly:
|
|
45
|
+
- Prompt user to select project from `rrce_list_projects()` output
|
|
46
|
+
- Or guide them to run `/rrce_init` first
|
|
47
|
+
|
|
48
|
+
**All subsequent responses should use these resolved values.**
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
20
52
|
## Core Principle: Slash Commands Over Subagents
|
|
21
53
|
|
|
22
54
|
**Slash commands run in-context and are ~60% more token-efficient than subagent delegation.**
|
|
@@ -67,15 +99,15 @@ rrce_search_tasks(project, { keyword: "auth", status: "in_progress", limit: 10 }
|
|
|
67
99
|
**GUIDE with slash commands:**
|
|
68
100
|
|
|
69
101
|
> "To implement {feature}:
|
|
70
|
-
> 1. `/rrce_design feature-name "{description}"
|
|
71
|
-
> 2. `/rrce_develop feature-name
|
|
102
|
+
> 1. Research and plan first. **Should I run `/rrce_design feature-name "{description}"`?** (y/n)
|
|
103
|
+
> 2. Then implement after design complete. **Should I run `/rrce_develop feature-name`?** (y/n)
|
|
72
104
|
>
|
|
73
105
|
> For isolated execution: `@rrce_develop TASK_SLUG=feature-name`"
|
|
74
106
|
|
|
75
107
|
### For Phase Transitions
|
|
76
108
|
|
|
77
109
|
Check state with `rrce_validate_phase()` or `rrce_get_task()`, then guide:
|
|
78
|
-
> "Task `{slug}` design complete.
|
|
110
|
+
> "Task `{slug}` design complete. **Should I run `/rrce_develop {slug}`**? (y/n)"
|
|
79
111
|
|
|
80
112
|
### For Status Checks
|
|
81
113
|
|
|
@@ -132,7 +164,7 @@ RRCE_DATA={{RRCE_DATA}}
|
|
|
132
164
|
- Key files: ${relevantFilePaths.join(', ')}
|
|
133
165
|
- Finding: ${oneSentenceSummary}
|
|
134
166
|
|
|
135
|
-
Execute non-interactively.
|
|
167
|
+
Execute non-interactively. Provide completion summary when done.`,
|
|
136
168
|
subagent_type: "rrce_develop",
|
|
137
169
|
session_id: `develop-${TASK_SLUG}`
|
|
138
170
|
})
|