@jaybeeuu/agent-cortex 1.20.0
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/.beads/README.md +81 -0
- package/.beads/config.yaml +1 -0
- package/.beads/issues.jsonl +236 -0
- package/.beads/metadata.json +7 -0
- package/.claude-plugin/marketplace.json +16 -0
- package/.github/workflows/ci.test.ts +217 -0
- package/.github/workflows/ci.yml +35 -0
- package/.github/workflows/publish.yml +36 -0
- package/.junie/guidelines.md +87 -0
- package/.junie/mcp/mcp.json +10 -0
- package/AGENTS.md +102 -0
- package/CHANGELOG.md +705 -0
- package/README.md +209 -0
- package/agents/README.md +235 -0
- package/agents/plan.agent.md +56 -0
- package/agents/ralph-plan.agent.md +119 -0
- package/agents/ralph.agent.md +305 -0
- package/agents/strategy.agent.md +109 -0
- package/agents-native/ralph.md +193 -0
- package/bin/agent-cortex.mjs +27 -0
- package/claude/.claude-plugin/plugin.json +11 -0
- package/claude/.mcp.json +18 -0
- package/claude/agents/plan.md +56 -0
- package/claude/agents/ralph-plan.md +119 -0
- package/claude/agents/ralph.md +193 -0
- package/claude/agents/strategy.md +109 -0
- package/claude/hooks.json +23 -0
- package/claude/scripts/statusline-command.sh +124 -0
- package/docs/ideas/auto-model-selection.md +75 -0
- package/docs/ideas/improve-pi-system-prompt.md +34 -0
- package/docs/ideas/model-selector.md +40 -0
- package/docs/ideas/pi-task-memory.md +34 -0
- package/docs/ideas/qa-extension.md +43 -0
- package/docs/inspirations.md +33 -0
- package/docs/research/gas-city-research.md +256 -0
- package/docs/research/skill-design-research.md +286 -0
- package/docs/research/skill-improvements-analysis.md +117 -0
- package/docs/research/skill-patterns-research.md +24 -0
- package/docs/skills/skill-anatomy.md +149 -0
- package/docs/user-preferences.md +17 -0
- package/extensions/agent-modes/index.ts +507 -0
- package/extensions/auto-name.ts +107 -0
- package/extensions/context-loader.md +35 -0
- package/extensions/context-loader.ts +65 -0
- package/extensions/lib/tiny-model.ts +212 -0
- package/extensions/notify/index.ts +293 -0
- package/extensions/session-start.ts +44 -0
- package/extensions/skill-stats/README.md +74 -0
- package/extensions/skill-stats/context-loader.test.ts +107 -0
- package/extensions/skill-stats/discover.ts +119 -0
- package/extensions/skill-stats/format.ts +13 -0
- package/extensions/skill-stats/index.test.ts +452 -0
- package/extensions/skill-stats/index.ts +222 -0
- package/extensions/skill-stats/package.json +19 -0
- package/extensions/skill-stats/pnpm-lock.yaml +329 -0
- package/extensions/skill-stats/record.ts +48 -0
- package/extensions/skill-stats/store.ts +104 -0
- package/extensions/skill-stats/tsconfig.json +12 -0
- package/extensions/subagent/README.md +175 -0
- package/extensions/subagent/agents/planner.md +37 -0
- package/extensions/subagent/agents/reviewer.md +35 -0
- package/extensions/subagent/agents/scout.md +50 -0
- package/extensions/subagent/agents/worker.md +24 -0
- package/extensions/subagent/agents.ts +126 -0
- package/extensions/subagent/index.ts +1138 -0
- package/extensions/subagent/prompts/implement-and-review.md +10 -0
- package/extensions/subagent/prompts/implement.md +10 -0
- package/extensions/subagent/prompts/scout-and-plan.md +9 -0
- package/hooks.json +10 -0
- package/lib/cli.mjs +37 -0
- package/package.json +39 -0
- package/pi/keybindings.json +3 -0
- package/pi/settings.json +29 -0
- package/plugin.json +35 -0
- package/pnpm-workspace.yaml +7 -0
- package/scripts/build-claude-agents.mjs +179 -0
- package/scripts/install-instructions.sh +82 -0
- package/skills/engineering/design-an-interface/SKILL.md +94 -0
- package/skills/engineering/grill-with-docs/SKILL.md +88 -0
- package/skills/engineering/improve-codebase-architecture/REFERENCE.md +78 -0
- package/skills/engineering/improve-codebase-architecture/SKILL.md +81 -0
- package/skills/engineering/tdd/SKILL.md +150 -0
- package/skills/engineering/tdd/deep-modules.md +33 -0
- package/skills/engineering/tdd/interface-design.md +31 -0
- package/skills/engineering/tdd/mocking.md +59 -0
- package/skills/engineering/tdd/refactoring.md +10 -0
- package/skills/engineering/tdd/tests.md +61 -0
- package/skills/engineering/technical-direction/SKILL.md +86 -0
- package/skills/planning/classify-bead/SKILL.md +67 -0
- package/skills/planning/create-task/SKILL.md +96 -0
- package/skills/planning/create-task/pipeline.json +33 -0
- package/skills/planning/create-task/scripts/create-chores.ts +112 -0
- package/skills/planning/create-task/scripts/package.json +14 -0
- package/skills/planning/create-task/scripts/pnpm-lock.yaml +342 -0
- package/skills/planning/create-task/scripts/tsconfig.json +12 -0
- package/skills/planning/create-task/templates/code.md +40 -0
- package/skills/planning/create-task/templates/document.md +40 -0
- package/skills/planning/create-task/templates/fix.md +27 -0
- package/skills/planning/create-task/templates/review.md +36 -0
- package/skills/planning/create-task/templates/verify.md +43 -0
- package/skills/planning/prd-to-tasks/SKILL.md +227 -0
- package/skills/planning/record-idea/SKILL.md +62 -0
- package/skills/planning/record-idea/scripts/new-idea.sh +89 -0
- package/skills/planning/request-refactor-plan/SKILL.md +73 -0
- package/skills/planning/write-a-prd/SKILL.md +74 -0
- package/skills/planning/write-a-ticket/SKILL.md +97 -0
- package/skills/productivity/bd-tool/SKILL.md +90 -0
- package/skills/productivity/grill-me/SKILL.md +10 -0
- package/skills/productivity/handoff/SKILL.md +15 -0
- package/skills/productivity/init-beads/SKILL.md +93 -0
- package/skills/productivity/teach/GLOSSARY-FORMAT.md +35 -0
- package/skills/productivity/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/skills/productivity/teach/MISSION-FORMAT.md +31 -0
- package/skills/productivity/teach/RESOURCES-FORMAT.md +32 -0
- package/skills/productivity/teach/SKILL.md +109 -0
- package/skills/productivity/validate-agent-dir/scripts/package.json +15 -0
- package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +329 -0
- package/skills/productivity/validate-agent-dir/scripts/pnpm-workspace.yaml +2 -0
- package/skills/productivity/validate-agent-dir/scripts/tsconfig.json +19 -0
- package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.test.ts +317 -0
- package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.ts +127 -0
- package/skills/productivity/write-a-skill/SKILL.md +74 -0
- package/skills/review/maintain-agent-docs/REFERENCE.md +246 -0
- package/skills/review/maintain-agent-docs/SKILL.md +83 -0
- package/skills/review/refactor-skill/EXAMPLES.md +20 -0
- package/skills/review/refactor-skill/SKILL.md +148 -0
- package/skills/review/review-security/SKILL.md +107 -0
- package/skills/review/review-security/scripts/install-gitleaks.sh +43 -0
- package/skills/style/style-code/REFERENCE.md +38 -0
- package/skills/style/style-code/SKILL.md +113 -0
- package/skills/style/style-comms/SKILL.md +93 -0
- package/skills/style/style-documentation/SKILL.md +112 -0
- package/skills/style/style-tests/SKILL.md +97 -0
- package/skills/workflow/git-workflow/SKILL.md +85 -0
- package/skills/workflow/hitl-collab/SKILL.md +29 -0
- package/skills/workflow/plan/SKILL.md +272 -0
- package/skills/workflow/ralph/REFERENCE.md +202 -0
- package/skills/workflow/ralph/SKILL.md +105 -0
- package/skills/workflow/run-pipeline-stage/SKILL.md +151 -0
- package/skills/workflow/run-pipeline-stage/playbooks/code.md +17 -0
- package/skills/workflow/run-pipeline-stage/playbooks/document.md +18 -0
- package/skills/workflow/run-pipeline-stage/playbooks/fix.md +17 -0
- package/skills/workflow/run-pipeline-stage/playbooks/review.md +19 -0
- package/skills/workflow/run-pipeline-stage/playbooks/verify.md +14 -0
- package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +20 -0
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +783 -0
- package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +586 -0
- package/skills/workflow/run-pipeline-stage/scripts/package.json +15 -0
- package/skills/workflow/run-pipeline-stage/scripts/pnpm-lock.yaml +342 -0
- package/skills/workflow/run-pipeline-stage/scripts/pnpm-workspace.yaml +2 -0
- package/skills/workflow/run-pipeline-stage/scripts/tsconfig.json +12 -0
- package/skills/workflow/using-agent-skills/SKILL.md +109 -0
- package/skills/workflow/using-agent-skills/scripts/validate-skill-structure.test.ts +73 -0
- package/test/cli.test.mjs +149 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Fleet — Reference
|
|
2
|
+
|
|
3
|
+
Detailed procedures for the fleet orchestration workflow. See [SKILL.md](./SKILL.md) for the top-level event loop.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Dispatching a Chore Bead
|
|
8
|
+
|
|
9
|
+
1. **Claim** the bead: `bd update <id> --claim`.
|
|
10
|
+
2. **Read its `stage:*` label** from `bd show <id>`.
|
|
11
|
+
3. **Load the universal stage runner prompt** from `skills/workflow/run-pipeline-stage/prompts/stage-runner.md`.
|
|
12
|
+
4. **Read the parent task context**: follow the `parent-child` dependency to the parent task bead, run `bd show <parent-id>` to get the full task description.
|
|
13
|
+
5. **Ensure branch + worktree exist for this parent task** (see _Feature branches and worktrees_ below), then note the worktree path — you'll pass it as `cwd` to `task`.
|
|
14
|
+
6. **Fill in the prompt** — replace placeholders with:
|
|
15
|
+
- Stage from bead label (`stage:<stage>`) for `<stage>`
|
|
16
|
+
- `bd prime` output (held in memory from initialization)
|
|
17
|
+
- Parent task description from `bd show <parent-id>`
|
|
18
|
+
- For `fix` stage: `FILES_CHANGED` from the preceding stage's report (the required changes come from the fix bead's own description — read via `bd show <fix-id>`)
|
|
19
|
+
- For `verify`, `review`, `document` stages: `SUMMARY` and `FILES_CHANGED` from the preceding stage's report
|
|
20
|
+
- Bead ID and log file path (`.agent-cortex/ralph/ralph-<bead-id>.log`)
|
|
21
|
+
7. **Call the `task` tool** with the filled prompt as `prompt` and the worktree path as `cwd`. Store the returned agentId — you need it for step 8 and for log polling.
|
|
22
|
+
8. **Map** the agent ID to the bead ID in memory for lookup on completion.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Feature Branches and Worktrees
|
|
27
|
+
|
|
28
|
+
For each parent task bead (`<parent-id>`):
|
|
29
|
+
|
|
30
|
+
1. Determine the parent epic (`<epic-id>`) from the task's `epic:<epic-id>` label.
|
|
31
|
+
2. Ensure epic branch exists (always based on the latest `origin/main`, never local `main`):
|
|
32
|
+
```bash
|
|
33
|
+
git fetch origin
|
|
34
|
+
git rev-parse --verify epic/<epic-id> >/dev/null 2>&1 || git branch epic/<epic-id> origin/main
|
|
35
|
+
```
|
|
36
|
+
3. Ensure feature worktree exists:
|
|
37
|
+
```bash
|
|
38
|
+
git worktree add .agent-cortex/worktrees/<parent-id> -b feature/<parent-id> epic/<epic-id>
|
|
39
|
+
```
|
|
40
|
+
If `.agent-cortex/worktrees/<parent-id>` already exists, reuse it.
|
|
41
|
+
4. All chores for this parent run in `.agent-cortex/worktrees/<parent-id>`. The `feature/<parent-id>` branch is the agent branch for HITL PRs.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Feature PR Gate
|
|
46
|
+
|
|
47
|
+
When the `document` chore for a parent task completes:
|
|
48
|
+
|
|
49
|
+
1. Close the `document` chore.
|
|
50
|
+
2. Create or update a feature PR immediately from the agent branch to the feature branch (`feature/<parent-id>` into `epic/<epic-id>`):
|
|
51
|
+
```bash
|
|
52
|
+
gh pr create --base epic/<epic-id> --head feature/<parent-id> --title "[<parent-id>] <task-title>" --body "<summary>"
|
|
53
|
+
```
|
|
54
|
+
If an open PR already exists, update it instead of creating a duplicate.
|
|
55
|
+
3. Report the PR URL in chat as soon as it is created.
|
|
56
|
+
4. Find the child HITL task bead for this parent with label `lifecycle:feature-pr` (created by `create-task`).
|
|
57
|
+
5. Update that HITL bead with the PR URL/status (comment or note) so the reviewer has the link.
|
|
58
|
+
6. Do not schedule new parent features while this HITL PR gate bead remains open.
|
|
59
|
+
7. Once the PR is merged, a human closes the HITL PR gate bead. After that, close the parent feature bead:
|
|
60
|
+
```bash
|
|
61
|
+
bd close <parent-id>
|
|
62
|
+
```
|
|
63
|
+
Only then continue with next parent features.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Fix Loop
|
|
68
|
+
|
|
69
|
+
When a verify or review stage fails:
|
|
70
|
+
|
|
71
|
+
1. **Determine the parent task**: look up the chore bead's parent via `bd show <chore-id>` (follow the `parent-child` dependency).
|
|
72
|
+
2. **Count existing fix rounds**: list all chore beads that are children of the parent task with label `stage:fix`. The count of these (including closed ones) is the number of fix rounds already attempted.
|
|
73
|
+
3. **Read `maxFixRounds`** from `skills/planning/create-task/pipeline.json` (held in memory since initialization).
|
|
74
|
+
4. **If fix rounds ≥ maxFixRounds**: close the parent task bead as failed (`bd close <parent-id> --reason "Max fix rounds reached"`). Do not create another fix chore.
|
|
75
|
+
5. **Otherwise, create a fix chore** with the feedback in its description so the fixer agent can read it directly from `bd show`:
|
|
76
|
+
```bash
|
|
77
|
+
fix_id=$(bd create "[<parent-id>] Fix (round <N>)" --type chore \
|
|
78
|
+
--priority <same as parent> \
|
|
79
|
+
--description "<CHANGES_REQUESTED list or VERIFY_FAILURES list from the triggering REPORT>" -q)
|
|
80
|
+
bd tag $fix_id stage:fix
|
|
81
|
+
bd dep add $fix_id <parent-id> --type parent-child # fix-chore is child of parent
|
|
82
|
+
```
|
|
83
|
+
6. **Find the verify chore** for this parent task (the chore with label `stage:verify` and a `parent-child` dep to the parent).
|
|
84
|
+
7. **Block the verify chore** on the new fix chore:
|
|
85
|
+
```bash
|
|
86
|
+
bd dep add <verify-id> $fix_id --type blocks # verify waits for fix
|
|
87
|
+
```
|
|
88
|
+
8. **Reopen the verify chore**:
|
|
89
|
+
```bash
|
|
90
|
+
bd reopen <verify-id>
|
|
91
|
+
```
|
|
92
|
+
This ensures the fix chore runs first, then verify re-runs automatically when the fix closes.
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Log Polling
|
|
97
|
+
|
|
98
|
+
Run whenever polling is triggered (timer or agent completion):
|
|
99
|
+
|
|
100
|
+
1. **Query in-flight beads**: `bd list --status=in_progress --type=chore`. Extract each bead's ID and title.
|
|
101
|
+
2. For each in-flight bead, read new lines from its log file (track the next unread line number per bead in memory, starting at 1):
|
|
102
|
+
```bash
|
|
103
|
+
tail -n +<lastLine> .agent-cortex/ralph/ralph-<bead-id>.log 2>/dev/null
|
|
104
|
+
```
|
|
105
|
+
3. For each bead that has new lines:
|
|
106
|
+
- **Post a chat summary** of new key events (stage transitions and notable events — not every line verbatim):
|
|
107
|
+
```
|
|
108
|
+
📋 [bead-id] <title>
|
|
109
|
+
coding → verifying (or whatever transition)
|
|
110
|
+
Tests: 12 passed, 0 failed
|
|
111
|
+
```
|
|
112
|
+
- Update the in-memory line offset for that bead.
|
|
113
|
+
4. If no bead had new lines, post nothing — do not spam the chat with empty polls.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## HITL Pause
|
|
118
|
+
|
|
119
|
+
Proceed here when no chore beads are in-flight, no `stage:*` chore beads are ready, and HITL gate beads are pending (open `lifecycle:feature-pr` beads or epics tagged `awaiting-epic-pr-merge`). Ralph stops rather than burning requests on idle polls.
|
|
120
|
+
|
|
121
|
+
1. Regenerate `.agent-cortex/ralph/progress.md` one final time — do not delete it.
|
|
122
|
+
2. For each epic whose feature beads are all closed but not yet tagged `awaiting-epic-pr-merge`, open/update an epic PR to main:
|
|
123
|
+
```bash
|
|
124
|
+
gh pr create --base main --head epic/<epic-id> --title "[<epic-id>] Merge epic into main" --body "<epic summary>"
|
|
125
|
+
```
|
|
126
|
+
Tag each epic bead with `awaiting-epic-pr-merge` until merged.
|
|
127
|
+
3. Run:
|
|
128
|
+
```bash
|
|
129
|
+
bd dolt push
|
|
130
|
+
```
|
|
131
|
+
4. Collect pending HITL gate beads and their PR URLs:
|
|
132
|
+
```bash
|
|
133
|
+
bd list -l lifecycle:feature-pr -l implementation-type:hitl
|
|
134
|
+
bd list -l awaiting-epic-pr-merge
|
|
135
|
+
```
|
|
136
|
+
For each bead, run `bd show <id>` to retrieve the PR URL from bead notes.
|
|
137
|
+
5. Output the **Pending Human Action** summary:
|
|
138
|
+
```
|
|
139
|
+
⏸️ Ralph is paused — human action required before work can continue.
|
|
140
|
+
|
|
141
|
+
| Bead ID | Title | Action needed | PR |
|
|
142
|
+
|---------|-------|---------------|----|
|
|
143
|
+
| <id> | <title> | Review and merge feature PR, then close this bead | <url or "–"> |
|
|
144
|
+
| <id> | <title> | Review and merge epic PR into main | <url or "–"> |
|
|
145
|
+
...
|
|
146
|
+
|
|
147
|
+
When you've completed the above, prompt me to continue.
|
|
148
|
+
```
|
|
149
|
+
6. **Stop completely.** Do not restart the poll timer. Do not continue the event loop. Wait for the user to re-prompt before doing any further work.
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Shutdown
|
|
154
|
+
|
|
155
|
+
When `bd list --status=in_progress --type=chore` returns no results AND `bd ready` returns no chore beads with `stage:*` labels:
|
|
156
|
+
|
|
157
|
+
1. Regenerate `.agent-cortex/ralph/progress.md` one final time — do not delete it.
|
|
158
|
+
2. For each epic whose feature beads are all closed, open/update an epic PR to main:
|
|
159
|
+
```bash
|
|
160
|
+
gh pr create --base main --head epic/<epic-id> --title "[<epic-id>] Merge epic into main" --body "<epic summary>"
|
|
161
|
+
```
|
|
162
|
+
Tag each epic bead with `awaiting-epic-pr-merge` until merged.
|
|
163
|
+
3. Run:
|
|
164
|
+
```bash
|
|
165
|
+
bd dolt push
|
|
166
|
+
```
|
|
167
|
+
4. If any HITL beads were noted during the session, output:
|
|
168
|
+
```
|
|
169
|
+
All agent work is complete. The following steps require human action before work can continue:
|
|
170
|
+
|
|
171
|
+
| Bead ID | Title | Why human action is needed |
|
|
172
|
+
|---------|-------|---------------------------|
|
|
173
|
+
| <id> | <title> | <HITL reason from bead body> |
|
|
174
|
+
...
|
|
175
|
+
|
|
176
|
+
Run `bd show <id>` for full details on each step.
|
|
177
|
+
```
|
|
178
|
+
5. If any epics are tagged `awaiting-epic-pr-merge`, output a **Pending Epic Review** table (epic bead ID, branch, PR URL) and stop.
|
|
179
|
+
6. If no HITL beads remain, output:
|
|
180
|
+
```
|
|
181
|
+
All beads complete.
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## State Files
|
|
187
|
+
|
|
188
|
+
| File | Purpose |
|
|
189
|
+
|------|---------|
|
|
190
|
+
| `.agent-cortex/ralph/progress.md` | Human-readable snapshot. Regenerate: `workspace="/abs/path"; pnpm --prefix skills/workflow/run-pipeline-stage/scripts exec tsx generate-progress.ts --workspace "$workspace" > "$workspace/.agent-cortex/ralph/progress.md"`. `workspace` must be an **absolute** path — never `.` or `$(pwd)`. **Never hand-edit.** |
|
|
191
|
+
| `.agent-cortex/ralph/ralph-*.log` | Per-bead log files written by subagents (e.g. `.agent-cortex/ralph/ralph-abc-123.log`). |
|
|
192
|
+
|
|
193
|
+
All orchestration state is derived from beads:
|
|
194
|
+
|
|
195
|
+
| Question | How to answer |
|
|
196
|
+
|----------|---------------|
|
|
197
|
+
| What is in-flight? | `bd list --status=in_progress --type=chore` |
|
|
198
|
+
| What is ready? | `bd ready` — filter for chores with `stage:*` labels |
|
|
199
|
+
| What stage is a bead in? | Read the `stage:*` label from `bd show <id>` |
|
|
200
|
+
| How many fix rounds? | Count chore beads with label `stage:fix` that are children of the parent task. Read `maxFixRounds` from `skills/planning/create-task/pipeline.json`. |
|
|
201
|
+
| Which features are review-gated? | Find open child task beads labelled `lifecycle:feature-pr` and `implementation-type:hitl` |
|
|
202
|
+
| Which epics are review-gated? | `bd list -l awaiting-epic-pr-merge` |
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ralph
|
|
3
|
+
description: "Run all pending beads end-to-end using parallel subagents with review gates: initialise, dispatch up to 5 concurrent pipeline-stage chores, open and report PRs immediately, then wait for merges before continuing. Use when running the full task backlog with human approval points."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Fleet
|
|
7
|
+
|
|
8
|
+
Parallel task orchestration: find ready beads, dispatch them as background subagents, process each outcome through the pipeline (code → verify → review → document, with fix loops on failure), then open review-gated PRs before considering feature work complete.
|
|
9
|
+
|
|
10
|
+
Orchestration state is derived entirely from beads — there is no separate state file. In-flight work is tracked as chore beads with status `in_progress`. Ready work is discovered via `bd ready`. Pipeline configuration lives in `skills/planning/create-task/pipeline.json`. Stage runner prompt templates live in `skills/workflow/run-pipeline-stage/prompts/` and playbooks in `skills/workflow/run-pipeline-stage/playbooks/`.
|
|
11
|
+
|
|
12
|
+
## Branching and Review Model
|
|
13
|
+
|
|
14
|
+
1. **Epic integration branch**: each epic runs on `epic/<epic-id>` (base: `origin/main`, never local `main`).
|
|
15
|
+
2. **Feature branch per parent bead**: each AFK parent task runs on `feature/<parent-task-id>`, based from its epic branch. This branch is treated as the **agent branch** for HITL PRs.
|
|
16
|
+
3. **Dedicated worktree per parent bead**: each feature branch uses `.agent-cortex/worktrees/<parent-task-id>`.
|
|
17
|
+
4. **Feature PR gate**: each feature has a child HITL task bead (`lifecycle:feature-pr`) created by `create-task`. When `document` completes, open/update PR `feature/<parent-task-id> -> epic/<epic-id>` (agent-branch → feature branch), report the PR URL immediately, then wait for the HITL PR gate bead to be closed by a human.
|
|
18
|
+
5. **Epic PR gate**: when an epic's feature beads are complete, open/update a PR `epic/<epic-id> -> main` and pause until merged.
|
|
19
|
+
|
|
20
|
+
See [REFERENCE.md](./REFERENCE.md) for detailed procedures: dispatching, fix loop, log polling, and shutdown.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Initialization
|
|
25
|
+
|
|
26
|
+
Run once at startup:
|
|
27
|
+
|
|
28
|
+
1. Run `bd prime`. Hold the full output verbatim in memory — forward it unchanged to every subagent.
|
|
29
|
+
2. Ensure `.agent-cortex/` and `.agent-cortex/worktrees/` are in the project's `.gitignore` (append any that are missing).
|
|
30
|
+
3. Ensure Ralph's workspace directory exists: `mkdir -p .agent-cortex/ralph`.
|
|
31
|
+
4. Read `skills/planning/create-task/pipeline.json` and hold it in memory — you need `maxFixRounds` for the fix loop.
|
|
32
|
+
5. Run `bd ready` to get the initial list of available beads.
|
|
33
|
+
6. For each available bead:
|
|
34
|
+
- **Chore with a `stage:*` label**: pipeline stage bead — eligible for dispatch.
|
|
35
|
+
- **Task or other type without an `implementation-type:*` label**: unexpected here — classification is a planning-stage concern already applied by `create-task`. Do not invoke `classify-bead`; treat as needs-refinement and note for the shutdown summary.
|
|
36
|
+
- **Task labelled `implementation-type:hitl`**: skip — record the bead ID for the **Pending Human Action** summary at shutdown.
|
|
37
|
+
7. For each ready chore bead (up to 5), **dispatch** it (see _Dispatching a chore bead_ in REFERENCE.md). Chores for a parent bead must run from that parent's worktree.
|
|
38
|
+
8. **If** any chore beads were dispatched in step 7, start the **poll timer**: run `sleep 120` as a background bash process and hold its shellId in memory. **Otherwise**, if HITL gate beads are pending (check `bd list -l lifecycle:feature-pr -l implementation-type:hitl` and `bd list -l awaiting-epic-pr-merge`), proceed to **HITL Pause** (see REFERENCE.md) immediately.
|
|
39
|
+
9. Regenerate `.agent-cortex/ralph/progress.md`:
|
|
40
|
+
```bash
|
|
41
|
+
# workspace must be the absolute path you cd'd into — never . or $(pwd)
|
|
42
|
+
workspace="/absolute/path/to/worktree"
|
|
43
|
+
pnpm --prefix skills/workflow/run-pipeline-stage/scripts exec tsx generate-progress.ts --workspace "$workspace" > "$workspace/.agent-cortex/ralph/progress.md"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Event Loop
|
|
49
|
+
|
|
50
|
+
After initialization, wait for background agents or the poll timer to complete. On each completion notification:
|
|
51
|
+
|
|
52
|
+
### Poll timer completed
|
|
53
|
+
|
|
54
|
+
1. **Poll all in-flight bead logs** (see _Log polling_ in REFERENCE.md).
|
|
55
|
+
2. Regenerate `.agent-cortex/ralph/progress.md`.
|
|
56
|
+
3. **HITL pause check**: if `bd list --status=in_progress --type=chore` returns empty AND `bd ready` has no `stage:*` chore beads AND HITL gate beads are pending (`bd list -l lifecycle:feature-pr -l implementation-type:hitl` or `bd list -l awaiting-epic-pr-merge` returns results), proceed to **HITL Pause** (see REFERENCE.md) — do **not** restart the timer.
|
|
57
|
+
4. **Otherwise**: restart the timer: run `sleep 120` as a new background bash process, hold its shellId in memory.
|
|
58
|
+
|
|
59
|
+
### Background agent completed
|
|
60
|
+
|
|
61
|
+
1. **Poll that bead's log** to flush any final lines.
|
|
62
|
+
2. **Read** the completed agent's full output with `read_agent`.
|
|
63
|
+
3. **Identify the bead**: parse the `---REPORT---` block for `BEAD_ID` and `STAGE_COMPLETED`.
|
|
64
|
+
4. **Close** the chore bead: `bd close <bead-id>`.
|
|
65
|
+
5. **Handle stage outcome**:
|
|
66
|
+
|
|
67
|
+
| Stage completed | Condition | Next action |
|
|
68
|
+
|-----------------|-----------|-------------|
|
|
69
|
+
| `code` | — | Closing the code chore unblocks the verify chore. |
|
|
70
|
+
| `fix` | — | Closing the fix chore unblocks the verify chore. |
|
|
71
|
+
| `verify` | `VERIFY_OUTCOME: PASS` | Closing the verify chore unblocks the review chore. |
|
|
72
|
+
| `verify` | `VERIFY_OUTCOME: FAIL` | Run the **fix loop** (see REFERENCE.md). |
|
|
73
|
+
| `review` | `REVIEW_OUTCOME: APPROVED` | Closing the review chore unblocks the document chore. |
|
|
74
|
+
| `review` | `REVIEW_OUTCOME: CHANGES_REQUESTED` | Run the **fix loop** (see REFERENCE.md). |
|
|
75
|
+
| `document` | — | Open/update feature PR immediately (`feature/<parent-id> -> epic/<epic-id>`), report the PR URL, then update the child HITL PR gate bead (`lifecycle:feature-pr`) with the PR URL/status. Wait for human to close that HITL bead after merge, then close the parent task bead. |
|
|
76
|
+
|
|
77
|
+
6. **Check for newly ready beads**: run `bd ready` and inspect results:
|
|
78
|
+
- **Chore beads with `stage:*` label**: dispatch if in-flight count (from `bd list --status=in_progress --type=chore`) is < 5.
|
|
79
|
+
- **Task beads without `implementation-type:*` label**: unexpected here — classification happens at planning time via `create-task`. Do not invoke `classify-bead`; treat as needs-refinement and note for shutdown.
|
|
80
|
+
- If any feature PR gate bead (`lifecycle:feature-pr`, `implementation-type:hitl`) is open, do **not** schedule new parent features. Keep working only already in-flight chores.
|
|
81
|
+
7. **Check shutdown or pause**: if `bd list --status=in_progress --type=chore` returns no results AND `bd ready` returns no chore beads with `stage:*` labels:
|
|
82
|
+
- If HITL gate beads are pending (`bd list -l lifecycle:feature-pr -l implementation-type:hitl` or `bd list -l awaiting-epic-pr-merge` returns results), proceed to **HITL Pause** (see REFERENCE.md).
|
|
83
|
+
- Otherwise, proceed to **Shutdown** (see REFERENCE.md).
|
|
84
|
+
8. Regenerate `.agent-cortex/ralph/progress.md`.
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Constraints
|
|
89
|
+
|
|
90
|
+
- **Always** run in **foreground** (interactive) mode. If you find yourself executing as a background task, immediately surface a warning to the user and ask them to re-run you in foreground mode.
|
|
91
|
+
- **Never** write, edit, or create source code or documentation yourself.
|
|
92
|
+
- **Never** edit bead task files directly — only use `bd` commands.
|
|
93
|
+
- **ALWAYS call the `task` tool to spawn subagents** — never use bash, never run stages inline, never use any other tool. This is your only spawning mechanism.
|
|
94
|
+
- **Always** derive orchestration state from beads — do not maintain a separate state file.
|
|
95
|
+
- **Always** include the full `bd prime` output verbatim in every `task` tool prompt.
|
|
96
|
+
- **Always** keep the poll timer running — restart it immediately after it fires — **unless** the HITL pause condition is met (no chores in-flight, no `stage:*` chores ready, HITL gate beads pending), in which case proceed to **HITL Pause** (see REFERENCE.md) and stop instead.
|
|
97
|
+
- **Never** post empty poll updates to chat — only surface new log content.
|
|
98
|
+
- **Max 5** tasks in-flight at once.
|
|
99
|
+
- **Max fix rounds** per task as defined by `maxFixRounds` in `skills/planning/create-task/pipeline.json`.
|
|
100
|
+
- **Always** execute chore subagents from the parent feature worktree (`.agent-cortex/worktrees/<parent-id>`), never from repo root.
|
|
101
|
+
- **Never** auto-merge PRs. Merges are human-controlled.
|
|
102
|
+
- **Only continue past a feature review gate after the feature PR HITL task bead is closed by a human (after merge into the epic branch).**
|
|
103
|
+
- **Only continue past an epic review gate after the epic PR is merged into `main`.**
|
|
104
|
+
- **When a feature hits the HITL PR gate, push and open the PR immediately and report the URL — do not wait for explicit approval to push or create the PR.**
|
|
105
|
+
- **Always** bump the patch version in `plugin.json` as part of any commit that changes agent or skill files.
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: run-pipeline-stage
|
|
3
|
+
description: Execute a single pipeline stage for a task. Use when you want to work through beads inline, pick up a specific stage bead, or work without the full ralph parallel orchestrator.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Run Pipeline Stage
|
|
7
|
+
|
|
8
|
+
Execute a single pipeline stage. Stage beads (`code`, `verify`, `review`, `document`) are created by the `create-task` skill from the pipeline definition in `skills/planning/create-task/pipeline.json`; this skill handles executing one at a time.
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
1. Run `bd prime` and hold the output for your own context. Subagents you spawn can run `bd prime` themselves if they need project context.
|
|
13
|
+
2. If no bead is specified, run `bd ready` and ask the user which to work on.
|
|
14
|
+
3. Claim the bead with `bd update <id> --claim`.
|
|
15
|
+
4. Read the bead's `stage:*` label to determine which stage to execute.
|
|
16
|
+
5. Load the universal stage runner prompt from `skills/workflow/run-pipeline-stage/prompts/stage-runner.md`.
|
|
17
|
+
6. Populate `<stage>` (from the bead's `stage:*` label), and follow `skills/workflow/run-pipeline-stage/playbooks/<stage>.md` for stage-specific behavior before spawning a subagent.
|
|
18
|
+
|
|
19
|
+
## Progress Report
|
|
20
|
+
|
|
21
|
+
To generate a Markdown snapshot of all bead status (Mermaid dependency graph, active work table, completed list), run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# workspace must be the absolute path of the project — never . or $(pwd)
|
|
25
|
+
workspace="/absolute/path/to/project"
|
|
26
|
+
pnpm --prefix skills/workflow/run-pipeline-stage/scripts exec tsx generate-progress.ts --workspace "$workspace"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
To typecheck or test the scripts package:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
pnpm --prefix skills/workflow/run-pipeline-stage/scripts typecheck
|
|
33
|
+
pnpm --prefix skills/workflow/run-pipeline-stage/scripts test
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The data-fetch layer (`parseBdList` / `parseBdShow`) is kept separate from the renderer so the output format can be swapped without re-fetching.
|
|
37
|
+
|
|
38
|
+
## Progress Logging
|
|
39
|
+
|
|
40
|
+
When running inside the ralph orchestrator, subagents must write structured progress lines to `.agent-cortex/ralph/ralph-{bead-id}.log` (appending) so ralph can surface live updates. The bead ID and log file path are provided in each prompt.
|
|
41
|
+
|
|
42
|
+
**Format** — one entry per line:
|
|
43
|
+
```
|
|
44
|
+
[ISO-timestamp] [bead-id] [stage] message
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**When to log:**
|
|
48
|
+
- Stage start: `[...] [abc-123] [code] Stage started`
|
|
49
|
+
- Stage transitions: `[...] [abc-123] [code→verify] Stage complete`, `[...] [abc-123] [verify→review] PASS`, `[...] [abc-123] [verify→fix] FAIL`
|
|
50
|
+
- Key events only:
|
|
51
|
+
- Test results: `Tests: 12 passed, 0 failed`
|
|
52
|
+
- Lint result: `Lint: PASS` or `Lint: FAIL — <brief reason>`
|
|
53
|
+
- Build errors: `Build failed: <brief reason>`
|
|
54
|
+
- Security scan result: `Security scan: PASS` or `Security scan: FAIL — <finding>`
|
|
55
|
+
- Any significant blocker or decision
|
|
56
|
+
|
|
57
|
+
**How to write a log line:**
|
|
58
|
+
```bash
|
|
59
|
+
mkdir -p .agent-cortex/ralph && echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] [bead-id] [stage] message" >> .agent-cortex/ralph/ralph-bead-id.log
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Do not log every file read or minor action — only transitions and key events.
|
|
63
|
+
|
|
64
|
+
## Pipeline
|
|
65
|
+
|
|
66
|
+
The canonical pipeline is defined in `skills/planning/create-task/pipeline.json`. Current stages:
|
|
67
|
+
|
|
68
|
+
| Stage | Notes |
|
|
69
|
+
|-------|-------|
|
|
70
|
+
| **code** | Implement the task using a test-driven approach |
|
|
71
|
+
| **verify** | Run the project's test and lint commands and report the outcome |
|
|
72
|
+
| **review** | Review the implementation for security, correctness, and alignment with task requirements |
|
|
73
|
+
| **document** | Review changes and update documentation if key decisions, behaviour changes, or constraints were introduced |
|
|
74
|
+
|
|
75
|
+
The fix loop (on verify or review failure) is controlled by `maxFixRounds` in `pipeline.json`.
|
|
76
|
+
|
|
77
|
+
### Stage Transitions
|
|
78
|
+
|
|
79
|
+
Before dispatching a subagent for any stage, run these two commands (replacing `<id>` and `<stage>` with the bead ID and the stage about to start):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
bd tag <id> stage:<stage>
|
|
83
|
+
# workspace must be the absolute path of the worktree — never . or $(pwd)
|
|
84
|
+
workspace="/absolute/path/to/worktree"
|
|
85
|
+
mkdir -p "$workspace/.agent-cortex/ralph"
|
|
86
|
+
pnpm --prefix skills/workflow/run-pipeline-stage/scripts exec tsx generate-progress.ts --workspace "$workspace" > "$workspace/.agent-cortex/ralph/progress.md"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
This tags the bead with its current stage (beads are the source of truth for stage progress) and regenerates the progress doc so any inline pairing session stays current.
|
|
90
|
+
|
|
91
|
+
## Dispatch Rules
|
|
92
|
+
|
|
93
|
+
| Stage completed | Condition | Next action |
|
|
94
|
+
|-----------------|-----------|-------------|
|
|
95
|
+
| `code` | — | Run **verify** stage |
|
|
96
|
+
| `verify` | `OUTCOME: SUCCESS` | Run **review** stage |
|
|
97
|
+
| `verify` | `OUTCOME: BLOCKED` | Create a `stage:fix` chore (see _Feedback Beads_) |
|
|
98
|
+
| `review` | `OUTCOME: SUCCESS` | Run **document** stage |
|
|
99
|
+
| `review` | `OUTCOME: BLOCKED` and fixRounds < maxFixRounds | Create a `stage:fix` chore (see _Feedback Beads_); increment fixRounds |
|
|
100
|
+
| `review` | `OUTCOME: BLOCKED` and fixRounds ≥ maxFixRounds | `bd update <parent-id> --status blocked --notes "max fix rounds reached"` — record for shutdown |
|
|
101
|
+
| `document` | — | `bd close <id>` — done |
|
|
102
|
+
|
|
103
|
+
`maxFixRounds` is read from `skills/planning/create-task/pipeline.json` (`maxFixRounds` field, currently `4`).
|
|
104
|
+
|
|
105
|
+
### Fix loop flow
|
|
106
|
+
|
|
107
|
+
When a `stage:fix` chore completes, the next stage depends on which stage triggered the fix:
|
|
108
|
+
- **Fix after verify failure** → re-run **verify**
|
|
109
|
+
- **Fix after review failure** → re-run **review**
|
|
110
|
+
|
|
111
|
+
The orchestrator (ralph or inline agent) tracks fix rounds and re-dispatches the original stage after the fix chore completes.
|
|
112
|
+
|
|
113
|
+
## Feedback Beads
|
|
114
|
+
|
|
115
|
+
When a stage reports a failure or rejection, the orchestrator creates a new chore bead whose description contains the feedback. This keeps feedback durable and visible, and makes the orchestrator's dispatch path uniform — it just picks up whatever `bd ready` returns.
|
|
116
|
+
|
|
117
|
+
**Create the bead:**
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
new_id=$(bd create "[<parent-id>] <title>" --type chore \
|
|
121
|
+
--description "<feedback content from REPORT>" --priority <parent-priority> -q)
|
|
122
|
+
bd tag $new_id stage:<next-stage>
|
|
123
|
+
bd tag $new_id workflow:ralph
|
|
124
|
+
bd dep add $new_id <parent-id> --type parent-child
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
| Triggering outcome | Suggested title | Next stage tag | Feedback content to put in description |
|
|
128
|
+
|---|---|---|---|
|
|
129
|
+
| `OUTCOME: BLOCKED` from verify | `Fix: verify failures` | `stage:code` | Full BLOCKING_ISSUES list |
|
|
130
|
+
| `OUTCOME: BLOCKED` from review | `Fix: reviewer feedback` | `stage:fix` | Full BLOCKING_ISSUES list |
|
|
131
|
+
|
|
132
|
+
After creating the feedback bead, do **not** dispatch a new agent immediately — the bead will appear in `bd ready` on the next cycle and be dispatched through the normal scheduling path. The stage that consumed the feedback from the REPORT is now finished; its agent result has been processed.
|
|
133
|
+
|
|
134
|
+
## Report Format
|
|
135
|
+
|
|
136
|
+
Every subagent prompt **must** end with this instruction:
|
|
137
|
+
|
|
138
|
+
> End your response with a `---REPORT---` block in exactly this format:
|
|
139
|
+
> ```
|
|
140
|
+
> ---REPORT---
|
|
141
|
+
> BEAD_ID: <id>
|
|
142
|
+
> STAGE_COMPLETED: <code|verify|review|document>
|
|
143
|
+
> SUMMARY: <2–3 sentence summary of what was done>
|
|
144
|
+
> FILES_CHANGED: <comma-separated list, or "none">
|
|
145
|
+
> OUTCOME: <SUCCESS|BLOCKED>
|
|
146
|
+
> BLOCKING_ISSUES: ← only if OUTCOME is BLOCKED
|
|
147
|
+
> - <specific blocking issue>
|
|
148
|
+
> ---
|
|
149
|
+
> ```
|
|
150
|
+
|
|
151
|
+
Subagents report facts. **Do not ask subagents to suggest or predict the next step.**
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Stage Playbook: coding
|
|
2
|
+
|
|
3
|
+
## Stage Instructions
|
|
4
|
+
|
|
5
|
+
1. Invoke `style-tests` before writing tests.
|
|
6
|
+
2. Invoke `tdd` for the red-green-refactor implementation loop.
|
|
7
|
+
3. Invoke `style-code` before making code changes.
|
|
8
|
+
4. Do not add speculative code — only what is required by current tests/requirements.
|
|
9
|
+
5. Make only task-scoped changes; avoid unrelated refactors.
|
|
10
|
+
6. Use context7 for third-party libraries when API/version details matter.
|
|
11
|
+
|
|
12
|
+
## Stage Outcome
|
|
13
|
+
|
|
14
|
+
- Set `OUTCOME: SUCCESS` when implementation passes all tests and meets requirements.
|
|
15
|
+
- Set `OUTCOME: BLOCKED` if tests fail or requirements cannot be met.
|
|
16
|
+
- If blocked, list issues under `BLOCKING_ISSUES`.
|
|
17
|
+
- `FILES_CHANGED` lists all modified source/test files.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Stage Playbook: documenting
|
|
2
|
+
|
|
3
|
+
## Stage Instructions
|
|
4
|
+
|
|
5
|
+
1. Invoke the `style-documentation` skill before making documentation changes.
|
|
6
|
+
2. Update docs only when changes introduce:
|
|
7
|
+
- a key decision,
|
|
8
|
+
- macro-level behavior change,
|
|
9
|
+
- a lasting constraint/trade-off.
|
|
10
|
+
3. Prefer updating existing docs; create new docs only when no suitable home exists.
|
|
11
|
+
4. Do not modify source code in this stage.
|
|
12
|
+
|
|
13
|
+
## Stage Outcome
|
|
14
|
+
|
|
15
|
+
- Set `OUTCOME: SUCCESS` when docs are updated as needed (or none needed).
|
|
16
|
+
- Set `OUTCOME: BLOCKED` if unable to update or content guidance is unclear.
|
|
17
|
+
- If blocked, list issues under `BLOCKING_ISSUES`.
|
|
18
|
+
- `FILES_CHANGED` lists docs touched, or `none` if no doc change is needed.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Stage Playbook: fixing
|
|
2
|
+
|
|
3
|
+
## Stage Instructions
|
|
4
|
+
|
|
5
|
+
1. Invoke `style-tests` before writing or updating tests.
|
|
6
|
+
2. Invoke `tdd` to drive any implementation or test changes.
|
|
7
|
+
3. Invoke `style-code` before making code changes.
|
|
8
|
+
4. Apply only the requested changes from the triggering feedback.
|
|
9
|
+
5. Do not perform unrelated modifications.
|
|
10
|
+
6. Preserve task scope and keep fixes minimal and explicit.
|
|
11
|
+
|
|
12
|
+
## Stage Outcome
|
|
13
|
+
|
|
14
|
+
- Set `OUTCOME: SUCCESS` when requested changes are successfully applied.
|
|
15
|
+
- Set `OUTCOME: BLOCKED` if unable to apply changes or guidance is unclear.
|
|
16
|
+
- If blocked, list issues under `BLOCKING_ISSUES`.
|
|
17
|
+
- `FILES_CHANGED` lists files updated to address requested changes.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Stage Playbook: reviewing
|
|
2
|
+
|
|
3
|
+
## Stage Instructions
|
|
4
|
+
|
|
5
|
+
1. Invoke the `review-security` skill first.
|
|
6
|
+
2. If security verdict is FAIL:
|
|
7
|
+
- set `OUTCOME: BLOCKED`,
|
|
8
|
+
- include each finding under `BLOCKING_ISSUES`,
|
|
9
|
+
- stop further review.
|
|
10
|
+
3. Invoke `style-code` and `style-tests` for code and test review criteria.
|
|
11
|
+
4. Review for correctness, requirement alignment, and material quality issues.
|
|
12
|
+
5. Do not request changes for stylistic preferences alone.
|
|
13
|
+
|
|
14
|
+
## Stage Outcome
|
|
15
|
+
|
|
16
|
+
- Set `OUTCOME: SUCCESS` if approved.
|
|
17
|
+
- Set `OUTCOME: BLOCKED` if changes are requested.
|
|
18
|
+
- If blocked, enumerate required changes under `BLOCKING_ISSUES`.
|
|
19
|
+
- `FILES_CHANGED` should be `none`.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Stage Playbook: verifying
|
|
2
|
+
|
|
3
|
+
## Stage Instructions
|
|
4
|
+
|
|
5
|
+
1. Discover test/lint/check commands from project conventions (`package.json`, `Makefile`, language configs).
|
|
6
|
+
2. Run each discovered command in project root and capture output.
|
|
7
|
+
3. Do not fix failures in this stage — report only.
|
|
8
|
+
|
|
9
|
+
## Stage Outcome
|
|
10
|
+
|
|
11
|
+
- Set `OUTCOME: SUCCESS` when all commands succeed.
|
|
12
|
+
- Set `OUTCOME: BLOCKED` when any command fails.
|
|
13
|
+
- If blocked, summarize failures under `BLOCKING_ISSUES`.
|
|
14
|
+
- `FILES_CHANGED` should be `none`.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
## Project context
|
|
2
|
+
Run `bd prime` if you need project-level context (conventions, tech stack, goals).
|
|
3
|
+
|
|
4
|
+
## Stage metadata
|
|
5
|
+
- Stage: `<stage>`
|
|
6
|
+
- Playbook: `skills/workflow/run-pipeline-stage/playbooks/<stage>.md`
|
|
7
|
+
|
|
8
|
+
## Bead specification
|
|
9
|
+
<bd show <id> output — verbatim>
|
|
10
|
+
|
|
11
|
+
## Prior stage context (if any)
|
|
12
|
+
<prior REPORT fields, dependency context, and relevant files>
|
|
13
|
+
|
|
14
|
+
## Progress log
|
|
15
|
+
Write progress to: `.agent-cortex/ralph/ralph-<bead-id>.log`
|
|
16
|
+
|
|
17
|
+
## Instructions
|
|
18
|
+
1. Read and follow the playbook file listed above.
|
|
19
|
+
2. Treat the bead as the source-of-truth specification (not a prompt script).
|
|
20
|
+
3. Keep output factual and stage-scoped.
|