@jaybeeuu/agent-cortex 2.1.0 → 2.2.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.
Files changed (178) hide show
  1. package/CHANGELOG.md +387 -0
  2. package/README.md +33 -13
  3. package/agents/README.md +22 -10
  4. package/agents/plan/agent.md +2 -2
  5. package/agents/ralph/agent.md +126 -88
  6. package/agents/ralph/claude/frontmatter.json +3 -3
  7. package/agents/ralph/claude/wake.md +46 -0
  8. package/agents/ralph/pi/{polling.md → wake.md} +35 -20
  9. package/agents/ralph-plan/agent.md +23 -11
  10. package/bin/agent-cortex.mjs +66 -4
  11. package/bin/installers/claude.mjs +182 -68
  12. package/bin/installers/pi.mjs +200 -24
  13. package/extensions/agent-guardrails/README.md +1 -1
  14. package/extensions/agent-guardrails/guardrails.ts +1 -1
  15. package/extensions/agent-guardrails/index.ts +1 -1
  16. package/extensions/agent-modes/discover.test.ts +2 -2
  17. package/hooks/claude/scripts/notify.mjs +8 -1
  18. package/lib/cli.mjs +91 -2
  19. package/package.json +27 -3
  20. package/scripts/check-changeset.mjs +4 -0
  21. package/scripts/check-no-sync.mjs +5 -1
  22. package/scripts/lib/compose-agent.mjs +69 -9
  23. package/scripts/lib/fs.mjs +10 -2
  24. package/scripts/lib/migrate.mjs +736 -0
  25. package/scripts/lib/release-gates.mjs +21 -1
  26. package/scripts/lib/skill-frontmatter.mjs +23 -6
  27. package/scripts/lib/skill-links.mjs +52 -0
  28. package/scripts/lib/verify-worker-tree.mjs +25 -0
  29. package/scripts/resolve-publish-command.mjs +4 -0
  30. package/skills/engineering/design-an-interface/SKILL.md +3 -3
  31. package/skills/engineering/grill-with-docs/SKILL.md +3 -5
  32. package/skills/engineering/improve-codebase-architecture/SKILL.md +5 -4
  33. package/skills/engineering/tdd/SKILL.md +5 -7
  34. package/skills/engineering/technical-direction/SKILL.md +5 -5
  35. package/skills/planning/classify-bead/REFERENCE.md +3 -3
  36. package/skills/planning/classify-bead/SKILL.md +14 -9
  37. package/skills/planning/classify-bead/scripts/classify-bead.mjs +5 -4
  38. package/skills/planning/create-task/REFERENCE.md +52 -3
  39. package/skills/planning/create-task/SKILL.md +70 -26
  40. package/skills/planning/create-task/scripts/{create-chores.ts → create-chores.mjs} +48 -23
  41. package/skills/planning/flesh-out-idea/REFERENCE.md +116 -0
  42. package/skills/planning/flesh-out-idea/SKILL.md +146 -0
  43. package/skills/planning/prd-to-tasks/REFERENCE.md +54 -5
  44. package/skills/planning/prd-to-tasks/SKILL.md +22 -16
  45. package/skills/planning/record-idea/FORMAT.md +66 -17
  46. package/skills/planning/record-idea/SKILL.md +48 -24
  47. package/skills/planning/request-refactor-plan/SKILL.md +4 -4
  48. package/skills/planning/spec-to-tickets/SKILL.md +5 -5
  49. package/skills/planning/write-a-prd/SKILL.md +8 -9
  50. package/skills/planning/write-a-ticket/SKILL.md +4 -6
  51. package/skills/productivity/bd-tool/SKILL.md +15 -10
  52. package/skills/productivity/grill-me/SKILL.md +5 -0
  53. package/skills/productivity/init-beads/SKILL.md +3 -3
  54. package/skills/productivity/migration/REFERENCE.md +227 -0
  55. package/skills/productivity/migration/SKILL.md +188 -0
  56. package/skills/productivity/validate-agent-dir/scripts/{validate-agent-dir.ts → validate-agent-dir.mjs} +49 -28
  57. package/skills/productivity/write-a-skill/SKILL.md +5 -5
  58. package/skills/review/maintain-agent-docs/SKILL.md +5 -7
  59. package/skills/review/refactor-skill/SKILL.md +4 -3
  60. package/skills/review/review-security/SKILL.md +3 -5
  61. package/skills/style/style-code/SKILL.md +5 -10
  62. package/skills/style/style-comms/SKILL.md +5 -7
  63. package/skills/style/style-documentation/SKILL.md +5 -6
  64. package/skills/style/style-tests/SKILL.md +5 -7
  65. package/skills/workflow/git-workflow/SKILL.md +28 -4
  66. package/skills/workflow/hitl-collab/SKILL.md +4 -6
  67. package/skills/workflow/plan/SKILL.md +41 -30
  68. package/skills/workflow/ralph/REFERENCE.md +182 -51
  69. package/skills/workflow/ralph/SKILL.md +89 -50
  70. package/skills/workflow/run-pipeline-stage/SKILL.md +72 -71
  71. package/skills/workflow/run-pipeline-stage/playbooks/code.md +11 -0
  72. package/skills/workflow/run-pipeline-stage/playbooks/document.md +12 -0
  73. package/skills/workflow/run-pipeline-stage/playbooks/fix.md +12 -0
  74. package/skills/workflow/run-pipeline-stage/playbooks/review.md +11 -0
  75. package/skills/workflow/run-pipeline-stage/playbooks/verify.md +13 -0
  76. package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +73 -1
  77. package/token-map.README.md +9 -4
  78. package/token-map.json +13 -6
  79. package/.agents/skills/style-versioning/SKILL.md +0 -172
  80. package/.changeset/README.md +0 -8
  81. package/.changeset/config.json +0 -11
  82. package/.github/workflows/ci.yml +0 -302
  83. package/.junie/guidelines.md +0 -87
  84. package/.junie/mcp/mcp.json +0 -10
  85. package/AGENTS.md +0 -153
  86. package/agents/ralph/claude/polling.md +0 -31
  87. package/agents-native/ralph.md +0 -203
  88. package/docs/claude-hooks.md +0 -144
  89. package/docs/commit-signing.md +0 -231
  90. package/docs/ideas/auto-model-selection.md +0 -75
  91. package/docs/ideas/ban-content-assertion-tests.md +0 -75
  92. package/docs/ideas/bead-progress-notes-for-session-resumption.md +0 -75
  93. package/docs/ideas/classify-beads-via-deterministic-script-with-agent-fallback.md +0 -70
  94. package/docs/ideas/ctx-alias-version-and-update-commands.md +0 -65
  95. package/docs/ideas/ctx-feedback-command-for-capturing-ideas-from-any-machine.md +0 -67
  96. package/docs/ideas/dedicated-review-tests-skill.md +0 -71
  97. package/docs/ideas/deployment-beads-for-post-merge-pipelines.md +0 -36
  98. package/docs/ideas/design-and-delivery-as-separate-bead-trees/design-and-delivery-as-separate-bead-trees.md +0 -99
  99. package/docs/ideas/enable-signed-commit-enforcement-changesets-bot-commits-must-be-signed.md +0 -42
  100. package/docs/ideas/extension-manifests.md +0 -121
  101. package/docs/ideas/improve-pi-system-prompt.md +0 -43
  102. package/docs/ideas/map-every-cortex-tool-to-a-real-pi-equivalent.md +0 -95
  103. package/docs/ideas/model-selector.md +0 -40
  104. package/docs/ideas/pi-task-memory.md +0 -34
  105. package/docs/ideas/qa-extension.md +0 -43
  106. package/docs/ideas/record-idea-implementation-questions.md +0 -68
  107. package/docs/ideas/record-ideas-as-beads.md +0 -115
  108. package/docs/ideas/self-flushing-session.md +0 -72
  109. package/docs/ideas/state-in-beads-not-md.md +0 -69
  110. package/docs/ideas/subagent-visibility.md +0 -72
  111. package/docs/ideas/task-session-context.local.md +0 -95
  112. package/docs/ideas/task-session-context.md +0 -89
  113. package/docs/ideas/test-data-creation-helpers.md +0 -92
  114. package/docs/ideas/test-planning-stage-bead-in-feature-planning.md +0 -68
  115. package/docs/ideas/unified-ci-pipeline.md +0 -28
  116. package/docs/ideas/unify-the-ticket-and-task-decomposition-workflows.md +0 -71
  117. package/docs/ideas/worktree-housekeeping-for-closed-beads.md +0 -39
  118. package/docs/inspirations.md +0 -33
  119. package/docs/research/disable-model-invocation.md +0 -82
  120. package/docs/research/gas-city-research.md +0 -256
  121. package/docs/research/skill-design-research.md +0 -286
  122. package/docs/research/skill-improvements-analysis.md +0 -117
  123. package/docs/research/skill-patterns-research.md +0 -24
  124. package/docs/skills/skill-anatomy.md +0 -200
  125. package/docs/technical-direction/harness-config.md +0 -177
  126. package/docs/technical-direction/migration-execution-labels.md +0 -177
  127. package/docs/user-preferences.md +0 -17
  128. package/extensions/agent-guardrails/tsconfig.json +0 -12
  129. package/extensions/agent-modes/tsconfig.json +0 -12
  130. package/extensions/output-style/tsconfig.json +0 -12
  131. package/extensions/session-start/tsconfig.json +0 -12
  132. package/extensions/skill-stats/pnpm-lock.yaml +0 -329
  133. package/extensions/skill-stats/tsconfig.json +0 -12
  134. package/extensions/subagent/agents/planner.md +0 -37
  135. package/extensions/subagent/agents/reviewer.md +0 -35
  136. package/extensions/subagent/agents/scout.md +0 -50
  137. package/extensions/subagent/agents/worker.md +0 -24
  138. package/extensions/subagent/prompts/implement-and-review.md +0 -10
  139. package/extensions/subagent/prompts/implement.md +0 -10
  140. package/extensions/subagent/prompts/scout-and-plan.md +0 -9
  141. package/extensions/subagent/tsconfig.json +0 -12
  142. package/pi/keybindings.json +0 -3
  143. package/pi/settings.json +0 -34
  144. package/pnpm-workspace.yaml +0 -14
  145. package/skills/planning/create-task/scripts/package.json +0 -14
  146. package/skills/planning/create-task/scripts/pnpm-lock.yaml +0 -342
  147. package/skills/planning/create-task/scripts/tsconfig.json +0 -12
  148. package/skills/planning/record-idea/scripts/new-idea.sh +0 -89
  149. package/skills/productivity/validate-agent-dir/scripts/package.json +0 -15
  150. package/skills/productivity/validate-agent-dir/scripts/pnpm-lock.yaml +0 -329
  151. package/skills/productivity/validate-agent-dir/scripts/pnpm-workspace.yaml +0 -2
  152. package/skills/productivity/validate-agent-dir/scripts/tsconfig.json +0 -19
  153. package/skills/productivity/validate-agent-dir/scripts/validate-agent-dir.test.ts +0 -317
  154. package/skills/workflow/run-pipeline-stage/REFERENCE.md +0 -22
  155. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +0 -682
  156. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +0 -588
  157. package/skills/workflow/run-pipeline-stage/scripts/package.json +0 -15
  158. package/skills/workflow/run-pipeline-stage/scripts/pnpm-lock.yaml +0 -342
  159. package/skills/workflow/run-pipeline-stage/scripts/pnpm-workspace.yaml +0 -2
  160. package/skills/workflow/run-pipeline-stage/scripts/tsconfig.json +0 -12
  161. package/test/classify-bead.test.mjs +0 -277
  162. package/test/claude-installer.test.mjs +0 -308
  163. package/test/cli.test.mjs +0 -314
  164. package/test/create-chores.test.mjs +0 -85
  165. package/test/fake-bd.test.mjs +0 -72
  166. package/test/fs.test.mjs +0 -76
  167. package/test/helpers/fake-bd.mjs +0 -87
  168. package/test/helpers/fake-claude.mjs +0 -152
  169. package/test/helpers/fake-pi.mjs +0 -132
  170. package/test/installer.test.mjs +0 -806
  171. package/test/notify-hook.test.mjs +0 -63
  172. package/test/pending-gates.test.mjs +0 -147
  173. package/test/pi-installer.test.mjs +0 -785
  174. package/test/pi-register.test.mjs +0 -342
  175. package/test/pi-sweep.test.mjs +0 -619
  176. package/test/release-gates.test.mjs +0 -190
  177. package/test/skill-frontmatter.test.mjs +0 -137
  178. package/test/verify-worker-tree.test.mjs +0 -120
@@ -1,69 +0,0 @@
1
- # Idea: state-in-beads-not-md
2
-
3
- ## Status
4
- Recorded as bead `agnt-ctx-ul91` (2026-09-22) — awaiting `plan`. Merged with
5
- `bead-progress-notes-for-session-resumption.md` into one bead state model design (this file is
6
- Part 1: WHERE state lives).
7
-
8
- ## Created
9
- 2026-08-30
10
-
11
- ## Problem
12
- Skills write a lot of operational documents that are never meant to be committed or read
13
- by humans at rest — they describe transient notes/current state. Today they land as md files:
14
- - `hitl-collab` writes `.agent-cortex/working-docs/hitl/<bead-id>/handoff.md` — one file per
15
- bead, near-duplicating information that already lives (or should live) on the bead.
16
- - `run-pipeline-stage` / `ralph` write `.agent-cortex/ralph/ralph-{bead-id}.log` and
17
- `.agent-cortex/ralph/progress.md` for live progress surfacing.
18
- These files duplicate bead state, rot as the bead changes, and fragment context across
19
- files + beads. They're also invisible to `bd` tooling (search, deps, sync).
20
-
21
- ## Who benefits
22
- Every agent skill run that produces state (hitl-collab, ralph, run-pipeline-stage, plan,
23
- and any future skill that takes notes). The author benefits from a single source of truth,
24
- and ralph/pipeline state stops living in a `.agent-cortex` attic that drifts from the beads.
25
-
26
- ## Proposed outcome
27
- A general rule stored in agent docs: **any artifact that is notes/current state — not
28
- intended as committable durable documentation — lives in the bead's fields** (`--notes`,
29
- `--context`, `--design`), not in md files.
30
- - Durable, committable docs (SKILL.md, REFERENCE.md, playbooks/, prompts/, docs/) stay files.
31
- - `hitl-collab` handoff: write the handoff content into the HITL bead (`--context`/`--notes`),
32
- drop the `.agent-cortex/working-docs/hitl/<bead-id>/handoff.md` file flow.
33
- - ralph progress/log lines: feed a live progress view off the beads (or a temp/log file kept
34
- explicitly out of the `working-docs` convention) — spike details during planning.
35
- - `record-idea`'s caveat: this same principle is what `record-ideas-as-beads` already applies
36
- to idea records; this idea generalises it to operational/state artifacts.
37
-
38
- ## Validity check
39
- - Evidence we already have: `bd` fields (`--notes`, `--context`, `--design`) support the content
40
- model; `record-ideas-as-beads` already proves bead-field content is workable for structured
41
- records (design decided 2026-08-25). Bead notes are multi-line and markdown-capable.
42
- - Riskiest assumption: live progress surfacing (ralph's log tail / progress.md) can be
43
- satisfied without a scratch file — the bead-update round-trip may be too slow/chatty for
44
- high-frequency log lines; may need a per-run scratch log that is explicitly ephemeral and
45
- deleted on close, rather than a persistent working doc.
46
- - What would invalidate this idea: if bead fields become unwieldy for large attachments (e.g.
47
- long PR summaries), or if a future agent needs shared state that must not be per-bead
48
- (cross-bead coordination) — that's a different problem, not a per-bead note.
49
-
50
- ## Constraints
51
- - Bead content is portable and searchable: `bd show <id>` must remain a comfortable read
52
- surface for handoff/notes.
53
- - Never regress committable docs into beads (AGENTS.md/skills stay in-repo markdown).
54
- - P2 (medium): actively annoying today — hitl-collab handoff docs are already duplicating
55
- bead state.
56
-
57
- ## Next validation step
58
- Pick one skill (hitl-collab is the smallest, clearest case): prototype writing the handoff
59
- into the bead's `--context` (or `--notes`) and read it back with `bd show`, confirm the
60
- HITL reader (ralph/plan/handoff skill) can consume bead-stored handoffs; then extend the
61
- rule to ralph progress with an ephemeral-scratch-log fallback if needed.
62
-
63
- ## Notes
64
- Cross-link: sibling idea `record-ideas-as-beads` (fleshed out 2026-08-25) covers ideas
65
- specifically — once it lands, docs/ideas/ disappears and this record becomes a bead too.
66
- The rule here is the generalisation: beads are for state, files are for durable docs.
67
- Skills that currently write working docs: `hitl-collab` (handoff.md), `ralph` +
68
- `run-pipeline-stage` (ralph-*.log, progress.md). Update `bd-tool`/`git-workflow`/AGENTS.md
69
- conventions if the rule lands.
@@ -1,72 +0,0 @@
1
- # Idea: subagent-visibility
2
-
3
- ## Status
4
- Backlog idea (not implementation-ready)
5
-
6
- ## Created
7
- 2026-08-25
8
-
9
- ## Problem
10
- The bundled `subagent` extension delegates work to separate `pi` processes with isolated
11
- context windows. It streams output live, shows per-agent usage stats (turns, tokens, cost), and
12
- supports abort — but after a run there's no retained record of what each subagent actually did
13
- (files touched, decisions, blockers), and while a run is in flight there's no richer
14
- dashboard-level view of what each agent is up to. There's also no way to influence a running
15
- subagent: you can only watch or Ctrl+C the whole thing. For the ralph-style parallel dispatches
16
- (up to 5 concurrent chores) this is a real blind spot.
17
-
18
- ## Who benefits
19
- The author, whenever running parallel subagent work (ralph pipeline chores, parallel research).
20
- A live dashboard helps during runs; persisted per-run reports turn subagent work into a
21
- reviewable after-action record (which also complements the HITL/summary flow). Mid-run steering
22
- reduces wasted tokens from subagents heading the wrong way and having to restart.
23
-
24
- ## Proposed outcome
25
- Expand (or adopt, if a store extension fits) subagent tooling to give:
26
-
27
- 1. **Live dashboard** — richer TUI during runs: per-agent status (phase, current tool call,
28
- files touched), so you can see what each parallel subagent is doing without digging into
29
- streamed output.
30
- 2. **Persisted reports** — a per-run record per subagent (what it did, files changed,
31
- decisions, blockers), stored for after-action review. Persistence should follow the repo
32
- convention: write to `~/.pi/agent-cortex/`, tagged with project path for per-project slicing.
33
- 3. **Mid-run steering** — send a message to a running subagent to change its direction
34
- ("skip that, focus on X") rather than killing and restarting.
35
-
36
- Decision from the interview: **evaluate the pi extension store first** — if a maintained
37
- extension already covers dashboard + reports (and ideally steering), adopt it; otherwise expand
38
- the bundled `subagent` extension. Building is a fallback, not the default.
39
-
40
- ## Validity check
41
- - Evidence we already have: the bundled `subagent` extension is a working base — it already
42
- spawns `pi` subprocesses, streams, and collects usage data, so the hooks for a dashboard and
43
- reports exist in some form. The repo has a data convention (`~/.pi/agent-cortex/`, per-project
44
- tagging) that reports would slot into.
45
- - Riskiest assumption: that mid-run steering is technically feasible — subagents run as separate
46
- `pi` processes, so steering likely needs a message channel (e.g. a FIFO / IPC pipe into the
47
- running process, or a PI-native way to inject input). If the process model doesn't allow input
48
- mid-run, the interaction half collapses to "abort and re-dispatch with corrected instruction".
49
- - What would invalidate this idea: if store extensions are all visibility-only (no steering) and
50
- the process model rules out mid-run input, the remaining value is dashboard + reports only.
51
- Also, if subagents use private pipes that block reading live state cheaply, the dashboard may
52
- be constrained to what the streamer already shows.
53
-
54
- ## Constraints
55
- - Keep it lightweight and consistent with the repo's extension conventions (no internal LLM
56
- calls in the extension itself).
57
- - Should compose with ralph's parallel dispatch (up to 5 concurrent chores) without making the
58
- TUI unusable.
59
- - Steering must be safe: a message is advisory input to the subagent, not a force-kill;
60
- abort stays available.
61
-
62
- ## Next validation step
63
- Two-part check before building: (1) search the pi extension store for subagent/dashboard/steering
64
- extensions and evaluate against this wishlist; (2) verify whether a running `pi` subagent
65
- process accepts input mid-run (checked against how the subagent extension spawns processes and
66
- whether PI exposes any IPC/input channel) — this decides whether steering is scoped in.
67
-
68
- ## Notes
69
- Recorded 2026-08-25. Interview decisions: visibility = both live dashboard AND persisted
70
- per-run reports; interaction = mid-run steering (not approve-gates, not pause/resume); path =
71
- evaluate store first, fall back to expanding the bundled `subagent` extension. Complements
72
- `unified-ci-pipeline` (pipeline visibility) and the ralph parallelism work in this repo.
@@ -1,95 +0,0 @@
1
- # Idea: task-session-context
2
-
3
- ## Status
4
- Backlog idea (not implementation-ready)
5
-
6
- ## Created
7
- 2026-08-25
8
-
9
- ## Problem
10
- Coding sessions accumulate context turn by turn: every question, every tool call, every
11
- tangent stays in the window until it's manually compacted or the session is restarted. Keeping
12
- the context small and relevant is an active management burden — the author has to notice the
13
- bloat, decide what matters, and intervene. Long conversations either burn tokens or require
14
- frequent manual resets that drop useful memory.
15
-
16
- ## Who benefits
17
- The author, daily. Removing context management from the loop means sessions stay small and
18
- focused no matter how long the overall thread runs. It also produces a durable, reviewable log
19
- of work: each task's bead + summary memory is an audit trail of what was done and why.
20
-
21
- ## Proposed outcome
22
- A workflow organised around **tasks** instead of sessions. Whenever the user does something
23
- discrete — asks a new question, records an idea, fleshes out a piece of work — it **begins a
24
- task**:
25
-
26
- 1. **Task = blank session with memory context.** The task starts a fresh, self-contained
27
- session. It does NOT get every turn and tool call of the parent conversation — only access
28
- to the accumulated **memories** of what came before (a summary/compressed view, not the raw
29
- transcript).
30
- 2. **Self-contained execution.** The task works on its own: it takes action, and **records
31
- memories along the way** as it produces outcomes.
32
- 3. **Single summary memory on completion.** The last thing a task does is write one summary
33
- memory capturing its outcome. These memories are additive — the running memory store grows as
34
- tasks complete.
35
- 4. **Fresh session continues the thread.** Once the task completes, a new session starts with
36
- access to the memories — including the new summary — so to the user it feels like one
37
- continuous thread, but each underlying session stays small.
38
-
39
- **Ties into beads (bd):** "the completion of a bead is the completion of a task". A bead becomes
40
- the log of work completed: the task's outcome is recorded on/with the bead, the fresh session
41
- starts, and the bead is accompanied by **referential memory** (a pointer/memory entry that links
42
- the outcome to the bead). So the bead doubles as the durable record AND the context-boundary
43
- marker: starting a bead is the trigger for task-session separation.
44
-
45
- **The bead is the artifact — the session is disposable.** Once a task is complete, the whole
46
- conversation context is no longer needed; the bead is the artifact. The current conversation is
47
- the live example: recording this idea is a task, and when it's done the transcript of every turn
48
- and tool call can be discarded — what remains is the record plus its summary/referential memory.
49
- This is the load-bearing philosophical point of the idea: sessions exist to serve tasks, not the
50
- other way around. Context is an implementation detail of a single task; the bead is the durable
51
- unit of history.
52
-
53
- The mechanism likely needs: a memory store (per-project, e.g. under `~/.pi/agent-cortex/` or a
54
- records convention), a session-scoping rule (what memories a fresh task session is seeded with),
55
- the summary-writing step, and the bead ↔ memory linkage.
56
-
57
- ## Validity check
58
- - Evidence we already have: the repo already runs on beads as the unit of work (bd), and the
59
- ralph pipeline already treats beads as self-contained executable units — so task-per-bead
60
- separation is a natural extension of an existing pattern. Existing ideas
61
- (`record-ideas-as-beads`, `pi-task-memory`, `extension-manifests`) all push in the direction of
62
- making agent-cortex the declared, memory-rich source of truth.
63
- - Riskiest assumption: that a fresh session seeded with *memories only* (no raw transcript) is
64
- sufficient context for a task — the compression of a conversation into memories must not lose
65
- the specifics a task needs. Also: whether the harness (pi/Claude) even supports programmatic
66
- session spawning with a seed context cleanly enough for this to feel seamless.
67
- - What would invalidate this idea: if memory-as-context proves lossy in a way that keeps tasks
68
- mis-executing (then the blank-session model needs the raw transcript after all, defeating the
69
- point); or if the session boundary machinery (start/stop/spawn with seed) fights the harness.
70
-
71
- ## Constraints
72
- - Sessions must stay small — this is the whole point; memory is the interface, not the transcript.
73
- - Memories are additive and durable; the summary memory is the handoff contract between tasks.
74
- - The bead is the work log AND the context boundary: no task completion without its summary
75
- memory and bead record.
76
- - Must not break the existing task loops (ralph pipeline stages, HITL handoffs) — it should
77
- compose with them, not fork them.
78
-
79
- ## Next validation step
80
- Flesh-out session (proposed by the author): nail down the trigger rules (what counts as "begin a
81
- task"), the memory store schema and what a "memory" is vs a summary, how a fresh session gets
82
- seeded, and how the bead carries the summary + referential memory. Then a spike: one task
83
- completing with summary → fresh session seeded → verify the thread feels continuous.
84
-
85
- ## Notes
86
- Recorded 2026-08-25. The author explicitly wants to flesh this out later — this record captures
87
- the working concept. It connects several existing ideas: `record-ideas-as-beads` (beads as the
88
- unit of everything), `pi-task-memory` (memory as a first-class mechanism), and
89
- `subagent-visibility` (visibility into what task sessions do).
90
-
91
- **Amendment (2026-08-30):** see `self-flushing-session` — the sharper mechanism record for this
92
- principle: agent autonomously decides when to flush, beads *are* the memory store (no separate
93
- system), a parent session bead holds the conversation with child outcome beads discovered
94
- progressively, and the bead ID is the only thing kept across a flush. This record remains the
95
- principle; `self-flushing-session` is the mechanism.
@@ -1,89 +0,0 @@
1
- # Idea: task-session-context
2
-
3
- ## Status
4
- Backlog idea (not implementation-ready)
5
-
6
- ## Created
7
- 2026-08-25
8
-
9
- ## Problem
10
- Coding sessions accumulate context turn by turn: every question, every tool call, every
11
- tangent stays in the window until it's manually compacted or the session is restarted. Keeping
12
- the context small and relevant is an active management burden — the author has to notice the
13
- bloat, decide what matters, and intervene. Long conversations either burn tokens or require
14
- frequent manual resets that drop useful memory.
15
-
16
- ## Who benefits
17
- The author, daily. Removing context management from the loop means sessions stay small and
18
- focused no matter how long the overall thread runs. It also produces a durable, reviewable log
19
- of work: each task's bead + summary memory is an audit trail of what was done and why.
20
-
21
- ## Proposed outcome
22
- A workflow organised around **tasks** instead of sessions. Whenever the user does something
23
- discrete — asks a new question, records an idea, fleshes out a piece of work — it **begins a
24
- task**:
25
-
26
- 1. **Task = blank session with memory context.** The task starts a fresh, self-contained
27
- session. It does NOT get every turn and tool call of the parent conversation — only access
28
- to the accumulated **memories** of what came before (a summary/compressed view, not the raw
29
- transcript).
30
- 2. **Self-contained execution.** The task works on its own: it takes action, and **records
31
- memories along the way** as it produces outcomes.
32
- 3. **Single summary memory on completion.** The last thing a task does is write one summary
33
- memory capturing its outcome. These memories are additive — the running memory store grows as
34
- tasks complete.
35
- 4. **Fresh session continues the thread.** Once the task completes, a new session starts with
36
- access to the memories — including the new summary — so to the user it feels like one
37
- continuous thread, but each underlying session stays small.
38
-
39
- **Ties into beads (bd):** "the completion of a bead is the completion of a task". A bead becomes
40
- the log of work completed: the task's outcome is recorded on/with the bead, the fresh session
41
- starts, and the bead is accompanied by **referential memory** (a pointer/memory entry that links
42
- the outcome to the bead). So the bead doubles as the durable record AND the context-boundary
43
- marker: starting a bead is the trigger for task-session separation.
44
-
45
- **The bead is the artifact — the session is disposable.** Once a task is complete, the whole
46
- conversation context is no longer needed; the bead is the artifact. The current conversation is
47
- the live example: recording this idea is a task, and when it's done the transcript of every turn
48
- and tool call can be discarded — what remains is the record plus its summary/referential memory.
49
- This is the load-bearing philosophical point of the idea: sessions exist to serve tasks, not the
50
- other way around. Context is an implementation detail of a single task; the bead is the durable
51
- unit of history.
52
-
53
- The mechanism likely needs: a memory store (per-project, e.g. under `~/.pi/agent-cortex/` or a
54
- records convention), a session-scoping rule (what memories a fresh task session is seeded with),
55
- the summary-writing step, and the bead ↔ memory linkage.
56
-
57
- ## Validity check
58
- - Evidence we already have: the repo already runs on beads as the unit of work (bd), and the
59
- ralph pipeline already treats beads as self-contained executable units — so task-per-bead
60
- separation is a natural extension of an existing pattern. Existing ideas
61
- (`record-ideas-as-beads`, `pi-task-memory`, `extension-manifests`) all push in the direction of
62
- making agent-cortex the declared, memory-rich source of truth.
63
- - Riskiest assumption: that a fresh session seeded with *memories only* (no raw transcript) is
64
- sufficient context for a task — the compression of a conversation into memories must not lose
65
- the specifics a task needs. Also: whether the harness (pi/Claude) even supports programmatic
66
- session spawning with a seed context cleanly enough for this to feel seamless.
67
- - What would invalidate this idea: if memory-as-context proves lossy in a way that keeps tasks
68
- mis-executing (then the blank-session model needs the raw transcript after all, defeating the
69
- point); or if the session boundary machinery (start/stop/spawn with seed) fights the harness.
70
-
71
- ## Constraints
72
- - Sessions must stay small — this is the whole point; memory is the interface, not the transcript.
73
- - Memories are additive and durable; the summary memory is the handoff contract between tasks.
74
- - The bead is the work log AND the context boundary: no task completion without its summary
75
- memory and bead record.
76
- - Must not break the existing task loops (ralph pipeline stages, HITL handoffs) — it should
77
- compose with them, not fork them.
78
-
79
- ## Next validation step
80
- Flesh-out session (proposed by the author): nail down the trigger rules (what counts as "begin a
81
- task"), the memory store schema and what a "memory" is vs a summary, how a fresh session gets
82
- seeded, and how the bead carries the summary + referential memory. Then a spike: one task
83
- completing with summary → fresh session seeded → verify the thread feels continuous.
84
-
85
- ## Notes
86
- Recorded 2026-08-25. The author explicitly wants to flesh this out later — this record captures
87
- the working concept. It connects several existing ideas: `record-ideas-as-beads` (beads as the
88
- unit of everything), `pi-task-memory` (memory as a first-class mechanism), and
89
- `subagent-visibility` (visibility into what task sessions do).
@@ -1,92 +0,0 @@
1
- # Idea: Test data creation helpers
2
-
3
- ## Status
4
- Backlog idea (not implementation-ready) — priority P2 (moderate)
5
-
6
- ## Created
7
- 2026-09-14
8
-
9
- ## Problem
10
- Agents writing tests reach for test data the lazy way, in three shapes:
11
-
12
- 1. **Shared module-scope objects used as fixtures.** Because the object is built once at
13
- top-level scope and reused, every test mutates the same instance — state leaks between
14
- tests, and a passing test can depend on the order in which others ran. Failures are
15
- order-dependent and hard to reproduce in isolation.
16
- 2. **Data built outside the test rather than inline.** The reader — and the next agent — must
17
- scroll away from the assertion to find what the input actually was, so the test stops
18
- reading as an example of the behaviour under test.
19
- 3. **No small configurable helper.** Instead of a factory with sensible defaults and an
20
- overrides argument, each test re-spells the entire literal. One field change means editing
21
- every call site, and the tests silently drift apart from one another.
22
-
23
- Net effect: tests that are annoying to read, annoying to change, and occasionally lie. The
24
- cost is paid again on every subsequent edit.
25
-
26
- ## Who benefits
27
- Everyone who reads or changes the suite: the author reviewing a diff, the reviewer agent
28
- auditing a PR, and later agents picking the code up cold. It also cuts churn in ralph pipeline
29
- runs, where agents write tests unattended and nobody corrects a sloppy fixture habit in the
30
- moment. Test authors write less boilerplate; reviewers have less to query.
31
-
32
- ## Proposed outcome
33
- Skill-only guidance (no shipped helper code) telling the agent how to create test data:
34
-
35
- - **Build data inline in the test** (or in a helper called from it), so the test body shows the
36
- shape of its own input.
37
- - **No shared mutable top-level fixture.** If data must be reused, it is produced fresh per
38
- test by a function — a factory, not a constant. Module-scope constants are acceptable only
39
- when genuinely immutable and read-only.
40
- - **Prefer a small configurable helper** — a factory taking partial overrides with defaults for
41
- the rest — over repeated full literals. Build the helper only when reuse justifies it; a
42
- single test's data stays a plain inline object.
43
- - **Name and locate the helper conventionally** so the next agent finds it (colocated with the
44
- tests, named for what it builds).
45
-
46
- Landing: the rule belongs in `style-tests`, the skill that already governs test-writing
47
- conventions, with `tdd` and `engineering` pointing at it so the habit lands at authoring time.
48
- Per the repo's keep-skill-bodies-small convention it is a red-flag row plus a checklist item,
49
- not a new essay.
50
-
51
- ## Validity check
52
- - Evidence we already have: the pattern is observed repeatedly in agent-authored tests
53
- (module-scope fixtures mutated across tests, full literals duplicated per test); `style-tests`
54
- already asserts behaviour-over-structure and mock discipline, so a data-construction rule fits
55
- its existing remit without new philosophy; and the sibling idea `ban-content-assertion-tests`
56
- shows this class of test-quality gap is real and gets fixed the same way — skill-only, red flag
57
- plus checklist item. The repo already ships skills governing how tests are written, so there is
58
- a known enforcement point and no new mechanism to invent.
59
- - Riskiest assumption: that a prose rule actually changes agent behaviour. The content-assertion
60
- idea rests on the same assumption; if agents keep reaching for module-scope fixtures after the
61
- rule lands, the fix is a review gate rather than more wording. Second-riskiest: that "no shared
62
- top-level fixture" is not overly absolute — a genuinely immutable shared constant (a frozen
63
- canonical example) is fine, so the wording must target mutability and per-test freshness, not
64
- top-level scope by itself.
65
- - What would invalidate this idea: finding that the real cause is not agent habit but a missing
66
- convention in the target projects (nowhere for a helper to live, so inline literals are the only
67
- option), or that a project's test framework already ships builders the agent simply fails to
68
- find — either would move the fix to discoverability or enforcement rather than a style rule.
69
-
70
- ## Constraints
71
- - **Skill-only.** No helper library shipped from this plugin — each project owns its factories.
72
- - Keep `style-tests` at ~100 lines: add a red-flag row and a verification-checklist item; do not
73
- expand the skill's philosophy.
74
- - Do not ban top-level constants outright — the rule targets mutable shared state and per-test
75
- freshness.
76
- - Small scope: no pipeline changes beyond pointing `tdd`/`engineering` at the rule.
77
-
78
- ## Next validation step
79
- Before implementing, grep the agent-authored tests in this repo (and one or two target projects)
80
- for module-scope fixture objects versus inline/per-test construction, to confirm the pattern is as
81
- frequent as the anecdote suggests and to capture two or three concrete before/after examples. If
82
- it is real, land the red-flag row in `style-tests`, add the pointer lines in `tdd`/`engineering`,
83
- then check the next ralph run's tests for it.
84
-
85
- ## Notes
86
- Recorded 2026-09-14 (P2). Interview was deliberately short — this is a capture, not a spec. Timing
87
- signal: "it's annoying" — a recurring, low-severity papercut that costs a little on every test
88
- edit rather than a project-breaking defect, hence P2 rather than the P1 carried by adjacent
89
- content-assertion work. Stance locked in interview: skill-only guidance, no shipped helper code;
90
- the fix is teaching the agent the pattern, not providing a library. Related:
91
- `ban-content-assertion-tests.md` (same enforcement point, same shape of fix),
92
- `test-planning-stage-bead-in-feature-planning.md` (test-stage quality in the pipeline).
@@ -1,68 +0,0 @@
1
- # Idea: Test-planning stage bead in feature planning
2
-
3
- ## Status
4
- Absorbed into bead `agnt-ctx-rig0` (2026-09-22) — the verification beads in that design's
5
- design stage generalise this idea's provable-outcome / completion-criterion motivation. Not a
6
- standalone bead.
7
-
8
- ## Created
9
- 2026-09-03
10
-
11
- ## Problem
12
- Tests get under-planned: features are split into beads around implementation
13
- (code, verify, review) but nobody plans *what* needs testing or *how we know
14
- it's done* before the work starts. Verification ends up ad hoc — a verify
15
- stage runs whatever tests exist rather than the tests the feature actually
16
- needs.
17
-
18
- ## Who benefits
19
- - The agent running the pipeline (ralph / run-pipeline-stage) — has an explicit
20
- test plan to execute against instead of improvising a verify pass.
21
- - The human reviewer — a stated definition of done for testing makes the PR
22
- gate checkable ("did the planned tests land?").
23
- - The feature itself — testability becomes a planning output, not an accident.
24
-
25
- ## Proposed outcome
26
- When a feature is planned, the planning phase also produces a
27
- test/verification planning stage bead: what behaviour to test, at what level
28
- (unit/integration/e2e), key cases and edge cases, and an explicit completion
29
- criterion — the answer to "how do we know it's done?" The bead sits between
30
- feature planning and implementation, so test planning happens once at plan
31
- time rather than being rediscovered per-task.
32
-
33
- ## Validity check
34
- - Evidence we already have: verify-stage chores exist today but run generic
35
- checks (`playbooks/verify.md`, `run-pipeline-stage`); nothing at plan time
36
- defines the feature's test surface or a testing definition of done — PR
37
- reviews have to reconstruct what should have been tested.
38
- - Riskiest assumption: a test-plan bead is actually useful to the executing
39
- agent and isn't just ceremony that duplicates what the code bead already
40
- implies ("write tests that cover this feature"). Cheap to validate: try it
41
- on one feature and judge whether the verify stage runs a materially better
42
- test pass.
43
- - What would invalidate this idea: if RALPH's verify stage already produces
44
- adequate coverage decisions from the playbook alone, the extra bead adds
45
- overhead without changing outcomes.
46
-
47
- ## Constraints
48
- - Pipeline shape is fixed by the existing bead/pipeline contract
49
- (create-task chores, ralph stage dispatch) — the new bead type must slot in
50
- without a pipeline redesign.
51
- - No new runtime for test execution — the bead plans; existing verify tooling
52
- executes.
53
- - Must stay lightweight: test planning for its own sake is the failure mode.
54
-
55
- ## Next validation step
56
- Run a two-feature pilot: for the next two planned features, hand-write a
57
- test/verification plan bead (without wiring it into the pipeline) and compare
58
- the resulting verify passes against a control feature planned the current
59
- way. If the planned features demonstrably get better test coverage, wire the
60
- bead type into the planning skill.
61
-
62
- ## Notes
63
- - User framing: "planning, then test/verification planning — how do we know
64
- it's done?" The completion criterion is the heart of the idea, not the bead
65
- itself.
66
- - Priority: medium — next planning-skill iteration, not blocking current work.
67
- - The definition-of-done answer could eventually feed the HITL PR gate
68
- (reviewer checks planned-tests-vs-landed-tests).
@@ -1,28 +0,0 @@
1
- # Idea: Unified CI Pipeline with Parallel Checks
2
-
3
- ## Status
4
- Backlog idea (not implementation-ready)
5
-
6
- ## Why it might be useful
7
- The current CI setup has two problems:
8
- 1. **Slow feedback** — checks run serially, making the pipeline slower than it needs to be.
9
- 2. **Broken releases** — the release job (version branch creation) is a separate pipeline, so it can fire even when checks fail. A broken commit can reach the version branch.
10
-
11
- Combining them gives faster feedback (parallel checks) and a safety gate (release step only runs if all checks pass).
12
-
13
- ## How we might do it
14
- - Merge the check pipeline and release pipeline into a single pipeline.
15
- - Fan out all checks to run in parallel.
16
- - Make the version branch creation a downstream job/step that depends on all checks passing.
17
-
18
- ## When to think about it
19
- When CI pipeline speed or release safety becomes a recurring friction — e.g. after the changesets/release workflow is fully set up and seeing real traffic.
20
-
21
- ## Priority
22
- P2 — infrastructure quality-of-life. Not blocking current work, but a clear improvement once the release flow stabilises.
23
-
24
- ## Notes
25
- - Setup job with artifact infrastructure added (2026-08): install + build now happen once in a `setup` job, artifacts are shared with downstream jobs via upload/download-artifact. This is the first step toward the unified pipeline vision.
26
- - Depends on the changesets release workflow being in place (P1 beads `agnt-ctx-d1ht`, `agnt-ctx-5bcu`).
27
- - Should be straightforward once the pipeline shape is settled.
28
- - **Release pipeline fires on every push to main** — this wastes CI minutes. It should only run when there are changesets to process (e.g. when the version packages PR is merged, or when new changesets land on main). Add a path filter or a pre-check that skips the job when no `.changeset/*.md` files changed.
@@ -1,71 +0,0 @@
1
- # Idea: Unify the ticket and task decomposition workflows
2
-
3
- ## Status
4
- Backlog idea (not implementation-ready)
5
-
6
- ## Created
7
- 2026-10-13
8
-
9
- ## Problem
10
- The planning skills assume a fixed split between tickets and tasks, and implement
11
- decomposition in three places that do not agree:
12
-
13
- - `prd-to-tasks` slices a PRD into epics and task beads, then expands each task through
14
- `create-task` into pipeline chore beads for ralph.
15
- - `spec-to-tickets` slices a spec into a ticket map, drafts bodies, and creates tickets in
16
- a tracker (Jira, GitLab, GitHub, or beads).
17
- - `plan` Phase 2 re-implements the slicing logic inline rather than delegating.
18
-
19
- There is no model for a ticket that itself needs breaking into tasks, and no single place
20
- that owns decomposition. Which skill to use depends on the tracker rather than on the work.
21
-
22
- ## Who benefits
23
- The author, and any agent running the planning skills. One decomposition path replaces
24
- three overlapping ones, and a ticket in any tracker can be created and then broken into
25
- tasks without switching skills.
26
-
27
- ## Proposed outcome
28
- A single coherent model in which a ticket — in any tracker, including beads — can be
29
- created and then decomposed into tasks, with the tracker acting as an adapter rather than
30
- defining a separate skill. The exact shape is deliberately undecided; this record captures
31
- the problem, not a design.
32
-
33
- ## Validity check
34
- - Evidence we already have: three implementations of spec-to-units slicing (`plan` Phase 2
35
- inline, `prd-to-tasks`, `spec-to-tickets`); `prd-to-tasks` has eight dependents plus a
36
- generated agent file; the only substantive difference between the two decomposition
37
- skills is the creation contract — `create-task` expands AFK tasks into ralph's chore
38
- tree, while `spec-to-tickets` uses a generic tracker adapter.
39
- - Riskiest assumption: not yet identified — this needs a thinking-through pass. Candidates
40
- to test: (a) the ticket/task split can be unified without losing ralph's execution
41
- contract; (b) the refactor is affordable given its blast radius; (c) the duplication is
42
- causing enough harm to justify it at all.
43
- - What would invalidate this idea: if ralph's requirements — chore-tree expansion via
44
- `create-chores.ts`/`pipeline.json`, epic branches, AFK/HITL classification — cannot be
45
- expressed as a tracker adapter behind one slicing skill, then the split is load-bearing
46
- and should stay. It would also be invalidated if the duplication never produces concrete
47
- drift.
48
-
49
- ## Constraints
50
- - Ralph's execution contract is fixed and must keep working: chore expansion, the epic PR
51
- flow, and AFK/HITL classification.
52
- - Open beads `agnt-ctx-s5xd.4` and `agnt-ctx-s5xd.4.4` are already rewriting
53
- `prd-to-tasks` and `plan`'s tagging for the `execution:` label model. Any refactor has to
54
- land after that epic or it will collide.
55
- - Skills target ~150 lines, so a unified decomposition skill would need its tracker
56
- adapters and formats split into support files.
57
-
58
- ## Next validation step
59
- Once the s5xd two-axis epic lands, enumerate exactly what `create-task` and ralph require
60
- from a decomposition — classification, chore tree, epic hierarchy, labels — and test
61
- whether each can be expressed as a tracker adapter behind one slicing skill. That is the
62
- cheapest step that would firm up or kill the idea.
63
-
64
- ## Notes
65
- - The open question at the heart of it: are "ticket" and "task" the same thing at different
66
- granularities, or genuinely different things? Related: is a ticket a ralph task, or
67
- something a ralph task is created from?
68
- - Priority P3 by the author's call — it blocks other planning work rather than being
69
- polish.
70
- - Filed during the `write-a-ticket` / `spec-to-tickets` work (bead `agnt-ctx-vgzj`), where
71
- the overlap first became concrete.
@@ -1,39 +0,0 @@
1
- # Idea: Worktree housekeeping for closed beads
2
-
3
- ## Status
4
- Backlog idea (not implementation-ready)
5
-
6
- ## Created
7
- 2026-09-13
8
-
9
- ## Problem
10
- Ralph runs each bead in a dedicated worktree under `.agent-cortex/worktrees/<parent-id>` and only cleans up when a human manually removes it — the `git-workflow` skill's "Worktree lifecycle" step is discretionary, not enforced. Closed, merged beads leave their worktrees behind, and crashed or abandoned runs leave orphaned ones. The worktree set drifts from the actual bead/PR state with no mechanism to converge it.
11
-
12
- ## Who benefits
13
- - The author, who currently accumulates stale worktrees and must identify and remove them by hand.
14
- - Future ralph/agent sessions, which skip reading a worktree set polluted by dead state and avoid accidentally reusing an abandoned worktree for a new bead.
15
- - Confident teardown: knowing a merged feature's worktree is gone makes "is this still live?" checks unnecessary.
16
-
17
- ## Proposed outcome
18
- Two tiers of cleanup:
19
- - **Minor (deterministic)**: when a ralph run's PRs merge and its beads close, the associated worktrees are removed as part of the close-off — no LLM judgement needed.
20
- - **Major (broader)**: a reusable housekeeping pass that finds and reports orphaned or abandoned worktrees (no corresponding live bead, no open PR / stale branch), usable on demand.
21
-
22
- Cleanup is safe-first: it must not remove a worktree whose branch or bead is still active, and unmerged/abandoned worktrees should be surfaced rather than silently deleted.
23
-
24
- ## Validity check
25
- - Evidence we already have: `git-workflow` SKILL.md already documents "after the PR is merged or closed, clean up the worktree" as a manual step — the intent exists, only the enforcement is missing. Ralph already knows the full mapping of bead → worktree → PR, so it has all the data a deterministic cleanup needs.
26
- - Riskiest assumption: worktree state can be derived reliably from bead state + git state (that a "closed bead" always means its worktree is safe to remove, and that orphan detection can distinguish abandoned worktrees from merely idle ones). If the bead/PR mapping is lossy — e.g. beads close without recording whether the PR merged — the deterministic rule could remove an unmerged feature's worktree.
27
- - What would invalidate this idea: if the cost of a false positive cleanup (losing an unmerged feature's worktree or its local branches) outweighs the cost of the current manual drift; or if ralph's lifecycle already converges worktrees in practice and the observed accumulation is negligible.
28
-
29
- ## Constraints
30
- - Human merge gates stay non-negotiable — cleanup must never imply or require auto-merging.
31
- - No destructive action on anything the mapping can't positively classify (unmerged features, active beads, open PRs) — default to reporting.
32
- - Both the skill and the deterministic script live in this repo (`skills/`, `scripts/`); final split between skill, script, or both is a design-time decision.
33
-
34
- ## Next validation step
35
- List worktrees across a few real (recently completed) ralph sessions and compare against bead/PR state to measure actual accumulation and test whether closed-bead → safe-to-remove always holds. This both quantifies the problem and de-risks the riskiest assumption.
36
-
37
- ## Notes
38
- - Interview left two design-time decisions open: (1) whether cleanup lives as a skill, a script, or both; (2) whether it runs at session start, inside the ralph loop, or as an on-demand command — "maybe both" was the lean.
39
- - Related backlog neighbours worth reconciling when this is planned: `deployment-beads-for-post-merge-pipelines.md` (post-merge lifecycle), `record-ideas-as-beads.md` if the major housekeeping pass becomes a scheduled bead.