Ai Coding 5xp Template
A boilerplate and reference guide demonstrating the 5xP Context Framework for steering AI coding agents (like Gemini, Copilot, Cline) through context engineering.
Gather Agent Docs
Seed `.agents/docs/` with a navigation map of the project's key topics (tools, services, frameworks, ...) — a structured link index to upstream pages, plus a brief summary and key concepts. Future agents read locally to find the right upstream URL in one hop. Triggers include "gather docs for X", "seed agent docs", "set up .agents/docs", "deepen agent docs".
Lever Init
Bootstrap a repo for agent-levers. Creates .agents/levers/, wires CLAUDE.md/GEMINI.md to import AGENTS.md, writes an AGENTS.md skeleton when missing. Hands off via /lever-new.
Lever New
Start a new lever — discuss the ask in chat, then capture intent (Goal, Success sketch, Context, Open questions) as §Brief. Hands off via /lever <id>.
Lever
Advance an existing lever. Reads lever.yaml.step and runs the chain (plan → do → check → act → done) autonomously until it pauses or finishes.
Use Agent Docs
Before web-searching or fetching docs for a project topic, check `.agents/docs/INDEX.md` and the matching `DOC.md` for a navigation map of curated upstream URLs. No-op if `INDEX.md` is missing.
New Agent Evolution
Capture phase of an agent evolution — discuss the objective, gates, rubric, scope, and budget; write `.agents/evolutions/<id>-<slug>/{evolution.yaml, EVOLUTION.md}` only on explicit user agreement. Pairs with `/run-agent-evolution` (next) and `/apply-agent-evolution` (later).
Apply Agent Evolution
Apply phase of an agent evolution — diff the winner workspace against the live repo, get explicit user confirmation, copy files in, optionally re-run gates against the live tree. Writes `applied`. Requires `winner` set by `/run-agent-evolution`.
Run Agent Evolution
Run phase of an agent evolution — plan a batch of up to `budget.parallel` variants, dispatch sub-agents in parallel to materialize and evaluate them, learn from results, repeat until budget / wall-clock / plateau. Writes `winner` on a clean stop. Requires an evolution captured via `/new-agent-evolution`; `/apply-agent-evolution` lands the winner afterward.
Lever Status
Inspect or cancel levers. List all (no arg), detail one (TL;DR + criteria + per-criterion events timeline), or cancel one with `<id> cancel [<reason>]`. Never advances the chain.
Refresh Agent Docs
Re-verify entries in `.agents/docs/` against upstream — repair dead links in the documentation map, update drifted captured snippets, and bump `last_verified` dates. Triggers include "refresh agent docs", "update .agents/docs", "re-verify the docs".