buddy-agent-harness 0.5.0 → 0.6.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.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/index.d.mts +129 -13
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{init.command-c0fBv15T.mjs → init.command-zbntulIq.mjs} +347 -45
- package/dist/init.command-zbntulIq.mjs.map +1 -0
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/skills/doctor/SKILL.md +24 -6
- package/skills/init/SKILL.md +6 -3
- package/skills/init/references/harnesses/claude-code.md +2 -0
- package/skills/init/references/harnesses/gemini-cli.md +6 -9
- package/src/diagnose-bridges/agents-files.ts +34 -0
- package/src/diagnose-bridges/diagnose-bridges.ts +18 -8
- package/src/diagnose-bridges/diagnose-instructions.ts +140 -0
- package/src/diagnose-bridges/doctor-guidance.ts +81 -13
- package/src/diagnose-bridges/doctor.command.ts +8 -2
- package/src/diagnose-bridges/json-with-comments.ts +60 -0
- package/src/harness-registry/harness-registry.ts +71 -14
- package/src/harness-registry/instruction-bridge.ts +31 -0
- package/src/index.ts +16 -3
- package/src/initialize-harnesses/initialize-harnesses.ts +1 -1
- package/src/skill-projection/skill-projection.ts +2 -2
- package/dist/init.command-c0fBv15T.mjs.map +0 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `scripts/generate-skills.ts`, so the shipped skill cannot drift from what the command says.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/** Every way a bridge can fail, in the order `doctor` reports them. */
|
|
7
|
+
/** Every way a skills bridge can fail, in the order `doctor` reports them. */
|
|
8
8
|
export type BridgeProblem =
|
|
9
9
|
| 'no-canonical'
|
|
10
10
|
| 'missing'
|
|
@@ -16,8 +16,22 @@ export type BridgeProblem =
|
|
|
16
16
|
| 'diverged-unknown'
|
|
17
17
|
| 'unpinned-copy'
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Every way an instruction bridge can fail. Separate from `BridgeProblem` because the two share no
|
|
21
|
+
* repair: a skills bridge is rebuilt with `init` flags, and an instruction bridge is a file whose
|
|
22
|
+
* content is the user's, so every repair here goes back to the `init` skill.
|
|
23
|
+
*/
|
|
24
|
+
export type InstructionProblem =
|
|
25
|
+
| 'no-instructions'
|
|
26
|
+
| 'instructions-missing'
|
|
27
|
+
| 'instructions-unbridged'
|
|
28
|
+
| 'instructions-unreadable'
|
|
29
|
+
|
|
30
|
+
/** Everything `doctor` can report against, across both sections. */
|
|
31
|
+
export type DoctorProblem = BridgeProblem | InstructionProblem
|
|
32
|
+
|
|
19
33
|
export type Repair = {
|
|
20
|
-
problem:
|
|
34
|
+
problem: DoctorProblem
|
|
21
35
|
/** What `doctor` prints in the `findings` row for this problem. */
|
|
22
36
|
detail: string
|
|
23
37
|
/**
|
|
@@ -83,7 +97,8 @@ await import(join(packageRoot, 'bin', '${commandInvocation}.mjs'))
|
|
|
83
97
|
/** How the skill hands a repair back to `init`. */
|
|
84
98
|
export const initSkillInvocation = '/buddy-agent-harness:init'
|
|
85
99
|
|
|
86
|
-
|
|
100
|
+
/** The skills bridges, reported in `bridges`. */
|
|
101
|
+
export const bridgeRepairs: readonly Repair[] = [
|
|
87
102
|
{
|
|
88
103
|
problem: 'no-canonical',
|
|
89
104
|
detail: 'the canonical skill directory does not exist, so no bridge can resolve',
|
|
@@ -144,16 +159,53 @@ export const doctorRepairs: readonly Repair[] = [
|
|
|
144
159
|
},
|
|
145
160
|
]
|
|
146
161
|
|
|
162
|
+
/**
|
|
163
|
+
* The instruction bridges, reported in `instructions`. Every repair is the `init` skill: these are
|
|
164
|
+
* files a person wrote, or files carrying content beside the bridge, and deciding what to preserve
|
|
165
|
+
* while restoring the bridge is judgment no flag carries. `repair` therefore names the skill in
|
|
166
|
+
* both places rather than pretending a shell command exists.
|
|
167
|
+
*/
|
|
168
|
+
export const instructionRepairs: readonly Repair[] = [
|
|
169
|
+
{
|
|
170
|
+
problem: 'no-instructions',
|
|
171
|
+
detail: 'no AGENTS.md at the repository root, so every instruction bridge points at nothing',
|
|
172
|
+
repair: () => initSkillInvocation,
|
|
173
|
+
skillRepair: () => `run \`${initSkillInvocation}\`, which derives AGENTS.md and the bridges to it`,
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
problem: 'instructions-missing',
|
|
177
|
+
detail: 'no instruction bridge at this path — the harness reads none of AGENTS.md',
|
|
178
|
+
repair: () => initSkillInvocation,
|
|
179
|
+
skillRepair: () => `run \`${initSkillInvocation}\``,
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
problem: 'instructions-unbridged',
|
|
183
|
+
detail: 'the file is present but names AGENTS.md nowhere — the harness reads none of it',
|
|
184
|
+
repair: () => initSkillInvocation,
|
|
185
|
+
skillRepair: () =>
|
|
186
|
+
`run \`${initSkillInvocation}\`, which adds the bridge without discarding what the file already says`,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
problem: 'instructions-unreadable',
|
|
190
|
+
detail: 'the settings file does not parse, so the harness reads none of it',
|
|
191
|
+
repair: () => initSkillInvocation,
|
|
192
|
+
skillRepair: () => `fix the JSON by hand, then run \`${initSkillInvocation}\``,
|
|
193
|
+
},
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
/** Both sections, in the order `doctor` reports them. */
|
|
197
|
+
export const doctorRepairs: readonly Repair[] = [...bridgeRepairs, ...instructionRepairs]
|
|
198
|
+
|
|
147
199
|
const repairsByProblem = new Map(doctorRepairs.map((entry) => [entry.problem, entry]))
|
|
148
200
|
|
|
149
|
-
export function repairFor(problem:
|
|
201
|
+
export function repairFor(problem: DoctorProblem): Repair {
|
|
150
202
|
return repairsByProblem.get(problem) as Repair
|
|
151
203
|
}
|
|
152
204
|
|
|
153
205
|
export const doctorSkill = {
|
|
154
206
|
name: 'doctor',
|
|
155
207
|
description:
|
|
156
|
-
'Use this skill when a repository loads no project skills, when skills are missing after a clone, or when checking whether the agent configuration bridges into .claude/skills and the other harness
|
|
208
|
+
'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, CLAUDE.md, and the other harness files still resolve.',
|
|
157
209
|
} as const
|
|
158
210
|
|
|
159
211
|
/** Written into the generated skill so a reader knows not to edit it in place. */
|
|
@@ -168,9 +220,10 @@ export const generatedSkillWarning =
|
|
|
168
220
|
export function renderDoctorSkill(version: string): string {
|
|
169
221
|
// A repair may itself contain a pipe, which would otherwise end the table cell early.
|
|
170
222
|
const cell = (value: string) => value.replaceAll('|', '\\|')
|
|
171
|
-
const rows =
|
|
172
|
-
|
|
173
|
-
|
|
223
|
+
const rows = (repairs: readonly Repair[]) =>
|
|
224
|
+
repairs
|
|
225
|
+
.map((entry) => `| \`${entry.problem}\` | ${entry.detail} | ${cell(entry.skillRepair('<path>'))} |`)
|
|
226
|
+
.join('\n')
|
|
174
227
|
|
|
175
228
|
return `---
|
|
176
229
|
name: ${doctorSkill.name}
|
|
@@ -181,7 +234,7 @@ ${generatedSkillWarning}
|
|
|
181
234
|
|
|
182
235
|
# Harness Doctor
|
|
183
236
|
|
|
184
|
-
\`.agents/skills\`
|
|
237
|
+
A repository keeps one canonical configuration: \`.agents/skills\` for its skills and \`AGENTS.md\` for its instructions. Harnesses that cannot read those get bridges pointing at them: Claude Code needs both, and Gemini CLI needs the instruction bridge only — it reads \`.agents/skills\` itself. A bridge that stops resolving is silent: the harness finds nothing and loads zero project skills, with no warning anywhere. An instruction bridge fails the same way and costs more, because the harness then reads none of the repository's instructions at all.
|
|
185
238
|
|
|
186
239
|
Diagnose it:
|
|
187
240
|
|
|
@@ -195,22 +248,36 @@ The command is read-only. It never repairs anything, so it is safe to run at any
|
|
|
195
248
|
|
|
196
249
|
## Reading the report
|
|
197
250
|
|
|
198
|
-
\`bridges\` lists every bridge \`init\` would create for this repository, each with a \`status\` of \`ok\`, \`missing\`, \`degraded\`, \`stale\`, or \`diverged\`.
|
|
251
|
+
\`bridges\` lists every skills bridge \`init\` would create for this repository, each with a \`status\` of \`ok\`, \`missing\`, \`degraded\`, \`stale\`, or \`diverged\`.
|
|
252
|
+
|
|
253
|
+
\`instructions\` lists every instruction bridge into \`AGENTS.md\`, with a \`status\` of \`ok\`, \`missing\`, \`unbridged\`, or \`unreadable\`. They are a separate section because nothing about them is shared: a different \`kind\`, a different status vocabulary, and a repair that is never a command.
|
|
254
|
+
|
|
255
|
+
\`findings\` explains each problem from either section and \`help\` names its repair. Apply the repair from the tables below, then re-run \`doctor\`.
|
|
199
256
|
|
|
200
|
-
|
|
257
|
+
Do not run an \`init\` command yourself. Rebuilding a skills bridge can move skills a user wrote, and rewriting an instruction file touches prose a person authored — both are the \`init\` skill's judgment, so hand the repair to \`${initSkillInvocation}\` instead. A \`help\` line naming that skill has no shell equivalent at all.
|
|
201
258
|
|
|
202
259
|
When every bridge resolves, \`findings\` says so outright rather than being empty.
|
|
203
260
|
|
|
204
261
|
The default output is TOON, which is what you parse. Add \`--format text\` when you need to show the same report to a person, or \`--format json\`.
|
|
205
262
|
|
|
206
|
-
##
|
|
263
|
+
## Skills bridge findings
|
|
207
264
|
|
|
208
265
|
| Finding | What it means | Repair |
|
|
209
266
|
| --- | --- | --- |
|
|
210
|
-
${rows}
|
|
267
|
+
${rows(bridgeRepairs)}
|
|
211
268
|
|
|
212
269
|
Substitute the reported bridge path for \`<path>\`.
|
|
213
270
|
|
|
271
|
+
## Instruction bridge findings
|
|
272
|
+
|
|
273
|
+
| Finding | What it means | Repair |
|
|
274
|
+
| --- | --- | --- |
|
|
275
|
+
${rows(instructionRepairs)}
|
|
276
|
+
|
|
277
|
+
\`unbridged\` is the one to read carefully. The file is there and looks fine, and it names \`AGENTS.md\` nowhere — a \`CLAUDE.md\` someone overwrote with real content, or a \`.gemini/settings.json\` another tool rewrote without \`AGENTS.md\` in \`context.fileName\`. Never fix it by replacing the file: the content that displaced the bridge may be the only copy of something.
|
|
278
|
+
|
|
279
|
+
An instruction bridge is reported per file, so a monorepo gets one row per \`AGENTS.md\` in the tree. Each nested \`AGENTS.md\` needs its own stub — an import bridges the file beside it and nothing deeper.
|
|
280
|
+
|
|
214
281
|
## The Windows case
|
|
215
282
|
|
|
216
283
|
The common failure is \`degraded\`. Creating a symlink on Windows needs a privilege most accounts do not have, and Git for Windows gates it separately with \`core.symlinks\`, which its installer leaves off. With \`core.symlinks=false\` git does not error — it writes the symlink out as a regular file whose contents are the target path. \`${initSkillInvocation} --copy --force\` rebuilds the bridges as real directories on that machine.
|
|
@@ -222,5 +289,6 @@ A copy is a snapshot rather than a live projection, and an agent that edits a sk
|
|
|
222
289
|
- Never repair a \`diverged-both\` or \`diverged-unknown\` bridge by re-running \`init\`. Rebuilding overwrites whichever side holds the newer edit. Reconcile the two directories first.
|
|
223
290
|
- Edit skills at \`.agents/skills/<name>/SKILL.md\`. Editing through a bridge is only safe when that bridge is a symlink.
|
|
224
291
|
- Do not add bridges to \`.gitignore\`. An untracked bridge swallows a real edit silently.
|
|
292
|
+
- Write instructions in \`AGENTS.md\`, never in \`CLAUDE.md\`. A bridge file holds the import and any harness-specific notes; content written there reaches one harness and drifts from the canonical file.
|
|
225
293
|
`
|
|
226
294
|
}
|
|
@@ -9,6 +9,7 @@ import { commandInvocation } from './doctor-guidance.ts'
|
|
|
9
9
|
type DoctorReport = {
|
|
10
10
|
bin: string
|
|
11
11
|
bridges: DiagnoseResult['bridges']
|
|
12
|
+
instructions: DiagnoseResult['instructions']
|
|
12
13
|
divergence?: DiagnoseResult['divergence']
|
|
13
14
|
/** The repair is lifted out into `help`, so a finding row stays to the diagnosis itself. */
|
|
14
15
|
findings: Omit<DiagnoseResult['findings'][number], 'repair'>[] | string
|
|
@@ -20,11 +21,14 @@ type DoctorReport = {
|
|
|
20
21
|
* flags to confirm that an empty section really meant "nothing wrong".
|
|
21
22
|
*/
|
|
22
23
|
export function buildReport(bin: string, result: DiagnoseResult): DoctorReport {
|
|
24
|
+
// Both sections are bridges, so the healthy line counts them together rather than making a reader
|
|
25
|
+
// add up two numbers to learn that nothing is wrong.
|
|
23
26
|
if (!result.findings.length) {
|
|
24
|
-
const count = result.bridges.length
|
|
27
|
+
const count = result.bridges.length + result.instructions.length
|
|
25
28
|
return {
|
|
26
29
|
bin,
|
|
27
30
|
bridges: result.bridges,
|
|
31
|
+
instructions: result.instructions,
|
|
28
32
|
findings:
|
|
29
33
|
count === 1 ? '0 problems found — the 1 bridge resolves' : `0 problems found — all ${count} bridges resolve`,
|
|
30
34
|
}
|
|
@@ -33,6 +37,7 @@ export function buildReport(bin: string, result: DiagnoseResult): DoctorReport {
|
|
|
33
37
|
return {
|
|
34
38
|
bin,
|
|
35
39
|
bridges: result.bridges,
|
|
40
|
+
instructions: result.instructions,
|
|
36
41
|
...(result.divergence.length ? { divergence: result.divergence } : {}),
|
|
37
42
|
findings: result.findings.map(({ path, detail }) => ({ path, detail })),
|
|
38
43
|
help: [...new Set(result.findings.map((finding) => `Run \`${finding.repair}\``))],
|
|
@@ -41,7 +46,8 @@ export function buildReport(bin: string, result: DiagnoseResult): DoctorReport {
|
|
|
41
46
|
|
|
42
47
|
export const doctorCommand: cli.Command = command({
|
|
43
48
|
name: 'doctor',
|
|
44
|
-
description:
|
|
49
|
+
description:
|
|
50
|
+
"Report whether this repository's harness bridges still resolve — skills into .agents/skills, instructions into AGENTS.md. Read-only.",
|
|
45
51
|
options: {
|
|
46
52
|
root: {
|
|
47
53
|
description: 'Repository or package directory. Defaults to the current directory.',
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.gemini/settings.json` may legally carry comments — the Gemini CLI loader strips them before
|
|
3
|
+
* parsing. A plain `JSON.parse` of a valid settings file therefore throws, and `doctor` would report
|
|
4
|
+
* a working bridge as unreadable. Comments are removed before parsing for that reason.
|
|
5
|
+
*
|
|
6
|
+
* Only comments. A trailing comma stays a parse error, because nothing documents it as accepted.
|
|
7
|
+
*/
|
|
8
|
+
export function stripJsonComments(source: string): string {
|
|
9
|
+
let output = ''
|
|
10
|
+
let index = 0
|
|
11
|
+
let inString = false
|
|
12
|
+
let escaped = false
|
|
13
|
+
|
|
14
|
+
while (index < source.length) {
|
|
15
|
+
const character = source[index] as string
|
|
16
|
+
|
|
17
|
+
if (inString) {
|
|
18
|
+
output += character
|
|
19
|
+
if (escaped) escaped = false
|
|
20
|
+
else if (character === '\\') escaped = true
|
|
21
|
+
else if (character === '"') inString = false
|
|
22
|
+
index += 1
|
|
23
|
+
continue
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (character === '"') {
|
|
27
|
+
inString = true
|
|
28
|
+
output += character
|
|
29
|
+
index += 1
|
|
30
|
+
continue
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// A `//` inside a string is an ordinary URL; outside one it can only start a comment.
|
|
34
|
+
if (character === '/' && source[index + 1] === '/') {
|
|
35
|
+
while (index < source.length && source[index] !== '\n') index += 1
|
|
36
|
+
continue
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (character === '/' && source[index + 1] === '*') {
|
|
40
|
+
index += 2
|
|
41
|
+
while (index < source.length && !(source[index] === '*' && source[index + 1] === '/')) index += 1
|
|
42
|
+
index += 2
|
|
43
|
+
continue
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
output += character
|
|
47
|
+
index += 1
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return output
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** The parsed value, or `undefined` when the file is not JSON even once its comments are gone. */
|
|
54
|
+
export function parseJsonWithComments(source: string): unknown {
|
|
55
|
+
try {
|
|
56
|
+
return JSON.parse(stripJsonComments(source))
|
|
57
|
+
} catch {
|
|
58
|
+
return undefined
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { lstatSync } from 'node:fs'
|
|
2
2
|
import { join } from 'node:path'
|
|
3
|
+
import type { InstructionBridge } from './instruction-bridge.ts'
|
|
3
4
|
|
|
4
5
|
export type HarnessName =
|
|
5
6
|
| 'claude-code'
|
|
@@ -10,21 +11,56 @@ export type HarnessName =
|
|
|
10
11
|
| 'devin-desktop'
|
|
11
12
|
| 'windsurf'
|
|
12
13
|
|
|
14
|
+
/** The two scopes a harness reads configuration at. Their roots differ; their shape does not. */
|
|
15
|
+
export type HarnessScopeName = 'project' | 'user'
|
|
16
|
+
|
|
13
17
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
18
|
+
* What one harness does at one scope. Paths are relative to that scope's root: the repository root
|
|
19
|
+
* at project scope, the user's home directory at user scope.
|
|
20
|
+
*
|
|
21
|
+
* `detect` is the directory whose presence means this harness is configured at this scope — a
|
|
22
|
+
* different question per scope, which is why it is recorded per scope rather than once.
|
|
23
|
+
*
|
|
24
|
+
* `skillsDirectory` is the projection target the harness needs to see `.agents/skills` at this
|
|
25
|
+
* scope. A harness that reads `.agents/skills` natively there has none, and is never projected into.
|
|
26
|
+
*
|
|
27
|
+
* `instructionBridge` is the same question for `AGENTS.md`: what the harness needs at this scope in
|
|
28
|
+
* order to read it. It belongs per scope for the same reason `skillsDirectory` does — the file
|
|
29
|
+
* differs. Unlike `skillsDirectory`, the `init` command does not write it; the `init` skill does. It
|
|
30
|
+
* is recorded here to be diagnosed and gated per harness, not to be projected.
|
|
16
31
|
*/
|
|
17
|
-
export type
|
|
18
|
-
name: HarnessName
|
|
32
|
+
export type HarnessScope = {
|
|
19
33
|
detect: string
|
|
20
34
|
skillsDirectory?: string
|
|
35
|
+
instructionBridge?: InstructionBridge
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type Harness = {
|
|
39
|
+
name: HarnessName
|
|
40
|
+
/** What this harness does inside a repository. `init` and `doctor` act only here. */
|
|
41
|
+
project: HarnessScope
|
|
42
|
+
/**
|
|
43
|
+
* What this harness does for the user, outside any repository. Absent when no user-scope path is
|
|
44
|
+
* primary-sourced — Devin documents none. Described and diagnosable; never written to.
|
|
45
|
+
*/
|
|
46
|
+
user?: HarnessScope
|
|
21
47
|
/** Set when this name has been superseded; the value is the name that replaces it. */
|
|
22
48
|
deprecated?: HarnessName
|
|
23
49
|
}
|
|
24
50
|
|
|
25
51
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
52
|
+
* The two scopes disagree in general, and a single answer per harness could only record one of them:
|
|
53
|
+
* Copilot CLI is `.github/skills` in a repository and `~/.copilot` for the user. Claude Code is the
|
|
54
|
+
* only harness that needs a skills projection, and it needs one at both scopes. Codex, Cursor,
|
|
55
|
+
* Copilot CLI, Gemini CLI, and Devin Desktop read `.agents/skills` themselves and are never
|
|
56
|
+
* projected into.
|
|
57
|
+
*
|
|
58
|
+
* Gemini CLI carried a `.gemini/skills` projection until E-GEM-02: it reads the `.agents/skills`
|
|
59
|
+
* alias at project scope too, where that alias takes precedence over `.gemini/skills`. It still
|
|
60
|
+
* needs an instruction bridge, which is a separate axis and unaffected.
|
|
61
|
+
*
|
|
62
|
+
* Instruction bridges are recorded at project scope only. The user-scope equivalents exist, but
|
|
63
|
+
* nothing writes or reads them yet: `init` works inside a repository, and so does `doctor`.
|
|
28
64
|
*
|
|
29
65
|
* `windsurf` is the former name of Devin Desktop, rebranded 2026-06-02. It is retained as a
|
|
30
66
|
* deprecated alias: Devin still scans the legacy `.windsurf/skills` path, so its projection keeps
|
|
@@ -33,13 +69,32 @@ export type Harness = {
|
|
|
33
69
|
* See `.research/agentic-configuration-standards/` for the per-harness sources.
|
|
34
70
|
*/
|
|
35
71
|
export const harnessRegistry: readonly Harness[] = [
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
72
|
+
{
|
|
73
|
+
name: 'claude-code',
|
|
74
|
+
project: {
|
|
75
|
+
detect: '.claude',
|
|
76
|
+
skillsDirectory: '.claude/skills',
|
|
77
|
+
instructionBridge: { kind: 'import', path: 'CLAUDE.md' },
|
|
78
|
+
},
|
|
79
|
+
user: { detect: '.claude', skillsDirectory: '.claude/skills' },
|
|
80
|
+
},
|
|
81
|
+
{ name: 'cursor', project: { detect: '.cursor' }, user: { detect: '.cursor' } },
|
|
82
|
+
{ name: 'codex', project: { detect: '.codex' }, user: { detect: '.codex' } },
|
|
83
|
+
{ name: 'copilot-cli', project: { detect: '.github/skills' }, user: { detect: '.copilot' } },
|
|
84
|
+
{
|
|
85
|
+
name: 'gemini-cli',
|
|
86
|
+
project: {
|
|
87
|
+
detect: '.gemini',
|
|
88
|
+
instructionBridge: { kind: 'settings-entry', path: '.gemini/settings.json', key: 'context.fileName' },
|
|
89
|
+
},
|
|
90
|
+
user: { detect: '.gemini' },
|
|
91
|
+
},
|
|
92
|
+
{ name: 'devin-desktop', project: { detect: '.devin' } },
|
|
93
|
+
{
|
|
94
|
+
name: 'windsurf',
|
|
95
|
+
project: { detect: '.windsurf', skillsDirectory: '.windsurf/skills' },
|
|
96
|
+
deprecated: 'devin-desktop',
|
|
97
|
+
},
|
|
43
98
|
]
|
|
44
99
|
|
|
45
100
|
/** Enabled whether or not the repository already contains their directories. */
|
|
@@ -56,5 +111,7 @@ function directoryExists(path: string): boolean {
|
|
|
56
111
|
/** The default harnesses, plus the preferred ones, plus every harness whose directory is present. */
|
|
57
112
|
export function selectHarnesses(root: string, preferred: readonly HarnessName[]): Harness[] {
|
|
58
113
|
const enabled = new Set<HarnessName>([...defaultHarnesses, ...preferred])
|
|
59
|
-
return harnessRegistry.filter(
|
|
114
|
+
return harnessRegistry.filter(
|
|
115
|
+
(harness) => enabled.has(harness.name) || directoryExists(join(root, harness.project.detect)),
|
|
116
|
+
)
|
|
60
117
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a harness needs in order to read the repository's `AGENTS.md`.
|
|
3
|
+
*
|
|
4
|
+
* A skills projection is one shape — a directory pointing at `.agents/skills` — so the registry
|
|
5
|
+
* models it as a path. Instruction bridges are not one shape: Claude Code needs a Markdown file
|
|
6
|
+
* whose body imports `AGENTS.md`, and Gemini CLI needs `AGENTS.md` added to an array inside a JSON
|
|
7
|
+
* settings file. A second bare path field would describe the first and lie about the second, so the
|
|
8
|
+
* variant carries what its own check needs.
|
|
9
|
+
*
|
|
10
|
+
* The `init` command writes none of these. They are the `init` skill's work, which is why every
|
|
11
|
+
* finding against one names the skill rather than a flag.
|
|
12
|
+
*/
|
|
13
|
+
export type InstructionBridge =
|
|
14
|
+
| {
|
|
15
|
+
/**
|
|
16
|
+
* A Markdown file whose body is an `@AGENTS.md` import, or a symlink to `AGENTS.md`. One is
|
|
17
|
+
* needed beside every `AGENTS.md` in the tree, not only the root file: an import bridges the
|
|
18
|
+
* one file next to it, so a nested `AGENTS.md` is invisible until it has its own.
|
|
19
|
+
*/
|
|
20
|
+
kind: 'import'
|
|
21
|
+
/** Repository-relative name, the same in every directory that holds an `AGENTS.md`. */
|
|
22
|
+
path: string
|
|
23
|
+
}
|
|
24
|
+
| {
|
|
25
|
+
/** An `AGENTS.md` entry in an array inside a JSON settings file. */
|
|
26
|
+
kind: 'settings-entry'
|
|
27
|
+
/** Repository-relative path of the settings file. */
|
|
28
|
+
path: string
|
|
29
|
+
/** Dotted path to the array within it, as the harness documents it. */
|
|
30
|
+
key: string
|
|
31
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -8,12 +8,25 @@ export type {
|
|
|
8
8
|
DivergenceReport,
|
|
9
9
|
} from './diagnose-bridges/diagnose-bridges.ts'
|
|
10
10
|
export { diagnoseBridges } from './diagnose-bridges/diagnose-bridges.ts'
|
|
11
|
+
export type {
|
|
12
|
+
InstructionKind,
|
|
13
|
+
InstructionReport,
|
|
14
|
+
InstructionStatus,
|
|
15
|
+
} from './diagnose-bridges/diagnose-instructions.ts'
|
|
16
|
+
export { diagnoseInstructions } from './diagnose-bridges/diagnose-instructions.ts'
|
|
11
17
|
export { doctorCommand } from './diagnose-bridges/doctor.command.ts'
|
|
12
|
-
export type { BridgeProblem, Repair } from './diagnose-bridges/doctor-guidance.ts'
|
|
13
|
-
export {
|
|
18
|
+
export type { BridgeProblem, DoctorProblem, InstructionProblem, Repair } from './diagnose-bridges/doctor-guidance.ts'
|
|
19
|
+
export {
|
|
20
|
+
bridgeRepairs,
|
|
21
|
+
doctorRepairs,
|
|
22
|
+
doctorSkill,
|
|
23
|
+
instructionRepairs,
|
|
24
|
+
renderDoctorSkill,
|
|
25
|
+
} from './diagnose-bridges/doctor-guidance.ts'
|
|
14
26
|
export type { DivergenceDirection } from './diagnose-bridges/git-bridge-state.ts'
|
|
15
|
-
export type { HarnessName } from './harness-registry/harness-registry.ts'
|
|
27
|
+
export type { Harness, HarnessName, HarnessScope, HarnessScopeName } from './harness-registry/harness-registry.ts'
|
|
16
28
|
export { harnessRegistry } from './harness-registry/harness-registry.ts'
|
|
29
|
+
export type { InstructionBridge } from './harness-registry/instruction-bridge.ts'
|
|
17
30
|
export { activate, harnessCommand, initCommand } from './initialize-harnesses/init.command.ts'
|
|
18
31
|
export type { InitializeOptions, InitializeResult } from './initialize-harnesses/initialize-harnesses.ts'
|
|
19
32
|
export { initializeHarnesses } from './initialize-harnesses/initialize-harnesses.ts'
|
|
@@ -33,7 +33,7 @@ export function initializeHarnesses({
|
|
|
33
33
|
return {
|
|
34
34
|
root,
|
|
35
35
|
harnesses: harnesses.map((harness) => harness.name),
|
|
36
|
-
native: harnesses.filter((harness) => !harness.skillsDirectory).map((harness) => harness.name),
|
|
36
|
+
native: harnesses.filter((harness) => !harness.project.skillsDirectory).map((harness) => harness.name),
|
|
37
37
|
linked,
|
|
38
38
|
deprecated: harnesses
|
|
39
39
|
.filter((harness) => harness.deprecated)
|
|
@@ -42,10 +42,10 @@ export type ProjectSkillsOptions = {
|
|
|
42
42
|
*/
|
|
43
43
|
export function projectSkills({ root, canonicalSkills, harnesses, copy, force }: ProjectSkillsOptions): HarnessName[] {
|
|
44
44
|
const projections = harnesses
|
|
45
|
-
.filter((harness) => harness.skillsDirectory)
|
|
45
|
+
.filter((harness) => harness.project.skillsDirectory)
|
|
46
46
|
.map((harness) => ({
|
|
47
47
|
harness,
|
|
48
|
-
target: join(root, harness.skillsDirectory as string),
|
|
48
|
+
target: join(root, harness.project.skillsDirectory as string),
|
|
49
49
|
}))
|
|
50
50
|
|
|
51
51
|
const conflicts = projections
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.command-c0fBv15T.mjs","names":[],"sources":["../src/command-output/command-output.ts","../src/harness-registry/harness-registry.ts","../src/diagnose-bridges/directory-files.ts","../src/diagnose-bridges/doctor-guidance.ts","../src/diagnose-bridges/git-bridge-state.ts","../src/diagnose-bridges/diagnose-bridges.ts","../src/diagnose-bridges/doctor.command.ts","../src/skill-projection/skill-projection.ts","../src/initialize-harnesses/initialize-harnesses.ts","../src/initialize-harnesses/init.command.ts"],"sourcesContent":["import { sep } from 'node:path'\nimport { encode } from '@toon-format/toon'\n\nexport type OutputFormat = 'json' | 'toon' | 'text'\n\nconst formats: readonly OutputFormat[] = ['toon', 'json', 'text']\n\n/** Rejects anything but the supported formats so an unknown value never falls back silently. */\nexport function parseFormat(value: string | undefined): OutputFormat {\n\tif (!formats.includes(value as OutputFormat)) throw new Error('--format must be toon, json, or text.')\n\treturn value as OutputFormat\n}\n\n/** The single stdout boundary: internal logic stays on plain objects, encoding happens here. */\nexport function writeResult(value: object, format: OutputFormat): void {\n\tprocess.stdout.write(`${encodeResult(value, format)}\\n`)\n}\n\nfunction encodeResult(value: object, format: OutputFormat): string {\n\tif (format === 'json') return JSON.stringify(value)\n\treturn format === 'text' ? renderText(value) : encode(value)\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction cell(value: unknown): string {\n\treturn value === undefined ? '' : String(value)\n}\n\n/** A header row plus one row per record, every column padded to its widest cell. */\nfunction table(rows: Record<string, unknown>[]): string[] {\n\tconst columns = [...new Set(rows.flatMap((row) => Object.keys(row)))]\n\tconst widths = columns.map((column) => Math.max(column.length, ...rows.map((row) => cell(row[column]).length)))\n\tconst line = (values: string[]) =>\n\t\t` ${values.map((value, index) => value.padEnd(widths[index] as number)).join(' ')}`.trimEnd()\n\treturn [line(columns), ...rows.map((row) => line(columns.map((column) => cell(row[column]))))]\n}\n\n/**\n * The same result rendered for a person rather than for an agent: scalars as `key: value`, records\n * as an aligned table, and everything else as a bulleted list. TOON stays the default because it is\n * what an agent parses; this is for reading over someone's shoulder.\n */\nexport function renderText(value: object): string {\n\tconst blocks = Object.entries(value).map(([key, item]) => {\n\t\tif (!Array.isArray(item)) return [`${key}: ${isRecord(item) ? JSON.stringify(item) : String(item)}`]\n\t\tif (!item.length) return [`${key}: (none)`]\n\t\tconst body = item.every(isRecord) ? table(item) : item.map((entry) => ` - ${String(entry)}`)\n\t\treturn [`${key}:`, ...body]\n\t})\n\n\t// A blank line wherever a multi-line block meets its neighbour, so a following scalar does not\n\t// read as another row of the table above it.\n\treturn blocks\n\t\t.flatMap((block, index) => {\n\t\t\tconst previous = blocks[index - 1]\n\t\t\treturn previous && (previous.length > 1 || block.length > 1) ? ['', ...block] : block\n\t\t})\n\t\t.join('\\n')\n}\n\n/** AXI §10: the executable's absolute path, with the user's home directory collapsed to `~`. */\nexport function binPath(home: string, executable: string | undefined): string {\n\tif (!executable) return 'buddy-agent-harness'\n\treturn home && executable.startsWith(home + sep) ? `~${executable.slice(home.length)}` : executable\n}\n","import { lstatSync } from 'node:fs'\nimport { join } from 'node:path'\n\nexport type HarnessName =\n\t| 'claude-code'\n\t| 'cursor'\n\t| 'codex'\n\t| 'copilot-cli'\n\t| 'gemini-cli'\n\t| 'devin-desktop'\n\t| 'windsurf'\n\n/**\n * `skillsDirectory` is the projection target a harness needs to see `.agents/skills`.\n * A harness that reads `.agents/skills` natively has none, and is never projected into.\n */\nexport type Harness = {\n\tname: HarnessName\n\tdetect: string\n\tskillsDirectory?: string\n\t/** Set when this name has been superseded; the value is the name that replaces it. */\n\tdeprecated?: HarnessName\n}\n\n/**\n * Codex, Cursor, Copilot CLI, and Devin Desktop read `.agents/skills` directly, so they need no\n * projection. Only Claude Code and Gemini CLI read solely their own directory.\n *\n * `windsurf` is the former name of Devin Desktop, rebranded 2026-06-02. It is retained as a\n * deprecated alias: Devin still scans the legacy `.windsurf/skills` path, so its projection keeps\n * working, but new repositories should enable `devin-desktop` and have nothing written for them.\n *\n * See `.research/agentic-configuration-standards/` for the per-harness sources.\n */\nexport const harnessRegistry: readonly Harness[] = [\n\t{ name: 'claude-code', detect: '.claude', skillsDirectory: '.claude/skills' },\n\t{ name: 'cursor', detect: '.cursor' },\n\t{ name: 'codex', detect: '.codex' },\n\t{ name: 'copilot-cli', detect: '.github/skills' },\n\t{ name: 'gemini-cli', detect: '.gemini', skillsDirectory: '.gemini/skills' },\n\t{ name: 'devin-desktop', detect: '.devin' },\n\t{ name: 'windsurf', detect: '.windsurf', skillsDirectory: '.windsurf/skills', deprecated: 'devin-desktop' },\n]\n\n/** Enabled whether or not the repository already contains their directories. */\nconst defaultHarnesses: readonly HarnessName[] = ['claude-code', 'cursor']\n\nfunction directoryExists(path: string): boolean {\n\ttry {\n\t\treturn lstatSync(path).isDirectory()\n\t} catch {\n\t\treturn false\n\t}\n}\n\n/** The default harnesses, plus the preferred ones, plus every harness whose directory is present. */\nexport function selectHarnesses(root: string, preferred: readonly HarnessName[]): Harness[] {\n\tconst enabled = new Set<HarnessName>([...defaultHarnesses, ...preferred])\n\treturn harnessRegistry.filter((harness) => enabled.has(harness.name) || directoryExists(join(root, harness.detect)))\n}\n","import { readdirSync } from 'node:fs'\nimport { join, posix, relative, sep } from 'node:path'\n\n/**\n * Every file below `directory`, as paths relative to it, POSIX-separated and sorted. A directory\n * that does not exist reads as empty: `doctor` never creates one to look at it.\n */\nexport function filesUnder(directory: string): string[] {\n\ttry {\n\t\treturn readdirSync(directory, { recursive: true, withFileTypes: true })\n\t\t\t.filter((entry) => entry.isFile())\n\t\t\t.map((entry) => relative(directory, join(entry.parentPath, entry.name)).split(sep).join(posix.sep))\n\t\t\t.sort()\n\t} catch {\n\t\treturn []\n\t}\n}\n","/**\n * The one place `doctor`'s guidance is written. The command reads `detail` and `repair` to fill its\n * `findings` and `help` sections; `skills/doctor/SKILL.md` is generated from the same table by\n * `scripts/generate-skills.ts`, so the shipped skill cannot drift from what the command says.\n */\n\n/** Every way a bridge can fail, in the order `doctor` reports them. */\nexport type BridgeProblem =\n\t| 'no-canonical'\n\t| 'missing'\n\t| 'degraded'\n\t| 'stale'\n\t| 'diverged-bridge'\n\t| 'diverged-canonical'\n\t| 'diverged-both'\n\t| 'diverged-unknown'\n\t| 'unpinned-copy'\n\nexport type Repair = {\n\tproblem: BridgeProblem\n\t/** What `doctor` prints in the `findings` row for this problem. */\n\tdetail: string\n\t/**\n\t * The command that fixes it, for `doctor`'s own output. `path` is the repository-relative bridge\n\t * path; `cli` is how to invoke this tool.\n\t */\n\trepair(path: string, cli: string): string\n\t/**\n\t * What the shipped skill tells an agent to do instead. A repair that rebuilds a bridge delegates\n\t * to the `init` skill rather than calling the `init` command, because rebuilding can move\n\t * user-authored skills and that judgment is the `init` skill's, not `doctor`'s.\n\t */\n\tskillRepair(path: string): string\n}\n\n/** How the command names itself. */\nexport const commandInvocation = 'buddy-agent-harness'\n/**\n * How a skill invokes the command. A skill may run without the binary on PATH, so it goes through\n * `npx`, pinned to the caret range of the version that generated the skill.\n *\n * The pin is what makes the shipped guidance honest. A skill states the findings and flags of the\n * version it was generated from, so an unpinned `npx` — which resolves whatever is latest — can\n * hand an agent a table that does not describe the CLI it just ran. The caret keeps patches\n * flowing and stops at the next breaking line.\n */\nexport const skillInvocation = (version: string) => `npx -y ${commandInvocation}@^${version}`\n\n/**\n * The launcher a skill ships, named for the subcommand it runs so a stack trace or a process list\n * says which one it was. One script per command, beside the `SKILL.md` that documents it.\n */\nexport const launcherFor = (subcommand: string) => `scripts/${subcommand}.mjs`\n\n/**\n * How a skill names its launcher: the path as the skill sees it, resolved by the agent against the\n * directory it read the `SKILL.md` from.\n *\n * `node` stays in front. The launcher ships without an executable bit, and its shebang does nothing\n * on Windows, so naming the file alone would not run it.\n */\nexport const launcherInvocation = (subcommand: string) => `node ${launcherFor(subcommand)}`\n\n/**\n * The launcher written into a skill's `scripts/` directory. It resolves the CLI from its own\n * location rather than the working directory, so the skill runs the copy it shipped with and\n * fetches nothing. The repository it inspects is still the working directory, unchanged.\n */\nexport function renderSkillLauncher(subcommand: string): string {\n\treturn `#!/usr/bin/env node\n// Generated from src/diagnose-bridges/doctor-guidance.ts by scripts/generate-skills.ts. Do not edit by hand.\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\n// <package>/skills/<skill>/scripts/${subcommand}.mjs: four levels up is the package root.\nconst packageRoot = dirname(dirname(dirname(dirname(fileURLToPath(import.meta.url)))))\n\nprocess.argv.splice(2, 0, '${subcommand}')\nawait import(join(packageRoot, 'bin', '${commandInvocation}.mjs'))\n`\n}\n\n/** How the skill hands a repair back to `init`. */\nexport const initSkillInvocation = '/buddy-agent-harness:init'\n\nexport const doctorRepairs: readonly Repair[] = [\n\t{\n\t\tproblem: 'no-canonical',\n\t\tdetail: 'the canonical skill directory does not exist, so no bridge can resolve',\n\t\trepair: (_path, cli) => `${cli} init`,\n\t\tskillRepair: () => `run \\`${initSkillInvocation}\\`, which creates \\`.agents/skills\\` and the bridges`,\n\t},\n\t{\n\t\tproblem: 'missing',\n\t\tdetail: 'no bridge at this path — the harness sees zero project skills',\n\t\trepair: (_path, cli) => `${cli} init`,\n\t\tskillRepair: () => `run \\`${initSkillInvocation}\\``,\n\t},\n\t{\n\t\tproblem: 'degraded',\n\t\tdetail: 'expected a directory but found a regular file — checkout without core.symlinks',\n\t\trepair: (_path, cli) => `${cli} init --copy --force`,\n\t\tskillRepair: () => `run \\`${initSkillInvocation} --copy --force\\``,\n\t},\n\t{\n\t\tproblem: 'stale',\n\t\tdetail: 'symlink does not resolve to .agents/skills',\n\t\trepair: (_path, cli) => `${cli} init --force`,\n\t\tskillRepair: () => `run \\`${initSkillInvocation} --force\\``,\n\t},\n\t{\n\t\tproblem: 'diverged-bridge',\n\t\tdetail: 'only the bridge changed since the two last agreed — an agent wrote through the copy',\n\t\trepair: (path, cli) =>\n\t\t\t`replace .agents/skills with ${path} to keep the newer edit and then run ${cli} init --force`,\n\t\tskillRepair: (path) =>\n\t\t\t`replace .agents/skills with ${path} to keep the newer edit, then run \\`${initSkillInvocation} --force\\``,\n\t},\n\t{\n\t\tproblem: 'diverged-canonical',\n\t\tdetail: 'only .agents/skills changed since the two last agreed — the copy is stale',\n\t\trepair: (_path, cli) => `${cli} init --copy --force`,\n\t\tskillRepair: () => `run \\`${initSkillInvocation} --copy --force\\``,\n\t},\n\t{\n\t\tproblem: 'diverged-both',\n\t\tdetail: 'both sides changed since they last agreed — rebuilding would discard one of them',\n\t\trepair: (path) => `git diff --no-index .agents/skills ${path} and reconcile by hand`,\n\t\tskillRepair: (path) => `run \\`git diff --no-index .agents/skills ${path}\\` and reconcile by hand`,\n\t},\n\t{\n\t\tproblem: 'diverged-unknown',\n\t\tdetail: 'contents differ and no commit where they agreed was found — which side moved is unknown',\n\t\trepair: (path) => `git diff --no-index .agents/skills ${path} and reconcile by hand`,\n\t\tskillRepair: (path) => `run \\`git diff --no-index .agents/skills ${path}\\` and reconcile by hand`,\n\t},\n\t{\n\t\tproblem: 'unpinned-copy',\n\t\tdetail: 'tracked copy without the skip-worktree bit — the tree is dirty with content that must not be committed',\n\t\t// The index entry is the tracked symlink on a Windows checkout but the individual files in a\n\t\t// committed copy, so the paths are read back from git rather than assumed.\n\t\trepair: (path) => `git ls-files -z ${path} | xargs -0 git update-index --skip-worktree`,\n\t\tskillRepair: (path) => `run \\`git ls-files -z ${path} | xargs -0 git update-index --skip-worktree\\``,\n\t},\n]\n\nconst repairsByProblem = new Map(doctorRepairs.map((entry) => [entry.problem, entry]))\n\nexport function repairFor(problem: BridgeProblem): Repair {\n\treturn repairsByProblem.get(problem) as Repair\n}\n\nexport const doctorSkill = {\n\tname: 'doctor',\n\tdescription:\n\t\t'Use this skill when a repository loads no project skills, when skills are missing after a clone, or when checking whether the agent configuration bridges into .claude/skills and the other harness directories still resolve.',\n} as const\n\n/** Written into the generated skill so a reader knows not to edit it in place. */\nexport const generatedSkillWarning =\n\t'<!-- Generated from src/diagnose-bridges/doctor-guidance.ts by scripts/generate-skills.ts. Do not edit by hand. -->'\n\n/**\n * The shipped `doctor` skill, rendered from the same table the command prints. `version` is the\n * package version the skill ships with; it pins the `npx` invocation so the table and the CLI that\n * produced it stay on the same breaking line.\n */\nexport function renderDoctorSkill(version: string): string {\n\t// A repair may itself contain a pipe, which would otherwise end the table cell early.\n\tconst cell = (value: string) => value.replaceAll('|', '\\\\|')\n\tconst rows = doctorRepairs\n\t\t.map((entry) => `| \\`${entry.problem}\\` | ${entry.detail} | ${cell(entry.skillRepair('<path>'))} |`)\n\t\t.join('\\n')\n\n\treturn `---\nname: ${doctorSkill.name}\ndescription: ${doctorSkill.description}\n---\n\n${generatedSkillWarning}\n\n# Harness Doctor\n\n\\`.agents/skills\\` is the canonical skill directory. Harnesses that cannot read it — Claude Code and Gemini CLI — get a bridge pointing at it, normally a directory symlink. A bridge that stops resolving is silent: the harness finds nothing and loads zero project skills, with no warning anywhere.\n\nDiagnose it:\n\n\\`\\`\\`sh\n${launcherInvocation('doctor')}\n\\`\\`\\`\n\nThat path is relative to this skill's own directory. The launcher runs the CLI that shipped beside it against the current working directory, so nothing is downloaded. Fall back to \\`${skillInvocation(version)} doctor\\` when the launcher cannot be resolved or run, which is the case when the plugin was installed from git rather than npm and its dependencies were never installed.\n\nThe command is read-only. It never repairs anything, so it is safe to run at any point, including from a session-start hook.\n\n## Reading the report\n\n\\`bridges\\` lists every bridge \\`init\\` would create for this repository, each with a \\`status\\` of \\`ok\\`, \\`missing\\`, \\`degraded\\`, \\`stale\\`, or \\`diverged\\`. \\`findings\\` explains each problem and \\`help\\` names its repair. Apply the repair from the table below, then re-run \\`doctor\\`.\n\n\\`help\\` names the \\`init\\` command for a person at a shell. Do not run it yourself. Rebuilding a bridge can move skills a user wrote, and that judgment belongs to the \\`init\\` skill — hand the repair to \\`${initSkillInvocation}\\` instead.\n\nWhen every bridge resolves, \\`findings\\` says so outright rather than being empty.\n\nThe default output is TOON, which is what you parse. Add \\`--format text\\` when you need to show the same report to a person, or \\`--format json\\`.\n\n## Findings and their repairs\n\n| Finding | What it means | Repair |\n| --- | --- | --- |\n${rows}\n\nSubstitute the reported bridge path for \\`<path>\\`.\n\n## The Windows case\n\nThe common failure is \\`degraded\\`. Creating a symlink on Windows needs a privilege most accounts do not have, and Git for Windows gates it separately with \\`core.symlinks\\`, which its installer leaves off. With \\`core.symlinks=false\\` git does not error — it writes the symlink out as a regular file whose contents are the target path. \\`${initSkillInvocation} --copy --force\\` rebuilds the bridges as real directories on that machine.\n\nA copy is a snapshot rather than a live projection, and an agent that edits a skill through it writes into the copy instead of into \\`.agents/skills\\`. That is what the \\`diverged\\` findings catch.\n\n## Rules\n\n- Never repair a \\`diverged-both\\` or \\`diverged-unknown\\` bridge by re-running \\`init\\`. Rebuilding overwrites whichever side holds the newer edit. Reconcile the two directories first.\n- Edit skills at \\`.agents/skills/<name>/SKILL.md\\`. Editing through a bridge is only safe when that bridge is a symlink.\n- Do not add bridges to \\`.gitignore\\`. An untracked bridge swallows a real edit silently.\n`\n}\n","import { execFileSync } from 'node:child_process'\nimport { join } from 'node:path'\nimport { filesUnder } from './directory-files.ts'\n\n/** Which side of a diverged bridge moved since the last commit where the two agreed. */\nexport type DivergenceDirection = 'bridge' | 'canonical' | 'both' | 'unknown'\n\n/** Whether a path is tracked, and if so whether its skip-worktree bit is still set. */\nexport type TrackingState = 'untracked' | 'tracked' | 'skip-worktree'\n\nfunction git(root: string, args: string[], input?: string): string | undefined {\n\ttry {\n\t\treturn execFileSync('git', args, {\n\t\t\tcwd: root,\n\t\t\tencoding: 'utf8',\n\t\t\t...(input === undefined ? {} : { input }),\n\t\t\tstdio: ['pipe', 'pipe', 'pipe'],\n\t\t})\n\t} catch {\n\t\treturn undefined\n\t}\n}\n\nfunction lines(output: string | undefined): string[] {\n\treturn (output ?? '').split('\\n').filter(Boolean)\n}\n\n/**\n * Reads git state for the two sides of a bridge. Every method degrades to \"cannot tell\" rather than\n * throwing, so `doctor` still reports on a tarball, a worktree without git, or a repository with no\n * commits.\n */\nexport class GitBridgeState {\n\t/** Path of `root` relative to the repository root, `''` at the top, `undefined` outside a repository. */\n\tprivate readonly prefix: string | undefined\n\n\tconstructor(private readonly root: string) {\n\t\tthis.prefix = git(root, ['rev-parse', '--show-prefix'])?.trim()\n\t}\n\n\t/**\n\t * `init --copy` marks a bridge skip-worktree so a machine-local copy over a tracked symlink stops\n\t * showing as a pending change. The bit is a hint that some checkouts clear, so it is verified\n\t * rather than assumed.\n\t */\n\ttrackingOf(path: string): TrackingState {\n\t\tif (this.prefix === undefined) return 'untracked'\n\t\tconst entries = lines(git(this.root, ['ls-files', '-v', '--', path]))\n\t\tif (!entries.length) return 'untracked'\n\t\treturn entries.every((entry) => entry.startsWith('S')) ? 'skip-worktree' : 'tracked'\n\t}\n\n\t/**\n\t * Names the side that moved by finding the newest commit whose two trees agreed, then asking which\n\t * of the working directories still matches it.\n\t */\n\tdirectionOf(bridge: string, canonical: string): DivergenceDirection {\n\t\tif (this.prefix === undefined) return 'unknown'\n\t\tconst base = this.lastAgreedTree(bridge, canonical)\n\t\tif (base === undefined) return 'unknown'\n\t\tconst bridgeMoved = !this.matchesTree(bridge, base)\n\t\tconst canonicalMoved = !this.matchesTree(canonical, base)\n\t\tif (bridgeMoved && canonicalMoved) return 'both'\n\t\tif (bridgeMoved) return 'bridge'\n\t\treturn 'canonical'\n\t}\n\n\t/** The tree of the newest commit where both paths held identical content. */\n\tprivate lastAgreedTree(bridge: string, canonical: string): string | undefined {\n\t\tfor (const commit of lines(git(this.root, ['rev-list', '-n', '200', 'HEAD', '--', bridge, canonical]))) {\n\t\t\tconst bridgeObject = git(this.root, ['rev-parse', '-q', '--verify', `${commit}:${this.prefix}${bridge}`])?.trim()\n\t\t\tif (!bridgeObject) continue\n\t\t\tconst canonicalObject = git(this.root, [\n\t\t\t\t'rev-parse',\n\t\t\t\t'-q',\n\t\t\t\t'--verify',\n\t\t\t\t`${commit}:${this.prefix}${canonical}`,\n\t\t\t])?.trim()\n\t\t\tif (bridgeObject === canonicalObject) return bridgeObject\n\t\t}\n\t\treturn undefined\n\t}\n\n\t/**\n\t * Compares a working directory against a git tree by object id. `hash-object` is used rather than\n\t * hashing in-process so the comparison follows whatever object format the repository uses.\n\t */\n\tprivate matchesTree(directory: string, tree: string): boolean {\n\t\tconst expected = new Map(\n\t\t\tlines(git(this.root, ['ls-tree', '-r', tree])).map((entry) => {\n\t\t\t\tconst [meta, path] = entry.split('\\t')\n\t\t\t\treturn [path, (meta as string).split(' ')[2] as string] as const\n\t\t\t}),\n\t\t)\n\t\tconst files = filesUnder(join(this.root, directory))\n\t\tif (files.length !== expected.size || files.some((file) => !expected.has(file))) return false\n\t\tconst hashed = lines(\n\t\t\tgit(this.root, ['hash-object', '--stdin-paths'], files.map((file) => join(directory, file)).join('\\n')),\n\t\t)\n\t\treturn hashed.length === files.length && files.every((file, index) => expected.get(file) === hashed[index])\n\t}\n}\n","import { lstatSync, readFileSync, readlinkSync, statSync } from 'node:fs'\nimport { dirname, join, relative } from 'node:path'\nimport { type Harness, type HarnessName, selectHarnesses } from '../harness-registry/harness-registry.ts'\nimport { filesUnder } from './directory-files.ts'\nimport { type BridgeProblem, repairFor } from './doctor-guidance.ts'\nimport { type DivergenceDirection, GitBridgeState } from './git-bridge-state.ts'\n\nexport type BridgeKind = 'symlink' | 'copy' | 'file' | 'none'\nexport type BridgeStatus = 'ok' | 'missing' | 'degraded' | 'stale' | 'diverged'\n\nexport type BridgeReport = {\n\tharness: HarnessName\n\t/** Repository-relative, as the harness registry declares it. */\n\tpath: string\n\tkind: BridgeKind\n\tstatus: BridgeStatus\n}\n\nexport type BridgeFinding = {\n\tpath: string\n\tdetail: string\n\t/** The command that repairs this finding, already carrying the bridge path. */\n\trepair: string\n}\n\nexport type DivergenceReport = {\n\tpath: string\n\tdirection: DivergenceDirection\n}\n\nexport type DiagnoseOptions = {\n\troot: string\n\tharnesses?: HarnessName[]\n\t/** How to name this tool in the repair commands. */\n\tcli: string\n}\n\nexport type DiagnoseResult = {\n\tbridges: BridgeReport[]\n\tdivergence: DivergenceReport[]\n\tfindings: BridgeFinding[]\n}\n\nconst canonicalPath = '.agents/skills'\n\nfunction pathState(target: string): 'missing' | 'symlink' | 'directory' | 'file' {\n\ttry {\n\t\tconst stats = lstatSync(target)\n\t\tif (stats.isSymbolicLink()) return 'symlink'\n\t\treturn stats.isDirectory() ? 'directory' : 'file'\n\t} catch {\n\t\treturn 'missing'\n\t}\n}\n\nfunction isDirectory(path: string): boolean {\n\ttry {\n\t\treturn statSync(path).isDirectory()\n\t} catch {\n\t\treturn false\n\t}\n}\n\n/** The same test `init` uses to decide a projection is already correct, plus that it still resolves. */\nfunction resolvesToCanonical(target: string, canonical: string): boolean {\n\treturn readlinkSync(target) === relative(dirname(target), canonical) && isDirectory(target)\n}\n\nfunction sameContent(left: string, right: string): boolean {\n\tconst leftFiles = filesUnder(left)\n\tconst rightFiles = filesUnder(right)\n\treturn (\n\t\tleftFiles.length === rightFiles.length &&\n\t\tleftFiles.every(\n\t\t\t(file, index) =>\n\t\t\t\trightFiles[index] === file && readFileSync(join(left, file)).equals(readFileSync(join(right, file))),\n\t\t)\n\t)\n}\n\ntype Inspection = {\n\tkind: BridgeKind\n\tstatus: BridgeStatus\n\tproblem?: BridgeProblem\n\tdirection?: DivergenceDirection\n}\n\nfunction inspect(target: string, path: string, canonical: string, git: GitBridgeState): Inspection {\n\tswitch (pathState(target)) {\n\t\tcase 'missing':\n\t\t\treturn { kind: 'none', status: 'missing', problem: 'missing' }\n\t\t// The flagship Windows failure: git with `core.symlinks=false` writes the link out as a\n\t\t// regular file holding the target path, and the harness silently loads nothing.\n\t\tcase 'file':\n\t\t\treturn { kind: 'file', status: 'degraded', problem: 'degraded' }\n\t\tcase 'symlink':\n\t\t\treturn resolvesToCanonical(target, canonical)\n\t\t\t\t? { kind: 'symlink', status: 'ok' }\n\t\t\t\t: { kind: 'symlink', status: 'stale', problem: 'stale' }\n\t\tdefault: {\n\t\t\tif (!sameContent(target, canonical)) {\n\t\t\t\tconst direction = git.directionOf(path, canonicalPath)\n\t\t\t\treturn { kind: 'copy', status: 'diverged', problem: `diverged-${direction}`, direction }\n\t\t\t}\n\t\t\t// A copy over a tracked symlink only stays out of `git status` while its skip-worktree bit\n\t\t\t// survives, and some checkout and merge operations clear it.\n\t\t\treturn git.trackingOf(path) === 'tracked'\n\t\t\t\t? { kind: 'copy', status: 'ok', problem: 'unpinned-copy' }\n\t\t\t\t: { kind: 'copy', status: 'ok' }\n\t\t}\n\t}\n}\n\n/**\n * Reports whether every bridge `init` would create for this repository still resolves into\n * `.agents/skills`. Read-only: nothing is created, moved, or repaired, so the caller decides what\n * to run from the repair each finding carries.\n */\nexport function diagnoseBridges({ root, harnesses: preferred = [], cli }: DiagnoseOptions): DiagnoseResult {\n\tconst canonical = join(root, '.agents', 'skills')\n\tconst git = new GitBridgeState(root)\n\tconst bridged = selectHarnesses(root, preferred).filter((harness): harness is Harness & { skillsDirectory: string } =>\n\t\tBoolean(harness.skillsDirectory),\n\t)\n\n\tconst bridges: BridgeReport[] = []\n\tconst divergence: DivergenceReport[] = []\n\tconst findings: BridgeFinding[] = []\n\n\tif (!isDirectory(canonical)) {\n\t\tconst { detail, repair } = repairFor('no-canonical')\n\t\tfindings.push({ path: canonicalPath, detail, repair: repair(canonicalPath, cli) })\n\t}\n\n\tfor (const harness of bridged) {\n\t\tconst path = harness.skillsDirectory\n\t\tconst inspection = inspect(join(root, path), path, canonical, git)\n\t\tbridges.push({ harness: harness.name, path, kind: inspection.kind, status: inspection.status })\n\t\tif (inspection.direction) divergence.push({ path, direction: inspection.direction })\n\t\tif (inspection.problem) {\n\t\t\tconst { detail, repair } = repairFor(inspection.problem)\n\t\t\tfindings.push({ path, detail, repair: repair(path, cli) })\n\t\t}\n\t}\n\n\treturn { bridges, divergence, findings }\n}\n","import { homedir } from 'node:os'\nimport type { cli } from 'clibuilder'\nimport { command, z } from 'clibuilder'\nimport { binPath, parseFormat, writeResult } from '../command-output/command-output.ts'\nimport { type HarnessName, harnessRegistry } from '../harness-registry/harness-registry.ts'\nimport { type DiagnoseResult, diagnoseBridges } from './diagnose-bridges.ts'\nimport { commandInvocation } from './doctor-guidance.ts'\n\ntype DoctorReport = {\n\tbin: string\n\tbridges: DiagnoseResult['bridges']\n\tdivergence?: DiagnoseResult['divergence']\n\t/** The repair is lifted out into `help`, so a finding row stays to the diagnosis itself. */\n\tfindings: Omit<DiagnoseResult['findings'][number], 'repair'>[] | string\n\thelp?: string[]\n}\n\n/**\n * AXI §5: the healthy answer states the zero with context, so an agent does not re-run with other\n * flags to confirm that an empty section really meant \"nothing wrong\".\n */\nexport function buildReport(bin: string, result: DiagnoseResult): DoctorReport {\n\tif (!result.findings.length) {\n\t\tconst count = result.bridges.length\n\t\treturn {\n\t\t\tbin,\n\t\t\tbridges: result.bridges,\n\t\t\tfindings:\n\t\t\t\tcount === 1 ? '0 problems found — the 1 bridge resolves' : `0 problems found — all ${count} bridges resolve`,\n\t\t}\n\t}\n\n\treturn {\n\t\tbin,\n\t\tbridges: result.bridges,\n\t\t...(result.divergence.length ? { divergence: result.divergence } : {}),\n\t\tfindings: result.findings.map(({ path, detail }) => ({ path, detail })),\n\t\thelp: [...new Set(result.findings.map((finding) => `Run \\`${finding.repair}\\``))],\n\t}\n}\n\nexport const doctorCommand: cli.Command = command({\n\tname: 'doctor',\n\tdescription: 'Report whether the harness skill bridges in this repository still resolve. Read-only.',\n\toptions: {\n\t\troot: {\n\t\t\tdescription: 'Repository or package directory. Defaults to the current directory.',\n\t\t\ttype: z.optional(z.string()),\n\t\t},\n\t\tharness: {\n\t\t\tdescription: 'Comma-separated harnesses to check in addition to Claude Code and Cursor, e.g. codex,gemini-cli.',\n\t\t\ttype: z.optional(z.string()),\n\t\t},\n\t\tformat: {\n\t\t\tdescription: 'Output format: toon (default), json, or text for a human-readable report.',\n\t\t\ttype: z.optional(z.string()),\n\t\t\tdefault: 'toon',\n\t\t},\n\t},\n\trun(args) {\n\t\ttry {\n\t\t\tconst format = parseFormat(args.format)\n\t\t\tconst requested = args.harness\n\t\t\t\t?.split(',')\n\t\t\t\t.map((name) => name.trim())\n\t\t\t\t.filter(Boolean)\n\t\t\tconst unsupported = requested?.filter((name) => !harnessRegistry.some((harness) => harness.name === name))\n\t\t\tif (unsupported?.length)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unsupported harness: ${unsupported.join(', ')}. Supported: ${harnessRegistry\n\t\t\t\t\t\t.map((harness) => harness.name)\n\t\t\t\t\t\t.join(', ')}.`,\n\t\t\t\t)\n\t\t\tconst result = diagnoseBridges({\n\t\t\t\troot: args.root ?? process.cwd(),\n\t\t\t\t...(requested?.length ? { harnesses: requested as HarnessName[] } : {}),\n\t\t\t\tcli: commandInvocation,\n\t\t\t})\n\t\t\t// Exit stays 0 even with findings: the diagnosis succeeded, and a non-zero code reads to an\n\t\t\t// agent as \"this command is broken, try something else\".\n\t\t\twriteResult(buildReport(binPath(homedir(), process.argv[1]), result), format)\n\t\t} catch (error) {\n\t\t\tprocess.stderr.write(`error: ${error instanceof Error ? error.message : 'Harness diagnosis failed.'}\\n`)\n\t\t\tprocess.exitCode = 1\n\t\t}\n\t},\n})\n","import { cpSync, lstatSync, mkdirSync, readdirSync, readlinkSync, rmSync, symlinkSync } from 'node:fs'\nimport { dirname, join, relative } from 'node:path'\nimport type { Harness, HarnessName } from '../harness-registry/harness-registry.ts'\n\nfunction skillNames(skillsDirectory: string): string[] {\n\treturn readdirSync(skillsDirectory, { withFileTypes: true })\n\t\t.filter((entry) => entry.isDirectory())\n\t\t.map((entry) => entry.name)\n\t\t.sort()\n}\n\nfunction pathOccupied(path: string): boolean {\n\ttry {\n\t\tlstatSync(path)\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n\nfunction isCorrectLink(target: string, source: string): boolean {\n\treturn lstatSync(target).isSymbolicLink() && readlinkSync(target) === relative(dirname(target), source)\n}\n\n/** Creates the canonical directory when absent, so a fresh repository reports zero skills. */\nexport function countSkills(canonicalSkills: string): number {\n\tmkdirSync(canonicalSkills, { recursive: true })\n\treturn skillNames(canonicalSkills).length\n}\n\nexport type ProjectSkillsOptions = {\n\troot: string\n\tcanonicalSkills: string\n\tharnesses: readonly Harness[]\n\tcopy: boolean\n\tforce: boolean\n}\n\n/**\n * Points every harness that cannot read `.agents/skills` at the canonical directory. Symlinking is\n * preferred; a platform that refuses the link falls back to a copy. Returns the projected harnesses.\n */\nexport function projectSkills({ root, canonicalSkills, harnesses, copy, force }: ProjectSkillsOptions): HarnessName[] {\n\tconst projections = harnesses\n\t\t.filter((harness) => harness.skillsDirectory)\n\t\t.map((harness) => ({\n\t\t\tharness,\n\t\t\ttarget: join(root, harness.skillsDirectory as string),\n\t\t}))\n\n\tconst conflicts = projections\n\t\t.filter(({ target }) => pathOccupied(target) && !isCorrectLink(target, canonicalSkills))\n\t\t.map(({ target }) => target)\n\n\tif (conflicts.length && !force) {\n\t\tthrow new Error(\n\t\t\t`Refusing to replace existing skill targets:\\n${conflicts.map((target) => `- ${target}`).join('\\n')}`,\n\t\t)\n\t}\n\n\tfor (const { target } of projections) {\n\t\tmkdirSync(dirname(target), { recursive: true })\n\t\tif (pathOccupied(target) && isCorrectLink(target, canonicalSkills)) continue\n\t\tif (pathOccupied(target)) rmSync(target, { recursive: true, force: true })\n\t\tif (copy) {\n\t\t\tcpSync(canonicalSkills, target, { recursive: true })\n\t\t\tcontinue\n\t\t}\n\t\ttry {\n\t\t\tsymlinkSync(relative(dirname(target), canonicalSkills), target, 'junction')\n\t\t} catch (error) {\n\t\t\tif (pathOccupied(target)) throw error\n\t\t\tcpSync(canonicalSkills, target, { recursive: true })\n\t\t}\n\t}\n\n\treturn projections.map(({ harness }) => harness.name)\n}\n","import { join } from 'node:path'\nimport { type HarnessName, selectHarnesses } from '../harness-registry/harness-registry.ts'\nimport { countSkills, projectSkills } from '../skill-projection/skill-projection.ts'\n\nexport type InitializeOptions = {\n\troot: string\n\tharnesses?: HarnessName[]\n\tcopy?: boolean\n\tforce?: boolean\n}\nexport type InitializeResult = {\n\troot: string\n\tharnesses: HarnessName[]\n\tnative: HarnessName[]\n\tlinked: HarnessName[]\n\t/** Enabled harnesses whose name has been superseded, as `{ name, replacedBy }`. */\n\tdeprecated: { name: HarnessName; replacedBy: HarnessName }[]\n\tskills: number\n\tcopied: boolean\n}\n\nexport function initializeHarnesses({\n\troot,\n\tharnesses: preferred = [],\n\tcopy = false,\n\tforce = false,\n}: InitializeOptions): InitializeResult {\n\tconst canonicalSkills = join(root, '.agents', 'skills')\n\tconst skills = countSkills(canonicalSkills)\n\tconst harnesses = selectHarnesses(root, preferred)\n\tconst linked = projectSkills({ root, canonicalSkills, harnesses, copy, force })\n\n\treturn {\n\t\troot,\n\t\tharnesses: harnesses.map((harness) => harness.name),\n\t\tnative: harnesses.filter((harness) => !harness.skillsDirectory).map((harness) => harness.name),\n\t\tlinked,\n\t\tdeprecated: harnesses\n\t\t\t.filter((harness) => harness.deprecated)\n\t\t\t.map((harness) => ({ name: harness.name, replacedBy: harness.deprecated as HarnessName })),\n\t\tskills,\n\t\tcopied: copy,\n\t}\n}\n","import type { cli } from 'clibuilder'\nimport { command, z } from 'clibuilder'\nimport { parseFormat, writeResult } from '../command-output/command-output.ts'\nimport { doctorCommand } from '../diagnose-bridges/doctor.command.ts'\nimport { type HarnessName, harnessRegistry } from '../harness-registry/harness-registry.ts'\nimport { initializeHarnesses } from './initialize-harnesses.ts'\n\nexport const initCommand: cli.Command = command({\n\tname: 'init',\n\tdescription: 'Set up canonical agent skills for the harnesses already enabled in a repository.',\n\toptions: {\n\t\troot: {\n\t\t\tdescription: 'Repository or package directory. Defaults to the current directory.',\n\t\t\ttype: z.optional(z.string()),\n\t\t},\n\t\tharness: {\n\t\t\tdescription: 'Comma-separated harnesses to enable in addition to Claude Code and Cursor, e.g. codex,gemini-cli.',\n\t\t\ttype: z.optional(z.string()),\n\t\t},\n\t\tcopy: {\n\t\t\tdescription: 'Copy skills instead of linking them.',\n\t\t\ttype: z.optional(z.boolean()),\n\t\t},\n\t\tforce: {\n\t\t\tdescription: 'Replace conflicting target skill directories.',\n\t\t\ttype: z.optional(z.boolean()),\n\t\t},\n\t\tformat: {\n\t\t\tdescription: 'Output format: toon (default), json, or text for a human-readable report.',\n\t\t\ttype: z.optional(z.string()),\n\t\t\tdefault: 'toon',\n\t\t},\n\t},\n\trun(args) {\n\t\ttry {\n\t\t\tconst format = parseFormat(args.format)\n\t\t\tconst requested = args.harness\n\t\t\t\t?.split(',')\n\t\t\t\t.map((name) => name.trim())\n\t\t\t\t.filter(Boolean)\n\t\t\tconst unsupported = requested?.filter((name) => !harnessRegistry.some((harness) => harness.name === name))\n\t\t\tif (unsupported?.length)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unsupported harness: ${unsupported.join(', ')}. Supported: ${harnessRegistry\n\t\t\t\t\t\t.map((harness) => harness.name)\n\t\t\t\t\t\t.join(', ')}.`,\n\t\t\t\t)\n\t\t\twriteResult(\n\t\t\t\tinitializeHarnesses({\n\t\t\t\t\troot: args.root ?? process.cwd(),\n\t\t\t\t\t...(requested?.length ? { harnesses: requested as HarnessName[] } : {}),\n\t\t\t\t\t...(args.copy === undefined ? {} : { copy: args.copy }),\n\t\t\t\t\t...(args.force === undefined ? {} : { force: args.force }),\n\t\t\t\t}),\n\t\t\t\tformat,\n\t\t\t)\n\t\t} catch (error) {\n\t\t\tprocess.stderr.write(`error: ${error instanceof Error ? error.message : 'Harness initialization failed.'}\\n`)\n\t\t\tprocess.exitCode = 1\n\t\t}\n\t},\n})\n\n// Named for the package rather than shortened to `harness`: `repobuddy` mounts every plugin into one\n// command namespace, where `harness` is generic enough to collide with another plugin's.\nexport const harnessCommand: cli.Command = command({\n\tname: 'agent-harness',\n\tdescription: 'Commands for configuring agent harness compatibility.',\n\tcommands: [initCommand, doctorCommand],\n})\n\nexport function activate({ addCommand }: { addCommand(command: typeof harnessCommand): void }): void {\n\taddCommand(harnessCommand)\n}\n"],"mappings":";;;;;;;AAKA,MAAM,UAAmC;CAAC;CAAQ;CAAQ;AAAM;;AAGhE,SAAgB,YAAY,OAAyC;CACpE,IAAI,CAAC,QAAQ,SAAS,KAAqB,GAAG,MAAM,IAAI,MAAM,uCAAuC;CACrG,OAAO;AACR;;AAGA,SAAgB,YAAY,OAAe,QAA4B;CACtE,QAAQ,OAAO,MAAM,GAAG,aAAa,OAAO,MAAM,EAAE,GAAG;AACxD;AAEA,SAAS,aAAa,OAAe,QAA8B;CAClE,IAAI,WAAW,QAAQ,OAAO,KAAK,UAAU,KAAK;CAClD,OAAO,WAAW,SAAS,WAAW,KAAK,IAAI,OAAO,KAAK;AAC5D;AAEA,SAAS,SAAS,OAAkD;CACnE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC3E;AAEA,SAAS,KAAK,OAAwB;CACrC,OAAO,UAAU,KAAA,IAAY,KAAK,OAAO,KAAK;AAC/C;;AAGA,SAAS,MAAM,MAA2C;CACzD,MAAM,UAAU,CAAC,GAAG,IAAI,IAAI,KAAK,SAAS,QAAQ,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC;CACpE,MAAM,SAAS,QAAQ,KAAK,WAAW,KAAK,IAAI,OAAO,QAAQ,GAAG,KAAK,KAAK,QAAQ,KAAK,IAAI,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC;CAC9G,MAAM,QAAQ,WACb,KAAK,OAAO,KAAK,OAAO,UAAU,MAAM,OAAO,OAAO,MAAgB,CAAC,CAAC,CAAC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