@jaybeeuu/agent-cortex 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +269 -0
- package/README.md +102 -8
- package/agents/README.md +2 -2
- package/agents/ralph/agent.md +19 -16
- package/agents/ralph/claude/wake.md +4 -4
- package/agents/ralph/pi/wake.md +15 -20
- package/bin/agent-cortex.mjs +176 -67
- package/bin/installers/claude.mjs +33 -8
- package/bin/installers/pi.mjs +11 -1
- package/docs/skills/skill-anatomy.md +212 -0
- package/extensions/post-merge-watch/README.md +133 -0
- package/extensions/post-merge-watch/index.test.ts +247 -0
- package/extensions/post-merge-watch/index.ts +123 -0
- package/extensions/post-merge-watch/package.json +16 -0
- package/extensions/post-merge-watch/watch.test.ts +469 -0
- package/extensions/post-merge-watch/watch.ts +431 -0
- package/extensions/session-clear/README.md +74 -0
- package/extensions/session-clear/index.test.ts +524 -0
- package/extensions/session-clear/index.ts +159 -0
- package/extensions/session-clear/package.json +16 -0
- package/lib/cli.mjs +88 -1
- package/lib/harness-update.mjs +254 -0
- package/lib/harness-versions.mjs +36 -2
- package/lib/self-update.mjs +553 -0
- package/package.json +2 -1
- package/scripts/lib/docs.mjs +67 -0
- package/skills/engineering/implement-task/SKILL.md +124 -0
- package/skills/engineering/tdd/SKILL.md +2 -0
- package/skills/planning/create-task/REFERENCE.md +20 -3
- package/skills/planning/create-task/SKILL.md +1 -1
- package/skills/planning/create-task/pipeline.json +16 -0
- package/skills/planning/create-task/scripts/create-chores.mjs +51 -24
- package/skills/planning/create-task/templates/code.md +8 -3
- package/skills/planning/create-task/templates/document.md +8 -3
- package/skills/planning/create-task/templates/fix.md +8 -3
- package/skills/planning/create-task/templates/housekeeping.md +69 -0
- package/skills/planning/create-task/templates/post-merge.md +67 -0
- package/skills/planning/create-task/templates/review.md +8 -3
- package/skills/planning/create-task/templates/verify.md +8 -3
- package/skills/productivity/bd-tool/SKILL.md +55 -0
- package/skills/productivity/write-a-skill/SKILL.md +2 -2
- package/skills/review/refactor-skill/SKILL.md +2 -2
- package/skills/review/review-defects/EXAMPLES.md +122 -0
- package/skills/review/review-defects/SKILL.md +91 -0
- package/skills/style/style-tests/EXAMPLES.md +30 -0
- package/skills/style/style-tests/SKILL.md +10 -6
- package/skills/workflow/plan/SKILL.md +14 -3
- package/skills/workflow/ralph/REFERENCE.md +137 -30
- package/skills/workflow/ralph/SKILL.md +26 -16
- package/skills/workflow/ralph/scripts/post-merge-check.mjs +651 -0
- package/skills/workflow/run-pipeline-stage/SKILL.md +41 -23
- package/skills/workflow/run-pipeline-stage/playbooks/code.md +14 -8
- package/skills/workflow/run-pipeline-stage/playbooks/document.md +2 -2
- package/skills/workflow/run-pipeline-stage/playbooks/fix.md +2 -2
- package/skills/workflow/run-pipeline-stage/playbooks/housekeeping.md +58 -0
- package/skills/workflow/run-pipeline-stage/playbooks/post-merge.md +54 -0
- package/skills/workflow/run-pipeline-stage/playbooks/review.md +34 -3
- package/skills/workflow/run-pipeline-stage/playbooks/verify.md +2 -2
- package/skills/workflow/run-pipeline-stage/prompts/stage-runner.md +66 -10
- package/skills/workflow/run-pipeline-stage/scripts/recover-brief.mjs +805 -0
- package/skills/workflow/run-pipeline-stage/scripts/trail-entry.mjs +702 -0
- package/skills/workflow/using-agent-skills/SKILL.md +15 -7
- package/token-map.README.md +41 -4
- package/token-map.json +16 -5
|
@@ -28,7 +28,8 @@ Task arrives
|
|
|
28
28
|
├── Need to plan a feature end-to-end? ─→ plan
|
|
29
29
|
├── Running beads / task execution? ────→ ralph
|
|
30
30
|
│ └── Single stage? ─────────────────→ run-pipeline-stage
|
|
31
|
-
├── Implementing
|
|
31
|
+
├── Implementing a task? ──────────────→ implement-task
|
|
32
|
+
│ ├── Proving one behaviour? ────────→ tdd
|
|
32
33
|
│ ├── Designing an interface? ───────→ design-an-interface
|
|
33
34
|
│ └── Need style conventions? ───────→ style-code
|
|
34
35
|
├── Reviewing code? ───────────────────→ style-code
|
|
@@ -97,12 +98,19 @@ For a complete feature, the typical skill sequence is:
|
|
|
97
98
|
4. `prd-to-tasks` → Break into verifiable chunks
|
|
98
99
|
5. `plan` → Orchestrate the full flow end-to-end
|
|
99
100
|
6. `ralph` → Execute all pending beads
|
|
100
|
-
7. `
|
|
101
|
-
8. `
|
|
102
|
-
9. `
|
|
103
|
-
10. `
|
|
104
|
-
|
|
105
|
-
|
|
101
|
+
7. `implement-task` → Own the criteria, the scope, and the proof
|
|
102
|
+
8. `tdd` → Prove each slice works
|
|
103
|
+
9. `style-code` → Review before merge
|
|
104
|
+
10. `review-security` → Check for secrets
|
|
105
|
+
11. `git-workflow` → Clean commit history
|
|
106
|
+
|
|
107
|
+
Not every task needs every skill. A bug fix might only need: `implement-task` → `tdd` →
|
|
108
|
+
`style-code` → `review-security`.
|
|
109
|
+
|
|
110
|
+
Routing boundary: `implement-task` owns the request — its criteria, its scope, its evidence. `tdd`
|
|
111
|
+
owns the loop inside one criterion, and answers "how do I prove this behaviour" once the task is
|
|
112
|
+
already understood. A request with acceptance criteria to satisfy starts at `implement-task`; a
|
|
113
|
+
bare "write a test for X" still starts at `tdd`.
|
|
106
114
|
|
|
107
115
|
## Red Flags
|
|
108
116
|
|
package/token-map.README.md
CHANGED
|
@@ -51,10 +51,36 @@ rather than inventing a dotted form:
|
|
|
51
51
|
`ask_user`) — and `task` / `read_agent` / `wait_for_agents` subagent tools, the last three
|
|
52
52
|
supplied by this repo's own `extensions/subagent` rather than by pi; `skill` maps
|
|
53
53
|
to `read` (skills load by reading the listed SKILL.md path).
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
Two rows carry session-to-session messaging rather than a built-in tool: `peer_send` and
|
|
55
|
+
`peer_list`. On claude they are Claude Code's own `SendMessage` and `ListAgents`; on pi they
|
|
56
|
+
are the `pi-peer` package's tools, which the consuming repository installs itself. A row maps
|
|
57
|
+
a **name, never a protocol**: the message kinds and the acknowledgement rule layered above
|
|
58
|
+
the transport are harness-invariant text, so only the transport forks and the protocol stays
|
|
59
|
+
in one authored copy.
|
|
60
|
+
One row names who waits for a CI run that outlives a check's own wait window:
|
|
61
|
+
`post_merge_watch`. Its two values differ in kind — this package's own `post-merge-watch`
|
|
62
|
+
extension on pi, Claude Code's built-in `ScheduleWakeup` tool on claude — so the prose around
|
|
63
|
+
it describes only what both do (the session resumes, the check runs again) and never a call
|
|
64
|
+
shape.
|
|
65
|
+
Both values are a **self-paced re-prompt, not an event subscription**: the session asks to be
|
|
66
|
+
woken and looks again on waking. Claude Code also supplies an event-watching `Monitor` tool,
|
|
67
|
+
but that tool is gated behind a feature flag that defaults off, so a portable skill may not
|
|
68
|
+
depend on it. Naming the re-prompt is what holds on every session; the playbook's prose
|
|
69
|
+
fallback covers the session where even that is absent.
|
|
70
|
+
- **`paths`** — `plugin_root`, `agents_dir`, `skills_dir`, and `skill_anatomy`. These are the
|
|
71
|
+
install-time variables that differ per harness. `plugin_root` is the anchor; the others
|
|
72
|
+
resolve relative to it (`{base, relative}` specs) so a harness only overrides the single
|
|
73
|
+
root it actually installs into.
|
|
74
|
+
A path entry whose relative path sits under `docs/` names a document the install ships:
|
|
75
|
+
both installers copy it from the package root into the staged tree at that relative path
|
|
76
|
+
(`scripts/lib/docs.mjs`), so a skill can read it on a machine with no checkout. One copy
|
|
77
|
+
per install serves every skill that references it, and the token map decides both the
|
|
78
|
+
location and the shipment — `skill_anatomy` is read by both `write-a-skill` and
|
|
79
|
+
`refactor-skill`. The repo's `docs/` stays the single source of truth; the staged file is
|
|
80
|
+
a verbatim copy, never a second authored version.
|
|
81
|
+
A second shipped doc is declared twice: the `paths` entry sets its install location, and
|
|
82
|
+
`package.json` `files` must list the same path. The test stages from the checkout, so only
|
|
83
|
+
the `files` whitelist catches a doc that the published package omits.
|
|
58
84
|
Claude's `plugin_root` stays the `${CLAUDE_PLUGIN_ROOT}` env-var token, never a literal
|
|
59
85
|
`~/.agent-cortex/claude`: Claude Code **copies** marketplace-installed plugins — including
|
|
60
86
|
local directory sources like `~/.agent-cortex/claude` — into its own cache, so only the
|
|
@@ -92,6 +118,17 @@ Unknown (unmapped) tokens are a **hard error**, not a null — a silently-passed
|
|
|
92
118
|
token is exactly the bug the map exists to prevent, and mirrors the build script's
|
|
93
119
|
`unknown tool "x"` throw.
|
|
94
120
|
|
|
121
|
+
The peer channel is the worked example. `peer_get` and `peer_await` are `pi-peer` tools and
|
|
122
|
+
Claude Code has no equivalent, so they get no row and a shared sentence never names them:
|
|
123
|
+
substituting one would drop the token and leave the sentence that named it short of a name.
|
|
124
|
+
Their documentation stays inside a section labelled for one harness, where nothing is
|
|
125
|
+
substituted — see the `pi-peer` runbook in `skills/workflow/ralph/REFERENCE.md`.
|
|
126
|
+
|
|
127
|
+
`post_merge_watch` is deliberately **not** null on either side: a null would drop the token in the
|
|
128
|
+
pi render or the claude render and leave the sentence that named the mechanism short of one. The
|
|
129
|
+
fallback for a session that has no watcher is therefore written as prose in the same section, so
|
|
130
|
+
it survives both renders unchanged — see `skills/workflow/run-pipeline-stage/playbooks/post-merge.md`.
|
|
131
|
+
|
|
95
132
|
The pi install-time installer (`bin/installers/pi.mjs`) follows the strict contract above.
|
|
96
133
|
One consumer deviates deliberately: the pi `agent-modes` extension reads the map at
|
|
97
134
|
**runtime** (not install time) to compose agent prompts from the composable agents
|
package/token-map.json
CHANGED
|
@@ -25,7 +25,10 @@
|
|
|
25
25
|
"skill": { "claude": "Skill", "pi": "read" },
|
|
26
26
|
"task": { "claude": "Task", "pi": "task" },
|
|
27
27
|
"read_agent": { "claude": null, "pi": "read_agent" },
|
|
28
|
-
"wait_for_agents": { "claude": null, "pi": "wait_for_agents" }
|
|
28
|
+
"wait_for_agents": { "claude": null, "pi": "wait_for_agents" },
|
|
29
|
+
"peer_send": { "claude": "SendMessage", "pi": "peer_send" },
|
|
30
|
+
"peer_list": { "claude": "ListAgents", "pi": "peer_list" },
|
|
31
|
+
"post_merge_watch": { "claude": "ScheduleWakeup", "pi": "post-merge-watch" }
|
|
29
32
|
},
|
|
30
33
|
"paths": {
|
|
31
34
|
"plugin_root": {
|
|
@@ -39,6 +42,10 @@
|
|
|
39
42
|
"skills_dir": {
|
|
40
43
|
"claude": { "base": "plugin_root", "relative": "skills" },
|
|
41
44
|
"pi": { "base": "plugin_root", "relative": "skills" }
|
|
45
|
+
},
|
|
46
|
+
"skill_anatomy": {
|
|
47
|
+
"claude": { "base": "plugin_root", "relative": "docs/skills/skill-anatomy.md" },
|
|
48
|
+
"pi": { "base": "plugin_root", "relative": "docs/skills/skill-anatomy.md" }
|
|
42
49
|
}
|
|
43
50
|
},
|
|
44
51
|
"agents": {
|
|
@@ -58,8 +65,8 @@
|
|
|
58
65
|
"claude": "event-driven"
|
|
59
66
|
},
|
|
60
67
|
"notes": {
|
|
61
|
-
"pi": "Blocking wait: wait_for_agents returns as soon as one worker finishes, carrying its result inline. No timer to start, nothing to kill — there is no poll loop.",
|
|
62
|
-
"claude": "Event-driven: the harness re-invokes ralph when a worker completes and delivers the result inline. No poll timer
|
|
68
|
+
"pi": "Blocking wait: wait_for_agents returns as soon as one worker finishes, carrying its result inline. No timer to start, nothing to kill — there is no poll loop. Progress is read from the bead trail the worker writes (`bd show`, `bd provenance log`).",
|
|
69
|
+
"claude": "Event-driven: the harness re-invokes ralph when a worker completes and delivers the result inline. No poll timer and no sleep. Progress is read from the bead trail the worker writes (`bd show`, `bd provenance log`), never from a file ralph tails."
|
|
63
70
|
}
|
|
64
71
|
},
|
|
65
72
|
"notes": {
|
|
@@ -71,11 +78,15 @@
|
|
|
71
78
|
"skill": "Claude (Skill) exposes skills as a tool. pi has no dedicated skill tool — skills are surfaced in the always-present 'Available skills' context block and loaded by reading the listed SKILL.md path ({{PATH:<skill>/SKILL.md}}). The pi mapping is read, the tool used to load a skill's file; a dedicated skill tool is a follow-on design candidate if prompting proves insufficient.",
|
|
72
79
|
"read_agent": "Claude's Task returns results inline — there is no separate read step, so read_agent drops on claude (null). pi exposes read_agent as a fallback to wait_for_agents.",
|
|
73
80
|
"task": "Claude provides a subagent tool natively. On pi it is supplied by this repo's own extensions/subagent extension (which also registers read_agent and wait_for_agents), not by pi itself — a pi session started before that extension was installed has no dispatch tool at all. Skills must therefore stop and report a missing subagent tool rather than improvising a backgrounded CLI run, which has no completion signal.",
|
|
74
|
-
"wait_for_agents": "PI-only blocking wait over background subagent runs (the task tool): returns the results of completed agents and STILL RUNNING for the rest. Claude's Task delivers results inline with no wait step — null on claude."
|
|
81
|
+
"wait_for_agents": "PI-only blocking wait over background subagent runs (the task tool): returns the results of completed agents and STILL RUNNING for the rest. Claude's Task delivers results inline with no wait step — null on claude.",
|
|
82
|
+
"peer_send": "Session-to-session message send. pi takes it from the published pi-peer package (an ordinary package the consuming repository installs itself, never a dependency of this one). Claude Code has it built in and its docs name it there. Both address a peer by the name or address their own list reports, and neither send is proof of receipt. Only sends and discovery are tokenised: pi-peer's peer_get and peer_await have no Claude Code equivalent, and a null claude mapping drops the token and leaves the sentence that named it broken, so harness-varying prose must never name them — such passages stay inside a harness-labelled runbook.",
|
|
83
|
+
"peer_list": "Peer discovery: the peers that can receive a message, and the address each is reached by. pi's is the pi-peer package's tool. Claude Code's built-in equivalent is ListAgents (an earlier binary named it ListPeers), which also reports reachability and so doubles as the peer-state read.",
|
|
84
|
+
"post_merge_watch": "Who waits for a CI run that outlives the check's own wait window. The row maps a name, not a protocol: the verdicts and the escalation rule layered above it are harness-invariant text, so only the mechanism is tokenised. pi's name is this package's own post-merge-watch extension, which re-runs the check on a timer and wakes an idle session with the verdict. Claude Code's is its built-in ScheduleWakeup tool, which schedules the session's own resumption so it can re-run the check. The values differ in kind — an extension on pi, a tool on claude — because that is what each harness supplies; the surrounding prose therefore describes only what both do (the session resumes, the check runs again, the verdict table is unchanged) and never a call shape."
|
|
75
85
|
},
|
|
76
86
|
"paths": {
|
|
77
87
|
"pi": "plugin_root is the staged package `agent-cortex install pi` materialises at ~/.agent-cortex/pi; pi loads that directory by path and the shipped extensions resolve their own resources relative to it (agent-modes computes plugin_root from its actual install location). A checkout or symlinked install differs — installers compute plugin_root from the actual resolution and can override it (--plugin-root).",
|
|
78
|
-
"claude": "plugin_root stays ${CLAUDE_PLUGIN_ROOT} (env var) for the materialised plugin — never a literal ~/.agent-cortex/claude. Claude Code copies marketplace-installed plugins (including local directory sources like ~/.agent-cortex/claude) into its own cache and expands the env var per context, so a literal home path in substituted files would break under cache-copy; the installer passes the env form through verbatim."
|
|
88
|
+
"claude": "plugin_root stays ${CLAUDE_PLUGIN_ROOT} (env var) for the materialised plugin — never a literal ~/.agent-cortex/claude. Claude Code copies marketplace-installed plugins (including local directory sources like ~/.agent-cortex/claude) into its own cache and expands the env var per context, so a literal home path in substituted files would break under cache-copy; the installer passes the env form through verbatim.",
|
|
89
|
+
"skill_anatomy": "A path entry whose relative path sits under docs/ names a document the install ships: both installers copy it from the package root into the staged tree at that relative path (scripts/lib/docs.mjs), so a skill can read it on a machine with no checkout. One copy per install serves every skill that references it — write-a-skill and refactor-skill both do. The repo's docs/ stays the single source of truth; the staged copy is a verbatim copy, never a second authored version."
|
|
79
90
|
},
|
|
80
91
|
"agents": {
|
|
81
92
|
"prefix": "Claude strips the agent-cortex: name prefix during conversion (NAME_PREFIX in bin/installers/claude.mjs): pi agents are agent-cortex:<slug>, claude agents are <slug>."
|