levi-gear 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +21 -14
  2. package/agents/designer.md +1 -0
  3. package/agents/developer.md +2 -1
  4. package/agents/pm.md +2 -1
  5. package/agents/qa.md +2 -1
  6. package/agents/teamlead.md +1 -0
  7. package/docs/README.md +39 -0
  8. package/docs/authoring-usecases.md +124 -0
  9. package/docs/cli.md +99 -0
  10. package/docs/codex.md +35 -0
  11. package/docs/configuration.md +84 -0
  12. package/docs/contributing.md +46 -0
  13. package/docs/customization.md +45 -0
  14. package/docs/installation.md +82 -0
  15. package/docs/introduction.md +49 -0
  16. package/docs/team.md +143 -0
  17. package/docs/troubleshooting.md +63 -0
  18. package/docs/unattended-runs.md +51 -0
  19. package/docs/updating.md +109 -0
  20. package/docs/usage.md +62 -0
  21. package/docs/usecases.md +471 -0
  22. package/package.json +4 -3
  23. package/src/cli.js +2 -2
  24. package/src/commands/init.js +20 -10
  25. package/src/commands/list.js +1 -1
  26. package/src/commands/update.js +2 -2
  27. package/src/lib/agents.js +6 -1
  28. package/src/lib/desired-state.js +65 -5
  29. package/src/lib/sync.js +1 -1
  30. package/src/lib/tools.js +4 -3
  31. package/src/runtime/codex-checkpoint.mjs +48 -0
  32. package/usecases/_run-rules.md +10 -1
  33. package/usecases/create-feature/SKILL.md +20 -15
  34. package/usecases/create-feature/scripts/lock-tests.mjs +21 -8
  35. package/usecases/create-feature/workflow.js +49 -29
  36. package/usecases/design/SKILL.md +18 -3
  37. package/usecases/fix-bug/SKILL.md +16 -13
  38. package/usecases/fix-bug/workflow.js +47 -28
  39. package/usecases/generate-test-scenarios/SKILL.md +4 -4
  40. package/usecases/generate-test-scenarios/references/test-case-guide.md +1 -1
package/README.md CHANGED
@@ -1,16 +1,16 @@
1
1
  # levi-gear
2
2
 
3
- **Gather a whole software team into your terminal.** levi is an agentic kit that breathes a complete crew into Claude Code: a product manager, a teamlead, a developer, a designer and a QA engineer, each with a clear craft and a clear territory. Write a workflow once, and it comes alive as native Claude Code skills and subagents.
3
+ **Gather a whole software team into your terminal.** levi installs a product manager, teamlead, developer, designer and QA engineer as skills and subagents for Claude Code or Codex.
4
4
 
5
5
  ## Why levi
6
6
 
7
- - **Built for Claude Code.** A usecase is written once and installed as native Claude Code skills and subagents.
7
+ - **Skills and subagents.** Install usecases for Claude Code, Codex, or both.
8
8
  - **A team, not a lone assistant.** Five role agents, each owning only its own files, pass work to one another through plain files in a shared work folder, so every hand-off leaves a trail you can read.
9
9
  - **Craft from idea to release.** Seven ready usecases carry work from a vague idea to a verified result: brainstorming, spec writing, design, test-first feature building, bug fixing, code review and test scenarios.
10
10
  - **Tests that cannot be bent.** In `create-feature` and `fix-bug` the tests come first and are locked, and QA writes its test cases from the spec alone, so the code is fixed until the proof passes.
11
11
  - **Ask once, then run alone.** All questions are gathered up front; afterwards the run proceeds without you, picks cheap-to-change options on its own and lays them out in a closing report so you can change any of them.
12
- - **A run that outlasts the quota.** When the 5-hour usage window runs dry, the run resumes itself once it refills, with its context kept, instead of stopping half-way.
13
- - **Quiet until called.** levi never acts on its own; a prompt without the levi command is handled by Claude Code as usual. `/levi <request>` routes a request, in any language, to the best matching usecase.
12
+ - **Resume a run.** Claude Code has a quota guard; Codex saves checkpoints for recovery.
13
+ - **Quiet until called.** levi runs when explicitly invoked. `/levi <request>` in Claude Code or `$levi <request>` in Codex routes a request, in any language, to the matching usecase.
14
14
  - **Your files stay yours.** Everything installed is a plain file in your repository. `levi update` refreshes only what you did not touch and never overwrites your edits.
15
15
  - **Featherlight.** No runtime dependencies; Node.js 18 or newer is all it asks for.
16
16
 
@@ -21,8 +21,12 @@
21
21
  ```bash
22
22
  npx levi-gear@latest init # all usecases
23
23
  npx levi-gear@latest init brainstorming # only some usecases
24
+ npx levi-gear@latest init --tools codex # Codex skills and agents
25
+ npx levi-gear@latest init --tools claude,codex # both
24
26
  ```
25
27
 
28
+ For Codex, invoke `$levi <request>` or `$levi-<usecase> <request>`. See [Codex support](docs/codex.md) for prerequisites, checkpoint recovery and current limitations.
29
+
26
30
  Installed files are recorded in `.levi.json`. Commit the generated folders and `.levi.json` so teammates get everything by cloning.
27
31
 
28
32
  ## Commands
@@ -36,7 +40,7 @@ Installed files are recorded in `.levi.json`. Commit the generated folders and `
36
40
 
37
41
  ## Using it
38
42
 
39
- levi only runs when you ask for it. A prompt that does not start with the levi command is handled by Claude Code as usual.
43
+ levi only runs when you ask for it. In Codex use `$levi` and `$levi-<usecase>`; the table below shows the Claude Code form.
40
44
 
41
45
  | Let levi pick the usecase | Call a usecase directly |
42
46
  |---|---|
@@ -54,13 +58,13 @@ Every install includes the team agents from `agents/`. Usecases delegate to them
54
58
  | `levi-teamlead` | Designs the architecture and picks the technology; designs the database schema and migrations; sets structure, conventions and API contracts; breaks work into tasks with estimates; reviews code (security by OWASP Top 10, performance and correctness) with a fix for every finding; owns CI/CD | `architecture.md`, `tasks.md`, `review.md`, schema, migrations, CI/CD and deployment config | `brainstorming`, `create-feature`, `fix-bug`, `code-review` |
55
59
  | `levi-developer` | Implements tasks as designed; investigates and fixes bugs at the root cause; writes unit and integration tests; runs build, lint and tests before handing off | Application code, unit and integration tests, technical docs of the code | `create-feature`, `fix-bug` |
56
60
  | `levi-designer` | Maps user flows and wireframes; draws screens in SVG and HTML prototypes; defines design tokens and every state; covers responsive behavior and accessibility; writes handoff notes | `docs/designs/` | `design`, `create-feature` (for UI work) |
57
- | `levi-qa` | Writes test plans and test cases from the spec, without reading the code, as Markdown and Excel (only QA changes them); runs E2E tests in a headless browser; writes E2E and acceptance tests; reports bugs and gives the go or no-go | `test-plan.md`, `docs/tests/`, `test-report.md`, E2E and acceptance tests | `create-feature`, `fix-bug`, `generate-test-scenarios` |
61
+ | `levi-qa` | Writes test plans and test cases from the spec, without reading the code, as Markdown and Excel (only QA changes them); runs E2E tests in a headless browser when you choose to; writes E2E and acceptance tests; reports bugs and gives the go or no-go | `test-plan.md`, `docs/tests/`, `test-report.md`, E2E and acceptance tests | `create-feature`, `fix-bug`, `generate-test-scenarios` |
58
62
 
59
63
  Each agent does only its own role's work and writes only the files it owns; work for another role is handed off. The full role descriptions are in [docs/team.md](docs/team.md).
60
64
 
61
65
  Some usecases are also a role's skill: `spec-writing` for the PM, `design` for the designer, `code-review` for the teamlead and `generate-test-scenarios` for QA. They are installed with every install, and the agent follows that skill's guide whenever it gets that kind of task, from any usecase. A usecase declares this with `skill-for`, `skill-when` and `skill-guide` in its `SKILL.md`.
62
66
 
63
- The usecase's skill or workflow runs the team: it calls each member in turn. The PM only decides who owns each task and records it; the workflow follows that. Members hand work to each other through files in a work folder (`docs/levi/<slug>/` by default): `spec.md`, `status.md`, `docs/designs/`, `architecture.md`, `tasks.md`, `review.md`, `test-plan.md`, `test-report.md`. The shared rules live in `agents/_team-protocol.md`, which is appended to every team agent. Every usecase also follows the run rules in `usecases/_run-rules.md`, appended to each installed `SKILL.md`: all questions are asked up front, cheap-to-change choices are picked and reported at the end, and a run that hits the 5-hour quota resumes itself with its context kept ([docs/unattended-runs.md](docs/unattended-runs.md)).
67
+ The usecase's skill or workflow runs the team: it calls each member in turn. The PM only decides who owns each task and records it; the workflow follows that. Members hand work to each other through files in a work folder (`docs/levi/<slug>/` by default): `spec.md`, `status.md`, `docs/designs/`, `architecture.md`, `tasks.md`, `review.md`, `test-plan.md`, `test-report.md`. The shared rules live in `agents/_team-protocol.md`, which is appended to every team agent. Usecases also follow the run rules in `usecases/_run-rules.md` for questions and choices. Quota recovery differs between [Claude Code](docs/unattended-runs.md) and [Codex](docs/codex.md).
64
68
 
65
69
  ## Update
66
70
 
@@ -88,6 +92,8 @@ levi does not merge: a file you changed is yours from then on and stops receivin
88
92
  |---|---|
89
93
  | `.claude/skills/levi/`, `.claude/skills/levi-<usecase>/` | `.claude/agents/levi-<usecase>-<role>.md` |
90
94
 
95
+ For Codex, skills are installed under `.agents/skills/` and agent definitions under `.codex/agents/`.
96
+
91
97
  ## Authoring a usecase
92
98
 
93
99
  ```
@@ -100,15 +106,16 @@ agents/<role>.md # team agents shared by all usecases; frontmatter name:
100
106
  agents/_*.md # partials appended to every team agent
101
107
  ```
102
108
 
103
- Agent frontmatter (usecase and team agents alike):
109
+ Agent frontmatter applies to both usecase and team agents.
104
110
 
105
- | Field | Values | Claude Code |
106
- |---|---|---|
107
- | `name`, `description` | required | as is |
108
- | `tools` | comma list of `read`, `edit`, `execute`, `web`; omit for the defaults | `Read, Grep, Glob` / `Edit, Write` / `Bash` / `WebFetch, WebSearch` |
109
- | `model` | `strong`, `standard`, `fast`; omit to inherit | `opus` / `sonnet` / `haiku` |
111
+ | Field | Values | Claude Code | Codex |
112
+ |---|---|---|---|
113
+ | `name`, `description` | required | as is | `name`, `description` with a delegation note |
114
+ | `tools` | comma list of `read`, `edit`, `execute`, `web`; omit for the defaults | `Read, Grep, Glob` / `Edit, Write` / `Bash` / `WebFetch, WebSearch` | Uses the Codex tool configuration |
115
+ | `model` | `strong`, `standard`, `fast`; omit to inherit | `opus` / `sonnet` / `haiku` | Omitted. The agent inherits the Codex model |
116
+ | `effort` | `low`, `medium`, `high`, `xhigh`, `max`; omit to inherit | `effort:` as is | `model_reasoning_effort` (`max` maps to `xhigh`) |
110
117
 
111
- An explicit `tools` list also cuts off MCP tools, so leave it out for agents that need a browser or other MCP servers.
118
+ In Claude Code, an explicit `tools` list also cuts off MCP tools, so leave it out for agents that need a browser or other MCP servers.
112
119
 
113
120
  - Every usecase is manual-only: the installer sets `disable-model-invocation: true` in the installed `SKILL.md`, so Claude Code never triggers it by itself.
114
121
  - The `description` in `SKILL.md` is what the `levi` entry point reads to choose between usecases, so state precisely what the usecase does and which requests it fits. English is fine; requests in other languages are matched by meaning.
@@ -3,6 +3,7 @@ name: levi-designer
3
3
  description: UI/UX designer of the levi team. Designs and revises user interfaces, working mainly in SVG files and HTML prototypes - user flows, wireframes, screens, design tokens, states and handoff specs for developers.
4
4
  tools: read, edit, web
5
5
  model: standard
6
+ effort: medium
6
7
  ---
7
8
 
8
9
  You are the designer. You decide how the product looks and how people move through it, and you hand developers a design they can build without guessing.
@@ -1,7 +1,8 @@
1
1
  ---
2
2
  name: levi-developer
3
3
  description: Fullstack developer of the levi team. Implements assigned tickets and tasks following the teamlead's architecture and conventions, and writes unit and integration tests for the code it changes.
4
- model: standard
4
+ model: strong
5
+ effort: high
5
6
  ---
6
7
 
7
8
  You are a fullstack developer. You implement the tasks you are given, the way the teamlead designed them, and you prove they work with tests.
package/agents/pm.md CHANGED
@@ -2,7 +2,8 @@
2
2
  name: levi-pm
3
3
  description: Project manager of the levi team. Turns a request into a spec with acceptance criteria, keeps scope, progress, risks and tickets, approves plans, and accepts the product before it is delivered to the end user.
4
4
  tools: read, edit
5
- model: standard
5
+ model: strong
6
+ effort: xhigh
6
7
  ---
7
8
 
8
9
  You are the project manager. You own the outcome: what gets built, in what order, and whether it is ready to hand to the end user. You do not write code, you do not make technical decisions, and you do not call other agents: you assign the work and the workflow carries out the assignment.
package/agents/qa.md CHANGED
@@ -2,6 +2,7 @@
2
2
  name: levi-qa
3
3
  description: QA engineer of the levi team. Ensures quality independently of the developers - writes test plans and test cases from the spec, runs manual and E2E tests on the UI, writes automated tests, reports bugs, and signs off quality.
4
4
  model: standard
5
+ effort: medium
5
6
  ---
6
7
 
7
8
  You are the QA engineer. You check that the product does what the spec says, independently of how it was built. Your value comes from that independence.
@@ -10,7 +11,7 @@ You are the QA engineer. You check that the product does what the spec says, ind
10
11
 
11
12
  - **Test plan.** Write `test-plan.md` from `spec.md` and the design: scope, approach, environments, and test cases. Each test case has an ID, the acceptance criterion it covers, preconditions, steps, and the expected result.
12
13
  - **Coverage.** Every acceptance criterion has at least one test case. Cover the happy path, edge cases, invalid input, error states and permissions.
13
- - **E2E testing.** Run the test cases against the real UI, through the project's E2E runner or a browser tool when one is available.
14
+ - **E2E testing.** When the workflow asks for it (browser tests are optional, and the user may have turned them off), run the test cases against the real UI, through the project's E2E runner or a browser tool when one is available.
14
15
  - **Automation.** Write automated E2E and acceptance tests for the cases worth repeating. Developers own unit tests; you own E2E and acceptance tests.
15
16
  - **Visual check.** Compare the UI against the files in `docs/designs/` and report mismatches. The designer confirms what is intended.
16
17
  - **Bugs.** Report each bug in `test-report.md` with steps to reproduce, expected and actual result, severity, and evidence. Verify the fix when it lands, and rerun regression tests.
@@ -3,6 +3,7 @@ name: levi-teamlead
3
3
  description: Teamlead and senior developer of the levi team. Owns the technical side - system design, database, project structure, conventions, task breakdown and estimates, and code review before merge.
4
4
  tools: read, edit, execute, web
5
5
  model: strong
6
+ effort: xhigh
6
7
  ---
7
8
 
8
9
  You are the teamlead, the most senior developer on the team. You make the technical decisions and set the path the developers follow. You do not implement tickets yourself unless the workflow asks you to.
package/docs/README.md ADDED
@@ -0,0 +1,39 @@
1
+ # levi documentation
2
+
3
+ levi is an agentic kit. It installs ready-made workflows (**usecases**) and a shared **team** of role agents into your project, for Claude Code, with one command.
4
+
5
+ ## Getting started
6
+
7
+ 1. [Introduction](introduction.md): what levi is and how the pieces fit together
8
+ 2. [Installation](installation.md): requirements, `levi init`, what lands in your project
9
+ 3. [Usage](usage.md): how to invoke levi
10
+
11
+ ## Guides
12
+
13
+ - [Usecases](usecases.md): the usecases in the kit, with `brainstorming`, `spec-writing`, `design`, `create-feature`, `fix-bug`, `code-review` and `generate-test-scenarios` in detail
14
+ - [The team](team.md): the five role agents and the protocol they follow
15
+ - [Unattended runs](unattended-runs.md): asking everything up front, choices picked for you, and resuming after the 5-hour quota runs out
16
+ - [Updating](updating.md): `levi update`, how your edits are protected, `--force`
17
+ - [Customization](customization.md): adapt installed files to your project
18
+
19
+ ## Reference
20
+
21
+ - [CLI reference](cli.md): every command, option and exit code
22
+ - [Configuration and file layout](configuration.md): `.levi.json` and where each file is written
23
+ - [Authoring usecases](authoring-usecases.md): add a usecase or a team agent to the kit
24
+ - [Troubleshooting](troubleshooting.md): common problems and how to solve them
25
+ - [Contributing](contributing.md): conventions for changes to levi itself
26
+
27
+ ## Quick start
28
+
29
+ ```bash
30
+ npx levi-gear@latest init # install everything
31
+ ```
32
+
33
+ Then, in Claude Code:
34
+
35
+ ```text
36
+ /levi brainstorm how we should add CSV export to orders
37
+ ```
38
+
39
+ Keep it current with `npx levi-gear@latest update`.
@@ -0,0 +1,124 @@
1
+ # Authoring usecases
2
+
3
+ A usecase is a folder in the kit's `usecases/` directory. This page is for working on levi itself. If you only use levi in a project, see [Customization](customization.md).
4
+
5
+ ## Layout
6
+
7
+ ```text
8
+ usecases/<id>/
9
+ SKILL.md # entry point; frontmatter name: levi-<id>, description
10
+ references/, scripts/ # optional; copied along with the skill
11
+ agents/<role>.md # optional subagents; frontmatter name: levi-<id>-<role>, description
12
+
13
+ agents/<role>.md # team agents shared by all usecases; frontmatter name: levi-<role>
14
+ agents/_*.md # partials appended to every team agent
15
+ ```
16
+
17
+ Everything in the usecase folder except `agents/` is copied into the skill folder. `agents/` becomes Claude Code subagent files.
18
+
19
+ ## SKILL.md
20
+
21
+ Frontmatter fields:
22
+
23
+ | Field | Required | Meaning |
24
+ |---|---|---|
25
+ | `name` | yes | Must be exactly `levi-<id>`, where `<id>` is the folder name |
26
+ | `description` | yes | What the usecase does and which requests fit it |
27
+ | `argument-hint` | no | Shown by Claude Code, for example `"<problem or idea>"` |
28
+ | `requires` | no | Comma list of usecase ids this one builds on, for example `spec-writing, brainstorming`. Installing this usecase installs them too |
29
+ | `skill-for` | no | Comma list of team roles (`qa`, `pm`, ...) this usecase is the skill of. See [Role skills](#role-skills) |
30
+ | `skill-when` | with `skill-for` | The kind of task, completing "When ...", for example `you write or change test cases or test scenarios` |
31
+ | `skill-guide` | with `skill-for` | Path of the guide the role follows, relative to the usecase folder, for example `references/test-case-guide.md` |
32
+
33
+ The installer adds `disable-model-invocation: true` to the installed copy.
34
+
35
+ The `description` is what the `levi` entry point matches requests against, so state precisely what the usecase does and which requests it fits. English is fine; requests in other languages are matched by meaning.
36
+
37
+ The body is the workflow. Keep the workflow in this file: the entry point reads it directly, because manual-only skills cannot be called through a skill tool.
38
+
39
+ To reuse another usecase, list it in `requires` and tell the workflow to read its `SKILL.md` in the sibling folder (`levi-<id>/SKILL.md`) and follow it. Installed skills sit side by side in `.claude/skills/`.
40
+
41
+ A usecase may ship a Claude Code Workflow script (for example `workflow.js`) to run independent subagents from code. The Workflow tool calls it by its path in the skill folder. It is not a portable Node program. Give the skill a fallback for when no Workflow tool is available: the same steps run in order as subagent calls. See `usecases/create-feature/`.
42
+
43
+ ## Role skills
44
+
45
+ A usecase can be the skill a team role uses for one kind of task, in every usecase and not only its own: `generate-test-scenarios` is how `levi-qa` writes test cases, wherever it is asked to. Declare it in the frontmatter:
46
+
47
+ ```yaml
48
+ skill-for: qa
49
+ skill-when: you write or change test cases or test scenarios, or record their results
50
+ skill-guide: references/test-case-guide.md
51
+ ```
52
+
53
+ The installer then:
54
+
55
+ - installs the usecase with every install, since the team always is;
56
+ - adds a "Your skills" section to each named role's agent file, with the task and the guide's path in that tool's skill folder.
57
+
58
+ Write the guide so that it works on its own, whichever usecase calls the agent: what the prompt provides, the rules, the format of what the agent writes, and paths relative to the skill folder. Leave the workflow steps (asking the user, choosing files) in `SKILL.md`. Usecases that hand the role this task should point to the guide as well, and say only what is specific to them: the sources, the paths, what must be covered.
59
+
60
+ ## Agents
61
+
62
+ Both usecase agents and team agents use this frontmatter:
63
+
64
+ | Field | Required | Values |
65
+ |---|---|---|
66
+ | `name` | yes | `levi-<id>-<role>` for usecase agents; `levi-<role>` for team agents |
67
+ | `description` | yes | What the agent does and when it is used |
68
+ | `tools` | no | Comma list of `read`, `edit`, `execute`, `web`. Omit for the defaults |
69
+ | `model` | no | `strong`, `standard` or `fast`. Omit to inherit |
70
+ | `effort` | no | `low`, `medium`, `high`, `xhigh` or `max`. Omit to inherit |
71
+
72
+ How these map to Claude Code: see [Configuration and file layout](configuration.md#how-agent-fields-are-converted).
73
+
74
+ Rules:
75
+
76
+ - An explicit `tools` list cuts off MCP tools. Leave it out for agents that need a browser or other MCP servers.
77
+ - The installer appends a note to every subagent description so Claude Code delegates to it only through its usecase.
78
+ - A usecase id must not reuse a team role name (`pm`, `teamlead`, `developer`, `designer`, `qa`): `levi-<id>` would name both a skill and an agent.
79
+ - Agent names must be unique across the whole kit.
80
+ - `usecases/_run-rules.md` is not a usecase: it holds the run rules (ask everything first, pick instead of ask, quota guard) that the installer appends to every installed `SKILL.md`, and the installer adds `scripts/quota-check.mjs` to every skill folder for the quota guard. Do not restate those rules in a usecase (that includes the browser-tests question: a usecase with a browser step names the step and passes `browserTests` on, and the rules say how it is asked); when a step asks the user, say what the question is and let the rules decide when it is asked. See [Unattended runs](unattended-runs.md).
81
+ - Files in `agents/` whose names start with `_` are not agents. They are appended to every team agent. `_team-protocol.md` is one.
82
+
83
+ ## Delegating to the team
84
+
85
+ From the usecase's `SKILL.md`, call team agents by name (`levi-pm`, `levi-qa`, ...) and name the work folder they should use (`docs/levi/<slug>/` by default). Team agents do not call each other, so the workflow sequences them.
86
+
87
+ Tell each agent the exact paths to read and write. Agents have no memory of the conversation: a fresh call sees only the prompt you give it.
88
+
89
+ ## Validation
90
+
91
+ The kit is loaded and validated before every command writes anything. These fail with a message:
92
+
93
+ - `SKILL.md` missing, or `name` not equal to `levi-<id>`, or `description` missing;
94
+ - an agent whose `name` does not match its file, with no `description`, with an unknown `tools` value or with an unknown `model` tier;
95
+ - the same agent name defined twice, or a usecase id equal to a team role;
96
+ - a `requires` entry that names itself or a usecase missing from the kit;
97
+ - `skill-for` naming a role the team does not have, or without `skill-when` and `skill-guide`, or a `skill-guide` file that does not exist.
98
+
99
+ ## Conventions
100
+
101
+ - Write everything in the repository in English: usecase files, code, comments and docs. Requests to the entry point can still be in any language.
102
+ - Keep files focused; split a workflow into `references/` when it gets long.
103
+ - Do not add runtime dependencies. The CLI uses only Node's standard library.
104
+
105
+ ## Test
106
+
107
+ There is no repository-wide test suite. Test in a scratch project:
108
+
109
+ ```bash
110
+ mkdir /tmp/scratch && cd /tmp/scratch
111
+ node /path/to/levi-gear/bin/levi.js init
112
+ node /path/to/levi-gear/bin/levi.js status
113
+ ```
114
+
115
+ Inspect the generated files. Then change a generated file and run `status` and `update` to confirm that your edit is kept. When you can, run the usecase in Claude Code.
116
+
117
+ ## Release
118
+
119
+ ```bash
120
+ npm version <patch|minor>
121
+ npm publish
122
+ ```
123
+
124
+ The package publishes only `agents`, `bin`, `src` and `usecases` (the `files` list in `package.json`). `docs/` is not part of the package.
package/docs/cli.md ADDED
@@ -0,0 +1,99 @@
1
+ # CLI reference
2
+
3
+ ```text
4
+ levi <command>
5
+ ```
6
+
7
+ Run with `npx levi-gear@latest <command>` from the root of your project. All commands act on the current directory.
8
+
9
+ | Command | Purpose |
10
+ |---|---|
11
+ | [`init`](#levi-init) | Install usecases |
12
+ | [`update`](#levi-update) | Refresh installed files, keeping your changes |
13
+ | [`status`](#levi-status) | Show what `update` would do |
14
+ | [`list`](#levi-list) | List usecases in the kit |
15
+
16
+ Global options:
17
+
18
+ | Option | Effect |
19
+ |---|---|
20
+ | `-h`, `--help`, or no command | Print the help text |
21
+ | `-v`, `--version` | Print the package version |
22
+
23
+ An unknown command prints `Unknown command: <name>` followed by the help, and exits with code 1.
24
+
25
+ ## levi init
26
+
27
+ ```text
28
+ levi init [--tools claude,codex] [usecase...]
29
+ ```
30
+
31
+ The default target is Claude Code. Use `--tools codex` for Codex or
32
+ `--tools claude,codex` for both. Re-running `init` adds targets to an existing installation.
33
+
34
+ Installs usecases, the team agents and the `levi` entry point, and writes `.levi.json`.
35
+
36
+ | Argument | Meaning |
37
+ |---|---|
38
+ | `usecase...` | Usecases to install. Omit to install every usecase in the kit |
39
+
40
+ Behavior:
41
+
42
+ - Merges with an existing install: usecases already installed stay, named ones are added.
43
+ - Also installs the usecases a named usecase requires (`requires:` in its `SKILL.md`), for example `create-feature` brings `spec-writing`, `brainstorming` and `design`, and always installs the [role skills](team.md#role-skills) of the team agents.
44
+ - Never overwrites a file you changed or a path levi did not write; both are reported.
45
+ - Prints a summary, a file report and the invocation syntax.
46
+
47
+ Exit code 1 when `--tools` is passed (nothing is installed; the option was removed with Codex and Copilot support) or a usecase name is not in the kit (the others are still installed).
48
+
49
+ More: [Installation](installation.md).
50
+
51
+ ## levi update
52
+
53
+ ```text
54
+ levi update [--force [path...]]
55
+ ```
56
+
57
+ Refreshes installed files to the package version. Requires `.levi.json`; without it, prints `No .levi.json found. Run "levi init" first.` and exits with code 1.
58
+
59
+ | Option | Meaning |
60
+ |---|---|
61
+ | `--force` | Overwrite every file you changed with the kit version |
62
+ | `--force <path>...` | Overwrite only the given files. Paths are relative to the project root, as in the report |
63
+
64
+ Behavior: see the table in [Updating](updating.md#what-update-does-to-each-file). Only the usecases already installed are considered.
65
+
66
+ ## levi status
67
+
68
+ ```text
69
+ levi status
70
+ ```
71
+
72
+ Dry run of `update`. Prints what `update` would add, update and remove, and the files it would keep. Writes nothing, not even `.levi.json`. Requires `.levi.json`, with the same error and exit code as `update`.
73
+
74
+ ## levi list
75
+
76
+ ```text
77
+ levi list
78
+ ```
79
+
80
+ Prints each usecase of the kit: its id, the usecase's own agents and the usecases it requires (when it has any) and its description. Then prints the invocation syntax.
81
+
82
+ ```text
83
+ brainstorming
84
+ Brainstorm any problem or idea with the PM and Teamlead and turn it into an execution plan ...
85
+
86
+ Invoke with:
87
+ /levi <request> /levi-<usecase> <request>
88
+ ```
89
+
90
+ `list` shows what the kit offers, not what is installed. Installed usecases are the keys of `usecases` in `.levi.json`.
91
+
92
+ ## Exit codes
93
+
94
+ | Code | When |
95
+ |---|---|
96
+ | 0 | Success |
97
+ | 1 | Unknown command, `--tools` passed, usecase not in the kit, `update` or `status` without `.levi.json`, or an error while reading the kit or config |
98
+
99
+ Errors while loading the kit, such as a malformed agent file, are printed as a message and exit with code 1 before any file is written.
package/docs/codex.md ADDED
@@ -0,0 +1,35 @@
1
+ # Codex support
2
+
3
+ Install Codex files with `levi init --tools codex`, or install both targets with
4
+ `levi init --tools claude,codex`. On an existing Claude install, selecting Codex
5
+ adds it without removing Claude. `levi update` preserves the selected targets and
6
+ customized files.
7
+
8
+ Use `$levi <request>` to choose a usecase, or `$levi-<usecase> <request>` to
9
+ select one. Restart Codex if the installed skills or agents do not appear.
10
+ Multi-agent support and the capabilities required by the usecase must be enabled.
11
+ In `create-feature` and `fix-bug`, QA writes test cases on every run. The opening
12
+ round asks whether to run browser tests and accepts a limited scope. QA needs a
13
+ working app and an E2E runner or browser when you choose to run UI cases.
14
+
15
+ The generated agent TOML inherits the Codex model. It sets only
16
+ `model_reasoning_effort` when the source declares `effort`, mapping `max` to
17
+ `xhigh`. QA uses `high` effort to write or revise test cases and its default
18
+ effort to run them. The designer uses `high` to draw and correct a design when
19
+ it has no approved basis. For these overrides the skill passes
20
+ `"reasoning_effort": "high"` and `"fork_turns": "none"` to `spawn_agent`.
21
+
22
+ Codex workflows save a checkpoint under `docs/levi-runs/`. Code review saves it
23
+ outside the project in the system temporary directory because review must not
24
+ change the project. To continue an interrupted run, invoke `$levi` and give the
25
+ checkpoint path. If there are multiple incomplete runs, select the intended run.
26
+ On resume the skill reads the checkpoint history and the run's saved choices
27
+ under `docs/levi/<slug>/choices/`. It restores the browser decision and any
28
+ scope from `user-browser-tests.md`, reuses the opening answers, and checks the
29
+ working tree and any locked tests before continuing.
30
+
31
+ The checkpoint records the latest reported stage and next action. Before
32
+ continuing, verify the current files and any in-progress work; a checkpoint does
33
+ not prove that a subagent completed. Do not start a second coordinator while the
34
+ original is still active. The checkpoint helper prevents simultaneous writes;
35
+ an abandoned `.lock` directory requires investigation before removal.
@@ -0,0 +1,84 @@
1
+ # Configuration and file layout
2
+
3
+ ## .levi.json
4
+
5
+ levi keeps its state in `.levi.json` at the project root. There is nothing to configure by hand: `init` and `update` write it. Commit it.
6
+
7
+ ```json
8
+ {
9
+ "version": "0.1.0",
10
+ "targets": ["claude", "codex"],
11
+ "usecases": {
12
+ "brainstorming": {
13
+ "files": {
14
+ ".claude/skills/levi-brainstorming/SKILL.md": "3b1f...e9",
15
+ ".claude/skills/levi-brainstorming/...": "..."
16
+ }
17
+ }
18
+ },
19
+ "router": { "files": { ".claude/skills/levi/SKILL.md": "a07c...41" } },
20
+ "team": { "files": { ".claude/agents/levi-pm.md": "5d22...b0" } }
21
+ }
22
+ ```
23
+
24
+ | Field | Meaning |
25
+ |---|---|
26
+ | `version` | The package version that last wrote the file |
27
+ | `targets` | Installed platforms (`claude`, `codex`, or both); older configs default to Claude |
28
+ | `usecases.<id>.files` | Each file written for that usecase: its project-relative path and the SHA-256 of the content when levi wrote it |
29
+ | `router.files` | Files of the generated `levi` entry point |
30
+ | `team.files` | The team agent files |
31
+
32
+ The hash is how `update` tells your edits from untouched files. A path that is not listed in `.levi.json` is not managed by levi, and `update` will not overwrite or delete it.
33
+
34
+ Do not edit the hashes. Changing one makes `update` misjudge the file. To release a file from levi, see [Customization](customization.md#keeping-a-file-out-of-levi's-control).
35
+
36
+ A `tools` field left by earlier versions is ignored and dropped on the next `init` or `update`.
37
+
38
+ Configs from early versions listed files as an array without hashes. They still load; every file in such a config that differs from the kit counts as changed by you until you run `levi update --force`, after which hashes are recorded. See [Troubleshooting](troubleshooting.md).
39
+
40
+ ## Where files are written
41
+
42
+ ### Skills
43
+
44
+ `.claude/skills/levi/` is the entry point and `.claude/skills/levi-<usecase>/` holds each usecase.
45
+
46
+ Codex reads the corresponding entry point and usecases from `.agents/skills/`.
47
+
48
+ A usecase skill folder holds its `SKILL.md`, references and scripts. Claude Code also gets `scripts/quota-check.mjs` for the [quota guard](unattended-runs.md). Codex gets `scripts/codex-checkpoint.mjs` for [checkpoint recovery](codex.md) and follows the manual steps in `SKILL.md`.
49
+
50
+ ### Subagents
51
+
52
+ `.claude/agents/levi-<usecase>-<role>.md`, Markdown with frontmatter. Team agents follow the same pattern without the usecase: `levi-<role>`, for example `.claude/agents/levi-pm.md`.
53
+
54
+ Codex agents are TOML files in `.codex/agents/`.
55
+
56
+ ## Manual-only flag
57
+
58
+ Every levi skill is installed so Claude Code never triggers it on its own: the installed `SKILL.md` frontmatter carries `disable-model-invocation: true`.
59
+
60
+ For Codex, each skill has `agents/openai.yaml` with `allow_implicit_invocation: false`.
61
+
62
+ This is why the entry point reads a usecase's `SKILL.md` by path rather than calling it through a skill tool: manual-only skills cannot be called that way.
63
+
64
+ ## How agent fields are converted
65
+
66
+ Usecase and team agent source files use a small neutral format. The installer converts it to Claude Code frontmatter or Codex TOML.
67
+
68
+ | Field | Values | Claude Code | Codex |
69
+ |---|---|---|---|
70
+ | `tools` | `read`, `edit`, `execute`, `web`; omit for the defaults | `Read, Grep, Glob` / `Edit, Write` / `Bash` / `WebFetch, WebSearch` | Uses the Codex tool configuration |
71
+ | `model` | `strong`, `standard`, `fast`; omit to inherit | `opus` / `sonnet` / `haiku` | Omitted. The agent inherits the Codex model |
72
+ | `effort` | `low`, `medium`, `high`, `xhigh`, `max`; omit to inherit | `effort:` as is | `model_reasoning_effort` (`max` maps to `xhigh`) |
73
+
74
+ In Claude Code, an explicit `tools` list also cuts off MCP tools. That is why `levi-developer` and `levi-qa` leave `tools` out: they may need a browser or other MCP servers.
75
+
76
+ The default effort is `xhigh` for `levi-pm` and `levi-teamlead`, `high` for `levi-developer`, and `medium` for `levi-designer` and `levi-qa`. Claude Code uses the `strong` tier for the first three roles and `standard` for the other two. When QA writes or revises test cases, or the designer draws or corrects a design without an approved basis, both targets request `high` effort for that call. Claude Code also requests the `strong` tier. Codex sets only `reasoning_effort` and inherits the model.
77
+
78
+ ## Leftovers from earlier versions
79
+
80
+ Earlier versions could also install for GitHub Copilot. `levi update` removes obsolete tracked files for targets outside the current install, including legacy Codex files in a Claude-only install. It keeps and reports files you edited.
81
+
82
+ ## Work folders
83
+
84
+ Not part of the install. The usecases and team write their working files into your project while they run, by default under `docs/levi/<slug>/`, and usecase deliverables into their own folder (for example `docs/brainstorming/`). See [The team](team.md#the-work-folder).
@@ -0,0 +1,46 @@
1
+ # Contributing
2
+
3
+ This page covers changes to levi itself: the CLI, the team agents and the usecases. To add a usecase or an agent, start with [Authoring usecases](authoring-usecases.md).
4
+
5
+ ## Conventions
6
+
7
+ - Commit messages, branch names and pull requests are written in English, using short conventional prefixes: `feat:`, `fix:`, `docs:`.
8
+ - Everything in the repository is written in English: code, comments, usecase files and docs.
9
+ - No runtime dependencies. The CLI uses Node.js 18+ and its standard library only.
10
+
11
+ ## Repository layout
12
+
13
+ ```text
14
+ bin/levi.js # executable entry; calls src/cli.js
15
+ src/cli.js # command dispatch and help
16
+ src/commands/ # init, update, status, list
17
+ src/lib/ # kit loading, install planning, agent rendering, hashing
18
+ agents/ # team agents and the shared team protocol
19
+ usecases/<id>/ # one folder per usecase
20
+ docs/ # this documentation; not published to npm
21
+ ```
22
+
23
+ Where the logic lives:
24
+
25
+ | File | Responsibility |
26
+ |---|---|
27
+ | `src/lib/usecases.js` | Loads and validates usecases and the whole kit |
28
+ | `src/lib/agents.js` | Reads team agents, validates agent frontmatter |
29
+ | `src/lib/tools.js` | Install paths and agent rendering |
30
+ | `src/lib/desired-state.js` | Builds the set of files a clean install would contain |
31
+ | `src/lib/sync.js` | Compares that set with disk and `.levi.json`, then applies it |
32
+ | `src/lib/router.js` | Generates the `levi` entry point skill |
33
+ | `src/lib/config.js` | Reads and writes `.levi.json` |
34
+ | `src/lib/report.js` | Prints the install and update report |
35
+
36
+ ## Making a change
37
+
38
+ 1. Branch from `master`.
39
+ 2. Change the code, usecase or agent files.
40
+ 3. Try it in a scratch project: `node /path/to/levi-gear/bin/levi.js init`, then `status`, change a generated file, and `update`.
41
+ 4. Update the docs in `docs/` when behavior, commands or file layout change.
42
+ 5. Open a pull request.
43
+
44
+ ## Docs
45
+
46
+ The docs are plain Markdown in `docs/`, read on GitHub. Link between pages with relative links. When you change a command, update [CLI reference](cli.md) and the page that explains the behavior.
@@ -0,0 +1,45 @@
1
+ # Customization
2
+
3
+ Installed files are ordinary files in your repository. Edit them to fit the project.
4
+
5
+ ## Editing installed files
6
+
7
+ Open the file and change it. Examples:
8
+
9
+ - `.claude/agents/levi-qa.md`: add your project's test conventions, the E2E runner, naming rules for test cases.
10
+ - `.claude/agents/levi-developer.md`: state your stack, lint and build commands, folder conventions.
11
+ - `.claude/skills/levi-brainstorming/SKILL.md`: change where plans are written or how estimates are formatted.
12
+
13
+ `levi update` keeps files you changed and tells you which ones it kept. See [Updating](updating.md).
14
+
15
+ ### What you give up
16
+
17
+ levi does not merge. A file you changed stops receiving kit updates until you run `levi update --force <path>`. If the kit improves that file later, you will not get the improvement automatically. Run `levi status` after upgrading: it lists the files kept because of your edits, so you can compare them with the kit's version.
18
+
19
+ To see what changed in the kit version of a file you customized:
20
+
21
+ 1. Copy your file aside.
22
+ 2. `levi update --force <path>`.
23
+ 3. Diff the two and reapply your edits.
24
+
25
+ ## Keeping a file out of levi's control
26
+
27
+ To make a file entirely yours, copy it to a name without the `levi-` prefix and use that copy.
28
+
29
+ ```bash
30
+ cp .claude/agents/levi-qa.md .claude/agents/our-qa.md
31
+ ```
32
+
33
+ Then change the `name:` in the copy to match. A copy is not managed by levi:
34
+
35
+ - it is not manual-only unless you set that yourself;
36
+ - the `/levi` entry point does not list or pick it;
37
+ - `update` never touches it.
38
+
39
+ ## Per-project usecase behavior
40
+
41
+ You usually do not need to fork a usecase. The workflows read the project they run in: an existing spec in `docs/specs/`, existing conventions, the language of your request. Put the project's rules where the agents will read them (`CLAUDE.md`, or the agent files above) before editing workflows.
42
+
43
+ ## Adding your own usecase
44
+
45
+ A new usecase belongs in the kit, not in your project, so that it is installed and updated like the others. See [Authoring usecases](authoring-usecases.md).