Agent Control is a self-contained repo for improving AI coding agent workflow, bounded loops, verification discipline, project memory, and handoff quality.
It is designed as an agent-first operating surface rather than a framework: clear runbooks, explicit stop-lines, reusable templates, and a repo-local check that keeps the authority docs aligned.
Use this short prompt in the host project:
Clone https://github.com/mengchheanglong/agent-control.git and follow its AGENTS.md.
If this repo has just been cloned or imported into a host project, do not stop after cloning.
When this repo is imported into another project, the AI agent should inspect the host project first, infer the project context and proof path, then ask the user one optional question:
I inferred the project context and next useful direction. Any priority, constraint, or direction you want future agents to remember?
Then the agent records the result with bootstrap --context. The CLI should stay non-interactive and dependency-free; the agent does the analysis.
By default, add agent-control/ to the host project's .gitignore after cloning. Do not overwrite existing ignore rules. Skip this only when the user explicitly wants to vendor Agent Control into the host repo.
Also create or update the host root AGENTS.md so future agents know Agent Control exists even though agent-control/ is ignored. Preserve any existing host instructions and add a short pointer like:
Use `agent-control/` for workflow memory and verification discipline. Before substantive work, read `agent-control/AGENTS.md` and `agent-control/memory/project.md`. After meaningful changes, update Agent Control memory and regenerate `agent-control/memory/state.json`.Minimum post-clone sequence, run from inside agent-control/ unless noted:
npm run agent-control -- adoption-protocol
# from the host project root, add agent-control/ to .gitignore unless vendoring
# from the host project root, create or update AGENTS.md to point future agents to agent-control/
npm run agent-control -- bootstrap --context "..." --project-shape "..." --current-truth "..." --constraint "..." --next "..." --proof "..."
npm run checkAGENTS.md: thin discovery bridge for tools that look for agent instructionsauthority.manifest.json: structured map of authority surfaces, commands, and drift boundariesimplement.md: thin entrypoint into the active guidancerunbook/: live operating guidance and current prioritypolicies/: stable guardrails, continuation rules, logging rules, and stop-line cardstemplates/: reusable cycle, loop-run, and handoff formatstemplates/project-memory.md: compact project memory template for imported projectsmemory/: guidance for keepingagent-control/memory/project.mdand generatedagent-control/memory/state.jsonas active agent memory in imported projectslogs/: optional run history for the project using this reposcripts/: lightweight validation and operating helpers, includingscripts/agent-control.mjs
- Read
implement.md. - Read
runbook/active.md. - Read
runbook/current-priority.md. - Read
policies/stop-lines.md,policies/continuation-rules.md, andpolicies/logging-rules.md. - Inspect
policies/stop-line-cards.jsonwhen choosing an owning lane. - Run
npm run check.
npm run agent-control -- help: list available helper commandsnpm run agent-control -- adoption-protocol: print the agent-first import protocolnpm run agent-control -- preflight: run the lightweight workflow gate for generated policies and memory qualitynpm run agent-control -- bootstrap --context "...": create project memory and a machine-readable context capsule for a newly imported projectnpm run agent-control -- update-memory: add durable truth, decisions, suggestions, questions, recent changes, next move, and proof pathnpm run agent-control -- show-memory: print the active project memorynpm run agent-control -- memory-state: print project memory plus the context capsule as structured JSONnpm run agent-control -- sync-state: regenerate repo-localmemory/state.jsonfrommemory/project.mdnpm run agent-control -- show-next: print the next best move, proof path, and active constraints from project memorynpm run agent-control -- score-next: rank candidate next moves by scope, proof strength, specificity, and constraint fitnpm run agent-control -- audit-memory: check memory for placeholders, bloat, and weak proof pathsnpm run agent-control -- compact-memory: trim bloated list sections while preserving durable statenpm run agent-control -- start-cycle: scaffold a bounded cycle entrynpm run agent-control -- close-cycle: fill verification, result, next move, and risk fields in a cycle entrynpm run agent-control -- handoff: create a concise handoff record underlogs/YYYY-MM/npm run agent-control -- analyze-logs: scan logs for missing fields, failed verification mentions, oversized-scope signals, and stale next movesnpm run agent-control -- pack: copy the minimal import profile underdist/npm run agent-control -- render-stop-lines: regeneratepolicies/stop-lines.mdfrom stop-line cardsnpm run agent-control -- stop-lines: print the active stop-line cards
npm run check: validate authority surfaces and CLI behaviornpm run check:agent-control: run the authority check directlynpm test: run focused CLI behavior testsnpm run preflight: run generated-policy and memory-quality checksnpm run check:reusable: copy the repo to a temp directory and run the authority check there
- The repo is self-contained and does not depend on a specific workspace layout.
- Start
logs/fresh for the project where you adopt this repo.