levi-gear 0.5.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.
- package/README.md +12 -6
- package/docs/README.md +39 -0
- package/docs/authoring-usecases.md +123 -0
- package/docs/cli.md +99 -0
- package/docs/codex.md +23 -0
- package/docs/configuration.md +81 -0
- package/docs/contributing.md +46 -0
- package/docs/customization.md +45 -0
- package/docs/installation.md +82 -0
- package/docs/introduction.md +49 -0
- package/docs/team.md +143 -0
- package/docs/troubleshooting.md +63 -0
- package/docs/unattended-runs.md +49 -0
- package/docs/updating.md +109 -0
- package/docs/usage.md +62 -0
- package/docs/usecases.md +460 -0
- package/package.json +4 -3
- package/src/cli.js +2 -2
- package/src/commands/init.js +20 -10
- package/src/commands/list.js +1 -1
- package/src/commands/update.js +2 -2
- package/src/lib/desired-state.js +51 -5
- package/src/lib/sync.js +1 -1
- package/src/lib/tools.js +1 -1
- package/src/runtime/codex-checkpoint.mjs +48 -0
- package/usecases/create-feature/scripts/lock-tests.mjs +21 -8
package/README.md
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# levi-gear
|
|
2
2
|
|
|
3
|
-
**Gather a whole software team into your terminal.** levi
|
|
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
|
-
- **
|
|
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
|
-
- **
|
|
13
|
-
- **Quiet until called.** levi
|
|
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.
|
|
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
|
|---|---|
|
|
@@ -60,7 +64,7 @@ Each agent does only its own role's work and writes only the files it owns; work
|
|
|
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.
|
|
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
|
```
|
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).
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Installation
|
|
2
|
+
|
|
3
|
+
## Requirements
|
|
4
|
+
|
|
5
|
+
- Node.js 18 or newer
|
|
6
|
+
- A project folder where you use Claude Code or Codex
|
|
7
|
+
|
|
8
|
+
levi is not installed globally. You run it with `npx` from the root of your project.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx levi-gear@latest init
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
This installs every usecase in the kit. Run it from the project root: levi writes into the current directory.
|
|
17
|
+
|
|
18
|
+
To install for Codex, use `npx levi-gear@latest init --tools codex`; use
|
|
19
|
+
`--tools claude,codex` for both. See [Codex support](codex.md) for prerequisites
|
|
20
|
+
and recovery limitations.
|
|
21
|
+
|
|
22
|
+
### Choose usecases
|
|
23
|
+
|
|
24
|
+
Name the usecases to install; leave them out to install all.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx levi-gear@latest init brainstorming
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
See which usecases exist with `npx levi-gear@latest list`.
|
|
31
|
+
|
|
32
|
+
## What `init` does
|
|
33
|
+
|
|
34
|
+
1. Reads the kit and validates it, so a broken file fails before anything is written.
|
|
35
|
+
2. Writes:
|
|
36
|
+
- a skill folder per usecase (`levi-<usecase>/`);
|
|
37
|
+
- the generated entry point `levi/`;
|
|
38
|
+
- subagent files for the usecase's own agents and for the five team agents.
|
|
39
|
+
3. Marks every skill as manual-only.
|
|
40
|
+
4. Writes `.levi.json` with the installed usecases and a hash of every file written.
|
|
41
|
+
5. Prints a summary and the invocation syntax.
|
|
42
|
+
|
|
43
|
+
Example output:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
Installed 1 usecase(s) for Claude Code
|
|
47
|
+
- brainstorming
|
|
48
|
+
Added 21, updated 0, removed 0 file(s).
|
|
49
|
+
|
|
50
|
+
Invoke with:
|
|
51
|
+
/levi <request> /levi-<usecase> <request>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The exact file count depends on the kit version. For the full list of paths, see [Configuration and file layout](configuration.md).
|
|
55
|
+
|
|
56
|
+
## Commit the result
|
|
57
|
+
|
|
58
|
+
Commit the generated folders and `.levi.json`. Teammates then get everything by cloning, and `.levi.json` lets anyone run `levi update` later without overwriting local edits.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git add .claude .levi.json
|
|
62
|
+
git commit -m "chore: install levi"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Running `init` again
|
|
66
|
+
|
|
67
|
+
`init` is safe to repeat. It merges with what is installed:
|
|
68
|
+
|
|
69
|
+
- **Add a usecase:** `levi init <usecase>` keeps the usecases you already have and adds the new one.
|
|
70
|
+
- **Files you changed** are never overwritten by `init`. They are reported as kept. Use [`update --force`](updating.md#taking-the-kit-version-of-a-file) to take the kit version.
|
|
71
|
+
- **A path that already exists** and was not written by levi is kept as is and reported as a conflict.
|
|
72
|
+
|
|
73
|
+
## Errors
|
|
74
|
+
|
|
75
|
+
| Message | Cause |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `Unknown tool; choose claude or codex` | An unsupported value was supplied to `--tools`. Nothing is installed. |
|
|
78
|
+
| `Not found in kit: x` | A usecase name does not exist. The other usecases named are still installed; the command exits with code 1. |
|
|
79
|
+
|
|
80
|
+
## Uninstall
|
|
81
|
+
|
|
82
|
+
There is no uninstall command. To remove levi, delete the files it wrote as recorded in `.levi.json`, then remove that configuration file. Depending on the selected targets, managed files live under `.claude/skills/`, `.claude/agents/`, `.agents/skills/` and `.codex/agents/`.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Introduction
|
|
2
|
+
|
|
3
|
+
levi is an npm package that installs **Agent Skills** and **subagents** into a project, so that Claude Code can run team workflows. It has no runtime dependencies and needs Node.js 18 or newer.
|
|
4
|
+
|
|
5
|
+
## The pieces
|
|
6
|
+
|
|
7
|
+
| Piece | What it is | Who runs it |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| **Usecase** | A self-contained workflow, written as a skill (`SKILL.md`), optionally with its own subagents and reference files. Example: `brainstorming`. | You, by calling it |
|
|
10
|
+
| **Team agents** | Five shared role agents (PM, teamlead, developer, designer, QA) that usecases delegate to. | A usecase, never you directly |
|
|
11
|
+
| **Entry point** | A generated skill named `levi` that reads your request and runs the best matching usecase. | You, by calling it |
|
|
12
|
+
| **`.levi.json`** | A record of what was installed and a hash of each file, so updates never overwrite your edits. | The CLI |
|
|
13
|
+
|
|
14
|
+
A usecase is the *what*: the steps to follow. The team is the *who*: the roles that carry the steps out. The usecase's skill runs the team by calling each member in turn.
|
|
15
|
+
|
|
16
|
+
## Design principles
|
|
17
|
+
|
|
18
|
+
**Manual only.** levi never runs by itself. Every installed skill is marked so that Claude Code does not trigger it on its own. A prompt that does not start with the levi command is handled by Claude Code as usual.
|
|
19
|
+
|
|
20
|
+
**Built for Claude Code.** You write a usecase once. The installer writes it as a Claude Code skill folder and subagent files.
|
|
21
|
+
|
|
22
|
+
**Your files are yours.** Installed files are plain files in your repository. You can edit them. `levi update` keeps every file you changed and only refreshes the ones you did not touch.
|
|
23
|
+
|
|
24
|
+
**Files as the hand-off.** Team members do not see each other's conversation. They pass work through files in a work folder. See [The team](team.md).
|
|
25
|
+
|
|
26
|
+
## How a request flows
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
you: /levi break "export orders as CSV" into tasks
|
|
30
|
+
│
|
|
31
|
+
▼
|
|
32
|
+
levi (entry point) ── matches the request to a usecase description
|
|
33
|
+
│
|
|
34
|
+
▼
|
|
35
|
+
levi-brainstorming ── the usecase's SKILL.md is the workflow
|
|
36
|
+
│ calls in turn
|
|
37
|
+
├──▶ levi-pm frames the problem
|
|
38
|
+
├──▶ levi-teamlead explores approaches, breaks down the work
|
|
39
|
+
└──▶ levi-pm writes the final plan
|
|
40
|
+
│
|
|
41
|
+
▼
|
|
42
|
+
docs/brainstorming/export-orders-csv.md
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
You can skip the entry point and call the usecase directly: `/levi-brainstorming <request>`.
|
|
46
|
+
|
|
47
|
+
## Supported tool
|
|
48
|
+
|
|
49
|
+
levi supports Claude Code only: skills are read from `.claude/skills/` and subagents from `.claude/agents/`. Earlier versions also supported Codex and GitHub Copilot; see [Leftovers from earlier versions](configuration.md#leftovers-from-earlier-versions) if you installed for them.
|