levi-gear 0.4.0 → 0.6.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 (45) hide show
  1. package/README.md +31 -35
  2. package/docs/README.md +39 -0
  3. package/docs/authoring-usecases.md +123 -0
  4. package/docs/cli.md +99 -0
  5. package/docs/codex.md +23 -0
  6. package/docs/configuration.md +81 -0
  7. package/docs/contributing.md +46 -0
  8. package/docs/customization.md +45 -0
  9. package/docs/installation.md +82 -0
  10. package/docs/introduction.md +49 -0
  11. package/docs/team.md +143 -0
  12. package/docs/troubleshooting.md +63 -0
  13. package/docs/unattended-runs.md +49 -0
  14. package/docs/updating.md +109 -0
  15. package/docs/usage.md +62 -0
  16. package/docs/usecases.md +460 -0
  17. package/package.json +4 -3
  18. package/src/cli.js +3 -3
  19. package/src/commands/init.js +20 -25
  20. package/src/commands/list.js +3 -5
  21. package/src/commands/status.js +1 -1
  22. package/src/commands/update.js +4 -4
  23. package/src/lib/agents.js +1 -1
  24. package/src/lib/desired-state.js +62 -31
  25. package/src/lib/sync.js +3 -3
  26. package/src/lib/tools.js +10 -81
  27. package/src/runtime/codex-checkpoint.mjs +48 -0
  28. package/src/runtime/quota-check.mjs +21 -142
  29. package/usecases/_run-rules.md +13 -20
  30. package/usecases/brainstorming/SKILL.md +0 -4
  31. package/usecases/code-review/SKILL.md +0 -4
  32. package/usecases/create-feature/SKILL.md +3 -4
  33. package/usecases/create-feature/scripts/lock-tests.mjs +21 -8
  34. package/usecases/design/SKILL.md +0 -4
  35. package/usecases/fix-bug/SKILL.md +3 -4
  36. package/usecases/generate-test-scenarios/SKILL.md +0 -5
  37. package/usecases/spec-writing/SKILL.md +0 -4
  38. package/src/runtime/codex-run-state.mjs +0 -156
  39. package/usecases/brainstorming/references/codex-runner.md +0 -28
  40. package/usecases/code-review/references/codex-runner.md +0 -5
  41. package/usecases/create-feature/references/codex-runner.md +0 -57
  42. package/usecases/design/references/codex-runner.md +0 -27
  43. package/usecases/fix-bug/references/codex-runner.md +0 -32
  44. package/usecases/generate-test-scenarios/references/codex-runner.md +0 -32
  45. package/usecases/spec-writing/references/codex-runner.md +0 -25
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 your AI coding tools: 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 in Claude Code, Codex and GitHub Copilot alike.
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
- - **One kit, three tools.** A usecase is written once and installed as native skills and subagents for Claude Code, Codex and GitHub Copilot.
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 your tool 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
 
@@ -19,33 +19,32 @@
19
19
  ## Install into a project
20
20
 
21
21
  ```bash
22
- npx levi-gear@latest init # all usecases, all tools
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 claude,codex # only some tools
24
+ npx levi-gear@latest init --tools codex # Codex skills and agents
25
+ npx levi-gear@latest init --tools claude,codex # both
25
26
  ```
26
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
+
27
30
  Installed files are recorded in `.levi.json`. Commit the generated folders and `.levi.json` so teammates get everything by cloning.
28
31
 
29
32
  ## Commands
30
33
 
31
34
  | Command | What it does |
32
35
  |---|---|
33
- | `levi init [usecase...] [--tools claude,codex,copilot]` | Install usecases (all by default) for the chosen tools |
36
+ | `levi init [usecase...]` | Install usecases (all by default) |
34
37
  | `levi update [--force [path...]]` | Refresh installed files to this package version, keeping files you changed |
35
38
  | `levi status` | Show what `update` would do, without changing anything |
36
39
  | `levi list` | List usecases in the kit and print how to invoke them |
37
40
 
38
41
  ## Using it
39
42
 
40
- levi only runs when you ask for it. A prompt that does not start with the levi command is handled by your tool as usual.
41
-
42
- | Tool | Let levi pick the usecase | Call a usecase directly |
43
- |---|---|---|
44
- | Claude Code | `/levi <request>` | `/levi-<usecase> <request>` |
45
- | Copilot | `/levi <request>` | `/levi-<usecase> <request>` |
46
- | Codex | `$levi <request>` | `$levi-<usecase> <request>` |
43
+ levi only runs when you ask for it. In Codex use `$levi` and `$levi-<usecase>`; the table below shows the Claude Code form.
47
44
 
48
- Codex has no user-defined `/` commands in a repo, so it uses `$` instead. `levi init`, `update` and `list` print the right syntax for the tools you installed.
45
+ | Let levi pick the usecase | Call a usecase directly |
46
+ |---|---|
47
+ | `/levi <request>` | `/levi-<usecase> <request>` |
49
48
 
50
49
  `levi <request>` is an entry point generated at install time from the installed usecases. It matches the request (in any language) against each usecase description, runs the best match (naming the runner-up when it was close, so you can call that one directly), and tells you when none fits.
51
50
 
@@ -65,7 +64,7 @@ Each agent does only its own role's work and writes only the files it owns; work
65
64
 
66
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`.
67
66
 
68
- 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`. On Codex, every installed skill also gets a small `scripts/codex-run-state.mjs` helper; long runs record `run.json` in that work folder so they can resume after an interruption. 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).
69
68
 
70
69
  ## Update
71
70
 
@@ -89,11 +88,11 @@ levi does not merge: a file you changed is yours from then on and stops receivin
89
88
 
90
89
  ## Where things go
91
90
 
92
- | Tool | Skill | Subagents |
93
- |---|---|---|
94
- | Claude Code | `.claude/skills/levi/`, `.claude/skills/levi-<usecase>/` | `.claude/agents/levi-<usecase>-<role>.md` |
95
- | Codex | `.agents/skills/levi/`, `.agents/skills/levi-<usecase>/` | `.codex/agents/levi-<usecase>-<role>.toml` |
96
- | Copilot | reads `.claude/skills` and `.agents/skills` (gets `.agents/skills` itself only if Claude is not selected) | `.github/agents/levi-<usecase>-<role>.agent.md` |
91
+ | Skill | Subagents |
92
+ |---|---|
93
+ | `.claude/skills/levi/`, `.claude/skills/levi-<usecase>/` | `.claude/agents/levi-<usecase>-<role>.md` |
94
+
95
+ For Codex, skills are installed under `.agents/skills/` and agent definitions under `.codex/agents/`.
97
96
 
98
97
  ## Authoring a usecase
99
98
 
@@ -109,19 +108,18 @@ agents/_*.md # partials appended to every team agent
109
108
 
110
109
  Agent frontmatter (usecase and team agents alike):
111
110
 
112
- | Field | Values | Claude Code | Codex | Copilot |
113
- |---|---|---|---|---|
114
- | `name`, `description` | required | as is | as is | as is |
115
- | `tools` | comma list of `read`, `edit`, `execute`, `web`; omit for the tool's defaults | `Read, Grep, Glob` / `Edit, Write` / `Bash` / `WebFetch, WebSearch` | `sandbox_mode = "read-only"` without `edit`/`execute`, else `"workspace-write"` | `read, search` / `edit` / `execute` / `web` |
116
- | `model` | `strong`, `standard`, `fast`; omit to inherit | `opus` / `sonnet` / `haiku` | `model_reasoning_effort` `high` / `medium` / `low` | not set (keeps the user's model) |
111
+ | Field | Values | Claude Code |
112
+ |---|---|---|
113
+ | `name`, `description` | required | as is |
114
+ | `tools` | comma list of `read`, `edit`, `execute`, `web`; omit for the defaults | `Read, Grep, Glob` / `Edit, Write` / `Bash` / `WebFetch, WebSearch` |
115
+ | `model` | `strong`, `standard`, `fast`; omit to inherit | `opus` / `sonnet` / `haiku` |
117
116
 
118
- An explicit `tools` list also cuts off MCP tools on Claude Code and Copilot, so leave it out for agents that need a browser or other MCP servers.
117
+ An explicit `tools` list also cuts off MCP tools, so leave it out for agents that need a browser or other MCP servers.
119
118
 
120
- - Every usecase is manual-only: the installer sets `disable-model-invocation: true` in the installed `SKILL.md` (Claude Code, Copilot) and writes `agents/openai.yaml` with `allow_implicit_invocation: false` (Codex). The tool never triggers it by itself.
119
+ - 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.
121
120
  - 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.
122
121
  - The entry point reads a chosen usecase's `SKILL.md` directly, because manual-only skills cannot be called through a skill tool. Keep the workflow in that file.
123
- - The installer appends a note to each subagent description so the tool delegates to it only through its usecase.
124
- - Subagent files use the same format for every tool; the installer converts them (Codex needs TOML).
122
+ - The installer appends a note to each subagent description so Claude Code delegates to it only through its usecase.
125
123
  - Delegate to team agents by name (`levi-pm`, `levi-qa`, ...) from the usecase's `SKILL.md`, and name the work folder they should use. A usecase id must not reuse a team role name.
126
124
  - Write everything in the repo in English: usecase files, code, comments and docs. Requests to the entry point can still be in any language.
127
125
  - Test in a scratch project with `node /path/to/levi-gear/bin/levi.js init`, then `npm version <patch|minor>` and `npm publish`.
@@ -136,11 +134,9 @@ Commit messages, branch names and pull requests are written in English, using sh
136
134
 
137
135
  ## Status
138
136
 
139
- Checked in the real clients (Claude Code 2.1.276, Codex 0.154.0 and GitHub Copilot CLI 1.0.91):
137
+ Checked in Claude Code 2.1.276:
140
138
 
141
139
  - The installed skills and agents are picked up.
142
140
  - A prompt without the levi command does not use levi.
143
- - `/levi` (Claude Code, Copilot) and `$levi` (Codex) route a request to the matching usecase.
144
- - The team agents run when a usecase delegates to them (Claude Code and Copilot run the full `brainstorming` flow; Codex runs a team agent when asked).
145
-
146
- Not checked yet: the Copilot extension in VS Code. The Copilot CLI was tested with a non-interactive prompt, so try `/levi` interactively once to see it in the `/` menu.
141
+ - `/levi` routes a request to the matching usecase.
142
+ - The team agents run when a usecase delegates to them (the full `brainstorming` flow runs).
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,123 @@
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
+
71
+ How these map to Claude Code: see [Configuration and file layout](configuration.md#how-agent-fields-are-converted).
72
+
73
+ Rules:
74
+
75
+ - An explicit `tools` list cuts off MCP tools. Leave it out for agents that need a browser or other MCP servers.
76
+ - The installer appends a note to every subagent description so Claude Code delegates to it only through its usecase.
77
+ - 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.
78
+ - Agent names must be unique across the whole kit.
79
+ - `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; 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).
80
+ - Files in `agents/` whose names start with `_` are not agents. They are appended to every team agent. `_team-protocol.md` is one.
81
+
82
+ ## Delegating to the team
83
+
84
+ 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.
85
+
86
+ 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.
87
+
88
+ ## Validation
89
+
90
+ The kit is loaded and validated before every command writes anything. These fail with a message:
91
+
92
+ - `SKILL.md` missing, or `name` not equal to `levi-<id>`, or `description` missing;
93
+ - an agent whose `name` does not match its file, with no `description`, with an unknown `tools` value or with an unknown `model` tier;
94
+ - the same agent name defined twice, or a usecase id equal to a team role;
95
+ - a `requires` entry that names itself or a usecase missing from the kit;
96
+ - `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.
97
+
98
+ ## Conventions
99
+
100
+ - Write everything in the repository in English: usecase files, code, comments and docs. Requests to the entry point can still be in any language.
101
+ - Keep files focused; split a workflow into `references/` when it gets long.
102
+ - Do not add runtime dependencies. The CLI uses only Node's standard library.
103
+
104
+ ## Test
105
+
106
+ There is no repository-wide test suite. Test in a scratch project:
107
+
108
+ ```bash
109
+ mkdir /tmp/scratch && cd /tmp/scratch
110
+ node /path/to/levi-gear/bin/levi.js init
111
+ node /path/to/levi-gear/bin/levi.js status
112
+ ```
113
+
114
+ 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.
115
+
116
+ ## Release
117
+
118
+ ```bash
119
+ npm version <patch|minor>
120
+ npm publish
121
+ ```
122
+
123
+ 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,23 @@
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
+ QA needs a working app and an E2E runner or browser for UI cases.
12
+
13
+ Codex workflows save a checkpoint under `docs/levi-runs/`. Code review saves it
14
+ outside the project in the system temporary directory because review must not
15
+ change the project. To continue an interrupted run, invoke `$levi` and give the
16
+ checkpoint path. If there are multiple incomplete runs, select the intended run.
17
+ Check the working tree and any locked tests before continuing.
18
+
19
+ The checkpoint records the latest reported stage and next action. Before
20
+ continuing, verify the current files and any in-progress work; a checkpoint does
21
+ not prove that a subagent completed. Do not start a second coordinator while the
22
+ original is still active. The checkpoint helper prevents simultaneous writes;
23
+ an abandoned `.lock` directory requires investigation before removal.
@@ -0,0 +1,81 @@
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 skill folder holds the usecase's `SKILL.md` plus everything else in the usecase folder except `agents/` (references, scripts). Every skill folder also gets `scripts/quota-check.mjs`, the quota guard helper described in [Unattended runs](unattended-runs.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.
67
+
68
+ | Field | Values | Claude Code |
69
+ |---|---|---|
70
+ | `tools` | `read`, `edit`, `execute`, `web`; omit for the defaults | `Read, Grep, Glob` / `Edit, Write` / `Bash` / `WebFetch, WebSearch` |
71
+ | `model` | `strong`, `standard`, `fast`; omit to inherit | `opus` / `sonnet` / `haiku` |
72
+
73
+ 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.
74
+
75
+ ## Leftovers from earlier versions
76
+
77
+ Earlier versions could also install for Codex and GitHub Copilot, into `.agents/skills/`, `.codex/agents/` and `.github/agents/`. The next `levi update` removes those files when you did not edit them and keeps (and reports) the ones you did.
78
+
79
+ ## Work folders
80
+
81
+ 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).