akm docs

Use AKM With Any Agent

AKM works from any shell-capable coding agent — Claude Code, OpenCode, Cursor, Windsurf, Aider, and others. No plugins or SDKs are required for the core workflow: a three-line system prompt block plus shell access is all an agent needs to start using your bundle.

AGENTS.md / CLAUDE.md snippet

Add this block to your AGENTS.md, CLAUDE.md, or system prompt. It tells the agent that akm is available and how to discover it.

## Resources & Capabilities

You have access to a searchable library of scripts, skills, commands, agents,
knowledge, workflows, env files, secrets, lessons, memories, tasks, sessions,
and facts via the `akm` CLI. Use `akm -h` for details.

That is the minimum. The agent can then run akm curate <task> at the start of any complex task to pull the most relevant assets into context, and akm show <ref> to load any asset by ref.

For a longer, agent-facing instruction block — usage patterns, flag guidance, the full ref format — generate one instead of hand-writing it:

akm hints >> AGENTS.md

The output is written for agents rather than humans: it describes the lookup workflow (curate → show → feedback) and explains how refs work. It prints the short guide.

The retrieval loop: curate, show, feedback

Once an agent knows akm is available, the working pattern is always the same three calls:

# 1. Curate assets for the current task
akm curate "deploy to production" --limit 3

# 2. Load the best match by ref from the curate output
akm show workflows/deploy-to-prod

# 3. Record outcome
akm feedback workflows/deploy-to-prod --positive --reason "Completed without issues"

Get refs from search. Agents should call akm search or akm curate to discover refs rather than guess them. Both return a ref at the default detail level; pass it to akm show. --detail agent additionally returns each hit's path and editable flag, for agents that read or edit the file directly. For a long document, akm show <ref> --outline returns its outline (toc, no body), and akm show <ref>#<slug> then loads only the sections the task needs.

Feedback closes the loop. Record --negative only when the asset's content is wrong or stale; a note that simply did not fit the task is not negative feedback, so record nothing for it. akm feedback <ref> --negative --reason "<what is wrong and what should change>" flags the asset, and the next improve run may repair its description, title or when_to_use from your reason. Once you have verified the correct fact, attach the exact fix with --replace, --with and --source. --positive records that an asset helped (it raises its ranking) and does not trigger a rewrite. See Improve the Library for what happens to feedback after it's recorded.

Compatibility matrix

Not every agent surface integrates with AKM the same way. The table below sets expectations by environment.

Environment Core support Optional/extended support
Shell-capable coding agent curate / show / feedback via the CLI Generated prompt block (akm hints) or a platform plugin
Claude/OpenCode project layout Indexed in place through a BundleAdapter — no migration needed akm import --asset-ref selected assets into a writable bundle for editing
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

A Claude Code .claude directory or an OpenCode .opencode directory is recognized and indexed automatically once added as a source — see Bundle Types for the full adapter list and which formats are read-only versus writable in the current release. The native directory remains the source of truth: AKM translates recognized assets while reading the bundle and does not synchronize, copy, or write them back. Execution of these translated agents and commands is described in Architecture: Connections and Harnesses.

AKM complements, rather than replaces

AKM is not a competitor to assistant-native rules/skills or to MCP — it fills a different layer. Assistant-native rules and skills give a specific tool built-in, tool-specific activation. MCP exposes live tools and resources over a protocol. AKM manages portable, versionable capability assets — and the retrieval loop that finds and loads them — across whichever tool you're sitting in. In short, AKM complements MCP and assistant-native skills rather than replacing either.

Also available

OpenCode plugins: one package per OpenCode major

OpenCode 1 and OpenCode 2 load different plugin APIs, so akm ships one plugin package for each. Install only the one that matches the opencode you run; akm never installs or replaces the opencode binary, and akm upgrade never adds one plugin to the other major's config.

OpenCode Plugin package Config key Plugin cache
1 akm-opencode "plugin" ~/.cache/opencode/packages/akm-opencode@<tag>/
2 akm-opencode-v2 "plugins" (the key opencode plugin add writes) ~/.cache/opencode/npm/akm-opencode-v2@<tag>/<build>/

($XDG_CACHE_HOME and $XDG_CONFIG_HOME move both.) Both packages declare the same akm-cli dependency. OpenCode 1 is deprecated as the opencode harness and removed in 0.11 (see STABILITY.md); use OpenCode 2.

OpenCode 1. Add akm-opencode to the global config (~/.config/opencode/opencode.json):

{ "plugin": ["akm-opencode"] }

OpenCode 2.

opencode plugin add akm-opencode-v2

This installs the package and adds it to plugins in the global config.

Updating. akm upgrade refreshes the cached plugin of each major it finds, holds the CLI to the akm-cli those plugins pin, and leaves a plugin alone whose config pins another spec such as akm-opencode@0.8.0. Use akm upgrade --channel next with akm-opencode@next / akm-opencode-v2@next in the config to follow prereleases. The exact rules are in the akm upgrade reference. akm doctor warns when either plugin's bundled akm-cli differs from the running CLI.

Which OpenCode akm runs does not depend on the plugin: the opencode harness runs your OpenCode through its CLI (OpenCode 2; OpenCode 1 still runs through 0.10 and prints a deprecation notice), and akm's own runtime fetches and runs its own pinned one (see Configuration). Install the plugin for the OpenCode you use yourself.

See also