/buddy-agent-harness:enhance [--root <dir>]from buddy-agent-harness
Adds guidance missing from a repository's existing AGENTS.md, or refreshes a vetted section it carries in an outdated form — offering each one at a time and writing only what the user approves. Runs on its own or straight after init.
Ships in buddy-agent-harness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
init consolidates what a repository already has. enhance proposes what it does not.
The split matters: initialization has to run everywhere and invent nothing, so it carries no opinions. An addition is opinionated by construction, and worth having only where its subject is missing. Keeping them apart is what lets init stay safe to run on any repository.
Every addition is offered, never written on sight. An addition asserts something about how the repository is worked in — it stays true whether or not this tool ever ran — so it is material under the rule in references/agents-md.md, and material content needs approval. Nothing here goes inside the buddy-agent-harness managed region; that region is for the tool's own bookkeeping.
Five additions ship today: references/delegation.md, references/list-identifiers.md, references/session-scope.md, references/references-as-links.md, and references/agent-worktrees.md. Classify, offer, and report each one on its own; the owner's answer to one decides nothing about the others. Each addition's reference file carries the text to offer, a ## Covered when criterion for the subject already being present, a ## Stale when section naming the history file its stale check reads and what else that check needs for this addition, and a ## Where it belongs recommendation naming which instruction file the text should go in. The retired wordings themselves are kept beside it — references/<addition>.history.md — and are what a present section is compared against.
Beside the root AGENTS.md, the only file this skill writes is the owner's global file, ~/.agents/AGENTS.md, and only where the owner picks it (step 5). Claude Code's agent-worktree settings — the .gitignore line, the base, and removing old tool exclusions — are not offered here; init offers them. The Agent worktrees addition is guidance for AGENTS.md, not a setting, and is offered here.
Where the invocation names --root <dir>, that directory is the repository: read and write inside it only, apart from ~/.agents/AGENTS.md as step 5 allows. Otherwise locate the Git repository root. The target is the root AGENTS.md.
If there is no root AGENTS.md, stop and say so. This skill adds to an existing file; creating one is init's job, so point there and write nothing. Still report in full as step 6 says — what you read, that nothing was written — with not judged as each addition's verdict.
A nested AGENTS.md is never a target. It governs its own subtree, and none of these additions are subtree-scoped.
Read the root AGENTS.md. Then read any harness instruction file whose content still belongs in it — CLAUDE.md with a body of its own, .cursorrules, .cursor/rules/**, .github/copilot-instructions.md, GEMINI.md, .windsurfrules. references/detection.md lists them.
Judge against all of it together. That combined text is what an agent effectively reads, so guidance living in a Cursor always-on rule counts as present even though AGENTS.md does not carry it yet.
Read those files; do not consolidate them. Merging them into AGENTS.md is init's work and belongs to init alone. If you find content that should be consolidated, say so and recommend init — then carry on with the coverage judgment.
Ask the coverage question first: does the merged view already tell the agent what this addition would tell it?
Judge by meaning, not by heading or wording. A repository covering delegation under ## Working with subagents, or in three sentences inside a longer section, is covered. A repository that mentions subagents only to name a tool is not.
When in doubt, treat it as covered and say why. A missing offer costs the user nothing; a duplicate section teaches every future agent that this file repeats itself.
A heading inside a fenced code block is not a heading. Text between ``` or ~~~ fences is an example of a file, not part of this one, and an addition quoted inside a fence is being shown rather than adopted. This is not hypothetical: every addition here is offered as a fenced block containing its own heading, so a repository documenting this tool — or an AGENTS.md that quotes one — carries the exact heading the addition would write, inside a fence, while remaining entirely uncovered. Judge only the prose the agent actually reads as instruction.
A text carries the current text of an addition when it holds every sentence of the text the addition offers now, in order — the owner may have added paragraphs of their own around or between them, and those are theirs to keep — and asserts no sentence found only in a retired wording. Containment, not resemblance: a text holding the current wording that still asserts a retired sentence does not carry it. This one test is used below on both the repository's text and your own instructions.
Before offering an uncovered addition, check your own instructions. Where instructions you load from outside the repository — the owner's global file, however your harness reaches it — carry the current text, the addition is already global. You can check without opening a file; they are in front of you. Do not count the repository's own files, which the merged view already judged, nor another repository's that your harness loaded from the working directory.
Then ask the second question of text that read as covered, and only of that text: did that text come from this addition, at a version it used to ship? Never ask it of text that read as uncovered, and never ask it first. A global copy (below) is covering text of its own, and is asked it.
Answer it against the addition's own texts: the one its reference offers now, and the ones it has retired, in the history file its ## Stale when names. That section also carries what is specific to the addition; apply it with the procedure below.
Let prose-update do the sentence-level reading. cyber-agentkit ships it as a skill, and this plugin depends on that package. Hand it the three texts as files: the text the addition offers now (the fenced block under ## Offer this text verbatim), the section as found in the file, and the addition's history file. Its script compares them sentence by sentence and returns an outcome per part. Run the script the skill names, or node <this skill's folder>/scripts/cyber-agentkit.mjs prose-update with the same arguments when it cannot be reached. It writes nothing and asks nothing; this skill still does both.
prose-update outcome | State below |
|---|---|
up-to-date | already current |
owners | the owner's own |
update | from a retired wording |
conflict, undetermined | you cannot tell, unless the skill's own reading of meaning settles the part |
For update, prose-update also returns the merged text, which keeps the owner's sentences and takes the offered ones. Offer the current text as the replacement, as below, and put the merged text beside it as the answer that keeps what the owner added. Where prose-update cannot be run at all, apply the two questions that follow by hand; they decide the same cases.
First, is the section already current? It is when it carries the current text; then it is already current, and you compare it against no retired wording. A section that does not carry it goes on to the two questions.
Otherwise, compare the section against each retired wording, and never weigh it against the current text to decide it is stale — differing from the current wording is what a rewrite produces. The one exception: an addition whose history holds no retired wording yet has its current text stand in for one, and its reference says so.
Ask two questions about the section, and only these two:
Each answers yes or no, never neither — where you cannot tell whether a sentence survives, or whether the structure does, the answer is no. When the two answers agree, they decide. When they disagree, you cannot tell.
| whole sentences | structure | |
|---|---|---|
| yes | yes | Stale. It is that wording, edited. Offer the replacement. |
| no | no | The owner's. Written from scratch. Offer nothing. |
| yes | no | You cannot tell. A line of ours carried into prose they wrote — or a line they reached themselves. |
| no | yes | You cannot tell. Their words in our shape — a reword of ours, or the order the subject naturally takes. |
Do not decide the two disagreeing cases. Show the owner the three texts and ask (step 4).
Match a sentence literally. A shared idea is not a sentence surviving, a paraphrase of one is not that sentence, and no phrase, however memorable, answers question 1.
A quoted sentence is not an asserted one, and does not count for question 1. A sentence inside quotation marks, inside a fence, or in a sentence that disputes it is being shown, not followed. A section that quotes one in order to reject it is the owner's prose.
Once both answers are yes, offer the replacement. Do not then read the section's remaining sentences against the current text and reconsider. That applies to the section's other prose only; it changes nothing about how the two questions are answered.
Do not shortcut any of this on the subject a section talks about. Only the two questions decide, and they decide against the texts themselves.
Where your instructions from outside the repository cover the subject in another form, classify that copy. An uncovered addition whose subject they cover — judged by meaning, as above — is not absent. Ask the second question of that global copy, against the same texts and in the same way as of a repository section, and offer nothing for the repository whatever it answers. Its verdict is the one a repository section would get, placed in your instructions from outside the repository: from a retired wording, the owner's own, or you cannot tell. Say, as for already global, that a copy in the root AGENTS.md would add the team and nothing else, that the owner would then read the subject twice, and that they can ask for it.
Classify a global copy the same way whatever the repository holds — a covered or already-current section included — and offer the current text in place of one from a retired wording (step 4).
Each addition ends this step in one of six states:
AGENTS.md would add the team and nothing else, that the owner would then read the text twice, and that they can ask for it. Write that copy only if they do; the request is the approval.AGENTS.md — offer the current text as a replacement. For an addition with no retired wording yet, report it as an edited copy of the current text. Where your instructions from outside the repository carry the current text, the offer says so and puts removal beside it (step 4).A global copy that carries the current text is already global, or, beside a repository section, reported as current. Otherwise it takes the last three, placed in your instructions from outside the repository, and is offered nothing for the repository.
A section from a retired wording in a file that is not the root AGENTS.md — a CLAUDE.md, a .cursorrules — is reported by name and offered nothing. This skill writes one file; replacing the root copy while an older copy stays in a harness file leaves the repository holding two versions instead of one. Recommend init and carry on.
Where an addition is absent, show its text verbatim — the whole thing, not a summary — say where it would go, and ask.
Where it goes is part of the offer, and the addition decides it. Read its ## Where it belongs and lead with what that section recommends. An addition whose subject is the repository belongs in the repository's AGENTS.md; one whose subject is how the agent works belongs in the owner's own global instruction file, because it holds in every repository they open and a copy per repository is a copy per repository to keep in step. Delegation, list identifiers, session scope, references as links, and agent worktrees are all the second kind, and their references recommend the global file.
The global file is ~/.agents/AGENTS.md, the user-scope counterpart of the root AGENTS.md. No harness reads it by itself; a harness reads it only where a user-scope instruction file of its own loads it. Say whether the harness in use does, and do not judge that yourself — doctor owns the check:
node <this skill's folder>/scripts/buddy-agent-harness.mjs doctor
<this skill's folder> is the directory that holds this SKILL.md. The script forwards every argument to the buddy-agent-harness CLI and runs against the current working directory. Read the globalInstructions row for the harness you are running in:
ok — say that this harness loads ~/.agents/AGENTS.md, through the file the row names.missing or unbridged — say that it does not yet, so the text would reach no session of this harness until it does. Name the file the row gives, and hand over the step that bridges it beside the text: references/global-instructions.md names it per harness, and where doctor reported a finding for that file, its help row carries the same step. Where the row is unbridged and the step is a symlink, say that what the file holds moves into ~/.agents/AGENTS.md first.overridden — say that it does not, because the harness reads another file in place of the one the row names, and hand over beside the text: move what that file says into ~/.agents/AGENTS.md and remove it. The file is the suppresses AGENTS.md entry of references/harnesses/<name>.md in the /buddy-agent-harness:doctor-buddy-agent-harness (pnpm install: pnpm-buddy-agent-harness-doctor-buddy-agent-harness) skill, under the same directory as the row's path, and once ~/.agents/AGENTS.md exists, doctor's global-instructions-overridden finding names it../ — whatever the status, the harness is reading an empty variable as the directory it starts in, so its user-scope file changes with each directory. Say that, and hand over unsetting the variable beside the text rather than any step for that file; once ~/.agents/AGENTS.md exists, doctor's global-instructions-emptied finding names the variable.doctor can check, so whether it loads the global file is not something you can confirm.Name both destinations and what each buys — the global file reaches every repository the owner opens and nobody else; the project file reaches everyone who clones it, at a copy per repository.
Ask which destination the owner wants, and write the one they pick. Put the recommended destination first and the other as the alternative, and ask for one or neither. Either is written on that yes and neither without it: the root AGENTS.md, or the end of ~/.agents/AGENTS.md (step 5). The owner's choice of the other destination is an approval of that one, not a decline. A bridging step from the doctor row above stays handed over: it changes a harness's own user-scope file, which this skill does not write.
Where an addition came from a retired wording, show the section as it stands in AGENTS.md, then the current text verbatim, say that it would replace that section and nothing else, and ask.
Name what the replacement would take with it. A stale section often carries paragraphs the owner added to it — rules of their own, sitting under the same heading. Replacing the section removes those too. So before you ask, name every paragraph in that section that appears in no retired wording — or, for an addition with none yet, not in the current text — say the replacement would remove it, and let the owner weigh that. An approval given for "refresh the wording" is not an approval to delete what they wrote.
Where your instructions from outside the repository carry the current text, put removal beside the replacement. Offer the replacement as above, and say that it would have the owner read the text twice, once from each place. Then offer removing the section as the other answer: name every paragraph of the owner's it would take, and say the team's agents would no longer read it. This holds however the section was placed — by the comparison, by the owner's answer, or by measurement.
Where a global copy came from a retired wording — whatever the repository holds, a current section included — show it as it stands, then the current text verbatim, name the file that holds it where you can see it, and say the current text would replace that section there. Name the owner's paragraphs it would take, as for a replacement. Where that file is ~/.agents/AGENTS.md, offer the replacement and ask, as for one in the root AGENTS.md; it is written only on a yes (step 5). Where it is any other file — a harness's own user-scope file — or one you cannot see, hand the current text over for it instead and say so: this skill writes no other file outside the repository. Where a global copy cannot be placed, put it to the owner exactly as below; an answer that it came from here, or a measurement that puts the current text ahead, offers the current text as that replacement.
Where you cannot tell, say that first, in those words. Then show three texts — the section as it stands, the retired wording it partly tracks, and the current text — and put three answers to the owner:
Put the third every time the repository can actually do it, because the owner may not remember either, and the question they care about is not where the section came from but which wording serves them better. Provenance is a stand-in for that; when the stand-in fails, ask the real question.
Measurement means running each wording against a set of real tasks and comparing how the agent behaves — whatever harness this repository has for that addition's wording. In this package's own repository eval-delegation scores Delegation's and eval-list-identifiers scores List identifiers'; Session scope, References as links, and Agent worktrees have none, and a consumer repository will have its own or none. Look before you offer it. Where the repository has no harness for that addition, say the third answer would need one it does not have, and put the other two.
Ask before running it, and never run it unasked — it is many model runs, and the owner is the one paying for them.
Where the owner asks for it, run it over the section as it stands and the current text, and report both scores.
Do not argue for any of it past one sentence. The user is reading the actual text; that is the argument.
On approval of an addition for the repository, or a request for the team copy of an already global one, write the section into the root AGENTS.md at the end of the owner's prose, outside the managed region, preserving the surrounding file exactly.
On approval of the global destination, write the section at the end of ~/.agents/AGENTS.md, creating the file where it does not exist, and leave every other byte of it as it was. The repository's AGENTS.md is left as it stands. Where the harness in use does not load that file yet, hand over the step that bridges it; that step is never written here.
On approval of a replacement — in the root AGENTS.md, or of a global copy in ~/.agents/AGENTS.md — replace that one section in place — from its heading through to the next heading of the same or higher level — and leave every other byte of the file as it was. Do not relocate it, do not reformat around it, and do not touch the managed region.
Strip the fence when you write. The ``` markers around the addition in its reference file are there so you can see where the text begins and ends; the section goes into AGENTS.md as prose, not as a code block.
On approval of a removal, remove that one section — from its heading through to the next heading of the same or higher level — and leave every other byte of the file as it was.
On a decline, write nothing. A declined replacement leaves the section exactly where it stands, and so does an unanswered question.
Report every run, whichever way it went: what you read, the verdict for each addition and why — already global, already current, absent, the owner's own, from a retired wording, undecidable, or not judged — what you offered, which destination you recommended, and what was written, naming the file each write went to. For an already-current addition your instructions from outside the repository also carry, say the owner reads it twice. Wherever those instructions cover an addition's subject, name that copy and its verdict. A hand-over — a bridging step, or the current text for a global copy in a file this skill does not write — is an outcome, not a decline; say so. A run that offers nothing still reports — that is the only way the user can tell "already covered" from "did not look".
AGENTS.md or ~/.agents/AGENTS.md, and only on the owner's approval in this run, or their request for a team copy.init's offer to run this skill, not a flag here.~/.agents/AGENTS.md as the global file. Name a harness's own user-scope file only where that harness documents it.AGENTS.md, or any file other than the root AGENTS.md — except ~/.agents/AGENTS.md in step 5, as approved.~/.claude/CLAUDE.md. A step for it is handed over..gitignore, tool configs, .claude/settings.json, or unrelated project files.references/agent-worktrees.history.md (opens in a new tab)references/agent-worktrees.md (opens in a new tab)references/agents-md.md (opens in a new tab)references/delegation.history.md (opens in a new tab)references/delegation.md (opens in a new tab)references/detection.md (opens in a new tab)references/global-instructions.md (opens in a new tab)references/list-identifiers.history.md (opens in a new tab)references/list-identifiers.md (opens in a new tab)references/references-as-links.history.md (opens in a new tab)references/references-as-links.md (opens in a new tab)references/session-scope.history.md (opens in a new tab)references/session-scope.md (opens in a new tab)scripts/buddy-agent-harness.mjs (opens in a new tab)scripts/cyber-agentkit.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub repobuddy/buddy-agent-harness --plugin buddy-agent-harness4 skills in this plugin
/doctor-buddy-agent-harnessChecks whether a repository's agent configuration bridges into .claude/skills and the other harness files still resolve — when a repository loads no project skills, when skills are missing after a clone, or when a harness appears to be ignoring AGENTS.md./init-buddy-agent-harnessInitializes, adopts, or migrates a repository's agent configuration to the open AGENTS.md and Agent Skills standards, so one canonical source works across Claude Code, Codex, Cursor, Copilot CLI, and other agent harnesses./repairRepairs a repository's agent configuration when it is present but wrong or outdated — a retired harness name, a git-ignored bridge, an AGENTS.local.md nothing reads, a skill a harness refuses to load, a skills copy that drifted from .agents/skills or lost its copy protection, or an MCP server that differs between the golden set and a harness, on the side that is plainly ahead. Also for "sync the .claude/skills copy that drifted from .agents/skills". Runs doctor to find them, then offers each correction with its before and after and writes only what is approved.Other plugins' skills for the same job