akm-cli 0.9.30 → 0.10.26101001-alpha

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 (353) hide show
  1. package/CHANGELOG.md +282 -0
  2. package/README.md +10 -10
  3. package/ROADMAP.md +112 -0
  4. package/STABILITY.md +79 -53
  5. package/dist/api-node.mjs +20 -0
  6. package/dist/api.d.ts +23 -0
  7. package/dist/api.js +45 -0
  8. package/dist/assets/hints/cli-hints-full.md +13 -27
  9. package/dist/assets/hints/cli-hints-short.md +1 -1
  10. package/dist/assets/improve-strategies/default.json +3 -3
  11. package/dist/assets/prompts/consolidate-pair.md +9 -7
  12. package/dist/cli/shared.js +31 -48
  13. package/dist/cli/unknown-flags.js +6 -43
  14. package/dist/cli.js +8 -34
  15. package/dist/commands/agent/contribute-cli.js +1 -1
  16. package/dist/commands/completions.js +1 -2
  17. package/dist/commands/config-cli.js +5 -28
  18. package/dist/commands/env/env-cli.js +5 -5
  19. package/dist/commands/env/secret-cli.js +2 -2
  20. package/dist/commands/health/checks.js +41 -16
  21. package/dist/commands/health/plugin-staleness.js +52 -22
  22. package/dist/commands/improve/autonomy-gate.js +5 -3
  23. package/dist/commands/improve/consolidate/pair-pass.js +7 -1
  24. package/dist/commands/improve/consolidate.js +6 -35
  25. package/dist/commands/improve/distill/lesson-update.js +91 -0
  26. package/dist/commands/improve/distill-guards.js +1 -43
  27. package/dist/commands/improve/distill.js +140 -20
  28. package/dist/commands/improve/extract-cli.js +1 -1
  29. package/dist/commands/improve/improve-cli.js +120 -114
  30. package/dist/commands/improve/improve-strategies.js +8 -12
  31. package/dist/commands/improve/loop-stages.js +0 -1
  32. package/dist/commands/improve/planner.js +0 -1
  33. package/dist/commands/improve/preparation.js +40 -99
  34. package/dist/commands/improve/proactive-maintenance.js +2 -2
  35. package/dist/commands/improve/reflect-noise.js +3 -55
  36. package/dist/commands/improve/reflect.js +3 -8
  37. package/dist/commands/improve/retrieval-scope.js +2 -2
  38. package/dist/commands/improve/salience.js +2 -9
  39. package/dist/commands/improve/stage.js +14 -9
  40. package/dist/commands/lint/index.js +5 -20
  41. package/dist/commands/observability-cli.js +3 -9
  42. package/dist/commands/proposal/drain.js +39 -6
  43. package/dist/commands/proposal/proposal-cli.js +10 -30
  44. package/dist/commands/proposal/repository.js +3 -3
  45. package/dist/commands/read/knowledge.js +3 -3
  46. package/dist/commands/read/remember-cli.js +0 -13
  47. package/dist/commands/read/search-cli.js +29 -97
  48. package/dist/commands/read/search.js +0 -11
  49. package/dist/commands/read/show.js +0 -19
  50. package/dist/commands/sources/plugin-upgrade.js +164 -101
  51. package/dist/commands/sources/sources-cli.js +1 -15
  52. package/dist/commands/sources/stash-cli.js +4 -12
  53. package/dist/commands/tasks/tasks-cli.js +4 -115
  54. package/dist/commands/workflow/plan.js +11 -33
  55. package/dist/commands/workflow-cli.js +2 -7
  56. package/dist/core/adapter/adapter-ids.js +1 -2
  57. package/dist/core/adapter/adapters/agent-skills-adapter.js +0 -4
  58. package/dist/core/adapter/adapters/akm-adapter.js +9 -48
  59. package/dist/core/adapter/adapters/akm-lint.js +10 -26
  60. package/dist/core/adapter/adapters/akm-metadata.js +2 -72
  61. package/dist/core/adapter/adapters/akm-task-adapter.js +0 -5
  62. package/dist/core/adapter/adapters/akm-workflow-adapter.js +9 -28
  63. package/dist/core/adapter/adapters/dotenv-adapter.js +1 -20
  64. package/dist/core/adapter/adapters/generic-files-adapter.js +0 -10
  65. package/dist/core/adapter/adapters/llm-wiki-adapter.js +0 -4
  66. package/dist/core/adapter/adapters/tool-dir-shared.js +0 -24
  67. package/dist/core/adapter/adapters/website-snapshot-adapter.js +4 -4
  68. package/dist/core/adapter/recognize-match.js +3 -4
  69. package/dist/core/common.js +18 -2
  70. package/dist/core/config/config-schema.js +12 -15
  71. package/dist/core/config/config-types.js +6 -15
  72. package/dist/core/config/config-walker.js +6 -23
  73. package/dist/core/config/config.js +17 -80
  74. package/dist/core/config/engine-semantics.js +7 -3
  75. package/dist/core/config/schema/engines.js +7 -7
  76. package/dist/core/config/schema/improve-processes.js +8 -61
  77. package/dist/core/config/schema/improve.js +2 -21
  78. package/dist/core/config/schema/index-config.js +6 -39
  79. package/dist/core/env-secret-ref.js +2 -45
  80. package/dist/core/errors.js +1 -2
  81. package/dist/core/extra-params.js +2 -86
  82. package/dist/core/file-lock.js +10 -1
  83. package/dist/core/improve-result.js +11 -1
  84. package/dist/core/mutation-target.js +2 -2
  85. package/dist/core/recognition-util.js +4 -5
  86. package/dist/core/warn.js +21 -4
  87. package/dist/core/write-source.js +3 -3
  88. package/dist/execution/target-ref.js +1 -2
  89. package/dist/indexer/search/db-search.js +4 -19
  90. package/dist/indexer/search/fts-query.js +0 -19
  91. package/dist/integrations/agent/engine-resolution.js +5 -2
  92. package/dist/integrations/agent/index.js +1 -1
  93. package/dist/integrations/agent/profiles.js +41 -98
  94. package/dist/integrations/agent/request-lowering.js +3 -3
  95. package/dist/integrations/harnesses/aider/index.js +5 -0
  96. package/dist/integrations/harnesses/amazonq/index.js +1 -0
  97. package/dist/integrations/harnesses/claude/config-import.js +2 -3
  98. package/dist/integrations/harnesses/claude/index.js +5 -0
  99. package/dist/integrations/harnesses/codex/index.js +1 -0
  100. package/dist/integrations/harnesses/copilot/index.js +1 -0
  101. package/dist/integrations/harnesses/gemini/index.js +1 -0
  102. package/dist/integrations/harnesses/index.js +18 -39
  103. package/dist/integrations/harnesses/opencode/agent-builder.js +60 -35
  104. package/dist/integrations/harnesses/opencode/config-import.js +121 -52
  105. package/dist/integrations/harnesses/opencode/index.js +22 -0
  106. package/dist/integrations/harnesses/opencode/plugin-layout.js +68 -0
  107. package/dist/integrations/harnesses/opencode/session-log-types.js +12 -0
  108. package/dist/integrations/harnesses/opencode/session-log-v1.js +72 -0
  109. package/dist/integrations/harnesses/opencode/session-log-v2.js +140 -0
  110. package/dist/integrations/harnesses/opencode/session-log.js +104 -115
  111. package/dist/integrations/harnesses/opencode/version.js +98 -0
  112. package/dist/integrations/harnesses/opencode-sdk/{harness.js → index.js} +5 -17
  113. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +105 -206
  114. package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +199 -0
  115. package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +228 -0
  116. package/dist/integrations/harnesses/opencode-sdk/wire.js +66 -0
  117. package/dist/integrations/harnesses/openhands/index.js +1 -0
  118. package/dist/integrations/harnesses/pi/index.js +1 -0
  119. package/dist/integrations/harnesses/shared.js +2 -0
  120. package/dist/integrations/harnesses/types.js +2 -0
  121. package/dist/llm/client.js +74 -14
  122. package/dist/output/cli-hints.js +1 -1
  123. package/dist/output/context.js +10 -19
  124. package/dist/output/format-exempt.js +5 -8
  125. package/dist/output/shapes/helpers.js +1 -22
  126. package/dist/output/shapes/passthrough.js +0 -1
  127. package/dist/output/shapes.js +3 -31
  128. package/dist/output/stdout.js +5 -1
  129. package/dist/output/text/command-format.js +6 -1
  130. package/dist/output/text/workflow-format.js +4 -22
  131. package/dist/scripts/akm-migrate-node.js +15746 -16706
  132. package/dist/scripts/akm-migrate.js +16319 -17275
  133. package/dist/setup/detect.js +10 -4
  134. package/dist/setup/harness-config-import.js +5 -14
  135. package/dist/setup/setup.js +1 -1
  136. package/dist/setup/steps/tasks.js +12 -13
  137. package/dist/storage/repositories/task-history-repository.js +0 -5
  138. package/dist/storage/repositories/workflow-runs-repository.js +5 -15
  139. package/dist/tasks/embedded.js +2 -1
  140. package/dist/tasks/run/task-history.js +0 -2
  141. package/dist/tasks/schedule-gates.js +39 -0
  142. package/dist/tasks/scheduler-binding.js +0 -16
  143. package/dist/tasks/scheduler-sync.js +3 -97
  144. package/dist/tasks/source/bounded-document.js +1 -1
  145. package/dist/tasks/source/task-source-v4.js +2 -12
  146. package/dist/tasks/task-run-reserved-flags.js +2 -31
  147. package/dist/workflows/authoring/authoring.js +6 -6
  148. package/dist/workflows/compile.js +8 -65
  149. package/dist/workflows/exec/child-workflow.js +22 -3
  150. package/dist/workflows/exec/native-executor.js +12 -147
  151. package/dist/workflows/exec/run-workflow.js +31 -103
  152. package/dist/workflows/exec/step-work.js +9 -178
  153. package/dist/workflows/exec/unit-dispatch.js +0 -10
  154. package/dist/workflows/freeze/environment.js +3 -44
  155. package/dist/workflows/freeze/freeze.js +8 -41
  156. package/dist/workflows/freeze/targets/child-workflow.js +27 -63
  157. package/dist/workflows/freeze/targets/command.js +2 -16
  158. package/dist/workflows/freeze/targets/shell.js +0 -2
  159. package/dist/workflows/freeze/task-bindings.js +2 -28
  160. package/dist/workflows/ir/params.js +12 -2
  161. package/dist/workflows/parser.js +82 -232
  162. package/dist/workflows/plan.js +1 -1
  163. package/dist/workflows/renderer.js +10 -19
  164. package/dist/workflows/runtime/run-plan.js +11 -53
  165. package/dist/workflows/runtime/runs.js +4 -27
  166. package/dist/workflows/source-files.js +12 -16
  167. package/dist/workflows/source-semantics.js +1 -93
  168. package/docs/README.md +43 -42
  169. package/docs/agents/README.md +15 -0
  170. package/docs/agents/agent-install.md +14 -0
  171. package/docs/architecture/README.md +67 -0
  172. package/docs/architecture/adapters.md +258 -0
  173. package/docs/architecture/akm-architecture-decision-history.md +2055 -0
  174. package/docs/architecture/akm-core-principles.md +126 -0
  175. package/docs/architecture/architecture.md +578 -0
  176. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
  177. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
  178. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
  179. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
  180. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
  181. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
  182. package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
  183. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
  184. package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
  185. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
  186. package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
  187. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
  188. package/docs/architecture/decisions/README.md +62 -0
  189. package/docs/architecture/improvement.md +471 -0
  190. package/docs/architecture/internals/classification.md +154 -0
  191. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
  192. package/docs/architecture/internals/functional-contract-patterns.md +340 -0
  193. package/docs/architecture/internals/health-advisories.md +110 -0
  194. package/docs/architecture/internals/improve-workflow.md +720 -0
  195. package/docs/architecture/internals/indexing.md +498 -0
  196. package/docs/architecture/internals/registry-network-boundary.md +57 -0
  197. package/docs/architecture/internals/search.md +248 -0
  198. package/docs/architecture/internals/storage-locations.md +943 -0
  199. package/docs/architecture/persisted-data-compat.md +68 -0
  200. package/docs/architecture/reviews/env-secret-access.md +319 -0
  201. package/docs/architecture/runtime-boundary-design.md +153 -0
  202. package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
  203. package/docs/architecture/specs/0.9.0-decisions.md +532 -0
  204. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
  205. package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
  206. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
  207. package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
  208. package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
  209. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
  210. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
  211. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
  212. package/docs/architecture/specs/di-seams-plan.md +539 -0
  213. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
  214. package/docs/architecture/specs/fact-asset-type.md +142 -0
  215. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
  216. package/docs/architecture/specs/okf-support.md +148 -0
  217. package/docs/architecture/specs/ref.md +329 -0
  218. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
  219. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
  220. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
  221. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
  222. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
  223. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
  224. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
  225. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
  226. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
  227. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
  228. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
  229. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
  230. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
  231. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
  232. package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
  233. package/docs/architecture/specs/stash-organization-conventions.md +377 -0
  234. package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
  235. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
  236. package/docs/architecture/specs/workflow-format-unification.md +432 -0
  237. package/docs/architecture/testing/manual-testing-checklist.md +3411 -0
  238. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
  239. package/docs/architecture/testing/task-workflow-manual-tests.md +1720 -0
  240. package/docs/architecture/testing/testing-workflow.md +446 -0
  241. package/docs/architecture/workflow-engine.md +223 -0
  242. package/docs/guides/README.md +33 -0
  243. package/docs/guides/author-bundles.md +310 -0
  244. package/docs/guides/author-workflows.md +490 -0
  245. package/docs/guides/bundles.md +321 -0
  246. package/docs/guides/capture-knowledge.md +136 -0
  247. package/docs/guides/claude-code-vs-akm-workflows.md +29 -0
  248. package/docs/guides/concepts.md +93 -0
  249. package/docs/guides/discover-and-load.md +158 -0
  250. package/docs/guides/getting-started.md +240 -0
  251. package/docs/guides/improve-the-library.md +246 -0
  252. package/docs/guides/knowledge-management.md +18 -0
  253. package/docs/guides/recipes/headless-install.md +97 -0
  254. package/docs/guides/recipes/website-source.md +28 -0
  255. package/docs/guides/run-workflows.md +279 -0
  256. package/docs/guides/scheduling.md +123 -0
  257. package/docs/guides/use-with-any-agent.md +174 -0
  258. package/docs/guides/wikis.md +81 -0
  259. package/docs/integration/bundling-akm.md +7 -6
  260. package/docs/maintainers/README.md +19 -0
  261. package/docs/maintainers/curate-workmap.md +335 -0
  262. package/docs/maintainers/eval.md +3 -0
  263. package/docs/maintainers/local-development.md +108 -0
  264. package/docs/maintainers/release-checklist.md +132 -0
  265. package/docs/migration/README.md +2 -2
  266. package/docs/migration/release-notes/0.0.13.md +1 -1
  267. package/docs/migration/release-notes/0.1.0.md +1 -1
  268. package/docs/migration/release-notes/0.2.0.md +1 -1
  269. package/docs/migration/release-notes/0.3.0.md +1 -1
  270. package/docs/migration/release-notes/0.5.0.md +1 -1
  271. package/docs/migration/release-notes/0.6.0.md +1 -1
  272. package/docs/migration/release-notes/0.7.0.md +1 -1
  273. package/docs/migration/release-notes/0.7.3.md +2 -2
  274. package/docs/migration/release-notes/0.7.4.md +1 -1
  275. package/docs/migration/release-notes/0.7.5.md +1 -1
  276. package/docs/migration/release-notes/0.8.0.md +1 -1
  277. package/docs/migration/release-notes/0.9.0.md +1 -1
  278. package/docs/migration/release-notes/0.9.14.md +1 -1
  279. package/docs/migration/release-notes/0.9.15.md +1 -1
  280. package/docs/migration/release-notes/0.9.16.md +1 -1
  281. package/docs/migration/release-notes/0.9.17.md +1 -1
  282. package/docs/migration/release-notes/0.9.19.md +1 -1
  283. package/docs/migration/release-notes/0.9.2.md +1 -1
  284. package/docs/migration/release-notes/README.md +27 -31
  285. package/docs/migration/v0.5-to-v0.6.md +759 -0
  286. package/docs/migration/v0.8-to-v0.9.md +1 -1
  287. package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
  288. package/docs/posts/README.md +30 -0
  289. package/docs/posts/akm-command-tour.md +495 -0
  290. package/docs/posts/akm-logo-sized.webp +0 -0
  291. package/docs/posts/belief-aware-memory-12.md +139 -0
  292. package/docs/posts/config-v2-lessons-16.md +191 -0
  293. package/docs/posts/improve-loop-autonomous-10.md +225 -0
  294. package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
  295. package/docs/posts/intro-part-01.md +76 -0
  296. package/docs/posts/intro-part-02.md +221 -0
  297. package/docs/posts/intro-part-03.md +190 -0
  298. package/docs/posts/intro-part-04.md +221 -0
  299. package/docs/posts/llm-mode-reflect-13.md +166 -0
  300. package/docs/posts/openpalm-built-on-akm.md +86 -0
  301. package/docs/posts/progressive-disclosure-06.md +129 -0
  302. package/docs/posts/proposal-safety-net-15.md +112 -0
  303. package/docs/posts/release-0.5.0.md +247 -0
  304. package/docs/posts/release-0.6.0.md +117 -0
  305. package/docs/posts/release-0.7.0.md +159 -0
  306. package/docs/posts/release-0.8.0.md +332 -0
  307. package/docs/posts/scattered-skills-05.md +100 -0
  308. package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
  309. package/docs/posts/team-skills-07.md +198 -0
  310. package/docs/posts/wiki-agent-knowledge-08.md +223 -0
  311. package/docs/posts/workflows-vaults-09.md +321 -0
  312. package/docs/product-surface.md +54 -0
  313. package/docs/reference/README.md +2 -2
  314. package/docs/reference/api.md +65 -0
  315. package/docs/reference/asset-types.md +166 -0
  316. package/docs/reference/bundle-types.md +2 -4
  317. package/docs/reference/cli.md +129 -175
  318. package/docs/reference/configuration.md +84 -19
  319. package/docs/reference/data-and-telemetry.md +1 -1
  320. package/docs/reference/env-and-secrets.md +126 -0
  321. package/docs/reference/memory.md +124 -0
  322. package/docs/reference/refs.md +156 -0
  323. package/docs/reference/registry.md +489 -0
  324. package/docs/reference/supported-formats.md +3 -4
  325. package/docs/reference/tasks.md +12 -19
  326. package/docs/reference/website-sources.md +141 -0
  327. package/docs/reference/workflow-schema.md +89 -317
  328. package/docs/reference/workflows.md +20 -48
  329. package/package.json +23 -16
  330. package/schemas/akm-config.json +2 -243
  331. package/schemas/akm-task.json +2 -3
  332. package/schemas/akm-workflow.json +47 -84
  333. package/dist/assets/improve-strategies/catchup.json +0 -41
  334. package/dist/assets/improve-strategies/proactive-maintenance.json +0 -24
  335. package/dist/assets/improve-strategies/quick.json +0 -17
  336. package/dist/assets/improve-strategies/reflect-distill.json +0 -29
  337. package/dist/assets/improve-strategies/thorough.json +0 -49
  338. package/dist/assets/tasks/improve/akm-improve-catchup.yml +0 -6
  339. package/dist/assets/tasks/improve/akm-improve-frequent.yml +0 -4
  340. package/dist/assets/tasks/improve/akm-improve-nightly.yml +0 -4
  341. package/dist/cli/retired-commands.js +0 -118
  342. package/dist/commands/tasks/validate.js +0 -176
  343. package/dist/core/config/legacy-source-shape-shim.js +0 -117
  344. package/dist/integrations/harnesses/ids.js +0 -28
  345. package/dist/tasks/source/task-source-v3-frozen.js +0 -424
  346. package/dist/tasks/source/task-to-v4.js +0 -863
  347. package/dist/workflows/exec/worktree.js +0 -372
  348. package/dist/workflows/freeze/child-output-references.js +0 -83
  349. package/dist/workflows/freeze/identity.js +0 -22
  350. package/dist/workflows/freeze/targets/script.js +0 -50
  351. package/dist/workflows/freeze/targets/task.js +0 -124
  352. package/dist/workflows/github-yaml.js +0 -506
  353. package/dist/workflows/runtime/run-outputs.js +0 -80
@@ -0,0 +1,321 @@
1
+ ---
2
+ title: Agents That Remember Where They Were
3
+ cover_image: 'https://raw.githubusercontent.com/itlackey/akm/main/docs/posts/akm-logo-sized.webp'
4
+ series: akm-workflows
5
+ description: 'akm 0.5.0 adds workflow assets, vault assets, and a writable synced stash.'
6
+ tags:
7
+ - ai
8
+ - agents
9
+ - cli
10
+ - workflows
11
+ published: true
12
+ id: 3538935
13
+ date: '2026-05-05T02:19:50Z'
14
+ ---
15
+
16
+ > This is a dated article from AKM's publishing archive. For current product behavior, see the
17
+ > [documentation index](https://github.com/itlackey/akm/blob/main/docs/README.md).
18
+
19
+ This is part nine in a series about managing the growing pile of skills, scripts, and context that AI coding agents depend on. [Part one](https://dev.to/itlackey/your-ai-agents-skill-list-is-getting-out-of-hand-32ck) introduced progressive disclosure. [Part two](https://dev.to/itlackey/you-already-have-dozens-of-agent-skills-you-just-cant-find-them-bpo) unified your local assets across platforms. [Part seven](https://dev.to/itlackey) covered shared team skills via Git repos.
20
+
21
+ Ask an agent to ship a release and it will start confidently. It runs the build, opens the changelog, checks the branch. Then something interrupts the session — you close the terminal, the context window fills up, you need to switch tasks. When you come back, the agent has no idea where it left off. You either restart from scratch or spend time reconstructing what happened.
22
+
23
+ This is the central problem with agents and multi-step work. They're good at individual tasks. They're not naturally good at procedures — sequences of steps that span time, accumulate state, and need to be resumable when interrupted.
24
+
25
+ `akm` ships three features that address this directly: workflow assets for stored, resumable procedures; vault assets for secret-aware environment config; and a writable git stash that keeps your skill collection in sync across machines. This post explains what each one does and how they fit together.
26
+
27
+ ## The Problem: Tasks Versus Procedures
28
+
29
+ A task is "write this function." A procedure is "ship this release." Tasks have a beginning and end that fit inside a single context window. Procedures have steps, dependencies between steps, and state that persists across sessions.
30
+
31
+ When agents handle procedures today, the state lives only in the conversation. That's fine for a five-minute task. It breaks down for anything that takes an hour, involves multiple sessions, or needs to be audited later. If something fails at step four of seven, there's no standard way to resume at step five without replaying the whole context.
32
+
33
+ The workaround most developers reach for is a checklist in a markdown file. The agent checks off items as it goes. This works, but it's manual, fragile, and the state isn't queryable. You can't ask "which deployments are currently in-progress" if the state is scattered across markdown checkboxes in different files.
34
+
35
+ Workflow assets are the structured version of that checklist.
36
+
37
+ ## Workflow Assets: Stored Procedures Your Agent Can Step Through
38
+
39
+ Workflows live in `workflows/` in your stash. Each workflow is a markdown file with frontmatter declaring the procedure's parameters and a standard step format. You write the workflow once; the agent follows it on every run.
40
+
41
+ Here's what a release workflow looks like:
42
+
43
+ ```markdown
44
+ ---
45
+ description: Ship a production release
46
+ params:
47
+ version: "The version to release (e.g. 1.2.3)"
48
+ ---
49
+ # Workflow: Ship Release
50
+
51
+ ## Step: Validate inputs
52
+ Step ID: validate
53
+ ### Instructions
54
+ Check that version follows semver and that the release branch exists.
55
+ ### Completion Criteria
56
+ - Version matches x.y.z
57
+ - Branch release/{{ version }} exists
58
+
59
+ ## Step: Build
60
+ Step ID: build
61
+ ### Instructions
62
+ Run `bun run build` and verify dist/ was generated.
63
+
64
+ ## Step: Deploy to staging
65
+ Step ID: staging
66
+ ### Instructions
67
+ Run `./scripts/deploy.sh staging` and verify the health check passes.
68
+
69
+ ## Step: Deploy to production
70
+ Step ID: production
71
+ ### Instructions
72
+ Run `./scripts/deploy.sh production` after staging health check is green.
73
+ ```
74
+
75
+ The workflow defines the procedure. To run it, the agent creates a *run* — an instance of that procedure with a specific set of params:
76
+
77
+ ```sh
78
+ akm workflow start workflow:ship-release --params '{"version":"1.2.3"}' # doclint:ignore (historical workflow lifecycle removed in 0.9)
79
+ # Returns a run ID: run-abc123
80
+ ```
81
+
82
+ Now the procedure has state. The agent calls `akm workflow next` to get the current actionable step:
83
+
84
+ ```sh
85
+ akm workflow next workflow:ship-release # doclint:ignore (historical workflow lifecycle removed in 0.9)
86
+ # Returns: Step "validate" — Check that version follows semver...
87
+ ```
88
+
89
+ When the agent completes a step, it marks it done with notes:
90
+
91
+ ```sh
92
+ akm workflow complete run-abc123 --step validate --state completed --notes "Version 1.2.3, branch release/1.2.3 confirmed" # doclint:ignore (historical workflow lifecycle removed in 0.9)
93
+ ```
94
+
95
+ `--state` defaults to `completed` when omitted, so the `--state completed` above is redundant but explicit.
96
+
97
+ And the next call to `akm workflow next` returns the following step. The run persists independently of the conversation. If the session ends, a new agent picks up exactly where the previous one left off:
98
+
99
+ ```sh
100
+ akm workflow next workflow:ship-release # doclint:ignore (historical workflow lifecycle removed in 0.9)
101
+ # Returns: Step "build" — still in progress from the interrupted session
102
+ ```
103
+
104
+ Want to see the full state of a run?
105
+
106
+ ```sh
107
+ akm workflow status run-abc123
108
+ ```
109
+
110
+ `workflow status` also accepts a workflow ref directly, resolving to the most-recently-updated run:
111
+
112
+ ```sh
113
+ akm workflow status workflow:ship-release
114
+ ```
115
+
116
+ Ref-based workflow commands are scoped to the current working context, not all
117
+ workflow runs on the machine. In practice akm groups runs by the current
118
+ project/worktree/directory, so an active run in one repo or sandbox does not
119
+ block a different directory from starting its own run of the same workflow.
120
+
121
+ That shows each step with its status and any notes the agent recorded. You can list all active runs:
122
+
123
+ ```sh
124
+ akm workflow list --active
125
+ ```
126
+
127
+ The procedure is now auditable. You know which step failed, when, and what the agent noted. You can hand the run off to a different agent or a different developer. The state is outside the context window where it's durable.
128
+
129
+ If you need a starting point, `akm workflow template` prints a starter workflow doc you can adapt.
130
+
131
+ ### Resuming blocked or failed runs
132
+
133
+ Sometimes a run gets blocked — a step requires human input, an external dependency is unavailable, or a tool call fails. When that happens, the run transitions to `blocked` or `failed`. Use `workflow resume` to flip it back to `active` without discarding progress:
134
+
135
+ ```sh
136
+ akm workflow resume run-abc123
137
+ ```
138
+
139
+ Completed runs cannot be resumed. Use `workflow list` to find runs by status.
140
+
141
+ ## Vault Assets: The Agent Knows What It Needs, Not What the Values Are
142
+
143
+ Procedures that touch production environments need secrets — database URLs, API keys, deploy tokens. Putting those secrets in a skill file or a prompt is an obvious problem. But the agent still needs to know *which* secrets a given procedure requires.
144
+
145
+ Vault assets solve this. A vault is a `.env` file stored in `vaults/` in your stash. The design has one rule: values are never surfaced in structured output. The agent can inspect a vault and learn what keys exist. It never sees what those keys are set to.
146
+
147
+ ```sh
148
+ akm show vault:production
149
+ # Returns keys/comments only, never values
150
+ ```
151
+
152
+ This is enough for the agent to confirm "yes, the right secrets are configured for this environment" without the secrets appearing anywhere in the conversation or the context window.
153
+
154
+ When a script actually needs the values — at runtime, not at planning time — the agent runs the command through `vault run`:
155
+
156
+ ```sh
157
+ akm vault run vault:production -- ./deploy.sh # doclint:ignore (historical — akm 0.5.0 release-era post; `vault` type removed in 0.9.0, see `env`/`secret`)
158
+ ```
159
+
160
+ The values are loaded into the child process environment. They never pass through the agent's structured output. The agent's conversation log is clean.
161
+
162
+ Combined with a workflow, this fits naturally into an environment verification step. The agent calls `akm show vault:production` to confirm all required keys are present, marks the step complete, then later calls `akm vault run vault:production -- <command>` when a command actually needs the secrets. The workflow knows what's required. The agent confirms it. The command gets what it needs.
163
+
164
+ ## Writable Git Stash: Your Skills Sync Like Code
165
+
166
+ So far in this series, stashes have been read-only: you pull in a team repo or a remote source, and `akm` indexes it. In 0.5.0, a stash can be writable.
167
+
168
+ When you create a stash with `--writable`, `akm save` will stage, commit, and push your changes back to the remote:
169
+
170
+ ```sh
171
+ akm add git@github.com:your-org/skills.git --provider git --name team-skills --writable # doclint:ignore (historical — pre-0.9.0 command spelling)
172
+ ```
173
+
174
+ ```sh
175
+ # After editing or adding an asset
176
+ akm save team-skills -m "Add deploy workflow" # doclint:ignore (historical — akm 0.5.0 release-era post; `save` renamed `sync` in 0.9.0, `-m` survives as `sync`'s own alias)
177
+ ```
178
+
179
+ The behavior depends on the stash configuration:
180
+
181
+ | State | What happens |
182
+ | --- | --- |
183
+ | Not a git repo | Skipped |
184
+ | Git repo, no remote | Stage and commit only |
185
+ | Git repo, has remote, writable: false | Stage and commit only |
186
+ | Git repo, has remote, writable: true | Stage, commit, and push |
187
+
188
+ Your default stash — the one `akm init` creates — is auto-initialized as a local git repo. So by default, `akm save` gives you a commit history of every change you've made to your skill collection, without requiring a remote. Add a remote and flip `writable: true` when you're ready to sync across machines.
189
+
190
+ This changes how you think about managing your personal stash. It's not a pile of files in `~/.akm`. It's a versioned repository. You can see when you wrote a skill, what it looked like before you changed it, and whether your teammates have made updates since you last pulled.
191
+
192
+ ## How These Three Features Work Together
193
+
194
+ Consider a deployment procedure that a team runs regularly. Before 0.5.0, you'd write a deploy skill and hope the agent followed the steps in the right order. With 0.5.0:
195
+
196
+ **Step 1: Write the workflow once.**
197
+
198
+ ```sh
199
+ akm workflow create ship-release
200
+ # Edit workflows/ship-release.md with your team's exact steps
201
+ ```
202
+
203
+ **Step 2: Add a vault with the production secrets.**
204
+
205
+ The vault file lives at `vaults/production.env` in your stash. The keys are there; the values are managed separately through whatever secret management you use.
206
+
207
+ **Step 3: Save both to the team stash.**
208
+
209
+ ```sh
210
+ akm save team-skills -m "Add ship-release workflow and production vault" # doclint:ignore (historical — akm 0.5.0 release-era post; `save` renamed `sync` in 0.9.0, `-m` survives as `sync`'s own alias)
211
+ ```
212
+
213
+ Every developer on the team pulls the update with `akm update --all`. Now everyone has the same workflow and the same vault definition.
214
+
215
+ **Step 4: When it's time to deploy, the agent runs the procedure.**
216
+
217
+ ```sh
218
+ # Agent starts a run
219
+ akm workflow start workflow:ship-release --params '{"version":"2.0.0"}' # doclint:ignore (historical workflow lifecycle removed in 0.9)
220
+
221
+ # Gets the first step
222
+ akm workflow next workflow:ship-release # doclint:ignore (historical workflow lifecycle removed in 0.9)
223
+ # → "Validate inputs: confirm version and vault keys"
224
+
225
+ # Checks the vault without reading secrets
226
+ akm show vault:production
227
+ # → keys/comments only, never values
228
+
229
+ # Marks the step complete
230
+ akm workflow complete run-xyz --step validate --notes "All keys present" # doclint:ignore (historical workflow lifecycle removed in 0.9)
231
+
232
+ # Gets the next step
233
+ akm workflow next workflow:ship-release # doclint:ignore (historical workflow lifecycle removed in 0.9)
234
+ # → "Build: run bun run build..."
235
+ ```
236
+
237
+ If the session ends at the staging step, a fresh agent picks up with:
238
+
239
+ ```sh
240
+ akm workflow next workflow:ship-release # doclint:ignore (historical workflow lifecycle removed in 0.9)
241
+ # → "Deploy to staging" — still pending from the previous session
242
+ ```
243
+
244
+ No context reconstruction. No "where did we leave off?" The procedure state is in the workflow run, not the conversation.
245
+
246
+ When the deploy is done, commit any skill or workflow improvements back to the team repo:
247
+
248
+ ```sh
249
+ akm save team-skills -m "Improve staging health check step" # doclint:ignore (historical — akm 0.5.0 release-era post; `save` renamed `sync` in 0.9.0, `-m` survives as `sync`'s own alias)
250
+ ```
251
+
252
+ The team gets the improvement on next `akm update`.
253
+
254
+ ## Security Model
255
+
256
+ Vault assets have a clear security contract. Understanding it prevents both
257
+ false confidence and unnecessary alarm.
258
+
259
+ **Values never leave disk via akm commands.** This is the core invariant.
260
+ `akm show`, `akm vault list`, `akm search`, and every other structured output
261
+ command expose only key names and comments — never values. The two supported
262
+ paths that actually use values are `source "$(akm vault path vault:name)"` (the
263
+ shell loads the file directly) and `akm vault run vault:name -- <command>`
264
+ (values are injected into the child process environment). Neither path passes
265
+ values through akm's structured output.
266
+
267
+ **Key names are metadata — they are intentionally discoverable.** Key names
268
+ appear in `vault list`, `vault show`, search results, and agent context by
269
+ design. This is how an agent can confirm "yes, `DATABASE_URL` is configured in
270
+ this vault" without seeing its value. Do not treat key names as secrets.
271
+
272
+ **The `--sensitive` flag hides a vault from `vault list` only.** Creating a
273
+ vault with `akm vault create prod --sensitive` prevents it from appearing in
274
+ the default `vault list` output. It does not prevent key names from showing up
275
+ in search results or when the vault is shown directly with `akm show
276
+ vault:prod`. Use `--sensitive` to reduce noise, not to enforce secrecy.
277
+
278
+ **Dangerous key detection.** Vault keys with names like `LD_PRELOAD`, `PATH`,
279
+ `DYLD_INSERT_LIBRARIES`, or `NODE_OPTIONS` can be used to hijack process
280
+ execution when the vault is loaded via `akm vault run`. `akm add` and
281
+ `akm lint` both scan for these names. During install, `akm add` pauses and
282
+ asks for confirmation when dangerous keys are found (non-interactive mode fails
283
+ unless `--allow-dangerous-env-keys` is passed). The full list of 23 flagged key names is
284
+ documented in the [CLI reference](../reference/cli.md#dangerous-env-key-audit).
285
+
286
+ **When to use `--allow-dangerous-env-keys`.** Pass it to `akm bundle add` when
287
+ you have reviewed a bundle manually and confirmed that a dangerous environment
288
+ key is legitimate (for example, a hermetic toolchain that overrides `PATH`).
289
+ Plain-HTTP transport is a separate decision and requires
290
+ `--allow-insecure-transport`. Neither flag is a global config setting; each
291
+ applies only to the single invocation.
292
+
293
+ ## Getting Started
294
+
295
+ If you're on `akm` already, upgrade to the latest version:
296
+
297
+ ```sh
298
+ npm install -g akm-cli@latest
299
+ # or
300
+ akm upgrade
301
+ ```
302
+
303
+ The npm package requires Node.js >= 22. It prefers a working Bun >= 1.0 on
304
+ `PATH` and otherwise uses Node.js; the standalone binary is runtime-free.
305
+
306
+ To try workflows:
307
+
308
+ ```sh
309
+ akm workflow template # doclint:ignore (historical — akm 0.5.0 release announcement; `template` folded into `workflow create --print` in the 0.9.0 CLI overhaul)
310
+ # Copy the output to workflows/your-first-workflow.md and edit it
311
+ akm workflow create your-first-workflow
312
+ akm workflow start workflow:your-first-workflow # doclint:ignore (historical workflow lifecycle removed in 0.9)
313
+ ```
314
+
315
+ To add a vault, drop a `.env` file in `vaults/` in your stash. The format is standard `.env` — one `KEY=value` per line, comments with `#`.
316
+
317
+ To make your default stash writable, add a remote to the git repo in `~/.akm/stash` and update your stash config with `--writable`. Run `akm save -m "Initial commit"` to verify it pushes.
318
+
319
+ The repo is at [github.com/itlackey/akm](https://github.com/itlackey/akm). The [Getting Started guide](../guides/getting-started.md) covers initial setup if you're coming in new.
320
+
321
+ Agents are most useful when they can handle real work end-to-end. Real work usually involves multiple steps, sensitive configuration, and sessions that get interrupted. Workflows, vaults, and a writable stash close those gaps. Give them a try on the next multi-step task you'd normally hand off with a checklist.
@@ -0,0 +1,54 @@
1
+ # Product Surface
2
+
3
+ Every akm feature, with its status. Status meanings are in
4
+ [STABILITY.md](../STABILITY.md).
5
+
6
+ > [!NOTE]
7
+ > The 0.10 series makes every feature Stable or removes it.
8
+
9
+ ## Library
10
+
11
+ - [Bundles](guides/bundles.md): add local folders, git repos, npm packages and websites. *Stable*
12
+ - [Supported formats](reference/supported-formats.md): akm bundles, Claude Code and OpenCode folders, Agent Skills, wikis, websites. *Evolving*
13
+ - [Registries](reference/registry.md): find bundles others publish. *Evolving*
14
+ - Sync: commit and push a git-backed bundle. *Stable*
15
+
16
+ ## Find and load
17
+
18
+ - [Search, curate, show](guides/discover-and-load.md): find assets and load one by ref. *Stable*
19
+
20
+ ## Capture
21
+
22
+ - [Remember, import, clone](guides/capture-knowledge.md). *Stable*
23
+ - Feedback: rate an asset or attach a fix. *Stable*
24
+ - Lessons. *Experimental*
25
+
26
+ ## Improve
27
+
28
+ - [`akm improve` and proposals](guides/improve-the-library.md): reviewable changes from feedback and usage. *Evolving*
29
+ - Improve settings and strategies other than `default` and `consolidate`. *Experimental*
30
+ - Automatic acceptance (opt-in). *Experimental*
31
+ - Session extraction. *Evolving*
32
+
33
+ ## Monitor
34
+
35
+ - Health. *Evolving*
36
+ - Metrics. *Experimental*
37
+ - Log, lint. *Evolving*
38
+
39
+ ## Run work
40
+
41
+ - [Tasks and scheduling](guides/scheduling.md). *Evolving*
42
+ - [Workflows](guides/run-workflows.md). *Experimental*
43
+ - Agent dispatch and harnesses (Claude Code, Codex, OpenCode and others). *Evolving*
44
+ - Model aliases. *Evolving*
45
+
46
+ ## Environment and secrets
47
+
48
+ - [Read and inject](reference/env-and-secrets.md). *Stable*
49
+ - Create and change. *Experimental*
50
+
51
+ ## Setup and maintenance
52
+
53
+ - Install, setup, config, help, completions. *Stable*
54
+ - Upgrade, including agent plugins and `--next`. *Evolving*
@@ -2,7 +2,8 @@
2
2
 
3
3
  Authoritative reference documentation for the akm CLI and its data.
4
4
 
5
- - [Bundle Types](bundle-types.md) -- Pointer page: where the bundle-format compatibility table and adapter internals now live
5
+ - [Programmatic API](api.md) -- `akm-cli/api`: in-process `curate()` for the akm plugins
6
+ - [Bundle Types](bundle-types.md) -- Supported bundle formats and compatibility
6
7
  - [CLI](cli.md) -- All `akm` commands and flags
7
8
  - [Configuration](configuration.md) -- Engines, strategies, bundles, and settings
8
9
  - [Supported Formats](supported-formats.md) -- Formats akm can index, from its own bundle layout to other tools' existing asset directories
@@ -17,4 +18,3 @@ Authoritative reference documentation for the akm CLI and its data.
17
18
  - [Website Sources](https://github.com/itlackey/akm/blob/main/docs/reference/website-sources.md) -- The pluggable fetcher API behind `akm import <url>` and other URL-based knowledge reads
18
19
  - [Data & Telemetry](data-and-telemetry.md) -- Exactly what akm reads and writes on your machine (no remote telemetry)
19
20
 
20
- See also: [akm-eval](https://github.com/itlackey/akm-eval) -- the evals and benchmarks for measuring whether `akm improve` is working, and the repo-root [Roadmap](https://github.com/itlackey/akm/blob/main/ROADMAP.md) -- high-level focus for upcoming releases.
@@ -0,0 +1,65 @@
1
+ # Programmatic API (`akm-cli/api`)
2
+
3
+ `akm-cli` is a CLI package. The one supported programmatic entry point is
4
+ `akm-cli/api`, which exists so the akm plugins (OpenCode, Claude Code, ...) can
5
+ do their automatic recall in-process instead of starting an `akm` process per
6
+ prompt. Everything else in the package stays CLI-only: deep imports of
7
+ `akm-cli/dist/*` are not an API, and the CLI is still the way to run every
8
+ other command.
9
+
10
+ ```ts
11
+ import { curate } from "akm-cli/api";
12
+
13
+ const text = await curate("deploy to prod", { limit: 4, type: "skill", format: "text" });
14
+ ```
15
+
16
+ ## `curate(query, options?)`
17
+
18
+ ```ts
19
+ function curate(
20
+ query: string,
21
+ options?: { limit?: number; type?: string; format?: "text" | "json" },
22
+ ): Promise<string>;
23
+ ```
24
+
25
+ - **Result.** Exactly the stdout of
26
+ `akm --detail agent -q curate <query> [--limit N] [--type T] --format <format>`,
27
+ including the trailing newline, computed in-process. `format` defaults to
28
+ `"json"`, as the CLI does. It runs the same code as the command (argument
29
+ validation, search, ranking, shaping and rendering are shared, not copied), so
30
+ the two cannot drift.
31
+ - **Failure.** It rejects with an `Error` whose `message` is the CLI's error
32
+ text and whose `code` is the CLI's error code (`MISSING_REQUIRED_ARGUMENT`,
33
+ `INVALID_FLAG_VALUE`, `INVALID_CONFIG_FILE`, ...) wherever the CLI would have
34
+ failed. An unexpected internal failure rejects with a plain `Error` without a
35
+ `code`.
36
+ - **No side effects on the host.** No child process; nothing is written to
37
+ stdout or stderr; `process.chdir` is never called; `process.env` and
38
+ `process.argv` are not modified; the host's quiet and verbose state is
39
+ unchanged afterwards. As with `akm curate`, the call records its usage
40
+ event in `state.db`.
41
+ - **Repeated calls.** Config is re-validated against `config.json` on every
42
+ call (its path, size and modification time), so an edit on disk is seen by
43
+ the next call exactly as a separate CLI run would see it. Database handles are
44
+ opened and closed within each call. The local embedding model and the embedding
45
+ cache are kept for the life of the process, which is what makes a warm call
46
+ cheaper than a CLI run. Overlapping calls are safe. Under Bun the SQLite file
47
+ descriptors of a finished call are released when the garbage collector
48
+ finalizes its statements, so they can briefly outlive the call.
49
+
50
+ ## Loading it
51
+
52
+ `package.json` `exports` maps `akm-cli/api` to `dist/api.js` under Bun and to
53
+ `dist/api-node.mjs` under Node (which registers the loader hook for the
54
+ package's embedded `.md`/`.xml` assets before loading `dist/api.js`), with
55
+ `dist/api.d.ts` for types. `akm-cli/package.json` and `akm-cli/dist/*` are also
56
+ exported, so a plugin can locate the `akm` bin with
57
+ `require.resolve("akm-cli/package.json")` and published plugin versions that
58
+ deep-import `akm-cli/dist/commands/read/*.js` keep working.
59
+
60
+ ## Stability
61
+
62
+ Evolving (see [STABILITY.md](../../STABILITY.md)): the export list only grows,
63
+ and `curate()`'s parameters and result keep the contract above; the text it
64
+ returns is the CLI's agent-shaped output and changes whenever that does.
65
+ `tests/contracts/api-surface.test.ts` pins the export list.
@@ -0,0 +1,166 @@
1
+ # Asset Types
2
+
3
+ Reference for the capability taxonomy the native `akm` adapter recognizes,
4
+ the bundle directory layout, and the metadata every asset carries.
5
+
6
+ ## Contract
7
+
8
+ - akm's own native format (the `akm` adapter) recognizes **fourteen asset
9
+ types**: script, skill, command, agent, knowledge, instruction, env,
10
+ secret, workflow, lesson, memory, task, session, and fact.
11
+ - Scripts, knowledge, commands, agents, skills, and workflows are classified
12
+ by **file extension and content**, not by directory name. A `.sh` file is
13
+ a script whether it lives in `scripts/`, `deploy/`, or the bundle root; for
14
+ these types the conventional directory names below are an **opt-in
15
+ convention that improves indexing confidence**. The remaining types are
16
+ **directory-required**: env, secret, memory, lesson, fact, session, task,
17
+ and instruction assets are only discovered under their placement
18
+ directories (a memory-shaped `.md` outside `memories/` indexes as plain
19
+ knowledge).
20
+ - `type` is not part of an asset's ref — the placement subdirectory carries
21
+ that signal. See [Refs](refs.md).
22
+ - Ten additional *bundle formats* beyond akm's own (Claude Code and OpenCode
23
+ tool directories, OKF, LLM wikis, and more) are recognized, indexed, and
24
+ validated in place by their own adapters — see
25
+ [Bundle Types](bundle-types.md) for the full type-by-type table (purpose,
26
+ what the agent gets, and example ref) and the other-format read/write
27
+ picture.
28
+
29
+ ## Directory layout
30
+
31
+ There's no required structure, but this skeleton is the opt-in convention:
32
+
33
+ ```text
34
+ my-bundle/
35
+ scripts/ # Executable scripts (.sh, .ts, .js, .py, .rb, .go, etc.)
36
+ skills/ # Skill definitions (directories with SKILL.md)
37
+ commands/ # Slash commands (.md with $ARGUMENTS or agent frontmatter)
38
+ agents/ # Agent definitions (.md with model/tools frontmatter)
39
+ knowledge/ # Reference documents (.md)
40
+ instructions/ # Project guidance (.md)
41
+ env/ # Environment files (.env) — groups of related config, loaded whole
42
+ secrets/ # Secrets — one sensitive value per file (auth tokens, keys, certs)
43
+ workflows/ # Workflow sources (.md)
44
+ lessons/ # Distilled lessons (.md, see akm improve / proposals)
45
+ memories/ # Recalled context fragments (.md, see Memory reference)
46
+ facts/ # Durable bundle-level facts (.md)
47
+ tasks/ # Task source v4 scheduled or on-demand automation (.yml only)
48
+ sessions/ # Machine-placed indexed session summaries (.md)
49
+ .meta/ # Optional bundle orientation, not indexed (see "Bundle orientation" below)
50
+ ```
51
+
52
+ LLM Wikis are a related but separate concept: a wiki is its own installable
53
+ bundle (`akm bundle add github:team/research-wiki`), not a type-subdirectory
54
+ inside a regular bundle. See [Wikis](../guides/wikis.md) for how akm
55
+ recognizes and indexes them.
56
+
57
+ ## Classification taxonomy
58
+
59
+ Scripts and knowledge are classified by **what they are**: a `.sh` file is a
60
+ script; a plain `.md` file is knowledge. Commands and agents are classified
61
+ by **how an LLM should use them**: a `.md` file with `$ARGUMENTS`
62
+ placeholders is a command template; one with `tools` in its frontmatter is an
63
+ agent definition. Workflow assets are `.md`, classified by `type: workflow`
64
+ or placement. Skills are a
65
+ **packaging convention**: a directory containing a `SKILL.md` file.
66
+
67
+ See [Classification](../architecture/internals/classification.md) for the
68
+ full specificity-based matching system.
69
+
70
+ ## Metadata field reference
71
+
72
+ Metadata lives with the asset itself, not in a separate sidecar file:
73
+ frontmatter for markdown assets, and structured comments for scripts. The
74
+ indexer derives metadata from filenames, code comments, frontmatter, and
75
+ `package.json`.
76
+
77
+ See [Filesystem Layout](../architecture/internals/storage-locations.md) for
78
+ the full field reference.
79
+
80
+ ### Bundle orientation: the `.meta/` convention
81
+
82
+ A bundle may carry an optional `.meta/` directory at its root holding
83
+ human-authored orientation for the bundle *as a whole* — purpose, key
84
+ assets, conventions, maintainer. This is distinct from per-asset metadata,
85
+ which still lives with each asset: `.meta/` never describes individual
86
+ assets, only the bundle itself.
87
+
88
+ ```text
89
+ my-bundle/
90
+ .meta/
91
+ index.md # shown by `akm show meta` — the default orientation doc
92
+ about.md # shown by `akm show meta:about`
93
+ conventions.md # shown by `akm show meta:conventions`
94
+ ```
95
+
96
+ Because `.meta/` is a dot-directory, the indexer skips it — these docs never
97
+ appear in `akm search` and never compete for ranking. They are **direct-read
98
+ on demand**:
99
+
100
+ ```sh
101
+ akm show meta # working bundle's .meta/index.md
102
+ akm show meta:about # working bundle's .meta/about.md
103
+ akm show akm//meta # the primary bundle explicitly
104
+ ```
105
+
106
+ `akm show <origin>//meta:<name>` resolves `<name>.md` first, then an
107
+ extensionless `<name>`. The convention is open-ended: bundle owners add new
108
+ docs by dropping files into `.meta/` — no configuration or code changes
109
+ required. `akm bundle create` scaffolds a starter `.meta/index.md`.
110
+
111
+ **Known gap:** an install-ref origin (`akm show github:owner/repo//meta`)
112
+ does not currently resolve even for an installed bundle — origin resolution
113
+ matches only derived installation ids, not raw install refs. Use `akm//meta`
114
+ for the primary bundle, or the bundle key you gave it in `bundles`
115
+ (`config.json`), not the original install ref.
116
+
117
+ ## Script execution (ExecHints)
118
+
119
+ For script assets, akm resolves execution hints in this order:
120
+
121
+ 1. Header comment tags (`@run`, `@setup`, `@cwd`)
122
+ 2. Auto-detection from extension and nearby dependency files
123
+
124
+ ## Defaults
125
+
126
+ - Directory placement is advisory for scripts, knowledge, commands, agents,
127
+ skills, and workflows; it is required for env, secret, memory, lesson,
128
+ fact, session, task, and instruction discovery.
129
+ - A memory asset with no source directory pointed at it is written to the
130
+ working bundle by `akm remember`.
131
+ - `facts/` holds durable bundle-level facts, including the organization,
132
+ backlink, and domain convention facts the bundle skeleton ships with (see
133
+ [Refs — namespacing](refs.md#namespacing)).
134
+
135
+ ## Security / persistence implications
136
+
137
+ - `env` and `secret` assets carry protected values: key names are
138
+ discoverable, but values are never written to stdout, the index, or
139
+ structured output. See `STABILITY.md`'s "Protected env & secret values"
140
+ entry for the exact contract and the safe injection path
141
+ (`akm env run` / `akm secret run`).
142
+ - All asset content is plain files inside the bundle directory — the search
143
+ index (`index.db`) is a derived, regenerable cache rebuilt by `akm index`;
144
+ it is never the source of truth for asset content.
145
+ - `akm lint` only operates on writable sources, and `akm improve` on one of
146
+ them: the bundle it writes to (`--bundle`, else `defaultWriteTarget`, else the
147
+ working bundle). Read-only registry caches (`git`, `npm`, `website`) are
148
+ excluded from improvement and lint passes even when they are indexed.
149
+
150
+ ## Stability
151
+
152
+ Per `STABILITY.md`: asset `type` is a free-form, open string — `--type`
153
+ filtering is exact-match against an open set and deliberately unvalidated
154
+ (an unrecognized type returns zero hits, not an error). The `lesson` asset
155
+ type's schema (`when_to_use`, `description`) is stable, but its
156
+ distillation triggers and ranking are Experimental tuning targets. See
157
+ `STABILITY.md` for the full command- and surface-level tier index.
158
+
159
+ ## See also
160
+
161
+ - [Concepts](../guides/concepts.md) — the four core ideas asset types fit into
162
+ - [Refs](refs.md) — how a conceptId is built from an asset's placement
163
+ - [Memory](memory.md) — the memory asset type's belief-state and derived-memory model
164
+ - [Bundle Types](bundle-types.md) — every bundle format akm recognizes, not just its own
165
+ - [Classification](../architecture/internals/classification.md) — the specificity-based matcher
166
+ - [Filesystem Layout](../architecture/internals/storage-locations.md) — full metadata field reference
@@ -3,8 +3,7 @@
3
3
  This page has moved. AKM's bundle-format documentation is now split in two:
4
4
  the public compatibility table lives at
5
5
  [Supported Formats](supported-formats.md), and the adapter internals — probe
6
- order, the `BundleAdapter` interface, `placeNew()` wiring status, and the
7
- write allowlists — live at
6
+ order, the `BundleAdapter` interface, and the write allowlists — live at
8
7
  [Architecture → Adapters](https://github.com/itlackey/akm/blob/main/docs/architecture/adapters.md).
9
8
 
10
9
  - [Supported Formats](supported-formats.md) — the format-by-format table:
@@ -13,7 +12,6 @@ write allowlists — live at
13
12
  `llm-wiki`, `claude`, `opencode`, `agent-skills`, `dotenv`,
14
13
  `akm-workflow`, `akm-task`, `website-snapshot`, `generic-files`).
15
14
  - [Architecture → Adapters](https://github.com/itlackey/akm/blob/main/docs/architecture/adapters.md) — how AKM picks an
16
- adapter for a bundle, the `BundleAdapter` interface contract, the current
17
- `placeNew()` wiring status, the write allowlists that actually gate
15
+ adapter for a bundle, the `BundleAdapter` interface contract, the write allowlists that actually gate
18
16
  `akm remember`/`import`/`proposal accept`/etc., and per-adapter
19
17
  implementation caveats.