Repository navigation
Development
Giulio Smedile edited this page Nov 13, 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/ sources of this wiki
scripts/publish-wiki.sh publishes wiki/ to the GitHub wiki
.gitignore
-
LEAN:
lean/(pluswiki/andscripts/). -
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 8 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.7.0: 29 tests, 29 pass, 0 fail, about 7 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 eight 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.7.0.tgz(52 files, about 102 kB); thefilesfield inpackage.jsondecides what ships. -
Local use:
npm packinlean/, thennpx --package=./lean-method-0.7.0.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 |
- Pages live in
wiki/in the repo. Edit them there, then runscripts/publish-wiki.sh. Do not edit on github.com: those edits never reach the repo. - 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
.md([Parallel Teams](Parallel-Teams)). The publish step strips the.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