@jaybeeuu/agent-cortex 1.37.1 → 1.39.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 (135) hide show
  1. package/.agents/skills/style-versioning/SKILL.md +9 -8
  2. package/.github/workflows/ci.yml +190 -8
  3. package/AGENTS.md +27 -6
  4. package/CHANGELOG.md +72 -0
  5. package/README.md +156 -39
  6. package/agents/README.md +49 -13
  7. package/agents/plan/agent.md +51 -0
  8. package/agents/plan/claude/frontmatter.json +6 -0
  9. package/agents/plan/copilot/frontmatter.json +6 -0
  10. package/agents/plan/pi/frontmatter.json +6 -0
  11. package/agents/plan.agent.md +3 -0
  12. package/agents/ralph/agent.md +262 -0
  13. package/agents/ralph/claude/frontmatter.json +6 -0
  14. package/agents/ralph/claude/polling.md +31 -0
  15. package/agents/ralph/copilot/frontmatter.json +6 -0
  16. package/agents/ralph/copilot/polling.md +62 -0
  17. package/agents/ralph/pi/frontmatter.json +6 -0
  18. package/agents/ralph/pi/polling.md +74 -0
  19. package/agents/ralph-plan/agent.md +114 -0
  20. package/agents/ralph-plan/claude/frontmatter.json +6 -0
  21. package/agents/ralph-plan/copilot/frontmatter.json +6 -0
  22. package/agents/ralph-plan/pi/frontmatter.json +6 -0
  23. package/agents/ralph-plan.agent.md +6 -3
  24. package/agents/ralph.agent.md +83 -57
  25. package/agents/strategy/agent.md +104 -0
  26. package/agents/strategy/claude/frontmatter.json +6 -0
  27. package/agents/strategy/copilot/frontmatter.json +6 -0
  28. package/agents/strategy/pi/frontmatter.json +6 -0
  29. package/agents/strategy.agent.md +3 -0
  30. package/bin/agent-cortex.mjs +76 -1
  31. package/bin/installers/claude.mjs +376 -0
  32. package/bin/installers/copilot.mjs +129 -0
  33. package/bin/installers/pi.mjs +197 -0
  34. package/claude/.claude-plugin/plugin.json +1 -1
  35. package/claude/agents/plan.md +3 -1
  36. package/claude/agents/ralph-plan.md +6 -4
  37. package/claude/agents/strategy.md +3 -1
  38. package/claude/hooks/scripts/notify.mjs +54 -0
  39. package/claude/hooks.json +15 -0
  40. package/docs/claude-hooks.md +115 -0
  41. package/docs/ideas/auto-model-selection.md +75 -0
  42. package/docs/ideas/extension-manifests.md +75 -0
  43. package/docs/ideas/improve-pi-system-prompt.md +34 -0
  44. package/docs/ideas/model-selector.md +40 -0
  45. package/docs/ideas/pi-task-memory.md +34 -0
  46. package/docs/ideas/qa-extension.md +43 -0
  47. package/docs/ideas/record-ideas-as-beads.md +115 -0
  48. package/docs/ideas/subagent-visibility.md +72 -0
  49. package/docs/ideas/task-session-context.md +89 -0
  50. package/docs/ideas/unified-ci-pipeline.md +28 -0
  51. package/docs/research/skill-design-research.md +4 -4
  52. package/docs/research/skill-improvements-analysis.md +1 -1
  53. package/docs/skills/skill-anatomy.md +47 -2
  54. package/docs/technical-direction/migration-execution-labels.md +132 -0
  55. package/extensions/agent-modes/README.md +54 -0
  56. package/extensions/agent-modes/discover.test.ts +241 -0
  57. package/extensions/agent-modes/discover.ts +458 -0
  58. package/extensions/agent-modes/index.ts +13 -224
  59. package/extensions/agent-modes/node_modules/.bin/pi +21 -0
  60. package/extensions/agent-modes/node_modules/.bin/tsc +21 -0
  61. package/extensions/agent-modes/node_modules/.bin/tsserver +21 -0
  62. package/extensions/agent-modes/node_modules/.bin/tsx +21 -0
  63. package/extensions/agent-modes/package.json +20 -0
  64. package/extensions/agent-modes/tsconfig.json +12 -0
  65. package/extensions/subagent/README.md +19 -0
  66. package/extensions/subagent/index.ts +131 -45
  67. package/extensions/subagent/node_modules/.bin/pi +21 -0
  68. package/extensions/subagent/node_modules/.bin/pi-ai +21 -0
  69. package/extensions/subagent/node_modules/.bin/tsc +21 -0
  70. package/extensions/subagent/node_modules/.bin/tsserver +21 -0
  71. package/extensions/subagent/node_modules/.bin/tsx +21 -0
  72. package/extensions/subagent/package.json +23 -0
  73. package/extensions/subagent/tsconfig.json +12 -0
  74. package/extensions/subagent/wait.test.ts +202 -0
  75. package/extensions/subagent/wait.ts +118 -0
  76. package/hooks/claude/hooks.json +38 -0
  77. package/hooks/claude/scripts/notify.mjs +54 -0
  78. package/lib/cli.mjs +68 -3
  79. package/package.json +6 -4
  80. package/plugin.json +1 -1
  81. package/pnpm-workspace.yaml +1 -1
  82. package/scripts/build-copilot-agents.mjs +30 -0
  83. package/scripts/lib/compose-agent.mjs +241 -0
  84. package/skills/engineering/design-an-interface/SKILL.md +78 -58
  85. package/skills/engineering/grill-with-docs/REFERENCE.md +78 -0
  86. package/skills/engineering/grill-with-docs/SKILL.md +66 -63
  87. package/skills/engineering/improve-codebase-architecture/SKILL.md +66 -48
  88. package/skills/engineering/technical-direction/FORMAT.md +38 -0
  89. package/skills/engineering/technical-direction/SKILL.md +70 -77
  90. package/skills/planning/classify-bead/SKILL.md +59 -35
  91. package/skills/planning/create-task/REFERENCE.md +40 -0
  92. package/skills/planning/create-task/SKILL.md +70 -66
  93. package/skills/planning/create-task/scripts/create-chores.ts +6 -1
  94. package/skills/planning/create-task/scripts/node_modules/.bin/tsc +21 -0
  95. package/skills/planning/create-task/scripts/node_modules/.bin/tsserver +21 -0
  96. package/skills/planning/create-task/scripts/node_modules/.bin/tsx +21 -0
  97. package/skills/planning/prd-to-tasks/REFERENCE.md +66 -0
  98. package/skills/planning/prd-to-tasks/SKILL.md +86 -170
  99. package/skills/planning/record-idea/FORMAT.md +44 -0
  100. package/skills/planning/record-idea/SKILL.md +70 -53
  101. package/skills/planning/request-refactor-plan/FORMAT.md +45 -0
  102. package/skills/planning/request-refactor-plan/SKILL.md +57 -46
  103. package/skills/planning/write-a-prd/FORMAT.md +54 -0
  104. package/skills/planning/write-a-prd/SKILL.md +49 -48
  105. package/skills/planning/write-a-ticket/SKILL.md +68 -53
  106. package/skills/productivity/handoff/SKILL.md +12 -0
  107. package/skills/productivity/init-beads/SKILL.md +48 -40
  108. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsc +21 -0
  109. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsserver +21 -0
  110. package/skills/productivity/validate-agent-dir/scripts/node_modules/.bin/tsx +21 -0
  111. package/skills/productivity/write-a-skill/SKILL.md +2 -1
  112. package/skills/review/maintain-agent-docs/SKILL.md +71 -51
  113. package/skills/workflow/hitl-collab/SKILL.md +86 -17
  114. package/skills/workflow/ralph/REFERENCE.md +24 -19
  115. package/skills/workflow/ralph/SKILL.md +88 -74
  116. package/skills/workflow/run-pipeline-stage/REFERENCE.md +22 -0
  117. package/skills/workflow/run-pipeline-stage/SKILL.md +91 -93
  118. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.test.ts +6 -107
  119. package/skills/workflow/run-pipeline-stage/scripts/generate-progress.ts +4 -2
  120. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsc +21 -0
  121. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsserver +21 -0
  122. package/skills/workflow/run-pipeline-stage/scripts/node_modules/.bin/tsx +21 -0
  123. package/skills/workflow/using-agent-skills/SKILL.md +122 -0
  124. package/test/claude-installer.test.mjs +248 -0
  125. package/test/cli.test.mjs +115 -2
  126. package/test/copilot-installer.test.mjs +298 -0
  127. package/test/installer.test.mjs +179 -0
  128. package/test/notify-hook.test.mjs +63 -0
  129. package/test/pi-installer.test.mjs +371 -0
  130. package/token-map.README.md +130 -0
  131. package/token-map.json +106 -0
  132. package/.github/workflows/ci.test.ts +0 -217
  133. package/.github/workflows/release.yml +0 -58
  134. package/scripts/build-claude-agents.mjs +0 -179
  135. package/scripts/publish-release.sh +0 -32
@@ -0,0 +1,34 @@
1
+ # Idea: Improve PI System Prompt
2
+
3
+ ## Status
4
+ Backlog idea (not implementation-ready)
5
+
6
+ ## Why it might be useful
7
+ PI's current system prompt is weak. Agents consistently get off track, spend excessive tokens spinning their wheels or going off on tangents, fail to check in when problems are hit, and generally behave like inexperienced code goblins. This wastes tokens, slows down task completion, and forces the user to constantly redirect the agent. A stronger system prompt would produce more focused, disciplined agents that know when to stop and ask.
8
+
9
+ ## How we might do it
10
+ Build improved behavioural instructions into agent-cortex — layered on top of or replacing PI's default system prompt. Key improvements:
11
+
12
+ 1. **Loop prevention / circuit-breakers** — hard limits on retry attempts (e.g. 2-attempt limit before stopping and asking), no repeated tool execution without rationale
13
+ 2. **Task-focus discipline** — stronger scoping instructions, no tangential refactoring, atomic changes
14
+ 3. **Check-in triggers** — explicit rules for when the agent must stop and present options to the user
15
+
16
+ A Gemini-generated execution protocol prompt exists as a possible starting point (see Notes), but will need significant customisation for agent-cortex.
17
+
18
+ ## When to think about it
19
+ - Land the current work first (refactor-to-template epic, bead workflow polish, CI/CD pipeline)
20
+ - **Next priority after current work** — this is urgent-ish
21
+
22
+ ## Priority
23
+ High — after current work lands. Directly impacts daily productivity and token efficiency.
24
+
25
+ ## Open questions
26
+ - Layer on top of PI's default prompt, or replace it entirely?
27
+ - Should PI's current system prompt be reviewed for nonsense that can be chopped out?
28
+ - Which guardrails from the Gemini starter are genuinely useful vs redundant with existing skills (e.g. `git-workflow` already covers destructive commands, `style-code` covers scope discipline)?
29
+ - How should circuit-breakers interact with skills like `run-pipeline-stage` that already have structured workflows?
30
+
31
+ ## Notes
32
+ - **Gemini starter prompt** exists (see conversation from 2026-08-05) covering loop prevention, action scope, context management, execution workflow order, and working state maintenance. Useful starting material but needs heavy customisation.
33
+ - **Incompatibility to fix**: the starter's "Working State Maintenance" section proposes `.pi/PLAN.md` files for complex tasks. This is incompatible with agent-cortex — we use **beads (bd)** for task tracking and pipeline stages, not flat markdown plan files. This section needs to be replaced with bead-aware equivalents (e.g. updating bead notes, using pipeline stage state).
34
+ - **Overlap with existing skills**: several guardrails already exist in agent-cortex skills (`git-workflow`, `style-code`, `run-pipeline-stage`). The biggest gaps are **loop prevention / circuit-breakers** and **check-in discipline** — these aren't enforced anywhere today.
@@ -0,0 +1,40 @@
1
+ # Idea: model-selector
2
+
3
+ ## Status
4
+ Backlog idea (not implementation-ready)
5
+
6
+ ## Created
7
+ 2026-07-12
8
+
9
+ ## Problem
10
+ Selecting the right model for a task is manual and brittle. When a model is unavailable (rate-limited, down, or lacking capability), there's no automatic fallback. You have to know which model IDs to type into `/model` and remember which providers offer which capabilities.
11
+
12
+ ## Who benefits
13
+ Anyone using PI who runs multiple models/providers. The extension makes model selection declarative: "I want to write code" → extension picks the best available model (and falls back if limits are hit).
14
+
15
+ ## Proposed outcome
16
+ A PI extension that defines an abstraction for selecting models based on task/use case. Users declare "use case → model(s) with fallbacks" in config, and the extension handles selection and failover automatically.
17
+
18
+ Key capabilities:
19
+ - **Use-case profiles**: e.g. `code`, `chat`, `review`, `architect` — each maps to a primary model + ordered fallbacks
20
+ - **Automatic fallback**: if the primary model returns a 429 or error, drop to the next in the chain
21
+ - **Task-based selection**: think "I want this model to write code" instead of choosing a specific model ID
22
+ - **Configurable**: profiles defined in settings.json or a dedicated config file
23
+
24
+ ## Validity check
25
+ - Evidence we already have: The existing `tiny-model.ts` lib in this repo already shows the pattern of configuring a model by provider/id string and looking it up via `modelRegistry.find()`. The PI extension API supports `before_provider_response` (for catching 429s) and `model_select` events.
26
+ - Riskiest assumption: That use-case profiles are a useful abstraction — users may prefer to just name a model family and let fallback be implicit.
27
+ - What would invalidate this idea: If PI adds built-in model routing/fallback, or if users find the abstraction adds confusion rather than removing it.
28
+
29
+ ## Constraints
30
+ - Must not add LLM calls internally (per extension conventions in AGENTS.md)
31
+ - Must work with the existing `modelRegistry` API — no monkey-patching
32
+ - Storage/config should go in settings.json or `~/.pi/agent-cortex/` (global, cross-project)
33
+
34
+ ## Next validation step
35
+ Sketch the config schema and test it against real usage patterns. Does the profile abstraction hold up for the models/providers you actually use?
36
+
37
+ ## Notes
38
+ - Initial conversation during planning session 2026-07-12. Idea recorded as backlog, to be fleshed out when time permits.
39
+ - Could draw on patterns from OpenRouter's routing and the existing `modelOverrides` in models.json.
40
+ - The `notify` extension already intercepts provider responses — similar pattern for catching rate limits.
@@ -0,0 +1,34 @@
1
+ # Idea: PI Task Memory Skill
2
+
3
+ ## Status
4
+ Backlog idea (not implementation-ready)
5
+
6
+ ## Why it might be useful
7
+ PI has no built-in task memory. Agents lose context between sessions — they can't track what a task has done, what decisions were made, or where they left off. A skill that persists task-scoped knowledge in structured markdown would let agents pick up work without re-discovering context from scratch, and give humans a readable audit trail they can review or promote into real documentation.
8
+
9
+ ## How we might do it
10
+ **Possibly build on top of `bd remember`** rather than creating a separate storage system. Worth exploring whether `bd remember`'s existing infrastructure (persistence, cross-session survival, auto-injection) could be extended with task-scoping and structure, vs building something standalone.
11
+ - **Task-linked** — memories keyed to specific bead/task IDs so they can be retrieved in context
12
+ - **Progressively discoverable** — the agent recalls relevant memories as it picks up work, not all at once
13
+ - **Structured** — consistent format that's easy to scan, edit, or promote
14
+ - **Promotable** — easy to elevate a memory into real repo documentation (e.g. `docs/`, `AGENTS.md`) once it's proven stable
15
+
16
+ If `bd remember` turns out to be the right foundation, the skill would add **task-scoping discipline, structure, and a promotion workflow** on top. But that's to be determined.
17
+
18
+ ## When to think about it
19
+ - After the current skill set stabilises (refactor-to-template work, bead workflow, CI/CD pipeline)
20
+ - Not blocked by anything, but benefits from a stable foundation
21
+
22
+ ## Priority
23
+ Low / backlog — useful but not urgent. Current memory surfaces (bd remember, context-mode) cover some of the gap already.
24
+
25
+ ## Open questions
26
+ - What triggers writing a memory? (Agent decides? Skill hook on task close? Specific prompts?)
27
+ - What does "progressively discoverable" mean in practice — agent reads task memories at session start, or on-demand when picking up a task?
28
+ - What does "elevate into docs" look like — export memory to markdown file, or just reference the memory in docs?
29
+ - How to structure memory keys for task-scoping? (e.g. `task-<bead-id>-<topic>`, or a naming convention?)
30
+
31
+ ## Notes
32
+ - **What bd remember already provides**: persistent cross-session memories, auto-injection at `bd prime`, searchable via `bd memories <keyword>`, stored in Dolt database.
33
+ - **Worth exploring**: could this skill layer task-scoping discipline (memories keyed to bead IDs), structured format, progressive discovery (not all memories at once), and a promotion workflow on top of `bd remember`? Or does it need its own system?
34
+ - Could be a **PI extension** (event hooks) rather than a skill (invoked on-demand) if memories should be written automatically during task work.
@@ -0,0 +1,43 @@
1
+ # Idea: qa-extension
2
+
3
+ ## Status
4
+ Backlog idea (not implementation-ready)
5
+
6
+ ## Created
7
+ 2026-07-12
8
+
9
+ ## Problem
10
+ When an agent needs clarification during a task (e.g. during a grilling session, resolving ambiguity, or making a recommendation), it has no structured way to ask the user a question and wait for an answer. The current workaround is unstructured prompting — the agent guesses, rambles, or proceeds with incomplete information. This makes grilling sessions less productive and wastes turns.
11
+
12
+ ## Who benefits
13
+ Anyone using PI agents for interactive work — especially during planning, grilling, and design sessions where the model needs to ask a series of questions one at a time and get focused answers.
14
+
15
+ ## Proposed outcome
16
+ A PI extension that registers a `qa` or `ask` tool that the LLM can call to ask the user a question. The tool:
17
+ - Presents the question (and optionally multiple-choice options or a recommendation)
18
+ - Pauses the agent and waits for the user's response
19
+ - Returns the user's answer to the model so it can continue
20
+ - Supports multi-turn Q&A sessions (series of questions)
21
+
22
+ This mirrors the built-in `ask_clarification` / `question` tools in Claude Code, GitHub Copilot Chat, and similar coding agents.
23
+
24
+ ## Validity check
25
+ - Evidence we already have: The PI extension API supports custom tools with user interaction via `ctx.ui` (input, confirm, select). The `subagent` extension already demonstrates complex async tool patterns. Claude Code and Copilot both ship this — it's a proven pattern.
26
+ - Riskiest assumption: That the tool execution model in PI can support a "pause and wait for user input" flow without blocking the agent loop awkwardly.
27
+ - What would invalidate this idea: If PI adds a built-in `ask_user` tool, or if the UX of blocking the agent loop for input feels worse than the current unstructured approach.
28
+
29
+ ## Constraints
30
+ - Must work in both TUI and RPC modes (graceful fallback in non-interactive modes)
31
+ - Should support at minimum: free-text input, confirm/deny, and multiple-choice selection
32
+ - Questions and answers should be visible in the session history so they survive compaction
33
+ - Must handle abort (Ctrl+C mid-question) gracefully
34
+
35
+ ## Next validation step
36
+ 1. **Investigate existing extensions first** — search PI's built-in tools, extension registry, and community repos for an existing `ask`/`qa`/`question` tool before building. May already be available.
37
+ 2. If no existing extension: check the PI tool execution model to see if a custom tool can return a partial result and then receive follow-up input from the user. Look at how `ctx.ui.input()` and `ctx.ui.confirm()` behave inside tool execution — can they block and return, or do they need a different pattern?
38
+
39
+ ## Notes
40
+ - **Needs investigation** — check for existing PI extensions/tools before building.
41
+ - Initial conversation 2026-07-12. Motivated by making grilling sessions more efficient — the grill-me skill asks one question at a time, and a structured Q&A tool would make that flow tighter.
42
+ - Related to `grill-me` skill (`skills/productivity/grill-me/SKILL.md`) — this extension could become the runtime that grill-me delegates its questioning to.
43
+ - Possible names: `/ask`, `qa`, `question` tool.
@@ -0,0 +1,115 @@
1
+ # Idea: record-ideas-as-beads
2
+
3
+ ## Status
4
+ Fleshed out 2026-08-25 — design decisions locked in an interview; not yet implemented.
5
+
6
+ ## Created
7
+ 2026-08-25
8
+
9
+ ## Problem
10
+ Ideas currently live as loose markdown files in `docs/ideas/`. This sits awkwardly alongside
11
+ the rest of the workflow, which is almost entirely bead-based (bd). Because ideas aren't beads,
12
+ they can't be searched with `bd label`, can't express relationships/dependencies to real tasks,
13
+ can't be given priority that surfaces alongside other work, and can't sync to remote via
14
+ `bd dolt push`. There's no clean promotion path from "idea" to "epic" to "executable task".
15
+
16
+ ## Who benefits
17
+ The author's daily planning loop. Ideas are the beginning of epics, so making them first-class
18
+ beads gives a single coherent backlog where an idea can grow relationships to the tasks it
19
+ spawns. The plan/agent-nexus agents benefit too: agent-nexus will eventually schedule work
20
+ through planning stages (not just execution), and a beads-native idea record gives it a clean
21
+ input to plan against.
22
+
23
+ ## Proposed outcome
24
+ Record ideas as beads labelled `kind:idea`, replacing `docs/ideas/*.md` entirely (bead-only —
25
+ files deleted after migration). `bd` already supports labels natively (`bd create -l`,
26
+ `bd label add/list`). An idea bead maps directly to an epic; promoting it means spawning task
27
+ beads as children and letting the idea bead become the epic node.
28
+
29
+ ## Fleshed-out design (decided 2026-08-25)
30
+
31
+ ### Label & identification
32
+ - **`kind:idea` label** marks idea beads. Ideas do NOT use `deferred` status — they stay
33
+ `open` so they're visible to idea tooling; hiding from actionable work is done by exclusion,
34
+ not status.
35
+ - **ralph excludes them**: ready queries use `bd ready --exclude-label kind:idea`
36
+ (verified: `bd ready` supports `--exclude-label`). Idea beads never appear as claimable work.
37
+ - Optional companion labels: `priority:<0-4>`, `epic:<id>` once promoted.
38
+
39
+ ### Flesh-out workflow (the skill that consumes them)
40
+ There should be a **flesh-out skill** (e.g. `flesh-out-idea`) that answers: *"which idea beads
41
+ are ready to be fleshed out?"* This is `bd ready -l kind:idea` — the blocker-aware ready query
42
+ scoped to ideas. Because `bd ready` already respects dependencies, an idea bead that
43
+ `depends-on` in-flight work (e.g. "needs unified-ci-pipeline landed first") naturally shows as
44
+ *not ready* until its deps close. That's exactly the semantics wanted:
45
+ - `bd ready -l kind:idea` → list & pick an idea ready for fleshing.
46
+ - The skill runs the record-idea-style interview (why / how / when / priority) at deeper depth,
47
+ updating the bead's description/design/notes as the idea ripens.
48
+ - Once fleshed out enough, the idea can be promoted (below).
49
+
50
+ ### Promotion path: idea → epic → tasks
51
+ Parent-child hierarchy (chosen over labels+deps only):
52
+ 1. Idea bead starts with `kind:idea`, type defaulted appropriately (still `task` type, or set
53
+ `epic` type on promotion).
54
+ 2. On promotion: `bd label add <idea> epic:<idea-id>` (or flip to an epic label), then spawn
55
+ task beads with `--parent <idea-id>` — children inherit the epic relationship natively.
56
+ 3. The idea bead becomes the epic node; its children are the executable tasks. Closing the
57
+ children resolves to the epic closing.
58
+
59
+ ### Content model (bead fields)
60
+ Map the current idea-template sections onto bd fields:
61
+ | md template field | bd field |
62
+ |---|---|
63
+ | Title | `--title` |
64
+ | Problem / Why | `--description` |
65
+ | How we might do it | `--design` |
66
+ | When / Priority / Validity / Constraints / Notes | `--notes` (structured, keep section markers) |
67
+ | anything referential | `--context` |
68
+
69
+ Multiple sections per field use explicit markers (`## Validity check`, etc.) inside the field
70
+ so the flesh-out interview can find/update them later.
71
+
72
+ ### Skill changes
73
+ - **`record-idea`**: replace scaffold-file flow (`new-idea.sh` → `docs/ideas/x.md`) with bead
74
+ creation: interview → `bd create "<title>" -l kind:idea -d "<why>" --design "<how>"
75
+ --notes "<when/priority/validity>"`. Keep the interview; drop the markdown scaffold script.
76
+ - New **`flesh-out-idea`** skill (see above) — validates readiness (`bd ready -l kind:idea`),
77
+ picks an idea, drives the deepening interview, updates the bead, optionally promotes.
78
+
79
+ ### Migration
80
+ - Bulk-migrate the existing `docs/ideas/*.md` records to beads: read each file, map sections to
81
+ bd fields, `bd create -l kind:idea`, preserve priority. Run as a one-off (manual or scripted).
82
+ - Then **delete `docs/ideas/`** — bead-only going forward.
83
+ - Update `AGENTS.md` + any stale references that point at `docs/ideas/`.
84
+ - The `record-idea` skill itself must unlearn the docs/ideas path.
85
+
86
+ ## Validity check
87
+ - Evidence we already have: `bd ready --exclude-label` and `bd ready -l` both exist and compose
88
+ (label filtering + blocker-aware ready semantics) — the two core mechanisms this idea needs
89
+ are native, no feature build. `--parent` exists for the hierarchy. 9-10 idea files exist to
90
+ migrate; the record-idea skill and its script are the only two consumers of the file flow.
91
+ - Riskiest assumption: that keeping ideas `open` (not `deferred`) + label exclusion is
92
+ discoverable enough — ralph, plan agents, and the author must remember the exclusion. The
93
+ `bd-tool` skill's labels table needs `kind:idea` documented with the exclusion convention.
94
+ - What would invalidate this idea: if label-based exclusion leaks idea beads into `bd ready`
95
+ via some path (e.g. `bd ready` without the exclude flag), or if losing the scannable
96
+ `docs/ideas/` directory hurts occasional review more than bead queries help it.
97
+
98
+ ## Constraints
99
+ - Ideas stay quick to scan: `bd list -l kind:idea` + `bd show <id>` should be a comfortable
100
+ replacement for opening the directory.
101
+ - Idea beads must never appear in ralph's actionable-ready view.
102
+ - `record-idea` and `bd-tool` skills stay consistent — no stale references to docs/ideas.
103
+ - Priority of ideas uses the same P0-P4 scale as tasks (P4 = backlog default for ideas).
104
+
105
+ ## Next validation step
106
+ Prototype one idea as a labelled bead: create it with `-l kind:idea`, confirm `bd ready`
107
+ excludes it by default and `bd ready -l kind:idea` surfaces it; then promote it (add epic label,
108
+ spawn a child task) to confirm the hierarchy reads correctly. If the prototype passes, do the
109
+ bulk migration + skill updates.
110
+
111
+ ## Notes
112
+ Interview on 2026-08-25 locked: labels over status (kind:idea + ralph exclusion), bead-only
113
+ content (files deleted), parent-child promotion, and record-idea skill rewritten to create
114
+ beads. Agent-nexus is the planned consumer. Once this lands, this very record becomes an
115
+ idea-bead (and then this file is deleted — the migration eats its own tail).
@@ -0,0 +1,72 @@
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.
@@ -0,0 +1,89 @@
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).
@@ -0,0 +1,28 @@
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.
@@ -58,9 +58,9 @@ Both repos follow the same two-part format: capability sentence + `"Use when..."
58
58
  > "Disciplined diagnosis loop for hard bugs and performance regressions. Reproduce → minimise → hypothesise → instrument → fix → regression-test. Use when user says 'diagnose this' / 'debug this', reports a bug, says something is broken/throwing/failing, or describes a performance regression."
59
59
 
60
60
  **agent-cortex example** (vaguer triggers):
61
- > "Create a bead, classify it, and if AFK expand it into pipeline stage child beads plus a HITL PR gate task. Use when creating a new task that should be tracked and moved through implementation and human review gates."
61
+ > "Create a task bead, classify it as AFK or HITL, and if AFK expand it into pipeline stage chores plus a HITL PR gate. Use when starting tracked work with implementation and review gates — 'create a task for this', 'track this end-to-end', or 'get this into the ralph pipeline'."
62
62
 
63
- The agent-cortex description describes internal mechanics rather than what the user is trying to accomplish.
63
+ The agent-cortex description leads with internal mechanics ("task bead", "AFK", "HITL") rather than what the user is trying to accomplish — the quoted triggers were added in a later refactor, but the jargon remains.
64
64
 
65
65
  ---
66
66
 
@@ -180,7 +180,7 @@ Move to Phase 2 only when both boxes are checked.
180
180
 
181
181
  **Evidence**: Anthropic Building Effective Agents: *"Think of this as writing a great docstring for a junior developer on your team."* For agents, descriptions are the only routing signal. FLAN (Wei et al., ICLR 2022) showed instruction-tuned models generalise from natural language task descriptions — use the vocabulary a user would *actually speak*, not internal system jargon. Anthropic tool use note: `"Use when"` language *actively counteracts* the model's default tendency to solve problems without invoking tools.
182
182
 
183
- **Current state**: some agent-cortex descriptions describe internal mechanics rather than user intent. E.g., `create-task`: *"Use when creating a new task that should be tracked and moved through implementation and human review gates"* — references internal workflow terms a user wouldn't say.
183
+ **Current state**: some agent-cortex descriptions describe internal mechanics rather than user intent. E.g., `create-task`: *"Use when starting tracked work with implementation and review gates — 'create a task for this', 'track this end-to-end', or 'get this into the ralph pipeline'."* — rewritten to add quoted user triggers (per this rec), though it still leans on internal jargon like "ralph pipeline" a user wouldn't say.
184
184
 
185
185
  **Recommendation**: Rewrite descriptions to lead with user-vocabulary triggers. Include 2–4 quoted phrases or scenario patterns a user might say:
186
186
 
@@ -219,7 +219,7 @@ argument-hint: "Describe the bug or paste the error message"
219
219
 
220
220
  ### Rec 10 — Fix prd-to-epics Missing SKILL.md
221
221
 
222
- **Current state**: `skills/prd-to-epics/` directory exists in the repo but has no `SKILL.md`. It cannot be invoked.
222
+ **Current state**: Resolved in #16 — the broken `skills/prd-to-epics/` directory was removed; epic/task decomposition is consolidated into the `prd-to-tasks` skill (see CHANGELOG 1.0.0).
223
223
 
224
224
  **Recommendation**: Either write the missing `SKILL.md` or remove the directory. This is a straightforward bug.
225
225
 
@@ -110,7 +110,7 @@ REFERENCE.md" — keeping SKILL.md as the primary working document rather than g
110
110
  | Verification checklists | Planned |
111
111
  | Concrete examples | Planned |
112
112
  | Reconsider 100-line limit | Done (raised to 150) |
113
- | ASCII workflow diagrams | Not yet |
113
+ | ASCII workflow diagrams | Done (ASCII-only style guide in skill-anatomy.md) |
114
114
  | Cross-references between skills | Planned |
115
115
  | Consistent skeleton template | Partially adopted |
116
116
 
@@ -29,6 +29,14 @@ Optional fields:
29
29
  - Add one rationale sentence for non-obvious rules so behavior generalizes in novel cases.
30
30
  - Avoid ALL-CAPS emphasis.
31
31
 
32
+ ## Tool references
33
+
34
+ Reference agent tools by `{{TOOL:name}}` token (canonical copilot name), never a
35
+ hardcoded harness-specific name such as `bash`, `task`, or `read_agent` — installers
36
+ substitute the per-harness name from `token-map.json` at install time. Add any new tool
37
+ to the map's `tools` section in the same change; unknown tokens are hard errors. See
38
+ `token-map.README.md` for the full authoring rules.
39
+
32
40
  ## Required sections
33
41
 
34
42
  Every skill must include:
@@ -49,6 +57,23 @@ For each optional section, define **what it is**, include an **example snippet**
49
57
  | `Phase-gate checklists` | Mid-workflow gates that must pass before proceeding | `- [ ] Phase 1 complete: baseline tests captured.` | Multi-phase workflows (3+ distinct phases) | Linear single-phase tasks |
50
58
  | `Cross-skill references` | Explicit delegation to another skill for a real sub-task | `- Run \\`review-security\\` before committing.` | Another skill owns a sub-domain better than restating it | Self-contained skills |
51
59
  | `Examples` | Full worked sample of expected outcome/output | `- Input: ... Output: ...` | Any non-trivial output contract | Trivially self-evident skills |
60
+ | `Workflow diagrams` | Inline ASCII diagram showing step flow and decision points | Fenced block of `[Box]`, `|`, `-`, `>`, `v` arrows, e.g. `[Start] --> [Validate] --> [Run]` | Multi-step or branching workflows where a glanceable flow improves comprehension | Simple linear workflows already clear from numbered steps |
61
+
62
+ ## Workflow diagram style guide
63
+
64
+ When a skill includes a workflow diagram, follow these rules so it renders
65
+ reliably in any CLI:
66
+
67
+ - **ASCII only** — never Mermaid, images, or unicode box-drawing characters.
68
+ Keep to `|`, `-`, `>`, `+`, and `v`.
69
+ - **Fenced block** — wrap the diagram in a fenced code block so monospace is
70
+ preserved.
71
+ - **At most 80 characters per line** — narrow enough for terminal-width readers.
72
+ - **Short box labels** — imperative verbs or nouns (e.g. `[Validate scope]`),
73
+ never full sentences.
74
+ - **Read left-to-right, top-down** — prefer one branch level over dense joins.
75
+ - **Mirror the numbered workflow** — the diagram is a glanceable summary of the
76
+ `## Workflow` steps, never a source of truth that contradicts them.
52
77
 
53
78
  ## Section ordering
54
79
 
@@ -81,8 +106,10 @@ Provide completion gates that are testable and stage-scoped.
81
106
 
82
107
  A skill passes anatomy review when:
83
108
  - [ ] Front matter uses required fields and valid description format.
109
+ - [ ] Tool references use `{{TOOL:name}}` tokens, not hardcoded tool names.
84
110
  - [ ] Required sections exist and follow canonical ordering.
85
111
  - [ ] Optional sections (if present) include what/when/example guidance.
112
+ - [ ] Workflow diagrams (if present) are ASCII-only and follow the workflow diagram style guide.
86
113
  - [ ] Verification checklist contains concrete, machine-checkable items.
87
114
  - [ ] Supporting docs are split by purpose when `SKILL.md` would exceed ~150 lines.
88
115
 
@@ -110,8 +137,26 @@ disable-model-invocation: false
110
137
  ## Workflow
111
138
 
112
139
  1. Gather required context and validate scope boundaries.
113
- 2. Execute deterministic steps in order, recording key decisions.
114
- 3. Produce the required output artifact or terminal response.
140
+ 2. Reject early with the reason when validation fails; otherwise continue.
141
+ 3. Execute deterministic steps in order, recording key decisions.
142
+ 4. Produce the required output artifact or terminal response.
143
+
144
+ Workflow at a glance (include only when the flow branches):
145
+
146
+ [Trigger]
147
+ |
148
+ v
149
+ [Gather context]
150
+ |
151
+ v
152
+ [Validate scope] --(invalid)--> [Reject early]
153
+ |
154
+ (valid)
155
+ v
156
+ [Run deterministic steps]
157
+ |
158
+ v
159
+ [Produce output artifact]
115
160
 
116
161
  ## Red Flags
117
162