Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,16 +271,6 @@ Persist unresolved questions or blockers into `openspec/plan/<plan-slug>/open-qu
- **rtk** (shell compression): wrap noisy discovery (`rtk ls`/`grep`/`find`/`read`), git/gh (`rtk git status`/`gh pr list`), and verification (`rtk tsc`/`lint`/`test`). Do **not** wrap machine-readable commands (`--porcelain`, `--json`, exact stdout contracts).
- **OpenSpec**: keep `openspec/changes/<slug>/tasks.md` current during work, not batched. Validate with `openspec validate --specs` before archive.

### Caveman style

Default to `ultra` for commentary and progress updates: answer first, cause next, fix or next step last. Drop filler. Use fragments when clear.

Keep exact literals (code, commands, file paths, flags, env vars, URLs, numbers, timestamps, error text) unchanged.

Switch back to `lite` or normal wording for security warnings, irreversible actions, privacy/compliance notes, ordered instructions where fragments may confuse, confused users, commits, PR text, specs, logs, and blocker evidence.

Never caveman-compress commands, file paths, specs, logs, or blocker evidence.

### Token / context budget

Default: less word, same proof.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-06-03
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Why

- The shipped `multiagent-safety` contract (installed into every gx-managed repo's `AGENTS.md`) carried a `### Caveman style` subsection. It restates generic terseness/formatting guidance that agents already get from their own persona, so it spends contract tokens in every installed repo for little marginal value.

## What Changes

- Remove the `### Caveman style` subsection from the shipped template `templates/AGENTS.multiagent-safety.md`.
- KEEP `### Token / context budget` (the `.agent/TOKEN-DISCIPLINE.md` pointer added in #612 references it).
- Re-generate this repo's `AGENTS.md` managed block from the trimmed template.
- Update template-content test assertions in `test/prompt.test.js` (also fixed pre-existing stale assertions there → green) and `test/setup.test.js`.

## Impact

- Surface: the installed contract every gx repo receives (~150 tokens leaner). No code/behavior change to the CLI.
- Risk: low. Token-budget subsection retained (no broken pointer). Net test result improves: the stale `prompt --snippet` test goes green (34 → 33 failures); zero new failures.
- Out of scope (deferred): Kitty stack consolidation (A10/A11) — recon-overstated, needs test rewrites.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## ADDED Requirements

### Requirement: Lean shipped multi-agent contract
The installed `multiagent-safety` marker block SHALL carry the load-bearing coordination rules (isolation, ownership/locks, completion, token/context budget) and SHALL NOT duplicate generic style guidance that agents already receive from their own persona.

#### Scenario: Caveman style is not shipped
- **WHEN** `gx setup` installs or refreshes the managed `AGENTS.md` block
- **THEN** the block does not contain a `### Caveman style` subsection

#### Scenario: Token/context budget is retained
- **WHEN** the managed block is installed or refreshed
- **THEN** it still contains the `### Token / context budget` subsection (referenced by `.agent/TOKEN-DISCIPLINE.md`)
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Definition of Done

This change is complete only when **all** of the following are true:

- Every checkbox below is checked.
- The agent branch reaches `MERGED` state on `origin` and the PR URL + state are recorded in the completion handoff.
- If any step blocks (test failure, conflict, ambiguous result), append a `BLOCKED:` line under section 4 explaining the blocker and **STOP**. Do not tick remaining cleanup boxes; do not silently skip the cleanup pipeline.

## Handoff

- Handoff: change=`agent-claude-phase6-trim-shipped-multiagent-template-2026-06-03-14-09`; branch=`agent/<your-name>/<branch-slug>`; scope=`TODO`; action=`continue this sandbox or finish cleanup after a usage-limit/manual takeover`.
- Copy prompt: Continue `agent-claude-phase6-trim-shipped-multiagent-template-2026-06-03-14-09` on branch `agent/<your-name>/<branch-slug>`. Work inside the existing sandbox, review `openspec/changes/agent-claude-phase6-trim-shipped-multiagent-template-2026-06-03-14-09/tasks.md`, continue from the current state instead of creating a new sandbox, and when the work is done run `gx branch finish --branch agent/<your-name>/<branch-slug> --base dev --via-pr --wait-for-merge --cleanup`.

## 1. Specification

- [x] 1.1 Finalize proposal scope and acceptance criteria for `agent-claude-phase6-trim-shipped-multiagent-template-2026-06-03-14-09`.
- [x] 1.2 Define normative requirements in `specs/phase6-trim-shipped-multiagent-template-caveman-and-token-blocks/spec.md`.

## 2. Implementation

- [x] 2.1 Implement scoped behavior changes.
- [x] 2.2 Add/update focused regression coverage.

## 3. Verification

- [x] 3.1 Run targeted project verification commands.
- [x] 3.2 Run `openspec validate agent-claude-phase6-trim-shipped-multiagent-template-2026-06-03-14-09 --type change --strict`.
- [x] 3.3 Run `openspec validate --specs`.

## 4. Cleanup (mandatory; run before claiming completion)

- [ ] 4.1 Run the cleanup pipeline: `gx branch finish --branch agent/<your-name>/<branch-slug> --base dev --via-pr --wait-for-merge --cleanup`. This handles commit -> push -> PR create -> merge wait -> worktree prune in one invocation.
- [ ] 4.2 Record the PR URL and final merge state (`MERGED`) in the completion handoff.
- [ ] 4.3 Confirm the sandbox worktree is gone (`git worktree list` no longer shows the agent path; `git branch -a` shows no surviving local/remote refs for the branch).
10 changes: 0 additions & 10 deletions templates/AGENTS.multiagent-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,6 @@ Persist unresolved questions or blockers into `openspec/plan/<plan-slug>/open-qu
- **rtk** (shell compression): wrap noisy discovery (`rtk ls`/`grep`/`find`/`read`), git/gh (`rtk git status`/`gh pr list`), and verification (`rtk tsc`/`lint`/`test`). Do **not** wrap machine-readable commands (`--porcelain`, `--json`, exact stdout contracts).
- **OpenSpec**: keep `openspec/changes/<slug>/tasks.md` current during work, not batched. Validate with `openspec validate --specs` before archive.

### Caveman style

Default to `ultra` for commentary and progress updates: answer first, cause next, fix or next step last. Drop filler. Use fragments when clear.

Keep exact literals (code, commands, file paths, flags, env vars, URLs, numbers, timestamps, error text) unchanged.

Switch back to `lite` or normal wording for security warnings, irreversible actions, privacy/compliance notes, ordered instructions where fragments may confuse, confused users, commits, PR text, specs, logs, and blocker evidence.

Never caveman-compress commands, file paths, specs, logs, or blocker evidence.

### Token / context budget

Default: less word, same proof.
Expand Down
18 changes: 6 additions & 12 deletions test/prompt.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,26 +150,20 @@ test('prompt --exec rejects prompt-only parts', () => {
assert.match(result.stderr, /Exec-capable parts:/);
});

test('prompt --snippet prints the managed AGENTS template with token budget and caveman rules', () => {
test('prompt --snippet prints the managed AGENTS template with token budget rules', () => {
const repoDir = initRepo();
const result = runNode(['prompt', '--snippet'], repoDir);
assert.equal(result.status, 0, result.stderr || result.stdout);
assert.match(result.stdout, /<!-- multiagent-safety:START -->/);
assert.match(result.stdout, /### Colony coordination loop/);
assert.match(result.stdout, /Use Colony as the primary coordination surface\./);
assert.match(result.stdout, /### Core rules/);
assert.match(result.stdout, /### Isolation \(the load-bearing rule\)/);
assert.match(result.stdout, /### Token \/ context budget/);
assert.match(result.stdout, /Default: less word, same proof\./);
assert.match(result.stdout, /Keep raw terminal interaction out of long-lived context/);
assert.match(result.stdout, /Keep execution log separate from reasoning context/);
assert.match(result.stdout, /### RTK command compression/);
assert.match(result.stdout, /### Optional companion tooling/);
assert.match(result.stdout, /rtk git status/);
assert.match(result.stdout, /Do not wrap machine-readable commands with RTK/);
assert.match(result.stdout, /### FFF file search/);
assert.match(result.stdout, /For file search, fff MCP takes precedence whenever available\./);
assert.match(result.stdout, /Use the fff MCP tools for all file search operations instead of default tools, including RTK shell wrappers\./);
assert.match(result.stdout, /If fff MCP tools are unavailable in the current client/);
assert.match(result.stdout, /### Caveman style/);
assert.match(result.stdout, /Answer order stays fixed: answer first, cause next, fix or next step last\./);
assert.match(result.stdout, /### Verification gates/);
assert.match(result.stdout, /<!-- multiagent-safety:END -->/);
});


Expand Down
1 change: 0 additions & 1 deletion test/setup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,6 @@ test('install configures AGENTS managed policy block with GX contract wording',
assert.match(agentsContent, /Guardex cannot bypass Codex host approval prompts/);
assert.match(agentsContent, /request approval for the narrow `gx branch finish \.\.\.` command/);
assert.match(agentsContent, /### Token \/ context budget/);
assert.match(agentsContent, /### Caveman style/);
});


Expand Down
Loading