ralph-teams-codex 1.5.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/AGENTS.md +6 -0
- package/FLOW.md +47 -0
- package/README.md +157 -0
- package/agents/teams-builder.md +74 -0
- package/agents/teams-reviewer.md +109 -0
- package/bin/ralph-teams-codex.js +152 -0
- package/package.json +20 -0
- package/skills/debug/SKILL.md +156 -0
- package/skills/teams-document/SKILL.md +107 -0
- package/skills/teams-plan/SKILL.md +250 -0
- package/skills/teams-run/SKILL.md +167 -0
- package/skills/teams-verify/SKILL.md +162 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teams-debug
|
|
3
|
+
description: "Fix any bug related to an active Teams plan. Can be triggered by the user at any time or automatically from teams-verify on failure. Reads PLAN.md, VERIFY.md, and REVIEW.md for context, then spawns a targeted builder to fix the issue."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teams: Debug
|
|
8
|
+
|
|
9
|
+
Fix a bug related to the current Teams plan. This skill can be triggered:
|
|
10
|
+
- **By the user at any time** — e.g. "something's broken, use `teams-debug`"
|
|
11
|
+
- **Automatically from `teams-verify`** — when a scenario fails during manual verification
|
|
12
|
+
|
|
13
|
+
It reads the existing plan and any available verification/review reports to understand context before fixing.
|
|
14
|
+
|
|
15
|
+
**Prerequisite:** `.ralph-teams/PLAN.md` must exist. If not found, stop and tell the user to run `teams-plan` first.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Step 1: Load Context
|
|
20
|
+
|
|
21
|
+
Check that `.ralph-teams/PLAN.md` exists. If not:
|
|
22
|
+
> `.ralph-teams/PLAN.md` not found. This skill requires an active Teams plan. Run `teams-plan` first.
|
|
23
|
+
|
|
24
|
+
Read all available context files:
|
|
25
|
+
- `.ralph-teams/PLAN.md` — the feature plan (note its `Plan ID:` field)
|
|
26
|
+
- `.ralph-teams/VERIFY.md` — if it exists, the manual verification report with failed scenarios
|
|
27
|
+
- `.ralph-teams/REVIEW.md` — if it exists, the automated review findings
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Step 2: Identify the Bug
|
|
32
|
+
|
|
33
|
+
If the user described the bug when invoking this skill, use that description.
|
|
34
|
+
|
|
35
|
+
Otherwise, ask:
|
|
36
|
+
|
|
37
|
+
> **What's the bug?**
|
|
38
|
+
>
|
|
39
|
+
> Describe what went wrong, what you expected, and what you saw. Include the scenario name if it came from `teams-verify`.
|
|
40
|
+
|
|
41
|
+
Wait for their response.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 3: Confirm Scope
|
|
46
|
+
|
|
47
|
+
Summarize your understanding back to the user:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
51
|
+
RALPH-TEAMS Plan #[N] — Bug report
|
|
52
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
53
|
+
Feature: [feature name from PLAN.md]
|
|
54
|
+
Bug: [one-line summary]
|
|
55
|
+
Related: [phase(s)/task(s) or scenario(s) from the plan]
|
|
56
|
+
Criteria: [affected acceptance criteria, if any]
|
|
57
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Ask:
|
|
61
|
+
> **Correct? Reply `yes` to fix, or clarify what I got wrong.**
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Step 4: Spawn a Fix Builder
|
|
66
|
+
|
|
67
|
+
When confirmed, spawn a builder subagent:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
spawn_agent(
|
|
71
|
+
agent_type: "worker",
|
|
72
|
+
model: "gpt-5.4-mini",
|
|
73
|
+
message: "You are fixing a bug found during manual verification of a completed feature.
|
|
74
|
+
|
|
75
|
+
Bug report:
|
|
76
|
+
[user's bug description]
|
|
77
|
+
|
|
78
|
+
Feature plan (.ralph-teams/PLAN.md):
|
|
79
|
+
[paste full PLAN.md content]
|
|
80
|
+
|
|
81
|
+
[If VERIFY.md exists:]
|
|
82
|
+
Verification report (.ralph-teams/VERIFY.md):
|
|
83
|
+
[paste VERIFY.md content]
|
|
84
|
+
|
|
85
|
+
[If REVIEW.md exists:]
|
|
86
|
+
Review findings (.ralph-teams/REVIEW.md):
|
|
87
|
+
[paste REVIEW.md content]
|
|
88
|
+
|
|
89
|
+
Instructions:
|
|
90
|
+
- Investigate the root cause of the bug before making changes
|
|
91
|
+
- Fix only what is broken — do not refactor unrelated code
|
|
92
|
+
- Platform: [web|mobile from PLAN.md]
|
|
93
|
+
- Verify the fix using [Playwright|Maestro] after applying it
|
|
94
|
+
- If verification tools are not available, run tests/lint instead
|
|
95
|
+
- Commit with message: 'fix: [short description of the bug fixed]'"
|
|
96
|
+
)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Print while the builder runs:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
103
|
+
RALPH-TEAMS Plan #[N] — Fixing bug...
|
|
104
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Wait for the builder with `wait_agent`. After you have handled the result, call `close_agent`.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Step 5: Update Verification Report
|
|
112
|
+
|
|
113
|
+
After the builder completes, if `.ralph-teams/VERIFY.md` exists, update the relevant scenario's status from `FAIL` to `FIXED`:
|
|
114
|
+
|
|
115
|
+
```markdown
|
|
116
|
+
### ✓ Scenario N: [Name]
|
|
117
|
+
Status: FIXED
|
|
118
|
+
Fix applied: [commit message or brief description]
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Step 5b: Update Review Report
|
|
124
|
+
|
|
125
|
+
If `.ralph-teams/REVIEW.md` exists, append a fix summary section at the bottom:
|
|
126
|
+
|
|
127
|
+
```markdown
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Fix Applied
|
|
131
|
+
|
|
132
|
+
**Bug:** [one-line bug summary]
|
|
133
|
+
**Fix:** [brief description of what was changed]
|
|
134
|
+
**Commit:** [commit message]
|
|
135
|
+
**Status:** Resolved
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
If the REVIEW.md already has findings related to this bug, update the relevant finding's status to `Resolved` inline as well.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Step 6: Done
|
|
143
|
+
|
|
144
|
+
Print:
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
148
|
+
RALPH-TEAMS Plan #[N] — Fix applied
|
|
149
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
150
|
+
Bug: [summary]
|
|
151
|
+
Status: Fixed + committed
|
|
152
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Then ask:
|
|
156
|
+
> **Want to re-verify this scenario? Run `teams-verify` to continue from where you left off.**
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teams-document
|
|
3
|
+
description: "Update existing project docs (README.md, ARCHITECTURE.md, etc.) and the active plan file to reflect the latest build. Spawns a lightweight scribe agent to find and update relevant documentation files and ensure the plan is accurate."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teams: Document
|
|
8
|
+
|
|
9
|
+
Update existing project documentation to reflect what was built in the current plan. Spawns a scribe agent that finds relevant docs and updates them — no new files created unless explicitly needed.
|
|
10
|
+
|
|
11
|
+
**Prerequisite:** `.ralph-teams/PLAN.md` must exist. If not found, stop:
|
|
12
|
+
> `.ralph-teams/PLAN.md` not found. Run `teams-plan` first.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Step 1: Load Context
|
|
17
|
+
|
|
18
|
+
Read:
|
|
19
|
+
- `.ralph-teams/PLAN.md` — plan ID, feature name, tasks completed, acceptance criteria
|
|
20
|
+
- `.ralph-teams/REVIEW.md` — if it exists, for additional context on what was changed
|
|
21
|
+
- Run `git log --oneline` to identify recent commits from the build
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Step 2: Confirm Scope
|
|
26
|
+
|
|
27
|
+
Show the user what will be updated:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
31
|
+
RALPH-TEAMS Plan #[N] — [Feature Name]
|
|
32
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
33
|
+
Scribe will scan for and update:
|
|
34
|
+
• .ralph-teams/PLAN.md (verify phase statuses + overall status)
|
|
35
|
+
• README.md
|
|
36
|
+
• ARCHITECTURE.md
|
|
37
|
+
• docs/**
|
|
38
|
+
• Any other relevant docs found
|
|
39
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Ask:
|
|
43
|
+
> **Anything to skip or add? Reply `go` to start, or tell me what to adjust.**
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Step 3: Spawn the Scribe
|
|
48
|
+
|
|
49
|
+
When confirmed, spawn a scribe agent:
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
spawn_agent(
|
|
53
|
+
agent_type: "worker",
|
|
54
|
+
model: "gpt-5.4-mini",
|
|
55
|
+
message: "You are a documentation scribe. Your job is to update existing project documentation to reflect recent changes — not to create new files.
|
|
56
|
+
|
|
57
|
+
Plan ID: #[N]
|
|
58
|
+
Feature: [feature name]
|
|
59
|
+
|
|
60
|
+
Phases completed:
|
|
61
|
+
[paste phase list from .ralph-teams/PLAN.md]
|
|
62
|
+
|
|
63
|
+
Acceptance criteria:
|
|
64
|
+
[paste acceptance criteria from .ralph-teams/PLAN.md]
|
|
65
|
+
|
|
66
|
+
Instructions:
|
|
67
|
+
1. Update `.ralph-teams/PLAN.md` first:
|
|
68
|
+
- Run `git log --oneline` to verify which phases were actually committed.
|
|
69
|
+
- Ensure each phase checkbox matches reality: `[x]` if committed, `[!]` if it failed, `[ ]` if not started.
|
|
70
|
+
- Update the top-level `Status:` field to reflect the current state (e.g., `complete`, `in-progress`).
|
|
71
|
+
2. Find all existing documentation files: README.md, ARCHITECTURE.md, docs/**, CHANGELOG.md, or any other .md files that describe the project.
|
|
72
|
+
3. For each relevant file, update only the sections affected by the completed phases — do not rewrite unrelated content.
|
|
73
|
+
4. Keep changes minimal and accurate. Only document what was actually built.
|
|
74
|
+
5. Do NOT create new documentation files unless one is completely missing and clearly expected (e.g., no README.md at all).
|
|
75
|
+
6. After updating, commit all changes with message: 'docs: update docs for Plan #[N] — [feature name]'
|
|
76
|
+
|
|
77
|
+
What to update (examples):
|
|
78
|
+
- README: feature descriptions, usage instructions, setup steps
|
|
79
|
+
- ARCHITECTURE.md: new components, changed data flows, updated diagrams descriptions
|
|
80
|
+
- CHANGELOG.md: add an entry for this feature
|
|
81
|
+
- API docs: new or changed endpoints"
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Print while running:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
89
|
+
RALPH-TEAMS Plan #[N] — Updating docs...
|
|
90
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Wait for the scribe with `wait_agent`. After you have captured the list of updated files and any commit details you need, call `close_agent`.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Step 4: Done
|
|
98
|
+
|
|
99
|
+
After the scribe completes, print:
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
103
|
+
RALPH-TEAMS Plan #[N] — Docs updated
|
|
104
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
105
|
+
[list of files updated by the scribe]
|
|
106
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
107
|
+
```
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teams-plan
|
|
3
|
+
description: "Plan and build a feature. Orchestrate a plan, spawn sequential builder subagents per phase with Playwright or Maestro verification, then run a reviewer and a fix pass if needed."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teams: Plan + Build
|
|
8
|
+
|
|
9
|
+
You are the planner and orchestrator. Your job: discuss the feature, create a plan, execute it with sequential builder subagents, review the result with a reviewer, and apply fixes.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Step 1: Discuss + Plan
|
|
14
|
+
|
|
15
|
+
Ask: **"What do you want to build?"**
|
|
16
|
+
|
|
17
|
+
Discuss with the user. Identify the target platform: **web** or **mobile** (this determines whether the builder uses Playwright or Maestro for verification).
|
|
18
|
+
|
|
19
|
+
**Phase sizing:** Each phase runs in its own builder agent with a 200k token context window. A well-sized phase should fill **50–60% of that context** — meaning the builder will read, write, and reason about enough code that it uses roughly half its available context doing the work. Phases contain tasks (concrete steps the builder follows).
|
|
20
|
+
- **Too small:** a phase that takes only a few minutes or touches one file — merge it into a related phase or make it a task within a larger phase.
|
|
21
|
+
- **Too big:** a phase whose tasks collectively require more code than fits in one builder session — split it into two phases.
|
|
22
|
+
- **Right size:** "Implement full auth system" (tasks: user model + DB migration, signup/login endpoints, JWT middleware + refresh tokens, password reset flow, email verification, auth guards on all protected routes, unit + integration tests), "Build product catalog" (tasks: product model + seed data, list page with filters + pagination, detail page, search endpoint, cart integration, component tests).
|
|
23
|
+
|
|
24
|
+
> **Rule of thumb:** a phase = one meaningful feature area with enough depth to keep a builder busy for a substantial session. Tasks = the concrete steps the builder takes to complete it. Aim for 4–8 tasks per phase. When in doubt, make phases larger rather than smaller.
|
|
25
|
+
|
|
26
|
+
**Phase complexity:** For each phase, assign a complexity level — this determines which model the builder uses:
|
|
27
|
+
- `simple` → `gpt-5.4-mini`: truly trivial phases only — renaming, copy changes, config tweaks, adding a single field
|
|
28
|
+
- `standard` → `gpt-5.4`: everything else — the default for any phase with real logic, UI, CRUD, auth, migrations, architecture, etc.
|
|
29
|
+
|
|
30
|
+
**Prepare the build directory:**
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
mkdir -p ralph-teams
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Determine the plan number:**
|
|
37
|
+
- Check for existing plan files: `.ralph-teams/PLAN-*.md`
|
|
38
|
+
- Count existing files to determine N (next plan number = count + 1)
|
|
39
|
+
- If plans exist, inform the user:
|
|
40
|
+
> **Found [N-1] existing plan(s). Creating Plan #[N]. Use `teams-run` to resume an existing plan.**
|
|
41
|
+
- If no existing plans: plan number = 1
|
|
42
|
+
|
|
43
|
+
Write `.ralph-teams/PLAN-[N].md`:
|
|
44
|
+
|
|
45
|
+
```markdown
|
|
46
|
+
# Plan #[N]: [Feature Name]
|
|
47
|
+
|
|
48
|
+
Plan ID: #[N]
|
|
49
|
+
Generated: [date]
|
|
50
|
+
Platform: web | mobile
|
|
51
|
+
Status: draft
|
|
52
|
+
|
|
53
|
+
## Phases
|
|
54
|
+
1. [ ] Phase 1: [Description] — complexity: simple
|
|
55
|
+
- [Task 1 description]
|
|
56
|
+
- [Task 2 description]
|
|
57
|
+
2. [ ] Phase 2: [Description] — complexity: standard
|
|
58
|
+
- [Task 1 description]
|
|
59
|
+
- [Task 2 description]
|
|
60
|
+
- [Task 3 description]
|
|
61
|
+
3. [ ] Phase 3: [Description] — complexity: standard
|
|
62
|
+
- [Task 1 description]
|
|
63
|
+
- [Task 2 description]
|
|
64
|
+
|
|
65
|
+
## Acceptance Criteria
|
|
66
|
+
- [Criterion 1]
|
|
67
|
+
- [Criterion 2]
|
|
68
|
+
|
|
69
|
+
## Verification
|
|
70
|
+
Tool: Playwright | Maestro
|
|
71
|
+
Scenarios:
|
|
72
|
+
- [Scenario 1: name — steps — expected result]
|
|
73
|
+
- [Scenario 2: name — steps — expected result]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Step 2: Optional Plan Review
|
|
79
|
+
|
|
80
|
+
After writing the draft plan, ask the user:
|
|
81
|
+
|
|
82
|
+
> **"Would you like another AI agent to review this plan for completeness and edge cases? (Recommended: Yes)"**
|
|
83
|
+
|
|
84
|
+
If **yes**:
|
|
85
|
+
1. **Check for a second-opinion coding CLI:** Look for an available tool such as `mcp__Multi_CLI__Ask_Claude`, `mcp__Multi_CLI__Ask_Gemini`, or `mcp__Multi_CLI__Ask_OpenCode`.
|
|
86
|
+
- If available: read `.ralph-teams/PLAN-[N].md` and call that tool with the prompt: *"Review this implementation plan. Identify missing phases, edge cases, or architectural gaps. Be concise."*
|
|
87
|
+
- If not available: use `spawn_agent` to start a reviewer subagent and prompt it to review `.ralph-teams/PLAN-[N].md` for completeness, edge cases, and architectural gaps. After `wait_agent` returns and you have incorporated the feedback, call `close_agent`.
|
|
88
|
+
2. Evaluate the feedback. Incorporate valid findings into `.ralph-teams/PLAN-[N].md`.
|
|
89
|
+
3. Briefly tell the user what changed.
|
|
90
|
+
|
|
91
|
+
If **no**: skip to Step 3.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Step 3: Get Approval
|
|
96
|
+
|
|
97
|
+
Display `.ralph-teams/PLAN-[N].md` and ask:
|
|
98
|
+
|
|
99
|
+
> **"Plan looks good? Reply `yes` to start, or tell me what to change."**
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Step 4: Execute — Sequential Builder Subagents
|
|
104
|
+
|
|
105
|
+
When approved:
|
|
106
|
+
|
|
107
|
+
1. Update `.ralph-teams/PLAN-[N].md` status to `approved`.
|
|
108
|
+
2. Capture the base commit SHA before building starts:
|
|
109
|
+
```bash
|
|
110
|
+
git rev-parse HEAD
|
|
111
|
+
```
|
|
112
|
+
Save this as `BASE_SHA` — you will pass it to the reviewer later.
|
|
113
|
+
3. Print:
|
|
114
|
+
```
|
|
115
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
116
|
+
RALPH-TEAMS Plan #[N] — Starting build...
|
|
117
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
For **each phase in order**, use `spawn_agent` to start a builder subagent. Pick the model from the phase's complexity annotation:
|
|
121
|
+
- `complexity: simple` → `model: "gpt-5.4-mini"`
|
|
122
|
+
- `complexity: standard` → `model: "gpt-5.4"`
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
spawn_agent(
|
|
126
|
+
agent_type: "worker",
|
|
127
|
+
model: "[gpt-5.4-mini | gpt-5.4 based on phase complexity]",
|
|
128
|
+
message: "You are implementing Phase [N] of [M]: [phase description].
|
|
129
|
+
|
|
130
|
+
Tasks to complete:
|
|
131
|
+
[list tasks from the phase]
|
|
132
|
+
|
|
133
|
+
Platform: [web|mobile]
|
|
134
|
+
|
|
135
|
+
Full plan:
|
|
136
|
+
[paste .ralph-teams/PLAN-[N].md content]
|
|
137
|
+
|
|
138
|
+
Your assignment: implement Phase [N] only, completing all its tasks. Verify it works using [Playwright|Maestro], then commit.
|
|
139
|
+
If [Playwright|Maestro] tools are not available, run tests/lint instead and note that E2E verification was skipped."
|
|
140
|
+
)
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Wait for the subagent with `wait_agent` before starting the next. As soon as you have recorded the result, call `close_agent` for that finished builder. After each phase, update `.ralph-teams/PLAN-[N].md` (change `[ ]` to `[x]` on success, `[!]` on failure) and print the phase board:
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
147
|
+
RALPH-TEAMS [N of M phases complete]
|
|
148
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
149
|
+
✓ Phase 1: Project Setup [done] (mini)
|
|
150
|
+
► Phase 2: Auth System [building...] (5.4)
|
|
151
|
+
○ Phase 3: API Routes [pending] (mini)
|
|
152
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Status symbols:
|
|
156
|
+
- `✓` — completed
|
|
157
|
+
- `►` — in progress
|
|
158
|
+
- `✗` — failed
|
|
159
|
+
- `○` — pending
|
|
160
|
+
|
|
161
|
+
If a builder subagent fails, log it as failed and continue with the next phase.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Step 5: Review
|
|
166
|
+
|
|
167
|
+
After all phases complete, print:
|
|
168
|
+
|
|
169
|
+
```
|
|
170
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
171
|
+
RALPH-TEAMS Reviewing implementation...
|
|
172
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Spawn the reviewer with `spawn_agent`:
|
|
176
|
+
|
|
177
|
+
```
|
|
178
|
+
spawn_agent(
|
|
179
|
+
agent_type: "default",
|
|
180
|
+
model: "gpt-5.4",
|
|
181
|
+
message: "Review the implementation for: [feature name].
|
|
182
|
+
|
|
183
|
+
Base commit (before build started): [BASE_SHA]
|
|
184
|
+
Use `git diff [BASE_SHA]..HEAD` to see all changes.
|
|
185
|
+
|
|
186
|
+
Full plan:
|
|
187
|
+
[paste .ralph-teams/PLAN-[N].md content]
|
|
188
|
+
|
|
189
|
+
Write your review to .ralph-teams/REVIEW.md.
|
|
190
|
+
If a second-opinion coding CLI is available, use it for a second opinion."
|
|
191
|
+
)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Wait for the reviewer with `wait_agent`. After you have read `.ralph-teams/REVIEW.md` and captured anything you need from the result, call `close_agent`.
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Step 6: Apply Fixes
|
|
199
|
+
|
|
200
|
+
After the reviewer completes, read `.ralph-teams/REVIEW.md`.
|
|
201
|
+
|
|
202
|
+
If there are blocking findings:
|
|
203
|
+
1. Print a summary of the review findings.
|
|
204
|
+
2. Spawn a fix-pass builder:
|
|
205
|
+
```
|
|
206
|
+
spawn_agent(
|
|
207
|
+
agent_type: "worker",
|
|
208
|
+
model: "gpt-5.4-mini",
|
|
209
|
+
message: "You are applying review fixes (not implementing a new phase).
|
|
210
|
+
|
|
211
|
+
Review findings to fix:
|
|
212
|
+
[paste blocking findings from .ralph-teams/REVIEW.md]
|
|
213
|
+
|
|
214
|
+
Platform: [web|mobile]
|
|
215
|
+
|
|
216
|
+
Fix each blocking issue. Verify the fixes work using [Playwright|Maestro].
|
|
217
|
+
If verification tools are not available, run tests/lint instead.
|
|
218
|
+
Commit all fixes together with message: 'fix: address review findings'."
|
|
219
|
+
)
|
|
220
|
+
```
|
|
221
|
+
3. Wait for the fix-pass builder with `wait_agent`, then call `close_agent` once its result has been handled.
|
|
222
|
+
4. Print final summary when done.
|
|
223
|
+
|
|
224
|
+
If no blocking findings, print final summary directly.
|
|
225
|
+
|
|
226
|
+
Final summary format:
|
|
227
|
+
```
|
|
228
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
229
|
+
RALPH-TEAMS Plan #[N] — Build complete!
|
|
230
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
231
|
+
✓ Phase 1: ...
|
|
232
|
+
✓ Phase 2: ...
|
|
233
|
+
✓ Review: [passed | N fixes applied]
|
|
234
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Then suggest:
|
|
238
|
+
> **Build done. Run `teams-verify` to walk through manual E2E verification.**
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Step 7: Optional — Update Docs
|
|
243
|
+
|
|
244
|
+
Ask the user:
|
|
245
|
+
|
|
246
|
+
> **"Would you like to update your documentation? Run `teams-document` to have the scribe update your README, ARCHITECTURE.md, and other docs."**
|
|
247
|
+
|
|
248
|
+
If yes, invoke the `teams-document` skill.
|
|
249
|
+
|
|
250
|
+
If **no**, skip.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: teams-run
|
|
3
|
+
description: "Resume building a single Teams plan. Orchestrate sequential builder subagents for incomplete phases, then run a reviewer and apply fixes."
|
|
4
|
+
user-invocable: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Teams: Run (Resume Build)
|
|
8
|
+
|
|
9
|
+
You are the orchestrator. Resume an existing build by running all incomplete phases, then reviewing and applying fixes.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Step 1: Find the Plan
|
|
14
|
+
|
|
15
|
+
Read `.ralph-teams/PLAN.md`. If not found:
|
|
16
|
+
> `.ralph-teams/PLAN.md` not found. Use `teams-plan` to create a plan first.
|
|
17
|
+
|
|
18
|
+
Identify:
|
|
19
|
+
- Plan ID (the `Plan ID:` field — e.g. `#2`)
|
|
20
|
+
- All phases, their status (`[x]` = done, `[!]` = failed, `[ ]` = incomplete), and their complexity annotation (`complexity: simple` or `complexity: standard`)
|
|
21
|
+
- Platform (web or mobile)
|
|
22
|
+
- Verification scenarios
|
|
23
|
+
|
|
24
|
+
Print the current state:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
28
|
+
RALPH-TEAMS Plan #[N] — Resuming — [N of M phases already done]
|
|
29
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
30
|
+
✓ Phase 1: Project Setup [done]
|
|
31
|
+
✓ Phase 2: Auth System [done]
|
|
32
|
+
○ Phase 3: API Routes [pending]
|
|
33
|
+
○ Phase 4: Frontend [pending]
|
|
34
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Step 2: Execute — Sequential Builder Subagents
|
|
40
|
+
|
|
41
|
+
Capture the base commit SHA before building starts:
|
|
42
|
+
```bash
|
|
43
|
+
git rev-parse HEAD
|
|
44
|
+
```
|
|
45
|
+
Save this as `BASE_SHA`.
|
|
46
|
+
|
|
47
|
+
For **each incomplete phase** (`[ ]` or `[!]`) **in order**, use `spawn_agent`. Pick the model from the phase's complexity annotation:
|
|
48
|
+
- `complexity: simple` → `model: "gpt-5.4-mini"`
|
|
49
|
+
- `complexity: standard` → `model: "gpt-5.4"`
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
spawn_agent(
|
|
53
|
+
agent_type: "worker",
|
|
54
|
+
model: "[gpt-5.4-mini | gpt-5.4 based on phase complexity]",
|
|
55
|
+
message: "You are implementing Phase [N] of [M]: [phase description].
|
|
56
|
+
|
|
57
|
+
Tasks to complete:
|
|
58
|
+
[list tasks from the phase]
|
|
59
|
+
|
|
60
|
+
Platform: [web|mobile]
|
|
61
|
+
|
|
62
|
+
Full plan:
|
|
63
|
+
[paste .ralph-teams/PLAN.md content]
|
|
64
|
+
|
|
65
|
+
Your assignment: implement Phase [N] only, completing all its tasks. Verify it works using [Playwright|Maestro], then commit.
|
|
66
|
+
If [Playwright|Maestro] tools are not available, run tests/lint instead and note that E2E verification was skipped."
|
|
67
|
+
)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Wait for each subagent with `wait_agent` before starting the next. As soon as you have recorded the result, call `close_agent` for that finished builder. After each phase, update `.ralph-teams/PLAN.md` (change `[ ]` to `[x]` on success, `[!]` on failure) and reprint the phase board.
|
|
71
|
+
|
|
72
|
+
If a builder subagent fails, log it as failed and continue.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Step 3: Review
|
|
77
|
+
|
|
78
|
+
After all phases complete, print:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
82
|
+
RALPH-TEAMS Reviewing implementation...
|
|
83
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Spawn the reviewer with `spawn_agent`:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
spawn_agent(
|
|
90
|
+
agent_type: "default",
|
|
91
|
+
model: "gpt-5.4",
|
|
92
|
+
message: "Review the implementation for: [feature name].
|
|
93
|
+
|
|
94
|
+
Base commit (before build started): [BASE_SHA]
|
|
95
|
+
Use `git diff [BASE_SHA]..HEAD` to see all changes.
|
|
96
|
+
|
|
97
|
+
Full plan:
|
|
98
|
+
[paste .ralph-teams/PLAN.md content]
|
|
99
|
+
|
|
100
|
+
Write your review to .ralph-teams/REVIEW.md.
|
|
101
|
+
If a second-opinion coding CLI is available, use it for a second opinion."
|
|
102
|
+
)
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Wait for the reviewer with `wait_agent`. After you have read `.ralph-teams/REVIEW.md` and captured anything you need from the result, call `close_agent`.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Step 4: Apply Fixes
|
|
110
|
+
|
|
111
|
+
Read `.ralph-teams/REVIEW.md`. If there are blocking findings:
|
|
112
|
+
1. Print a summary of the findings.
|
|
113
|
+
2. Spawn a fix-pass builder:
|
|
114
|
+
```
|
|
115
|
+
spawn_agent(
|
|
116
|
+
agent_type: "worker",
|
|
117
|
+
model: "gpt-5.4-mini",
|
|
118
|
+
message: "You are applying review fixes (not implementing a new phase).
|
|
119
|
+
|
|
120
|
+
Review findings to fix:
|
|
121
|
+
[paste blocking findings from .ralph-teams/REVIEW.md]
|
|
122
|
+
|
|
123
|
+
Platform: [web|mobile]
|
|
124
|
+
|
|
125
|
+
Fix each blocking issue. Verify the fixes work using [Playwright|Maestro].
|
|
126
|
+
If verification tools are not available, run tests/lint instead.
|
|
127
|
+
Commit all fixes together with message: 'fix: address review findings'."
|
|
128
|
+
)
|
|
129
|
+
```
|
|
130
|
+
3. Wait for the fix-pass builder with `wait_agent`, then call `close_agent` once its result has been handled.
|
|
131
|
+
4. After the fix-pass builder completes, update `.ralph-teams/REVIEW.md` — append a fix summary section at the bottom:
|
|
132
|
+
```markdown
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Fixes Applied
|
|
136
|
+
|
|
137
|
+
**Fixes:** [brief description of what was changed]
|
|
138
|
+
**Commit:** fix: address review findings
|
|
139
|
+
**Status:** All blocking findings resolved
|
|
140
|
+
```
|
|
141
|
+
Also mark any blocking findings in the REVIEW.md body as `Resolved` inline.
|
|
142
|
+
|
|
143
|
+
Final summary:
|
|
144
|
+
```
|
|
145
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
146
|
+
RALPH-TEAMS Plan #[N] — Build complete!
|
|
147
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
148
|
+
✓ Phase 1: ...
|
|
149
|
+
✓ Phase 2: ...
|
|
150
|
+
✓ Review: [passed | N fixes applied]
|
|
151
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Then suggest:
|
|
155
|
+
> **Build done. Run `teams-verify` to walk through manual E2E verification.**
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Step 5: Optional — Update Docs
|
|
160
|
+
|
|
161
|
+
Ask the user:
|
|
162
|
+
|
|
163
|
+
> **"Would you like to update your documentation? Run `teams-document` to have the scribe update your README, ARCHITECTURE.md, and other docs."**
|
|
164
|
+
|
|
165
|
+
If yes, invoke the `teams-document` skill.
|
|
166
|
+
|
|
167
|
+
If **no**, skip.
|