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
feat: separate orchestrator directive from agent tasks
- IMPLEMENTATION_PLAN.md now contains single meta-directive: "Check .context/TASKS.md"
- Tasks live in agent's mind (.context/TASKS.md), not orchestrator
- ctx init creates IMPLEMENTATION_PLAN.md in project root
- PROMPT.md updated to check .context/TASKS.md for task selection
- Removed unused root templates/ directory (internal/templates/ is source of truth)
- Added decision record and learnings for orchestrator/agent separation
- Marked "Claude hooks" task complete in TASKS.md
Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
Copy file name to clipboardExpand all lines: .context/DECISIONS.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,3 +171,30 @@ ctx init # Creates BOTH .context/ AND .claude/hooks/
171
171
- Only works with Claude Code (other tools need different approach)
172
172
- Requires jq for JSON parsing in hook script
173
173
- Session files are .jsonl format (need tooling to read)
174
+
175
+
---
176
+
177
+
## [2025-01-21] Separate Orchestrator Directive from Agent Tasks
178
+
179
+
**Status**: Accepted
180
+
181
+
**Context**: Two task systems existed: `IMPLEMENTATION_PLAN.md` (Ralph Loop orchestrator) and `.context/TASKS.md` (ctx's own context). Ralph would find IMPLEMENTATION_PLAN.md complete and exit, ignoring .context/TASKS.md.
182
+
183
+
**Decision**: Clean separation of concerns:
184
+
-**`.context/TASKS.md`** = Agent's mind. Tasks the agent decided need doing.
185
+
-**`IMPLEMENTATION_PLAN.md`** = Orchestrator's directive. A single meta-task: "Check your tasks."
186
+
187
+
The orchestrator doesn't maintain a parallel ledger — it just tells the agent to check its own mind.
188
+
189
+
**Rationale**:
190
+
- Agent autonomy: the agent owns its task list
191
+
- Single source of truth for tasks
192
+
- Orchestrator is minimal, not a micromanager
193
+
- Fresh `ctx init` deployments can have one directive: "Check .context/TASKS.md"
194
+
- Prevents task list drift between two files
195
+
196
+
**Consequences**:
197
+
-`PROMPT.md` now references `.context/TASKS.md` for task selection
198
+
-`IMPLEMENTATION_PLAN.md` becomes a thin directive layer
199
+
- Historical milestones are archived, not active tasks
200
+
- North Star goals live in IMPLEMENTATION_PLAN.md (meta-level, not tasks)
Copy file name to clipboardExpand all lines: .context/LEARNINGS.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,3 +129,35 @@ The `.context/` directory is an ctx convention. Claude won't know about it unles
129
129
CGO_ENABLED=0 go build -o ctx ./cmd/ctx
130
130
CGO_ENABLED=0 go test ./...
131
131
```
132
+
133
+
---
134
+
135
+
## Project Structure
136
+
137
+
### One Templates Directory, Not Two
138
+
**Discovered**: 2025-01-21
139
+
140
+
**Context**: Confusion arose about `templates/` (root) vs `internal/templates/` (embedded).
141
+
142
+
**Lesson**: Only `internal/templates/` matters — it's where Go embeds files into the binary. A root `templates/` directory is spec baggage that serves no purpose.
143
+
144
+
**The actual flow:**
145
+
```
146
+
internal/templates/ ──[ctx init]──> .context/
147
+
(baked into binary) (agent's working copy)
148
+
```
149
+
150
+
**Application**: Don't create duplicate template directories. One source of truth.
151
+
152
+
### Orchestrator vs Agent Tasks
153
+
**Discovered**: 2025-01-21
154
+
155
+
**Context**: Ralph Loop checked `IMPLEMENTATION_PLAN.md`, found all tasks done, exited — ignoring `.context/TASKS.md`.
156
+
157
+
**Lesson**: Separate concerns:
158
+
-**`IMPLEMENTATION_PLAN.md`** = Orchestrator directive ("check your tasks")
159
+
-**`.context/TASKS.md`** = Agent's mind (actual task list)
160
+
161
+
The orchestrator shouldn't maintain a parallel ledger. It just says "check your mind."
162
+
163
+
**Application**: For new projects, `IMPLEMENTATION_PLAN.md` has ONE task: "Check `.context/TASKS.md`"
- Implement `ctx watch` — Watch for context-update commands
88
-
89
-
### Milestone 5: Integration
90
-
- Implement `ctx hook` — Generate AI tool integration configs
91
-
- Add `--help` text for all commands
92
-
- Add `--version` flag with build-time version
93
-
94
-
### Milestone 6: Testing & Release
95
-
- Write unit tests for `internal/context/` (loader, parser)
96
-
- Write unit tests for `internal/drift/` (detector)
97
-
- Write integration tests for CLI commands
98
-
- Create `scripts/build-all.sh` for cross-platform builds
99
-
- Create `.github/workflows/release.yml` for GitHub Actions
100
-
- Create `examples/demo/` with sample `.context/` directory
101
-
- Update README.md with installation and usage instructions
59
+
1. Read `IMPLEMENTATION_PLAN.md` for the current directive
60
+
2. Follow the directive — typically: "Check `.context/TASKS.md`"
61
+
3. Read `.context/TASKS.md` and pick the **first unchecked item** in "Next Up"
62
+
63
+
**IF NO UNCHECKED ITEMS in `.context/TASKS.md`:**
64
+
1. Check `IMPLEMENTATION_PLAN.md` for North Star goals
65
+
2. Remind user about Endgame goals before exiting
66
+
3. Output `<promise>DONE</promise>`
67
+
68
+
**Philosophy:** Tasks live in the agent's mind (`.context/TASKS.md`). The orchestrator (`IMPLEMENTATION_PLAN.md`) provides the meta-directive, not the task list
102
69
103
70
---
104
71
@@ -134,10 +101,11 @@ go vet ./... # No vet errors
134
101
135
102
## PHASE 5: UPDATE CONTEXT
136
103
137
-
1. Mark completed task `[x]` in `IMPLEMENTATION_PLAN.md`
138
-
2. If you made an architectural decision → document in `specs/` or `.context/DECISIONS.md`
139
-
3. If you learned a gotcha → add to `.context/LEARNINGS.md`
140
-
4. If build commands changed → update `AGENTS.md`
104
+
1. Mark completed task `[x]` in `.context/TASKS.md`
105
+
2. Move task to "Completed (Recent)" section with date
106
+
3. If you made an architectural decision → document in `.context/DECISIONS.md`
107
+
4. If you learned a gotcha → add to `.context/LEARNINGS.md`
108
+
5. If build commands changed → update `AGENTS.md`
141
109
142
110
---
143
111
@@ -160,9 +128,9 @@ Complete ONE task, then stop. The loop handles continuation.
160
128
161
129
### NO CHAT
162
130
Never ask questions. If blocked:
163
-
1.Add `Blocked: [reason]` to `IMPLEMENTATION_PLAN.md`
164
-
2. Move to next task
165
-
3. If ALL blocked: `<promise>SYSTEM_BLOCKED</promise>`
131
+
1.Move task to "Blocked" section in `.context/TASKS.md` with reason
132
+
2. Move to next task in "Next Up"
133
+
3. If ALL tasks blocked: `<promise>SYSTEM_BLOCKED</promise>`
166
134
167
135
### MEMORY IS THE FILESYSTEM
168
136
You will not remember this conversation. Write everything important to files.
@@ -309,12 +277,10 @@ Never assume. If you don't see it in files, you don't know it.
309
277
310
278
Output `<promise>DONE</promise>` ONLY when ALL of these are true:
311
279
312
-
1.All commands in `specs/cli.md`are implemented
280
+
1.`.context/TASKS.md`has no unchecked items in "Next Up"
313
281
2.`go build ./...` passes
314
282
3.`go test ./...` passes
315
-
4.`ctx init && ctx status && ctx drift` works end-to-end
316
-
5.`scripts/build-all.sh` produces binaries for linux/darwin/windows
317
-
6. README.md has installation instructions
283
+
4. You have reminded the user about the North Star goals in `IMPLEMENTATION_PLAN.md`
0 commit comments