# Decomposition methods

How docs are cut is swappable: a method folder (`SKILL.md`, optionally `decomposer.yaml`) is prompt text that `tkt` serves in the steps, never runs; the ticket shape and the gate stay aitodo's.

`tkt plan method import ./my-method` stores it (`.aitodo/methods/<name>/`), so every member cuts the same way: `--method my-method`, defaulted by `tkt plan method default` (`planMethod`), else `story-writer`.

## Details

- `--method` is a folder with `/` or `\`, a drive letter, or a leading `.`/`~`; else a name (stored, built-in, repo-store folder). A local folder as a name: `ERR_NOT_FOUND` (`--method ./name`).
- Hashed, served: `SKILL.md` (required, non-empty), `decomposer.yaml`, `.md`/`.txt` in `references/`, `templates/`, `examples/`; root `SOURCE.md`, `LICENSE*` kept quiet; others ignored (`Warning Ignored …`, `warnings[]`). Refused pre-upload (`ERR_DECOMPOSITION_METHOD_INVALID`): `scripts/`, executable bits, symlinks, text over 200 KB or not UTF-8, missing/empty `SKILL.md`, bad manifest.
- `decomposer.yaml` (unknown keys refused): `name` (`[a-z0-9-]+`), `version` (quote `"1.10"`), `placement: inline|sibling` (`inline`), `typeMap` (`lowerType` → `task|bug|chore`, else `task`), `acStyle: gwt|checklist` (`checklist`; `gwt` adds `ac-gwt`), `maxUnitsPerDoc` (1-50, 20). `story-writer`: `inline`, `gwt`, 15.
- `methodRev` = `name@version#hash12` (defaults: folder name, `0`); editing mid-way: `ERR_DECOMPOSITION_STALE`. A `SKILL.md` alone is a method.
- Import name: `--name`, manifest `name`, folder (`[a-z0-9-]+`, not `headings`, `target: name`); committed, moved by `tkt store move`, not exported to OKF; a stored `story-writer` shadows the built-in. Same hash: `unchanged`; else `replaced <name>: <old12> → <new12>`, open decompositions go stale, tickets keep `methodRev`.
- `tkt plan method default`: resolvable names only (`ERR_SCHEMA_INVALID_ENUM`), `--clear` unsets; `from-docs` ignores it.
- Server store: client-checked tar upload (hidden `--method-archive`, 1 MB); a folder in `--method`: `ERR_STORE_LOCATION`. `import`, `default`: admin (`admin_write`). `tkt doctor`: `PLAN_METHOD_INVALID`, `PLAN_METHOD_DEFAULT_MISSING`.

- `tkt plan method list [--json]`: `name`, `version`, `hash`, `methodRev`, `source` (`store`/`builtin`), `default`, `shadowed`, `valid`.

## Commands on this page

- [`tkt plan method import`](/en/docs/reference/commands/plan.md#tkt-plan-method-import): Check a method folder and store it in the project, under .aitodo/methods/\<name\>/
- [`tkt plan method list`](/en/docs/reference/commands/plan.md#tkt-plan-method-list): List the decomposition methods: the stored ones and the built-in story-writer, with their version, hash and methodRev, and which one tkt plan begin takes without --method
- [`tkt plan method default`](/en/docs/reference/commands/plan.md#tkt-plan-method-default): Set the method tkt plan begin takes without --method (planMethod in the store config)

## Related

- Error code · 422: [`ERR_DECOMPOSITION_METHOD_INVALID`](/en/docs/reference/errors.md#ERR_DECOMPOSITION_METHOD_INVALID): A decomposition method folder tkt refuses to read
- Doctor · warning: [`PLAN_METHOD_INVALID`](/en/docs/reference/doctor.md#doctor-PLAN_METHOD_INVALID): A stored decomposition method that no longer passes the method checks
- Doctor · warning: [`PLAN_METHOD_DEFAULT_MISSING`](/en/docs/reference/doctor.md#doctor-PLAN_METHOD_DEFAULT_MISSING): planMethod names a stored method that does not exist
- Config key: [`planMethod`](/en/docs/reference/config.md#planMethod): The default decomposition method of tkt plan begin
