You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plans enable **parallel, non-overlapping work**. Each task must be independent; agents work in a **dedicated git worktree** (see worktrees skill).
9
9
10
+
**Where to keep plan.md and spec files:** Create and edit plan.md (and the other Ralph spec files: goal.md/spec.md, state.json, decisions.md) in a **dedicated folder** under the **specs** folder at the **repo root**: `specs/<feature-or-component-name>/`. Example: `specs/resizable-container/plan.md`. Do not place spec files next to source (e.g. not under `src/components/...`).
11
+
10
12
## Required plan.md Structure
11
13
12
14
1.**Worktree section** (top) — path, branch, base branch. See worktrees skill.
description: Collaboration protocol for Ralph loop (Plan → Act → Reflect → Refine). Use when working from goal.md, plan.md, state.json, decisions.md; when executing tasks in a shared plan; or when the user mentions Ralph, multi-agent, or file-based collaboration.
3
+
description: Collaboration protocol for Ralph loop (Plan → Act → Reflect → Refine). Use when working from spec files in specs/<name>/ (goal.md/spec.md, plan.md, state.json, decisions.md); when executing tasks in a shared plan; or when the user mentions Ralph, multi-agent, or file-based collaboration.
4
4
---
5
5
6
6
# Ralph Protocol (Agent Collaboration)
@@ -9,27 +9,29 @@ Files are the source of truth. All agents share memory via files. No silent deci
|**goal.md**| What we achieve; success criteria; constraints; non-goals. Read first. Only change if goal actually changes. No implementation details. |
15
-
|**plan.md**| How we achieve it. Ordered tasks, ownership, dependencies, status (`pending \| in-progress \| done \| blocked`). Propose changes before big deviations; don't rewrite completed sections. |
16
-
|**state.json**| Current memory. Task statuses, flags (`blocked`, `needs-review`, etc.). Update immediately after acting. Read before assuming anything. |
17
-
|**decisions.md**| Log of non-trivial decisions (what + why). Append only; never delete. Prevents reopening or contradicting past choices. |
12
+
**Location:** Generate and keep spec files in a **dedicated folder** inside the **specs** folder at the **root of the repo**: `specs/<feature-or-component-name>/`. Example: `specs/resizable-container/goal.md`, `specs/resizable-container/plan.md`, `specs/resizable-container/state.json`, `specs/resizable-container/decisions.md`. One folder per feature or component; do not put spec files next to source (e.g. not under `src/components/...`).
|**spec.md** or **goal.md**| What we achieve; success criteria; constraints; non-goals. Read first. Only change if goal actually changes. No implementation details. |
17
+
|**plan.md**| How we achieve it. Ordered tasks, ownership, dependencies, status (`pending \| in-progress \| done \| blocked`). Propose changes before big deviations; don't rewrite completed sections. |
18
+
|**state.json**| Current memory. Task statuses, flags (`blocked`, `needs-review`, etc.). Update immediately after acting. Read before assuming anything. |
19
+
|**decisions.md**| Log of non-trivial decisions (what + why). Append only; never delete. Prevents reopening or contradicting past choices. |
**Before acting:** Read the spec files in `specs/<name>/`: spec.md (or goal.md) → plan.md → state.json → decisions.md.
22
24
23
25
**During:** Follow the plan; no overlapping work unless coordinated; no undocumented decisions.
24
26
25
-
**After:** Update state.json → record decisions in decisions.md → update task status in plan.md. Optionally add learnings to observations.md.
27
+
**After:** Update `specs/<name>/state.json` → record decisions in `specs/<name>/decisions.md` → update task status in `specs/<name>/plan.md`. Optionally add learnings to observations.md in the same folder.
26
28
27
29
**Prohibited:** Decisions without recording; using chat as memory; re-solving done problems; changing goals implicitly; overwriting files without explanation.
28
30
29
31
## Task ownership (critical)
30
32
31
33
- Work on **exactly one** task at a time.
32
-
- That task must be in plan.md, marked `in-progress` and assigned to you.
34
+
- That task must be in the plan file (`specs/<name>/plan.md`), marked `in-progress` and assigned to you.
33
35
- Do not change files for other tasks, even if small.
34
36
35
37
## Commit scope
@@ -42,6 +44,6 @@ When acceptance criteria involve UI: use Playwright (MCP or project config). Tak
42
44
43
45
## Loop reminder
44
46
45
-
Each iteration: Plan (update plan.md if needed) → Act (scoped work) → Reflect (learnings) → Refine (plan or decisions).
47
+
Each iteration: Plan (update `specs/<name>/plan.md` if needed) → Act (scoped work) → Reflect (learnings) → Refine (plan or decisions).
46
48
47
49
For decision log format and state.json example, see [reference.md](reference.md). Plan structure and worktrees: use make-plans and worktrees skills.
Copy file name to clipboardExpand all lines: .cursor/skills/ralph-protocol/reference.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
Source: `.ai/RALPH.md`
4
4
5
+
**Spec files location:** Keep all spec files (spec.md, plan.md, state.json, decisions.md) in a dedicated folder at repo root: `specs/<feature-or-component-name>/`.
Then in plan.md include a **Worktree** section with path, branch, base branch. Agent must `cd` into the worktree before any work.
26
+
Then in the plan file (`specs/<plan-name>/plan.md`) include a **Worktree** section with path, branch, base branch. Agent must `cd` into the worktree before any work.
0 commit comments