Two moves: create and run.
afk create <task>
Implementation: src/core/afk.js:268 · runAfkCreate(root, config, args).
Flags: --slug <string> (auto-generated from task if omitted), --root, --provider, --json.
Writes: .agentify/planned/<slug>.md with frontmatter type: agentify-afk-plan, schema_version: "1.0", status: pending.
Required sections: ## Plan, ## Implementation, ## Verification.
afk run <plan-file>
Implementation: src/core/afk.js:356 · runAfkRun(root, config, args).
Flags: --current-worktree, --allow-dirty, --no-commit, --cleanup <keep|delete|ask>, --provider, --root, --json.
Reads: the plan markdown; validates frontmatter and required sections via validateAfkPlanMarkdown.
Writes: a fresh worktree (unless --current-worktree); auto-commits on completion (unless --no-commit); updates the plan's status field.
What validateAfkPlanMarkdown checks.
From src/core/afk.js:73. The validator throws if any of these are missing or wrong.
agentify-afk-plan.
"1.0" (constant AFK_PLAN_SCHEMA_VERSION).
pending → running → complete / failed.
Run-time guards.
Both isolated and current-worktree paths call assertCleanWorktree(root, "--allow-dirty"). Pass --allow-dirty to bypass.
--current-worktree refuses to auto-commit on the default or a protected branch. Either run from a feature branch or pass --no-commit.
Must be one of keep, delete, or ask. Any other value throws: "afk run --cleanup must be one of: keep, delete, ask".
For supervised runs over GitHub issues, use agentify issue-killer with the default agentify-ready label or a custom CSV via --labels.