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,321 @@
1
+ # Bundles
2
+
3
+ akm works toward two outcomes: bring the agent assets you already have into
4
+ one library, and install (or share) reusable capability bundles with other
5
+ people. Both go through the same primitive — a **bundle** — which can be a
6
+ local directory, a git repo, an npm package, or a crawled website.
7
+ **Registries** are discovery indexes that let you find bundles you haven't
8
+ heard of yet. Together they give you a unified, searchable library that pulls
9
+ from anywhere and grows over time.
10
+
11
+ ## Bring what you already have into one library
12
+
13
+ If you already have skills, commands, or agent configs scattered across
14
+ different tools, point akm at each of them. Nothing moves — akm indexes assets
15
+ in place — and every asset becomes retrievable through the same search and
16
+ curate commands regardless of which agent originally created it.
17
+
18
+ ```sh
19
+ akm bundle add ~/.claude # Claude Code's project/user assets
20
+ akm bundle add ~/.config/opencode # OpenCode's config directory
21
+ akm index # Bring the search index up to date
22
+ akm curate "plan a release" # Pull the best matches from every bundle you added
23
+ ```
24
+
25
+ This is the "one library for every agent" idea in practice: assets authored
26
+ for one tool become discoverable — and usable — from any other.
27
+
28
+ ## akm bundle add
29
+
30
+ `akm bundle add` connects a new bundle. The source kind is inferred from the
31
+ input: known git hosts and URLs ending in `.git` are git bundles, while other
32
+ HTTP(S) URLs are website bundles.
33
+
34
+ ```sh
35
+ akm bundle add ~/.claude/skills # Local directory (filesystem)
36
+ akm bundle add github:owner/team-bundle # GitHub repo (git)
37
+ akm bundle add @scope/bundle # npm package
38
+ akm bundle add npm:@scope/bundle@latest # npm with version pin
39
+ akm bundle add github:owner/repo#v1.2.3 # GitHub at a specific tag
40
+ akm bundle add https://docs.example.com --name docs # Crawled website (website)
41
+ akm bundle add https://docs.example.com --max-pages 200 --max-depth 5
42
+
43
+ # Add the official onboarding bundle:
44
+ akm bundle add github:itlackey/akm-stash
45
+
46
+ # Mark a git bundle as writable (enables akm sync to push):
47
+ akm bundle add git@github.com:org/skills.git --provider git --name my-skills --writable
48
+
49
+ # Authenticate an HTTPS Git bundle without storing a token in its URL:
50
+ GIT_READ_TOKEN=... akm bundle add https://github.com/org/private.git --provider git \
51
+ --name private --credential '$GIT_READ_TOKEN'
52
+
53
+ # Control secondary-bundle resolution priority (the default bundle is always first):
54
+ akm bundle add github:owner/team-bundle --name team --before community
55
+ ```
56
+
57
+ | Bundle kind | Input shape | Behavior |
58
+ | --- | --- | --- |
59
+ | `filesystem` | local path | Indexed in place, writable by default |
60
+ | `git` | `github:`, known git-host URL, or URL ending in `.git` | Cloned into `~/.cache/akm/registry/`, read-only by default |
61
+ | `npm` | `@scope/pkg` | Installed into cache, read-only |
62
+ | `website` | Other HTTP/HTTPS URL | Crawled, converted to markdown, refreshed every 12 hours |
63
+
64
+ `akm bundle add` materializes and indexes Git install refs before it reports
65
+ success. A declarative `--provider git` add does the same, including writable
66
+ checkouts. Other declarative provider entries are materialized by
67
+ `akm bundle update`.
68
+
69
+ **Bundle naming.** `--name` sets the bundle's key — akm's config, index, and
70
+ every persisted ref hang off it. It is a contract, not a hint: it must be a
71
+ legal bundle slug (no `:` `.` `#` `/` or whitespace), and it must not already
72
+ be taken by a different bundle, or the add fails before writing anything.
73
+ Re-adding a source that is already installed under a different `--name` than
74
+ it already carries also fails, naming the existing key — use
75
+ [`akm bundle rename`](#akm-bundle-rename) instead of trying to relabel it
76
+ through `add`. Every `akm bundle add` result carries `bundleId` (its
77
+ resolved key), so scripting against the JSON output never has to guess it
78
+ back out of `sourceAdded`/`installed`. Without `--name`, akm derives one
79
+ (the directory name, the package/repo name, or the hostname), falling back to
80
+ a `-<hash>` suffix only on a collision — that forgiving fallback applies
81
+ solely to a derived name, never to an explicit `--name`.
82
+
83
+ Git credentials must be symbolic references: `$VAR`, `${VAR}`, or
84
+ `secret://name`. AKM resolves the reference only at the Git subprocess boundary
85
+ and sends it as an HTTPS bearer header; it does not put the token in the remote
86
+ URL or `config.json`.
87
+
88
+ **Website bundles.** A `website` URL is offered to a set of specialized
89
+ fetchers (YouTube, Bluesky, X, RSS/Atom feeds) before falling back to a
90
+ general crawl, and crawl behavior (page/depth limits, timeouts, robots.txt)
91
+ is configurable. See the
92
+ [website source recipe](recipes/website-source.md) for a walkthrough and
93
+ [Website Sources](../reference/website-sources.md) for the full fetcher
94
+ reference, X credential setup, and crawl-option details. Low-level knobs like
95
+ `crawlTimeoutMs` and `respectRobots` live in the bundle's `website`
96
+ descriptor — see [Configuration](../reference/configuration.md).
97
+
98
+ **Example: add a team bundle from GitHub**
99
+
100
+ ```sh
101
+ akm bundle add github:my-org/team-bundle --name team
102
+ akm index
103
+ akm search "deploy" --type script
104
+ ```
105
+
106
+ ## akm bundle list
107
+
108
+ `akm bundle list` shows all configured bundles — local directories, managed
109
+ packages, and remote providers — so you know what is in your library.
110
+
111
+ ```sh
112
+ akm bundle list # All bundles
113
+ akm bundle list --kind filesystem # Only local directories
114
+ akm bundle list --kind git # Only git-cloned bundles
115
+ akm bundle list --kind npm # Only npm packages
116
+ akm bundle list --kind filesystem,git # Multiple kinds (comma-separated)
117
+ ```
118
+
119
+ Valid `--kind` values are the four bundle providers: `filesystem`, `git`,
120
+ `npm`, `website`.
121
+
122
+ ## akm bundle update / akm bundle remove
123
+
124
+ `akm bundle update` refreshes git, npm, and website bundles. Each candidate is
125
+ staged outside its active root, audited for dangerous environment keys, and
126
+ only then published and indexed. `akm bundle remove` disconnects a bundle and
127
+ re-indexes without it.
128
+
129
+ Bundle refresh is deliberately explicit: Git bundles do not poll upstream on
130
+ their own. Consumers that want automatic refresh should schedule
131
+ `akm bundle update <name>` or `akm bundle update --all`. Scheduled invocations
132
+ should pass `--skip-if-locked` so concurrent index or improve activity becomes
133
+ a successful skip instead of exit 75.
134
+
135
+ ```sh
136
+ # Update
137
+ akm bundle update @scope/bundle # One managed bundle
138
+ akm bundle update --all # All managed bundles
139
+ akm bundle update --all --force # Force fresh download even if version unchanged
140
+ akm bundle update --all --skip-if-locked # Scheduled refresh: exit 0 on DB contention
141
+ akm bundle update @scope/bundle --allow-dangerous-env-keys # Approve reviewed dangerous env keys
142
+
143
+ # Remove
144
+ akm bundle remove @scope/bundle # By npm id
145
+ akm bundle remove github:owner/repo # By git ref
146
+ akm bundle remove ~/.claude/skills # By path
147
+ akm bundle remove my-provider # By name
148
+ ```
149
+
150
+ Dangerous keys prompt in a terminal (default: No) and block non-interactive
151
+ updates unless `--allow-dangerous-env-keys` is explicit. `--yes` only approves deletion
152
+ of an obsolete moved install directory; it never approves security findings.
153
+ For `--all`, blocked and failed bundles are reported separately and later
154
+ bundles continue. A rejected or failed bundle keeps its prior bytes, lock/config
155
+ state, and search-index generation.
156
+
157
+ Private bundles that intentionally version every file under `env/` and
158
+ `secrets/` can place this documented marker anywhere in their root
159
+ `.gitignore`:
160
+
161
+ ```gitignore
162
+ # akm: intentionally track env and secrets
163
+ ```
164
+
165
+ The stash scaffold then leaves the ignore file unchanged. Use this only for a
166
+ private remote whose exposure policy you have reviewed.
167
+
168
+ During publication AKM holds a SQLite writer transaction across the index and
169
+ the update-owned state work. Existing readers keep seeing the prior generation,
170
+ but other writers may wait for a full index pass. This provides process-fault
171
+ rollback for handled errors, not atomic durability across the filesystem and
172
+ two WAL database files during `SIGKILL`, power loss, or storage failure. After
173
+ such a failure, stop writers, run `akm health`, rerun the targeted update if its
174
+ checkout/lock is not the intended revision, and run
175
+ `akm index --full`. The `index-state-generation` advisory detects mismatched
176
+ durable usage links; it cannot detect every theoretical cross-file split.
177
+
178
+ **Example: keep bundles fresh**
179
+
180
+ ```sh
181
+ akm bundle update --all && akm index
182
+ ```
183
+
184
+ ## akm bundle rename
185
+
186
+ `akm bundle rename <old> <new>` is the one command allowed to change a
187
+ configured bundle's key. A bundle id is a mass identity prefix: every ref this
188
+ tool minted (`entries.item_ref`, `proposals.ref`, a pending proposal's write
189
+ target, a workflow's `task_history.target_ref`, `scheduler.enabled[].ref`)
190
+ carries it, so hand-editing the `bundles` key in `config.json` strands all of
191
+ it — the rest of akm keeps reading the old prefix out of the index and state
192
+ databases while config names the new one.
193
+
194
+ ```sh
195
+ akm bundle rename old-name new-name --dry-run # See the plan first
196
+ akm bundle rename old-name new-name
197
+ ```
198
+
199
+ `<new>` must be a legal, unused bundle slug — the same `--name` contract
200
+ `akm bundle add` enforces. Rewritten: the config key,
201
+ `defaultBundle`/`defaultWriteTarget` when they name the old id, every
202
+ scheduler ref, the lockfile entry, every indexed entry's `bundle_id`, and
203
+ this tool's own state rows that name the old bundle. Reported, never rewritten:
204
+ refs inside the bundle's own content (cross-references, a task's `uses:`,
205
+ `supersededBy`) — the command lists the files that still spell the old
206
+ `<old>//` prefix so you can fix them by hand. A real run also re-syncs native
207
+ scheduler bindings under the new name on its own, so scheduled tasks pick it
208
+ up immediately — but the result's `taskSync.ok` is `false` when a binding
209
+ fails to re-sync too, not only when the sync call itself fails, so a partial
210
+ re-sync is never reported as clean; `--dry-run` lists the installed native
211
+ rows that still name the old bundle, so you can see what that sync will
212
+ replace.
213
+
214
+ ## akm clone
215
+
216
+ `akm clone` copies a single asset from any bundle into your writable bundle
217
+ (or a custom destination) for local editing. After cloning, your local copy
218
+ wins in subsequent searches automatically.
219
+
220
+ ```sh
221
+ akm clone scripts/deploy.sh
222
+ akm clone skills/code-review --name my-code-review
223
+ akm clone scripts/deploy.sh --dest ./project/.claude
224
+ akm clone "npm:@scope/pkg//scripts/deploy.sh" # From uninstalled package
225
+ ```
226
+
227
+ Clone is non-destructive: use `--force` to overwrite an existing local copy.
228
+ Skills (directories with `SKILL.md`) are copied recursively. All other types
229
+ copy a single file.
230
+
231
+ **Example: clone and customize a workflow**
232
+
233
+ ```sh
234
+ akm clone workflows/ship-release --dest ./project/.claude
235
+ # Edit ./project/.claude/workflows/ship-release.md
236
+ # The local copy wins in searches from this directory forward
237
+ ```
238
+
239
+ ## akm sync
240
+
241
+ `akm sync` stages, commits, and optionally pushes your writable bundle. It is
242
+ the complement to `akm bundle add`: once you have made changes locally,
243
+ `sync` persists them to git. (There is no `akm save` command — use
244
+ `akm sync`.)
245
+
246
+ ```sh
247
+ akm sync # Primary bundle, auto timestamp message
248
+ akm sync -m "Add deploy skill" # Custom commit message
249
+ akm sync my-skills -m "Update" # Named writable git bundle
250
+ ```
251
+
252
+ Push behavior depends on configuration: if the bundle is a git repo with a
253
+ remote and `writable: true`, sync also pushes. Otherwise it commits only.
254
+
255
+ Writes that land on a writable git bundle via an explicit destination flag
256
+ (e.g. `akm remember --bundle my-skills`, proposal accept/revert, consolidate)
257
+ are committed automatically in a single batch at the end of the operation —
258
+ one complete commit (staging `.akm/` + assets together), pushed under the
259
+ same `writable + remote` gate as `akm sync`. `options.pushOnCommit` is
260
+ rejected at config load; remove it and rely on `writable: true` + push
261
+ instead.
262
+
263
+ **Example: publish your own bundle**
264
+
265
+ ```sh
266
+ # One-time setup (git-descriptor primary bundles only): mark it writable by
267
+ # setting bundles.<name>.writable: true in ~/.config/akm/config.json.
268
+ # A filesystem-type primary bundle is already writable by default.
269
+ akm sync -m "Add deployment skills"
270
+ # → stages, commits, and pushes to your configured remote
271
+ ```
272
+
273
+ For the full workflow of turning a bundle into something others can install —
274
+ manifest conventions, versioning, and publishing to a registry — see the
275
+ [Bundle Author's Guide](author-bundles.md). For how a bundle's provider kind
276
+ maps to the code that indexes and fetches it, see
277
+ [Architecture](../architecture/architecture.md).
278
+
279
+ ## Install and share reusable capability bundles
280
+
281
+ The other half of the bundle story is discovery: finding bundles other people
282
+ have published, and publishing your own so others can install it. `akm bundle
283
+ add` (above) is how you install one once you know where it lives; the
284
+ registry (below) is how you find it in the first place.
285
+
286
+ ## akm registry
287
+
288
+ The registry is a discovery index — it lets you find and install bundles you
289
+ don't know about yet. The official registry ships pre-configured.
290
+
291
+ ```sh
292
+ akm registry list # See configured registries
293
+ akm search "deploy" --from registry # Search registry bundles by topic
294
+ akm search "code review" --from registry --assets # Include asset-level hits
295
+ akm registry add https://example.com/registry/index.json --name my-team
296
+ akm registry remove my-team
297
+ ```
298
+
299
+ Once you find an interesting bundle in the registry, install it with `akm bundle add`:
300
+
301
+ ```sh
302
+ akm search "kubernetes" --from registry
303
+ akm bundle add github:some-org/k8s-bundle
304
+ akm index
305
+ ```
306
+
307
+ For the registry index schema, hosting a private registry, and how entries
308
+ get discovered, see [Registry](../reference/registry.md).
309
+
310
+ ## See also
311
+
312
+ - [Discover & Load](discover-and-load.md) — querying the index after bundles are connected
313
+ - [Knowledge Management](knowledge-management.md) — writing your own assets
314
+ - [Use akm With Any Agent](use-with-any-agent.md) — using refs across bundles in prompts
315
+ - [Website Source Recipe](recipes/website-source.md) — walkthrough for adding a crawled website bundle
316
+ - [Website Sources](../reference/website-sources.md) — fetcher reference, X credentials, crawl options
317
+ - [Configuration](../reference/configuration.md) — bundle descriptor fields including `website` crawl knobs
318
+ - [CLI Reference](../reference/cli.md) — full flag documentation for `add`, `list`, `update`, `remove`, `clone`, `sync`, `registry`
319
+ - [Registry](../reference/registry.md) — registry index format and private registry setup
320
+ - [Bundle Author's Guide](author-bundles.md) — build and publish your own bundle
321
+ - [Architecture](../architecture/architecture.md) — how bundle providers are implemented
@@ -0,0 +1,136 @@
1
+ # Capture Knowledge
2
+
3
+ Insights don't have to evaporate at the end of a session. `akm remember`
4
+ captures a short observation or decision, `akm import` pulls an existing
5
+ document into your library, `akm bundle add` keeps an external directory or
6
+ repo connected on an ongoing basis, and an LLM wiki organizes captured
7
+ material into a maintained, cross-referenced knowledge base. Once written,
8
+ captured material is indexed like any other asset — the next agent to run
9
+ `akm curate` or `akm search`, regardless of which tool it is, can find it.
10
+ This is "one library for every agent" applied to what you and your agents
11
+ learn along the way, not just what you started with.
12
+
13
+ ## Fast path
14
+
15
+ ```sh
16
+ # Save a quick observation
17
+ akm remember "Hot-fix deploys skip staging; always notify on-call first" \
18
+ --tag ops --tag deployment
19
+
20
+ # Pull an existing document into the library
21
+ akm import ./postmortem-2026-05.md --name postmortem-2026-05
22
+
23
+ # Confirm it's there
24
+ akm show knowledge/postmortem-2026-05
25
+ ```
26
+
27
+ ## How it works
28
+
29
+ `akm remember` writes a context fragment — an observation, decision,
30
+ snippet, or note — into `memories/` in your writable bundle. Pass a quoted
31
+ string for short notes, or pipe markdown via stdin for longer content.
32
+
33
+ ```sh
34
+ akm remember "Deployment needs VPN access"
35
+ akm remember "Pair with ops before rotating prod secrets" --path ops --name prod-secrets
36
+
37
+ # Structured metadata:
38
+ akm remember "VPN required for staging deploys" \
39
+ --tag ops --tag networking \
40
+ --expires 90d \
41
+ --source "skills/deploy"
42
+
43
+ # Heuristic tagging (zero-latency, pure TS):
44
+ akm remember "Found this snippet: curl -fsSL ... | bash" --tag ops --auto
45
+
46
+ # LLM-assisted enrichment (requires a configured LLM; fails soft):
47
+ cat long-meeting-notes.md | akm remember --name meeting-2026-05 --enrich
48
+
49
+ # Route to a named writable bundle:
50
+ akm remember "Use staging cluster for blue-green" --bundle team-bundle
51
+ ```
52
+
53
+ `--xref` cites related assets in the memory's frontmatter, and `--supersedes`
54
+ writes a correction while demoting the stale asset it replaces in the same
55
+ step. Scope flags (`--user`, `--agent`, `--run`, `--channel`) partition
56
+ memories for multi-agent environments; a scoped memory is only returned when
57
+ the same scope filter is supplied to `akm search` or `akm show`. Full flag
58
+ reference, belief-state mechanics, and provenance detail live in
59
+ [Memory](../reference/memory.md).
60
+
61
+ `akm import` brings an existing document — a local file, a single URL, or
62
+ stdin — into `knowledge/` as a searchable reference asset. Unlike
63
+ `akm bundle add` (which registers a persistent source), `import` is a
64
+ one-shot capture: a URL import fetches only the exact page you pass, converts
65
+ it to markdown, and does not crawl linked pages or register a source.
66
+
67
+ ```sh
68
+ akm import ./docs/auth-flow.md
69
+ akm import ./notes/release.txt --name release-checklist
70
+ akm import - --name scratch-notes < notes.md
71
+ akm import https://example.com/docs/auth
72
+
73
+ # Route to a named writable bundle:
74
+ akm import ./docs/auth-flow.md --target team-bundle
75
+ ```
76
+
77
+ Both commands accept `--xref <ref>` to cross-reference related assets and
78
+ `--supersedes <ref>` to correct and demote an existing asset in one step —
79
+ refs are validated before anything is written, so a typo fails fast instead
80
+ of leaving a dangling reference. See [Memory](../reference/memory.md) for the
81
+ belief-state and provenance model these flags drive.
82
+
83
+ ## Decision table
84
+
85
+ | Need | Use |
86
+ | --- | --- |
87
+ | Save a short observation, decision, or gotcha from the current session | `akm remember` |
88
+ | Copy one existing document into the writable library | `akm import` |
89
+ | Keep an external directory or repo connected on an ongoing basis | `akm bundle add` |
90
+ | Maintain a structured, agent-authored wiki with raw sources and cross-referenced pages | [Wikis](wikis.md) |
91
+
92
+ ## How captured material becomes available to every agent
93
+
94
+ A memory or import is a normal asset the moment it's written: `akm index`
95
+ (run automatically by most write paths, or explicitly when needed) folds it
96
+ into the unified search database, and from then on any agent — Claude Code,
97
+ OpenCode, or any other shell-capable assistant pointed at the same bundle —
98
+ finds it through the same `akm search` / `akm curate` / `akm show` calls it
99
+ uses for scripts and skills. Nothing about the capture path is
100
+ tool-specific; the retrieval loop (connect, index, curate, show, use/run,
101
+ feedback, proposal) treats a `akm remember` note the same way it treats a
102
+ bundled skill.
103
+
104
+ ## Common problems
105
+
106
+ **`akm remember` rejects the write with a tags-required error.** Passing
107
+ `--expires`, `--source`, or `--description` without any `--tag` triggers a
108
+ required-field check before anything is written. Either add at least one
109
+ `--tag`, or drop those flags and use the zero-flag form
110
+ (`akm remember "body"`), which writes bare with no frontmatter.
111
+
112
+ **A URL import didn't pick up the rest of the site.** That's expected — an
113
+ import fetches exactly the page you pass. To keep a whole site or repo in
114
+ sync on an ongoing basis, use `akm bundle add` instead.
115
+
116
+ **`--xref` or `--supersedes` fails with exit 2 before writing anything.**
117
+ The cited ref doesn't resolve in the write target or any configured source.
118
+ Fix the ref (check `akm search` for the correct one) and retry — validation
119
+ runs before the write, so nothing partial is left behind.
120
+
121
+ **A scoped memory isn't showing up in search.** Scoped memories
122
+ (`--user`/`--agent`/`--run`/`--channel`) only surface when the same scope
123
+ filter is passed to `akm search --filter` or `akm show --filter`.
124
+
125
+ ## See also
126
+
127
+ - [Memory](../reference/memory.md) — belief state, corrections, and
128
+ provenance detail for `remember` and `import`
129
+ - [Wikis](wikis.md) — the LLM-wiki bundle format for maintained, structured
130
+ knowledge
131
+ - [Bundles](bundles.md) — connecting external directories and repos on an
132
+ ongoing basis
133
+ - [Environment & Secrets](../reference/env-and-secrets.md) — protected
134
+ configuration and credential storage, not plain knowledge capture
135
+ - [CLI Reference](../reference/cli.md) — full flag documentation for
136
+ `remember` and `import`
@@ -0,0 +1,30 @@
1
+ # Choosing between a session-native workflow and an AKM workflow
2
+
3
+ Most coding assistants, Claude Code included, offer a native way to fan work
4
+ out inside the current session — an in-context script or tool that spawns
5
+ subagents, runs them concurrently, and reports back before the session ends.
6
+ AKM workflows are a different thing: a portable procedure that any supported
7
+ agent harness can run, with durable state, retries, gates, and resume built
8
+ in. Peer workflow sources are Markdown `.md` and GitHub-shaped YAML `.yml`;
9
+ both adapters lower to source IR version 1. Every run freezes the durable plan
10
+ v4 family's executable `irVersion: 5` before execution; pre-`irVersion`-5
11
+ stored plans are rejected.
12
+ Neither replaces the other — they solve different problems, and the right
13
+ choice depends on whether the work is a one-off inside a session or a
14
+ procedure worth keeping. Use the table below to pick.
15
+
16
+ | Use a session-native workflow when... | Use an AKM workflow when... |
17
+ | --- | --- |
18
+ | Work is temporary and belongs to one active assistant session | The procedure should survive sessions and be shared |
19
+ | The assistant's native orchestration is the main value | Stable inputs, outputs, retries, gates, and resume matter |
20
+ | Tool-specific behavior is acceptable | Portability and a durable source definition matter |
21
+ | No long-lived run record is needed | Run state and verification need to persist |
22
+
23
+ For the deep technical dive — representation, execution model, concurrency,
24
+ persistence, and where the two approaches overlap and diverge — see the full
25
+ comparison at
26
+ [docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md](../architecture/comparisons/claude-code-vs-akm-workflows-full.md).
27
+
28
+ To run an existing AKM workflow, see
29
+ [docs/guides/run-workflows.md](run-workflows.md). To author a new one, see
30
+ [docs/guides/author-workflows.md](author-workflows.md).
@@ -0,0 +1,93 @@
1
+ # Concepts
2
+
3
+ AKM is a portable capability library for AI agents: one local index that
4
+ holds every capability you've connected, and a small set of verbs any agent
5
+ can use to find, load, and improve it. Four ideas cover the whole mental
6
+ model.
7
+
8
+ ## 1. A capability is something an agent can discover and use
9
+
10
+ A **capability** is any asset an agent can search for and act on: a script,
11
+ skill, command, agent definition, knowledge document, instruction, env file,
12
+ secret, workflow, lesson, memory, task, session summary, or fact. AKM
13
+ classifies capabilities by **what they are** (file extension and content),
14
+ not by which directory they live in — a `.sh` file is a script whether it
15
+ lives in `scripts/`, `deploy/`, or the bundle root.
16
+
17
+ See [Asset Types](../reference/asset-types.md) for the full taxonomy,
18
+ directory layout, and metadata field reference.
19
+
20
+ ## 2. A bundle is a portable directory of capabilities
21
+
22
+ A **bundle** is a directory of capabilities you can connect, share, and
23
+ install — a local folder, a git repo, an npm package, or a crawled website.
24
+ `akm bundle add` infers the bundle's kind from the input shape; you never
25
+ pick it yourself. Every bundle materializes to a local directory that the
26
+ indexer walks.
27
+
28
+ Your **working bundle** (`~/akm`, created by `akm setup`) is the default
29
+ destination for `akm remember`, `akm import`, and other writes — the one
30
+ bundle guaranteed to be writable.
31
+
32
+ See [Author Bundles](author-bundles.md) for how to build and share one, and
33
+ [Registry](../reference/registry.md) for finding bundles other people have
34
+ published.
35
+
36
+ ## 3. AKM builds a local index and uses progressive disclosure
37
+
38
+ Every connected bundle is folded into one local FTS5 index — there's no
39
+ per-bundle fan-out at query time. Two verbs work that index:
40
+
41
+ ```text
42
+ search decides -- a lean menu: type, name, action, score
43
+ show delivers -- the full dispatch envelope: run command, prompt, content
44
+ ```
45
+
46
+ Search should not accumulate show-level detail, and show should not require
47
+ a prior search call. When two bundles hold a capability with the same name,
48
+ the working bundle wins by ranking convention rather than a fixed lookup
49
+ order — `akm clone` copies a capability into your working bundle so your
50
+ local edits override the upstream copy in subsequent searches.
51
+
52
+ ## 4. A ref is an opaque handle returned by discovery and consumed by show
53
+
54
+ A **ref** is the compact identifier `akm search` returns and `akm show`
55
+ consumes: `[bundle//]conceptId[#fragment]`. Treat it as an opaque token — get
56
+ it from search or curate, and pass it straight to `show`. Don't parse it or
57
+ construct one by hand; the structured `conceptId` and `bundle` fields on a
58
+ search hit carry the same information in parseable form.
59
+
60
+ See [Refs](../reference/refs.md) for the full grammar, rename semantics, and
61
+ namespacing conventions.
62
+
63
+ ## How it fits together
64
+
65
+ ```text
66
+ local folders / git / npm / websites
67
+ |
68
+ v
69
+ bundles
70
+ |
71
+ v
72
+ one local index
73
+ |
74
+ v
75
+ curate -> show -> use/run -> feedback -> proposals
76
+ ```
77
+
78
+ This is the retrieval loop: **connect** a source, **index** it, **curate** a
79
+ shortlist for a task, **show** the full payload, **use/run** it, send
80
+ **feedback**, and let accumulated signal become a **proposal**. AKM
81
+ retrieves every supported capability type. It directly orchestrates defined
82
+ execution surfaces such as workflows, agent dispatch, tasks, and guarded
83
+ subprocess injection. It does not blindly execute arbitrary indexed content
84
+ merely because that content appears in search results.
85
+
86
+ ## See also
87
+
88
+ - [Asset Types](../reference/asset-types.md) — the full capability taxonomy, directory layout, and metadata fields
89
+ - [Refs](../reference/refs.md) — ref grammar, rename semantics, and namespacing
90
+ - [Memory](../reference/memory.md) — belief states, capture modes, and derived memories
91
+ - [Registry](../reference/registry.md) — finding and installing bundles
92
+ - [Architecture](../architecture/architecture.md) — how indexing, search, and execution fit together
93
+ - [Author Bundles](author-bundles.md) — how to build and share a bundle