buddy-agent-harness 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.codex-plugin/plugin.json +1 -1
  3. package/.cursor-plugin/plugin.json +1 -1
  4. package/CHANGELOG.md +25 -0
  5. package/dist/cli.mjs +86 -9
  6. package/dist/index.d.mts +10 -3
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.mjs +92 -8
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/skill-scripts/doctor.mjs +27 -27
  11. package/dist/skill-scripts/init.mjs +27 -27
  12. package/dist/skill-scripts/mcp.mjs +27 -27
  13. package/llms.txt +6 -5
  14. package/package.json +2 -1
  15. package/plugin.json +1 -1
  16. package/skills/doctor-buddy-agent-harness/README.md +1 -1
  17. package/skills/doctor-buddy-agent-harness/SKILL.md +9 -2
  18. package/skills/doctor-buddy-agent-harness/references/worktrees.md +17 -0
  19. package/skills/doctor-buddy-agent-harness/scripts/doctor.mjs +27 -27
  20. package/skills/enhance/SKILL.md +25 -16
  21. package/skills/enhance/references/agent-worktrees.md +59 -0
  22. package/skills/enhance/references/delegation.md +1 -1
  23. package/skills/enhance/references/list-identifiers.md +2 -2
  24. package/skills/enhance/references/references-as-links.history.md +9 -0
  25. package/skills/enhance/references/references-as-links.md +76 -0
  26. package/skills/enhance/references/session-scope.md +2 -2
  27. package/skills/enhance/scripts/doctor.mjs +27 -27
  28. package/skills/init-buddy-agent-harness/SKILL.md +8 -5
  29. package/skills/init-buddy-agent-harness/references/agent-worktrees.md +59 -0
  30. package/skills/init-buddy-agent-harness/scripts/doctor.mjs +27 -27
  31. package/skills/init-buddy-agent-harness/scripts/init.mjs +27 -27
  32. package/skills/repair/README.md +2 -2
  33. package/skills/repair/SKILL.md +3 -3
  34. package/skills/repair/scripts/doctor.mjs +27 -27
  35. package/skills/repair/scripts/mcp.mjs +27 -27
  36. package/src/diagnose-bridges/doctor-guidance.ts +66 -1
  37. package/src/diagnose-bridges/doctor.command.ts +2 -0
  38. package/src/diagnose-bridges/git-bridge-state.ts +5 -0
  39. package/src/diagnose-worktrees/diagnose-worktrees.ts +69 -0
  40. package/src/index.ts +1 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: enhance
3
- description: Use this skill when a repository already has an AGENTS.md and you want to add guidance it is missing, or to refresh 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.
3
+ description: 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.
4
4
  argument-hint: '[--root <dir>]'
5
5
  ---
6
6
 
@@ -12,13 +12,15 @@ The split matters: initialization has to run everywhere and invent nothing, so i
12
12
 
13
13
  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.
14
14
 
15
- Three additions ship today: `references/delegation.md`, `references/list-identifiers.md`, and `references/session-scope.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.
15
+ Four additions ship today: `references/delegation.md`, `references/list-identifiers.md`, `references/session-scope.md`, and `references/references-as-links.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.
16
+
17
+ Beside the additions, it offers the two **agent-worktree settings** in `references/agent-worktrees.md`: lines in `.gitignore`, a tool config, and `.claude/settings.json` rather than prose in `AGENTS.md`. Step 6 is theirs. Beside the owner's global file, `~/.agents/AGENTS.md`, written only where the owner picks it (step 5), they are the only writes this skill makes outside the root `AGENTS.md`.
16
18
 
17
19
  ## 1. Find the instruction file
18
20
 
19
- Where the invocation names `--root <dir>`, that directory is the repository: read and write inside it only. Otherwise locate the Git repository root. The target is the root `AGENTS.md`.
21
+ 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`.
20
22
 
21
- 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.
23
+ 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 7 says — what you read, that nothing was written — with **not judged** as each addition's verdict.
22
24
 
23
25
  A nested `AGENTS.md` is never a target. It governs its own subtree, and none of these additions are subtree-scoped.
24
26
 
@@ -89,7 +91,7 @@ Once both answers are yes, offer the replacement. Do **not** then read the secti
89
91
 
90
92
  **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.
91
93
 
92
- Classify a global copy the same way whatever the repository holds — a covered or already-current section included — and hand over the current text for one from a retired wording (step 4).
94
+ 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).
93
95
 
94
96
  Each addition ends this step in one of six states:
95
97
 
@@ -108,7 +110,7 @@ A section from a retired wording in a file that is **not** the root `AGENTS.md`
108
110
 
109
111
  Where an addition is **absent**, show its text **verbatim** — the whole thing, not a summary — say where it would go, and ask.
110
112
 
111
- **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, and session scope are all the second kind, and their references recommend the global file.
113
+ **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, and references as links are all the second kind, and their references recommend the global file.
112
114
 
113
115
  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:
114
116
 
@@ -116,7 +118,7 @@ The global file is `~/.agents/AGENTS.md`, the user-scope counterpart of the root
116
118
  node scripts/doctor.mjs
117
119
  ```
118
120
 
119
- That path is relative to this skill's own directory; fall back to `npx -y buddy-agent-harness@1.1.0 doctor` when it is missing or cannot be run. Read the `globalInstructions` row for the harness you are running in:
121
+ That path is relative to this skill's own directory; fall back to `npx -y buddy-agent-harness@1.3.0 doctor` when it is missing or cannot be run. Read the `globalInstructions` row for the harness you are running in:
120
122
 
121
123
  - **`ok`** — say that this harness loads `~/.agents/AGENTS.md`, through the file the row names.
122
124
  - **`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.
@@ -126,7 +128,7 @@ That path is relative to this skill's own directory; fall back to `npx -y buddy-
126
128
 
127
129
  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.
128
130
 
129
- **A global placement is handed over, not written.** This skill writes the root `AGENTS.md` and nothing else, so give the text and the path and stop there. Do not offer to write outside the repository, and do not treat the hand-off as a decline — report it as what it is.
131
+ **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.
130
132
 
131
133
  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.
132
134
 
@@ -134,7 +136,7 @@ Where an addition came from a **retired wording**, show the section as it stands
134
136
 
135
137
  **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.
136
138
 
137
- 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. This skill writes nothing outside the repository, so this is handed over, as a global placement is; say so. 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, hands the current text over.
139
+ 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.
138
140
 
139
141
  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:
140
142
 
@@ -144,7 +146,7 @@ Where you **cannot tell**, say that first, in those words. Then show three texts
144
146
 
145
147
  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.
146
148
 
147
- 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 has 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.
149
+ 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 and References as links 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.
148
150
 
149
151
  **Ask before running it, and never run it unasked** — it is many model runs, and the owner is the one paying for them.
150
152
 
@@ -159,9 +161,9 @@ Do not argue for any of it past one sentence. The user is reading the actual tex
159
161
 
160
162
  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.
161
163
 
162
- On approval of a **global placement**, write nothing. Give the text and `~/.agents/AGENTS.md`, and say it belongs at the end of that file. Where the harness in use does not load that file yet, give the step that bridges it too. Nothing outside the repository is written, the bridge included, and the run still reports.
164
+ 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.
163
165
 
164
- On approval of a **replacement**, 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.
166
+ 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.
165
167
 
166
168
  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.
167
169
 
@@ -169,9 +171,15 @@ On approval of a **removal**, remove that one section — from its heading throu
169
171
 
170
172
  On a decline, write nothing. A declined replacement leaves the section exactly where it stands, and so does an unanswered question.
171
173
 
172
- ## 6. Report
174
+ ## 6. Offer the agent-worktree settings
175
+
176
+ Where Claude Code is in use — a `.claude/` directory exists — read `references/agent-worktrees.md` and judge **P1**, ignoring `.claude/worktrees/`, and **P2**, setting `worktree.baseRef` to `"head"`, against the files that page names. Each is covered, or offered on its own, one line per file, with P2's trade-off explained before you ask. On approval, write exactly the line approved into that file and leave every other byte of it as it was: change the one key or array element, keep key order, indentation, and comments. On a decline, write nothing.
177
+
178
+ These are settings, not additions. They have no history file, no global destination, and no `prose-update` comparison: a line is there or it is not. Where no `AGENTS.md` exists the run stops at step 1 and offers neither; `init`, which it points to, offers both.
179
+
180
+ ## 7. Report
173
181
 
174
- 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. 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-off for the owner to place globally 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".
182
+ 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. Report each agent-worktree offer as written, declined, or already covered, naming the file. A run that offers nothing still reports — that is the only way the user can tell "already covered" from "did not look".
175
183
 
176
184
  ## Rules
177
185
 
@@ -182,5 +190,6 @@ Report every run, whichever way it went: what you read, the verdict for each add
182
190
  - **Never run an evaluation unasked.** It costs the owner many model runs. Offer it; wait.
183
191
  - **Never edit an addition to fit a repository.** The wording is fixed. Offer it as written or not at all.
184
192
  - **Name `~/.agents/AGENTS.md` as the global file.** Name a harness's own user-scope file only where that harness documents it.
185
- - **Never touch the managed region**, a nested `AGENTS.md`, or any file other than the root `AGENTS.md`.
186
- - Local agent configuration only. Do not change workflows, repository settings, or unrelated project files.
193
+ - **Never touch the managed region**, a nested `AGENTS.md`, or any file other than the root `AGENTS.md` — except `~/.agents/AGENTS.md` in step 5 and the agent-worktree lines in step 6, each as approved.
194
+ - **Never write a harness's own user-scope file**, such as `~/.claude/CLAUDE.md`. A step for it is handed over.
195
+ - Local agent configuration only. Do not change workflows, repository settings, or unrelated project files; the agent-worktree lines are the one exception.
@@ -0,0 +1,59 @@
1
+ # Agent worktrees
2
+
3
+ Claude Code runs a session started with `--worktree`, and a subagent isolated in a worktree, in a git worktree under `.claude/worktrees/<name>/` at the repository root, on a branch named `worktree-<name>`. The place is by design: no setting moves it, and only a `WorktreeCreate` hook, which replaces Claude Code's git logic outright, can put worktrees elsewhere. That is rarely worth it, so do not offer it.
4
+
5
+ Each worktree is a whole checkout inside the repository, config files included. A repository that does not account for that pays three ways:
6
+
7
+ - **`git status` lists `.claude/worktrees/` as untracked.** Claude Code does not ignore the directory itself; its documentation tells users to.
8
+ - **Tools that walk the tree find each worktree's config.** Biome stops with "Found a nested root configuration, but there's already a root configuration", and a pre-commit hook running it fails every commit until the worktrees are gone. ESLint, Prettier, knip, and a tsconfig `include` walk the same tree.
9
+ - **Agent worktrees branch from the default branch.** Unless `worktree.baseRef` is `"head"`, a subagent asked to build on a feature branch starts from `main` without that branch's commits, and its work comes back as merge conflicts.
10
+
11
+ Two offers follow. Make them only where Claude Code is in use: a `.claude/` directory exists, or the owner enabled Claude Code in this run. Each is offered on its own, and the owner's answer to one decides nothing about the other.
12
+
13
+ ## P1: ignore the worktree directory
14
+
15
+ **Covered when** `git check-ignore -q .claude/worktrees/` succeeds, and each tool config listed below that the repository has already excludes `.claude/worktrees`. A rule on a parent directory counts. Where that rule is `.claude/` whole, it also ignores `.claude/skills`, which `doctor` reports as `ignored-bridge`; that is `repair`'s, not this offer's.
16
+
17
+ Offer each missing line as its own item, naming the file and showing the line:
18
+
19
+ | File | Line to add |
20
+ | --- | --- |
21
+ | `.gitignore` | `.claude/worktrees/` |
22
+ | `biome.json` or `biome.jsonc` | `"!**/.claude/worktrees"` as an element of `files.includes`; where `files.includes` is absent, `"files": { "includes": ["**", "!**/.claude/worktrees"] }` |
23
+ | `.eslintignore` | `**/.claude/worktrees` |
24
+ | `eslint.config.*` (flat config) | `"**/.claude/worktrees/**"` in a global `ignores` entry |
25
+ | `.prettierignore` | `**/.claude/worktrees` |
26
+ | `knip.json` or `knip.jsonc` | `"**/.claude/worktrees/**"` in `ignore` |
27
+ | `tsconfig.json` whose `include` reaches the repository root | `"**/.claude/worktrees"` in `exclude` |
28
+
29
+ Look for each file; offer only for the files that exist. Biome is the confirmed failure, so lead with it where it is present. A tool set to read `.gitignore`, such as Biome with `vcs.useIgnoreFile`, is still offered its own line: whether it then skips a nested config in an ignored directory is not documented. Say so.
30
+
31
+ A tsconfig whose `include` names only `src` never reaches `.claude/`, so it is covered and needs nothing.
32
+
33
+ **A tsconfig `exclude` replaces the default.** With no `exclude`, TypeScript excludes `node_modules` and the `outDir` by default, and writing an `exclude` drops that default. Where the file has none, offer `["node_modules", "**/.claude/worktrees"]` and name the trade, rather than a one-element list.
34
+
35
+ ## P2: set `worktree.baseRef` to `"head"`
36
+
37
+ **Covered when** the project's `.claude/settings.json` sets `worktree.baseRef` to either value. An explicit `"fresh"` is the owner's answer; offer nothing and say so.
38
+
39
+ Explain the trade-off before asking, in about these words:
40
+
41
+ > Claude Code branches every agent worktree from the repository's default branch on the remote unless `worktree.baseRef` is `"head"`. The default suits agents given tasks unrelated to what you are working on: each starts from a clean tree. It surprises anyone working on a feature branch: an agent asked to build on it starts from `main`, misses its commits, and its work comes back in conflict. `"head"` branches from your current `HEAD` instead, unpushed commits included.
42
+
43
+ Then offer the setting, merged into `.claude/settings.json`:
44
+
45
+ ```json
46
+ {
47
+ "worktree": {
48
+ "baseRef": "head"
49
+ }
50
+ }
51
+ ```
52
+
53
+ The setting accepts only those two values, not a branch name. Write it in the project's `.claude/settings.json`, which is committed, so everyone who clones the repository gets the same base. Where the owner wants it for themselves only, name `.claude/settings.local.json` instead and write there on their approval.
54
+
55
+ ## Writing
56
+
57
+ Edit each file in place, as the rule in the skill says: add the one line, element, or key, and leave every other byte as it was. Create `.gitignore` or `.claude/settings.json` when it is missing; that is still an approved write, so it is offered first like any other.
58
+
59
+ A decline writes nothing. `doctor` reports what is still missing as `worktrees-untracked`, `worktrees-scanned`, and `worktree-base-unset`, so the owner can come back to it.
@@ -51,7 +51,7 @@ Offer this repository's `AGENTS.md` as the alternative, and name what each one b
51
51
 
52
52
  The project file is the right pick for one reason and it is worth stating: a team's agents read the repository, not the maintainer's home directory. Where the owner wants the guidance to reach contributors, `AGENTS.md` is the only lever, and the duplicate copy is what that costs.
53
53
 
54
- This skill writes the root `AGENTS.md` and nothing else, so a global placement is **handed over, not made**: give the text and the path, say it goes at the end of that file, and stop there.
54
+ Ask which of the two the owner wants, leading with the global file. Where they pick it, write the text at the end of `~/.agents/AGENTS.md` on that yes, as step 5 of the skill says; never without it.
55
55
 
56
56
  ## Do not edit it
57
57
 
@@ -49,8 +49,8 @@ Offer this repository's `AGENTS.md` as the alternative, and name what each one b
49
49
  | the owner's global file | every repository they open, themselves only | one copy, and nothing to keep in step |
50
50
  | this repository's `AGENTS.md` | everyone who clones it, and any agent CI runs | a copy per repository, and a second copy in context for anyone who already has it globally |
51
51
 
52
- A global placement is **handed over, not made**: give the text and the path, say it goes at the end
53
- of that file, and stop there.
52
+ Ask which of the two the owner wants, leading with the global file. Where they pick it, write the
53
+ text at the end of `~/.agents/AGENTS.md` on that yes, as step 5 of the skill says; never without it.
54
54
 
55
55
  ## Do not edit it
56
56
 
@@ -0,0 +1,9 @@
1
+ # Superseded wordings: References as links
2
+
3
+ Every wording this addition has retired, newest first, each exactly as it was offered. Read this
4
+ file when a `## References as links` section is already present and reads as covered; it is what
5
+ the section in front of you is compared against.
6
+
7
+ Nothing here is ever offered. The text to offer is in `references-as-links.md`.
8
+
9
+ None yet. This addition still offers its first wording.
@@ -0,0 +1,76 @@
1
+ # Addition: References as links
2
+
3
+ ## Covered when
4
+
5
+ The merged view already tells the agent **to write an issue, pull request, or commit it mentions as
6
+ a link the user can follow, not as a bare number**. Any of these counts:
7
+
8
+ - a rule to write references to issues, pull requests, or commits as Markdown links or full URLs, under any heading
9
+ - a rule that a reference the agent puts to the user names its repository and links to the item's page
10
+
11
+ A convention for commit messages or pull request bodies — "close the issue with `Closes #12`" — is
12
+ not coverage: it governs text GitHub renders, not what the agent puts to the user. Neither is a rule
13
+ to qualify a number with its repository alone, such as `owner/repo#12`, which still leads nowhere
14
+ in a terminal. Neither is a rule that appears only in a skill body — this addition is for the
15
+ always-loaded file.
16
+
17
+ ## Stale when
18
+
19
+ Compare the `## References as links` section already in the file against
20
+ `references-as-links.history.md` by the procedure in step 3 of the skill, with the text below as the
21
+ current text.
22
+
23
+ `references-as-links.history.md` holds no retired wording yet. Until it does, a section that is not
24
+ already current is compared against the text below, standing in for a retired wording: both answers
25
+ yes is this text edited, and gets the replacement offer; both no is the owner's own; a disagreement
26
+ you cannot tell. The paragraphs a replacement would remove are the ones the text below does not
27
+ contain.
28
+
29
+ A section whose example link names a different repository or item is still this text edited when
30
+ its sentences survive: the example is part of the wording, not the owner's own content.
31
+
32
+ Where you cannot tell, the third answer needs a harness that scores this addition's wording, and none
33
+ does: `eval-delegation` scores Delegation's and `eval-list-identifiers` scores List identifiers', and
34
+ neither covers this one. Put two answers, not three, and say settling it by measurement would need a
35
+ harness that does not exist yet.
36
+
37
+ ## Offer this text verbatim
38
+
39
+ ```markdown
40
+ ## References as links
41
+
42
+ Write each issue, pull request, or commit you mention as a Markdown link to its page, such as
43
+ [cyber-agentkit#222](https://github.com/cyber-uni/cyber-agentkit/pull/222), not a bare `#222`. A bare
44
+ number is a link only on GitHub itself; in a terminal or a chat it leads nowhere, and across
45
+ repositories it names the wrong one.
46
+ ```
47
+
48
+ ## Where it belongs
49
+
50
+ **Recommend the owner's own global instruction file, not this repository's `AGENTS.md`.**
51
+
52
+ The text says how to present a reference to the user, which holds in every repository the owner
53
+ opens, so the global file, `~/.agents/AGENTS.md`, is its one home.
54
+
55
+ Offer this repository's `AGENTS.md` as the alternative, and name what each one buys:
56
+
57
+ | Destination | Reaches | Costs |
58
+ | --- | --- | --- |
59
+ | the owner's global file | every repository they open, themselves only | one copy, and nothing to keep in step |
60
+ | this repository's `AGENTS.md` | everyone who clones it, and any agent CI runs | a copy per repository, and a second copy in context for anyone who already has it globally |
61
+
62
+ Ask which of the two the owner wants, leading with the global file. Where they pick it, write the
63
+ text at the end of `~/.agents/AGENTS.md` on that yes, as step 5 of the skill says; never without it.
64
+
65
+ ## Do not edit it
66
+
67
+ The wording is fixed. In particular, do not swap the example link for one in this repository — the
68
+ section has to hold in every repository it is read in, and an example naming one of them reads as a
69
+ rule about that one. Offer it as written or not at all.
70
+
71
+ If the text is ever revised, the same change must do two things:
72
+
73
+ - append the outgoing wording to `references-as-links.history.md`, newest first, exactly as it was offered;
74
+ - add scenarios for the **shape of that revision** and pass the gate against the new pair.
75
+
76
+ Where the owner picks this repository over their global file, place it at the end of their prose, outside the `buddy-agent-harness` managed region.
@@ -58,8 +58,8 @@ Offer this repository's `AGENTS.md` as the alternative, and name what each one b
58
58
  | the owner's global file | every repository they open, themselves only | one copy, and nothing to keep in step |
59
59
  | this repository's `AGENTS.md` | everyone who clones it, and any agent CI runs | a copy per repository, and a second copy in context for anyone who already has it globally |
60
60
 
61
- A global placement is **handed over, not made**: give the text and the path, say it goes at the end
62
- of that file, and stop there.
61
+ Ask which of the two the owner wants, leading with the global file. Where they pick it, write the
62
+ text at the end of `~/.agents/AGENTS.md` on that yes, as step 5 of the skill says; never without it.
63
63
 
64
64
  ## Do not edit it
65
65