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": "buddy-agent-harness",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Initialize standards-based agent configuration across agent harnesses",
5
5
  "author": {
6
6
  "name": "repobuddy"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buddy-agent-harness",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Initialize standards-based agent configuration across agent harnesses",
5
5
  "author": {
6
6
  "name": "repobuddy"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "buddy-agent-harness",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "Initialize standards-based agent configuration across agent harnesses",
5
5
  "author": {
6
6
  "name": "repobuddy"
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # buddy-agent-harness
2
2
 
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 840d2dc: `enhance` now asks, for each addition, whether to write it to your global `~/.agents/AGENTS.md` or to the repository's `AGENTS.md`. It leads with the destination the addition recommends. If you pick the global file, it writes the section at the end of `~/.agents/AGENTS.md`, creating the file if needed, instead of handing you the text. A retired wording in `~/.agents/AGENTS.md` is offered the current text in its place, and replaced on your yes. Steps that bridge a harness's own user-scope file, and a global copy kept in such a file, are still handed over.
8
+
9
+ ## 1.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 3d86bc2: Account for the git worktrees Claude Code creates under `.claude/worktrees/`, inside the repository.
14
+
15
+ The `init-buddy-agent-harness` and `enhance` skills now offer two settings, each on its own and written only on approval: ignoring `.claude/worktrees/` in `.gitignore` and in each tree-scanning tool's config the repository has (Biome, ESLint, Prettier, knip, tsconfig), and setting `worktree.baseRef` to `"head"` in `.claude/settings.json`, with the trade-off explained first. Each worktree is a whole checkout, so Biome in the main checkout stops on its nested root configuration, and without `"head"` an agent asked to build on a feature branch starts from the default branch.
16
+
17
+ `doctor` reports what is missing in a repository with a `.claude/` directory: `worktrees-untracked` for the `.gitignore` rule, `worktrees-scanned` for a `biome.json` that does not exclude the directory, and `worktree-base-unset` for a `.claude/settings.json` that leaves `worktree.baseRef` unset. An explicit `"fresh"` is the owner's choice and is not reported.
18
+ - 8373121: The `enhance` skill now offers a fourth addition, `## References as links`. It tells the agent to write each issue, pull request, or commit it mentions as a Markdown link to its page rather than a bare `#222`, which is a link only on GitHub itself and names the wrong repository when the agent works across several.
19
+
20
+ It is gated like the other three. The skill offers it only where the merged instructions do not already cover the subject, recommends the owner's global instruction file over the repository's `AGENTS.md`, and writes nothing without approval. Its history file starts empty, so a section already in a file is compared against the current text, and no harness scores this wording yet, so where the skill cannot tell whose a section is, it offers two answers rather than three.
21
+
22
+ ### Patch Changes
23
+
24
+ - ce2b780: The `doctor-buddy-agent-harness` skill now lists the outcomes it is done when, so its evals can check them.
25
+ - 8588ad8: The shipped skill descriptions (`doctor-buddy-agent-harness`, `enhance`, `init-buddy-agent-harness`, `repair`) now open by saying what the skill does instead of "Use this skill when". Every trigger phrase is kept.
26
+ - 4c76524: The `repair` skill no longer says that only the instruction, configuration, non-standard, and agent-worktree families name a skill in `help`. Four MCP findings name `repair` too: `mcp-unprojected`, `mcp-undeclared`, `mcp-diverged-target`, and `mcp-diverged-golden`. Its README now lists the MCP drift it corrects.
27
+
3
28
  ## 1.1.0
4
29
 
5
30
  ### Minor Changes
package/dist/cli.mjs CHANGED
@@ -14110,7 +14110,7 @@ function gitIgnores(root, path) {
14110
14110
  }
14111
14111
  /** One answer per discovery, so a run resolving many names reads each `package.json` once. */
14112
14112
  const found = /* @__PURE__ */ new WeakMap();
14113
- function readJson$2(path) {
14113
+ function readJson$3(path) {
14114
14114
  try {
14115
14115
  return JSON.parse(readFileSync(path, "utf8"));
14116
14116
  } catch {
@@ -14121,7 +14121,7 @@ function declared(top, folders) {
14121
14121
  const plugins = [];
14122
14122
  for (const folder of folders) {
14123
14123
  const manifestPath = join(top, ...folder.split("/"), "package.json");
14124
- const manifest = readJson$2(manifestPath);
14124
+ const manifest = readJson$3(manifestPath);
14125
14125
  for (const pkg of declaredDependencies(manifest)) {
14126
14126
  const dir = packageDir(pkg, manifestPath);
14127
14127
  const plugin = dir && pluginManifestName(dir);
@@ -17752,7 +17752,7 @@ function serializeCatalog(catalog) {
17752
17752
  }
17753
17753
  //#endregion
17754
17754
  //#region src/dep-plugins/resolve.ts
17755
- function readJson$1(path) {
17755
+ function readJson$2(path) {
17756
17756
  try {
17757
17757
  return JSON.parse(readFileSync(path, "utf8"));
17758
17758
  } catch {
@@ -17767,7 +17767,7 @@ function readDepPlugin(pkg, fromManifest) {
17767
17767
  package: pkg,
17768
17768
  reason: "unresolved"
17769
17769
  };
17770
- const manifest = readJson$1(join(dir, "plugin.json"));
17770
+ const manifest = readJson$2(join(dir, "plugin.json"));
17771
17771
  if (!manifest || typeof manifest !== "object") return {
17772
17772
  ok: false,
17773
17773
  package: pkg,
@@ -17780,7 +17780,7 @@ function readDepPlugin(pkg, fromManifest) {
17780
17780
  package: pkg,
17781
17781
  reason: "unnamed"
17782
17782
  };
17783
- const installed = readJson$1(join(dir, "package.json"));
17783
+ const installed = readJson$2(join(dir, "package.json"));
17784
17784
  const version = typeof installed?.version === "string" ? installed.version : void 0;
17785
17785
  if (!version) return {
17786
17786
  ok: false,
@@ -17873,7 +17873,7 @@ function writeCatalog(root, catalog) {
17873
17873
  //#endregion
17874
17874
  //#region src/dep-plugins/harness-plugins.ts
17875
17875
  const COPILOT_LIMITATION = "Copilot CLI rejects an npm marketplace source, so it cannot install from this catalog. It needs a path-sourced catalog, which cannot reach node_modules from a subdirectory.";
17876
- function readJson(path) {
17876
+ function readJson$1(path) {
17877
17877
  try {
17878
17878
  return JSON.parse(readFileSync(path, "utf8"));
17879
17879
  } catch {
@@ -17891,7 +17891,7 @@ function claudeConfigDir(home, env = process.env) {
17891
17891
  return env["CLAUDE_CONFIG_DIR"] || join(home, ".claude");
17892
17892
  }
17893
17893
  function readClaudeState(configDir) {
17894
- const installedFile = readJson(join(configDir, "plugins", "installed_plugins.json"));
17894
+ const installedFile = readJson$1(join(configDir, "plugins", "installed_plugins.json"));
17895
17895
  const installed = [];
17896
17896
  for (const [id, entries] of Object.entries(installedFile?.plugins ?? {})) {
17897
17897
  if (!Array.isArray(entries)) continue;
@@ -17914,7 +17914,7 @@ function readClaudeState(configDir) {
17914
17914
  });
17915
17915
  }
17916
17916
  }
17917
- const knownFile = readJson(join(configDir, "plugins", "known_marketplaces.json"));
17917
+ const knownFile = readJson$1(join(configDir, "plugins", "known_marketplaces.json"));
17918
17918
  const marketplaces = [];
17919
17919
  for (const [name, value] of Object.entries(knownFile ?? {})) marketplaces.push({
17920
17920
  name,
@@ -18176,6 +18176,7 @@ const initSkillInvocation = `/buddy-agent-harness:init-buddy-agent-harness`;
18176
18176
  */
18177
18177
  const pnpmSkillRef = (invocation) => `\`${invocation}\` (pnpm install: \`pnpm-${commandInvocation}-${invocation.slice(invocation.indexOf(":") + 1)}\`)`;
18178
18178
  const initSkillRef = pnpmSkillRef(initSkillInvocation);
18179
+ const enhanceSkillRef = pnpmSkillRef("/buddy-agent-harness:enhance");
18179
18180
  const repairSkillRef = pnpmSkillRef(repairSkillInvocation);
18180
18181
  /** Where the user authors the golden MCP server set, named in every MCP repair that points at it. */
18181
18182
  const goldenSet = ".agents/buddy-agent-harness/mcp.toml";
@@ -18541,6 +18542,35 @@ const nonstandardTable = {
18541
18542
  }
18542
18543
  };
18543
18544
  repairsOf(nonstandardTable);
18545
+ /** Who offers every worktree repair, named the same way in each row. */
18546
+ const worktreeOffer = `${initSkillRef} offers it, or ${enhanceSkillRef} where the repository already has an AGENTS.md`;
18547
+ const worktreeTable = {
18548
+ "worktrees-untracked": {
18549
+ detail: ".claude/worktrees/ is not git-ignored, so every agent worktree Claude Code creates there shows up as untracked in git status",
18550
+ repair: ({ file }) => ({
18551
+ command: "",
18552
+ instruction: `add \`.claude/worktrees/\` to ${file} — ${worktreeOffer}`
18553
+ }),
18554
+ skillRepair: () => `run ${initSkillRef} or ${enhanceSkillRef}, which offers the .gitignore line`
18555
+ },
18556
+ "worktrees-scanned": {
18557
+ detail: "this config does not exclude .claude/worktrees, so the tool walks into each agent worktree, a whole checkout with its own config, and Biome stops on the nested root configuration",
18558
+ repair: ({ file }) => ({
18559
+ command: "",
18560
+ instruction: `add \`"!**/.claude/worktrees"\` to \`files.includes\` in ${file} — ${worktreeOffer}`
18561
+ }),
18562
+ skillRepair: () => `run ${initSkillRef} or ${enhanceSkillRef}, which offers the exclusion`
18563
+ },
18564
+ "worktree-base-unset": {
18565
+ detail: "worktree.baseRef is unset, so agent worktrees branch from the default branch rather than the current HEAD — work on a feature branch starts without its commits",
18566
+ repair: ({ file }) => ({
18567
+ command: "",
18568
+ instruction: `decide whether agent worktrees should branch from HEAD, and if so set \`"worktree": { "baseRef": "head" }\` in ${file} — ${worktreeOffer}`
18569
+ }),
18570
+ skillRepair: () => `run ${initSkillRef} or ${enhanceSkillRef}, which explains the trade-off and offers the setting`
18571
+ }
18572
+ };
18573
+ repairsOf(worktreeTable);
18544
18574
  /**
18545
18575
  * Annotated over the whole union rather than inferred, so an added problem fails to compile until
18546
18576
  * its section carries it.
@@ -18551,7 +18581,8 @@ const doctorTable = {
18551
18581
  ...globalInstructionTable,
18552
18582
  ...configurationTable,
18553
18583
  ...mcpTable,
18554
- ...nonstandardTable
18584
+ ...nonstandardTable,
18585
+ ...worktreeTable
18555
18586
  };
18556
18587
  repairsOf(doctorTable);
18557
18588
  /** The repair for one problem. Total by construction: the table is keyed by the union. */
@@ -20340,6 +20371,43 @@ function diagnoseNonstandard({ root, cli }) {
20340
20371
  }
20341
20372
  return findings.sort((left, right) => left.path.localeCompare(right.path));
20342
20373
  }
20374
+ const biomeConfigs = ["biome.json", "biome.jsonc"];
20375
+ const claudeSettings = ".claude/settings.json";
20376
+ /** `undefined` when the file is missing or does not parse; either way Claude Code reads no base from it. */
20377
+ function readJson(path) {
20378
+ try {
20379
+ return JSON.parse(readFileSync(path, "utf8"));
20380
+ } catch {
20381
+ return;
20382
+ }
20383
+ }
20384
+ /**
20385
+ * Checked only where `.claude/` exists, the sign the repository is worked in with Claude Code.
20386
+ * Biome is the one tool checked: it is the confirmed failure, and the others are offered by the
20387
+ * skills without a finding.
20388
+ */
20389
+ function diagnoseWorktrees({ root, git, cli }) {
20390
+ if (!existsSync(join(root, ".claude"))) return [];
20391
+ const findings = [];
20392
+ const add = (path, problem) => {
20393
+ const { detail, repair } = repairFor(problem);
20394
+ findings.push({
20395
+ path,
20396
+ problem,
20397
+ detail,
20398
+ repair: repair({ file: path }, cli)
20399
+ });
20400
+ };
20401
+ if (git.isRepository() && !git.isIgnored(".claude/worktrees/")) add(".gitignore", "worktrees-untracked");
20402
+ for (const config of biomeConfigs) {
20403
+ const path = join(root, config);
20404
+ if (existsSync(path) && !readFileSync(path, "utf8").includes(".claude/worktrees")) add(config, "worktrees-scanned");
20405
+ }
20406
+ const settings = readJson(join(root, claudeSettings));
20407
+ const worktree = isRecord(settings) ? settings["worktree"] : void 0;
20408
+ if (!isRecord(worktree) || worktree["baseRef"] === void 0) add(claudeSettings, "worktree-base-unset");
20409
+ return findings;
20410
+ }
20343
20411
  //#endregion
20344
20412
  //#region ../../node_modules/.pnpm/cyber-agentkit@2.2.0_clibuilder@12.3.0_js-yaml@4.3.2_/node_modules/cyber-agentkit/dist/commands.js
20345
20413
  /**
@@ -22048,6 +22116,10 @@ var GitBridgeState = class {
22048
22116
  this.root = root;
22049
22117
  this.repoRootPrefix = git(root, ["rev-parse", "--show-prefix"])?.trim();
22050
22118
  }
22119
+ /** Whether `root` is inside a git work tree at all; a check that needs git's answer skips when not. */
22120
+ isRepository() {
22121
+ return this.repoRootPrefix !== void 0;
22122
+ }
22051
22123
  /** The skip-worktree bit is a hint some checkouts clear, so it is verified rather than assumed. */
22052
22124
  trackingOf(path) {
22053
22125
  if (this.repoRootPrefix === void 0) return "untracked";
@@ -22349,6 +22421,11 @@ async function diagnoseReport(args) {
22349
22421
  ...diagnoseNonstandard({
22350
22422
  root,
22351
22423
  cli: commandInvocation
22424
+ }),
22425
+ ...diagnoseWorktrees({
22426
+ root,
22427
+ git,
22428
+ cli: commandInvocation
22352
22429
  })
22353
22430
  ];
22354
22431
  const { layers: rows } = listReferences(await referenceLayers({
package/dist/index.d.mts CHANGED
@@ -240,8 +240,13 @@ type NonstandardProblem = "nonstandard-instructions" | "nonstandard-rule" | "non
240
240
  type InstructionProblem = "no-instructions" | "instructions-missing" | "instructions-unbridged" | "instructions-unreadable" | "instructions-shadowing" | "instructions-superseded";
241
241
  /** Every way a harness's user-scope instruction file fails to load `~/.agents/AGENTS.md`. */
242
242
  type GlobalInstructionProblem = "global-instructions-missing" | "global-instructions-unbridged" | "global-instructions-overridden" | "global-instructions-emptied";
243
+ /**
244
+ * What a repository lacks for the git worktrees Claude Code creates under `.claude/worktrees/`;
245
+ * each is an offer `init` and `enhance` make, never a fault in a file the owner wrote.
246
+ */
247
+ type WorktreeProblem = "worktrees-untracked" | "worktrees-scanned" | "worktree-base-unset";
243
248
  /** Everything `doctor` can report against, across every section. */
244
- type DoctorProblem = BridgeProblem | InstructionProblem | GlobalInstructionProblem | ConfigurationFault | McpProblem | NonstandardProblem;
249
+ type DoctorProblem = BridgeProblem | InstructionProblem | GlobalInstructionProblem | ConfigurationFault | McpProblem | NonstandardProblem | WorktreeProblem;
245
250
  /** Alias kept for callers that name the whole set rather than one section. */
246
251
  type ConfigurationProblem = DoctorProblem;
247
252
  type RepairAction = {
@@ -271,7 +276,7 @@ export declare const globalInstructionRepairs: readonly Repair[];
271
276
  export declare const doctorRepairs: readonly Repair[];
272
277
  export declare const doctorSkill: {
273
278
  readonly name: "doctor-buddy-agent-harness";
274
- readonly description: "Use this skill when a repository loads no project skills, when skills are missing after a clone, when a harness appears to be ignoring AGENTS.md, or when checking whether the agent configuration bridges into .claude/skills and the other harness files still resolve.";
279
+ readonly description: "Checks 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.";
275
280
  };
276
281
  /**
277
282
  * The shipped `doctor-buddy-agent-harness` skill; the finding tables live in the reference pages
@@ -293,6 +298,8 @@ declare class GitBridgeState {
293
298
  /** `''` at the top, `undefined` outside a repository. */
294
299
  private readonly repoRootPrefix;
295
300
  constructor(root: string);
301
+ /** Whether `root` is inside a git work tree at all; a check that needs git's answer skips when not. */
302
+ isRepository(): boolean;
296
303
  /** The skip-worktree bit is a hint some checkouts clear, so it is verified rather than assumed. */
297
304
  trackingOf(path: string): TrackingState;
298
305
  /**
@@ -655,5 +662,5 @@ type ReferenceLayerOptions = Omit<ReferenceLayerOptions$1, "plugin"> & {
655
662
  export declare function referenceLayers({ packageRoot, ...options }: ReferenceLayerOptions): Promise<ReferenceLayers>;
656
663
  export declare const referenceCommand: cli$1.Command;
657
664
  //#endregion
658
- export { type BridgeFinding, type BridgeKind, type BridgeProblem, type BridgeReport, type BridgeStatus, type ConfigurationFault, type ConfigurationProblem, type DiagnoseMcpOptions, type DiagnoseOptions, type DiagnoseResult, type DivergenceDirection, type DivergenceReport, type DoctorProblem, type DoctorReference, type DoctorReport, type GlobalInstructionKind, type GlobalInstructionProblem, type GlobalInstructionReport, type GlobalInstructionStatus, type GovernanceDocument, type GovernanceEntry, type GovernanceLayer, type GovernanceListReport, type GovernanceScope, type GovernanceShowReport, type Harness, type HarnessName, type HarnessScope, type HarnessScopeName, type InitializeOptions, type InitializeResult, type InstructionBridge, type InstructionKind, type InstructionProblem, type InstructionReport, type InstructionStatus, type LayerOptions, type ListMcpServersOptions, type MatchKind, type McpConfig, type McpDirection, type McpField, type McpProblem, type McpServer, type McpServerEntry, type McpTransport, type ReferenceLayer, type ReferenceLayerOptions, type ReferenceListLayerRow, type ReferenceListReport, type ReferenceListRow, type ReferenceListing, type ReferenceLoadEntry, type ReferenceName, type ReferenceSearchReport, type ReferenceStatus, type ReferenceTier, type Repair, type ResolveOptions, type ResolvedReference, type SearchMatch, listReferences, parseReferenceName, resolveReference, searchReferences };
665
+ export { type BridgeFinding, type BridgeKind, type BridgeProblem, type BridgeReport, type BridgeStatus, type ConfigurationFault, type ConfigurationProblem, type DiagnoseMcpOptions, type DiagnoseOptions, type DiagnoseResult, type DivergenceDirection, type DivergenceReport, type DoctorProblem, type DoctorReference, type DoctorReport, type GlobalInstructionKind, type GlobalInstructionProblem, type GlobalInstructionReport, type GlobalInstructionStatus, type GovernanceDocument, type GovernanceEntry, type GovernanceLayer, type GovernanceListReport, type GovernanceScope, type GovernanceShowReport, type Harness, type HarnessName, type HarnessScope, type HarnessScopeName, type InitializeOptions, type InitializeResult, type InstructionBridge, type InstructionKind, type InstructionProblem, type InstructionReport, type InstructionStatus, type LayerOptions, type ListMcpServersOptions, type MatchKind, type McpConfig, type McpDirection, type McpField, type McpProblem, type McpServer, type McpServerEntry, type McpTransport, type ReferenceLayer, type ReferenceLayerOptions, type ReferenceListLayerRow, type ReferenceListReport, type ReferenceListRow, type ReferenceListing, type ReferenceLoadEntry, type ReferenceName, type ReferenceSearchReport, type ReferenceStatus, type ReferenceTier, type Repair, type ResolveOptions, type ResolvedReference, type SearchMatch, type WorktreeProblem, listReferences, parseReferenceName, resolveReference, searchReferences };
659
666
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/cli.ts","../src/harness-registry/instruction-bridge.ts","../src/diagnose-mcp/mcp-model.ts","../src/mcp-dialects/mcp-dialects.ts","../src/harness-registry/mcp-config.ts","../src/harness-registry/nonstandard-artifact.ts","../src/harness-registry/harness-registry.ts","../src/diagnose-bridges/diagnose-global-instructions.ts","../src/diagnose-bridges/diagnose-instructions.ts","../src/diagnose-bridges/locator.ts","../src/diagnose-bridges/doctor-guidance.ts","../src/diagnose-bridges/git-bridge-state.ts","../src/diagnose-bridges/diagnose-bridges.ts","../src/diagnose-configuration/diagnose-configuration.ts","../src/diagnose-bridges/doctor.command.ts","../src/diagnose-mcp/diagnose-mcp.ts","../src/diagnose-mcp/mcp-baseline.ts","../src/diagnose-mcp/mcp-sources.ts","../src/governance-overrides/governance-overrides.ts","../src/governance-overrides/governance.command.ts","../src/initialize-harnesses/init.command.ts","../src/skill-projection/skill-projection.ts","../src/initialize-harnesses/initialize-harnesses.ts","../src/mcp-inventory/mcp-inventory.ts","../src/references/references.ts"],"mappings":";;;;;;;;wBAsEsB,IAAI,iBAAiB;;;;;;;;KCjE/B;;EAGT;;EAEA;;EAEA;;;EAIA;;EAEA;;EAEA;;;EAIA;;EAEA;;;;KCzBS;;KAGA;EACX,YAAY;EACZ;EACA;EACA,MAAM,SAAS;EACf;EACA,UAAU,SAAS;EACnB;EACA;EACA;EACA;;;cAIY;KAaD,mBAAmB;;;KC5BnB;;;KCIA;;EAEX;;EAEA;EACA;;EAEA,SAAS;;EAET;;;;;;;;;KCXW;KAeA;;EAEX;;EAEA;EACA,MAAM;;;;KClBK;;KAiBA;;KAGA;;EAEX;;EAEA;;;;;EAKA,oBAAoB;;EAEpB;;;;;EAKA;;;;;EAKA;;EAEA,YAAY;;EAEZ,uBAAuB;;KAGZ;EACX,MAAM;;EAEN,SAAS;;;;;EAKT,OAAO;;EAEP,aAAa;;;;;;qBA6BD,0BAA0B;;;;KCjF3B;;;;;;KAMA;KAEA;EACX,SAAS;;;;;;EAMT;EACA,MAAM;EACN,QAAQ;;;;;;;;wBAkGO,2BACf,cACA,oBAAoB,eACpB,aACA,MAAK,OAAO,YACZ;EACI,oBAAoB;EAA2B,UAAU;;;;;KCzHlD;;;;;KAKA;KAEA;EACX,SAAS;;EAET;EACA,MAAM;EACN,QAAQ;;;;;;wBA8EO,qBACf,cACA,oBAAoB,WACpB;EACI,cAAc;E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AwB;;;KCrSpD,wBAAwB,KAAK;;EAExC;;;wBAIe,kBACf,gBACG,WACD,wBAAwB,QAAQ;qBAItB,kBAAkB,MAAI"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/cli.ts","../src/harness-registry/instruction-bridge.ts","../src/diagnose-mcp/mcp-model.ts","../src/mcp-dialects/mcp-dialects.ts","../src/harness-registry/mcp-config.ts","../src/harness-registry/nonstandard-artifact.ts","../src/harness-registry/harness-registry.ts","../src/diagnose-bridges/diagnose-global-instructions.ts","../src/diagnose-bridges/diagnose-instructions.ts","../src/diagnose-bridges/locator.ts","../src/diagnose-bridges/doctor-guidance.ts","../src/diagnose-bridges/git-bridge-state.ts","../src/diagnose-bridges/diagnose-bridges.ts","../src/diagnose-configuration/diagnose-configuration.ts","../src/diagnose-bridges/doctor.command.ts","../src/diagnose-mcp/diagnose-mcp.ts","../src/diagnose-mcp/mcp-baseline.ts","../src/diagnose-mcp/mcp-sources.ts","../src/governance-overrides/governance-overrides.ts","../src/governance-overrides/governance.command.ts","../src/initialize-harnesses/init.command.ts","../src/skill-projection/skill-projection.ts","../src/initialize-harnesses/initialize-harnesses.ts","../src/mcp-inventory/mcp-inventory.ts","../src/references/references.ts"],"mappings":";;;;;;;;wBAsEsB,IAAI,iBAAiB;;;;;;;;KCjE/B;;EAGT;;EAEA;;EAEA;;;EAIA;;EAEA;;EAEA;;;EAIA;;EAEA;;;;KCzBS;;KAGA;EACX,YAAY;EACZ;EACA;EACA,MAAM,SAAS;EACf;EACA,UAAU,SAAS;EACnB;EACA;EACA;EACA;;;cAIY;KAaD,mBAAmB;;;KC5BnB;;;KCIA;;EAEX;;EAEA;EACA;;EAEA,SAAS;;EAET;;;;;;;;;KCXW;KAeA;;EAEX;;EAEA;EACA,MAAM;;;;KClBK;;KAiBA;;KAGA;;EAEX;;EAEA;;;;;EAKA,oBAAoB;;EAEpB;;;;;EAKA;;;;;EAKA;;EAEA,YAAY;;EAEZ,uBAAuB;;KAGZ;EACX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ACA,QAAQ;;KAEG;EACX;EACA,WAAW;EACX,QAAQ;EACR,QAAQ;;;;;EAKR,SAAS;;EAET;IAAc,MAAM;IAAa,YAAY;;EAC7C;;;;;;EAMA;EACA;;wBAQe,sBACf,MACA,WAAW,WACX,MACA,SACE,oBAAoB;;;;;;;KC7BX,iBAAiB;;KA6DjB;EACX,SAAS;EACT,OAAO;;EAEP;;EAEA;EACA,WAAW;;EAEX;;EAEA;;EAEA;EACA;;EAEA;;KAGW;;EAEX;;EAEA;;;;;EAKA,MAAM,SAAS;;EAEf,WAAW,OAAO;;;;;;;wBAuMH,eAAe,SAAS,wBAAwB;;;KCrSpD,wBAAwB,KAAK;;EAExC;;;wBAIe,kBACf,gBACG,WACD,wBAAwB,QAAQ;qBAItB,kBAAkB,MAAI"}
package/dist/index.mjs CHANGED
@@ -371,7 +371,7 @@ function serializeCatalog(catalog) {
371
371
  }
372
372
  //#endregion
373
373
  //#region src/dep-plugins/resolve.ts
374
- function readJson$1(path) {
374
+ function readJson$2(path) {
375
375
  try {
376
376
  return JSON.parse(readFileSync(path, "utf8"));
377
377
  } catch {
@@ -386,7 +386,7 @@ function readDepPlugin(pkg, fromManifest) {
386
386
  package: pkg,
387
387
  reason: "unresolved"
388
388
  };
389
- const manifest = readJson$1(join(dir, "plugin.json"));
389
+ const manifest = readJson$2(join(dir, "plugin.json"));
390
390
  if (!manifest || typeof manifest !== "object") return {
391
391
  ok: false,
392
392
  package: pkg,
@@ -399,7 +399,7 @@ function readDepPlugin(pkg, fromManifest) {
399
399
  package: pkg,
400
400
  reason: "unnamed"
401
401
  };
402
- const installed = readJson$1(join(dir, "package.json"));
402
+ const installed = readJson$2(join(dir, "package.json"));
403
403
  const version = typeof installed?.version === "string" ? installed.version : void 0;
404
404
  if (!version) return {
405
405
  ok: false,
@@ -492,7 +492,7 @@ function writeCatalog(root, catalog) {
492
492
  //#endregion
493
493
  //#region src/dep-plugins/harness-plugins.ts
494
494
  const COPILOT_LIMITATION = "Copilot CLI rejects an npm marketplace source, so it cannot install from this catalog. It needs a path-sourced catalog, which cannot reach node_modules from a subdirectory.";
495
- function readJson(path) {
495
+ function readJson$1(path) {
496
496
  try {
497
497
  return JSON.parse(readFileSync(path, "utf8"));
498
498
  } catch {
@@ -510,7 +510,7 @@ function claudeConfigDir(home, env = process.env) {
510
510
  return env["CLAUDE_CONFIG_DIR"] || join(home, ".claude");
511
511
  }
512
512
  function readClaudeState(configDir) {
513
- const installedFile = readJson(join(configDir, "plugins", "installed_plugins.json"));
513
+ const installedFile = readJson$1(join(configDir, "plugins", "installed_plugins.json"));
514
514
  const installed = [];
515
515
  for (const [id, entries] of Object.entries(installedFile?.plugins ?? {})) {
516
516
  if (!Array.isArray(entries)) continue;
@@ -533,7 +533,7 @@ function readClaudeState(configDir) {
533
533
  });
534
534
  }
535
535
  }
536
- const knownFile = readJson(join(configDir, "plugins", "known_marketplaces.json"));
536
+ const knownFile = readJson$1(join(configDir, "plugins", "known_marketplaces.json"));
537
537
  const marketplaces = [];
538
538
  for (const [name, value] of Object.entries(knownFile ?? {})) marketplaces.push({
539
539
  name,
@@ -804,6 +804,7 @@ const initSkillInvocation = `/buddy-agent-harness:init-buddy-agent-harness`;
804
804
  */
805
805
  const pnpmSkillRef = (invocation) => `\`${invocation}\` (pnpm install: \`pnpm-${commandInvocation}-${invocation.slice(invocation.indexOf(":") + 1)}\`)`;
806
806
  const initSkillRef = pnpmSkillRef(initSkillInvocation);
807
+ const enhanceSkillRef = pnpmSkillRef("/buddy-agent-harness:enhance");
807
808
  const repairSkillRef = pnpmSkillRef(repairSkillInvocation);
808
809
  /** Where the user authors the golden MCP server set, named in every MCP repair that points at it. */
809
810
  const goldenSet = ".agents/buddy-agent-harness/mcp.toml";
@@ -1169,6 +1170,35 @@ const nonstandardTable = {
1169
1170
  }
1170
1171
  };
1171
1172
  repairsOf(nonstandardTable);
1173
+ /** Who offers every worktree repair, named the same way in each row. */
1174
+ const worktreeOffer = `${initSkillRef} offers it, or ${enhanceSkillRef} where the repository already has an AGENTS.md`;
1175
+ const worktreeTable = {
1176
+ "worktrees-untracked": {
1177
+ detail: ".claude/worktrees/ is not git-ignored, so every agent worktree Claude Code creates there shows up as untracked in git status",
1178
+ repair: ({ file }) => ({
1179
+ command: "",
1180
+ instruction: `add \`.claude/worktrees/\` to ${file} — ${worktreeOffer}`
1181
+ }),
1182
+ skillRepair: () => `run ${initSkillRef} or ${enhanceSkillRef}, which offers the .gitignore line`
1183
+ },
1184
+ "worktrees-scanned": {
1185
+ detail: "this config does not exclude .claude/worktrees, so the tool walks into each agent worktree, a whole checkout with its own config, and Biome stops on the nested root configuration",
1186
+ repair: ({ file }) => ({
1187
+ command: "",
1188
+ instruction: `add \`"!**/.claude/worktrees"\` to \`files.includes\` in ${file} — ${worktreeOffer}`
1189
+ }),
1190
+ skillRepair: () => `run ${initSkillRef} or ${enhanceSkillRef}, which offers the exclusion`
1191
+ },
1192
+ "worktree-base-unset": {
1193
+ detail: "worktree.baseRef is unset, so agent worktrees branch from the default branch rather than the current HEAD — work on a feature branch starts without its commits",
1194
+ repair: ({ file }) => ({
1195
+ command: "",
1196
+ instruction: `decide whether agent worktrees should branch from HEAD, and if so set \`"worktree": { "baseRef": "head" }\` in ${file} — ${worktreeOffer}`
1197
+ }),
1198
+ skillRepair: () => `run ${initSkillRef} or ${enhanceSkillRef}, which explains the trade-off and offers the setting`
1199
+ }
1200
+ };
1201
+ repairsOf(worktreeTable);
1172
1202
  /**
1173
1203
  * Annotated over the whole union rather than inferred, so an added problem fails to compile until
1174
1204
  * its section carries it.
@@ -1179,7 +1209,8 @@ const doctorTable = {
1179
1209
  ...globalInstructionTable,
1180
1210
  ...configurationTable,
1181
1211
  ...mcpTable,
1182
- ...nonstandardTable
1212
+ ...nonstandardTable,
1213
+ ...worktreeTable
1183
1214
  };
1184
1215
  const doctorRepairs = repairsOf(doctorTable);
1185
1216
  /** The repair for one problem. Total by construction: the table is keyed by the union. */
@@ -1191,7 +1222,7 @@ function repairFor(problem) {
1191
1222
  }
1192
1223
  const doctorSkill = {
1193
1224
  name: "doctor-buddy-agent-harness",
1194
- description: "Use this skill when a repository loads no project skills, when skills are missing after a clone, when a harness appears to be ignoring AGENTS.md, or when checking whether the agent configuration bridges into .claude/skills and the other harness files still resolve."
1225
+ description: "Checks 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."
1195
1226
  };
1196
1227
  /** Written into the generated skill so a reader knows not to edit it in place. */
1197
1228
  const generatedSkillWarning = "<!-- Generated from src/diagnose-bridges/doctor-guidance.ts by scripts/generate-skills.ts. Do not edit by hand. -->";
@@ -1258,6 +1289,7 @@ Every \`problem\` name routes to exactly one page. Load the page for the finding
1258
1289
  | \`references/configuration.md\` | a finding about the configuration around the bridges rather than a bridge |
1259
1290
  | \`references/mcp.md\` | any finding whose path is an MCP locator — **always** before acting on a credential finding |
1260
1291
  | \`references/nonstandard.md\` | a finding about configuration only one harness can read |
1292
+ | \`references/worktrees.md\` | a finding about the agent worktrees Claude Code creates under \`.claude/worktrees/\` |
1261
1293
  | \`references/harnesses/<name>.md\` | the paths and files one named harness uses |
1262
1294
 
1263
1295
  ## Rules
@@ -1268,6 +1300,12 @@ Every \`problem\` name routes to exactly one page. Load the page for the finding
1268
1300
  - Never repeat a value from a file an \`mcp-literal-secret\` or \`mcp-committed-secret\` finding points at. The report withheld it on purpose, and quoting it back puts it in the transcript anyway.
1269
1301
  - Never write outside the repository. A \`globalInstructions\` repair is a step for the user to take in their own home directory; hand it over exactly as reported.
1270
1302
  - Write instructions in \`AGENTS.md\`, never in \`CLAUDE.md\`. Content written there reaches one harness, drifts from the canonical file, and — because Claude Code prefers it — takes \`AGENTS.md\` out of that harness's context entirely.
1303
+
1304
+ ## Done when
1305
+
1306
+ - **C1.** The reply names each problem the report found and its cause, or, when the report found none, says the configuration is healthy and calls for no change.
1307
+ - **C2.** No bridge, skill, or instruction file changed: no \`init\` ran, and nothing was written to \`CLAUDE.md\`.
1308
+ - **C3.** The reply repeats no value that a secret finding withheld.
1271
1309
  `;
1272
1310
  }
1273
1311
  //#endregion
@@ -2080,6 +2118,43 @@ function diagnoseNonstandard({ root, cli }) {
2080
2118
  }
2081
2119
  return findings.sort((left, right) => left.path.localeCompare(right.path));
2082
2120
  }
2121
+ const biomeConfigs = ["biome.json", "biome.jsonc"];
2122
+ const claudeSettings = ".claude/settings.json";
2123
+ /** `undefined` when the file is missing or does not parse; either way Claude Code reads no base from it. */
2124
+ function readJson(path) {
2125
+ try {
2126
+ return JSON.parse(readFileSync(path, "utf8"));
2127
+ } catch {
2128
+ return;
2129
+ }
2130
+ }
2131
+ /**
2132
+ * Checked only where `.claude/` exists, the sign the repository is worked in with Claude Code.
2133
+ * Biome is the one tool checked: it is the confirmed failure, and the others are offered by the
2134
+ * skills without a finding.
2135
+ */
2136
+ function diagnoseWorktrees({ root, git, cli }) {
2137
+ if (!existsSync(join(root, ".claude"))) return [];
2138
+ const findings = [];
2139
+ const add = (path, problem) => {
2140
+ const { detail, repair } = repairFor(problem);
2141
+ findings.push({
2142
+ path,
2143
+ problem,
2144
+ detail,
2145
+ repair: repair({ file: path }, cli)
2146
+ });
2147
+ };
2148
+ if (git.isRepository() && !git.isIgnored(".claude/worktrees/")) add(".gitignore", "worktrees-untracked");
2149
+ for (const config of biomeConfigs) {
2150
+ const path = join(root, config);
2151
+ if (existsSync(path) && !readFileSync(path, "utf8").includes(".claude/worktrees")) add(config, "worktrees-scanned");
2152
+ }
2153
+ const settings = readJson(join(root, claudeSettings));
2154
+ const worktree = isRecord(settings) ? settings["worktree"] : void 0;
2155
+ if (!isRecord(worktree) || worktree["baseRef"] === void 0) add(claudeSettings, "worktree-base-unset");
2156
+ return findings;
2157
+ }
2083
2158
  //#endregion
2084
2159
  //#region src/governance-overrides/governance-overrides.ts
2085
2160
  function machineWideDir(platform, programData, names) {
@@ -2691,6 +2766,10 @@ var GitBridgeState = class {
2691
2766
  this.root = root;
2692
2767
  this.repoRootPrefix = git(root, ["rev-parse", "--show-prefix"])?.trim();
2693
2768
  }
2769
+ /** Whether `root` is inside a git work tree at all; a check that needs git's answer skips when not. */
2770
+ isRepository() {
2771
+ return this.repoRootPrefix !== void 0;
2772
+ }
2694
2773
  /** The skip-worktree bit is a hint some checkouts clear, so it is verified rather than assumed. */
2695
2774
  trackingOf(path) {
2696
2775
  if (this.repoRootPrefix === void 0) return "untracked";
@@ -2992,6 +3071,11 @@ async function diagnoseReport(args) {
2992
3071
  ...diagnoseNonstandard({
2993
3072
  root,
2994
3073
  cli: commandInvocation
3074
+ }),
3075
+ ...diagnoseWorktrees({
3076
+ root,
3077
+ git,
3078
+ cli: commandInvocation
2995
3079
  })
2996
3080
  ];
2997
3081
  const { layers: rows } = listReferences$1(await referenceLayers({