Kanban-as-Code is a git-native execution framework that turns planning into versioned, machine-validated markdown so teams can coordinate strategy, scope, and delivery from a single source of truth.
Kanban-as-Code is a lightweight planning system that stores strategy, roadmap, and task execution data in plain markdown files with strict schema validation. Instead of treating planning docs as static notes, it makes them first-class development artifacts: auditable, reviewable, queryable, and safe for parallel execution.
The kan CLI initializes the system, validates frontmatter and cross-references, coordinates agent ownership, and supports a structured loop (plan → work → review → compound) so multi-agent work stays consistent over time.
The system is intentionally portable:
- any standalone repo, and
- any existing Turborepo repo with minimal optional wiring.
GitHub: https://github.com/agora/kanban-as-code
It contains:
kanban/planning structure with strategy roots and roadmap documentsdocs/knowledge spacekanCLI package (bin/kan.js) to bootstrap, lint, and validate the repository- strict frontmatter schemas (via Zod) + cross-reference checks
PR workflow for the kanban-as-code project:
- Fork and branch from
main. - Keep changes focused and small.
- Prefer documentation and template improvements over behavior changes in the core CLI unless required.
- Run
kan lint --jsonfor planning-plane validation. - Open a PR with a short summary of intent and validation notes.
If you find a bug, please submit it to the GitHub repo:
- open an issue: https://github.com/agora/kanban-as-code/issues
- open a pull request with a focused fix: https://github.com/agora/kanban-as-code/pulls
You can use Claude Code, Codex, or other AI coding tools to help with fixes, but please keep PRs small, include validation output, and link to the related issue when possible.
From a fresh repo root:
npm init -y
npx kan initFor a cleaner dogfood workspace in any repo (empty folders with agents.md in every planning/knowledge folder):
kan init --skeletonkan lint
kan start --json
kan status
kan queue
kan next
kan backlog summary --scope kanban/roadmap/initiatives
kan backlog set in-progress <task-id>
kan backlog move kanban/roadmap/initiatives/foo.md docs/archive/foo.md
kan assess
kan docs:index --out .kan/docs-index.json
kan update --dry-run
kan update
kan build
kan update --force
kan health
kan query '.[] | select(.status == "in-progress") | .id'
kan query '.[] | sort_by(.status) | .[0:3]'
kan agent init
kan agent worktree <agent-name> --branch <branch>
kan agent claim --scope <path> --agent <name>
kan evolve initiatives/my-doc-id --to review
kan mv kanban/roadmap/initiatives/foo.md docs/archive/foo.md
kan rm kanban/roadmap/initiatives/old.md --dry-run
kan grooming --scope kanban/roadmap/initiatives --type initiativeIf your repo already uses kanban-as-code, keep it in sync with template/tool updates:
kan update --dry-run
kan update --forceThis is the release update flow for injected deployments:
- upgrade the
kanban-as-codesource in your environment (or pull the latest starter release), - run one command in each downstream repo:
kan update --force, - run
kan lint --jsonand address any generated conflicts.
Keep upgrades predictable by using Git tags/releases from:
Simple fixed cadence flow:
- Choose a target release/tag in this repository.
- Update your local
kanban-as-codecheckout or package to that tag. - Run
kan update --forcein each deployed repo. - Run
kan lint --jsonand resolve conflicts.
This makes updates deterministic: every repo is synced to a known upstream tag/release rather than ad-hoc snapshots.
kan updateapplies new files from the template and skips existing conflicts.kan update --forcealso overwrites starter files so local edits are intentionally refreshed.kan update --jsonreturns machine-readable change summaries for scripts/CI.
kan supports JSON output with --json for machine/agent flows.
kan also provides optional multi-agent commands:
kan agent claim(claim via target task or explicit scope)kan agent init(bootstrap local worktree helper and, for non-starter repos, generate a PR agent-guard workflow)kan agent worktree(provision a dedicated agent worktree)kan grooming/kan backlog:groom(run backlog triage before execution)kan status/kan queue/kan next/kan backlog summary(execution-readiness plane)kan backlog set/kan backlog move(status updates and scoped movement with lock checks)kan assess(machine-readable PASS/WARN/FAIL planning health)kan docs:index(generate docs payload for planning and agents)kan plugin list/kan plugin install <name>kan loop --stage plan,kan loop --stage work,kan loop --stage review,kan loop --stage compoundkan loop --stage compound --auto --scope kanbanfor autonomous post-merge compounding mode
kan agent init flags:
--workflowto force creating the PR guard workflow even when a starter workflow exists.--no-workflowto skip generating the PR guard workflow.kan agent initalso writesscripts/kan-agent-worktree.shfor dedicated agent worktrees.
Every agent session starts with exactly this command:
kan start --jsonRead at least these fields before touching state:
context.config.existscontext.config.isHealthycontext.collections[].existsrecommendedNextcapabilities
If context.config.isHealthy is false or a config error exists, resolve that first before evolve, mv, rm, or scope-changing work.
The canonical roadmap for implemented improvements is now machine-readable:
future-ledger.jsonfuture-ledger.schema.jsonsrc/future-notes.js(compat wrapper + source import path)
future-ledger.json is the canonical ledger for triage (diff-safe, machine-parseable, and strict to schema).
Machine-readable outputs:
node scripts/validate-future-ledger.mjs --json --triageThis prints structured validation + triage fields for automation.
kanban/is the execution planning plane; durable artifacts are:architecture-reference.mdStrategy-Current.mdstrategic-execution-spec.md
docs/is a stable knowledge index for references.docs/brainstorms/stores compounding prompts and system memory.docs/compounds/stores loop artifacts fromkan loopexecution.- IDs are stable (
idin frontmatter) and should remain stable across renames/moves. - Every file is plain markdown with YAML frontmatter and is versioned in git.
Recommended pattern:
- Use dedicated git worktrees and one branch per agent for primary isolation.
- For same-worktree sessions, use
kan agent claimandkan agent guardin pre-commit. - Prefer
kan agent claim --scope <scope>when a task id is not available.
templates/starter/is the bootstrap payload used bykan init.kan.config.jsonconfigures collection paths + schemas.
For non-starter repos, run kan agent init to add dedicated pull-request guard and compound loop files:
.github/workflows/kan-agent-scope-guard.ymlenforceskan agent guardon pull requests..github/workflows/kan-compound-autopilot.ymlrunskan loop --stage compound --autoafter merge when the plugin is installed.- Keep project CI (
kan lint,kan build) in your existing workflow. compound.config.yamlstores starter autopilot policy defaults for compounds.
Kanban is standalone by default. For host repos that already use Turborepo, follow this minimal path:
- Copy the starter payload:
kan initin the host repo, or copytemplates/starterinto it.
- Keep using the default workflow above as-is (it still runs on any repo).
- Optional: wire into
turboby adding a root script and task that map tokan lint.
Example:
{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"kanban-lint": {
"outputs": [".kan/lint.json"],
"inputs": [
"kan.config.json",
"compound.config.yaml",
"kanban/**/*",
"docs/**/*"
]
}
}
}Then add a corresponding package script in the host root package.json:
"kanban-lint": "kan lint --json > .kan/lint.json"Run with turbo run kanban-lint when you want Turborepo-native orchestration.
Author: Gudjon Mar Gudjonsson [ Agora & OZ & Alendis ]