akm docs

Asset Types

Reference for the capability taxonomy the native akm adapter recognizes, the bundle directory layout, and the metadata every asset carries.

Contract

Directory layout

There's no required structure, but this skeleton is the opt-in convention:

my-bundle/
  scripts/        # Executable scripts (.sh, .ts, .js, .py, .rb, .go, etc.)
  skills/         # Skill definitions (directories with SKILL.md)
  commands/       # Command templates (.md; placeholders optional)
  agents/         # Agent definitions (.md with model/tools frontmatter)
  knowledge/      # Reference documents (.md)
  instructions/   # Project guidance (.md)
  rules/          # Short agent rules, led by project in search and curate (.md, see "Project Rules" in the author guide)
  env/            # Environment files (.env) — groups of related config, loaded whole
  secrets/        # Secrets — one sensitive value per file (auth tokens, keys, certs)
  workflows/      # Workflow sources (.md)
  lessons/        # Distilled lessons (.md, see akm improve / proposals)
  memories/       # Recalled context fragments (.md, see Memory reference)
  facts/          # Durable bundle-level facts (.md)
  tasks/          # Task source v4 scheduled or on-demand automation (.yml only)
  sessions/       # Machine-placed indexed session summaries (.md)
  .meta/          # Optional bundle orientation, not indexed (see "Bundle orientation" below)
  .scratch/       # Temporary working material, never indexed (see "Scratch space" below)

LLM Wikis are a related but separate concept: a wiki is its own installable bundle (akm bundle add github:team/research-wiki), not a type-subdirectory inside a regular bundle. See Wikis for how akm recognizes and indexes them.

Classification taxonomy

Scripts and knowledge are classified by what they are: a .sh file is a script; a plain .md file is knowledge. Commands and agents are classified by how an LLM should use them: a .md file under commands/ or with agent frontmatter is a command template; one under agents/ is an agent definition. Body placeholders such as $ARGUMENTS also discover commands in untyped directories, but do not override knowledge, memory, or other typed directory placement. Workflow assets are .md, classified by type: workflow or placement. Skills are a packaging convention: a directory containing a SKILL.md file.

See Classification for the full specificity-based matching system.

Metadata field reference

Metadata lives with the asset itself, not in a separate sidecar file: frontmatter for markdown assets, and structured comments for scripts. The indexer derives metadata from filenames, code comments, frontmatter, and package.json.

See Storage Locations for the on-disk layout of the databases, caches and asset directories.

Bundle orientation: the .meta/ convention

A bundle may carry an optional .meta/ directory at its root holding human-authored orientation for the bundle as a whole — purpose, key assets, conventions, maintainer. This is distinct from per-asset metadata, which still lives with each asset: .meta/ never describes individual assets, only the bundle itself.

my-bundle/
  .meta/
    index.md          # shown by `akm show meta` — the default orientation doc
    about.md          # shown by `akm show meta:about`
    conventions.md     # shown by `akm show meta:conventions`

Because .meta/ is a dot-directory, the indexer skips it — these docs never appear in akm search and never compete for ranking. They are direct-read on demand:

akm show meta                       # working bundle's .meta/index.md
akm show meta:about                 # working bundle's .meta/about.md
akm show akm//meta                  # the primary bundle explicitly

akm show <origin>//meta:<name> resolves <name>.md first, then an extensionless <name>. The convention is open-ended: bundle owners add new docs by dropping files into .meta/ — no configuration or code changes required. akm bundle create scaffolds a starter .meta/index.md.

Known gap: an install-ref origin (akm show github:owner/repo//meta) does not currently resolve even for an installed bundle — origin resolution matches only derived installation ids, not raw install refs. Use akm//meta for the primary bundle, or the bundle key you gave it in bundles (config.json), not the original install ref.

Scratch space: the .scratch/ convention

The root .scratch/ directory of a bundle holds temporary drafts, investigation notes, experiments, generated artifacts and intermediate outputs. Every file beneath it is excluded from indexing regardless of extension, adapter or Git state (tracked and force-added files included), and it never influences adapter or bundle-root detection. The reservation is root-scoped: a nested .scratch/ is ordinary content, and the existing workspace/ directory keeps its indexable-content semantics.

akm bundle create (and akm setup, which reuses it) creates .scratch/README.md and adds /.scratch/ to .gitignore. Re-running it restores a missing README or rule without touching existing scratch files or a customized README. Existing bundles work without the directory, and reads never create it. Index exclusion is independent of Git tracking: ignoring .scratch/ does not untrack files already committed.

AKM never cleans .scratch/. Remove your own files when the work is done, move reusable findings into indexed content, and never keep the only copy of anything important there. Entries indexed before a file moved into .scratch/ are removed on the next index pass.

Script execution (ExecHints)

For script assets, akm resolves execution hints in this order:

  1. Header comment tags (@run, @setup, @cwd)
  2. Auto-detection from extension and nearby dependency files

Defaults

Storage

Stability

Per STABILITY.md: asset type is a free-form, open string — --type filtering is exact-match against an open set and deliberately unvalidated (an unrecognized type returns zero hits, not an error). The lesson asset type's schema (when_to_use, description) is stable, but its distillation triggers and ranking are Experimental tuning targets. See STABILITY.md for the full command- and surface-level tier index.

See also