This repo implements the Bounce Protocol — a convention for structured iterative refinement between AI agents using in-document markers. If you are an agent invoked against documents in this repo, you should know how to read and emit these markers.
[CONTESTED]— appears on its own line below text you disagree with. The note states the disagreement and proposes a concrete alternative. If you see one in a document you are editing, either resolve it (delete it after applying its alternative or rebutting it) or leave it for the next agent.[CLARIFY]— appears on its own line below ambiguous text. The note offers two interpretations or asks a question with a finite answer space. If you can disambiguate, do so and delete the marker.
Both markers auto-expire after 2 passes: on the final pass of any bounce, you must resolve every remaining marker and may not introduce new ones. This rule guarantees convergence.
Full spec: BOUNCE-PROTOCOL.md. Reference implementation: agent-bouncer/.
- If you are invoked via
/co-evolutionorbash co-evolve-bouncer.sh, you are in the general-purpose co-evolution workflow for questions, drafts, plans, specs, arguments, and markdown refinement - If you are invoked via
/dev-review(Claude Code) orbash dev-review/codex/dev-review.sh(Codex), you are inside the bounce pipeline — your role (reviewer / composer) and pass number are passed to you in the prompt template - If you are invoked via
/codex-build, you are orchestrating a detached Codex build: the session plans and reviews, Codex executes in the background under--preset codex-build, and the session is woken at gates (seeskills/codex-build/) - If you are orchestrating via
--preset claude-build, Codex plans and reviews while Claude executes the build synchronously; this path hard-requiresclaudeCLI auth because Claude is the executor (seedev-review/codex/claude-build.md) - If you are invoked via
bash agent-bouncer/agent-bouncer.sh <doc>, you are bouncing a single markdown document — same protocol applies - If you are exploring the repo directly without an explicit role, treat the protocol section above as orientation, then read the GSD-managed sections below for project meta
The lab/ subdirectory holds opt-in experimental features invoked via --lab <mode>. Lab features may not modify master directly — only via emitted PRs that a human reviews and merges. See lab/README.md for the full contract.
This section lives outside all <!-- GSD:*-start --> / <!-- GSD:*-end --> blocks so it survives GSD regeneration sweeps.
The sections below are auto-generated from .planning/ artifacts. They describe the project's structure, conventions, and active work. Read them for context after the protocol section above.
Co-Evolution
Co-Evolution is a tooling repo for structured iterative refinement between AI agents and humans. It already ships a standalone Agent Bouncer and a Claude Code /dev-review skill, and the current initiative is to add a standalone Codex runtime for the same compose-bounce-execute-verify workflow.
Core Value: Cross-AI workflows can be executed from local CLIs with clear artifact trails, reusable prompt contracts, and enough control to course-correct between steps.
- Tech stack: Bash-first runtime plus Markdown templates — existing product surface should stay shell-native
- Compatibility: Preserve current Agent Bouncer behavior and artifact naming while extracting helpers
- Shared assets: Prompt templates and schema live under
skills/dev-review/so all runtimes share one contract - Execution style: Implement and commit in visible steps aligned with the external plan so progress is easy to inspect
- Project type: tooling repo for cross-AI document refinement, not a deployable app or service.
- Legacy runner (still used by tests/experiments):
agent-bouncer/agent-bouncer.sh. - Primary orchestrator spec:
skills/dev-review/SKILL.md. - Supporting assets: markdown templates in
agent-bouncer/templates/andskills/dev-review/templates/, plus JSON schema inskills/dev-review/schemas/review-verdict.json. - Tracked source is small: one shell entrypoint, one large skill spec, supporting docs, prompts, and schema files.
- Bash is the only tracked programming language, used in
agent-bouncer/agent-bouncer.sh. - Markdown is the dominant artifact format in
README.md,agent-bouncer/README.md,skills/dev-review/README.md,notesforhumans.md, and all prompt/template files. - JSON Schema is used in
skills/dev-review/schemas/review-verdict.jsonto constrain verification output. - Ignore metadata lives in
.gitignoreand.agentignore.
agent-bouncer/agent-bouncer.shassumes a POSIX shell plus standard utilities such asdate,head,tr,cp,mv,rm,wc,awk,tee,mkdir, andcat.- The bouncer depends on authenticated AI CLIs:
claudeandcodex. - The Claude adapter defaults to model
claude-opus-4-8(thebestalias resolved inlib/co-evolution.sh), overridable via theCLAUDE_MODELenv var or the--claude-modelflag; it is not hard-coded. - The Codex adapter is hard-coded to
codex exec --full-auto --skip-git-repo-check. skills/dev-review/SKILL.mdassumes Claude Code tooling,git, and optionallyghfor PR creation.
- There is no
package.json,pyproject.toml,Cargo.toml,go.mod, or compiled build system. - There is no dependency lockfile.
- There is no CI configuration in the tracked repository.
- Distribution today is file-copy based: users run
agent-bouncer/agent-bouncer.shdirectly or copyskills/dev-review/into a Claude Code skills directory.
- Generated bounce artifacts are written under
runs/. .gitignoremarksruns/as generated output, so run logs and bounced documents stay local by default.- The bouncer mutates the input plan file in place and also writes a clean final copy plus per-pass raw outputs into
runs/bouncer-*/.
- The repo is best understood as a shell-based orchestrator plus a prompt/spec bundle.
- Operational correctness depends more on CLI behavior, prompt quality, and file contracts than on a compiled application runtime.
agent-bouncer/agent-bouncer.shstarts withset -euo pipefailand relies on fail-fast shell semantics.- Repository-wide shell style favors uppercase globals and lowercase helper/local names.
- Functions are short and single-purpose: adapter invocation, cleanup, and logging are separated.
- File-based orchestration is preferred over pipes between complex subprocess chains.
- Defensive cleanup is handled with
trap cleanup EXIT.
- Prompt templates use literal placeholder tokens such as
{TASK}and{PLAN_CONTENT}. - Both the bouncer and the skill embed plan content inline into prompts instead of handing Codex the canonical plan file path.
- The bounce protocol insists on editing the document directly rather than returning commentary or diffs.
[CONTESTED]and[CLARIFY]are the shared coordination markers across the repo.- A
## HUMAN SUMMARYsection is preserved as metadata for per-pass explanation and stripped from the clean canonical output byagent-bouncer/agent-bouncer.sh.
- Raw pass outputs are always preserved separately from the canonical working document.
- Clean outputs are named after the run label instead of a fixed filename.
- stderr is captured per pass in
runs/bouncer-*/pass-N-stderr.log. - Generated run artifacts are kept local and ignored through
.gitignore.
- Behavior is documented close to the implementation:
agent-bouncer/README.mdfor the script andskills/dev-review/README.mdfor the skill. - The repo uses markdown tables, command examples, and file trees heavily instead of typed interfaces or generated docs.
notesforhumans.mdcarries concept and origin context that is intentionally hidden from agent ingestion via.agentignore.
- The bounce alternates reviewer on odd passes and composer on even passes.
- Most workflows assume two passes are the high-value default.
- The skill's verification phase expects JSON-only output matching
skills/dev-review/schemas/review-verdict.json. - Recent git history uses imperative commit subjects such as
Fix Claude max-turns and Codex non-git-repo failures.
- Empty agent output triggers a retry.
- Suspiciously short output triggers a retry because the agent may have returned a summary instead of the full document.
- Marker counting ignores fenced code blocks and inline backticks to reduce false positives when the docs discuss marker syntax itself.
- Adapter functions tolerate non-zero subprocess exits and rely on downstream file checks to decide whether a pass truly failed.
- There is no formatter, linter, or automated style enforcement.
- There is no shared library enforcing consistency between
agent-bouncer/templates/andskills/dev-review/templates/. - Process discipline is encoded mostly in docs, prompts, and human review rather than in tests or static analysis.
- The repository contains two related but separate delivery surfaces:
agent-bouncer/agent-bouncer.shis a legacy runner (still used by tests/experiments) for bouncing a document between agents.skills/dev-review/SKILL.mdis a declarative Claude Code workflow for compose -> bounce -> execute -> verify.- Shared behavior is expressed through prompt templates rather than through a shared library module.
- Adapter boundary:
invoke_claude()andinvoke_codex()isolate CLI differences insideagent-bouncer/agent-bouncer.sh. - Prompt boundary: protocol and role instructions live in
agent-bouncer/templates/andskills/dev-review/templates/. - Schema boundary:
skills/dev-review/schemas/review-verdict.jsonseparates review data shape from prompt wording. - Artifact boundary: raw pass output is preserved, while the working document stays clean and canonical.
- Short-lived state lives in temp prompt/output files created by
agent-bouncer/agent-bouncer.sh. - Durable local state lives in
runs/as per-pass artifacts, stderr logs, and clean final documents. - The skill side assumes additional temp files under
/tmp/dev-review-*, but those are described behavior rather than tracked implementation.
- File-driven orchestration instead of API objects or in-memory pipelines.
- Prompt templates are first-class architecture, not secondary documentation.
- The repo favors explicit artifacts for auditability: original input, per-pass raw outputs, clean output, and
run.log. - There is no application server, UI, or internal library package abstraction.
- Most changes are cross-cutting between executable shell logic, prompt templates, and documentation.
- Architectural drift risk is higher than in a codebase with shared typed abstractions, because behavior is split across prose, shell, and runtime assumptions.
No project skills found. Add skills to any of: .claude/skills/, .agents/skills/, .cursor/skills/, or .github/skills/ with a SKILL.md index file.
Before using Edit, Write, or other file-changing tools, start work through a GSD command so planning artifacts and execution context stay in sync.
Use these entry points:
/gsd-quickfor small fixes, doc updates, and ad-hoc tasks/gsd-debugfor investigation and bug fixing/gsd-execute-phasefor planned phase work
Do not make direct repo edits outside a GSD workflow unless the user explicitly asks to bypass it.
Profile not yet configured. Run
/gsd-profile-userto generate your developer profile. This section is managed bygenerate-claude-profile-- do not edit manually.
The bounce protocol is also distributed as an npm package: @alanshurafa/co-evolution-mcp (the mcp/ subdirectory) wraps co-evolve-bouncer.sh as an MCP server exposing one co_evolve tool for external clients (Claude Desktop, Cursor, Continue). The package vendors a snapshot of the bouncer at each git tag — when changing co-evolve-bouncer.sh, lib/co-evolution.sh, the co-evolve templates, or the receipts stack (evals/score-bounce.sh, evals/report-bounce.sh), remember the change ships externally on the next tag. The MCP smoke tests (cd mcp && npm test) run in CI on all three platforms.