@jaybeeuu/agent-cortex 1.43.0 → 2.0.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 (42) hide show
  1. package/.agents/skills/style-versioning/SKILL.md +5 -6
  2. package/.github/workflows/ci.yml +4 -11
  3. package/AGENTS.md +10 -16
  4. package/CHANGELOG.md +16 -0
  5. package/README.md +44 -55
  6. package/agents/README.md +9 -23
  7. package/agents/ralph/agent.md +7 -10
  8. package/agents/ralph/claude/polling.md +1 -1
  9. package/bin/agent-cortex.mjs +0 -16
  10. package/bin/installers/claude.mjs +2 -2
  11. package/docs/research/disable-model-invocation.md +5 -26
  12. package/docs/skills/skill-anatomy.md +2 -3
  13. package/docs/technical-direction/harness-config.md +6 -14
  14. package/docs/user-preferences.md +2 -2
  15. package/extensions/agent-modes/README.md +3 -3
  16. package/extensions/agent-modes/discover.ts +6 -6
  17. package/extensions/subagent/README.md +2 -2
  18. package/extensions/subagent/agents.ts +1 -2
  19. package/lib/cli.mjs +5 -7
  20. package/package.json +3 -5
  21. package/scripts/lib/compose-agent.mjs +10 -10
  22. package/skills/workflow/ralph/REFERENCE.md +3 -3
  23. package/skills/workflow/ralph/SKILL.md +5 -5
  24. package/test/cli.test.mjs +11 -10
  25. package/token-map.README.md +9 -12
  26. package/token-map.json +26 -31
  27. package/agents/plan/copilot/frontmatter.json +0 -6
  28. package/agents/plan.agent.md +0 -59
  29. package/agents/ralph/copilot/frontmatter.json +0 -6
  30. package/agents/ralph/copilot/polling.md +0 -62
  31. package/agents/ralph-plan/copilot/frontmatter.json +0 -6
  32. package/agents/ralph-plan.agent.md +0 -126
  33. package/agents/ralph.agent.md +0 -331
  34. package/agents/strategy/copilot/frontmatter.json +0 -6
  35. package/agents/strategy.agent.md +0 -112
  36. package/bin/installers/copilot.mjs +0 -124
  37. package/hooks.json +0 -10
  38. package/plugin.json +0 -35
  39. package/scripts/build-copilot-agents.mjs +0 -30
  40. package/scripts/install-instructions.sh +0 -82
  41. package/scripts/sync-plugin-version.sh +0 -17
  42. package/test/copilot-installer.test.mjs +0 -308
@@ -82,7 +82,7 @@ changeset to make it green.
82
82
  The `release` job in `.github/workflows/ci.yml` handles everything automatically:
83
83
 
84
84
  1. **Detects new changesets** on main
85
- 2. **Creates a "Version Packages" PR** — the `version` step runs `pnpm version-packages`, which bumps `package.json`, syncs `plugin.json` (via `scripts/sync-plugin-version.sh`), updates `CHANGELOG.md`, and regenerates the committed Copilot output (`pnpm build:copilot`; the Claude plugin is materialised at install time with the package version, so it has no committed output to regenerate) so the drift gates never fail on a version bump
85
+ 2. **Creates a "Version Packages" PR** — the `version` step runs `pnpm version-packages` (`changeset version`), which bumps `package.json` and rewrites `CHANGELOG.md`. That is the whole release surface: every plugin this package ships is materialised at install time with the package version, so there is no generated output to regenerate and no drift gates to satisfy on a version bump
86
86
  3. **When "Version Packages" is merged**:
87
87
  - Creates a git tag
88
88
  - Publishes to npm — `pnpm publish-package` packs with `pnpm pack` and publishes with `npm publish --provenance --access public`. Authenticates via npm Trusted Publishing (OIDC): the release job's `id-token` permission lets npm exchange a GitHub OIDC token for a short-lived npm token at publish time, so no `NPM_TOKEN` secret or `.npmrc` auth config is required — only the one-time npm-side Trusted Publishing setup on npmjs.com (package → Access → Trusted Publishing → GitHub repo `jaybeeuu/agent-cortex` + workflow `.github/workflows/ci.yml`)
@@ -141,18 +141,17 @@ human-only follow-ups, including the merge probe that closes AC1.
141
141
 
142
142
  ### Version lockstep
143
143
 
144
- All version numbers stay in lockstep automatically:
144
+ Two files carry the version, in lockstep automatically:
145
145
 
146
146
  1. `package.json` → bumped by changesets
147
- 2. `plugin.json` → synced by `scripts/sync-plugin-version.sh`
148
- 3. `CHANGELOG.md` → generated by changesets
147
+ 2. `CHANGELOG.md` → generated by changesets
149
148
 
150
149
  **Never bump versions manually.** Always create a changeset file.
151
150
 
152
151
  ## Common mistakes
153
152
 
154
153
  - **Running `pnpm changeset`**: Interactive, wastes tokens. Write the file directly.
155
- - **Bumping versions manually**: Don't touch `"version"` in `package.json` or `plugin.json`. Create a changeset.
154
+ - **Bumping versions manually**: Don't touch `"version"` in `package.json`. Create a changeset.
156
155
  - **Omitting the changeset**: CI fails the PR. Publishing is the default; the only
157
156
  opt-out is the `no-publish` label, which must already exist in the repo's settings.
158
157
  - **Wrong bump type**: `patch` for fixes, `minor` for additions, `major` for breakage. When in doubt, ask the user.
@@ -170,4 +169,4 @@ All version numbers stay in lockstep automatically:
170
169
  | Agent bumps versions locally | Agent writes a changeset file |
171
170
  | Manual GitHub release creation | Automated by the `release` job in `ci.yml` |
172
171
  | `publish.yml` triggered by release | `ci.yml` release job on push to main |
173
- | Version sync was manual | `sync-plugin-version.sh` runs automatically |
172
+ | Version files synced by hand | changesets bumps `package.json` + `CHANGELOG.md` |
@@ -220,11 +220,6 @@ jobs:
220
220
  PLUGIN_VERSION=$(node -p "require('$OUT/.claude-plugin/plugin.json').version")
221
221
  test "$PKG_VERSION" = "$PLUGIN_VERSION"
222
222
 
223
- - name: Check generated Copilot agent files are up to date
224
- run: |
225
- pnpm build:copilot
226
- git diff --exit-code -- 'agents/*.agent.md'
227
-
228
223
  release:
229
224
  name: Release
230
225
  needs: [lint, test, claude-plugin-check]
@@ -288,12 +283,10 @@ jobs:
288
283
  # changesets/action execs these inputs via @actions/exec with NO shell:
289
284
  # the string is split by argStringToArray on whitespace (single quotes
290
285
  # survive literally), so each must be a single unquoted command token
291
- # that runs a pnpm script. version-packages bumps versions, syncs
292
- # plugin.json, THEN regenerates the committed Copilot output
293
- # (build:copilot re-derives agents/*.agent.md; the Claude plugin is
294
- # materialised at install time with the package version, so nothing
295
- # committed needs regenerating) before the action commits, so the
296
- # Version Packages PR always passes the drift gates.
286
+ # that runs a pnpm script. version-packages bumps the package version
287
+ # and rewrites CHANGELOG.md, and nothing else is committed: the Claude
288
+ # plugin is materialised at install time with the package version, so
289
+ # there is no committed output to regenerate.
297
290
  version: pnpm version-packages
298
291
  # pnpm publish-package when the merged PR is unlabelled, pnpm
299
292
  # publish-noop when it carries `no-publish`.
package/AGENTS.md CHANGED
@@ -4,20 +4,17 @@ Instructions for agents working on this repository.
4
4
 
5
5
  ## What This Repo Is
6
6
 
7
- A personal Copilot CLI plugin containing custom agents and skills, shipped to Copilot, pi,
8
- and Claude Code, plus PI extensions and Claude hooks for enhancing the coding agent
9
- runtime. Changes here affect the behaviour of every agent, skill, and PI extension
10
- available in the author's coding sessions.
7
+ A personal collection of custom agents and skills, shipped to pi and Claude Code, plus PI
8
+ extensions and Claude hooks for enhancing the coding agent runtime. Changes here affect the
9
+ behaviour of every agent, skill, and PI extension available in the author's coding sessions.
11
10
 
12
11
  ## Structure
13
12
 
14
13
  ```
15
14
  agent-cortex/
16
15
  ├── package.json # PI package manifest (pi: { extensions, skills }) + pi runtime deps
17
- ├── plugin.json # GitHub Copilot plugin manifest — agents, skills, MCP servers
18
16
  ├── agents/ # Custom agents — canonical composable <name>/ dirs
19
- │ ├── *.agent.md # generated from <name>/ by scripts/build-copilot-agents.mjs
20
- │ ├── ralph/ # composable format — see agents/README.md
17
+ │ ├── ralph/ # composable format (shared agent.md + pi/, claude/) — see agents/README.md
21
18
  │ ├── plan/ # "
22
19
  │ ├── ralph-plan/ # "
23
20
  │ └── strategy/ # "
@@ -44,7 +41,7 @@ agent-cortex/
44
41
  ## Versioning
45
42
 
46
43
  Use `pnpm changeset` for all version bumps. Never edit versions manually.
47
- `package.json`, `plugin.json`, and `CHANGELOG.md` stay in lockstep automatically.
44
+ `package.json` and `CHANGELOG.md` stay in lockstep automatically.
48
45
  See the `style-versioning` skill for the full workflow.
49
46
 
50
47
  ## Changelog
@@ -69,7 +66,7 @@ Generated automatically by changesets. Do not edit `CHANGELOG.md` manually.
69
66
  ## Skill Conventions
70
67
 
71
68
  - **Skills are portable, not repo documentation.** `skills/` is installed onto arbitrary machines
72
- (Copilot, pi, Claude Code), so it describes general practice and the author's portable
69
+ (pi, Claude Code), so it describes general practice and the author's portable
73
70
  preferences — never how this repository is configured or how to work in it. Facts about this
74
71
  checkout (branch bases, merge method, signature rules, required checks, release mechanics) belong
75
72
  in `AGENTS.md`, `docs/`, or the tracker. Repo-local `.agents/skills/` follows the same rule: a
@@ -88,13 +85,10 @@ Generated automatically by changesets. Do not edit `CHANGELOG.md` manually.
88
85
  ## Agent Conventions
89
86
 
90
87
  - Agents live in composable `<name>/` directories under `agents/`: a shared `agent.md` body plus
91
- per-harness subdirectories `pi/`, `copilot/`, `claude/` (frontmatter.json and optional section
92
- files) per the spec in `agents/README.md`. `ralph`, `plan`, `ralph-plan`, and `strategy` all use
93
- the composable layout. The flat `agents/*.agent.md` files are **generated output** — composed
94
- from the canonical directories by the shared `bin/installers/copilot.mjs` code path behind both
95
- `agent-cortex install copilot` and `scripts/build-copilot-agents.mjs` (thin wrapper), and
96
- committed for Copilot CLI (plugin.json `agents: "agents/"` scans for `*.agent.md`); never edit
97
- them by hand. The Claude plugin is materialised by the install-time generator
88
+ per-harness subdirectories `pi/` and `claude/` (frontmatter.json and optional section files) per
89
+ the spec in `agents/README.md`. `ralph`, `plan`, `ralph-plan`, and `strategy` all use the
90
+ composable layout, and no flat agent file is committed — each harness renders its own at install
91
+ time. The Claude plugin is materialised by the install-time generator
98
92
  `bin/installers/claude.mjs`: a plain `agent-cortex install claude` copies it into
99
93
  `~/.agent-cortex/claude` (skills copied flat with `{{TOOL:...}}`/`{{PATH:...}}` substituted,
100
94
  never symlinked), writes the marketplace manifest at
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 847ce42: Remove Copilot CLI as a deploy target. `agent-cortex install copilot` is gone (the
8
+ supported harnesses are now `claude` and `pi`), along with the Copilot plugin manifest
9
+ `plugin.json`, the `build:copilot` script and its committed `agents/*.agent.md` output,
10
+ the `agents/*/copilot/` harness dirs, `scripts/sync-plugin-version.sh`, the `postinstall`
11
+ hook and `scripts/install-instructions.sh` that wrote `~/.copilot/copilot-instructions.md`,
12
+ and the Copilot column of `token-map.json`.
13
+
14
+ `version-packages` is now plain `changeset version`: the release surface is
15
+ `package.json` + `CHANGELOG.md`, since every plugin is materialised at install time with
16
+ the package version. Nothing is swept from an existing `~/.copilot` install — remove
17
+ `~/.copilot/installed-plugins/_direct/agent-cortex` by hand.
18
+
3
19
  ## 1.43.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -1,21 +1,18 @@
1
1
  # agent-cortex
2
2
 
3
- A personal collection of custom agents and skills, shipped to three harnesses from one
4
- source: the [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/plugins-creating),
5
- pi, and [Claude Code](https://code.claude.com/docs) (as a plugin).
3
+ A personal collection of custom agents and skills, shipped to two harnesses from one
4
+ source: pi and [Claude Code](https://code.claude.com/docs) (as a plugin).
6
5
 
7
6
  ## Structure
8
7
 
9
8
  ```
10
9
  agent-cortex/
11
- ├── plugin.json # Copilot plugin manifest
12
10
  ├── agents/ # Canonical agents — composable <name>/ dirs (see agents/README.md)
13
- │ ├── *.agent.md # ralph, ralph-plan, plan, strategy — GENERATED from <name>/ by scripts/build-copilot-agents.mjs
14
- │ ├── ralph/ # composable form (shared agent.md + per-harness pi/, copilot/, claude/)
11
+ │ ├── ralph/ # composable form (shared agent.md + per-harness pi/, claude/)
15
12
  │ ├── plan/ # "
16
13
  │ ├── ralph-plan/ # "
17
14
  │ └── strategy/ # "
18
- ├── agents-native/ # Claude-only agents with no Copilot equivalent
15
+ ├── agents-native/ # Claude-only agents
19
16
  │ └── ralph.md # the lean Claude Ralph
20
17
  ├── skills/ # Skills (grouped by domain) — shared by all harnesses
21
18
  │ ├── engineering/ # tdd, improve-codebase-architecture, …
@@ -37,23 +34,18 @@ agent-cortex/
37
34
  ├── bin/
38
35
  │ ├── agent-cortex.mjs # CLI entrypoint
39
36
  │ └── installers/
40
- │ ├── copilot.mjs # shared generator: agent-cortex install copilot + scripts/build-copilot-agents.mjs
41
- │ └── claude.mjs # materialises ~/.agent-cortex/claude + ~/.claude/settings.json, registers with Claude Code (--output <dir> = generate-only)
42
- ├── scripts/
43
- │ └── build-copilot-agents.mjs # thin wrapper over bin/installers/copilot.mjs (regenerates agents/*.agent.md)
37
+ │ ├── claude.mjs # materialises ~/.agent-cortex/claude + ~/.claude/settings.json, registers with Claude Code (--output <dir> = generate-only)
38
+ │ └── pi.mjs # stages ~/.agent-cortex/pi + registers it with pi (--output <dir> = stage-only)
44
39
  ├── claude/ # Committed Claude user-settings template (settings.json) — merged into ~/.claude/settings.json
45
40
  └── claude-extras/ # Hand-authored Claude plugin extras
46
41
  ├── .mcp.json # MCP servers (context7, github) — copied into installs
47
42
  └── scripts/ # statusline-command.sh — copied into installs (executable)
48
43
  ```
49
44
 
50
- The same `agents/` and `skills/` power three harnesses (Copilot, pi, Claude Code).
51
- The composable `agents/<name>/` directories are the single source of truth; the flat
52
- `agents/*.agent.md` files are **generated** by the shared copilot installer
53
- (`agent-cortex install copilot`, or `scripts/build-copilot-agents.mjs` via
54
- `pnpm build:copilot` — both run the same `bin/installers/copilot.mjs` code path, so
55
- install-time and build-time output can never diverge) and committed so Copilot CLI
56
- (plugin.json `agents: "agents/"`) and pi keep loading the agents — don't hand-edit them.
45
+ The same `agents/` and `skills/` power two harnesses (pi and Claude Code). The composable
46
+ `agents/<name>/` directories are the single source of truth, and no flat agent file is
47
+ committed: `agent-cortex install claude` and `agent-cortex install pi` each render their own
48
+ from the canonical directories, so install-time output can never drift from the sources.
57
49
  The `{{TOOL:...}}` / `{{PATH:...}}` tokens written in agent and skill files are resolved
58
50
  per harness at install time from `token-map.json`, the single source of truth for
59
51
  canonical tool/path/agent names (see `token-map.README.md` and the `contract` section).
@@ -76,15 +68,13 @@ temp-dir install plus structural checks:
76
68
  - **Agents** can't be shared files (the frontmatter formats differ), so the materialised
77
69
  plugin's `agents/*.md` are composed from the canonical `agents/<name>/` directories' `claude/`
78
70
  harness dirs
79
- (frontmatter.json + section files), exactly like the Copilot flats are composed from their
80
- `copilot/` dirs. Claude only loads agents from a plugin's default `agents/` dir, so the plugin
81
- ships them at its own root (default `~/.agent-cortex/claude/agents/`) — isolating them from the
82
- Copilot `.agent.md` files.
83
- - **Claude-native agents** that have no Copilot equivalent live in `agents-native/*.md` and are
84
- copied verbatim into the materialised plugin's `agents/`. `ralph` is one: it is reimplemented
85
- for Claude around
86
- background workers + an independent review gate (the Copilot Ralph's `task`/`read_agent`
87
- poll loop has no Claude equivalent), so it can't be mechanically converted.
71
+ (frontmatter.json + section files). Claude only loads agents from a plugin's default `agents/`
72
+ dir, so the plugin ships them at its own root (default `~/.agent-cortex/claude/agents/`).
73
+ - **Claude-native agents** that cannot be composed from a shared body live in
74
+ `agents-native/*.md` and are copied verbatim into the materialised plugin's `agents/`. `ralph`
75
+ is one: it is reimplemented for Claude around background workers + an independent review gate
76
+ (Claude's event-driven completion delivery has no `task`/`read_agent` poll loop to reuse), so
77
+ it can't be mechanically converted.
88
78
  - **Manifests** are generated too: the plugin's `.claude-plugin/plugin.json` (its `version`
89
79
  tracks `package.json`, so it never goes stale) and `hooks.json` (copied from the canonical
90
80
  `hooks/claude/hooks.json` source), plus any support files under `hooks/claude/` bundled into
@@ -94,8 +84,8 @@ temp-dir install plus structural checks:
94
84
  extension→hook mapping and the rejections (auto-name, agent-guardrails, skill-stats, subagent, agent-modes).
95
85
 
96
86
  Edit the sources (`agents/<name>/` composable dirs, `agents-native/*.md`, `skills/**`,
97
- `hooks/claude/`, `claude-extras/`, `package.json`), never the generated
98
- `agents/*.agent.md` files or anything under the materialised `~/.agent-cortex/claude`.
87
+ `hooks/claude/`, `claude-extras/`, `package.json`), never anything under the materialised
88
+ `~/.agent-cortex/claude`.
99
89
 
100
90
  ## CI
101
91
 
@@ -117,9 +107,8 @@ validates the Claude plugin **materialiser** instead of diffing a committed mirr
117
107
  it runs `node bin/agent-cortex.mjs install claude --output <tmp dir>` and checks the
118
108
  result structurally — `plugin.json` version tracks `package.json`, every generated and
119
109
  hand-authored piece is present, no literal `{{TOOL:...}}`/`{{PATH:...}}` tokens survive,
120
- and no symlinks leak into the copied tree. The Copilot drift check
121
- (`pnpm build:copilot` + `git diff --exit-code -- 'agents/*.agent.md'`) still guards the
122
- committed flat agent files.
110
+ and no symlinks leak into the copied tree. There is no committed agent file to drift-check:
111
+ the `agents/` tree holds the composable sources only, and both installers render from them.
123
112
 
124
113
  A separate `changeset-check` job runs on every pull request and fails it unless the
125
114
  PR adds a `.changeset/*.md` file. **Publishing is the default and `no-publish` is the
@@ -133,11 +122,10 @@ changeset.
133
122
  On pushes to `main`, a `release` job (gated on `lint`, `test`, and
134
123
  `claude-plugin-check`) runs changesets to open a `chore: version packages` PR when
135
124
  changesets are pending, then publishes to npm once it lands. The version step runs
136
- `pnpm version-packages` — bumping `package.json`, syncing `plugin.json`, and
137
- regenerating the committed Copilot agent files (the Claude plugin is materialised at
138
- install time with the package version, so it has no committed output to regenerate)
139
- so the drift gates stay green; the publish step runs `pnpm publish-package` (pack +
140
- provenance publish), or
125
+ `pnpm version-packages` — `changeset version`, which bumps `package.json` and rewrites
126
+ `CHANGELOG.md` and touches nothing else (both plugins are materialised at install time
127
+ with the package version, so there is no committed output to regenerate); the publish
128
+ step runs `pnpm publish-package` (pack + provenance publish), or
141
129
  `pnpm publish-noop` when the merged PR carried `no-publish`. Labels are invisible on
142
130
  a push event, so the job resolves the PR merged for the pushed commit through the
143
131
  GitHub API and reads its labels — no extra secret or scope, since the job already
@@ -262,18 +250,25 @@ templates** for your own pi configuration. They are not installer output: pi's
262
250
  `settings.json` and `keybindings.json` are pi's own user config, so
263
251
  `agent-cortex install pi` leaves them alone.
264
252
 
265
- ### Copilot plugin (separate)
253
+ ### Removing a stale Copilot install
266
254
 
267
- ```sh
268
- copilot plugin install jaybeeuu/agent-cortex
269
- ```
270
-
271
- Or install a local checkout:
255
+ Copilot CLI is no longer a deploy target: `agent-cortex install copilot` and the
256
+ `plugin.json` manifest are gone, and nothing in this package reads or writes `~/.copilot`
257
+ any more. No installer sweeps an existing install, so a machine that used the old target
258
+ keeps a stale plugin, a cached marketplace, and an instruction block until you remove them
259
+ by hand:
272
260
 
273
261
  ```sh
274
- copilot plugin install ./agent-cortex
262
+ rm -rf ~/.copilot/installed-plugins/_direct/agent-cortex
263
+ rm -rf ~/.cache/copilot/marketplaces/https---github-com-jaybeeuu-agent-cortex
264
+ sed -i.bak '/<!-- agent-cortex:start -->/,/<!-- agent-cortex:end -->/d' \
265
+ ~/.copilot/copilot-instructions.md
275
266
  ```
276
267
 
268
+ The first two paths are the old install and its marketplace cache. The `sed` deletes only
269
+ the agent-cortex block the removed `postinstall` hook appended to Copilot's own
270
+ instructions file, leaving the rest of that file — and a `.bak` copy — intact.
271
+
277
272
  ### Claude Code plugin (separate)
278
273
 
279
274
  A plain `agent-cortex install claude` **materialises** the plugin into the home install
@@ -293,10 +288,6 @@ The generate-only `--output <dir>` form is for previewing and CI validation; the
293
288
  documented path is the plain install to `~/.agent-cortex/claude`:
294
289
 
295
290
  ```sh
296
- pnpm build:copilot # or: node scripts/build-copilot-agents.mjs (regenerates agents/*.agent.md)
297
- node bin/agent-cortex.mjs install copilot # regenerates agents/*.agent.md in place
298
- node bin/agent-cortex.mjs install copilot --dry-run # plan only, no writes
299
- node bin/agent-cortex.mjs install copilot --output /tmp/x # preview the flat files elsewhere
300
291
  node bin/agent-cortex.mjs install claude # materialises ~/.agent-cortex/claude + marketplace manifest AND registers it with Claude Code (user scope, idempotent)
301
292
  node bin/agent-cortex.mjs install claude --dry-run # plan generation + registration, no writes/spawns
302
293
  node bin/agent-cortex.mjs install claude --require-register # fail (non-zero exit) when the claude CLI can't drive registration
@@ -432,14 +423,14 @@ extension→hook audit.
432
423
  rejection rationale live in `docs/claude-hooks.md`.
433
424
  - Ralph follow-ups: multi-feature epic branches, and a GitHub-trigger routine to auto-resume
434
425
  after a PR merge (instead of manual re-invocation).
435
- - The Copilot/pi Ralph (the 4-stage `run-pipeline-stage` pipeline) is unchanged; those two
426
+ - The pi Ralph (the 4-stage `run-pipeline-stage` pipeline) is unchanged; those two
436
427
  ralph-coupled skills (`ralph`, `run-pipeline-stage`) are intentionally not shipped to Claude.
437
428
 
438
429
  #### Contributing to the Claude plugin
439
430
 
440
431
  Edit the **sources** — the composable `agents/<name>/` directories (shared `agent.md` +
441
- per-harness frontmatter/sections, auto-composed by `scripts/build-copilot-agents.mjs` and
442
- `bin/installers/claude.mjs`), `agents-native/*.md` (Claude-only
432
+ per-harness frontmatter/sections, composed by `bin/installers/claude.mjs`),
433
+ `agents-native/*.md` (Claude-only
443
434
  agents like `ralph` — the canonical bodies the installer copies verbatim), `skills/**`,
444
435
  `hooks/claude/hooks.json` (hook config), `claude/settings.json` (the user-settings template
445
436
  merged into `~/.claude/settings.json`), `claude-extras/` (hand-authored `.mcp.json` and
@@ -449,7 +440,5 @@ version — picked up at install time) — then run
449
440
  re-registers it; `--output <dir>` generates a preview only). The only committed file under
450
441
  `claude/` is the settings template; `~/.agent-cortex/claude` is generated in full
451
442
  (`.claude-plugin/plugin.json`, `agents/`, `skills/`, `hooks.json`, `.mcp.json`, `scripts/`)
452
- so never edit anything under it. The generated `agents/*.agent.md` files are still
453
- drift-checked by CI (`git diff --exit-code -- 'agents/*.agent.md'`), and CI validates the
454
- Claude materialiser (structural checks on a temp-dir install) so sources and installer can
455
- never silently diverge.
443
+ so never edit anything under it. CI validates the Claude materialiser (structural checks on
444
+ a temp-dir install) so sources and installer can never silently diverge.
package/agents/README.md CHANGED
@@ -4,7 +4,7 @@ This document defines the canonical format for composable agent directories in a
4
4
 
5
5
  ## Motivation
6
6
 
7
- The original format used a single `*.agent.md` file per agent, combining harness-agnostic logic with harness-specific configuration. This created duplication when the same agent needed to run on multiple harnesses (PI, Copilot, Claude) with different tool names and polling mechanisms.
7
+ The original format used a single `*.agent.md` file per agent, combining harness-agnostic logic with harness-specific configuration. This created duplication when the same agent needed to run on multiple harnesses (PI, Claude) with different tool names and polling mechanisms.
8
8
 
9
9
  The composable directory format separates concerns:
10
10
 
@@ -21,9 +21,6 @@ agents/
21
21
  │ ├── pi/
22
22
  │ │ ├── frontmatter.json # PI-specific metadata
23
23
  │ │ └── <section>.md # Optional: PI-specific sections
24
- │ ├── copilot/
25
- │ │ ├── frontmatter.json # Copilot-specific metadata
26
- │ │ └── <section>.md # Optional: Copilot-specific sections
27
24
  │ └── claude/
28
25
  │ ├── frontmatter.json # Claude-specific metadata
29
26
  │ └── <section>.md # Optional: Claude-specific sections
@@ -37,9 +34,6 @@ agents/ralph/
37
34
  ├── pi/
38
35
  │ ├── frontmatter.json # PI tools: ["bash", "task", "read_agent", "wait_for_agents"]
39
36
  │ └── polling.md # PI completion: blocking wait_for_agents (no poll timer)
40
- ├── copilot/
41
- │ ├── frontmatter.json # Copilot tools: ["bash", "task", "read_agent"]
42
- │ └── polling.md # Copilot completion: sleep-120 poll timer + read_agent
43
37
  └── claude/
44
38
  ├── frontmatter.json # Claude tools: ["bash", "task"]
45
39
  └── polling.md # Claude event-driven (no polling)
@@ -52,8 +46,6 @@ agents/plan/
52
46
  ├── agent.md # Shared body (planning workflow)
53
47
  ├── pi/
54
48
  │ └── frontmatter.json # PI tools
55
- ├── copilot/
56
- │ └── frontmatter.json # Copilot tools
57
49
  └── claude/
58
50
  └── frontmatter.json # Claude tools
59
51
  ```
@@ -143,9 +135,8 @@ When composing the final agent file for a specific harness:
143
135
  2. Replace `{{SECTION:name}}` with content from `<harness>/<name>.md`
144
136
  3. `{{TOOL:name}}` and `{{PATH:name}}` are resolved against `token-map.json` — the
145
137
  canonical tool/path/agent names per harness. `scripts/lib/compose-agent.mjs` (used by
146
- `build:copilot` and by `bin/installers/claude.mjs` / `bin/installers/pi.mjs`) resolves them when
147
- generating the flat files / installing for claude and pi; pi's `agent-modes` extension does the
148
- same at runtime. See the `contract` section of `token-map.json` and
138
+ `bin/installers/claude.mjs` / `bin/installers/pi.mjs`) resolves them when generating the flat
139
+ files / installing for claude and pi; pi's `agent-modes` extension does the same at runtime. See the `contract` section of `token-map.json` and
149
140
  `token-map.README.md` for the rules.
150
141
 
151
142
  The pi harness's `agent-modes` extension is a runtime consumer of this format: it
@@ -201,7 +192,6 @@ Agents like `plan`, `ralph-plan`, and `strategy` that have identical behavior ac
201
192
  agents/plan/
202
193
  ├── agent.md # Shared body (same for all harnesses)
203
194
  ├── pi/frontmatter.json # PI tools
204
- ├── copilot/frontmatter.json # Copilot tools
205
195
  └── claude/frontmatter.json # Claude tools
206
196
  ```
207
197
 
@@ -211,14 +201,12 @@ agents/plan/
211
201
  2. Migrate ralph agent first (proves the pattern) — DONE
212
202
  3. Migrate plan, ralph-plan, strategy agents — DONE
213
203
  4. Update the installer/composer to handle the new format
214
- 5. Remove old `*.agent.md` files — DONE (the flat files are now **generated output**, see below)
204
+ 5. Remove old `*.agent.md` files — DONE (the composable directories are the only committed
205
+ form; every harness composes or renders its own agent files at install time)
215
206
 
216
- All four agents (`ralph`, `plan`, `ralph-plan`, `strategy`) use the composable layout and the
217
- flat `agents/*.agent.md` files are built from them:
207
+ All four agents (`ralph`, `plan`, `ralph-plan`, `strategy`) use the composable layout, and no
208
+ flat agent file is committed:
218
209
 
219
- - `scripts/build-copilot-agents.mjs` (`pnpm build:copilot`) composes `agents/*.agent.md` from
220
- each agent's `copilot/` harness dir — committed for Copilot CLI, which loads `*.agent.md`
221
- from `plugin.json`'s `agents: "agents/"` path.
222
210
  - `bin/installers/claude.mjs` (plain `agent-cortex install claude` materialises the plugin
223
211
  into `~/.agent-cortex/claude` and registers it with Claude Code; `--output <dir>` is its
224
212
  generate-only form, used by tests/CI) composes the plugin's
@@ -239,9 +227,7 @@ via `bin/installers/claude.mjs`, the generator behind plain `agent-cortex instal
239
227
  `claude/settings.json` into `~/.claude/settings.json`, and registers the plugin with Claude
240
228
  Code); the only committed `claude/` file is that settings template (hand-authored extras live
241
229
  in `claude-extras/`), and CI validates the materialiser with structural checks on a temp-dir
242
- install; `copilot` ships via
243
- `bin/installers/copilot.mjs`, the shared code path behind both `agent-cortex install
244
- copilot` and `scripts/build-copilot-agents.mjs`; `pi` ships via
230
+ install; `pi` ships via
245
231
  `bin/installers/pi.mjs`, which stages a self-contained pi package (manifest, rendered
246
232
  agents, token-substituted skills, extensions) at `~/.agent-cortex/pi`.
247
233
 
@@ -264,7 +250,7 @@ The validator checks:
264
250
 
265
251
  - JSON has strict syntax (no comments, no ambiguity)
266
252
  - Easier to validate with JSON Schema
267
- - Consistent with existing tooling (package.json, plugin.json)
253
+ - Consistent with existing tooling (package.json)
268
254
  - No need for YAML parser dependency
269
255
 
270
256
  ### Why separate section files instead of inline sections?
@@ -42,7 +42,7 @@ Run once at startup:
42
42
  5. Create Ralph's workspace directory: `mkdir -p .agent-cortex/ralph`
43
43
  6. Create `.agent-cortex/ralph/state.json` with initial content:
44
44
  ```json
45
- { "timerShellId": null, "inflight": [] }
45
+ { "inflight": [] }
46
46
  ```
47
47
  Then generate the progress file:
48
48
  ```bash
@@ -59,7 +59,7 @@ Run once at startup:
59
59
  b. Claim the parent bead: `bd update <parent-id> --claim`.
60
60
  c. Create the first stage chore bead and dispatch it (see _Creating and dispatching a stage chore_ below).
61
61
  8. Record each launched agent in `.agent-cortex/ralph/state.json` (see format below).
62
- 9. Hand over to the completion-detection mechanism in the polling section: it starts the Copilot poll loop, blocks with `wait_for_agents` (PI), or waits for event-driven wake-ups (Claude), and proceeds to **HITL Pause** directly when no agent work was dispatched and HITL gate beads are pending.
62
+ 9. Hand over to the completion-detection mechanism in the polling section: it blocks with `wait_for_agents` (PI) or waits for event-driven wake-ups (Claude), and proceeds to **HITL Pause** directly when no agent work was dispatched and HITL gate beads are pending.
63
63
 
64
64
  ---
65
65
 
@@ -101,7 +101,6 @@ All orchestration state is derived from beads:
101
101
 
102
102
  ```json
103
103
  {
104
- "timerShellId": "shell-abc",
105
104
  "inflight": [
106
105
  { "choreId": "xyz-456", "parentId": "abc-123", "title": "Add auth", "agentId": "agent-xyz-456", "logLine": 4 },
107
106
  { "choreId": "def-789", "parentId": "ghi-101", "title": "Fix cache", "agentId": "agent-def-789", "logLine": 7 }
@@ -109,7 +108,6 @@ All orchestration state is derived from beads:
109
108
  }
110
109
  ```
111
110
 
112
- - **timerShellId**: the shellId of the active poll-timer bash process used for completion polling (Copilot; stays `null` on PI, which blocks with `wait_for_agents` instead, and on event-driven harnesses such as Claude).
113
111
  - **inflight[].choreId**: the chore bead currently being worked by the subagent.
114
112
  - **inflight[].parentId**: the parent feature task bead. Log file is `.agent-cortex/ralph/ralph-<parentId>.log`.
115
113
  - **inflight[].logLine**: the next line number to read from the parent's log file (1-based; start at 1). Updated after every poll.
@@ -127,12 +125,12 @@ Update `.agent-cortex/ralph/state.json` after **every** agent completion or disp
127
125
 
128
126
  ## Event loop
129
127
 
130
- After initialization, Ralph waits for background agents to complete. Completion notifications are delivered by the mechanism documented in the polling section — PI blocks with `wait_for_agents` until a worker completes and its result is returned inline; Copilot uses an active poll timer plus log polling; Claude is event-driven (you are re-invoked automatically when a worker completes, with its result delivered inline). On each completion notification:
128
+ After initialization, Ralph waits for background agents to complete. Completion notifications are delivered by the mechanism documented in the polling section — PI blocks with `wait_for_agents` until a worker completes and its result is returned inline; Claude is event-driven (you are re-invoked automatically when a worker completes, with its result delivered inline). On each completion notification:
131
129
 
132
130
  ### If a background agent completed
133
131
 
134
- 1. **Flush** that bead's log using the log-polling procedure in the polling section to pick up any final lines for the chat summary (PI: flush new log lines as part of handling the `wait_for_agents` result; Copilot: flush to detect completion; Claude: nothing to flush — the result is delivered with the wake-up).
135
- 2. **Read** the completed agent's full output (PI: the result arrives in the `wait_for_agents` response, with `read_agent` as a fallback for a specific result; Copilot: `read_agent`; Claude: the result was delivered inline).
132
+ 1. **Flush** that bead's log using the log-polling procedure in the polling section to pick up any final lines for the chat summary (PI: flush new log lines as part of handling the `wait_for_agents` result; Claude: nothing to flush — the result is delivered with the wake-up).
133
+ 2. **Read** the completed agent's full output (PI: the result arrives in the `wait_for_agents` response, with `read_agent` as a fallback for a specific result; Claude: the result was delivered inline).
136
134
  3. **Re-read** `.agent-cortex/ralph/state.json` to identify the chore bead and parent for that agent ID.
137
135
  4. **Parse** the agent's `---REPORT---` block (see report format in the `run-pipeline-stage` skill).
138
136
  5. **Close** the completed chore bead: `bd close <chore-id>`.
@@ -188,7 +186,7 @@ Proceed here when no chore beads are in-flight, no `stage:*` chore beads are rea
188
186
 
189
187
  When you've completed the above actions, prompt me to continue.
190
188
  ```
191
- 6. **Stop completely.** Stop the polling mechanism documented in the polling section (Copilot: kill any running timer; PI and Claude: nothing to stop — there is no timer). Do **not** restart or schedule anything. Do **not** start any background processes. Do **not** check bead status again. Do **not** continue the event loop. Output **nothing further** after the summary above. Ralph is now fully idle — it must not act again until the user explicitly re-prompts.
189
+ 6. **Stop completely.** Stop the polling mechanism documented in the polling section (PI and Claude: nothing to stop — there is no timer). Do **not** restart or schedule anything. Do **not** start any background processes. Do **not** check bead status again. Do **not** continue the event loop. Output **nothing further** after the summary above. Ralph is now fully idle — it must not act again until the user explicitly re-prompts.
192
190
 
193
191
  ---
194
192
 
@@ -258,5 +256,4 @@ All beads complete.
258
256
  - **Never** auto-merge feature or epic PRs — merge decisions are human-controlled.
259
257
  - **Never** continue past feature completion until PR `feature/<parent-id> -> epic/<epic-id>` is merged and the child HITL PR gate bead is closed by a human.
260
258
  - **Never** continue past epic completion until PR `epic/<epic-id> -> main` is merged.
261
- - **When a feature hits the HITL PR gate, push and open the PR immediately and report the URL — do not wait for explicit approval to push or create the PR.**
262
- - **Always** bump the patch version in `plugin.json` as part of any commit that changes agent or skill files.
259
+ - **When a feature hits the HITL PR gate, push and open the PR immediately and report the URL — do not wait for explicit approval to push or create the PR.**
@@ -20,7 +20,7 @@ Rules:
20
20
 
21
21
  Claude Code **re-invokes you automatically when a background worker completes** — the worker's result is delivered to you inline on the wake-up. **Do not poll and do not `sleep`.** React to completions as they arrive.
22
22
 
23
- - There is **no poll timer on Claude**: skip the PI/Copilot timer start and restart steps in initialization, and there is nothing to kill in **HITL Pause** — when you stop, you simply stop. The harness wakes you again when the user re-invokes you.
23
+ - There is **no poll timer anywhere in this pipeline**: nothing in initialization starts one, and there is nothing to kill in **HITL Pause** — when you stop, you simply stop. The harness wakes you again when the user re-invokes you.
24
24
  - There is **no log tailing on Claude**: workers' progress lines (`.agent-cortex/ralph/ralph-<parentId>.log`) are written by the workers themselves and surfaced by the harness with the completion — nothing to flush, nothing to poll. Produce the shared chat summaries from the delivered result instead.
25
25
  - On each completion, apply the shared handling in the **Event loop** section of agent.md (steps 3–8: correlate the task ID to its bead via `state.json`, parse the REPORT, close the chore, advance the parent, check for newly ready beads, run the shutdown check). `state.json` `logLine` tracking is not used on Claude.
26
26
 
@@ -112,22 +112,6 @@ if (parsed.command === "install") {
112
112
  process.exit(1);
113
113
  }
114
114
  }
115
-
116
- // copilot regenerates the flat agents/*.agent.md files the Copilot plugin
117
- // loads via plugin.json ("agents": "agents/") — the same code path
118
- // `pnpm build:copilot` runs.
119
- if (parsed.harness === "copilot") {
120
- const { installCopilot } = await import("./installers/copilot.mjs");
121
- try {
122
- await installCopilot({ output: parsed.output, dryRun: parsed.dryRun });
123
- process.exit(0);
124
- } catch (err) {
125
- process.stderr.write(`Install failed: ${err.message}\n`);
126
- process.exit(1);
127
- }
128
- }
129
-
130
- process.exit(0);
131
115
  }
132
116
 
133
117
  function printPiSweep({ removed }) {
@@ -97,8 +97,8 @@ const DEFAULT_WARN = (msg) => console.warn(`[claude-installer] ${msg}`);
97
97
  // section composition from the poll-loop sources.
98
98
  const DEFER = new Set(["ralph"]);
99
99
 
100
- // Ralph-coupled Copilot skills that don't apply to the lean Claude Ralph (and carry dead
101
- // ~/.copilot orchestration paths). Not copied into the Claude plugin.
100
+ // Ralph-coupled pipeline skills that don't apply to the lean Claude Ralph (its completion
101
+ // handling is event-driven, not the pi orchestrator's). Not copied into the Claude plugin.
102
102
  const SKILL_EXCLUDE = new Set(["ralph", "run-pipeline-stage"]);
103
103
 
104
104
  const NAME_PREFIX = "agent-cortex:";