Repository navigation
Development
Giulio Smedile edited this page Nov 26, 2026
·
5 revisions
How the LEAN repo is laid out, how to test and extend it, and how releases and this wiki are maintained. Everything LEAN ships lives in lean/.
lean-framework/
lean/ LEAN: the `lean-method` npm package. Edit here.
wiki/ source copy of the pages of this wiki
.gitignore
-
LEAN:
lean/(pluswiki/). -
Baseline (history only): the BMAD 6.12.4 install that LEAN was derived from and is measured against was committed once in
b6cf242:_bmad/(config, manifests, 5 Python helper scripts), the 29bmad-*skills in.claude/skills/and.agents/skills/, and 29 pointer files in.opencode/commands/. It is comparison material, not LEAN, and the working tree may not contain it. The size measurements and any comparison run depend on that commit. Recover the files withgit archive b6cf242 .claude .agents .opencode _bmad | tar -x -C <empty-dir>. BMAD writes its documents to_bmad-output/(theoutput_folderin_bmad/config.toml); that folder was never committed. -
Generated, never edit by hand: a target project's
_lean/,.claude/skills/lean-*and role agents. They are copies made by the installer. Edit the source inlean/, then reinstall; edited copies are backed up to_lean/_backups/on update. -
Ignored by git:
node_modules/,*.tgz,_lean/config.user.toml,_lean/custom/config.user.toml. The root.gitignorestill listsexplainer/and Python entries from before 0.5.0.
lean/
package.json name lean-method, version, bin lean + lean-method, node >=20.19
README.md COMPARISON.md package docs; BMAD-vs-LEAN run protocol
skills/ the 9 lean-* skills, copied as-is into projects
src/module.yaml install questions -> _lean/config*.toml
tools/installer/
lean-cli.js `npx lean-method <cmd>`; loads every commands/*.js
plan-cli.js becomes _lean/bin/lean.js (plan commands only)
commands/ install scout status uninstall | check next freeze claim metrics
hooks/frozen-guard.js becomes _lean/hooks/frozen-guard.js
lib/
installer.js file plan, manifests, hooks, vendoring _lean/bin
config.js reads and writes _lean/config*.toml; role tiers
scout.js detects agents and models, suggests tiers
role-agents.js renders role agents per tool
platform-codes.yaml the 48 install targets
plan.js plan-check.js metrics.js claims.js plan tooling
ui.js prompts (@clack/prompts)
test/ installer.test.js, plan.test.js
Runtime dependencies: @clack/prompts, commander, picocolors, smol-toml, yaml.
cd lean
npm install # once
npm test # node --test test/*.test.js
node --test --test-name-pattern=claims test/plan.test.js # one testResult on Node 22 at 0.10.2: 39 tests, 39 pass, 0 fail, about 6 s. The tests use the built-in node:test runner and drive the real CLI against temp directories.
-
installer.test.js(16): scout and tier suggestions, role agents for each tool, install, update, quick-update, uninstall, hooks, and a check that every`assets/<file>`a skill mentions exists. -
plan.test.js(13): builds a small plan tree, then coverscheck,next,freeze,metrics,claim, lane trespass and the guard hook. Needsgiton the path.
Try the installer from the checkout in a throwaway directory:
node tools/installer/lean-cli.js install --directory /tmp/try --tools claude-code --yes --no-scoutskills/lean-plan/
SKILL.md required
assets/ templates the skill copies from (story-template.md, epics-template.yaml, ...)
-
Frontmatter: exactly two keys,
nameanddescription. The description is one quoted line ending in trigger phrases ("Use when the user says ..."). OpenCode command pointers reuse it. -
Discovery: the installer takes every directory under
skills/that starts withlean-and copies it whole to each tool's skills folder. Extra files ship automatically. -
Body: starts
# Lean <Name>. Every skill exceptlean-kitthen has an On start line pointing to{skill-root}/../lean-kit/SKILL.md.{skill-root}and{project-root}are placeholders the agent resolves. -
Siblings: skills read shared files from each other (
lean-kit/orchestration.md,kiss.md;lean-review/lenses/,triage.md), so all nine always install together. -
Templates: refer to them as
`assets/<file>`; the installer test fails if the file is missing.
Add an entry to tools/installer/lib/platform-codes.yaml:
platforms:
my-tool:
name: "My Tool"
preferred: false
installer:
target_dir: .my-tool/skills- LEAN reads only
name,preferred,suspended,support,installer.target_dirandinstaller.commands_target_dir. Other keys inherited from BMAD's schema (such asglobal_target_dir) are ignored. - That entry gives basic support: skills install and run on one model. Check with
node tools/installer/lean-cli.js install --list-tools. -
commands_target_dirwrites one pointer file per skill (OpenCode uses.opencode/commands). -
Full support (
support: full) also needs a renderer inFORMATS(lib/role-agents.js), aHARNESSESentry and a tier branch inlib/scout.js, and tests. A guard hook adds the tool toGUARDEDincommands/install.jsand add/remove functions inlib/installer.js. - Worked examples: commits
553544a(AGY) and3323bb7(Codex). See Supported Tools.
Create tools/installer/commands/<name>.js (illustrative):
module.exports = {
command: 'hello',
description: 'Say hello',
options: [['--directory <path>', 'Project directory (default: current directory)']],
action: async (opts) => { process.stdout.write('hello\n'); },
};-
lean-cli.jsregisters every file incommands/automatically. A thrown error printslean-method <name>: <message>and exits 1; setLEAN_DEBUG=1for the stack. - To also offer it as a plan command (
node _lean/bin/lean.js hello), add the name toCOMMANDSinplan-cli.jsand toCLI_COMMANDSinlib/installer.js; add any new lib toCLI_LIBS. That CLI is vendored without npm, so onlyyaml,smol-tomlandpicocolorsare available, and options must be--flagor--flag <value>. - Add a test, then update the README, the CLI section of
lean-kit, andguide.mdsection 9. See CLI: Plan Tooling and CLI: Installer.
-
One source:
versioninlean/package.json. The installer reads it for--version, the install banner and the manifest (_lean/_config/manifest.yaml,installation.version), whichstatusand updates read back. -
Not published: no git tags, no changelog, not on the npm registry.
npm pack --dry-runshowslean-method-0.10.2.tgz(54 files, about 117 kB); thefilesfield inpackage.jsondecides what ships. -
Local use:
npm packinlean/, thennpx --package=./lean-method-0.10.2.tgz lean-method install. -
Convention in the history: a release is one commit titled
LEAN x.y.z: <summary>that bumpspackage.json, updates README andguide.md, and adds tests. The body lists the changes and the test count.
| Version | Commit | Date | Change |
|---|---|---|---|
| 0.4.0 | b6cf242 |
2026-11-12 | Baseline: BMAD 6.12.4, LEAN draft (installer, scout, role agents), explainer/ sources. 10 tests |
| 0.5.0 | 183d5f4 |
2026-11-12 | Deterministic plan tooling: check, next, freeze, metrics. frozen_sha256 and metrics: in stories. Triage log gets a fixed vocabulary. explainer/ removed. 18 tests |
| 0.6.0 | d6578b4 |
2026-11-13 | Enforced review, tests-first build, claims, hooks. Evidence rule, amend route, security lens, test worker, freeze --tests, claim, exit evidence, vendored _lean/bin, guard hook, git pre-commit, full/basic support, COMPARISON.md. 23 tests |
| none | 553544a |
2026-11-13 | Antigravity CLI (AGY) full support. Version stayed 0.6.0. 26 tests |
| 0.7.0 | 3323bb7 |
2026-11-13 | Codex full support: .codex/agents/*.toml, guard on apply_patch, scout detection. 29 tests |
| 0.8.0 | 0383a2b |
2026-11-15 |
lean-loop: unattended story loop whose gates are static checks (status, check --story, frozen-test hashes, verification commands, clean commit); loop.verify config key; lean-build reuses a given claim owner. 31 tests |
| 0.9.0 | 09955da |
2026-11-24 | Cheap profile for feature-sized work (at most three CAPs, nothing irreversible): one epic and one feature story with no team question, small route on a mid-tier session, tests written with the code (frozen tests only for security: true or an irreversible step), one review of the whole feature (earlier stories of a multi-story epic get a security pass only), reviewers told which decisions are settled, short retro for a one-story epic. Skills and docs only: no CLI change. Experimental: run once, for cost and time only (Experiment Results). 31 tests |
| 0.10.0 | ab03f60 |
2026-11-24 | Frozen contract fields and approval provenance, after an external review and the B run of the experiment. freeze --via checkpoint|plan writes approved_via and contract_sha256 (caps, rules, seams, checkpoint, security, frozen_tests, approved_via); check adds story/contract-changed, story/contract-unhashed, story/approved-via, story/baseline-unknown, story/security-untested, and the doubled cap for a feature story; the guard also blocks contract-field edits and a baseline_commit rewrite. Frozen lines the orchestrator wrote without a checkpoint carry [ASSUMPTION] and are open to review (decision-conflict:); triage judges them on the merits. lean-loop requires loop.verify unless --allow-no-verify. Not yet measured in a run. 37 tests |
| 0.10.1 | 5fcbcf0 |
2026-11-24 | Review window and acceptance traceability. check --story prints the diff since the last feature review and whether a review is due: at the final story, or earlier once it passes review.max_diff_lines (default 1,500 changed lines; 0 reviews every story); stories record review: feature | security | deferred; story/review-due (parked by lean-loop), story/review-vocab. Acceptance criteria are numbered AC-n in the frozen block, tests name them as <story id> AC-n, and story/ac-untested lists the ones no changed test names (reported only). Not yet measured in a run. 39 tests |
| 0.10.2 | 7454c84 |
2026-11-24 | One definition of an irreversible step, in lean-kit: a step a revert of the code would not undo (destructive or data-rewriting migration, data deletion, external side effect, deploy trigger). An additive migration with a working downgrade no longer counts, so a feature that only adds a table can take the cheap profile. Skills and docs only. 39 tests |
- The live wiki is the repository's GitHub wiki, a separate git repo (
lean-framework.wiki.git).wiki/in this repo holds the same pages. Nothing syncs them: change a page in both places, or copy the files fromwiki/into a clone of the wiki repo and push. - Page file names are the page names (
Review-and-Triage.md,_Sidebar.md,_Footer.md). - Style: no
# H1(the wiki shows the title); one bold lead line, then##sections; ASCII diagrams only; end with## See also. - Links between pages are relative with
.mdinwiki/([Parallel Teams](Parallel-Teams)), so they work when browsed in the repo. The GitHub wiki needs them without the extension. When copying, strip it:sed -E 's/\]\(([A-Za-z0-9_][A-Za-z0-9_-]*)\.md(#[^)]*)?\)/](\1\2)/g' Page.md. - Every claim must trace to a file in
lean/. When docs and code disagree, the code wins; fix the doc. - When you change behaviour in
lean/, update the README,skills/lean-help/guide.mdand the affected wiki page in the same commit.
- LEAN vs BMAD: why the baseline is kept in history, and how it is measured
- Supported Tools: what full and basic support mean per tool
-
Configuration: the
_lean/files the installer generates - CLI: Installer: the commands you extend
LEAN 0.10.2 · Repository