akm-cli 0.9.30 → 0.10.261001-beta

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 (384) hide show
  1. package/CHANGELOG.md +438 -0
  2. package/README.md +10 -10
  3. package/ROADMAP.md +112 -0
  4. package/STABILITY.md +99 -57
  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 +15 -29
  9. package/dist/assets/hints/cli-hints-short.md +2 -2
  10. package/dist/assets/improve-strategies/default.json +3 -3
  11. package/dist/assets/prompts/consolidate-pair.md +9 -7
  12. package/dist/assets/stash-skeleton/README.md +1 -1
  13. package/dist/assets/tasks/improve/akm-improve-consolidate.yml +1 -1
  14. package/dist/cli/shared.js +31 -48
  15. package/dist/cli/unknown-flags.js +6 -43
  16. package/dist/cli.js +8 -34
  17. package/dist/commands/agent/contribute-cli.js +1 -1
  18. package/dist/commands/completions.js +1 -2
  19. package/dist/commands/config-cli.js +5 -28
  20. package/dist/commands/env/env-cli.js +5 -5
  21. package/dist/commands/env/secret-cli.js +2 -2
  22. package/dist/commands/feedback-cli.js +75 -49
  23. package/dist/commands/health/checks.js +41 -16
  24. package/dist/commands/health/plugin-staleness.js +52 -22
  25. package/dist/commands/improve/autonomy-gate.js +5 -3
  26. package/dist/commands/improve/consolidate/chunking.js +3 -10
  27. package/dist/commands/improve/consolidate/continuity-check.js +4 -4
  28. package/dist/commands/improve/consolidate/pair-pass.js +29 -10
  29. package/dist/commands/improve/consolidate.js +10 -65
  30. package/dist/commands/improve/distill/lesson-update.js +91 -0
  31. package/dist/commands/improve/distill-guards.js +1 -43
  32. package/dist/commands/improve/distill.js +148 -21
  33. package/dist/commands/improve/eligibility.js +14 -1
  34. package/dist/commands/improve/extract-cli.js +1 -1
  35. package/dist/commands/improve/extract-prompt.js +17 -7
  36. package/dist/commands/improve/extract.js +5 -7
  37. package/dist/commands/improve/improve-cli.js +125 -118
  38. package/dist/commands/improve/improve-strategies.js +8 -12
  39. package/dist/commands/improve/improve.js +134 -52
  40. package/dist/commands/improve/loop-stages.js +18 -5
  41. package/dist/commands/improve/planner.js +0 -1
  42. package/dist/commands/improve/preparation.js +40 -99
  43. package/dist/commands/improve/proactive-maintenance.js +2 -2
  44. package/dist/commands/improve/reflect-noise.js +3 -55
  45. package/dist/commands/improve/reflect.js +29 -34
  46. package/dist/commands/improve/retrieval-queries.js +37 -0
  47. package/dist/commands/improve/retrieval-scope.js +2 -2
  48. package/dist/commands/improve/salience.js +2 -9
  49. package/dist/commands/improve/session-asset.js +4 -1
  50. package/dist/commands/improve/stage.js +23 -12
  51. package/dist/commands/lint/index.js +5 -20
  52. package/dist/commands/observability-cli.js +3 -9
  53. package/dist/commands/proposal/drain.js +43 -6
  54. package/dist/commands/proposal/proposal-cli.js +11 -31
  55. package/dist/commands/proposal/repository.js +20 -14
  56. package/dist/commands/proposal/validators/proposal-quality-validators.js +0 -3
  57. package/dist/commands/read/knowledge.js +3 -3
  58. package/dist/commands/read/remember-cli.js +0 -13
  59. package/dist/commands/read/search-cli.js +29 -97
  60. package/dist/commands/read/search.js +0 -11
  61. package/dist/commands/read/show.js +0 -19
  62. package/dist/commands/sources/plugin-upgrade.js +164 -101
  63. package/dist/commands/sources/sources-cli.js +1 -15
  64. package/dist/commands/sources/stash-cli.js +6 -14
  65. package/dist/commands/tasks/tasks-cli.js +4 -115
  66. package/dist/commands/workflow/plan.js +11 -33
  67. package/dist/commands/workflow-cli.js +2 -7
  68. package/dist/core/adapter/adapter-ids.js +1 -2
  69. package/dist/core/adapter/adapters/agent-skills-adapter.js +0 -4
  70. package/dist/core/adapter/adapters/akm-adapter.js +9 -48
  71. package/dist/core/adapter/adapters/akm-lint.js +10 -26
  72. package/dist/core/adapter/adapters/akm-metadata.js +2 -72
  73. package/dist/core/adapter/adapters/akm-task-adapter.js +0 -5
  74. package/dist/core/adapter/adapters/akm-workflow-adapter.js +9 -28
  75. package/dist/core/adapter/adapters/dotenv-adapter.js +1 -20
  76. package/dist/core/adapter/adapters/generic-files-adapter.js +0 -10
  77. package/dist/core/adapter/adapters/llm-wiki-adapter.js +0 -4
  78. package/dist/core/adapter/adapters/tool-dir-shared.js +0 -24
  79. package/dist/core/adapter/adapters/website-snapshot-adapter.js +4 -4
  80. package/dist/core/adapter/recognize-match.js +3 -4
  81. package/dist/core/common.js +18 -2
  82. package/dist/core/config/config-schema.js +12 -15
  83. package/dist/core/config/config-types.js +6 -15
  84. package/dist/core/config/config-walker.js +6 -23
  85. package/dist/core/config/config.js +17 -80
  86. package/dist/core/config/engine-semantics.js +7 -3
  87. package/dist/core/config/schema/engines.js +7 -7
  88. package/dist/core/config/schema/improve-processes.js +10 -63
  89. package/dist/core/config/schema/improve.js +2 -21
  90. package/dist/core/config/schema/index-config.js +6 -39
  91. package/dist/core/env-secret-ref.js +2 -45
  92. package/dist/core/errors.js +1 -2
  93. package/dist/core/extra-params.js +2 -86
  94. package/dist/core/file-lock.js +12 -7
  95. package/dist/core/improve-result.js +13 -1
  96. package/dist/core/mutation-target.js +2 -2
  97. package/dist/core/paths.js +4 -0
  98. package/dist/core/recognition-util.js +4 -5
  99. package/dist/core/run-lock.js +1 -1
  100. package/dist/core/subprocess.js +49 -0
  101. package/dist/core/warn.js +21 -4
  102. package/dist/core/write-source.js +3 -3
  103. package/dist/execution/target-ref.js +1 -2
  104. package/dist/indexer/indexer.js +15 -6
  105. package/dist/indexer/passes/memory-inference.js +15 -6
  106. package/dist/indexer/search/db-search.js +49 -36
  107. package/dist/indexer/search/fts-query.js +0 -19
  108. package/dist/indexer/search/ranking.js +29 -1
  109. package/dist/indexer/usage/usage-events.js +21 -16
  110. package/dist/integrations/agent/engine-resolution.js +5 -2
  111. package/dist/integrations/agent/index.js +1 -1
  112. package/dist/integrations/agent/profiles.js +41 -98
  113. package/dist/integrations/agent/request-lowering.js +3 -3
  114. package/dist/integrations/harnesses/aider/index.js +5 -0
  115. package/dist/integrations/harnesses/amazonq/index.js +1 -0
  116. package/dist/integrations/harnesses/claude/config-import.js +2 -3
  117. package/dist/integrations/harnesses/claude/index.js +5 -0
  118. package/dist/integrations/harnesses/codex/index.js +1 -0
  119. package/dist/integrations/harnesses/copilot/index.js +1 -0
  120. package/dist/integrations/harnesses/gemini/index.js +1 -0
  121. package/dist/integrations/harnesses/index.js +18 -39
  122. package/dist/integrations/harnesses/opencode/agent-builder.js +60 -35
  123. package/dist/integrations/harnesses/opencode/config-import.js +121 -52
  124. package/dist/integrations/harnesses/opencode/index.js +22 -0
  125. package/dist/integrations/harnesses/opencode/plugin-layout.js +68 -0
  126. package/dist/integrations/harnesses/opencode/session-log-types.js +12 -0
  127. package/dist/integrations/harnesses/opencode/session-log-v1.js +72 -0
  128. package/dist/integrations/harnesses/opencode/session-log-v2.js +140 -0
  129. package/dist/integrations/harnesses/opencode/session-log.js +104 -115
  130. package/dist/integrations/harnesses/opencode/version.js +98 -0
  131. package/dist/integrations/harnesses/opencode-sdk/{harness.js → index.js} +5 -17
  132. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +105 -206
  133. package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +199 -0
  134. package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +254 -0
  135. package/dist/integrations/harnesses/opencode-sdk/wire.js +66 -0
  136. package/dist/integrations/harnesses/openhands/index.js +1 -0
  137. package/dist/integrations/harnesses/pi/index.js +1 -0
  138. package/dist/integrations/harnesses/shared.js +2 -0
  139. package/dist/integrations/harnesses/types.js +2 -0
  140. package/dist/llm/client.js +74 -14
  141. package/dist/output/cli-hints.js +1 -1
  142. package/dist/output/context.js +10 -19
  143. package/dist/output/format-exempt.js +5 -8
  144. package/dist/output/shapes/helpers.js +1 -22
  145. package/dist/output/shapes/passthrough.js +0 -1
  146. package/dist/output/shapes.js +3 -31
  147. package/dist/output/stdout.js +5 -1
  148. package/dist/output/text/command-format.js +6 -1
  149. package/dist/output/text/workflow-format.js +4 -22
  150. package/dist/scripts/akm-migrate-node.js +15769 -16731
  151. package/dist/scripts/akm-migrate.js +16339 -17297
  152. package/dist/setup/detect.js +10 -4
  153. package/dist/setup/harness-config-import.js +5 -14
  154. package/dist/setup/setup.js +1 -1
  155. package/dist/setup/steps/tasks.js +12 -13
  156. package/dist/sources/providers/git-stash.js +94 -13
  157. package/dist/storage/repositories/index-utility-repository.js +2 -32
  158. package/dist/storage/repositories/index-vec-repository.js +4 -0
  159. package/dist/storage/repositories/task-history-repository.js +0 -5
  160. package/dist/storage/repositories/workflow-runs-repository.js +5 -15
  161. package/dist/tasks/embedded.js +2 -1
  162. package/dist/tasks/run/run-command-task.js +9 -1
  163. package/dist/tasks/run/run-workflow-task.js +4 -3
  164. package/dist/tasks/run/task-history.js +0 -2
  165. package/dist/tasks/run/task-log.js +38 -1
  166. package/dist/tasks/schedule-gates.js +39 -0
  167. package/dist/tasks/scheduler-binding.js +0 -16
  168. package/dist/tasks/scheduler-sync.js +3 -97
  169. package/dist/tasks/source/bounded-document.js +1 -1
  170. package/dist/tasks/source/task-source-v4.js +2 -12
  171. package/dist/tasks/task-run-reserved-flags.js +2 -31
  172. package/dist/workflows/authoring/authoring.js +6 -6
  173. package/dist/workflows/compile.js +8 -65
  174. package/dist/workflows/exec/child-workflow.js +22 -3
  175. package/dist/workflows/exec/native-executor.js +12 -147
  176. package/dist/workflows/exec/run-workflow.js +31 -103
  177. package/dist/workflows/exec/step-work.js +9 -178
  178. package/dist/workflows/exec/unit-dispatch.js +0 -10
  179. package/dist/workflows/freeze/environment.js +3 -44
  180. package/dist/workflows/freeze/freeze.js +8 -41
  181. package/dist/workflows/freeze/targets/child-workflow.js +27 -63
  182. package/dist/workflows/freeze/targets/command.js +2 -16
  183. package/dist/workflows/freeze/targets/shell.js +0 -2
  184. package/dist/workflows/freeze/task-bindings.js +2 -28
  185. package/dist/workflows/ir/params.js +12 -2
  186. package/dist/workflows/parser.js +82 -232
  187. package/dist/workflows/plan.js +1 -1
  188. package/dist/workflows/renderer.js +10 -19
  189. package/dist/workflows/runtime/run-plan.js +11 -53
  190. package/dist/workflows/runtime/runs.js +4 -27
  191. package/dist/workflows/source-files.js +12 -16
  192. package/dist/workflows/source-semantics.js +1 -93
  193. package/docs/README.md +43 -42
  194. package/docs/agents/README.md +15 -0
  195. package/docs/agents/agent-install.md +14 -0
  196. package/docs/architecture/0.10-process-rules.md +827 -0
  197. package/docs/architecture/README.md +67 -0
  198. package/docs/architecture/adapters.md +258 -0
  199. package/docs/architecture/akm-architecture-decision-history.md +2055 -0
  200. package/docs/architecture/akm-core-principles.md +126 -0
  201. package/docs/architecture/architecture.md +578 -0
  202. package/docs/architecture/comparisons/claude-code-vs-akm-workflows-full.md +550 -0
  203. package/docs/architecture/decisions/0001-no-interpolation-attached-structured-context.md +72 -0
  204. package/docs/architecture/decisions/0002-unit-reuse-and-input-hash-scope.md +142 -0
  205. package/docs/architecture/decisions/0003-child-env-allowlist-and-provenance.md +189 -0
  206. package/docs/architecture/decisions/0004-task-input-contract-and-flag-coercion.md +97 -0
  207. package/docs/architecture/decisions/0005-task-result-vocabulary-and-legacy-read-mapping.md +108 -0
  208. package/docs/architecture/decisions/0006-task-source-version-routing.md +124 -0
  209. package/docs/architecture/decisions/0007-workflow-composition-bounds.md +83 -0
  210. package/docs/architecture/decisions/0008-task-binding-normalization.md +88 -0
  211. package/docs/architecture/decisions/0009-child-run-publication-column-parity.md +80 -0
  212. package/docs/architecture/decisions/0010-driver-protocol-cut.md +36 -0
  213. package/docs/architecture/decisions/0011-engine-run-loop-invariants.md +125 -0
  214. package/docs/architecture/decisions/README.md +62 -0
  215. package/docs/architecture/improvement.md +479 -0
  216. package/docs/architecture/internals/classification.md +154 -0
  217. package/docs/architecture/internals/fresh-host-rebuild-runbook.md +40 -0
  218. package/docs/architecture/internals/functional-contract-patterns.md +340 -0
  219. package/docs/architecture/internals/health-advisories.md +110 -0
  220. package/docs/architecture/internals/improve-workflow.md +719 -0
  221. package/docs/architecture/internals/indexing.md +498 -0
  222. package/docs/architecture/internals/registry-network-boundary.md +57 -0
  223. package/docs/architecture/internals/search.md +248 -0
  224. package/docs/architecture/internals/storage-locations.md +943 -0
  225. package/docs/architecture/persisted-data-compat.md +68 -0
  226. package/docs/architecture/reviews/env-secret-access.md +319 -0
  227. package/docs/architecture/runtime-boundary-design.md +153 -0
  228. package/docs/architecture/specs/0.9.0-close-out-plan.md +361 -0
  229. package/docs/architecture/specs/0.9.0-decisions.md +532 -0
  230. package/docs/architecture/specs/0.9.0-docs-code-drift-register.md +745 -0
  231. package/docs/architecture/specs/0.9.0-open-items-register.md +135 -0
  232. package/docs/architecture/specs/0.9.0-public-api-issue-backlog.md +740 -0
  233. package/docs/architecture/specs/0.9.0-release-surface-review.md +636 -0
  234. package/docs/architecture/specs/agent-command-engine-model-design.md +513 -0
  235. package/docs/architecture/specs/akm-0.9.0-bundle-adapter-spec.md +501 -0
  236. package/docs/architecture/specs/akm-0.9.0-ref-grammar-decision.md +291 -0
  237. package/docs/architecture/specs/akm-format-neutral-bundle-workspace-spec.md +2059 -0
  238. package/docs/architecture/specs/di-seams-plan.md +539 -0
  239. package/docs/architecture/specs/driver-protocol-keep-or-cut.md +275 -0
  240. package/docs/architecture/specs/fact-asset-type.md +142 -0
  241. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +634 -0
  242. package/docs/architecture/specs/okf-support.md +148 -0
  243. package/docs/architecture/specs/ref.md +329 -0
  244. package/docs/architecture/specs/reviews/task-workflow-unification/README.md +72 -0
  245. package/docs/architecture/specs/reviews/task-workflow-unification/findings-consolidated.md +152 -0
  246. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-alternatives.md +352 -0
  247. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-bunqueue.md +300 -0
  248. package/docs/architecture/specs/reviews/task-workflow-unification/library-eval-openworkflow.md +402 -0
  249. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-1.md +758 -0
  250. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-2.md +645 -0
  251. package/docs/architecture/specs/reviews/task-workflow-unification/opus-review-3.md +602 -0
  252. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-adversarial.md +27 -0
  253. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-architecture.md +27 -0
  254. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-coverage.md +74 -0
  255. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r1-security.md +15 -0
  256. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-adversarial.md +132 -0
  257. package/docs/architecture/specs/reviews/task-workflow-unification/panel-r2-verification.md +147 -0
  258. package/docs/architecture/specs/stash-conventions-code-spec.md +275 -0
  259. package/docs/architecture/specs/stash-organization-conventions.md +377 -0
  260. package/docs/architecture/specs/task-workflow-format-unification.md +721 -0
  261. package/docs/architecture/specs/workflow-engine-buy-vs-build.md +231 -0
  262. package/docs/architecture/specs/workflow-format-unification.md +432 -0
  263. package/docs/architecture/testing/manual-testing-checklist.md +3411 -0
  264. package/docs/architecture/testing/okf-v0.2-conformance-runbook.md +924 -0
  265. package/docs/architecture/testing/task-workflow-manual-tests.md +1720 -0
  266. package/docs/architecture/testing/testing-workflow.md +446 -0
  267. package/docs/architecture/workflow-engine.md +223 -0
  268. package/docs/guides/README.md +33 -0
  269. package/docs/guides/author-bundles.md +310 -0
  270. package/docs/guides/author-workflows.md +490 -0
  271. package/docs/guides/bundles.md +323 -0
  272. package/docs/guides/capture-knowledge.md +136 -0
  273. package/docs/guides/claude-code-vs-akm-workflows.md +29 -0
  274. package/docs/guides/concepts.md +93 -0
  275. package/docs/guides/discover-and-load.md +158 -0
  276. package/docs/guides/getting-started.md +240 -0
  277. package/docs/guides/improve-the-library.md +247 -0
  278. package/docs/guides/knowledge-management.md +18 -0
  279. package/docs/guides/recipes/headless-install.md +97 -0
  280. package/docs/guides/recipes/website-source.md +28 -0
  281. package/docs/guides/run-workflows.md +279 -0
  282. package/docs/guides/scheduling.md +131 -0
  283. package/docs/guides/use-with-any-agent.md +174 -0
  284. package/docs/guides/wikis.md +81 -0
  285. package/docs/integration/bundling-akm.md +7 -6
  286. package/docs/maintainers/README.md +19 -0
  287. package/docs/maintainers/curate-workmap.md +335 -0
  288. package/docs/maintainers/eval.md +3 -0
  289. package/docs/maintainers/local-development.md +108 -0
  290. package/docs/maintainers/release-checklist.md +135 -0
  291. package/docs/migration/README.md +4 -2
  292. package/docs/migration/release-notes/0.0.13.md +1 -1
  293. package/docs/migration/release-notes/0.1.0.md +1 -1
  294. package/docs/migration/release-notes/0.10.0.md +201 -0
  295. package/docs/migration/release-notes/0.2.0.md +1 -1
  296. package/docs/migration/release-notes/0.3.0.md +1 -1
  297. package/docs/migration/release-notes/0.5.0.md +1 -1
  298. package/docs/migration/release-notes/0.6.0.md +1 -1
  299. package/docs/migration/release-notes/0.7.0.md +1 -1
  300. package/docs/migration/release-notes/0.7.3.md +2 -2
  301. package/docs/migration/release-notes/0.7.4.md +1 -1
  302. package/docs/migration/release-notes/0.7.5.md +1 -1
  303. package/docs/migration/release-notes/0.8.0.md +1 -1
  304. package/docs/migration/release-notes/0.9.0.md +1 -1
  305. package/docs/migration/release-notes/0.9.14.md +1 -1
  306. package/docs/migration/release-notes/0.9.15.md +1 -1
  307. package/docs/migration/release-notes/0.9.16.md +1 -1
  308. package/docs/migration/release-notes/0.9.17.md +1 -1
  309. package/docs/migration/release-notes/0.9.19.md +1 -1
  310. package/docs/migration/release-notes/0.9.2.md +1 -1
  311. package/docs/migration/release-notes/README.md +28 -31
  312. package/docs/migration/v0.5-to-v0.6.md +759 -0
  313. package/docs/migration/v0.8-to-v0.9.md +1 -1
  314. package/docs/migration/v0.9-to-v0.10.md +507 -0
  315. package/docs/plans/0.9.2-agent-command-workflow-plan.md +423 -0
  316. package/docs/posts/README.md +30 -0
  317. package/docs/posts/akm-command-tour.md +495 -0
  318. package/docs/posts/akm-logo-sized.webp +0 -0
  319. package/docs/posts/belief-aware-memory-12.md +139 -0
  320. package/docs/posts/config-v2-lessons-16.md +191 -0
  321. package/docs/posts/improve-loop-autonomous-10.md +225 -0
  322. package/docs/posts/improve-pipeline-debugging-0803.md +179 -0
  323. package/docs/posts/intro-part-01.md +76 -0
  324. package/docs/posts/intro-part-02.md +221 -0
  325. package/docs/posts/intro-part-03.md +190 -0
  326. package/docs/posts/intro-part-04.md +221 -0
  327. package/docs/posts/llm-mode-reflect-13.md +166 -0
  328. package/docs/posts/openpalm-built-on-akm.md +86 -0
  329. package/docs/posts/progressive-disclosure-06.md +129 -0
  330. package/docs/posts/proposal-safety-net-15.md +112 -0
  331. package/docs/posts/release-0.5.0.md +247 -0
  332. package/docs/posts/release-0.6.0.md +117 -0
  333. package/docs/posts/release-0.7.0.md +159 -0
  334. package/docs/posts/release-0.8.0.md +332 -0
  335. package/docs/posts/scattered-skills-05.md +100 -0
  336. package/docs/posts/task-assets-persistent-workflows-11.md +222 -0
  337. package/docs/posts/team-skills-07.md +198 -0
  338. package/docs/posts/wiki-agent-knowledge-08.md +223 -0
  339. package/docs/posts/workflows-vaults-09.md +321 -0
  340. package/docs/product-surface.md +54 -0
  341. package/docs/reference/README.md +2 -2
  342. package/docs/reference/api.md +65 -0
  343. package/docs/reference/asset-types.md +166 -0
  344. package/docs/reference/bundle-types.md +2 -4
  345. package/docs/reference/cli.md +163 -192
  346. package/docs/reference/configuration.md +101 -20
  347. package/docs/reference/data-and-telemetry.md +2 -2
  348. package/docs/reference/env-and-secrets.md +126 -0
  349. package/docs/reference/memory.md +124 -0
  350. package/docs/reference/refs.md +156 -0
  351. package/docs/reference/registry.md +489 -0
  352. package/docs/reference/supported-formats.md +3 -4
  353. package/docs/reference/tasks.md +12 -19
  354. package/docs/reference/website-sources.md +141 -0
  355. package/docs/reference/workflow-schema.md +89 -317
  356. package/docs/reference/workflows.md +20 -48
  357. package/package.json +23 -16
  358. package/schemas/akm-config.json +2 -243
  359. package/schemas/akm-task.json +2 -3
  360. package/schemas/akm-workflow.json +47 -84
  361. package/dist/assets/improve-strategies/catchup.json +0 -41
  362. package/dist/assets/improve-strategies/proactive-maintenance.json +0 -24
  363. package/dist/assets/improve-strategies/quick.json +0 -17
  364. package/dist/assets/improve-strategies/reflect-distill.json +0 -29
  365. package/dist/assets/improve-strategies/thorough.json +0 -49
  366. package/dist/assets/prompts/retrieval-relevance-judge.md +0 -6
  367. package/dist/assets/tasks/improve/akm-improve-catchup.yml +0 -6
  368. package/dist/assets/tasks/improve/akm-improve-frequent.yml +0 -4
  369. package/dist/assets/tasks/improve/akm-improve-nightly.yml +0 -4
  370. package/dist/cli/retired-commands.js +0 -118
  371. package/dist/commands/improve/retrieval-gate.js +0 -132
  372. package/dist/commands/tasks/validate.js +0 -176
  373. package/dist/core/config/legacy-source-shape-shim.js +0 -117
  374. package/dist/indexer/feedback/utility-policy.js +0 -75
  375. package/dist/integrations/harnesses/ids.js +0 -28
  376. package/dist/tasks/source/task-source-v3-frozen.js +0 -424
  377. package/dist/tasks/source/task-to-v4.js +0 -863
  378. package/dist/workflows/exec/worktree.js +0 -372
  379. package/dist/workflows/freeze/child-output-references.js +0 -83
  380. package/dist/workflows/freeze/identity.js +0 -22
  381. package/dist/workflows/freeze/targets/script.js +0 -50
  382. package/dist/workflows/freeze/targets/task.js +0 -124
  383. package/dist/workflows/github-yaml.js +0 -506
  384. package/dist/workflows/runtime/run-outputs.js +0 -80
@@ -0,0 +1,158 @@
1
+ # Discover and Load
2
+
3
+ Load only what the current task needs. Agents rarely know the exact name of
4
+ the asset they need, and front-loading every skill, script, and doc into the
5
+ prompt wastes context on capability the task will never touch. akm keeps the
6
+ full library indexed and searchable, then lets an agent pull a shortlist,
7
+ inspect one candidate, and load exactly the ref (or document section) the
8
+ task requires — nothing more.
9
+
10
+ ## End-to-end example
11
+
12
+ An agent picks up the task "deploy the app to staging." It doesn't know
13
+ whether a script, a workflow, or a skill covers this, so it starts broad,
14
+ narrows to a ref, and loads that ref's content:
15
+
16
+ ```sh
17
+ akm curate "deploy the app to staging" --detail agent
18
+ # → ranked shortlist; top hit: {"type":"script","ref":"scripts/deploy.sh","score":0.91,...}
19
+
20
+ akm show scripts/deploy.sh
21
+ # → {"run": "...", "setup": "...", ...} — ready to execute
22
+ ```
23
+
24
+ That three-step arc — discover, load, and later record how it went — is the
25
+ whole retrieval loop this guide covers.
26
+
27
+ ## 1. When to use search vs. curate
28
+
29
+ Reach for `akm search` when you already know roughly what you're looking for
30
+ — a type, a keyword, a conceptId prefix — and want a ranked list of matches.
31
+ Reach for `akm curate` when you're starting a task and want akm to do the
32
+ narrowing for you: curate runs a search, attaches previews and follow-up
33
+ commands, and returns a small, high-confidence shortlist rather than a long
34
+ results page. In short: search when you know what you're querying for,
35
+ curate when you know what you're trying to do.
36
+
37
+ ## 2. Discover a shortlist
38
+
39
+ `akm search` queries the unified index and ranks hits by relevance — keyword
40
+ (BM25) and semantic (vector) matches fused into one list:
41
+
42
+ ```sh
43
+ akm search "deploy" --type script --detail agent
44
+ # → [{"type":"script","name":"deploy.sh","ref":"scripts/deploy.sh","score":0.0328,...}]
45
+ ```
46
+
47
+ `akm curate` goes further: it takes the top search hits in order and attaches
48
+ a preview, run details and related support refs — all while including a
49
+ direct `akm show <ref>` follow-up on every result:
50
+
51
+ ```sh
52
+ akm curate "review an architecture proposal" --type skill
53
+ # → ranked shortlist with akm show skills/code-review as the top follow-up
54
+ ```
55
+
56
+ Use `--detail agent` on either command to get the `ref`/`path`/`editable`
57
+ fields an agent needs to act on a hit. See [CLI Reference](../reference/cli.md)
58
+ for the full flag tables and exact output-field lists per `--detail` level.
59
+
60
+ ## 3. Load the selected capability
61
+
62
+ Once you have a ref, `akm show` loads its full content. Every asset type
63
+ returns type-specific fields — scripts include `run` and `setup`, skills
64
+ return `content`, workflows return parsed `steps`:
65
+
66
+ ```sh
67
+ akm show scripts/deploy.sh
68
+ # → {"run": "...", "setup": "...", "cwd": "...", ...}
69
+ ```
70
+
71
+ The ref format is `[bundle//]conceptId` — the `bundle//` prefix narrows
72
+ lookup to one installed bundle when a conceptId is ambiguous across bundles.
73
+
74
+ ## 4. Load a document section
75
+
76
+ Knowledge docs and other markdown assets can be large. Append `#fragment` to
77
+ a ref to return one section by heading slug instead of the whole document:
78
+
79
+ ```sh
80
+ akm show knowledge/api-guide#authentication
81
+ # → just the "Authentication" section, not the full document
82
+ ```
83
+
84
+ Search can also return an opaque `#akm-fragment-...` selector for a bounded
85
+ piece of a long document. The exact selector remains the default. For memories
86
+ whose opening context helps interpret a later matching turn, opt into bounded
87
+ lead context:
88
+
89
+ ```sh
90
+ akm show '<ref-from-search>' --context lead --max-tokens 800
91
+ # → indexed-safe document lead, then [Selected matching fragment] and the match
92
+ ```
93
+
94
+ AKM preserves the selected match before lead bytes when the budget is tight and
95
+ reports `contextTruncated` in JSON. The response also distinguishes canonical
96
+ `parentRef` from `selectedRef` and includes fragment position, line bounds,
97
+ neighbors, and separate fragment/parent size estimates.
98
+
99
+ An unmatched fragment lists the available slugs instead of erroring, so a
100
+ guess that misses still tells you what to try next.
101
+
102
+ ## 5. Record the outcome
103
+
104
+ After acting on a loaded asset, close the loop with `akm feedback` so the
105
+ improvement pipeline learns from the outcome:
106
+
107
+ ```sh
108
+ akm feedback scripts/deploy.sh --positive
109
+ akm feedback skills/code-review --negative --reason "references a removed flag"
110
+ ```
111
+
112
+ Record `--negative` only when the asset's content is wrong or stale, and say what
113
+ is wrong and what it should say. A note that simply did not fit your task is not
114
+ negative feedback: record nothing for it.
115
+ `akm feedback <ref> --negative --reason "<what is wrong and what should change>"`
116
+ flags the asset: it ranks lower right away, and the next `akm improve` run may
117
+ repair its description, title or `when_to_use` from your reason. Improve does
118
+ not rewrite an asset's text, so once you have verified the correct fact, attach
119
+ the exact fix: `--replace "<exact current text>" --with "<corrected text>"
120
+ --source "<URL, command or file that shows it>"`. That is how a one-off task
121
+ turns into a durable improvement to the shared library rather than a result
122
+ nobody else benefits from. `--positive` records that an asset helped (it raises
123
+ its ranking) and does not trigger a rewrite.
124
+
125
+ ## 6. Troubleshoot an empty or poor result
126
+
127
+ - **Zero hits on an exact-sounding query** — the search pipeline already
128
+ retries with prefix matching when the exact query returns nothing, so a
129
+ true zero usually means the term genuinely isn't indexed yet. Run `akm
130
+ index` (or `akm index --full` after adding a new source) and search again.
131
+ - **Query looks right but nothing comes back** — check `--type`: it's
132
+ free-form and unvalidated, so a typo'd type (`scrpit` instead of `script`)
133
+ silently returns no hits rather than erroring.
134
+ - **Local results are missing something you know exists** — confirm
135
+ `--from` matches where the asset lives (`local` is the default; use
136
+ `registry` or `all` to include the public registry).
137
+ - **A known-good asset doesn't show up** — session assets and
138
+ `proposed`-quality entries are excluded from default results
139
+ (`--include-sessions` / `--include-proposed` bring them back), and
140
+ `--filter user=...`/`--filter agent=...` scoping can silently exclude
141
+ entries that don't carry a matching scope.
142
+ - **Curate's shortlist feels off-topic** — narrow with `--type` to steer it
143
+ toward workflows, skills, or scripts specifically, or fall back to `akm
144
+ search` for a plain ranked list.
145
+
146
+ ## 7. Reference links
147
+
148
+ - [CLI Reference](../reference/cli.md) — full `--detail` flag
149
+ semantics, complete flag tables, and exact output-field lists for `search`,
150
+ `curate`, `show`, and `index`
151
+ - [Architecture](../architecture/architecture.md) — ranking and search
152
+ implementation detail (Search Pipeline, Show Resolution, Utility Scoring)
153
+ - [Bundles](bundles.md) — where indexed assets come from
154
+ - [Knowledge Management](knowledge-management.md) — capturing and importing
155
+ assets before they're discoverable
156
+ - [Use akm with any agent](use-with-any-agent.md) — how agents reference
157
+ assets by ref in practice
158
+ - [Concepts](concepts.md) — refs, search priority, and the FTS5 index
@@ -0,0 +1,240 @@
1
+ # Getting Started
2
+
3
+ Install akm, connect a capability source, and pull a curated shortlist for a
4
+ real task. This path takes about five to seven minutes end to end.
5
+
6
+ ## Runtime Requirement
7
+
8
+ The npm package requires Node.js >= 22 to bootstrap its command on every
9
+ platform. If a working Bun >= 1.0 is also on `PATH`, the package launcher
10
+ prefers Bun for execution; old, unusable, or absent Bun installations fall back
11
+ to Node.js. The standalone binaries are runtime-free.
12
+
13
+ ## 1. Install
14
+
15
+ **Option 1 — npm package (recommended; requires [Node.js](https://nodejs.org) >= 22):**
16
+
17
+ ```sh
18
+ npm install -g akm-cli
19
+ ```
20
+
21
+ **Option 2 — Prebuilt binary (no runtime required):**
22
+
23
+ ```sh
24
+ # Linux / macOS
25
+ curl -fsSL https://github.com/itlackey/akm/releases/latest/download/install.sh | bash
26
+
27
+ # Windows (PowerShell)
28
+ irm https://github.com/itlackey/akm/releases/latest/download/install.ps1 | iex
29
+ ```
30
+
31
+ Or download a standalone binary directly from the
32
+ [GitHub releases](https://github.com/itlackey/akm/releases) page.
33
+
34
+ Hitting a PowerShell execution-policy error on Windows? See
35
+ [Troubleshooting](#troubleshooting) at the end of this guide.
36
+
37
+ **Success check:**
38
+
39
+ ```sh
40
+ akm --version
41
+ ```
42
+
43
+ ## 2. Run setup
44
+
45
+ Guided, interactive setup is the default:
46
+
47
+ ```sh
48
+ akm setup
49
+ ```
50
+
51
+ `akm setup` walks through bundle location, embedding/LLM settings, semantic
52
+ search asset preparation, registries, sources, and task definitions. It also
53
+ reviews your scheduled task definitions and asks whether to activate them in
54
+ the OS scheduler — that part of the flow, plus how to migrate or repair
55
+ scheduler bindings later, is covered in [Scheduling](scheduling.md).
56
+
57
+ For non-interactive use — scripting, CI, or when you just want a working
58
+ bundle fast — use `--yes`:
59
+
60
+ ```sh
61
+ akm setup --yes
62
+ akm setup --dir ~/custom-bundle # optional: a non-default bundle location
63
+ ```
64
+
65
+ **Success check:** either form creates `~/akm` (or your `--dir` path) — your
66
+ working bundle, the primary directory where your personal assets live — with
67
+ subdirectories for each asset type: `scripts/`, `skills/`, `commands/`,
68
+ `agents/`, `knowledge/`, `instructions/`, `workflows/`, `memories/`, `env/`,
69
+ `secrets/`, `facts/`, `lessons/`, `tasks/`, and `sessions/`. See
70
+ [Filesystem Layout](../architecture/internals/storage-locations.md) for
71
+ platform-specific paths and environment variable overrides.
72
+
73
+ ## Isolated sandbox workflow
74
+
75
+ Need a throwaway install for agent tests, CI repros, or docs verification? Run
76
+ akm inside a temporary HOME/XDG sandbox so nothing touches your normal local
77
+ state:
78
+
79
+ ```sh
80
+ export AKM_SANDBOX="$(mktemp -d /tmp/akm-sandbox.XXXXXX)"
81
+ export HOME="$AKM_SANDBOX/home"
82
+ export XDG_CONFIG_HOME="$HOME/.config"
83
+ export XDG_DATA_HOME="$HOME/.local/share"
84
+ export XDG_CACHE_HOME="$HOME/.cache"
85
+ export XDG_STATE_HOME="$HOME/.local/state"
86
+ mkdir -p "$XDG_CONFIG_HOME" "$XDG_DATA_HOME" "$XDG_CACHE_HOME" "$XDG_STATE_HOME"
87
+ akm setup --yes --dir "$AKM_SANDBOX/bundle"
88
+ ```
89
+
90
+ Delete `$AKM_SANDBOX` when you're done to remove the whole throwaway install.
91
+
92
+ ## 3. Connect a capability source
93
+
94
+ Add something to search. Point akm at a directory you already have, or
95
+ install the official onboarding bundle:
96
+
97
+ ```sh
98
+ akm bundle add ~/.claude/skills # an existing capability directory
99
+ akm bundle add github:itlackey/akm-stash # the official onboarding bundle
100
+ ```
101
+
102
+ Every source materialises files to a directory; akm indexes them locally.
103
+
104
+ **Success check:**
105
+
106
+ ```sh
107
+ akm bundle list
108
+ ```
109
+
110
+ lists the source you just added.
111
+
112
+ ## 4. Index
113
+
114
+ ```sh
115
+ akm index
116
+ ```
117
+
118
+ `akm index` scans every configured source, then builds the search database.
119
+ Run it again whenever you add or change assets. Use `akm index --full` to
120
+ force a complete rebuild instead of an incremental update.
121
+
122
+ **Success check:** the command reports how many assets it indexed. If a
123
+ workflow file is malformed, akm skips that one asset, continues indexing the
124
+ rest of the bundle, and reports the skipped file in `warnings`.
125
+
126
+ ## 5. Curate for a real task
127
+
128
+ Describe what you're trying to do, in plain language, instead of guessing an
129
+ exact asset name:
130
+
131
+ ```sh
132
+ akm curate "deploy a Bun app"
133
+ ```
134
+
135
+ Unlike `akm search`, `akm curate` attaches a preview and run details per hit,
136
+ adds related support refs, and summarizes the set — it's the usual starting
137
+ point for an agent.
138
+
139
+ **Success check:** the response includes a small shortlist; each entry
140
+ carries a `ref` field and a direct follow-up command such as `akm show <ref>`
141
+ or `akm bundle add <ref>`.
142
+
143
+ ## 6. Show one of the results
144
+
145
+ Pick a `ref` from your curate output and load its full payload:
146
+
147
+ ```sh
148
+ akm show <ref> # e.g. akm show workflows/deploy
149
+ ```
150
+
151
+ **Success check:** structured JSON with everything an agent needs to use the
152
+ asset — a `run` command plus optional `cwd` and `setup` for scripts, a
153
+ `prompt` payload for agents, or the document `content` for knowledge (append
154
+ `#<heading-slug>` to a ref for one section).
155
+
156
+ AKM retrieves every supported capability type. It directly orchestrates
157
+ defined execution surfaces such as workflows, agent dispatch, tasks, and
158
+ guarded subprocess injection. It does not blindly execute arbitrary indexed
159
+ content merely because that content appears in search results — `show` hands
160
+ your agent the payload; running it is a deliberate next step.
161
+
162
+ ## 7. Tell your agent about akm
163
+
164
+ ```sh
165
+ akm hints --detail brief >> AGENTS.md
166
+ ```
167
+
168
+ **Success check:** `AGENTS.md` now has a block of agent-facing usage
169
+ instructions for the `akm` CLI, so any agent reading that file knows how to
170
+ call it.
171
+
172
+ ## Optional: hand-write a script
173
+
174
+ Curious how classification works on a file you wrote yourself, rather than
175
+ one that came from a bundle? Add a small script and index it:
176
+
177
+ ```sh
178
+ cat > ~/akm/scripts/hello.sh << 'EOF'
179
+ #!/usr/bin/env bash
180
+ # A simple greeting script
181
+ echo "Hello from akm!"
182
+ EOF
183
+ chmod +x ~/akm/scripts/hello.sh
184
+ akm index
185
+ akm show scripts/hello.sh
186
+ ```
187
+
188
+ Any file with a known extension (`.sh`, `.ts`, `.py`, etc.) placed in your
189
+ working bundle is automatically recognized — the `scripts/` directory isn't
190
+ required, it just increases classification confidence. Assets use inline
191
+ metadata, not `.stash.json` sidecars: markdown assets use frontmatter, and
192
+ scripts use structured header comments (a short leading description,
193
+ `@param`, and execution hints like `@run` / `@setup` / `@cwd` when needed).
194
+ See [Concepts](concepts.md) for how classification works.
195
+
196
+ ## What just happened?
197
+
198
+ You ran the retrieval loop end to end: **connect** (added a source),
199
+ **index** (built the search database), **curate** (got a relevance-ranked
200
+ shortlist for a real task), and **show** (loaded one asset's full payload).
201
+ The remaining links in that loop — **use/run** the asset, send **feedback**
202
+ on whether it helped, and let akm turn accumulated signal into a
203
+ **proposal** — are what the guides below cover.
204
+
205
+ ## Next steps
206
+
207
+ - [Discover & Load](discover-and-load.md) — search, curate, and show in depth
208
+ - [Bundles](bundles.md) — sources, registries, and installing more capability
209
+ - [Capture Knowledge](capture-knowledge.md) — memories, imports, and wikis
210
+ - [Improve the Library](improve-the-library.md) — feedback, proposals, and
211
+ the improvement loop
212
+ - [Run Workflows](run-workflows.md) — structured, resumable
213
+ multi-step procedures
214
+
215
+ Scheduling `akm improve` and other background tasks — see
216
+ [Scheduling](scheduling.md).
217
+
218
+ ## Troubleshooting
219
+
220
+ **Windows PowerShell execution policy.** `install.ps1` requires Windows
221
+ PowerShell 5.1 or newer (default on Windows 10 and Windows 11). If
222
+ `irm ... | iex` triggers a SmartScreen prompt or an ExecutionPolicy error, do
223
+ one of:
224
+
225
+ ```powershell
226
+ # Allow scripts in this session only, then re-run the install:
227
+ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
228
+ irm https://github.com/itlackey/akm/releases/latest/download/install.ps1 | iex
229
+ ```
230
+
231
+ ```powershell
232
+ # Or download the script, unblock the file, and run it:
233
+ Invoke-WebRequest -Uri https://github.com/itlackey/akm/releases/latest/download/install.ps1 -OutFile install.ps1
234
+ Unblock-File .\install.ps1
235
+ .\install.ps1
236
+ ```
237
+
238
+ Windows ARM64 hosts install the x64 binary, which Windows runs via x86_64
239
+ emulation. Native ARM64 support is tracked alongside Bun's ARM64-on-Windows
240
+ progress.
@@ -0,0 +1,247 @@
1
+ # Improve the Library
2
+
3
+ AKM learns from outcomes, but changes remain reviewable. Every time an agent
4
+ uses a capability and reports back whether it helped, AKM folds that signal
5
+ into the asset's utility score; when the report says the content was wrong, it
6
+ proposes a concrete edit. Nothing lands in your bundle automatically: every
7
+ generated change queues as a proposal you (or an explicit policy) accept,
8
+ reject, or revert.
9
+
10
+ ```text
11
+ agent selects capability -> agent records outcome -> AKM updates utility and analyzes evidence ->
12
+ AKM creates a proposal -> human or policy reviews the diff -> accept / reject / revert
13
+ ```
14
+
15
+ ## akm feedback
16
+
17
+ `akm feedback` records a positive or negative signal for any indexed asset.
18
+ The signal updates the asset's utility score immediately, so highly-rated
19
+ assets rank higher and assets flagged wrong or stale surface less often right
20
+ away. See
21
+ [Architecture: The Improvement Loop](../architecture/improvement.md#utility-scoring)
22
+ for how that score is computed.
23
+
24
+ `akm feedback <ref> --negative --reason "<what is wrong and what should change>"`
25
+ flags the asset: it ranks lower right away, and the next improve run may repair
26
+ its description, title or `when_to_use` from your reason. Improve does not
27
+ rewrite an asset's text. Once you have verified the correct fact, attach the
28
+ exact fix: `--replace "<exact current text>" --with "<corrected text>"
29
+ --source "<URL, command or file that shows it>"` (repeat `--replace`/`--with`
30
+ for several edits). akm checks that each `--replace` text appears exactly once,
31
+ records nothing if one does not, and applies the edit at once: no review, no
32
+ gate (the `feedback` proposal it files is accepted on the spot, so
33
+ `akm proposal revert` undoes it). `--positive` records that an asset helped (it raises its ranking)
34
+ and does not trigger a rewrite.
35
+
36
+ ```sh
37
+ akm feedback skills/code-review --positive
38
+ akm feedback agents/reviewer --negative --reason "Gave outdated migration steps"
39
+ akm feedback knowledge/opencode-server --negative --reason "the default port is 4096, not 8000" --replace "port 8000" --with "port 4096" --source "https://opencode.ai/docs/server/"
40
+ akm feedback workflows/ship-release --positive --reason "Worked end-to-end on 0.8.0"
41
+
42
+ # With a structured reason slug (consumed by improve/distill prompts):
43
+ akm feedback skills/planner --negative --reason "wrong-default-timeout"
44
+ ```
45
+
46
+ Specify exactly one of `--positive` or `--negative`. The ref must be present in
47
+ the current local index. `--negative` additionally requires `--reason`, and
48
+ omitting it exits 2. Full flag reference:
49
+ [CLI Reference — feedback](../reference/cli.md#feedback---reason).
50
+
51
+ Record feedback about the asset's content: that it helped, or that it turned
52
+ out wrong or stale. Record `--negative` only for content that is wrong or stale,
53
+ and say what is wrong and what it should say. A note that simply did not fit
54
+ your task is not negative feedback: record nothing for it. A failed `akm`
55
+ command, such as an `akm show` that errors on the ref, says nothing about the
56
+ asset, so don't record it as feedback on it: reflect and distill read each
57
+ reason as a report about the asset's content.
58
+
59
+ **Example: flag a skill that gave bad advice**
60
+
61
+ ```sh
62
+ akm feedback skills/deploy --negative \
63
+ --reason "Skips the dry-run step; caused prod incident 2026-05-10"
64
+ ```
65
+
66
+ ## akm log
67
+
68
+ `akm log` is the realtime append-only event stream that every mutating CLI
69
+ verb writes to — the record of what agents selected and what feedback they
70
+ gave.
71
+
72
+ ```sh
73
+ akm log # All events, oldest first
74
+ akm log --type feedback # Filter by event type
75
+ akm log --ref skills/deploy
76
+ akm log --since '@offset:12345' # Resume from a durable cursor
77
+ ```
78
+
79
+ See [CLI Reference — log](../reference/cli.md#log) for the full filter list
80
+ and cursor format.
81
+
82
+ ## akm improve
83
+
84
+ `akm improve` is the main entry point for the self-improvement pass. It reads
85
+ feedback signals and usage patterns, then generates proposals — it never
86
+ writes directly to your bundle. By default, generated proposals always queue
87
+ for review; the underlying autonomy gate and strategy configuration are
88
+ covered in [Architecture: The Improvement Loop](../architecture/improvement.md).
89
+
90
+ ```sh
91
+ akm improve # Full bundle pass
92
+ akm improve memory # Scope to memory assets only
93
+ akm improve skills/code-review # One asset
94
+ akm improve --task "reduce duplication"
95
+ akm improve --dry-run # Show planned refs without generating proposals
96
+ akm improve --limit 10 # Cap the refs the run processes
97
+ ```
98
+
99
+ A run improves one bundle, the one it writes to (`--bundle`, else
100
+ `defaultWriteTarget`, else your working bundle), and leaves assets in your other
101
+ bundles alone even when they are writable. Run `akm improve --bundle team` to
102
+ improve another one. A scheduled run covers the same single bundle, so schedule
103
+ one `akm improve --bundle <name>` run per other bundle you want improved.
104
+ `--dry-run` previews the bundle a live run would improve.
105
+
106
+ A rewrite (reflect) is planned only for assets with negative feedback in the
107
+ last 30 days that is newer than the last time improve tried them, or for an
108
+ explicit ref; a positive or note-only signal never plans one, and neither does a negative whose exact fix (`--replace`, `--outdated`, `--superseded-by`) has since been accepted. Distill reads any
109
+ feedback on a memory in that window, but skips a memory flagged wrong and not
110
+ edited since: a negative feedback in that window judged the body it still has
111
+ (or, recorded without that body's hash, is newer than its file's last write).
112
+ It also skips a memory whose only feedback in that window is a positive with no
113
+ reason or note: say what helped (`--reason`), or the lesson has nothing to
114
+ distil.
115
+ Unless `--require-feedback-signal` is set,
116
+ the proactive-maintenance lane (on in `default`) also plans assets with no such
117
+ feedback that are due for a revisit: at most 15 per run
118
+ (`processes.proactiveMaintenance.maxPerRun`), and only assets not reflected or
119
+ distilled for 30 days (`dueDays`), so each comes up at most once a month. The
120
+ planned assets are ranked by salience and cut to `--limit`.
121
+ Improve reworks only what gets read: without fresh feedback, the lane
122
+ picks an asset (and a memory is judged for consolidation) only if `search`,
123
+ `curate` or `show` returned it, or feedback named it, in the last 90 days — the
124
+ usage log's retention — or if it is new material no improve stage has processed
125
+ yet. An explicit ref (`akm improve skills/code-review`) is always reworked.
126
+ Full flag reference: [CLI Reference — improve](../reference/cli.md#improve).
127
+
128
+ `--dry-run` is an execution-plan preview, not a raw scope listing. Its
129
+ `plannedRefs` are the final ranked refs after validation, retrieval, signal,
130
+ disk, and limit gates. The accompanying `plan` keeps the pre-gate `rawInScope` count,
131
+ per-gate removal counts and reasons, configured versus effective limits, and
132
+ the selection lane for each final ref. `plan.snapshot` explains whether the
133
+ existing index was readable; a missing or incompatible index produces an
134
+ explicit empty snapshot without creating or migrating it. The plan reports the
135
+ cap as `limits.effective` (`limits.additiveReplayAllowance` is always `0` and
136
+ `limits.totalCeiling` equals the cap, because the replay lane is retired). It
137
+ also reports proactive-maintenance due statistics, consolidation pool gates and
138
+ chunk estimate, extract/memory-inference stage decisions, and proposal-triage
139
+ mode and caps. The plan has
140
+ `mode: "estimate"` and `dispatch: false`; producing it does not acquire the
141
+ improve lock, invoke an LLM, create state, or write proposals, events, assets,
142
+ cache files, or result records.
143
+
144
+ The preview is a best-effort observation assembled during the invocation, not
145
+ an atomic cross-store snapshot or a reservation. A later live run re-inspects
146
+ mutable index, state, filesystem, and session-log inputs before dispatch, so
147
+ concurrent changes can legitimately produce a different plan.
148
+
149
+ **Example: auto-generate lessons from usage patterns**
150
+
151
+ ```sh
152
+ akm improve --dry-run # preview what would be processed
153
+ akm improve --limit 20 # process at most 20 refs
154
+ akm proposal list # review what was generated
155
+ ```
156
+
157
+ ## akm proposal (list, show, diff, accept, reject, reopen, revert)
158
+
159
+ `akm proposal list` lists pending proposals in the queue. Each proposal is an
160
+ AI-generated suggested change — an edit to an existing asset, a new lesson, a
161
+ memory consolidation, or a deprecation. Review the diff, then accept or reject.
162
+
163
+ ```sh
164
+ # List proposals
165
+ akm proposal list
166
+ akm proposal list --status pending
167
+ akm proposal list --ref skills/code-review
168
+
169
+ # Inspect a proposal
170
+ akm proposal show <id>
171
+ akm proposal diff <id> # Preview the change vs. the live asset
172
+
173
+ # Apply or discard
174
+ akm proposal accept <uuid-or-prefix>
175
+ akm proposal accept skills/akm-dream --bundle team-bundle
176
+ akm proposal reject <uuid-or-prefix> --reason "duplicates existing workflow"
177
+ ```
178
+
179
+ Accepts full UUIDs, 8-character UUID prefixes, or asset refs. `akm proposal accept` runs
180
+ full validation before promoting the proposal into your bundle.
181
+ `akm proposal revert` restores the prior content of an accepted proposal from
182
+ its captured backup, and `akm proposal reopen <id>` undoes a rejection (it puts
183
+ a rejected proposal back to pending unless its target has changed since). Full
184
+ flag reference:
185
+ [CLI Reference — proposal](../reference/cli.md#proposal).
186
+
187
+ **Example: review and accept a memory consolidation**
188
+
189
+ ```sh
190
+ akm proposal list --status pending
191
+ akm proposal diff abc12345 # preview the proposed consolidation
192
+ akm proposal accept abc12345 # write it to the bundle
193
+ ```
194
+
195
+ ## akm proposal new
196
+
197
+ `akm proposal new` asks an engine to author a brand-new asset — useful
198
+ when you want to create something from scratch rather than improving an
199
+ existing asset. Any engine kind works (an LLM engine, an agent CLI or
200
+ `opencode-sdk`): the engine returns the asset as JSON, which akm validates.
201
+ Output always goes to the proposal queue, never directly to the bundle.
202
+
203
+ ```sh
204
+ akm proposal new skill code-review --task "PR-style review skill for TypeScript repos"
205
+ akm proposal new lesson docker-cleanup --file ./prompts/docker-cleanup.md
206
+ ```
207
+
208
+ After the proposal is generated, review it with `akm proposal diff <id>` and apply with
209
+ `akm proposal accept`.
210
+
211
+ ## End-to-end example: from bad experience to a reviewed fix
212
+
213
+ ```sh
214
+ # 1. An agent hits a problem and records it
215
+ akm feedback skills/deploy --negative \
216
+ --reason "Skips the dry-run step; caused prod incident 2026-05-10"
217
+
218
+ # 2. The event lands in the log immediately
219
+ akm log --ref skills/deploy --type feedback
220
+
221
+ # 3. A later improve pass reads the signal and drafts a fix
222
+ akm improve skills/deploy
223
+
224
+ # 4. The fix is a proposal, not a live edit — review it
225
+ akm proposal list --ref skills/deploy
226
+ akm proposal diff <id>
227
+
228
+ # 5. Accept, reject, or revert after acceptance if it doesn't hold up
229
+ akm proposal accept <id>
230
+ akm proposal reject <id> --reason "not the right fix"
231
+ akm proposal revert <id>
232
+ ```
233
+
234
+ Nothing in this loop bypasses review by default: `akm improve` only ever
235
+ queues proposals, and promotion into the bundle happens through an explicit
236
+ `akm proposal accept` (or an explicit opt-in policy) — see
237
+ [Architecture: The Improvement Loop](../architecture/improvement.md) for the
238
+ autonomy gate that governs the few lanes that can act without one.
239
+
240
+ ## See also
241
+
242
+ - [Discover & Load](discover-and-load.md) — finding and loading assets
243
+ - [Knowledge Management](knowledge-management.md) — capturing memories and docs
244
+ - [Agent Integration](use-with-any-agent.md) — wiring feedback into agent workflows
245
+ - [CLI Reference](../reference/cli.md) — full flag documentation for `feedback`, `log`, `improve`, `proposal`
246
+ - [Architecture: The Improvement Loop](../architecture/improvement.md) — utility scoring, strategies, autonomy gates, auto-sync, and session extraction
247
+ - [Concepts](../guides/concepts.md) — bundles, refs and the index
@@ -0,0 +1,18 @@
1
+ # Knowledge Management
2
+
3
+ Capturing and protecting knowledge are two different jobs: `akm remember`,
4
+ `akm import`, `akm bundle add`, and LLM wikis turn what an agent or teammate
5
+ learns into searchable assets any agent can find, while `akm env` and
6
+ `akm secret` hold configuration and credentials under a stricter guarantee —
7
+ values never appear in akm's structured output. This page has moved; the
8
+ content now lives in two focused pages.
9
+
10
+ ## Where things moved
11
+
12
+ - [Capture Knowledge](capture-knowledge.md) — `akm remember`, `akm import`,
13
+ when to reach for each versus `akm bundle add` or a wiki, and how captured
14
+ material becomes available to every agent
15
+ - [Wikis](wikis.md) — the LLM-wiki bundle format for maintained, structured
16
+ knowledge
17
+ - [Environment & Secrets](../reference/env-and-secrets.md) — exact env/secret
18
+ operations, file modes, subprocess residency, and the security guarantee