@jaybeeuu/agent-cortex 1.43.0 → 2.1.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/.agents/skills/style-versioning/SKILL.md +5 -6
- package/.github/workflows/ci.yml +4 -11
- package/AGENTS.md +13 -17
- package/CHANGELOG.md +66 -0
- package/README.md +57 -57
- package/agents/README.md +9 -23
- package/agents/ralph/agent.md +13 -17
- package/agents/ralph/claude/polling.md +1 -1
- package/agents-native/ralph.md +15 -5
- package/bin/agent-cortex.mjs +0 -16
- package/bin/installers/claude.mjs +82 -11
- package/docs/claude-hooks.md +16 -0
- package/docs/ideas/improve-pi-system-prompt.md +9 -3
- package/docs/research/disable-model-invocation.md +5 -26
- package/docs/skills/skill-anatomy.md +5 -3
- package/docs/technical-direction/harness-config.md +6 -14
- package/docs/user-preferences.md +2 -2
- package/extensions/agent-modes/README.md +3 -3
- package/extensions/agent-modes/discover.ts +6 -6
- package/extensions/output-style/README.md +58 -0
- package/extensions/output-style/index.ts +23 -0
- package/extensions/output-style/output-style.md +43 -0
- package/extensions/output-style/output-style.test.ts +50 -0
- package/extensions/output-style/output-style.ts +32 -0
- package/extensions/output-style/package.json +19 -0
- package/extensions/output-style/tsconfig.json +12 -0
- package/extensions/subagent/README.md +2 -2
- package/extensions/subagent/agents.ts +1 -2
- package/lib/cli.mjs +5 -7
- package/package.json +5 -6
- package/scripts/check-skill-frontmatter.mjs +21 -0
- package/scripts/lib/compose-agent.mjs +10 -10
- package/scripts/lib/skill-frontmatter.mjs +135 -0
- package/skills/workflow/ralph/REFERENCE.md +34 -11
- package/skills/workflow/ralph/SKILL.md +10 -10
- package/skills/workflow/ralph/scripts/pending-gates.mjs +134 -0
- package/test/cli.test.mjs +11 -10
- package/test/installer.test.mjs +143 -1
- package/test/pending-gates.test.mjs +147 -0
- package/test/skill-frontmatter.test.mjs +137 -0
- package/token-map.README.md +9 -12
- package/token-map.json +26 -31
- package/agents/plan/copilot/frontmatter.json +0 -6
- package/agents/plan.agent.md +0 -59
- package/agents/ralph/copilot/frontmatter.json +0 -6
- package/agents/ralph/copilot/polling.md +0 -62
- package/agents/ralph-plan/copilot/frontmatter.json +0 -6
- package/agents/ralph-plan.agent.md +0 -126
- package/agents/ralph.agent.md +0 -331
- package/agents/strategy/copilot/frontmatter.json +0 -6
- package/agents/strategy.agent.md +0 -112
- package/bin/installers/copilot.mjs +0 -124
- package/hooks.json +0 -10
- package/plugin.json +0 -35
- package/scripts/build-copilot-agents.mjs +0 -30
- package/scripts/install-instructions.sh +0 -82
- package/scripts/sync-plugin-version.sh +0 -17
- 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
|
|
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
|
-
|
|
144
|
+
Two files carry the version, in lockstep automatically:
|
|
145
145
|
|
|
146
146
|
1. `package.json` → bumped by changesets
|
|
147
|
-
2. `
|
|
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
|
|
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
|
|
172
|
+
| Version files synced by hand | changesets bumps `package.json` + `CHANGELOG.md` |
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -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
|
|
292
|
-
#
|
|
293
|
-
#
|
|
294
|
-
#
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
│ ├──
|
|
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
|
|
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,12 +66,14 @@ 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
|
-
(
|
|
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
|
|
76
73
|
skill is a skill, not a place for this repo's configuration.
|
|
77
|
-
- `SKILL.md` must include a YAML front-matter block with `name` and `description`.
|
|
74
|
+
- `SKILL.md` must include a YAML front-matter block with `name` and `description`. `pnpm lint`
|
|
75
|
+
enforces this (`pnpm check:skills`), because PI silently drops a skill whose frontmatter it
|
|
76
|
+
cannot parse.
|
|
78
77
|
- `description` must be ≤ 1024 characters. First sentence: what it does. Second: "Use when…".
|
|
79
78
|
- Keep `SKILL.md` near the ~150-line target in `docs/skills/skill-anatomy.md`, overflowing into
|
|
80
79
|
purpose-named support files (`REFERENCE.md`, `EXAMPLES.md`, `FORMAT.md`). `style-tests`
|
|
@@ -88,13 +87,10 @@ Generated automatically by changesets. Do not edit `CHANGELOG.md` manually.
|
|
|
88
87
|
## Agent Conventions
|
|
89
88
|
|
|
90
89
|
- Agents live in composable `<name>/` directories under `agents/`: a shared `agent.md` body plus
|
|
91
|
-
per-harness subdirectories `pi
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
|
90
|
+
per-harness subdirectories `pi/` and `claude/` (frontmatter.json and optional section files) per
|
|
91
|
+
the spec in `agents/README.md`. `ralph`, `plan`, `ralph-plan`, and `strategy` all use the
|
|
92
|
+
composable layout, and no flat agent file is committed — each harness renders its own at install
|
|
93
|
+
time. The Claude plugin is materialised by the install-time generator
|
|
98
94
|
`bin/installers/claude.mjs`: a plain `agent-cortex install claude` copies it into
|
|
99
95
|
`~/.agent-cortex/claude` (skills copied flat with `{{TOOL:...}}`/`{{PATH:...}}` substituted,
|
|
100
96
|
never symlinked), writes the marketplace manifest at
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,71 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a4658cf: Add the `output-style` pi extension: it appends an always-on reply-shape block to the PI
|
|
8
|
+
system prompt — lead with the action, write in Simplified Technical English (ASD-STE100),
|
|
9
|
+
and restate context instead of citing beads, phases, or stages by ID alone.
|
|
10
|
+
|
|
11
|
+
The block lives in `extensions/output-style/output-style.md` and is also written to the managed
|
|
12
|
+
section of `~/.claude/CLAUDE.md` by `agent-cortex install claude`, so Claude Code receives the
|
|
13
|
+
same rules alongside pi.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- a30f3c4: Make ralph's PR gate brake depend on a gate being _unblocked_, and count gates
|
|
18
|
+
on the current HITL label axis.
|
|
19
|
+
|
|
20
|
+
`create-chores` pre-creates a `lifecycle:feature-pr` gate for every planned
|
|
21
|
+
feature, blocked behind that feature's own `document` chore. Ralph's rule — "do
|
|
22
|
+
not schedule new parent features while any HITL gate bead is open" — therefore
|
|
23
|
+
matched every unstarted feature, so the brake was permanently on: with eight
|
|
24
|
+
open gates, none of them actionable, no new feature could ever be dispatched.
|
|
25
|
+
The pause query had drifted the other way: it filtered on the legacy
|
|
26
|
+
`implementation-type:hitl` axis only, so gates migrated to `execution:hitl`
|
|
27
|
+
were invisible and pending human action was under-reported.
|
|
28
|
+
|
|
29
|
+
- `skills/workflow/ralph/scripts/pending-gates.mjs` resolves the question in one
|
|
30
|
+
place: `pendingHumanAction` holds unblocked gates plus epics tagged
|
|
31
|
+
`awaiting-epic-pr-merge` and is the only scheduling brake; `parked` holds
|
|
32
|
+
gates still blocked behind their own pipeline, which never stop dispatch and
|
|
33
|
+
never appear in the Pending Human Action table.
|
|
34
|
+
- Gate queries match `lifecycle:feature-pr` on either HITL axis, so gates
|
|
35
|
+
created on either side of the two-axis migration are counted.
|
|
36
|
+
- ralph's composable agent source (`agents/ralph/agent.md`) and the ralph skill
|
|
37
|
+
and REFERENCE now point at the script instead of restating ad-hoc `bd` queries
|
|
38
|
+
that had already drifted.
|
|
39
|
+
- `agents-native/ralph.md` (the Claude harness) keeps the **open**-gate form and
|
|
40
|
+
only takes the dual-axis query: its gates stay blocked for their whole life —
|
|
41
|
+
`create-task` blocks them behind a `document` chore no Claude ralph closes, and
|
|
42
|
+
the native route deps them onto the still-open feature bead — so the unblocked
|
|
43
|
+
predicate would never fire there and ralph would report "All beads complete."
|
|
44
|
+
with PRs unmerged. REFERENCE.md now states the invariant: a gate blocked by its
|
|
45
|
+
parent feature bead is not parked in any harness, so a gate must not carry a
|
|
46
|
+
`blocks` dependency onto its own feature.
|
|
47
|
+
|
|
48
|
+
Reconcile with agnt-ctx-s5xd.10 (ralph harness unification) when that rewrites
|
|
49
|
+
ralph's agent files — it owns collapsing the two predicates into one.
|
|
50
|
+
|
|
51
|
+
- e5e7683: Fail `pnpm lint` when a SKILL.md frontmatter cannot be parsed, is missing `name` or `description`, or has a description longer than 1024 characters. PI previously dropped such skills silently.
|
|
52
|
+
|
|
53
|
+
## 2.0.0
|
|
54
|
+
|
|
55
|
+
### Major Changes
|
|
56
|
+
|
|
57
|
+
- 847ce42: Remove Copilot CLI as a deploy target. `agent-cortex install copilot` is gone (the
|
|
58
|
+
supported harnesses are now `claude` and `pi`), along with the Copilot plugin manifest
|
|
59
|
+
`plugin.json`, the `build:copilot` script and its committed `agents/*.agent.md` output,
|
|
60
|
+
the `agents/*/copilot/` harness dirs, `scripts/sync-plugin-version.sh`, the `postinstall`
|
|
61
|
+
hook and `scripts/install-instructions.sh` that wrote `~/.copilot/copilot-instructions.md`,
|
|
62
|
+
and the Copilot column of `token-map.json`.
|
|
63
|
+
|
|
64
|
+
`version-packages` is now plain `changeset version`: the release surface is
|
|
65
|
+
`package.json` + `CHANGELOG.md`, since every plugin is materialised at install time with
|
|
66
|
+
the package version. Nothing is swept from an existing `~/.copilot` install — remove
|
|
67
|
+
`~/.copilot/installed-plugins/_direct/agent-cortex` by hand.
|
|
68
|
+
|
|
3
69
|
## 1.43.0
|
|
4
70
|
|
|
5
71
|
### 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
|
|
4
|
-
source:
|
|
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
|
-
│ ├──
|
|
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
|
|
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, …
|
|
@@ -27,6 +24,7 @@ agent-cortex/
|
|
|
27
24
|
├── extensions/ # pi extensions (pi only)
|
|
28
25
|
│ ├── agent-guardrails/ # behavioural circuit-breakers in the system prompt
|
|
29
26
|
│ ├── agent-modes/ # switchable agent modes (reads composable agents/)
|
|
27
|
+
│ ├── output-style/ # reply shape: STE, action-first, restated context
|
|
30
28
|
│ ├── skill-stats/
|
|
31
29
|
│ └── notify/
|
|
32
30
|
├── pi/ # Committed pi config templates (see below)
|
|
@@ -37,23 +35,18 @@ agent-cortex/
|
|
|
37
35
|
├── bin/
|
|
38
36
|
│ ├── agent-cortex.mjs # CLI entrypoint
|
|
39
37
|
│ └── installers/
|
|
40
|
-
│ ├──
|
|
41
|
-
│ └──
|
|
42
|
-
├── scripts/
|
|
43
|
-
│ └── build-copilot-agents.mjs # thin wrapper over bin/installers/copilot.mjs (regenerates agents/*.agent.md)
|
|
38
|
+
│ ├── claude.mjs # materialises ~/.agent-cortex/claude + ~/.claude/settings.json, registers with Claude Code (--output <dir> = generate-only)
|
|
39
|
+
│ └── pi.mjs # stages ~/.agent-cortex/pi + registers it with pi (--output <dir> = stage-only)
|
|
44
40
|
├── claude/ # Committed Claude user-settings template (settings.json) — merged into ~/.claude/settings.json
|
|
45
41
|
└── claude-extras/ # Hand-authored Claude plugin extras
|
|
46
42
|
├── .mcp.json # MCP servers (context7, github) — copied into installs
|
|
47
43
|
└── scripts/ # statusline-command.sh — copied into installs (executable)
|
|
48
44
|
```
|
|
49
45
|
|
|
50
|
-
The same `agents/` and `skills/` power
|
|
51
|
-
|
|
52
|
-
`
|
|
53
|
-
|
|
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.
|
|
46
|
+
The same `agents/` and `skills/` power two harnesses (pi and Claude Code). The composable
|
|
47
|
+
`agents/<name>/` directories are the single source of truth, and no flat agent file is
|
|
48
|
+
committed: `agent-cortex install claude` and `agent-cortex install pi` each render their own
|
|
49
|
+
from the canonical directories, so install-time output can never drift from the sources.
|
|
57
50
|
The `{{TOOL:...}}` / `{{PATH:...}}` tokens written in agent and skill files are resolved
|
|
58
51
|
per harness at install time from `token-map.json`, the single source of truth for
|
|
59
52
|
canonical tool/path/agent names (see `token-map.README.md` and the `contract` section).
|
|
@@ -76,15 +69,13 @@ temp-dir install plus structural checks:
|
|
|
76
69
|
- **Agents** can't be shared files (the frontmatter formats differ), so the materialised
|
|
77
70
|
plugin's `agents/*.md` are composed from the canonical `agents/<name>/` directories' `claude/`
|
|
78
71
|
harness dirs
|
|
79
|
-
(frontmatter.json + section files)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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.
|
|
72
|
+
(frontmatter.json + section files). Claude only loads agents from a plugin's default `agents/`
|
|
73
|
+
dir, so the plugin ships them at its own root (default `~/.agent-cortex/claude/agents/`).
|
|
74
|
+
- **Claude-native agents** that cannot be composed from a shared body live in
|
|
75
|
+
`agents-native/*.md` and are copied verbatim into the materialised plugin's `agents/`. `ralph`
|
|
76
|
+
is one: it is reimplemented for Claude around background workers + an independent review gate
|
|
77
|
+
(Claude's event-driven completion delivery has no `task`/`read_agent` poll loop to reuse), so
|
|
78
|
+
it can't be mechanically converted.
|
|
88
79
|
- **Manifests** are generated too: the plugin's `.claude-plugin/plugin.json` (its `version`
|
|
89
80
|
tracks `package.json`, so it never goes stale) and `hooks.json` (copied from the canonical
|
|
90
81
|
`hooks/claude/hooks.json` source), plus any support files under `hooks/claude/` bundled into
|
|
@@ -94,8 +85,8 @@ temp-dir install plus structural checks:
|
|
|
94
85
|
extension→hook mapping and the rejections (auto-name, agent-guardrails, skill-stats, subagent, agent-modes).
|
|
95
86
|
|
|
96
87
|
Edit the sources (`agents/<name>/` composable dirs, `agents-native/*.md`, `skills/**`,
|
|
97
|
-
`hooks/claude/`, `claude-extras/`, `package.json`), never the
|
|
98
|
-
|
|
88
|
+
`hooks/claude/`, `claude-extras/`, `package.json`), never anything under the materialised
|
|
89
|
+
`~/.agent-cortex/claude`.
|
|
99
90
|
|
|
100
91
|
## CI
|
|
101
92
|
|
|
@@ -117,9 +108,8 @@ validates the Claude plugin **materialiser** instead of diffing a committed mirr
|
|
|
117
108
|
it runs `node bin/agent-cortex.mjs install claude --output <tmp dir>` and checks the
|
|
118
109
|
result structurally — `plugin.json` version tracks `package.json`, every generated and
|
|
119
110
|
hand-authored piece is present, no literal `{{TOOL:...}}`/`{{PATH:...}}` tokens survive,
|
|
120
|
-
and no symlinks leak into the copied tree.
|
|
121
|
-
|
|
122
|
-
committed flat agent files.
|
|
111
|
+
and no symlinks leak into the copied tree. There is no committed agent file to drift-check:
|
|
112
|
+
the `agents/` tree holds the composable sources only, and both installers render from them.
|
|
123
113
|
|
|
124
114
|
A separate `changeset-check` job runs on every pull request and fails it unless the
|
|
125
115
|
PR adds a `.changeset/*.md` file. **Publishing is the default and `no-publish` is the
|
|
@@ -133,11 +123,10 @@ changeset.
|
|
|
133
123
|
On pushes to `main`, a `release` job (gated on `lint`, `test`, and
|
|
134
124
|
`claude-plugin-check`) runs changesets to open a `chore: version packages` PR when
|
|
135
125
|
changesets are pending, then publishes to npm once it lands. The version step runs
|
|
136
|
-
`pnpm version-packages` —
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
provenance publish), or
|
|
126
|
+
`pnpm version-packages` — `changeset version`, which bumps `package.json` and rewrites
|
|
127
|
+
`CHANGELOG.md` and touches nothing else (both plugins are materialised at install time
|
|
128
|
+
with the package version, so there is no committed output to regenerate); the publish
|
|
129
|
+
step runs `pnpm publish-package` (pack + provenance publish), or
|
|
141
130
|
`pnpm publish-noop` when the merged PR carried `no-publish`. Labels are invisible on
|
|
142
131
|
a push event, so the job resolves the PR merged for the pushed commit through the
|
|
143
132
|
GitHub API and reads its labels — no extra secret or scope, since the job already
|
|
@@ -262,18 +251,25 @@ templates** for your own pi configuration. They are not installer output: pi's
|
|
|
262
251
|
`settings.json` and `keybindings.json` are pi's own user config, so
|
|
263
252
|
`agent-cortex install pi` leaves them alone.
|
|
264
253
|
|
|
265
|
-
### Copilot
|
|
254
|
+
### Removing a stale Copilot install
|
|
266
255
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
256
|
+
Copilot CLI is no longer a deploy target: `agent-cortex install copilot` and the
|
|
257
|
+
`plugin.json` manifest are gone, and nothing in this package reads or writes `~/.copilot`
|
|
258
|
+
any more. No installer sweeps an existing install, so a machine that used the old target
|
|
259
|
+
keeps a stale plugin, a cached marketplace, and an instruction block until you remove them
|
|
260
|
+
by hand:
|
|
272
261
|
|
|
273
262
|
```sh
|
|
274
|
-
|
|
263
|
+
rm -rf ~/.copilot/installed-plugins/_direct/agent-cortex
|
|
264
|
+
rm -rf ~/.cache/copilot/marketplaces/https---github-com-jaybeeuu-agent-cortex
|
|
265
|
+
sed -i.bak '/<!-- agent-cortex:start -->/,/<!-- agent-cortex:end -->/d' \
|
|
266
|
+
~/.copilot/copilot-instructions.md
|
|
275
267
|
```
|
|
276
268
|
|
|
269
|
+
The first two paths are the old install and its marketplace cache. The `sed` deletes only
|
|
270
|
+
the agent-cortex block the removed `postinstall` hook appended to Copilot's own
|
|
271
|
+
instructions file, leaving the rest of that file — and a `.bak` copy — intact.
|
|
272
|
+
|
|
277
273
|
### Claude Code plugin (separate)
|
|
278
274
|
|
|
279
275
|
A plain `agent-cortex install claude` **materialises** the plugin into the home install
|
|
@@ -284,7 +280,10 @@ manifest at `~/.agent-cortex/.claude-plugin/marketplace.json` exposing `./claude
|
|
|
284
280
|
registers it with Claude Code, and merges the committed `claude/settings.json` template into
|
|
285
281
|
`~/.claude/settings.json`: the template supplies defaults, personal values win, and the
|
|
286
282
|
installer owns exactly `enabledPlugins` + `extraKnownMarketplaces` — every other key
|
|
287
|
-
(`permissions`, `hooks`, `env`, `statusLine`, unknown keys) is preserved.
|
|
283
|
+
(`permissions`, `hooks`, `env`, `statusLine`, unknown keys) is preserved. It also writes the
|
|
284
|
+
managed section of `~/.claude/CLAUDE.md` — the reply-shape block the pi `output-style`
|
|
285
|
+
extension appends, taken from the same source file — and leaves every other line of that
|
|
286
|
+
file alone. The only committed
|
|
288
287
|
Claude config is that template plus the hand-authored extras in `claude-extras/`
|
|
289
288
|
(`.mcp.json`, `scripts/`); the plugin subtree is generated at install time — there is nothing
|
|
290
289
|
to drift.
|
|
@@ -293,10 +292,6 @@ The generate-only `--output <dir>` form is for previewing and CI validation; the
|
|
|
293
292
|
documented path is the plain install to `~/.agent-cortex/claude`:
|
|
294
293
|
|
|
295
294
|
```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
295
|
node bin/agent-cortex.mjs install claude # materialises ~/.agent-cortex/claude + marketplace manifest AND registers it with Claude Code (user scope, idempotent)
|
|
301
296
|
node bin/agent-cortex.mjs install claude --dry-run # plan generation + registration, no writes/spawns
|
|
302
297
|
node bin/agent-cortex.mjs install claude --require-register # fail (non-zero exit) when the claude CLI can't drive registration
|
|
@@ -350,6 +345,12 @@ supplies defaults and personal values win; the installer owns exactly `enabledPl
|
|
|
350
345
|
never touched. A legacy symlinked `settings.json` is replaced with a real file rather than
|
|
351
346
|
written through, and `--output` leaves the user's Claude config alone.
|
|
352
347
|
|
|
348
|
+
It also writes the managed section of `~/.claude/CLAUDE.md` (Claude's user memory), delimited
|
|
349
|
+
by `<!-- BEGIN agent-cortex:output-style -->` / `<!-- END agent-cortex:output-style -->`. The
|
|
350
|
+
content is `extensions/output-style/output-style.md` — the same file the pi extension appends
|
|
351
|
+
to its system prompt — so both harnesses carry one copy of the rules. Text outside the
|
|
352
|
+
markers is never touched; a file with only one marker is left unchanged with a warning.
|
|
353
|
+
|
|
353
354
|
The equivalent manual registration adds a marketplace root by **absolute path** (a bare `.` is
|
|
354
355
|
rejected) — the home install root (`~/.agent-cortex`) is the marketplace root written by
|
|
355
356
|
the plain install; the repo checkout ships no manifest:
|
|
@@ -428,18 +429,19 @@ extension→hook audit.
|
|
|
428
429
|
#### Not ported / follow-ups
|
|
429
430
|
|
|
430
431
|
- Only `session-start` and `notify` had Claude equivalents (both ported to hooks); the other
|
|
431
|
-
pi `extensions/` (auto-name, agent-guardrails, skill-stats, subagent, agent-modes) have none —
|
|
432
|
+
pi `extensions/` (auto-name, agent-guardrails, skill-stats, subagent, agent-modes) have none — `output-style`
|
|
433
|
+
reaches Claude through the managed `CLAUDE.md` section instead; the audit and
|
|
432
434
|
rejection rationale live in `docs/claude-hooks.md`.
|
|
433
435
|
- Ralph follow-ups: multi-feature epic branches, and a GitHub-trigger routine to auto-resume
|
|
434
436
|
after a PR merge (instead of manual re-invocation).
|
|
435
|
-
- The
|
|
437
|
+
- The pi Ralph (the 4-stage `run-pipeline-stage` pipeline) is unchanged; those two
|
|
436
438
|
ralph-coupled skills (`ralph`, `run-pipeline-stage`) are intentionally not shipped to Claude.
|
|
437
439
|
|
|
438
440
|
#### Contributing to the Claude plugin
|
|
439
441
|
|
|
440
442
|
Edit the **sources** — the composable `agents/<name>/` directories (shared `agent.md` +
|
|
441
|
-
per-harness frontmatter/sections,
|
|
442
|
-
`
|
|
443
|
+
per-harness frontmatter/sections, composed by `bin/installers/claude.mjs`),
|
|
444
|
+
`agents-native/*.md` (Claude-only
|
|
443
445
|
agents like `ralph` — the canonical bodies the installer copies verbatim), `skills/**`,
|
|
444
446
|
`hooks/claude/hooks.json` (hook config), `claude/settings.json` (the user-settings template
|
|
445
447
|
merged into `~/.claude/settings.json`), `claude-extras/` (hand-authored `.mcp.json` and
|
|
@@ -449,7 +451,5 @@ version — picked up at install time) — then run
|
|
|
449
451
|
re-registers it; `--output <dir>` generates a preview only). The only committed file under
|
|
450
452
|
`claude/` is the settings template; `~/.agent-cortex/claude` is generated in full
|
|
451
453
|
(`.claude-plugin/plugin.json`, `agents/`, `skills/`, `hooks.json`, `.mcp.json`, `scripts/`)
|
|
452
|
-
so never edit anything under it.
|
|
453
|
-
|
|
454
|
-
Claude materialiser (structural checks on a temp-dir install) so sources and installer can
|
|
455
|
-
never silently diverge.
|
|
454
|
+
so never edit anything under it. CI validates the Claude materialiser (structural checks on
|
|
455
|
+
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,
|
|
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
|
-
`
|
|
147
|
-
|
|
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
|
|
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
|
|
217
|
-
flat
|
|
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; `
|
|
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
|
|
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?
|