akm-cli 0.9.29 → 0.9.31

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 (162) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +10 -10
  3. package/ROADMAP.md +112 -0
  4. package/dist/commands/improve/improve-cli.js +33 -12
  5. package/dist/commands/sources/plugin-upgrade.js +46 -23
  6. package/dist/core/file-lock.js +10 -1
  7. package/dist/llm/client.js +33 -3
  8. package/dist/scripts/akm-migrate-node.js +5 -1
  9. package/dist/scripts/akm-migrate.js +5 -1
  10. package/docs/README.md +42 -41
  11. package/docs/agents/README.md +15 -0
  12. package/docs/agents/agent-install.md +14 -0
  13. package/docs/architecture/README.md +67 -0
  14. package/docs/architecture/adapters.md +272 -0
  15. package/docs/architecture/akm-architecture-decision-history.md +2055 -0
  16. package/docs/architecture/akm-core-principles.md +126 -0
  17. package/docs/architecture/architecture.md +579 -0
  18. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
  19. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
  20. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
  21. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
  22. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
  23. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
  24. package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
  25. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
  26. package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
  27. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
  28. package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
  29. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
  30. package/docs/architecture/decisions/README.md +62 -0
  31. package/docs/architecture/improvement.md +440 -0
  32. package/docs/architecture/internals/classification.md +154 -0
  33. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
  34. package/docs/architecture/internals/functional-contract-patterns.md +340 -0
  35. package/docs/architecture/internals/health-advisories.md +110 -0
  36. package/docs/architecture/internals/improve-workflow.md +713 -0
  37. package/docs/architecture/internals/indexing.md +498 -0
  38. package/docs/architecture/internals/registry-network-boundary.md +57 -0
  39. package/docs/architecture/internals/search.md +249 -0
  40. package/docs/architecture/internals/storage-locations.md +943 -0
  41. package/docs/architecture/persisted-data-compat.md +59 -0
  42. package/docs/architecture/reviews/env-secret-access.md +319 -0
  43. package/docs/architecture/runtime-boundary-design.md +153 -0
  44. package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
  45. package/docs/architecture/specs/0.9.0-decisions.md +528 -0
  46. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
  47. package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
  48. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
  49. package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
  50. package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
  51. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
  52. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
  53. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
  54. package/docs/architecture/specs/di-seams-plan.md +539 -0
  55. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
  56. package/docs/architecture/specs/fact-asset-type.md +142 -0
  57. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
  58. package/docs/architecture/specs/okf-support.md +148 -0
  59. package/docs/architecture/specs/ref.md +329 -0
  60. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
  61. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
  62. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
  63. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
  64. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
  65. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
  66. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
  67. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
  68. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
  69. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
  70. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
  71. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
  72. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
  73. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
  74. package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
  75. package/docs/architecture/specs/stash-organization-conventions.md +377 -0
  76. package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
  77. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
  78. package/docs/architecture/specs/workflow-format-unification.md +437 -0
  79. package/docs/architecture/testing/manual-testing-checklist.md +3420 -0
  80. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
  81. package/docs/architecture/testing/task-workflow-manual-tests.md +1817 -0
  82. package/docs/architecture/testing/testing-workflow.md +446 -0
  83. package/docs/architecture/workflow-engine.md +274 -0
  84. package/docs/guides/README.md +33 -0
  85. package/docs/guides/author-bundles.md +310 -0
  86. package/docs/guides/author-workflows.md +520 -0
  87. package/docs/guides/bundles.md +321 -0
  88. package/docs/guides/capture-knowledge.md +136 -0
  89. package/docs/guides/claude-code-vs-akm-workflows.md +30 -0
  90. package/docs/guides/concepts.md +93 -0
  91. package/docs/guides/discover-and-load.md +158 -0
  92. package/docs/guides/getting-started.md +240 -0
  93. package/docs/guides/improve-the-library.md +246 -0
  94. package/docs/guides/knowledge-management.md +18 -0
  95. package/docs/guides/recipes/headless-install.md +97 -0
  96. package/docs/guides/recipes/website-source.md +28 -0
  97. package/docs/guides/run-workflows.md +279 -0
  98. package/docs/guides/scheduling.md +123 -0
  99. package/docs/guides/use-with-any-agent.md +129 -0
  100. package/docs/guides/wikis.md +81 -0
  101. package/docs/maintainers/README.md +19 -0
  102. package/docs/maintainers/curate-workmap.md +336 -0
  103. package/docs/maintainers/eval.md +3 -0
  104. package/docs/maintainers/local-development.md +108 -0
  105. package/docs/maintainers/release-checklist.md +103 -0
  106. package/docs/migration/README.md +2 -2
  107. package/docs/migration/release-notes/0.0.13.md +1 -1
  108. package/docs/migration/release-notes/0.1.0.md +1 -1
  109. package/docs/migration/release-notes/0.2.0.md +1 -1
  110. package/docs/migration/release-notes/0.3.0.md +1 -1
  111. package/docs/migration/release-notes/0.5.0.md +1 -1
  112. package/docs/migration/release-notes/0.6.0.md +1 -1
  113. package/docs/migration/release-notes/0.7.0.md +1 -1
  114. package/docs/migration/release-notes/0.7.3.md +2 -2
  115. package/docs/migration/release-notes/0.7.4.md +1 -1
  116. package/docs/migration/release-notes/0.7.5.md +1 -1
  117. package/docs/migration/release-notes/0.8.0.md +1 -1
  118. package/docs/migration/release-notes/0.9.0.md +1 -1
  119. package/docs/migration/release-notes/0.9.14.md +1 -1
  120. package/docs/migration/release-notes/0.9.15.md +1 -1
  121. package/docs/migration/release-notes/0.9.16.md +1 -1
  122. package/docs/migration/release-notes/0.9.17.md +1 -1
  123. package/docs/migration/release-notes/0.9.19.md +1 -1
  124. package/docs/migration/release-notes/0.9.2.md +1 -1
  125. package/docs/migration/release-notes/README.md +27 -31
  126. package/docs/migration/v0.5-to-v0.6.md +759 -0
  127. package/docs/migration/v0.8-to-v0.9.md +1 -1
  128. package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
  129. package/docs/posts/README.md +30 -0
  130. package/docs/posts/akm-command-tour.md +495 -0
  131. package/docs/posts/akm-logo-sized.webp +0 -0
  132. package/docs/posts/belief-aware-memory-12.md +139 -0
  133. package/docs/posts/config-v2-lessons-16.md +191 -0
  134. package/docs/posts/improve-loop-autonomous-10.md +225 -0
  135. package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
  136. package/docs/posts/intro-part-01.md +76 -0
  137. package/docs/posts/intro-part-02.md +221 -0
  138. package/docs/posts/intro-part-03.md +190 -0
  139. package/docs/posts/intro-part-04.md +221 -0
  140. package/docs/posts/llm-mode-reflect-13.md +166 -0
  141. package/docs/posts/openpalm-built-on-akm.md +86 -0
  142. package/docs/posts/progressive-disclosure-06.md +129 -0
  143. package/docs/posts/proposal-safety-net-15.md +112 -0
  144. package/docs/posts/release-0.5.0.md +247 -0
  145. package/docs/posts/release-0.6.0.md +117 -0
  146. package/docs/posts/release-0.7.0.md +159 -0
  147. package/docs/posts/release-0.8.0.md +332 -0
  148. package/docs/posts/scattered-skills-05.md +100 -0
  149. package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
  150. package/docs/posts/team-skills-07.md +198 -0
  151. package/docs/posts/wiki-agent-knowledge-08.md +223 -0
  152. package/docs/posts/workflows-vaults-09.md +321 -0
  153. package/docs/product-surface.md +54 -0
  154. package/docs/reference/README.md +1 -2
  155. package/docs/reference/asset-types.md +168 -0
  156. package/docs/reference/cli.md +5 -6
  157. package/docs/reference/env-and-secrets.md +126 -0
  158. package/docs/reference/memory.md +124 -0
  159. package/docs/reference/refs.md +156 -0
  160. package/docs/reference/registry.md +489 -0
  161. package/docs/reference/website-sources.md +141 -0
  162. package/package.json +12 -15
@@ -0,0 +1,489 @@
1
+ # Registry
2
+
3
+ A registry is a searchable source of bundles that `akm` can discover and
4
+ install from. The default registry type is a static JSON index, but akm
5
+ supports pluggable **registry providers** that can connect to different
6
+ ecosystems (e.g. skills.sh).
7
+
8
+ ## Official Registry
9
+
10
+ akm ships with the official registry pre-configured:
11
+
12
+ ```text
13
+ https://raw.githubusercontent.com/itlackey/akm-registry/main/index.json
14
+ ```
15
+
16
+ The [akm-registry](https://github.com/itlackey/akm-registry) repo publishes
17
+ a static `index.json` (v3 format). It merges three sources:
18
+
19
+ - npm packages with the `akm-stash` keyword
20
+ - GitHub repos with the `akm-stash` topic
21
+ - `manual-entries.json` for curated additions and overrides
22
+
23
+ To submit a bundle, either tag your repo/package as above (auto-discovery)
24
+ or open a pull request against `manual-entries.json` for a curated entry.
25
+
26
+ ### Official onboarding bundle
27
+
28
+ In addition to the registry, akm has an official onboarding bundle —
29
+ [itlackey/akm-stash](https://github.com/itlackey/akm-stash) — that ships
30
+ skills, commands, knowledge, workflows, and a librarian subagent for
31
+ working with akm itself. Install it with:
32
+
33
+ ```bash
34
+ akm bundle add github:itlackey/akm-stash
35
+ akm index
36
+ akm show skills/akm-quickstart
37
+ ```
38
+
39
+ ## Managing Registries
40
+
41
+ Use the `akm registry` subcommand group to manage configured registries:
42
+
43
+ ```bash
44
+ # List configured registries
45
+ akm registry list
46
+
47
+ # Add a third-party registry (static index)
48
+ akm registry add https://example.com/registry/index.json --name my-team
49
+
50
+ # Add a skills.sh registry
51
+ akm registry add https://skills.sh --name skills.sh --provider skills-sh
52
+
53
+ # Remove a registry by URL or name
54
+ akm registry remove my-team
55
+ ```
56
+
57
+ Registries are stored in the `registries` array in your config file:
58
+
59
+ ```jsonc
60
+ {
61
+ "registries": [
62
+ // Static index (default provider)
63
+ { "url": "https://raw.githubusercontent.com/itlackey/akm-registry/main/index.json", "name": "official" },
64
+ { "url": "https://example.com/registry/index.json", "name": "my-team", "enabled": true },
65
+ // skills.sh provider
66
+ { "url": "https://skills.sh", "name": "skills.sh", "provider": "skills-sh" }
67
+ ]
68
+ }
69
+ ```
70
+
71
+ Each entry supports:
72
+
73
+ | Field | Type | Default | Description |
74
+ | --- | --- | --- | --- |
75
+ | `url` | string | (required) | URL of the registry index or API base |
76
+ | `name` | string | -- | Human-friendly label |
77
+ | `enabled` | boolean | `true` | Whether this registry is active |
78
+ | `provider` | string | `"static-index"` | Provider type (see [Registry Providers](#registry-providers)) |
79
+ | `options` | object | -- | Provider-specific options (passed through to the provider) |
80
+
81
+ Set `enabled: false` to temporarily disable a registry without removing it.
82
+
83
+ Registry URLs must be credential-free: AKM rejects URL userinfo such as
84
+ `https://user:password@example.com/index.json` before it can be saved. The
85
+ built-in `static-index` and `skills-sh` providers do not currently support
86
+ authenticated registry requests, including through `options`; publish the
87
+ index/API at a credential-free HTTPS endpoint or place an authenticated proxy
88
+ in front of it. AKM does not translate URL credentials into request headers.
89
+
90
+ Registry HTTP requests must also resolve to public network addresses. AKM
91
+ rejects loopback, private, link-local, metadata, and reserved destinations on
92
+ the initial URL and every redirect hop. This intentionally means a
93
+ `static-index` or `skills-sh` registry hosted only on localhost or an intranet
94
+ is no longer reachable in 0.9.2; publish it at a publicly routable HTTPS
95
+ endpoint. The only private-network compatibility exception is an npm mirror
96
+ explicitly selected with `AKM_NPM_REGISTRY`; metadata and tarball requests may
97
+ reach that configured mirror, but not link-local or cloud-metadata addresses.
98
+ See [Registry network boundary](../architecture/internals/registry-network-boundary.md)
99
+ for the complete policy and DNS guarantee.
100
+
101
+ ## Searching Registries
102
+
103
+ Search registries alongside or instead of the local bundle:
104
+
105
+ ```bash
106
+ # Search registries only
107
+ akm search "deploy" --from registry
108
+
109
+ # Search both the local bundle library and registries
110
+ akm search "deploy" --from all
111
+
112
+ # Include asset-level results from v3 indexes
113
+ akm search "deploy" --from registry --assets
114
+ ```
115
+
116
+ ### Search Results
117
+
118
+ Each registry hit includes:
119
+
120
+ | Field | Description |
121
+ | --- | --- |
122
+ | `type` | Always `"registry"` |
123
+ | `name` | Bundle display name |
124
+ | `id` | Unique identifier (e.g. `npm:@scope/bundle`) |
125
+ | `description` | Summary from the registry |
126
+ | `action` | Ready-to-run next step such as `akm bundle add ... -> then search again` |
127
+ | `quality` | Optional provenance marker — `"generated"`, `"curated"`, or `"proposed"`. Replaces the legacy `curated` boolean removed in 0.7.0 |
128
+
129
+ Use `--detail full` to include ranking metadata like `score`.
130
+
131
+ ### The `--assets` Flag
132
+
133
+ When a registry publishes a v3 index (see below), `akm search --from
134
+ registry` can return individual asset-level hits in addition to bundle-level
135
+ hits. Pass `--assets` to enable this:
136
+
137
+ ```bash
138
+ akm search "code review" --from registry --assets
139
+ ```
140
+
141
+ Asset hits include `assetType`, `assetName`, `description`, and the parent
142
+ `stash` information, so you can install the right bundle and immediately know
143
+ which asset to use.
144
+
145
+ ## Discovery Filtering
146
+
147
+ Not every npm package or GitHub repo is an akm bundle. To keep results
148
+ relevant, the registry enforces tag-based filtering:
149
+
150
+ - **npm** -- Only packages whose `keywords` array includes `"akm-stash"` appear in search results.
151
+ - **GitHub** -- Only repositories with the topic `akm-stash` appear in search results.
152
+
153
+ > **0.6.0 breaking change:** `akm-cli >= 0.6.0` indexes only the
154
+ > `akm-stash` keyword / topic. The pre-0.6.0 `akm-kit` and `agentikit`
155
+ > keywords/topics are **not** honored as fallbacks. Publishers migrating
156
+ > from 0.5.x must add the new tag — see the
157
+ > [migration guide](../migration/v0.5-to-v0.6.md) for the step-by-step
158
+ > publisher checklist.
159
+
160
+ If you are publishing a bundle, add these tags so it can be discovered:
161
+
162
+ ```jsonc
163
+ // package.json
164
+ {
165
+ "keywords": ["akm-stash", "your-other-tags"]
166
+ }
167
+ ```
168
+
169
+ For GitHub repos, add topics via the repository settings page or the
170
+ `gh repo edit --add-topic akm-stash` command.
171
+
172
+ ## Installing
173
+
174
+ Install a bundle with `akm bundle add` using any supported ref format:
175
+
176
+ ```bash
177
+ # npm package
178
+ akm bundle add npm:@scope/my-bundle
179
+
180
+ # npm package (shorthand)
181
+ akm bundle add @scope/my-bundle
182
+
183
+ # GitHub repo
184
+ akm bundle add github:owner/repo
185
+
186
+ # GitHub repo at a specific tag or branch
187
+ akm bundle add github:owner/repo#v1.2.0
188
+
189
+ # GitHub URL
190
+ akm bundle add https://github.com/owner/repo
191
+
192
+ # Any git repo (GitLab, Bitbucket, Gitea, self-hosted, etc.)
193
+ akm bundle add git+https://gitlab.com/org/bundle
194
+ akm bundle add git+https://gitlab.com/org/bundle#v1.0
195
+ akm bundle add git+ssh://git@gitlab.com/org/bundle.git
196
+
197
+ # URLs on known git hosts are treated as git repos
198
+ akm bundle add https://gitlab.com/org/my-bundle
199
+
200
+ # Local directory (path or file: URI)
201
+ akm bundle add ./path/to/local/bundle
202
+ akm bundle add file:../relative/bundle
203
+ akm bundle add file:///absolute/path/to/bundle
204
+ ```
205
+
206
+ ### What Happens During Install
207
+
208
+ 1. **Ref parsing** -- The ref is classified as npm, GitHub/git, website, or
209
+ local directory. Known git hosts and `.git` URLs are git sources; other
210
+ HTTP(S) URLs are website sources.
211
+ 2. **Artifact resolution** -- For npm, the latest (or requested) version
212
+ tarball URL is resolved. GitHub/git refs prefer a shallow clone at the
213
+ resolved revision so normal git credentials work; GitHub API tarballs are a
214
+ fallback when clone resolution is unavailable.
215
+ 3. **Download and extract** -- The tarball is downloaded (or repo cloned) to a
216
+ cache directory under `~/.cache/akm/registry/` and extracted securely
217
+ (path traversal is rejected).
218
+ 4. **Security audit** -- Before install completes, the extracted bundle's
219
+ `env`/`secret` asset **key names** are checked against a denylist of
220
+ process-execution-hijacking variables -- dynamic-linker hooks
221
+ (`LD_PRELOAD`, `DYLD_INSERT_LIBRARIES`, ...), `PATH`, shell/runtime startup
222
+ hooks (`BASH_ENV`, `PROMPT_COMMAND`, `NODE_OPTIONS`, `PYTHONSTARTUP`, ...),
223
+ and interactive-tool overrides (`EDITOR`, `PAGER`, `GIT_SSH_COMMAND`, ...).
224
+ `akm bundle add` **blocks the install** when a dangerous key is present unless
225
+ `--allow-dangerous-env-keys` is set (or you confirm at an interactive prompt).
226
+ This is a **key-name audit only** (plus the path-traversal rejection in step
227
+ 3) -- akm does **not** scan source files, prompts, metadata, or install
228
+ scripts for prompt-injection phrases, shell pipes, or lifecycle hooks.
229
+ 5. **Bundle root detection** -- The extracted contents are scanned for asset
230
+ type directories (`scripts/`, `skills/`, etc.) or a `.stash/` marker. If the
231
+ bundle nests its bundle under an `opencode/` subdirectory, that is detected
232
+ automatically.
233
+ 6. **Selective include** -- If the package's `package.json` contains an
234
+ `akm.include` array, only the listed paths are copied into the
235
+ install cache. This lets a bundle ship a subset of its repo as the bundle.
236
+ 7. **Config registration** -- The desired source descriptor (`path`/`git`/
237
+ `website`/`npm`, `writable`, the original `registryId`) is saved to
238
+ `config.bundles.<key>`. Resolved cache state -- id, source, ref, resolved
239
+ version/revision, integrity, local materialized root, and install
240
+ timestamp -- is recorded separately in `<dataDir>/akm.lock`, never
241
+ duplicated into `config.json`.
242
+ 8. **Re-index** -- `akm index` runs automatically so the new assets appear in
243
+ search immediately.
244
+
245
+ ### Selective Include
246
+
247
+ A bundle can declare which paths to include via `package.json`:
248
+
249
+ ```jsonc
250
+ {
251
+ "akm": {
252
+ "include": [
253
+ "scripts",
254
+ "skills",
255
+ "commands"
256
+ ]
257
+ }
258
+ }
259
+ ```
260
+
261
+ Only the listed paths are copied into the install cache. Paths must be
262
+ relative to the package root and cannot escape it. The `.git` directory is
263
+ always excluded.
264
+
265
+ ## Managing Managed Sources
266
+
267
+ ```bash
268
+ # List all managed sources with their status
269
+ akm bundle list
270
+
271
+ # Update a specific bundle to its latest version
272
+ akm bundle update npm:@scope/my-bundle
273
+
274
+ # Update all managed sources
275
+ akm bundle update --all
276
+
277
+ # Force fresh download even if version is unchanged
278
+ akm bundle update npm:@scope/my-bundle --force
279
+ akm bundle update --all --force
280
+
281
+ # Remove a bundle
282
+ akm bundle remove npm:@scope/my-bundle
283
+ ```
284
+
285
+ ### Cloning Assets
286
+
287
+ Managed sources are cache-managed and may be overwritten by `akm bundle update`.
288
+ To edit an asset from a managed source, clone it into the working bundle:
289
+
290
+ ```bash
291
+ akm clone "npm:@scope/my-bundle//scripts/deploy.sh"
292
+
293
+ # Clone with a new name
294
+ akm clone "npm:@scope/my-bundle//scripts/deploy.sh" --name my-deploy.sh
295
+ ```
296
+
297
+ The cloned asset lives in the working bundle and takes priority over the
298
+ installed version in search and show.
299
+
300
+ Use `--dest` to clone to a custom directory instead of the working bundle:
301
+
302
+ ```bash
303
+ # Deploy a script directly into a project's .claude directory
304
+ akm clone "npm:@scope/my-bundle//scripts/deploy.sh" --dest ./project/.claude
305
+ ```
306
+
307
+ The type subdirectory (`scripts/`, `skills/`, etc.) is appended automatically,
308
+ so the example above produces `./project/.claude/scripts/deploy.sh`.
309
+
310
+ **Remote clone without install:** If the origin in the ref points to a
311
+ package that is not yet installed, `akm clone` fetches it to the cache
312
+ automatically. Unlike `akm bundle add`, this does **not** register the package as
313
+ a managed source -- it only extracts the single requested asset.
314
+
315
+ ## Search Priority
316
+
317
+ `akm search` and `akm show` query a single local FTS5 index that covers
318
+ every configured source's directory. There is no fixed lookup order —
319
+ results are ranked by relevance and utility, and precedence is expressed
320
+ through ranking rather than a per-source fan-out (see
321
+ [concepts.md](../guides/concepts.md#3-akm-builds-a-local-index-and-uses-progressive-disclosure)).
322
+
323
+ When two sources contain an asset with the same name, the working bundle
324
+ typically wins by convention because its files are usually more recent.
325
+ Use `akm clone` to copy an asset into your working bundle for local
326
+ editing — your edits then override the upstream copy in subsequent
327
+ searches.
328
+
329
+ ## Registry Providers
330
+
331
+ akm uses a pluggable provider system for registries. Each registry entry can
332
+ specify a `provider` type that determines how it is searched. When omitted,
333
+ the provider defaults to `"static-index"`.
334
+
335
+ Registries discover installable source bundles. They never store
336
+ asset content directly — installing a bundle creates a regular `bundles`
337
+ entry that the indexer walks like any other source.
338
+
339
+ ### Built-in Providers
340
+
341
+ #### `static-index` (default)
342
+
343
+ Fetches a static JSON v3 index from the configured URL and performs
344
+ client-side scoring. The index is cached locally with a 1-hour TTL. There is
345
+ currently no fallback to a stale cache row past that TTL on fetch failure —
346
+ `fetchCachedJson` (`src/storage/repositories/registry-index-cache-repository.ts`) only
347
+ consults the cache row that its own `getRegistryIndexCache` lookup returned
348
+ under the same TTL, and that lookup returns nothing once the row is older
349
+ than `maxAgeMs`, so a fetch failure after the TTL expires surfaces as an
350
+ error rather than serving older data.
351
+
352
+ ```bash
353
+ akm registry add https://example.com/registry/index.json --name my-team
354
+ ```
355
+
356
+ #### `skills-sh`
357
+
358
+ Searches the [skills.sh](https://skills.sh) registry using its server-side
359
+ search API. Results are skills from GitHub repositories indexed by skills.sh.
360
+
361
+ ```bash
362
+ akm registry add https://skills.sh --name skills.sh --provider skills-sh
363
+ ```
364
+
365
+ Key behaviors:
366
+ - Server-side search via `GET {url}/api/search?q={query}&limit={limit}`
367
+ - Hit IDs are namespaced with `"skills-sh:"` prefix to avoid collisions
368
+ - Scores are normalized from install counts (0-1 range)
369
+ - Per-query response caching with 15-minute TTL
370
+ - No stale-cache fallback past that TTL on network failure — same shared
371
+ cache mechanism as `static-index`, see the note there
372
+ - No authenticated-registry transport is currently supported
373
+ - Toggle on/off via `akm registry add https://skills.sh --name skills.sh --provider skills-sh` / `akm registry remove skills.sh` (the bare `akm enable` / `akm disable` aliases and `akm config enable|disable` were removed in 0.9.0 — use `akm registry add|remove`, the general mechanism)
374
+
375
+ To install a skill found via skills.sh, use the `ref` field (GitHub
376
+ `owner/repo`) with `akm bundle add`:
377
+
378
+ ```bash
379
+ akm bundle add vercel-labs/agent-skills
380
+ ```
381
+
382
+ ## Hosting Your Own Registry
383
+
384
+ A registry is a static JSON file conforming to the registry index schema.
385
+ You can host one on any static file server, CDN, or GitHub Pages.
386
+
387
+ Minimal example:
388
+
389
+ ```json
390
+ {
391
+ "version": 3,
392
+ "updatedAt": "2026-03-12T00:00:00Z",
393
+ "stashes": [
394
+ {
395
+ "id": "github:your-org/deploy-bundle",
396
+ "name": "deploy-bundle",
397
+ "description": "Deployment scripts and skills",
398
+ "ref": "your-org/deploy-bundle",
399
+ "source": "github",
400
+ "tags": ["deploy", "infrastructure"],
401
+ "assetTypes": ["script", "skill", "memory"]
402
+ }
403
+ ]
404
+ }
405
+ ```
406
+
407
+ Host the file at a stable URL and have team members add it:
408
+
409
+ ```bash
410
+ akm registry add https://your-server.com/akm-registry/index.json --name team
411
+ ```
412
+
413
+ To generate the index automatically, use the maintainer script in the akm
414
+ repository:
415
+
416
+ ```bash
417
+ bun scripts/build-registry-index.ts --out dist/index.json
418
+ ```
419
+
420
+ This does not scan the current directory. It fans out to three discovery
421
+ sources -- a manually curated `manual-entries.json`, an npm registry keyword
422
+ search for `akm-stash`, and a GitHub topic search for `akm-stash` -- and
423
+ deduplicates the results into a v3 index with bundle and asset entries. You
424
+ can also use the tooling in the
425
+ [akm-registry](https://github.com/itlackey/akm-registry) repository used by the
426
+ official registry.
427
+
428
+ ## Registry Index v3
429
+
430
+ Version 3 of the registry index schema is the only format `akm-cli >=
431
+ 0.6.0` parses. It carries an `assets` array on each bundle entry so
432
+ clients can perform asset-level search without installing the bundle
433
+ first.
434
+
435
+ ```json
436
+ {
437
+ "version": 3,
438
+ "updatedAt": "2026-03-12T00:00:00Z",
439
+ "stashes": [
440
+ {
441
+ "id": "npm:@scope/my-bundle",
442
+ "name": "my-bundle",
443
+ "description": "Scripts and skills for deployment",
444
+ "ref": "@scope/my-bundle",
445
+ "source": "npm",
446
+ "tags": ["deploy"],
447
+ "assetTypes": ["script", "skill", "memory"],
448
+ "assets": [
449
+ { "type": "script", "name": "deploy.sh", "description": "Deploy to production" },
450
+ { "type": "skill", "name": "code-review", "description": "Structured code review process" }
451
+ ]
452
+ }
453
+ ]
454
+ }
455
+ ```
456
+
457
+ Each asset entry supports:
458
+
459
+ | Field | Required | Description |
460
+ | --- | --- | --- |
461
+ | `type` | yes | AKM's own asset type keys (`skill`, `command`, `agent`, `knowledge`, `workflow`, `script`, `memory`, `env`, `secret`, `lesson`, `task`, `session`, `fact`, `instruction` — the authority is `KNOWN_TYPES` in `src/core/recognition-util.ts`), or a foreign/adapter-owned type (e.g. an `llm-wiki` page kind). This field is not a strict validation gate, so an unrecognized type still round-trips. Note: `wiki` was retired as an AKM-owned type — the LLM Wiki structure now lives in the first-class `llm-wiki` adapter, whose page kinds are foreign types rather than an AKM-owned `wiki` type. |
462
+ | `name` | yes | Asset name |
463
+ | `description` | no | One-line summary |
464
+ | `tags` | no | Searchable keywords |
465
+
466
+ The 0.6.0 release dropped support for the legacy v1 / v2 indexes;
467
+ publishers must regenerate `index.json` with the
468
+ `scripts/build-registry-index.ts` maintainer script
469
+ or the [akm-registry](https://github.com/itlackey/akm-registry) tooling
470
+ (see the [v0.5 → v0.6 migration guide](../migration/v0.5-to-v0.6.md)). akm
471
+ treats unknown fields inside a v3 entry as forward-compatible.
472
+
473
+ ## Cache Layout
474
+
475
+ Installed bundles are cached under `~/.cache/akm/registry/`
476
+ (`buildInstallCacheDir`, `src/sources/providers/provider-utils.ts`):
477
+
478
+ ```
479
+ ~/.cache/akm/registry/
480
+ npm-@scope-my-bundle/
481
+ 1.2.3/ # the resolved version — reused across installs
482
+ artifact.tar.gz # Downloaded archive
483
+ extracted/ # Extracted contents
484
+ selected/ # Subset from akm.include (if applicable)
485
+ ```
486
+
487
+ The version segment is the resolved version string for `npm`/`git` sources
488
+ (so re-installing the same version reuses the cache), or a random UUID for
489
+ `local` sources, which are always isolated per install.
@@ -0,0 +1,141 @@
1
+ # Website Sources
2
+
3
+ `akm import <url>` and every other URL-based knowledge read path pass through
4
+ a pluggable fetcher seam before the built-in website scraper.
5
+
6
+ akm ships five built-in fetchers, probed in this order (host-specific
7
+ fetchers before the deliberately loose path-shaped RSS matcher; any fetcher
8
+ returning `null` falls through to the generic website crawler):
9
+
10
+ | Fetcher | Handles | What it extracts |
11
+ | --- | --- | --- |
12
+ | `github-repository` | `github.com/<owner>/<repo>` URLs | The repository README, rendered to markdown |
13
+ | `youtube-transcript` | YouTube watch/short URLs | The video description and transcript when captions are available |
14
+ | `bluesky-profile` | `bsky.app` profile URLs | Public profile and recent posts via the unauthenticated AT Protocol API |
15
+ | `x` | `x.com`/`twitter.com` profiles, posts, and articles | Post/article content; profile timelines need a bearer token (below) |
16
+ | `rss-feed` | Feed-shaped paths (`.rss`/`.atom`/`.xml`, `?feed=`) | Feed items as markdown sections |
17
+
18
+ ## X credentials
19
+
20
+ The `x` fetcher reads public post/article pages without credentials. Profile
21
+ timelines require an API bearer token, resolved in order from the
22
+ `X_BEARER_TOKEN` environment variable, then the `secrets/x-bearer-token` akm
23
+ secret (`akm secret set secrets/x-bearer-token`). Alternatively, set `X_RSS_TEMPLATE`
24
+ to an RSS-bridge URL containing `{username}` to fetch profiles through the
25
+ `rss-feed` path instead.
26
+
27
+ ## Crawl options
28
+
29
+ When no fetcher claims a URL, the generic crawler applies the `website`
30
+ source descriptor's knobs (see the config schema): `maxPages` (default 50),
31
+ `maxDepth` (default 3), `respectRobots` (default `true`; set `false` to
32
+ bypass robots.txt for that source), and `crawlTimeoutMs` per request.
33
+
34
+ ## Why
35
+
36
+ Some sites need custom extraction logic that the generic HTML-to-markdown path
37
+ cannot provide well.
38
+
39
+ Examples:
40
+
41
+ - YouTube: fetch the transcript instead of the video description page chrome
42
+ - GitHub issues: fetch the issue body plus comments instead of the repository shell
43
+ - PDF-heavy sites: extract the underlying text instead of scraping an embed page
44
+
45
+ ## Discovery
46
+
47
+ Drop fetcher modules into:
48
+
49
+ ```text
50
+ <stashDir>/scripts/wiki-fetchers/
51
+ ```
52
+
53
+ `<stashDir>` is the active bundle for the current operation. When a command has a
54
+ resolved write target (for example `akm import --target ...`), akm loads
55
+ fetchers from that target bundle before falling back to the built-in website
56
+ scraper.
57
+
58
+ Files ending in `.ts`, `.js`, or `.mjs` are loaded in alphabetical order.
59
+ The first fetcher whose `matches()` returns `true` gets a chance to handle the
60
+ URL.
61
+
62
+ If a fetcher:
63
+
64
+ - returns `null`, akm falls through to the next fetcher or the built-in website scraper
65
+ - throws, akm logs a warning and falls through to the next fetcher or the built-in website scraper
66
+
67
+ ## Interface
68
+
69
+ Fetchers should export a default object with this shape:
70
+
71
+ ```ts
72
+ export interface WikiSnapshotResult {
73
+ url: string;
74
+ title: string;
75
+ markdown: string;
76
+ preferredName?: string;
77
+ tags?: string[];
78
+ }
79
+
80
+ export interface FetcherContext {
81
+ stashDir: string;
82
+ timeoutMs: number;
83
+ signal?: AbortSignal;
84
+ /**
85
+ * Resolve a secret by ref (e.g. `secrets/x-bearer-token`) from akm's
86
+ * secret store, or null when absent. Injected rather than imported so
87
+ * fetchers stay leaves in the import graph; never log the returned value.
88
+ */
89
+ resolveSecret?: (ref: string) => string | null;
90
+ }
91
+
92
+ export interface WikiSnapshotFetcher {
93
+ name: string;
94
+ matches(url: URL, context: FetcherContext): boolean;
95
+ fetch(url: URL, context: FetcherContext): Promise<WikiSnapshotResult | null>;
96
+ }
97
+ ```
98
+
99
+ `markdown` should contain only the body content. akm still wraps the result in
100
+ the standard raw snapshot frontmatter (`name`, `description`, `sourceUrl`,
101
+ `title`, `updated`, a `lint_skip` entry for `stale-path`, and `tags`) so
102
+ downstream wiki tooling continues to work normally.
103
+
104
+ Custom `tags` are appended to the default snapshot tags (`website` and the
105
+ resolved hostname). They do not replace those defaults.
106
+
107
+ ## Example
108
+
109
+ ```ts
110
+ export default {
111
+ name: "youtube-transcript",
112
+ matches(url: URL, _context: FetcherContext) {
113
+ return (
114
+ (url.hostname === "www.youtube.com" && url.pathname === "/watch") ||
115
+ url.hostname === "youtu.be"
116
+ );
117
+ },
118
+ async fetch(url: URL, _context: FetcherContext) {
119
+ const videoId = url.hostname === "youtu.be" ? url.pathname.slice(1) : url.searchParams.get("v");
120
+ if (!videoId) return null;
121
+
122
+ const transcript = await getTranscript(videoId);
123
+ return {
124
+ url: url.toString(),
125
+ title: `Video ${videoId}`,
126
+ markdown: `## Transcript\n\n${transcript}`,
127
+ preferredName: `videos/${videoId}`,
128
+ tags: ["video", "transcript"],
129
+ };
130
+ },
131
+ };
132
+ ```
133
+
134
+ ## Notes
135
+
136
+ - The fetcher seam is shared by `akm import <url>` and other URL-based
137
+ knowledge reads that use `fetchWebsiteMarkdownSnapshot()`.
138
+ - The built-in website scraper remains the default path when no custom fetcher
139
+ matches.
140
+ - Bundle-local fetchers are loaded before built-ins, so you can override any
141
+ built-in fetcher's behavior for your own workflow when needed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akm-cli",
3
- "version": "0.9.29",
3
+ "version": "0.9.31",
4
4
  "type": "module",
5
5
  "description": "akm (Agent Knowledge Manager) — a portable, local-first capability library for AI agents. Discover, load, share, and improve reusable skills, scripts, workflows, and knowledge across any shell-capable coding agent, including Claude Code, OpenCode, and Cursor.",
6
6
  "keywords": [
@@ -46,20 +46,17 @@
46
46
  "SECURITY.md",
47
47
  "STABILITY.md",
48
48
  "LICENSE",
49
- "docs/migration/release-notes",
50
- "docs/migration/v0.7-to-v0.8.md",
51
- "docs/migration/v0.8-to-v0.9.md",
52
- "docs/migration/v0.9.0-troubleshooting.md",
53
- "docs/migration/v0.9.1-to-v0.9.2.md",
54
- "docs/integration/bundling-akm.md",
55
- "docs/reference/bundle-types.md",
56
- "docs/reference/cli.md",
57
- "docs/reference/configuration.md",
58
- "docs/reference/data-and-telemetry.md",
59
- "docs/reference/supported-formats.md",
60
- "docs/reference/tasks.md",
61
- "docs/reference/workflow-schema.md",
62
- "docs/reference/workflows.md",
49
+ "ROADMAP.md",
50
+ "docs/agents",
51
+ "docs/architecture",
52
+ "docs/guides",
53
+ "docs/integration",
54
+ "docs/maintainers",
55
+ "docs/migration",
56
+ "docs/posts",
57
+ "docs/reference",
58
+ "docs/product-surface.md",
59
+ "docs/plans/0.9.2-agent-command-workflow-plan.md",
63
60
  "schemas"
64
61
  ],
65
62
  "bin": {