@iseoane/agent-depot 0.2.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 (36) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/LICENSE +21 -0
  3. package/README.md +465 -0
  4. package/package.json +69 -0
  5. package/skills/doctor-md-agents/README.md +51 -0
  6. package/skills/doctor-md-agents/SKILL.md +275 -0
  7. package/skills/doctor-md-agents/references/rule-model.md +56 -0
  8. package/skills/doctor-md-agents/references/structure.md +89 -0
  9. package/skills/doctor-md-agents/scorers/adherence.md +73 -0
  10. package/skills/doctor-md-agents/scorers/rule-value.md +49 -0
  11. package/skills/doctor-md-agents/scripts/collect_sessions.py +1135 -0
  12. package/skills/doctor-md-agents/scripts/extract_rules.py +704 -0
  13. package/skills/doctor-md-agents/scripts/render_report.py +644 -0
  14. package/skills/doctor-md-agents/scripts/scan_corrections.py +781 -0
  15. package/skills/doctor-md-agents/scripts/test_collect_sessions.py +780 -0
  16. package/skills/doctor-md-agents/scripts/test_extract_rules.py +530 -0
  17. package/skills/doctor-md-agents/scripts/test_render_report.py +383 -0
  18. package/skills/doctor-md-agents/scripts/test_scan_corrections.py +343 -0
  19. package/skills/doctor-md-agents/scripts/test_verify_citations.py +236 -0
  20. package/skills/doctor-md-agents/scripts/testdata/old_extract_rules_pre_t1.py.txt +507 -0
  21. package/skills/doctor-md-agents/scripts/verify_citations.py +217 -0
  22. package/skills/doctor-md-skill/README.md +27 -0
  23. package/skills/doctor-md-skill/SKILL.md +212 -0
  24. package/skills/doctor-md-skill/assets/pierre-diffs.js +1531 -0
  25. package/skills/doctor-md-skill/references/skill-improvements.md +32 -0
  26. package/skills/doctor-md-skill/references/supported-harnesses.md +44 -0
  27. package/skills/doctor-md-skill/scorers/code-quality.md +41 -0
  28. package/skills/doctor-md-skill/scorers/efficiency.md +38 -0
  29. package/skills/doctor-md-skill/scripts/collect_sessions.py +1112 -0
  30. package/skills/doctor-md-skill/scripts/detect_machine_sessions.py +315 -0
  31. package/skills/doctor-md-skill/scripts/render_report.py +545 -0
  32. package/skills/doctor-md-skill/scripts/test_collect_sessions.py +593 -0
  33. package/skills/doctor-md-skill/scripts/test_detect_machine_sessions.py +181 -0
  34. package/skills/doctor-md-skill/scripts/test_render_report.py +241 -0
  35. package/skills/doctor-md-skill/scripts/test_verify_citations.py +196 -0
  36. package/skills/doctor-md-skill/scripts/verify_citations.py +221 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,30 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.2.0] - 2026-09-30
9
+
10
+ ### BREAKING
11
+
12
+ - Node.js >= 24 (Active LTS) is now required. See `docs/adr/0002-node-24-lts-minimum.md`.
13
+ - The package is now published as `@iseoane/agent-depot` (the `agent-depot` command is unchanged).
14
+
15
+ ### Added
16
+
17
+ - `agent-depot tui`: interactive terminal UI with Sources, Catalog, Installations and Updates views (requires an interactive terminal).
18
+ - `agent-depot skill remove <id|path>... [--host <host>...]`: remove managed user-global Skills, or only selected hosts.
19
+ - `agent-depot skill host add <id|path> --host <host>...`: add hosts to an installed Skill.
20
+ - `agent-depot uninstall --unmanaged-skill <exact-global-path>...`: remove unmanaged user-global Skills.
21
+ - `agent-depot --version` (and `-v`); the TUI header shows the version.
22
+ - MIT license and npm package metadata; CI runs typecheck, lint, unit tests, a TUI end-to-end test in a real pseudo-terminal, and a pack smoke test.
23
+
24
+ ### Changed
25
+
26
+ - `package.json` is the single source of the package version; `src/version.ts` was removed.
27
+
28
+ ## [0.1.0]
29
+
30
+ - Initial private release: Git Source catalog, discovery, project and user-global installation, updates and uninstall.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 iseoane
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,465 @@
1
+ # Agent Depot
2
+
3
+ Agent Depot keeps a global catalog of Git Sources for future skill discovery.
4
+
5
+ Requires Node.js >= 24 (Active LTS). The [interactive TUI](#interactive-tui)
6
+ needs an interactive terminal.
7
+
8
+ ## Install
9
+
10
+ Agent Depot is published as the scoped package `@iseoane/agent-depot` and exposes the
11
+ `agent-depot` command. It requires Node.js >= 24.
12
+
13
+ ```sh
14
+ # Run without installing
15
+ npx @iseoane/agent-depot --version
16
+ npx @iseoane/agent-depot tui
17
+ pnpm dlx @iseoane/agent-depot tui
18
+
19
+ # Or install globally
20
+ npm install --global @iseoane/agent-depot
21
+ pnpm add --global @iseoane/agent-depot
22
+ agent-depot --version
23
+ ```
24
+
25
+ The examples below use the `agent-depot` command; `npx @iseoane/agent-depot <args>`
26
+ works the same way without a global install.
27
+
28
+ ### Updating
29
+
30
+ `npx` may reuse a cached copy of an older version. Add `@latest` to force the newest
31
+ release:
32
+
33
+ ```sh
34
+ npx @iseoane/agent-depot@latest tui
35
+ pnpm dlx @iseoane/agent-depot@latest tui
36
+ ```
37
+
38
+ A global install is updated with the package manager that installed it:
39
+
40
+ ```sh
41
+ npm install --global @iseoane/agent-depot@latest
42
+ pnpm add --global @iseoane/agent-depot@latest
43
+ ```
44
+
45
+ A running Agent Depot never downgrades built-in Skills: a Skill installed by a newer
46
+ Agent Depot is reported as not updatable (update Agent Depot first).
47
+
48
+ ## Usage
49
+
50
+ With the package installed (or via `npx @iseoane/agent-depot`):
51
+
52
+ ```sh
53
+ agent-depot source list
54
+ agent-depot source add https://github.com/example/skills.git
55
+ agent-depot source refresh git:<source-id>
56
+ agent-depot source refresh git:<source-id> --yes
57
+ agent-depot source remove git:<source-id> --yes
58
+ agent-depot source remove git:<source-id> --skill <id|path> --yes
59
+ agent-depot source migrate git:<old-source-id> git:<new-source-id> --skill <path> --yes
60
+ agent-depot discover builtin:agent-depot git:<source-id>
61
+ agent-depot install --scope project --source builtin:agent-depot --skill architecture --host pi --version latest --portable-v1 --yes
62
+ agent-depot install --scope user-global --source builtin:agent-depot --skill architecture --host pi --version latest --portable-v1 --yes
63
+ # Only for an explicitly reviewed, untracked real-directory conflict:
64
+ agent-depot install --scope project --source builtin:agent-depot --skill architecture --host pi --version latest --portable-v1 --overwrite --yes
65
+ agent-depot install --scope project --manifest --portable-v1 --yes
66
+ agent-depot update check --scope project
67
+ agent-depot update apply --scope project --all --yes
68
+ agent-depot update apply --scope user-global --skill 0 --yes
69
+ agent-depot skill remove <id|path>... --yes
70
+ agent-depot skill remove <id|path> --host <host>... --yes
71
+ agent-depot skill host add <id|path> --host <host>... --yes --confirm-additional-host
72
+ agent-depot uninstall --cli
73
+ agent-depot uninstall --skills --yes
74
+ agent-depot uninstall --unmanaged-skill <exact-global-path> --yes
75
+ agent-depot uninstall --data --yes
76
+ agent-depot tui
77
+ agent-depot --version
78
+ ```
79
+
80
+ Refresh first prints the registered URL as a preview. It requires explicit
81
+ `--yes` confirmation before any network access and otherwise fails closed. The
82
+ package-owned `builtin:agent-depot` Source is listed as read-only and cannot be
83
+ refreshed.
84
+
85
+ Source removal is user-global only and never reads project manifests or deletes
86
+ Source caches. It previews every dependent user-global Skill and keeps all of them
87
+ tracked by default. Pass `--skill <id|path>` for a selected subset or `--all` for
88
+ every dependent Skill. Numeric indexes are accepted for the dependent list, but a
89
+ literal digit-only Skill path takes precedence over its numeric index. Skill
90
+ deletion always requires `--yes`; adopted content and content that is locally
91
+ modified (or lacks a trusted baseline) receive warnings.
92
+ Preflight rejects unsafe paths, unexpected links, missing installations, overlapping
93
+ selected targets, and other inspection failures before changing the Source state or
94
+ deleting any Skill. A second preflight compares each target's content digest,
95
+ adoption flag, and modified status before the first deletion.
96
+
97
+ `skill remove <id|path>...` removes selected user-global managed Skills without
98
+ touching their Source. Each `<id|path>` is the exact Skill path or its final path
99
+ segment when that is unique; unknown or ambiguous selections fail before anything
100
+ changes. It previews every deletion (with adopted/modified warnings), requires
101
+ `--yes`, rechecks the targets, then deletes the files and their installation
102
+ records. It is user-global only: project installations and manifests are never
103
+ read or changed, and the Git cache is retained.
104
+
105
+ `skill host add <id|path> --host <host>... [--yes] [--confirm-additional-host]`
106
+ exposes an already installed user-global Skill to more Hosts without changing its
107
+ content or version, then records the new Hosts. Non-Claude Hosts share the
108
+ canonical `~/.agents/skills/<skill>` location and Claude is a symlink to it, so
109
+ only a missing Claude symlink is ever created. The preview lists the new
110
+ locations; because it exposes the Skill to more Hosts it needs both `--yes` and
111
+ `--confirm-additional-host`. It refuses a Claude location that already holds
112
+ anything other than the managed symlink, and a Skill that is not installed at the
113
+ canonical location (exposing it would require copying it).
114
+
115
+ `skill remove <id|path> --host <host>... [--yes]` removes only those Hosts. Only
116
+ the managed Claude symlink can be deleted this way; the canonical directory backs
117
+ every remaining Host (including the Claude symlink) and stays until the last Host
118
+ is removed. Removing every recorded Host is a full removal with the usual
119
+ adopted/modified warnings. The targets are rechecked before deleting and the
120
+ record is updated afterwards. Project installations are not affected.
121
+
122
+ To replace a Source URL, register the new Git Source first, then explicitly migrate
123
+ user-global identities with `source migrate <old-id> <new-id> (--skill <path>... |
124
+ --all) [--yes]`. Migration rewrites only selected user-global records: it never
125
+ moves physical installations or rewrites project manifests. Identity collisions are
126
+ rejected. Fixed version policies are retained only when the replacement Source
127
+ provides matching commit evidence; old resolved Source evidence is otherwise
128
+ removed. Content baselines remain tied to the unchanged installation, and
129
+ user-provided methods are retained for review rather than rewritten.
130
+
131
+ ## Uninstall choices
132
+
133
+ Uninstall is user-global only and never reads or changes project manifests. The
134
+ choices are independent: `--skills` removes all managed user-global Skills,
135
+ `--unmanaged-skill <exact-global-path>` removes only explicitly selected unmanaged
136
+ real directories below `~/.agents/skills` or `~/.claude/skills`, `--data` removes
137
+ the catalog/configuration state file, and `--cli` prints a package-manager handoff
138
+ for removing the persistent CLI. Unmanaged removal never searches or infers a
139
+ Source, refuses symlinks, transient/backup paths, invalid trees, managed paths,
140
+ and overlaps, and permanently deletes only after moving the unchanged tree to
141
+ same-parent staging. Skills and catalog data are preserved when their flags are
142
+ omitted. Removing Skills reconciles their installation records; removing data
143
+ while retaining Skills leaves those Skills untracked. Every filesystem deletion
144
+ requires `--yes` after the complete preview, and the unmanaged preview warns that
145
+ Agent Depot cannot guarantee recovery without a resolvable Source. Immediately
146
+ before each destructive removal, Agent Depot rereads managed installation records
147
+ and fails closed if they changed or now claim the selected path. The source-state
148
+ store serializes cooperating updates, but a non-cooperating process can still race
149
+ between the final check and filesystem rename/delete; staging failures restore the
150
+ original path when the result is known and otherwise retain the staged path with an
151
+ uncertain-status error. Agent Depot never invokes or infers a package manager, and
152
+ Git Source caches are retained. `uninstall --cli` prints the exact commands
153
+ (`npm uninstall --global @iseoane/agent-depot`, `pnpm remove --global @iseoane/agent-depot`);
154
+ `npx`/`pnpm dlx` runs need no uninstall, only a cache entry.
155
+
156
+ ## Batch updates
157
+
158
+ Check either independent installation scope before applying updates:
159
+
160
+ ```sh
161
+ agent-depot update check --scope project
162
+ agent-depot update check --scope user-global
163
+ ```
164
+
165
+ The check reports `Updateable`, `Current`, and `Unknown` managed Skills separately. `Unknown`
166
+ means a recorded managed selection could not be assessed safely (for example, its
167
+ Source or version evidence is unavailable); it remains managed but is not
168
+ updateable. For `--scope user-global` only, the check also reports `Unmanaged`
169
+ real Skill directories found at exact absolute locations below the supported
170
+ user-global roots. These are not update candidates, are not included in the
171
+ managed status counts, and are never looked up through a Source. Project checks
172
+ do not inventory or report unmanaged directories.
173
+
174
+ Skipped or unsafe global entries are shown separately with guidance and are not
175
+ Unmanaged entries or removal candidates. They may be symlinks, unsafe roots or
176
+ Skill files, or transient Agent Depot paths; inspect them manually. The later
177
+ unmanaged-removal workflow requires its own exact-path preview and explicit
178
+ confirmation.
179
+
180
+ Apply all updateable Skills or select one or more by their printed update ID, numeric
181
+ index, or an unambiguous Skill path:
182
+
183
+ ```sh
184
+ agent-depot update apply --scope project --all --yes
185
+ agent-depot update apply --scope user-global --skill 0 --yes
186
+ ```
187
+
188
+ A Skill tracked at a non-canonical project path (outside `.agents/skills/<name>` and
189
+ `.claude/skills/<name>`) is repository-controlled, so `--yes` alone does not update it. The
190
+ preview prints the relative path; repeat it with `--confirm-path` (once per such path):
191
+
192
+ ```sh
193
+ agent-depot update apply --scope project --all --yes --confirm-path vendor/alpha
194
+ ```
195
+
196
+ Applying always previews each selected candidate first. `--yes` is required and
197
+ confirms each candidate independently; without it, no files or state are
198
+ changed. Modified installations are called out and are never overwritten
199
+ without that explicit confirmation. External update commands show their exact
200
+ argument vector, working directory, target, declared changes, and a warning
201
+ that side effects cannot be verified or rolled back. Unknown-version Skills are
202
+ reported but cannot be selected for application, and independent failures are
203
+ summarized after the remaining candidates finish.
204
+
205
+ `discover` requires one or more Source IDs on every invocation. Use
206
+ `source list` to find registered IDs. It reads the current cached Git mirror
207
+ HEAD without refreshing it, so run `source refresh <id> --yes` first when a
208
+ mirror is unavailable or stale. It prints one tab-separated `Candidate:` line
209
+ per recognized Skill in this format:
210
+
211
+ ```text
212
+ Candidate: <source-id>\t<skill-path>\t<name>\t<description>
213
+ ```
214
+
215
+ Discovery only presents candidates. It does not persist Source selection,
216
+ select candidates, or install anything automatically.
217
+
218
+ ## User-global installation
219
+
220
+ User-global installations use the same canonical Host locations under the user
221
+ home directory (`.agents/skills/<skill>` and, when requested, a Claude symlink
222
+ at `.claude/skills/<skill>`). They are independent from project manifests and
223
+ are recorded in the shared per-user Source state, so separate CLI invocations
224
+ reuse the same installation records. The selected Source, Skill, Hosts, and
225
+ actual adopted or installed location are previewed before `--yes` confirmation.
226
+
227
+ A direct project or user-global install can configure its install method before
228
+ first installation with `--method <json>`. The value must be one strict JSON
229
+ method object, for example:
230
+
231
+ ```sh
232
+ agent-depot install --scope user-global --source builtin:agent-depot \
233
+ --skill architecture --host pi --version latest \
234
+ --method '{"kind":"command","argv":["node","scripts/install.mjs"],"cwd":"tools"}' \
235
+ --portable-v1 --yes
236
+ ```
237
+
238
+ The method is stored as `methods.install`, takes precedence over Source metadata,
239
+ and is executed from an argument vector without a shell. The command and
240
+ intended changes are previewed before confirmation. This option only configures
241
+ the install method; update execution is not part of this lifecycle.
242
+
243
+ ## Project installation
244
+
245
+ Project installation requires an explicit `--scope project`, Source ID, Skill
246
+ path, one or more `--host` values (`pi`, `claude`, `codex`, or `opencode`), and
247
+ a version policy (`--version latest` or `--version fixed:<value>`). External
248
+ Sources require a fixed 40- or 64-character Git commit. For the built-in
249
+ Source, `latest` tracks the installed Agent Depot package, while a fixed policy
250
+ is accepted only when its value exactly equals that package's current version;
251
+ other values fail closed because the requested package version cannot be
252
+ reproduced. The built-in Source does not support `--ref`, and the CLI rejects it
253
+ explicitly. External `latest` may track an explicit mutable safe ref, but an
254
+ immutable commit ref must use a fixed policy matching that commit. The
255
+ `--portable-v1` flag requires the validated portable format rule; compatibility
256
+ is derived from source bytes and exclusions rather than trusted from a caller
257
+ assertion. A skill-relative `agents/` directory is supported: its files remain
258
+ inside the selected Skill tree and are installed at
259
+ `.agents/skills/<skill>/agents/`, rather than being treated as a Host-level
260
+ `agents/` directory. Other Host-specific top-level directories such as
261
+ `.claude`, `.codex`, `.opencode`, `.pi`, `extensions`, `plugins`, and `mcp`
262
+ remain outside the portable V1 format.
263
+
264
+ The CLI reads the selected immutable Skill tree before asking for `--yes`.
265
+ Portable incompatibilities are rejected before confirmation or any write, with
266
+ the rejected source path and reason shown in the error. The inspected destination
267
+ identity and content are carried through confirmation and checked again immediately
268
+ before replacement; drift aborts without moving the target. A successful preview
269
+ lists the exact selected files, including supported skill-relative agents
270
+ files, and only a confirmed `--yes` proceeds to installation.
271
+
272
+ A confirmed installation writes `agent-depot.json` in the project root. The
273
+ manifest stores built-in identity or an external canonical URL, Skill path,
274
+ version policy, and Hosts, so `install --scope project --manifest` can resolve
275
+ it without the global Source catalog. Portable manifests reject local path
276
+ Sources because their identity is not independently resolvable. External Git
277
+ Sources are refreshed only
278
+ after confirmation.
279
+
280
+ The complete Skill tree is copied byte-for-byte and executable modes are preserved.
281
+ Before confirmation, existing Host locations are inspected and conflicts are shown.
282
+ Identical content is adopted in place; a Skill already recorded as managed must be
283
+ changed with `update apply`, not a repeat install. By default, no existing path is
284
+ overwritten. For an untracked, real directory whose content differs, replacement
285
+ requires both `--overwrite` and `--yes`:
286
+
287
+ ```sh
288
+ agent-depot install --scope project --source builtin:agent-depot \
289
+ --skill architecture --host pi --version latest --portable-v1 --overwrite --yes
290
+ ```
291
+
292
+ The preview is explicit about this distinction: without `--yes`, zero files or
293
+ installation state are changed; with both flags, it reports that the target will
294
+ be replaced and shows the `.agent-depot-backup-<generated-suffix>` backup pattern.
295
+ The same contract applies to `--scope user-global`. Symlinks, special files,
296
+ unsafe trees, ambiguous Claude locations, and races between preview and mutation
297
+ fail closed. Replacement first moves the exact original directory to a persistent
298
+ backup beside the installation, then installs the immutable preview tree. The CLI
299
+ prints the backup path; successful backups are never deleted automatically. Filesystem
300
+ replacement and manifest/global-state failures are restored in-process before the
301
+ error is returned. Rollback verifies the retained backup and replacement content
302
+ before deleting the replacement and fails closed when either has changed. These are
303
+ the strongest portable filesystem checks available, not an atomic cross-process
304
+ compare-and-swap: an external writer can still race after the final check, so Agent
305
+ Depot does not claim to serialize concurrent writers. This is not crash recovery: a
306
+ process crash after the original is moved can leave the retained
307
+ `.agent-depot-backup-*` directory with no guaranteed replacement state. Stop the CLI,
308
+ inspect the backup and target, and manually rename the retained backup back to the intended installation path when recovery is needed;
309
+ then rerun the install. External installation methods run only after the filesystem
310
+ and selected-scope state transaction succeeds.
311
+ Claude is exposed through a symlink to the canonical `.agents/skills/<skill>`
312
+ installation.
313
+
314
+ ## User-provided installation methods
315
+
316
+ A project selection may persist portable install and future-update methods in
317
+ its `methods` field:
318
+
319
+ ```json
320
+ {
321
+ "source": { "kind": "external", "url": "https://example.com/skills.git", "ref": "main" },
322
+ "path": "portable/example",
323
+ "version": { "policy": "latest" },
324
+ "hosts": ["pi"],
325
+ "methods": {
326
+ "install": { "kind": "command", "argv": ["node", "scripts/install.mjs"], "cwd": "tools" },
327
+ "update": { "kind": "command", "argv": ["node", "scripts/update.mjs"] }
328
+ }
329
+ }
330
+ ```
331
+
332
+ The same selection shape is stored under `userGlobalInstallations` in the
333
+ shared user-global `sources.json` state. `methods.install` takes precedence
334
+ over a method declared by the selected Source; the Source method is used only
335
+ when no configured install method exists. The configured `update` method is
336
+ currently persisted only; update execution belongs to the update workflow.
337
+
338
+ Before any configured or Source method runs, the CLI previews the exact argv,
339
+ resolved project or user-global cwd, selected files, and intended installation
340
+ locations. It requires explicit `--yes`; refusing the preview performs no
341
+ installation and runs no method. Methods are argument vectors, never shell
342
+ strings: they must use one portable command with no OS-specific variants, and
343
+ shell interpreters and shell syntax are rejected. Configuration must not contain
344
+ credential literals. Validation rejects obvious credential patterns on a
345
+ best-effort basis; it cannot detect every secret, so users remain responsible
346
+ for avoiding secrets in arguments or repository files.
347
+
348
+ A confirmed method runs as arbitrary child-process code with no sandbox. It may
349
+ change any filesystem location or external system available to that process;
350
+ Agent Depot cannot preview or roll back those side effects. The managed Skill
351
+ installation and manifest/state are persisted before method execution, and a
352
+ method failure retains those records. Source metadata is read from the same
353
+ immutable tree snapshot shown in the preview, not from a mutable latest re-read.
354
+
355
+ A Source may declare an installation method only through an explicit JSON
356
+ metadata file inside the selected Skill (`.agent-depot.json`,
357
+ `agent-depot-method.json`, or `installation-method.json`), never from
358
+ `SKILL.md` prose. The file may contain either the method object or
359
+ `{ "method": { "kind": "command", "argv": ["executable", "arg", ...],
360
+ "cwd": "optional/project-relative-directory" } }`. The executable must be a
361
+ bare safe command name and `cwd` must remain below the project root after
362
+ realpath resolution. A confirmed method still goes through compatibility
363
+ validation, canonical installation, and the Claude symlink path. Method-
364
+ containing batch installs are refused because arbitrary child-process side
365
+ effects are non-rollbackable. Manifest entries that identify an external local
366
+ path are refused by the Git-only resolver with an actionable unsupported-source
367
+ error; URL Sources remain self-contained and resolvable on a fresh machine.
368
+
369
+ ## Interactive TUI
370
+
371
+ ```sh
372
+ agent-depot tui
373
+ ```
374
+
375
+ The TUI is an [Ink](https://github.com/vadimdemedes/ink) (React for terminals)
376
+ front end over the same operations as the CLI. It needs Node.js >= 24 and an
377
+ interactive terminal; otherwise `tui` fails with an error. Switch views with
378
+ `1`-`4`, quit with `q` (not while a prompt is open). Every list scrolls when it is
379
+ taller than the terminal. `j`/`k` or the arrow keys move.
380
+
381
+ | View | Purpose |
382
+ | --- | --- |
383
+ | 1 Sources | Where skills come from: the fixed built-in Source plus registered Git Sources. |
384
+ | 2 Catalog | Skills that can be installed: those not installed yet, as Source, then Skills. |
385
+ | 3 Installations | What is on disk: managed installations (user-global and project) and unmanaged user-global skills. |
386
+ | 4 Updates | Managed skills with a newer version available, for user-global and project scope. |
387
+
388
+ Keys per view (prompts also accept `Esc` to cancel and `y`/`n` to confirm):
389
+
390
+ | View | Keys |
391
+ | --- | --- |
392
+ | Sources | `space` mark, `a` mark all, `Enter` open the Source in the Catalog, `n` add a Git Source, `r` refresh the marked (or highlighted) Sources, `d` remove |
393
+ | Catalog | `Enter`/arrows expand and collapse, `space` mark, `a` mark all listed, `i` install the marks (or the highlighted skill), `/` filter, `s` toggle one Source or all (when opened from a Source) |
394
+ | Installations | `Enter`/arrows expand and collapse, `u` uninstall (all Hosts or chosen Hosts) or remove an unmanaged skill, `h` or `i` add Hosts to an installation, `A` or `Enter` adopt an unmanaged skill, `space` marks a leaf and `a` marks all visible leaves: with marks, `u` and `h` act on all of them with one combined preview and one confirmation (project installations are skipped with a reason) |
395
+ | Updates | `space` mark, `a` mark all, `t`/`p`/`g` show all, project or user-global, `Enter` preview the marks, `r` check again, arrows fold the "cannot assess" line |
396
+
397
+ Safety model:
398
+
399
+ - Nothing is written before a preview and an explicit `y`. Exposing a skill to an
400
+ additional Host needs a second, separate confirmation, like `--confirm-additional-host`.
401
+ - An install refreshes its Git Source before the preview, so the content you
402
+ confirm is the content that is applied. The Updates view refreshes
403
+ the Git Sources in use when you enter it and on `r`.
404
+ - The built-in Source is fixed: it is shown as an unselectable row and cannot be
405
+ refreshed or removed.
406
+ - Removal is user-global only. Project installations are listed, but project
407
+ uninstall is not supported (`u` on a project row shows a message).
408
+ - Unmanaged skills are removed only from the paths listed in the preview. A symlink
409
+ is removed as a link; its target is never touched.
410
+ - Batch installs and removals apply item by item; one failure does not stop the
411
+ others and each item reports its own result.
412
+
413
+ See [CONTEXT.md](CONTEXT.md) for the domain terms and [docs/adr](docs/adr) for the
414
+ decisions behind the TUI.
415
+
416
+ ## Configuration and cache
417
+
418
+ The Source catalog and user-global installation records are stored together at:
419
+
420
+ - Linux and other Unix platforms: `$XDG_STATE_HOME/agent-depot/sources.json`,
421
+ or `~/.local/state/agent-depot/sources.json` when `XDG_STATE_HOME` is unset.
422
+ - Windows: `%APPDATA%/Agent Depot/sources.json` (falling back to the user
423
+ `AppData/Roaming` directory).
424
+
425
+ Git mirrors are cached separately from the catalog:
426
+
427
+ - Linux and other Unix platforms: `$XDG_CACHE_HOME/agent-depot/git-sources`,
428
+ or `~/.cache/agent-depot/git-sources`.
429
+ - Windows: `%LOCALAPPDATA%/Agent Depot/git-sources`.
430
+
431
+ ## Limitations
432
+
433
+ Only Git repository URLs using `git:`, `http:`, `https:`, or `ssh:` are
434
+ accepted. Refresh uses the registered URL and runs Git with argument arrays,
435
+ without a shell. It creates or fetches a bare mirror, explicitly synchronizes
436
+ all refs, and prunes deleted refs; it does not check out files, install skills,
437
+ or choose Sources automatically. Network access is required for a confirmed
438
+ refresh.
439
+
440
+ ## Development
441
+
442
+ From a source checkout, build and run the CLI directly:
443
+
444
+ ```sh
445
+ pnpm install
446
+ pnpm build
447
+ node dist/src/cli.js --version
448
+ ```
449
+
450
+ ## Static analysis
451
+
452
+ [Fallow](https://docs.fallow.tools) 3.30.0 runs through `npx --yes fallow@3.30.0`
453
+ (pinned, no dependency installed) and reads `.fallowrc.json`, which defines the
454
+ entry points and the module-layer boundaries (`cli` -> `application` -> `core`
455
+ -> `infrastructure`; imports may only point downward).
456
+
457
+ - `pnpm audit:dead-code`: unused files, exports and dependencies, plus
458
+ boundary violations. Must be clean.
459
+ - `pnpm audit:dupes`: code duplication (threshold 6%).
460
+ - `pnpm audit:health`: complexity and CRAP scores using real coverage; fails
461
+ when the health score drops below 85.
462
+ - `pnpm audit:all`: runs the three checks in order.
463
+ - `pnpm test:coverage`: runs the tests with built-in V8 coverage
464
+ (`NODE_V8_COVERAGE`, source maps) into `coverage/v8`, which Fallow reads.
465
+ It rebuilds `dist/` with source maps; no extra dependencies are needed.
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@iseoane/agent-depot",
3
+ "version": "0.2.0",
4
+ "description": "A cross-platform catalog for reusable coding-agent skills.",
5
+ "license": "MIT",
6
+ "author": "iseoane",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/iseoane/agent-depot.git"
10
+ },
11
+ "homepage": "https://github.com/iseoane/agent-depot#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/iseoane/agent-depot/issues"
14
+ },
15
+ "keywords": [
16
+ "agent",
17
+ "skills",
18
+ "coding-agent",
19
+ "cli",
20
+ "tui",
21
+ "catalog"
22
+ ],
23
+ "bin": {
24
+ "agent-depot": "dist/src/cli.js"
25
+ },
26
+ "files": [
27
+ "dist/src",
28
+ "skills",
29
+ "README.md",
30
+ "LICENSE",
31
+ "CHANGELOG.md"
32
+ ],
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "type": "module",
37
+ "engines": {
38
+ "node": ">=24"
39
+ },
40
+ "scripts": {
41
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
42
+ "typecheck": "tsc --noEmit",
43
+ "lint": "eslint \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\"",
44
+ "test": "pnpm build && node --test \"dist/tests/*.test.js\"",
45
+ "test:single": "pnpm build && node -e \"const { spawnSync } = require('node:child_process'); const input = process.argv[1] || 'tests/version.test.ts'; const file = input.replace(/^tests[\\\\/]/, 'dist/tests/').replace(/\\\\.ts$/i, '.js'); process.exit(spawnSync(process.execPath, ['--test', file], { stdio: 'inherit' }).status ?? 1);\"",
46
+ "test:coverage": "node -e \"require('node:fs').rmSync('coverage',{recursive:true,force:true})\" && tsc -p tsconfig.coverage.json && node -e \"const { spawnSync } = require('node:child_process'); process.exit(spawnSync(process.execPath, ['--enable-source-maps','--test','--test-reporter=dot','dist/tests/*.test.js'], { stdio: 'inherit', env: { ...process.env, NODE_V8_COVERAGE: 'coverage/v8' } }).status ?? 1);\"",
47
+ "audit:dead-code": "npx --yes fallow@3.30.0 dead-code --fail-on-issues",
48
+ "audit:dupes": "npx --yes fallow@3.30.0 dupes",
49
+ "audit:health": "pnpm test:coverage && npx --yes fallow@3.30.0 health --coverage coverage/v8 --min-score 85",
50
+ "audit:all": "pnpm audit:dead-code && pnpm audit:dupes && pnpm audit:health",
51
+ "test:e2e": "pnpm build && node --test --test-timeout=120000 \"dist/tests/e2e/*.e2e.test.js\"",
52
+ "prepublishOnly": "pnpm build && pnpm test",
53
+ "test:pack": "pnpm build && node scripts/pack-smoke.mjs"
54
+ },
55
+ "devDependencies": {
56
+ "@eslint/js": "^9.39.2",
57
+ "@homebridge/node-pty-prebuilt-multiarch": "^0.14.1",
58
+ "@types/node": "^24.19.0",
59
+ "@types/react": "^19.3.0",
60
+ "eslint": "^9.39.2",
61
+ "ink-testing-library": "^4.0.0",
62
+ "typescript": "^5.7.2",
63
+ "typescript-eslint": "^8.70.1"
64
+ },
65
+ "dependencies": {
66
+ "ink": "^7.1.1",
67
+ "react": "^19.3.0"
68
+ }
69
+ }
@@ -0,0 +1,51 @@
1
+ # doctor-md-agents
2
+
3
+ Audita los ficheros de instrucciones que se inyectan en cada prompt —`AGENTS.md`, `CLAUDE.md` y los que le indiques— contra el historial real de sesiones locales del propio usuario. Emite un informe HTML con, por regla: cuántas veces fue aplicable, si se obedeció, cuántas veces el usuario tuvo que corregir a mano sobre ese punto, lo que cuesta en tokens, y un veredicto de **mantener / mejorar / borrar**. Después propone las reglas que *faltan*, minadas de correcciones repetidas que ninguna regla actual cubre.
4
+
5
+ Todo corre en local. No sube transcripciones, ficheros de sesión ni instrucciones a ningún sitio.
6
+
7
+ ## Instalación
8
+
9
+ El repositorio es la copia real; la skill se expone mediante symlink:
10
+
11
+ ```bash
12
+ ln -s /path/to/doctor-md-agents ~/.agents/skills/doctor-md-agents
13
+ ```
14
+
15
+ ## Uso
16
+
17
+ Invoca la skill (`doctor-md-agents`) desde tu agente. `SKILL.md` es el contrato completo: 7 pasos, de extraer las reglas a proponer las ediciones. **Nunca modifica los ficheros de instrucciones**; las propuestas van a un directorio temporal y aplicarlas es una decisión aparte.
18
+
19
+ Los argumentos solo preseleccionan respuestas a las preguntas del Paso 0; nunca ejecutan la skill por intención inferida:
20
+
21
+ ```
22
+ /doctor-md-agents --mode restructure --files repo
23
+ ```
24
+
25
+ Este ejemplo concreto queda totalmente dirigido por argumentos: al fijar `--mode restructure` y `--files repo`, y si ningún fichero del repo tiene ya bloques `<important if>`, la skill no pregunta nada — ni siquiera qué conversaciones minar, porque con *Restructure only* cubriendo todos los ficheros seleccionados los Pasos 2–4 nunca se ejecutan.
26
+
27
+ ## Qué mide, y qué no
28
+
29
+ Dos señales con **denominadores distintos**, que nunca se mezclan:
30
+
31
+ - **Correcciones (señal dura).** El usuario corrigiendo al agente. Se minan por patrones sobre el corpus *completo* de la ventana (cientos de sesiones). Evidencia fiable.
32
+ - **Adherencia (señal blanda).** Un modelo juzga, por transcripción muestreada, si una regla aplicable se cumplió. Ruidosa: sirve para ordenar candidatas, nunca por sí sola para borrar una regla.
33
+
34
+ Cada cita del juez se verifica mecánicamente contra la transcripción por subcadena literal. Lo que no se verifica, se descarta.
35
+
36
+ ## Estructura
37
+
38
+ | | |
39
+ |---|---|
40
+ | `SKILL.md` | el contrato que ejecuta el agente |
41
+ | `scorers/` | rúbricas de adherencia y de valor de regla |
42
+ | `references/` | modelo de regla, privacidad, licencia de terceros |
43
+ | `scripts/` | 5 scripts stdlib + 5 suites (95 tests) |
44
+
45
+ ## Tests
46
+
47
+ ```bash
48
+ python3 -m unittest discover -s scripts -p 'test_*.py'
49
+ ```
50
+
51
+ Sin dependencias: stdlib de Python 3.9+.