akm-cli 0.9.31 → 0.10.26101002-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 (236) hide show
  1. package/CHANGELOG.md +265 -0
  2. package/STABILITY.md +79 -53
  3. package/dist/api-node.mjs +20 -0
  4. package/dist/api.d.ts +23 -0
  5. package/dist/api.js +45 -0
  6. package/dist/assets/hints/cli-hints-full.md +13 -27
  7. package/dist/assets/hints/cli-hints-short.md +1 -1
  8. package/dist/assets/improve-strategies/default.json +3 -3
  9. package/dist/assets/prompts/consolidate-pair.md +9 -7
  10. package/dist/cli/shared.js +31 -48
  11. package/dist/cli/unknown-flags.js +6 -43
  12. package/dist/cli.js +8 -34
  13. package/dist/commands/agent/contribute-cli.js +1 -1
  14. package/dist/commands/completions.js +1 -2
  15. package/dist/commands/config-cli.js +5 -28
  16. package/dist/commands/env/env-cli.js +5 -5
  17. package/dist/commands/env/secret-cli.js +2 -2
  18. package/dist/commands/health/checks.js +41 -16
  19. package/dist/commands/health/plugin-staleness.js +52 -22
  20. package/dist/commands/improve/autonomy-gate.js +5 -3
  21. package/dist/commands/improve/consolidate/pair-pass.js +7 -1
  22. package/dist/commands/improve/consolidate.js +6 -35
  23. package/dist/commands/improve/distill/lesson-update.js +91 -0
  24. package/dist/commands/improve/distill-guards.js +1 -43
  25. package/dist/commands/improve/distill.js +140 -20
  26. package/dist/commands/improve/eligibility.js +14 -1
  27. package/dist/commands/improve/extract-cli.js +1 -1
  28. package/dist/commands/improve/improve-cli.js +87 -102
  29. package/dist/commands/improve/improve-strategies.js +8 -12
  30. package/dist/commands/improve/improve.js +2 -2
  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 +11 -31
  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/improve-result.js +11 -1
  83. package/dist/core/mutation-target.js +2 -2
  84. package/dist/core/recognition-util.js +4 -5
  85. package/dist/core/warn.js +21 -4
  86. package/dist/core/write-source.js +3 -3
  87. package/dist/execution/target-ref.js +1 -2
  88. package/dist/indexer/search/db-search.js +4 -19
  89. package/dist/indexer/search/fts-query.js +0 -19
  90. package/dist/integrations/agent/engine-resolution.js +5 -2
  91. package/dist/integrations/agent/index.js +1 -1
  92. package/dist/integrations/agent/profiles.js +41 -98
  93. package/dist/integrations/agent/request-lowering.js +3 -3
  94. package/dist/integrations/harnesses/aider/index.js +5 -0
  95. package/dist/integrations/harnesses/amazonq/index.js +1 -0
  96. package/dist/integrations/harnesses/claude/config-import.js +2 -3
  97. package/dist/integrations/harnesses/claude/index.js +5 -0
  98. package/dist/integrations/harnesses/codex/index.js +1 -0
  99. package/dist/integrations/harnesses/copilot/index.js +1 -0
  100. package/dist/integrations/harnesses/gemini/index.js +1 -0
  101. package/dist/integrations/harnesses/index.js +18 -39
  102. package/dist/integrations/harnesses/opencode/agent-builder.js +60 -35
  103. package/dist/integrations/harnesses/opencode/config-import.js +121 -52
  104. package/dist/integrations/harnesses/opencode/index.js +22 -0
  105. package/dist/integrations/harnesses/opencode/plugin-layout.js +68 -0
  106. package/dist/integrations/harnesses/opencode/session-log-types.js +12 -0
  107. package/dist/integrations/harnesses/opencode/session-log-v1.js +72 -0
  108. package/dist/integrations/harnesses/opencode/session-log-v2.js +140 -0
  109. package/dist/integrations/harnesses/opencode/session-log.js +104 -115
  110. package/dist/integrations/harnesses/opencode/version.js +98 -0
  111. package/dist/integrations/harnesses/opencode-sdk/{harness.js → index.js} +5 -17
  112. package/dist/integrations/harnesses/opencode-sdk/sdk-runner.js +105 -206
  113. package/dist/integrations/harnesses/opencode-sdk/v1-adapter.js +199 -0
  114. package/dist/integrations/harnesses/opencode-sdk/v2-adapter.js +228 -0
  115. package/dist/integrations/harnesses/opencode-sdk/wire.js +66 -0
  116. package/dist/integrations/harnesses/openhands/index.js +1 -0
  117. package/dist/integrations/harnesses/pi/index.js +1 -0
  118. package/dist/integrations/harnesses/shared.js +2 -0
  119. package/dist/integrations/harnesses/types.js +2 -0
  120. package/dist/llm/client.js +41 -11
  121. package/dist/output/cli-hints.js +1 -1
  122. package/dist/output/context.js +10 -19
  123. package/dist/output/format-exempt.js +5 -8
  124. package/dist/output/shapes/helpers.js +1 -22
  125. package/dist/output/shapes/passthrough.js +0 -1
  126. package/dist/output/shapes.js +3 -31
  127. package/dist/output/stdout.js +5 -1
  128. package/dist/output/text/command-format.js +6 -1
  129. package/dist/output/text/workflow-format.js +4 -22
  130. package/dist/scripts/akm-migrate-node.js +13049 -14013
  131. package/dist/scripts/akm-migrate.js +16316 -17276
  132. package/dist/setup/detect.js +10 -4
  133. package/dist/setup/harness-config-import.js +5 -14
  134. package/dist/setup/setup.js +1 -1
  135. package/dist/setup/steps/tasks.js +12 -13
  136. package/dist/storage/repositories/task-history-repository.js +0 -5
  137. package/dist/storage/repositories/workflow-runs-repository.js +5 -15
  138. package/dist/tasks/embedded.js +2 -1
  139. package/dist/tasks/run/task-history.js +0 -2
  140. package/dist/tasks/schedule-gates.js +39 -0
  141. package/dist/tasks/scheduler-binding.js +0 -16
  142. package/dist/tasks/scheduler-sync.js +3 -97
  143. package/dist/tasks/source/bounded-document.js +1 -1
  144. package/dist/tasks/source/task-source-v4.js +2 -12
  145. package/dist/tasks/task-run-reserved-flags.js +2 -31
  146. package/dist/workflows/authoring/authoring.js +6 -6
  147. package/dist/workflows/compile.js +8 -65
  148. package/dist/workflows/exec/child-workflow.js +22 -3
  149. package/dist/workflows/exec/native-executor.js +12 -147
  150. package/dist/workflows/exec/run-workflow.js +31 -103
  151. package/dist/workflows/exec/step-work.js +9 -178
  152. package/dist/workflows/exec/unit-dispatch.js +0 -10
  153. package/dist/workflows/freeze/environment.js +3 -44
  154. package/dist/workflows/freeze/freeze.js +8 -41
  155. package/dist/workflows/freeze/targets/child-workflow.js +27 -63
  156. package/dist/workflows/freeze/targets/command.js +2 -16
  157. package/dist/workflows/freeze/targets/shell.js +0 -2
  158. package/dist/workflows/freeze/task-bindings.js +2 -28
  159. package/dist/workflows/ir/params.js +12 -2
  160. package/dist/workflows/parser.js +82 -232
  161. package/dist/workflows/plan.js +1 -1
  162. package/dist/workflows/renderer.js +10 -19
  163. package/dist/workflows/runtime/run-plan.js +11 -53
  164. package/dist/workflows/runtime/runs.js +4 -27
  165. package/dist/workflows/source-files.js +12 -16
  166. package/dist/workflows/source-semantics.js +1 -93
  167. package/docs/README.md +1 -1
  168. package/docs/agents/README.md +3 -3
  169. package/docs/agents/agent-install.md +1 -1
  170. package/docs/architecture/adapters.md +17 -31
  171. package/docs/architecture/architecture.md +4 -5
  172. package/docs/architecture/improvement.md +52 -21
  173. package/docs/architecture/internals/improve-workflow.md +15 -8
  174. package/docs/architecture/internals/indexing.md +1 -1
  175. package/docs/architecture/internals/search.md +1 -2
  176. package/docs/architecture/internals/storage-locations.md +5 -5
  177. package/docs/architecture/persisted-data-compat.md +13 -4
  178. package/docs/architecture/specs/0.9.0-decisions.md +6 -2
  179. package/docs/architecture/specs/improve-collapse-churn-detector-design.md +2 -2
  180. package/docs/architecture/specs/workflow-format-unification.md +1 -6
  181. package/docs/architecture/testing/manual-testing-checklist.md +20 -29
  182. package/docs/architecture/testing/task-workflow-manual-tests.md +106 -203
  183. package/docs/architecture/testing/testing-workflow.md +1 -1
  184. package/docs/architecture/workflow-engine.md +5 -56
  185. package/docs/guides/author-workflows.md +39 -69
  186. package/docs/guides/capture-knowledge.md +1 -1
  187. package/docs/guides/claude-code-vs-akm-workflows.md +1 -2
  188. package/docs/guides/discover-and-load.md +4 -4
  189. package/docs/guides/getting-started.md +1 -1
  190. package/docs/guides/improve-the-library.md +7 -7
  191. package/docs/guides/recipes/headless-install.md +2 -2
  192. package/docs/guides/run-workflows.md +1 -1
  193. package/docs/guides/use-with-any-agent.md +49 -4
  194. package/docs/integration/bundling-akm.md +7 -6
  195. package/docs/maintainers/curate-workmap.md +1 -2
  196. package/docs/maintainers/release-checklist.md +30 -1
  197. package/docs/posts/akm-command-tour.md +3 -3
  198. package/docs/product-surface.md +1 -1
  199. package/docs/reference/README.md +1 -0
  200. package/docs/reference/api.md +65 -0
  201. package/docs/reference/asset-types.md +3 -5
  202. package/docs/reference/bundle-types.md +2 -4
  203. package/docs/reference/cli.md +129 -171
  204. package/docs/reference/configuration.md +84 -19
  205. package/docs/reference/data-and-telemetry.md +1 -1
  206. package/docs/reference/env-and-secrets.md +2 -2
  207. package/docs/reference/supported-formats.md +3 -4
  208. package/docs/reference/tasks.md +12 -19
  209. package/docs/reference/website-sources.md +1 -1
  210. package/docs/reference/workflow-schema.md +89 -317
  211. package/docs/reference/workflows.md +20 -48
  212. package/package.json +12 -2
  213. package/schemas/akm-config.json +2 -243
  214. package/schemas/akm-task.json +2 -3
  215. package/schemas/akm-workflow.json +47 -84
  216. package/dist/assets/improve-strategies/catchup.json +0 -41
  217. package/dist/assets/improve-strategies/proactive-maintenance.json +0 -24
  218. package/dist/assets/improve-strategies/quick.json +0 -17
  219. package/dist/assets/improve-strategies/reflect-distill.json +0 -29
  220. package/dist/assets/improve-strategies/thorough.json +0 -49
  221. package/dist/assets/tasks/improve/akm-improve-catchup.yml +0 -6
  222. package/dist/assets/tasks/improve/akm-improve-frequent.yml +0 -4
  223. package/dist/assets/tasks/improve/akm-improve-nightly.yml +0 -4
  224. package/dist/cli/retired-commands.js +0 -118
  225. package/dist/commands/tasks/validate.js +0 -176
  226. package/dist/core/config/legacy-source-shape-shim.js +0 -117
  227. package/dist/integrations/harnesses/ids.js +0 -28
  228. package/dist/tasks/source/task-source-v3-frozen.js +0 -424
  229. package/dist/tasks/source/task-to-v4.js +0 -863
  230. package/dist/workflows/exec/worktree.js +0 -372
  231. package/dist/workflows/freeze/child-output-references.js +0 -83
  232. package/dist/workflows/freeze/identity.js +0 -22
  233. package/dist/workflows/freeze/targets/script.js +0 -50
  234. package/dist/workflows/freeze/targets/task.js +0 -124
  235. package/dist/workflows/github-yaml.js +0 -506
  236. package/dist/workflows/runtime/run-outputs.js +0 -80
@@ -10,17 +10,11 @@ it's written, see [Running Workflows](../guides/run-workflows.md).
10
10
 
11
11
  ## Start from the template
12
12
 
13
- Authors can choose peer Markdown or GitHub-shaped YAML sources. Markdown is
14
- the full AKM authoring format: OKF-conformant frontmatter carries the
15
- orchestration graph and its body carries instructions and gate rubrics.
16
- GitHub-shaped YAML is a strict local subset for interoperability. Read the
17
- [authoritative YAML subset](../reference/workflow-schema.md#github-shaped-yaml-subset)
18
- before translating an Actions-shaped file; AKM does not accept arbitrary
19
- GitHub semantics. `.yaml` is not recognized—use `.yml`.
20
-
21
- Use `akm workflow create --print` to print a valid Markdown starter, then edit
22
- it and register it with `akm workflow create`. Author a YAML source directly
23
- under `workflows/<name>.yml` and validate either source with `akm lint`:
13
+ A workflow is a Markdown file: OKF-conformant frontmatter carries the
14
+ orchestration graph and the body carries instructions and gate rubrics.
15
+
16
+ Use `akm workflow create --print` to print a valid starter, then edit it and
17
+ register it with `akm workflow create`. Validate with `akm lint`:
24
18
 
25
19
  ```sh
26
20
  akm workflow create my-release --print # Print the template, without writing
@@ -417,70 +411,46 @@ blast radius before running it.
417
411
  [Workflow Schema: Gates and verification](../reference/workflow-schema.md#gates-and-verification)),
418
412
  so this is worth confirming once per workflow rather than assuming.
419
413
 
420
- ## Composing a task with typed inputs
414
+ ## Running a child workflow (Experimental)
421
415
 
422
- A `uses: tasks/<ref>` step in the GitHub-shaped YAML format can bind a task
423
- source v4 target's declared `inputs:` through `with:`. Given this task:
416
+ A step can run another workflow and use its result. The step names the child
417
+ in its `unit:` bag and binds the child's `params:` with `with:`:
424
418
 
425
- ```yaml
426
- # tasks/ticket-review.yml
427
- version: 4
428
- name: Ticket review
429
- inputs:
430
- ticket:
431
- type: string
432
- required: true
433
- scope:
434
- type: string
435
- enum: [changed, all]
436
- default: changed
437
- uses: commands/review
438
- ```
419
+ ```markdown
420
+ ---
421
+ type: workflow
422
+ params:
423
+ topic: { type: string }
424
+ steps:
425
+ - id: investigate
426
+ unit:
427
+ workflow: workflows/research
428
+ with:
429
+ topic: { from: params.topic }
430
+ - id: report
431
+ inputs: [steps.investigate.output]
432
+ ---
439
433
 
440
- a workflow step can bind `ticket` from an EARLIER step's output, and override
441
- `scope` with a literal:
434
+ ## investigate
442
435
 
443
- ```yaml
444
- # workflows/nightly.yml
445
- name: Nightly review
446
- on:
447
- workflow_dispatch: {}
448
- jobs:
449
- main:
450
- runs-on: [self-hosted]
451
- steps:
452
- - id: pick
453
- run: echo T-42
454
- - id: dispatch
455
- uses: tasks/ticket-review
456
- with:
457
- ticket: { from: "steps.pick.output" }
458
- scope: all
436
+ Runs the research workflow as a child run.
437
+
438
+ ## report
439
+
440
+ Summarise the research finding.
459
441
  ```
460
442
 
461
- `{from: "steps.<id>.output(.<segment>)*"}` and `{from: "params.<name>"}` are
462
- the only two reference roots; anything else, or an object carrying `from`
463
- plus any other key, is `INPUT_BINDING_INVALID` at freeze — never silently
464
- reinterpreted as a literal. `pick`'s output is resolved just before the
465
- `dispatch` unit dispatches, then validated against `ticket`'s declared
466
- schema; a literal (like `scope: all` here) is validated at freeze instead,
467
- before the plan is ever published.
468
-
469
- The composed target — `commands/review` here — receives the resolved
470
- bindings on whichever delivery surface matches its kind: an
471
- `akm/command`/`commands/<ref>` target gets a `## Task inputs` block appended
472
- to its prompt; a `run:` shell or `scripts/<ref>` target gets one
473
- `AKM_TASK_INPUTS` environment variable (canonical JSON of the resolved
474
- bindings). Inspect exactly what each step's `with:` would deliver, without
475
- running anything, with `akm workflow plan workflows/nightly --format json`
476
- — its per-step `inputBindings` show `dispatch`'s `scope` as the literal
477
- `all` and `ticket` as the unresolved reference `steps.pick.output`, the
478
- same shape freezing a real run would produce. `akm task explain` is not a
479
- substitute here: it only reflects a task's OWN CLI flags, declared
480
- defaults, and `schedule[].inputs` — it never reads a workflow step's
481
- `with:` binding at all, so pointing it at `tasks/ticket-review` prints
482
- `scope`'s task-level default (`changed`), not the `all` this step actually
483
- sends.
443
+ A `with:` value is a literal (checked against the child's param type when the
444
+ workflow is frozen) or `{ from: <reference> }`, where the reference is
445
+ `params.<name>` or `steps.<id>.output(.<segment>)*`, resolved just before the
446
+ step runs. The child's **last step output** is the composing step's output, so
447
+ `report` reads it through `inputs:`. Inspect what a step would pass, without
448
+ running anything, with `akm workflow plan workflows/<name> --format json`; the
449
+ per-step `inputBindings` show each literal and each unresolved reference.
450
+
451
+ Child workflows are Experimental. See
452
+ [Workflow Schema: Child workflows](../reference/workflow-schema.md#child-workflows)
453
+ for blocked-child recovery and the limits.
484
454
 
485
455
  ## Troubleshooting
486
456
 
@@ -71,7 +71,7 @@ akm import - --name scratch-notes < notes.md
71
71
  akm import https://example.com/docs/auth
72
72
 
73
73
  # Route to a named writable bundle:
74
- akm import ./docs/auth-flow.md --target team-bundle
74
+ akm import ./docs/auth-flow.md --bundle team-bundle
75
75
  ```
76
76
 
77
77
  Both commands accept `--xref <ref>` to cross-reference related assets and
@@ -5,8 +5,7 @@ out inside the current session — an in-context script or tool that spawns
5
5
  subagents, runs them concurrently, and reports back before the session ends.
6
6
  AKM workflows are a different thing: a portable procedure that any supported
7
7
  agent harness can run, with durable state, retries, gates, and resume built
8
- in. Peer workflow sources are Markdown `.md` and GitHub-shaped YAML `.yml`;
9
- both adapters lower to source IR version 1. Every run freezes the durable plan
8
+ in. A workflow source is Markdown `.md`, lowered to source IR version 1. Every run freezes the durable plan
10
9
  v4 family's executable `irVersion: 5` before execution; pre-`irVersion`-5
11
10
  stored plans are rejected.
12
11
  Neither replaces the other — they solve different problems, and the right
@@ -14,7 +14,7 @@ whether a script, a workflow, or a skill covers this, so it starts broad,
14
14
  narrows to a ref, and loads that ref's content:
15
15
 
16
16
  ```sh
17
- akm curate "deploy the app to staging" --shape agent
17
+ akm curate "deploy the app to staging" --detail agent
18
18
  # → ranked shortlist; top hit: {"type":"script","ref":"scripts/deploy.sh","score":0.91,...}
19
19
 
20
20
  akm show scripts/deploy.sh
@@ -40,7 +40,7 @@ curate when you know what you're trying to do.
40
40
  (BM25) and semantic (vector) matches fused into one list:
41
41
 
42
42
  ```sh
43
- akm search "deploy" --type script --shape agent
43
+ akm search "deploy" --type script --detail agent
44
44
  # → [{"type":"script","name":"deploy.sh","ref":"scripts/deploy.sh","score":0.0328,...}]
45
45
  ```
46
46
 
@@ -53,7 +53,7 @@ akm curate "review an architecture proposal" --type skill
53
53
  # → ranked shortlist with akm show skills/code-review as the top follow-up
54
54
  ```
55
55
 
56
- Use `--shape agent` on either command to get the `ref`/`path`/`editable`
56
+ Use `--detail agent` on either command to get the `ref`/`path`/`editable`
57
57
  fields an agent needs to act on a hit. See [CLI Reference](../reference/cli.md)
58
58
  for the full flag tables and exact output-field lists per `--detail` level.
59
59
 
@@ -145,7 +145,7 @@ its ranking) and does not trigger a rewrite.
145
145
 
146
146
  ## 7. Reference links
147
147
 
148
- - [CLI Reference](../reference/cli.md) — full `--detail`/`--shape` flag
148
+ - [CLI Reference](../reference/cli.md) — full `--detail` flag
149
149
  semantics, complete flag tables, and exact output-field lists for `search`,
150
150
  `curate`, `show`, and `index`
151
151
  - [Architecture](../architecture/architecture.md) — ranking and search
@@ -162,7 +162,7 @@ your agent the payload; running it is a deliberate next step.
162
162
  ## 7. Tell your agent about akm
163
163
 
164
164
  ```sh
165
- akm help agents >> AGENTS.md
165
+ akm hints --detail brief >> AGENTS.md
166
166
  ```
167
167
 
168
168
  **Success check:** `AGENTS.md` now has a block of agent-facing usage
@@ -112,12 +112,12 @@ It also skips a memory whose only feedback in that window is a positive with no
112
112
  reason or note: say what helped (`--reason`), or the lesson has nothing to
113
113
  distil.
114
114
  Unless `--require-feedback-signal` is set,
115
- two fallback lanes pick assets with no such feedback: high-salience assets that
116
- were never reflected, and, in a strategy that enables proactive maintenance,
117
- assets due for a revisit. They only select and score assets and plan nothing,
118
- so improve does not rewrite on a proactive cadence. The planned assets are
119
- ranked by salience and cut to `--limit`.
120
- Improve reworks only what gets read: without fresh feedback, a fallback lane
115
+ the proactive-maintenance lane (on in `default`) also plans assets with no such
116
+ feedback that are due for a revisit: at most 15 per run
117
+ (`processes.proactiveMaintenance.maxPerRun`), and only assets not reflected or
118
+ distilled for 30 days (`dueDays`), so each comes up at most once a month. The
119
+ planned assets are ranked by salience and cut to `--limit`.
120
+ Improve reworks only what gets read: without fresh feedback, the lane
121
121
  picks an asset (and a memory is judged for consolidation) only if `search`,
122
122
  `curate` or `show` returned it, or feedback named it, in the last 90 days — the
123
123
  usage log's retention — or if it is new material no improve stage has processed
@@ -171,7 +171,7 @@ akm proposal diff <id> # Preview the change vs. the liv
171
171
 
172
172
  # Apply or discard
173
173
  akm proposal accept <uuid-or-prefix>
174
- akm proposal accept skills/akm-dream --target team-bundle
174
+ akm proposal accept skills/akm-dream --bundle team-bundle
175
175
  akm proposal reject <uuid-or-prefix> --reason "duplicates existing workflow"
176
176
  ```
177
177
 
@@ -31,7 +31,7 @@ akm info
31
31
  akm search "test"
32
32
 
33
33
  # 7. Install agent guidance
34
- akm help agents >> AGENTS.md
34
+ akm hints --detail brief >> AGENTS.md
35
35
 
36
36
  echo "akm setup complete"
37
37
  ```
@@ -85,7 +85,7 @@ indexing.
85
85
  `indexStats.entryCount` and `semanticSearch.status`; `akm search "<query>"`
86
86
  confirms retrieval actually returns results.
87
87
 
88
- **Install agent guidance.** `akm help agents >> AGENTS.md` appends the
88
+ **Install agent guidance.** `akm hints --detail brief >> AGENTS.md` appends the
89
89
  canonical usage block agents need to discover and use the library. Run this
90
90
  after indexing so the guidance matches the installed version.
91
91
 
@@ -21,7 +21,7 @@ projects.
21
21
 
22
22
  Every new run/start compiles source IR v1 and freezes the durable plan v4
23
23
  family's current executable format (`irVersion: 5`) before publishing the run.
24
- Markdown `.md` and GitHub-shaped `.yml` refs use the same freeze path.
24
+ A workflow ref is a Markdown `.md` source.
25
25
 
26
26
  ```sh
27
27
  akm workflow run workflows/ship-release --version 1.2.3
@@ -26,7 +26,7 @@ For a longer, agent-facing instruction block — usage patterns, flag guidance,
26
26
  the full ref format — generate one instead of hand-writing it:
27
27
 
28
28
  ```sh
29
- akm help agents >> AGENTS.md
29
+ akm hints --detail brief >> AGENTS.md
30
30
  ```
31
31
 
32
32
  The output is stable across patch releases and designed for agents rather
@@ -50,7 +50,7 @@ akm show workflows/deploy-to-prod
50
50
  akm feedback workflows/deploy-to-prod --positive --reason "Completed without issues"
51
51
  ```
52
52
 
53
- **Get refs from search.** Agents should call `akm search --shape agent` or
53
+ **Get refs from search.** Agents should call `akm search --detail agent` or
54
54
  `akm curate` to discover refs — not guess them. The `ref` field in search
55
55
  results is the stable token to pass to `akm show`. Feedback closes the loop.
56
56
  Record `--negative` only when the asset's content is wrong or stale; a note that
@@ -70,7 +70,7 @@ sets expectations by environment.
70
70
 
71
71
  | Environment | Core support | Optional/extended support |
72
72
  | --- | --- | --- |
73
- | Shell-capable coding agent | `curate` / `show` / `feedback` via the CLI | Generated prompt block (`akm help agents`) or a platform plugin |
73
+ | Shell-capable coding agent | `curate` / `show` / `feedback` via the CLI | Generated prompt block (`akm hints`) or a platform plugin |
74
74
  | Claude/OpenCode project layout | Indexed in place through a `BundleAdapter` — no migration needed | `akm clone` selected assets into a writable bundle for editing |
75
75
  | IDE assistant without shell access | Not a direct core integration | Requires a plugin, an `akm task`, or an external bridge that can shell out on the assistant's behalf |
76
76
 
@@ -118,12 +118,57 @@ than replacing either.
118
118
  browsing, automatic context injection — but the core `akm` CLI works
119
119
  without them.
120
120
 
121
+ ## OpenCode plugins: one package per OpenCode major
122
+
123
+ OpenCode 1 and OpenCode 2 load different plugin APIs, so akm ships one plugin
124
+ package for each. Install only the one that matches the `opencode` you run; akm
125
+ never installs or replaces the `opencode` binary, and `akm upgrade` never adds
126
+ one plugin to the other major's config.
127
+
128
+ | OpenCode | Plugin package | Config key | Plugin cache |
129
+ | --- | --- | --- | --- |
130
+ | 1 | `akm-opencode` | `"plugin"` | `~/.cache/opencode/packages/akm-opencode@<tag>/` |
131
+ | 2 | `akm-opencode-v2` | `"plugins"` (the key `opencode plugin add` writes) | `~/.cache/opencode/npm/akm-opencode-v2@<tag>/<build>/` |
132
+
133
+ (`$XDG_CACHE_HOME` and `$XDG_CONFIG_HOME` move both.) Both packages declare the
134
+ same `akm-cli` dependency.
135
+
136
+ **OpenCode 1.** Add `akm-opencode` to the global config
137
+ (`~/.config/opencode/opencode.json`):
138
+
139
+ ```json
140
+ { "plugin": ["akm-opencode"] }
141
+ ```
142
+
143
+ **OpenCode 2.**
144
+
145
+ ```sh
146
+ opencode plugin add akm-opencode-v2
147
+ ```
148
+
149
+ This installs the package and adds it to `plugins` in the global config.
150
+
151
+ **Updating.** `akm upgrade` refreshes the cached plugin of each major it finds,
152
+ holds the CLI to the `akm-cli` those plugins pin, and leaves a plugin alone
153
+ whose config pins another spec such as `akm-opencode@0.8.0`. Use
154
+ `akm upgrade --next` with `akm-opencode@next` / `akm-opencode-v2@next` in the
155
+ config to follow prereleases. The exact rules are in the
156
+ [`akm upgrade` reference](../reference/cli.md#harness-plugins). `akm health`
157
+ warns when either plugin's bundled `akm-cli` differs from the running CLI.
158
+
159
+ **Which OpenCode akm drives** is detected, not configured: an `opencode` or
160
+ `opencode-sdk` agent engine runs the most recent OpenCode on `PATH` (or its own
161
+ `bin`) and uses the adapters for the major that binary reports; OpenCode 1 logs a
162
+ warning recommending OpenCode 2 (see
163
+ [Configuration](../reference/configuration.md#engines)). It does not change
164
+ which plugin you install, and the plugin choice does not change it.
165
+
121
166
  ## See also
122
167
 
123
168
  - [Configuration](../reference/configuration.md#engines) — named agent engines and model aliases
124
169
  - [Discover and Load](discover-and-load.md) — the full curate → show retrieval path
125
170
  - [Knowledge Management](knowledge-management.md) — capturing agent-generated memories
126
171
  - [Improve the Library](improve-the-library.md) — feeding back usage signals
127
- - [CLI Reference](../reference/cli.md) — `completions`, `agent`, and `help agents` command documentation
172
+ - [CLI Reference](../reference/cli.md) — `completions`, `agent`, and `hints` command documentation
128
173
  - [Concepts](concepts.md) — refs, origins, and the asset type system
129
174
  - [Bundle Types](../reference/bundle-types.md) — how AKM indexes existing project layouts in place
@@ -30,10 +30,11 @@ akm migrate apply
30
30
  In order, every run applies (or, under `status`/`--dry-run`, plans):
31
31
 
32
32
  1. **config.json in its current shape** (`configFile`): retired and unknown
33
- keys dropped, legacy `extraParams` lifted onto first-class fields, the
34
- legacy `stashDir`/`sources[]`/`installed` layout converted to
35
- `bundles`/`defaultBundle`. Config loading already does all of this in
36
- memory; this persists it under a backup.
33
+ keys dropped, `configVersion` set. Config loading already does this in
34
+ memory; this persists it under a backup. A config older than 0.9.15 (the
35
+ legacy `stashDir`/`sources[]`/`installed` layout, an `extraParams` key
36
+ that shadows a first-class field) is not converted by 0.10: it blocks
37
+ with a message to run `akm migrate apply` under akm 0.9.x first.
37
38
  2. **Pending `state.db` migrations**, historical-destructive ones included
38
39
  (`stateMigrations`). This is the only path (besides `akm upgrade`, which
39
40
  calls the same code) that is allowed to apply a destructive migration to an
@@ -98,7 +99,7 @@ same step names):
98
99
  `status` is one of:
99
100
 
100
101
  - **`current`** — no task-source file needs converting, and no config
101
- extraParams lift is pending. A no-op boot.
102
+ rewrite is pending. A no-op boot.
102
103
  - **`ready`** — task sources have eligible changes and no config-lift
103
104
  conflict; a real `apply` will clear them.
104
105
  - **`blocked`** — at least one item cannot be applied automatically (a
@@ -244,7 +245,7 @@ akm-migrate apply
244
245
 
245
246
  `akm migrate status`/`apply` (under the `akm` CLI) are a thin wrapper over
246
247
  this same executable — same plan, same exit codes. Reach for `akm-migrate`
247
- directly when you don't want `akm`'s `--format`/`--shape`/`--detail` output
248
+ directly when you don't want `akm`'s `--format`/`--detail` output
248
249
  handling in the way, e.g. a shell script that just wants the raw JSON line
249
250
  on stdout and a plain exit code.
250
251
 
@@ -197,8 +197,7 @@ Important details:
197
197
 
198
198
  - `curate` has a dedicated output shaper now
199
199
  - `brief` still keeps `followUp` and `reason`
200
- - `--shape agent` trims fields down for agent use
201
- - `--shape summary` is rejected on `curate`
200
+ - `--detail agent` trims fields down for agent use
202
201
  - text output prints fixed `Next steps:` guidance that assumes `akm show <ref>` is the next action
203
202
 
204
203
  ## Telemetry And Retrieval Signal
@@ -6,7 +6,13 @@ run of the exact commit that will be published.
6
6
 
7
7
  ## 1. Freeze the candidate
8
8
 
9
- 1. Finish the version, changelog, migration-note, and release-PR changes.
9
+ 1. Finish the version, changelog, migration-note, and release-PR changes. From
10
+ 0.10 the version is a daily build, `0.10.YYMMDDNN` (see step 4):
11
+ `bun scripts/release-version.ts next` prints the next free one for today
12
+ (UTC). Commit it in `package.json` and cut the CHANGELOG as
13
+ `## [0.10.YYMMDDNN] - YYYY-MM-DD`. A prerelease stage is not committed: it is
14
+ chosen when the Release workflow runs, and a stage of a build is covered by
15
+ that build's CHANGELOG section.
10
16
  2. Record `git rev-parse HEAD`. This is the full 40-character release-candidate SHA.
11
17
  3. Run `bun run release:check` locally. If Docker is unavailable, run
12
18
  `./tests/release-check.sh --skip-docker` and rely on the gated Docker job
@@ -101,3 +107,26 @@ After the exact-SHA gated run and local release check are green, trigger the
101
107
  Release workflow with the version already committed in `package.json`. Keep the
102
108
  candidate SHA and Gated CI run URL in the release record so the published
103
109
  artifact's validation can be audited later.
110
+
111
+ 0.10 and later use daily builds, `0.10.YYMMDDNN`: `YY` the UTC year, `MM` the
112
+ month, `DD` the day and `NN` the build that day (`01` to `99`), two digits each
113
+ (see [`STABILITY.md`](../../STABILITY.md)). The first build on 2026-10-10 is
114
+ `0.10.26101001`. `bun scripts/release-version.ts next` takes `NN` as one above
115
+ the highest build already on npm for today's UTC date (`npm view akm-cli
116
+ versions`), so numbering follows what was published, not what was committed.
117
+
118
+ The workflow has two inputs:
119
+
120
+ - `version`: the version committed in `package.json`, as before. The workflow
121
+ rejects a malformed one (`scripts/release-version.ts`, tested in
122
+ `tests/release-version.test.ts`): two digits each for `YY`, `MM`, `DD`, `NN`, a
123
+ real calendar date, `NN` 01 to 99. For 0.9 and older it is the `X.Y.Z` as
124
+ before.
125
+ - `stage`: `none` publishes the build itself to the npm `latest` tag and as a
126
+ GitHub release. `alpha`, `beta` or `rc` publishes `<version>-<stage>` to
127
+ `next` as a GitHub prerelease (no `.N`: the build number already differs per
128
+ build). Promote one build by running the workflow again with the same
129
+ `version` and the next stage, then with `none`. The order is
130
+ `-alpha` < `-beta` < `-rc` < the build.
131
+
132
+ `bun scripts/release-version.ts validate <version>` checks a version by hand.
@@ -99,7 +99,7 @@ Use this to inspect or change settings.
99
99
  ```sh
100
100
  akm config get output.format
101
101
  akm config set output.detail full
102
- akm config path --all
102
+ akm info
103
103
  ```
104
104
 
105
105
  Real-world use: your agent prefers text output in one repo and JSON in another, or you want to set a default write target for memories and imports.
@@ -404,12 +404,12 @@ akm help migrate latest
404
404
 
405
405
  Real-world use: you upgraded `akm` and want the release-specific migration notes without leaving the terminal.
406
406
 
407
- ### `akm help agents`
407
+ ### `akm hints`
408
408
 
409
409
  Print instructions you can drop into `AGENTS.md` or `CLAUDE.md`.
410
410
 
411
411
  ```sh
412
- akm help agents
412
+ akm hints
413
413
  ```
414
414
 
415
415
  Real-world use: you want every project to tell its coding agent how to use the local `akm` installation.
@@ -28,7 +28,7 @@ Every akm feature, with its status. Status meanings are in
28
28
  - [`akm improve` and proposals](guides/improve-the-library.md): reviewable changes from feedback and usage. *Evolving*
29
29
  - Improve settings and strategies other than `default` and `consolidate`. *Experimental*
30
30
  - Automatic acceptance (opt-in). *Experimental*
31
- - Session extraction. *Experimental*
31
+ - Session extraction. *Evolving*
32
32
 
33
33
  ## Monitor
34
34
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  Authoritative reference documentation for the akm CLI and its data.
4
4
 
5
+ - [Programmatic API](api.md) -- `akm-cli/api`: in-process `curate()` for the akm plugins
5
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
@@ -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.
@@ -40,7 +40,7 @@ my-bundle/
40
40
  instructions/ # Project guidance (.md)
41
41
  env/ # Environment files (.env) — groups of related config, loaded whole
42
42
  secrets/ # Secrets — one sensitive value per file (auth tokens, keys, certs)
43
- workflows/ # Peer workflow sources (.md and .yml)
43
+ workflows/ # Workflow sources (.md)
44
44
  lessons/ # Distilled lessons (.md, see akm improve / proposals)
45
45
  memories/ # Recalled context fragments (.md, see Memory reference)
46
46
  facts/ # Durable bundle-level facts (.md)
@@ -60,10 +60,8 @@ Scripts and knowledge are classified by **what they are**: a `.sh` file is a
60
60
  script; a plain `.md` file is knowledge. Commands and agents are classified
61
61
  by **how an LLM should use them**: a `.md` file with `$ARGUMENTS`
62
62
  placeholders is a command template; one with `tools` in its frontmatter is an
63
- agent definition. Workflow assets may be `.md` or `.yml`: Markdown is
64
- classified by `type: workflow` or placement, while the GitHub-shaped YAML
65
- adapter validates the closed workflow subset. These are peer workflow sources,
66
- not an md-only surface. Skills are a
63
+ agent definition. Workflow assets are `.md`, classified by `type: workflow`
64
+ or placement. Skills are a
67
65
  **packaging convention**: a directory containing a `SKILL.md` file.
68
66
 
69
67
  See [Classification](../architecture/internals/classification.md) for the
@@ -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.