agent-friendly-repo

Use when bootstrapping or evolving a repository so coding agents work in it reliably and can run unattended between human decisions. Triggers on making a project agent-friendly, repository-as-harness design, AGENTS.md and skill structure, task ledgers and dispatchers for parallel agents, worker and verifier roles, autonomy tiers and run charters, guardrails and verification, delivery evidence, ownership in multi-human teams, retrospective learning loops, or Agent 友好项目、仓库级 harness、人机协同与无人值守.

¿Qué es agent-friendly-repo?

agent-friendly-repo is a Cursor agent skill that use when bootstrapping or evolving a repository so coding agents work in it reliably and can run unattended between human decisions. Triggers on making a project agent-friendly, repository-as-harness design, AGENTS.md and skill structure, task ledgers and dispatchers for parallel agents, worker and verifier roles, autonomy tiers and run charters, guardrails and verification, delivery evidence, ownership in multi-human teams, retrospective learning loops, or Agent 友好项目、仓库级 harness、人机协同与无人值守.

Compatible con~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/parkavenue9639/agent-friendly-repo/tree/HEAD

Installed? Explore more Productividad y colaboración skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Preguntar en tu IA favorita

Abre un nuevo chat con esta habilidad de agente ya precargada.

Documentación

Agent-Friendly Repository (Repository as Harness)

The Core: Align, Run, Decide

Humans spend their time where it is irreplaceable; workers and verifiers advance everything else on their own.

  1. Align. Humans, with agents drafting, settle the design and the task scope: tasks a worker can finish without asking, marked runnable, and a charter saying what a run may do alone.
  2. Run. A dispatcher starts runnable tasks in dependency order; workers execute in isolated workspaces; gates and an independent verifier decide; work merges according to its tier; whatever cannot proceed parks with a question a human can answer quickly.
  3. Decide. Whenever the human comes back, they read the run summary and the questions, answer, accept, and feed what went wrong back into the harness.

Runs are not tied to a time of day: they start when a batch is ready, overlap with the human's own work, or run continuously. Drafts are never picked up, and a run does not start tasks that overlap the human's uncommitted files, branch or in-progress work.

North star: less human attention per accepted change, with rework flat or falling.

Who Decides the Merge

Safety and throughput both come from moving the second pair of eyes from a waiting human to an independent verifier, and keeping humans for what needs authority.

TierTypical scopeMerge decided by
Green: self-mergeInside the task's own scope; no shared contract semantics; no guarded filesThe gates and delivery evidence (plus the verifier, if the charter says so)
Yellow: verifier-mergeShared entrypoints and fixtures, additive interfaces others adapt to, another owner's area under that owner's recorded agreementThe independent verifier; owners are notified and audit afterwards
Red: human-decisionContract meaning, direction, loosening checks, cost or irreversible or external effects, loops that do not converge, a verifier that is unsure; another owner's area without agreementA human; for another owner's area, that owner

The tier set during alignment is a floor: what the diff touches can raise it, nothing lowers it.

Fixed: the Questions; Free: the Answers

Everything below is infrastructure built beside the product code to make the loop safe. What each piece must guarantee is fixed; how a project provides it is its own. Every state name, field, prefix, threshold, template, prompt and bundled script here is a recommended default to adapt or replace. Carry over reasons, not another project's commands, labels or names, and pick the lightest native mechanism that serves each reason.

Two Stages, One Kernel

  • Solo: one human directing many agents, serially and in parallel. Thinnest forms: files in the repository, small scripts, one dispatcher.
  • Team: several humans directing agents in one repository. Adds the human contract (I12); pieces move to shared infrastructure because several people's agents share state. Move here when a second human starts directing agents, not when the code grows; code size and legacy debt are a separate dial inside verification (I6).

Build each piece thin first and thicken it only when the thin form breaks. A written convention is a valid thin form until it is violated; the violation is the learning loop's cue to turn it into a script or check.

Infrastructure Beside the Product Code

#InfrastructureServesSolo: build toTeam: build to
I1Agent contextAlign and runRoot AGENTS.md under ~200 lines (invariants, commands, validation matrix, tiers, skill router); skills only for recurring procedures; docs hold current design onlyPlus ownership summary and per-area routing; nested AGENTS.md where areas diverge; path and link checks over docs and skills
I2Task ledger and contractsAlign output, run inputAnything that answers the ledger questions mechanically (runnable? scope? tier floor? order? outcome? owner?); default: task cards checked by scripts/task_ledger.pyThe team's tracker with a body template, a closed label vocabulary, typed progress comments and report-only reconciliation
I3Charter and tiersRun boundsTiers and forbidden effects in AGENTS.md; a committed run charter: merge tiers, escalation paths (shared entrypoints to yellow, guarded files to red), budgets, parallelism, stop conditions, commandsPlus escalation from the ownership map (cross-owner work is yellow only with the owner's recorded agreement); per-area opt-out of verifier merges; per-person charters
I4DispatcherRun engineReference scripts/dispatch.py (maps the project's lifecycle; merges locally or through change requests) or a host loop meeting the same contract; worker wired with a role promptPer-person resident workers, a verifier role and a model-free gatekeeper; atomic claims, leases, write-scope locks, claim scope limited to the owner's tasks
I5Workspace isolationRun parallelismOne task, one branch, one workspace outside the checkout, removed after mergePlus audit of orphaned workspaces; teardown of task resources by exact name
I6Verification entry and self-testRun correctnessOne command: fast scope in the commit hook, full scope before merge; offline fakes for paid and real systems; diagnostics that say how to fixPlus CI on the merged tree with branch protection; affected-test selection, caching, ratchets where debt exists
I7Delivery evidenceTrust at decision timeClaimed acceptance checked against tests, scope respected, skipped tests listed; honest changed / verified / not verifiedPlus a grow-only record of tested acceptance; evidence attached to each change request
I8Independent verifierRun quality, yellow mergesA fresh-context verifier wired with a role prompt, bounded rounds, re-run after the base moves; a different model from the worker where possibleA verifier role on every change request that merges yellow work itself and arbitrates stuck tasks
I9Gate self-protectionThe run cannot cheatGuarded file list (red by default); loosening is a human decision; reasons recorded for test changes; hooks never bypassedPlus loosening detected mechanically; non-skippable core; escape hatches need consent and are counted
I10Decision queue and run summaryDecideParked tasks state what they need (a decision with options and a recommendation, or an arbitration request the verifier tries first); one summary per run, needs-you firstLabels and a live dashboard; per-person attention queue; routine tasks close after review, risky ones wait for a human
I11Learning loopNext loop is betterLessons with a reviewed-through cursor; after each run, promote each miss code-first (type, check, skill, lesson) and trim prose; collect the verifier's learning signalsPlus a signal script and a retro role (tightenings yellow, loosenings red); a few trend metrics
I12Human contractCommunicationOne decision-maker: nothing beyond I3Agreed by the humans: ownership map, cross-owner agreement before agents edit, document audiences and review discipline, lifecycle, cleanup duty
I13Worker runtimePer-person throughputHeadless command, auditable approval policy, model choice, delegation habits; measure unattended hours per human inputEach person tunes their own; the repository keeps host-neutral role notes

Before leaving agents alone, the run needs: contracts complete enough to start without asking (I1, I2); explicit authority and diff-based tiers (I3); collision-free parallelism (I4, I5); checks that decide correctness (I6); evidence another agent re-checked (I7, I8); checks the run cannot weaken (I9); effects off unless granted, a budget and a kill switch (I3, I4); no credentials beyond the grant (I3, I13); and a summary and queue that are enough to decide on (I10). The auditor reports which of these it can confirm.

Where things are (all paths relative to this skill):

NeedGo to
AGENTS.md templates, one canonical source per host, docs hygienereferences/context-and-skills-templates.md
Ledger questions, readiness, dispatcher contract, run charterreferences/task-ledger-and-dispatch.md
Human contract, tiers, escalation, verifier practice, worker runtimereferences/collaboration-and-autonomy.md
Topology, workspace isolation, self-test patternsreferences/architecture-and-isolation-menu.md
Verification entry, ratchets, evidence, gate protectionreferences/guardrails-and-verification-patterns.md
Decision view, learning loop, metricsreferences/learning-loop-and-metrics.md
Planner, worker and verifier prompts; wiring a headless agentassets/prompts/
Readiness audit, file-card ledger, reference dispatcher, prompt renderer, verifier verdict mapperscripts/ (Python 3.9+ standard library; tests in scripts/tests/)

Principles

  1. Enforce where every actor passes: hooks, CI and merge protection, never one agent's configuration; each layer assumes the one before was skipped.
  2. One home per rule; code beats docs, and a drifted doc or skill is fixed in the same change.
  3. Separate audiences: agent context apart from human rationale; humans explain designs themselves.
  4. Keep only current truth: delete what is obsolete; version control holds history.
  5. Evidence over assertion, and readiness is not authorization for cost or irreversible effects.
  6. Bound every loop: retries and review rounds escalate (worker, fresh-context analysis, verifier, human), and what reaches a human is decision-ready.
  7. Promote code-first, then trim: type, then check, then skill, then lesson; delete prose a check now covers.
  8. Scripts compute, models judge; tool failures report UNKNOWN, never healthy. Truth order: code and tests, nearest AGENTS.md, skills, docs, memory.

Approaching a Repository

This is guidance, not a script; the repository's state decides the path.

Read the state. Run python3 <skill-dir>/scripts/audit_repo_harness.py <repo> (--mode solo|team if the inference is wrong). It rates I1–I13 as ok, thin, missing or "by hand", names the next item to build, and says which run preconditions it can confirm. Add what it cannot see: who directs agents here, how work is tracked, and where the humans currently lose the most time; that bottleneck usually decides what to build first.

Existing project: map, adapt, fill gaps. Most of the kernel often exists under other names. Map what is there onto I1–I13 and the ledger questions, keep working conventions, and build only where a question has no answer.

Often already thereServesAdapt, do not replace
Issue tracker with its own states and labelsI2, I10Answer the ledger questions with its labels and templates; map file cards through the charter's ledger block
CI pipeline, make check, hooksI6The verification command is what CI already runs; add a fast scope for the commit hook
CODEOWNERS, team areasI3, I12Becomes the owners map and the cross-owner escalation
Pull-request review and branch protectionI8, I9Let the verifier merge through the platform (merge_mode: pr); keep protection on red paths
Host-specific instruction files, wiki pagesI1Fold rules into AGENTS.md, leave pointers, link instead of copying
An existing agent loop or role skillsI4, I8Check them against the dispatcher contract and keep them

New project or no loop yet: the shortest path to a first run (Solo). Typically a few hours when tests exist.

  • AGENTS.md with commands, hard invariants, the three tiers and forbidden effects (I1, I3).
  • One verification command wired into the commit hook (I6).
  • task_ledger.py init and two or three small runnable cards (I2).
  • assets/prompts/ copied to .agents/prompts/ and adapted (I4, I8).
  • .agents/run-charter.json with the worker, verify and verifier commands and the guarded paths (I3).
  • dispatch.py plan, then a supervised run with a small max_tasks; fix whatever made a worker ask, a check let something through, or the summary insufficient (I11), and widen from there.

What only humans decide: tiers, forbidden effects and the default charter; for Team, the human contract. Agents draft; note for each rule whether code, structure or discipline enforces it, and prefer the hardest.

Build order that usually works: what keeps watched work safe first (I1, I6, I5), then what makes tasks runnable and checkable (I2, I3, I7), then the engine and the decision view (I4, I8, I9, I10), then improvement (I11, I13). Team settles I12 first. Leave agents alone only once the preconditions above hold, starting with small batches and tight budgets.

Hand-off: re-run the auditor and the project's checks; report the stage and why, each item's form and what would justify thickening it, what changed, which commands ran with what result, what waits for a human, and which preconditions hold.

Anti-Patterns

  • Copying another project's labels, thresholds or names; treating the defaults, prompts or scripts here as mandatory; replacing a working convention that already answers a kernel question.
  • A different kernel for Solo instead of a thinner implementation of the same one.
  • Leaving agents unattended before the preconditions hold, or without a budget and a kill switch.
  • Rules enforced only in one agent's configuration; prose where a type or check could hold the rule; prompts that script agents step by step instead of giving them goals, boundaries and experience.
  • Agents inventing tiers, charters or ownership; unbounded loops; escalations without options and a recommendation.
  • Thickening a piece before its thin form breaks; measuring generated output instead of human attention.

Skills relacionados