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.
- package/README.md +21 -14
- package/agents/designer.md +1 -0
- package/agents/developer.md +2 -1
- package/agents/pm.md +2 -1
- package/agents/qa.md +2 -1
- package/agents/teamlead.md +1 -0
- package/docs/README.md +39 -0
- package/docs/authoring-usecases.md +124 -0
- package/docs/cli.md +99 -0
- package/docs/codex.md +35 -0
- package/docs/configuration.md +84 -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 +51 -0
- package/docs/updating.md +109 -0
- package/docs/usage.md +62 -0
- package/docs/usecases.md +471 -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/agents.js +6 -1
- package/src/lib/desired-state.js +65 -5
- package/src/lib/sync.js +1 -1
- package/src/lib/tools.js +4 -3
- package/src/runtime/codex-checkpoint.mjs +48 -0
- package/usecases/_run-rules.md +10 -1
- package/usecases/create-feature/SKILL.md +20 -15
- package/usecases/create-feature/scripts/lock-tests.mjs +21 -8
- package/usecases/create-feature/workflow.js +49 -29
- package/usecases/design/SKILL.md +18 -3
- package/usecases/fix-bug/SKILL.md +16 -13
- package/usecases/fix-bug/workflow.js +47 -28
- package/usecases/generate-test-scenarios/SKILL.md +4 -4
- package/usecases/generate-test-scenarios/references/test-case-guide.md +1 -1
package/docs/usecases.md
ADDED
|
@@ -0,0 +1,471 @@
|
|
|
1
|
+
# Usecases
|
|
2
|
+
|
|
3
|
+
A usecase is a self-contained workflow, installed as a skill named `levi-<id>`. This page lists the usecases in the kit. Run `npx levi-gear@latest list` for the list in the version you have.
|
|
4
|
+
|
|
5
|
+
| Usecase | What it does |
|
|
6
|
+
|---|---|
|
|
7
|
+
| [`brainstorming`](#brainstorming) | Turns a problem or idea into an execution plan: small tasks, an owning agent and an hour estimate for each |
|
|
8
|
+
| [`spec-writing`](#spec-writing) | Writes or updates a spec with the PM: it asks about everything unclear first and writes only what you confirmed |
|
|
9
|
+
| [`design`](#design) | Draws SVG designs with the Designer from a text description, images or videos you upload, or both |
|
|
10
|
+
| [`create-feature`](#create-feature) | Builds a feature spec first and test first: the tests from the spec are locked, QA's test cases are QA's alone, and the code is fixed until the tests pass, the teamlead approves, and, if you choose browser tests, every test case passes end to end |
|
|
11
|
+
| [`fix-bug`](#fix-bug) | Fixes a bug in merged code: the developer clarifies it with you, then fixes it test first while QA writes scenarios; the teamlead reviews and, if you choose browser tests, QA tests end to end until everything passes |
|
|
12
|
+
| [`code-review`](#code-review) | The teamlead reviews a pull request, a branch, commits, files or your uncommitted changes for security (OWASP Top 10), performance and correctness, and suggests a fix for every finding. Nothing is changed |
|
|
13
|
+
| [`generate-test-scenarios`](#generate-test-scenarios) | QA writes screen-level test cases from the feature specs alone, as Markdown and an Excel sheet in `docs/tests/`, and lists where the spec is unclear. Specs are never changed |
|
|
14
|
+
|
|
15
|
+
Four of them are also the skills of team roles, and are installed with every install: `spec-writing` (PM), `design` (designer), `code-review` (teamlead) and `generate-test-scenarios` (QA). See [Role skills](team.md#role-skills).
|
|
16
|
+
|
|
17
|
+
To write your own, see [Authoring usecases](authoring-usecases.md).
|
|
18
|
+
|
|
19
|
+
## Browser tests are optional
|
|
20
|
+
|
|
21
|
+
Running test cases in a headless browser is slow, so `create-feature` and `fix-bug` ask you once, in the first round of questions of the run (with the other opening questions, or alone when there are none), whether to run them:
|
|
22
|
+
|
|
23
|
+
- **Do not run browser tests** (recommended): much faster. Unit and integration tests (without any test that opens a browser, in the new tests and in the suite the gate runs) and the code review still run, and QA still writes the test cases so you can run them later. The test cases stay in `docs/tests/` without a result.
|
|
24
|
+
- **Run the full E2E suite**: after the review approves, QA runs every test case in a headless browser (through the API or CLI when there is no UI) and failures go back to the developer.
|
|
25
|
+
|
|
26
|
+
You can also answer in your own words, for example to run only some cases; the run follows that and reports the others as not run. When the question is skipped because your request already says what you want, that is used. The answer is kept in `docs/levi/<slug>/choices/user-browser-tests.md` and in the handoff report, so a resumed run never asks again, and the final report says "Browser tests: not run (the user chose this)" with the list of test cases that were not run. A usecase's workflow receives the answer as `browserTests` (`true` or `false`; missing means `false`) and, for a limited run, `browserScope`. The render check of `design` is not a test and is not affected.
|
|
27
|
+
|
|
28
|
+
## brainstorming
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
/levi-brainstorming <problem or idea to brainstorm>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Brainstorm any problem with the PM and the teamlead and end up with a plan. The problem can be anything the team could work on: a feature, a refactor, a migration, a process change.
|
|
35
|
+
|
|
36
|
+
Fits requests such as "brainstorm X", "how should we approach X" and "break X into tasks and estimate it".
|
|
37
|
+
|
|
38
|
+
### What you get
|
|
39
|
+
|
|
40
|
+
One file, `docs/brainstorming/<slug>.md`, written in the language of your request. `<slug>` is a short kebab-case English name derived from the problem, for example `export-orders-csv`.
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
# Export orders as CSV
|
|
44
|
+
|
|
45
|
+
- **Total estimate:** 14.5 hours
|
|
46
|
+
- **Agents:** levi-pm, levi-teamlead, levi-developer, levi-qa
|
|
47
|
+
|
|
48
|
+
## Tasks
|
|
49
|
+
|
|
50
|
+
| # | Task | Agent | Estimate (h) | Depends on |
|
|
51
|
+
|---|---|---|---|---|
|
|
52
|
+
| 1 | Define the CSV columns and limits | levi-pm | 1 | - |
|
|
53
|
+
| 2 | Design the export endpoint | levi-teamlead | 2 | 1 |
|
|
54
|
+
| 3 | Implement the endpoint with tests | levi-developer | 6 | 2 |
|
|
55
|
+
|
|
56
|
+
## Notes
|
|
57
|
+
|
|
58
|
+
Chosen approach, what was rejected, assumptions, the riskiest task.
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- The **total** is the sum of the task estimates. It is agent working time, not calendar time, so parallel tasks are still added up.
|
|
62
|
+
- An **estimate** is the hours the assigned agent needs, including checking its own work, in steps of 0.5 hours. It does not include waiting for you.
|
|
63
|
+
- **Agents** lists each agent that owns at least one task, once.
|
|
64
|
+
- **Depends on** lists only dependencies that cannot be removed. Tasks are cut to be as independent as possible so that they can run in parallel; when several tasks need the same thing (a data model, an interface, a shared component), it becomes one small foundation task that the others depend on, instead of a chain of tasks waiting on each other.
|
|
65
|
+
- **Notes** appears only when there is something to add, and never holds an undecided point.
|
|
66
|
+
|
|
67
|
+
### Several features: a plan in phases
|
|
68
|
+
|
|
69
|
+
When the problem holds several features, the plan is cut into phases so that development stays small and every release runs by itself:
|
|
70
|
+
|
|
71
|
+
- **Phase 1 is the MVP**: the basic version of every feature the core flow needs, nothing optional.
|
|
72
|
+
- **Each later phase completes one feature**, in order of value and then risk.
|
|
73
|
+
- **Each phase is a release that works on its own.** No phase needs anything from a later phase, and a later phase extends the earlier ones. Every phase ends with its own QA and release-check tasks.
|
|
74
|
+
|
|
75
|
+
The plan then has a phase table and one task table per phase, with a release check for each phase. A problem with one feature, or with no sensible cut, gets the flat plan above. The PM writes `phases.md` (scratch) before the teamlead breaks the work down.
|
|
76
|
+
|
|
77
|
+
The table above is illustrative. A real plan also includes design, review, QA and acceptance tasks, not only implementation.
|
|
78
|
+
|
|
79
|
+
### How it works
|
|
80
|
+
|
|
81
|
+
| Step | Who | What happens |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| 1. Intake | workflow | Reads your request, derives the slug. An empty request makes it ask what to brainstorm. |
|
|
84
|
+
| 2. Find the spec | workflow | Looks in `docs/specs/` for a file matching the problem. One clear match is used as the basis; several plausible ones make it ask you; none means the PM frames the problem itself. |
|
|
85
|
+
| 3. Frame | `levi-pm` | With a spec: reads it and returns only the gaps that matter. Without: writes a short `brief.md` (goal, scope, what done looks like, open questions). |
|
|
86
|
+
| 4. Explore | `levi-teamlead` | Writes two or three genuinely different approaches with trade-offs and a recommendation, and lists the forks only you can decide. |
|
|
87
|
+
| 5. Ask you once | workflow | Merges the questions from steps 3 and 4 and asks them in one round, each with two to four options and the recommended one first. |
|
|
88
|
+
| 6. Finalize | PM and teamlead | The teamlead picks the approach and writes the task breakdown, cut so tasks are as independent as possible; the PM folds your answers into the brief. |
|
|
89
|
+
| 7. Plan | `levi-pm` | Checks that every goal and done-criterion is covered by a task, decides the owner of each task and writes the plan. |
|
|
90
|
+
| 8. Review (hard plans) | fresh agent calls | Plans with more than 10 tasks get one independent review: the teamlead writes its decisions to `review.md`, then the PM applies them and checks the result. See below. |
|
|
91
|
+
| 9. Clean up | workflow | Deletes the scratch files. Only the plan is left. |
|
|
92
|
+
| 10. Report | workflow | Tells you the plan path, the spec used, the total hours, the agents, and any assumption taken. |
|
|
93
|
+
|
|
94
|
+
### Hard plans get a second review
|
|
95
|
+
|
|
96
|
+
A plan with more than 10 tasks is treated as a hard ticket. It is reviewed once more by fresh agent calls that see only the spec (or brief) and the plan, never the conversation. First the teamlead reviews task size, independence, dependencies, estimates and technical risk, and writes its decisions to `review.md`; it does not edit the plan, which belongs to the PM. Then the PM applies those decisions and reviews coverage, ownership and totals. The reviewers decide; they do not hand points back as questions. There is no second round.
|
|
97
|
+
|
|
98
|
+
### Specs are read-only
|
|
99
|
+
|
|
100
|
+
If your project keeps specs in `docs/specs/`, brainstorming reads the matching one as the basis. It never creates or edits anything under `docs/specs/`. If you want a spec written or changed, ask for that separately.
|
|
101
|
+
|
|
102
|
+
### Scratch files
|
|
103
|
+
|
|
104
|
+
During the run, the agents use `docs/levi/<slug>/`:
|
|
105
|
+
|
|
106
|
+
| File | Owner | Purpose |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `brief.md` | PM | The problem framed in a few lines. Written only when there is no spec |
|
|
109
|
+
| `architecture.md` | Teamlead | Approaches considered and the one chosen |
|
|
110
|
+
| `tasks.md` | Teamlead | Task breakdown with suggested roles and estimates |
|
|
111
|
+
| `status.md` | PM | Task assignments |
|
|
112
|
+
| `review.md` | Teamlead | The review decisions for a hard plan. Written only for plans with more than 10 tasks |
|
|
113
|
+
| `phases.md` | PM | The features, the MVP cut and the order of the later phases. Written only when the problem holds several features |
|
|
114
|
+
|
|
115
|
+
All of them are deleted at the end, and the folder is removed when empty. If a run is interrupted, they may remain; you can delete them.
|
|
116
|
+
|
|
117
|
+
### If the plan already exists
|
|
118
|
+
|
|
119
|
+
When `docs/brainstorming/<slug>.md` already exists, the single question round includes one more question: replace it, or write the new plan under another name.
|
|
120
|
+
|
|
121
|
+
## spec-writing
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
/levi-spec-writing <what the spec is about>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Write a spec, or update an existing one, with the PM. The PM never invents requirements: it first lists everything that is unclear or undecided, you confirm it, and only then is the spec written.
|
|
128
|
+
|
|
129
|
+
Fits requests such as "write a spec for X", "update the spec of X" and "turn this idea into a spec".
|
|
130
|
+
|
|
131
|
+
### What you get
|
|
132
|
+
|
|
133
|
+
One file, `docs/specs/<slug>.md`, written in the language of your request. `<slug>` is a short kebab-case English name, for example `export-orders-csv`.
|
|
134
|
+
|
|
135
|
+
```markdown
|
|
136
|
+
# Export orders as CSV
|
|
137
|
+
|
|
138
|
+
- **Status:** Draft (open questions remain)
|
|
139
|
+
- **Sources:** user, docs/orders-overview.md
|
|
140
|
+
|
|
141
|
+
## Goal
|
|
142
|
+
Let a shop owner download their orders as a CSV file.
|
|
143
|
+
|
|
144
|
+
## Users
|
|
145
|
+
...
|
|
146
|
+
|
|
147
|
+
## User stories
|
|
148
|
+
| ID | Story | Source |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| US-1 | As a shop owner, I want to export my orders, so that I can use them in a spreadsheet | user |
|
|
151
|
+
|
|
152
|
+
## Acceptance criteria
|
|
153
|
+
| ID | Story | Criterion | Source |
|
|
154
|
+
|---|---|---|---|
|
|
155
|
+
| AC-1 | US-1 | The file contains one row per order in the selected date range | user |
|
|
156
|
+
|
|
157
|
+
## Open questions
|
|
158
|
+
| # | Question | Blocks |
|
|
159
|
+
|---|---|---|
|
|
160
|
+
| 1 | Which columns does the file contain? | AC-1 |
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
- Every story and criterion has a **Source**: `user`, or the path of the document it comes from. A line with no source is not written.
|
|
164
|
+
- A section with nothing confirmed says `Not yet defined. See Open questions.` It is never filled with a guess.
|
|
165
|
+
- **Status** is `Ready` only when Open questions is empty.
|
|
166
|
+
- A guess, a typical default, or a recommended option you did not accept does not count as confirmed. An unanswered question stays open.
|
|
167
|
+
|
|
168
|
+
### How it works
|
|
169
|
+
|
|
170
|
+
| Step | Who | What happens |
|
|
171
|
+
|---|---|---|
|
|
172
|
+
| 1. Intake | workflow | Reads your request and the files you mention, derives the slug. An empty request makes it ask what the spec is about. |
|
|
173
|
+
| 2. Find an existing spec | workflow | Looks in `docs/specs/`. One clear match means an update; several plausible ones make it ask you; none means a new spec. |
|
|
174
|
+
| 3. Discover | `levi-pm` | Reads the sources and writes a ledger: confirmed facts with their source, open questions with options, and a ready-to-write verdict. |
|
|
175
|
+
| 4. Ask you | workflow | Asks all the open questions in one round, each with options and the recommended one first. You can answer freely or say "not sure yet". |
|
|
176
|
+
| 5. Absorb answers | `levi-pm` | Records your answers as confirmed facts, adds follow-up questions they raise, updates the verdict. Steps 4 and 5 repeat up to three rounds, until the PM says it is ready or you say to write now. |
|
|
177
|
+
| 6. Write | `levi-pm` | Writes the spec from the confirmed facts only. Unresolved questions go to Open questions. |
|
|
178
|
+
| 7. Clean up | workflow | Deletes the ledger. Only the spec is left. |
|
|
179
|
+
| 8. Report | workflow | Tells you the spec path, its status, the counts and the open questions. |
|
|
180
|
+
|
|
181
|
+
If the goal, the users or the core scope are still unconfirmed when the rounds end, no spec is written. The ledger is kept in `docs/levi/<slug>/ledger.md` so a later run can continue.
|
|
182
|
+
|
|
183
|
+
### Only the PM touches specs
|
|
184
|
+
|
|
185
|
+
Nobody else writes specs: the developer, designer, QA and teamlead only read them, and they report problems they find to the PM. This is part of the [team protocol](team.md#the-protocol).
|
|
186
|
+
|
|
187
|
+
## design
|
|
188
|
+
|
|
189
|
+
```text
|
|
190
|
+
/levi-design <what to design, and the images or videos to base it on>
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Create UI designs as SVG files with the Designer. Describe what you want in plain text, attach images or videos (screenshots, mockups, sketches, screen recordings), or both.
|
|
194
|
+
|
|
195
|
+
Fits requests such as "design a login screen", "recreate this mockup as SVG" and "design the app shown in this video".
|
|
196
|
+
|
|
197
|
+
### What you get
|
|
198
|
+
|
|
199
|
+
A folder `docs/designs/<slug>/` with one SVG file per screen, state or breakpoint. `<slug>` is a short kebab-case English name, for example `login-screen`.
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
docs/designs/login-screen/
|
|
203
|
+
login.svg
|
|
204
|
+
login-error.svg
|
|
205
|
+
login-mobile.svg
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
- Each file is valid, self-contained SVG: one artboard, a `<title>`, named groups, colors and type defined once as tokens and shared by every file in the folder. No embedded raster images, external fonts or scripts.
|
|
209
|
+
- Texts and data come from your request and references, exactly as given. Anything else is a marked placeholder, never an invention.
|
|
210
|
+
- Your words decide how an image is used. By default it is **recreated** (layout, texts, colors, icons); say "in this style" and it is only a **style reference**.
|
|
211
|
+
- Photos in a reference become labeled placeholders, and text uses a system font stack.
|
|
212
|
+
|
|
213
|
+
### How it works
|
|
214
|
+
|
|
215
|
+
| Step | Who | What happens |
|
|
216
|
+
|---|---|---|
|
|
217
|
+
| 1. Intake | workflow | Reads your text and attachments, derives the slug. With neither text nor attachment it asks what to design. |
|
|
218
|
+
| 2. Find the context | workflow | Looks in `docs/designs/` for an existing design to update, and in `docs/specs/` for a spec to use as read-only context. |
|
|
219
|
+
| 3. Prepare the references | workflow | Images with a path are passed as they are. An image that exists only in the conversation is written down as a plain description. A video is turned into up to 12 key frames with ffmpeg. |
|
|
220
|
+
| 4. Draw | `levi-designer` | Decides the list of files, then draws them from the references, keeping one visual language across all of them. With an approved basis (a recreate image, cover or mockup, an HTML preview, or an existing design you named or confirmed) it runs with its default settings; without one it runs with the strong tier and `high` effort. |
|
|
221
|
+
| 5. Check | workflow | Runs a checker that rejects invalid SVG, raster images, external references and scripts, and renders each file to a PNG when a renderer is installed (`rsvg-convert`, `inkscape` or headless Chrome) to look for cut-off or overlapping content and for differences from the reference. |
|
|
222
|
+
| 6. Fix | `levi-designer` | One pass on the problems found, with the same model and effort as step 4. There is no second pass; what is still wrong is reported. |
|
|
223
|
+
| 7. Ask you | workflow | Asks the designer's questions in one round, only those that change the design. Without questions, assumptions go into the report. |
|
|
224
|
+
| 8. Clean up and report | workflow | Deletes frames, descriptions and renders. Tells you the files, assumptions and what could not be reproduced. |
|
|
225
|
+
|
|
226
|
+
### Requirements
|
|
227
|
+
|
|
228
|
+
- Videos need `ffmpeg`. Without it, the workflow asks you for screenshots of the key screens instead of guessing what the video shows.
|
|
229
|
+
- The render check needs `rsvg-convert`, `inkscape` or Chrome/Chromium. Without one it is skipped and the report says so.
|
|
230
|
+
- The checker needs `python3` (or `xmllint` as a fallback).
|
|
231
|
+
|
|
232
|
+
### Specs are read-only
|
|
233
|
+
|
|
234
|
+
If your project keeps specs in `docs/specs/`, the matching one is used as context. The design never creates or edits anything there.
|
|
235
|
+
|
|
236
|
+
### Scratch files
|
|
237
|
+
|
|
238
|
+
During the run the workflow uses `docs/levi/<slug>/`: `frames/` (video key frames), `references.md` (descriptions of images that have no file) and `render/` (PNG renders). All are deleted at the end. Your uploaded files are never touched.
|
|
239
|
+
|
|
240
|
+
## create-feature
|
|
241
|
+
|
|
242
|
+
```text
|
|
243
|
+
/levi-create-feature <the feature to build, and the spec if you have one>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
Build a feature end to end, the spec-driven way: the spec decides, the tests and test scenarios are written from it, and the code is changed until it satisfies them. Tests and scenarios are never changed to make them pass.
|
|
247
|
+
|
|
248
|
+
Fits requests such as "build feature X", "implement X" and "add X to the app".
|
|
249
|
+
|
|
250
|
+
Installing it also installs `spec-writing`, `brainstorming`, `design`, `code-review` and `generate-test-scenarios`, which it reuses.
|
|
251
|
+
|
|
252
|
+
### What you get
|
|
253
|
+
|
|
254
|
+
- The feature's code (and migrations, when it needs them), left uncommitted in your working tree.
|
|
255
|
+
- Unit and feature tests in the folders your test framework uses, covering every acceptance criterion of the spec.
|
|
256
|
+
- `docs/tests/<base>.md` and `.xlsx`: the test cases, in the [`generate-test-scenarios`](#generate-test-scenarios) format (IDs `TC-<FeatureID>-001` and up), each with the criteria it covers and, when browser tests ran, its `PASS` or `FAIL` result with evidence from the end-to-end run.
|
|
257
|
+
- The spec, brainstorming plan and designs, when they had to be created.
|
|
258
|
+
|
|
259
|
+
### How it works
|
|
260
|
+
|
|
261
|
+
**Prepare, with you.**
|
|
262
|
+
|
|
263
|
+
| Step | Who | What happens |
|
|
264
|
+
|---|---|---|
|
|
265
|
+
| 1. Spec | workflow, `spec-writing` | Uses the spec you give. Otherwise it looks in `docs/specs/` and asks you to confirm a likely match. If you reject it, or there is none, the PM writes a new spec with the `spec-writing` flow. A Draft spec must be settled first: its open questions are answered or moved out of scope. |
|
|
266
|
+
| 2. Plan | workflow, `brainstorming` | Uses the matching plan in `docs/brainstorming/`, or runs the `brainstorming` flow. |
|
|
267
|
+
| 3. Designs | workflow, `design` | When the feature has a UI: uses the matching folder in `docs/designs/`, or runs the `design` flow. |
|
|
268
|
+
|
|
269
|
+
**Implement, without you.** On Claude Code this runs as a Workflow, where every step is a fresh, independent subagent that sees only the files it is given. Without a Workflow tool the same steps run one after another as subagent calls.
|
|
270
|
+
|
|
271
|
+
| Step | Who | What happens |
|
|
272
|
+
|---|---|---|
|
|
273
|
+
| 4. Execution plan | `levi-teamlead` | Fixes the interfaces tests and code share, the test framework and commands, how to start the app, the test groups (covering every criterion) and the implementation batches. |
|
|
274
|
+
| 5. Tests | `levi-developer`, reviewed by `levi-teamlead` | Unit and feature tests, written from the spec in parallel groups. They run once before any code exists (they should fail), then a fresh teamlead reviews them against the spec until it approves. |
|
|
275
|
+
| 5. Test cases | `levi-qa` (strong tier, `high` effort), reviewed by `levi-pm` | Written from the spec at the same time, without reading code or tests, with QA's test case guide. A fresh PM reviews them against the spec until it approves. |
|
|
276
|
+
| 6. Lock | workflow | Copies and hashes the tests, and snapshots the test cases. From here on they are the definition of done. |
|
|
277
|
+
| 7. Build | `levi-developer`, `levi-teamlead` | Implements the batches, tasks of a batch in parallel. |
|
|
278
|
+
| 8. Gate | workflow | Restores any locked file that was changed, runs the new tests and the whole suite. A failure goes back to the developer. |
|
|
279
|
+
| 9. Review | `levi-teamlead` | Once the tests pass, reviews the change against the spec. Critical and warning findings go back to their owner. |
|
|
280
|
+
| 10. E2E | `levi-qa` | Only when you chose browser tests. After the review approves, undoes any change made to the test cases outside QA, starts the app and runs every case in a headless browser (through the API or CLI when there is no UI), recording PASS or FAIL. Failing cases go back to the developer, and steps 7 to 10 repeat until the review approves and every case passes. Without browser tests, the run is done when the review approves. |
|
|
281
|
+
|
|
282
|
+
### Tests are locked, test cases are QA's
|
|
283
|
+
|
|
284
|
+
The developer's tests and QA's test cases are checked against the spec by a fresh reviewer before anything is built, so a failure later can only mean the code is wrong. After the lock, every round verifies the hashes of the tests: a changed or deleted test is restored and the developer is told. The test cases belong to QA: only QA changes them, through its test case guide, and a change made by anyone else is undone before QA runs them. QA never changes an expected result to match what the code does.
|
|
285
|
+
|
|
286
|
+
### When it stops
|
|
287
|
+
|
|
288
|
+
| Result | Meaning | What happens |
|
|
289
|
+
|---|---|---|
|
|
290
|
+
| Spec questions | The spec is silent or unclear on a point the tests need | You answer, the PM updates the spec, and implementation starts again |
|
|
291
|
+
| Blocked | Something outside the code: the app cannot start, a service or credential is missing | You get the stage and what to provide; the work folder is kept |
|
|
292
|
+
| Stalled | 10 build rounds and something still fails | You get the last failures; the same Workflow session can resume with more rounds |
|
|
293
|
+
|
|
294
|
+
### Requirements
|
|
295
|
+
|
|
296
|
+
- A test framework the developer can run from the command line; if the project has none, the teamlead picks one and the developer sets it up.
|
|
297
|
+
- For E2E on a UI, only when you choose browser tests: the project's E2E runner (such as Playwright) or a browser tool the QA agent can use, and an app that starts locally.
|
|
298
|
+
|
|
299
|
+
### Scratch files
|
|
300
|
+
|
|
301
|
+
`docs/levi/<slug>/` holds `tasks.md` (the execution plan), `review.md` (the code review), `test-cases.json` (the data of the test cases), `locked/` (the snapshot of the locked tests) and `qa-snapshot/` (the test cases as QA last wrote them). It is deleted when the feature is done, and kept when the run stops.
|
|
302
|
+
|
|
303
|
+
## fix-bug
|
|
304
|
+
|
|
305
|
+
```text
|
|
306
|
+
/levi-fix-bug <what goes wrong, how to reproduce it, and screenshots or logs if you have them>
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Fix a bug with the team. The developer first lists what is unclear and you confirm it; then the developer investigates and fixes it test first while QA writes the test cases, the teamlead reviews every fix, and, if you choose browser tests, QA tests it end to end. Tests and test cases are never changed to make them pass.
|
|
310
|
+
|
|
311
|
+
Fits requests such as "fix this bug", "X is broken" and "X shows the wrong value".
|
|
312
|
+
|
|
313
|
+
Installing it also installs `create-feature` (and what that one requires), whose test lock script it uses, `code-review`, whose criteria the teamlead reviews by, and `generate-test-scenarios`, whose format the test cases use.
|
|
314
|
+
|
|
315
|
+
### What counts as a bug
|
|
316
|
+
|
|
317
|
+
A bug is a defect in feature code that is already **merged into the base branch**. When the code at fault is still on a branch that is not merged, or not committed (for example the output of `create-feature` you are checking), asking to change it is a revision of that work, not a bug. `fix-bug` checks this with `git blame` on the lines of the root cause and stops when they are not merged.
|
|
318
|
+
|
|
319
|
+
### What you get
|
|
320
|
+
|
|
321
|
+
- The fix, left uncommitted in your working tree.
|
|
322
|
+
- Unit and feature tests that failed on the bug and pass now: new ones, or the existing ones when they already covered it.
|
|
323
|
+
- `docs/tests/bugs/<slug>.md` and `.xlsx`: the bug's test cases (IDs `TC-BUG-<SLUG>-001` and up), the first following the steps of your report, each with its `PASS` or `FAIL` result when browser tests ran.
|
|
324
|
+
|
|
325
|
+
### How it works
|
|
326
|
+
|
|
327
|
+
**Clarify, with you.**
|
|
328
|
+
|
|
329
|
+
| Step | Who | What happens |
|
|
330
|
+
|---|---|---|
|
|
331
|
+
| 1. Intake | workflow | Reads the report and attachments, checks whether all code is merged into the base branch, writes the report down, and finds the spec and designs of the feature. |
|
|
332
|
+
| 2. Clarify | `levi-developer` | Lists every unclear point that would change the fix or its tests, with options. You answer; the answers are kept word for word. Up to three rounds, until nothing is open. If the code does what the spec says, it is a change, not a bug, and the run stops. |
|
|
333
|
+
|
|
334
|
+
**Fix, without you.** On Claude Code this runs as a Workflow of fresh, independent subagents; without a Workflow tool the same steps run one after another.
|
|
335
|
+
|
|
336
|
+
| Step | Who | What happens |
|
|
337
|
+
|---|---|---|
|
|
338
|
+
| 3. Test cases | `levi-qa` (strong tier, `high` effort) | At the same time as step 4, without reading code: writes the test cases with its test case guide; they are snapshotted at once. Then waits for the review to approve. |
|
|
339
|
+
| 4. Investigate, test first | `levi-developer` | Finds the root cause and makes sure unit and feature tests fail because of the bug: existing ones if they cover it, otherwise new ones. |
|
|
340
|
+
| 5. Merge check and lock | workflow | `git blame` on the root-cause lines (unmerged code stops the run), then the tests that cover the bug are locked. |
|
|
341
|
+
| 6. Fix | `levi-developer` | Fixes the root cause until the bug's tests and the whole suite pass. |
|
|
342
|
+
| 7. Review | `levi-teamlead` | Reviews the fix. Critical and warning findings go back to the developer. |
|
|
343
|
+
| 8. E2E | `levi-qa` | Only when you chose browser tests. After the approval, undoes any change made to the test cases outside QA and runs every case in a headless browser. Failing cases go back to the developer, and steps 6 to 8 repeat until the review approves and every case passes. Without browser tests, the run is done when the review approves. |
|
|
344
|
+
|
|
345
|
+
### When it stops
|
|
346
|
+
|
|
347
|
+
| Result | Meaning |
|
|
348
|
+
|---|---|
|
|
349
|
+
| Not a bug | The code does what the spec and your confirmed points expect |
|
|
350
|
+
| Unmerged | The root cause is in code that is not merged: it is a revision of that work. Nothing is changed |
|
|
351
|
+
| Questions | An agent found a point still open; you answer and the fix runs again |
|
|
352
|
+
| Blocked | The app cannot start, a service or credential is missing, or no test could be made to fail on the bug |
|
|
353
|
+
| Stalled | 10 rounds and something still fails; the same Workflow session can resume with more rounds |
|
|
354
|
+
|
|
355
|
+
### Scratch files
|
|
356
|
+
|
|
357
|
+
`docs/levi/<slug>/` holds `report.md` (your report), `confirmed.md` (the questions and your answers), `investigation.md` (root cause and plan), `review.md` (the review), `test-cases.json` (the data of the test cases), `locked/` (the snapshots of the tests and the test cases) and, for a video, `frames/`. It is deleted when the fix is done, and kept when the run stops.
|
|
358
|
+
|
|
359
|
+
## code-review
|
|
360
|
+
|
|
361
|
+
```text
|
|
362
|
+
/levi-code-review <pull request link, branch, commit range or path; empty for the uncommitted changes>
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
The teamlead reviews code and suggests a fix for every problem it finds. Nothing is changed: no file, no commit, no comment on the pull request. The review is given in the conversation.
|
|
366
|
+
|
|
367
|
+
Fits requests such as "review this PR", "review my changes" and "check this code for security issues".
|
|
368
|
+
|
|
369
|
+
### What it reviews
|
|
370
|
+
|
|
371
|
+
| You give | It reviews |
|
|
372
|
+
|---|---|
|
|
373
|
+
| A pull request link | The pull request, read with `gh` (which must be installed and logged in) |
|
|
374
|
+
| A branch | The branch against the base branch |
|
|
375
|
+
| A commit or a range `a..b` | Those commits |
|
|
376
|
+
| Files or folders | Those files in full |
|
|
377
|
+
| Nothing | Your uncommitted changes, or the current branch against the base branch when there are none |
|
|
378
|
+
|
|
379
|
+
You can narrow the focus, for example "only security".
|
|
380
|
+
|
|
381
|
+
### What it checks
|
|
382
|
+
|
|
383
|
+
- **Security**, by OWASP Top 10 category: broken access control, cryptographic failures and sensitive data exposure, injection and XSS, insecure design, security misconfiguration and XXE, vulnerable and outdated components, broken authentication, insecure deserialization and other integrity failures, missing security logging, SSRF, and checks that fail open.
|
|
384
|
+
- **Performance and correctness**: N+1 queries, missing indexes, unbounded work, inefficient algorithms, race conditions, transactions, memory and resource leaks, error handling, logic and edge cases, and breaking API changes.
|
|
385
|
+
|
|
386
|
+
The criteria are in `references/` of the skill: `review-guide.md` (how to review, severities, finding format) and the checklists `security.md` and `performance-and-correctness.md`. The teamlead review of `create-feature` and `fix-bug` follows the same criteria.
|
|
387
|
+
|
|
388
|
+
### What you get
|
|
389
|
+
|
|
390
|
+
A verdict (**Approve** or **Request changes**), then the findings from critical to suggestion. Each finding has its location, the problem, a concrete case where it fails, and the suggested fix:
|
|
391
|
+
|
|
392
|
+
| Severity | Meaning | Blocks merge |
|
|
393
|
+
|---|---|---|
|
|
394
|
+
| critical | Exploitable vulnerability, leaked secret, data loss, a crash on a main path, a breaking change with no migration | Yes |
|
|
395
|
+
| warning | A real defect under realistic conditions, such as an N+1 on a list, a missing index, a race or an unhandled error | Yes |
|
|
396
|
+
| suggestion | Worth doing, not wrong today | No |
|
|
397
|
+
|
|
398
|
+
It ends with what the teamlead could not check, and any questions.
|
|
399
|
+
|
|
400
|
+
### Large changes
|
|
401
|
+
|
|
402
|
+
A reviewer who reads hundreds of files skims, and problems then turn up a few at a time over many review rounds. So a change of **more than 100 reviewable files** (generated files, lock files, vendored code and build output do not count) is not read by one teamlead:
|
|
403
|
+
|
|
404
|
+
1. A lead teamlead splits the files into slices of at most 100, grouped by what belongs together (a module with its tests, callers and migrations), not by alphabet.
|
|
405
|
+
2. One fresh teamlead call per slice reviews it, all at the same time, and reports every finding in one pass.
|
|
406
|
+
3. The lead teamlead merges the slice reports into the one review: findings with one cause are joined, severities are made consistent, and issues that cross slices are settled by reading both sides.
|
|
407
|
+
|
|
408
|
+
You get one review, as for a small change. `create-feature` and `fix-bug` do the same in their teamlead review step, on every round. The steps are in `references/large-changes.md` of the skill.
|
|
409
|
+
|
|
410
|
+
## generate-test-scenarios
|
|
411
|
+
|
|
412
|
+
```text
|
|
413
|
+
/levi-generate-test-scenarios <feature IDs (for example F001 F002) or spec files and folders; empty for every feature>
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
QA writes screen-level test cases from the feature specs already in your repository. The spec is the only source: nothing comes from the code, the UI, the designs or outside knowledge, and no function is invented. Specs are never created or changed.
|
|
417
|
+
|
|
418
|
+
Fits requests such as "generate test cases for F001", "write test scenarios from the spec" and "sinh test case cho F001, F002".
|
|
419
|
+
|
|
420
|
+
Every QA call here writes or changes test cases, so it runs with the strong tier and `high` effort (the same holds for QA in `create-feature` and `fix-bug` whenever it writes or fixes test cases).
|
|
421
|
+
|
|
422
|
+
### What you get
|
|
423
|
+
|
|
424
|
+
Two files per feature in `docs/tests/`, written in the language of the spec:
|
|
425
|
+
|
|
426
|
+
| File | Contents |
|
|
427
|
+
|---|---|
|
|
428
|
+
| `<base>.md` | Title and source spec, a coverage summary (cases by category and priority), the test cases, and "spec ambiguities": what QA and BA need to clarify |
|
|
429
|
+
| `<base>.xlsx` | One sheet, one row per case, columns `ID, Title, Category, Priority, Preconditions, Steps, Expected Result, Notes`, ready to import into Jira, TestRail, Notion or a spreadsheet |
|
|
430
|
+
|
|
431
|
+
`<base>` is `<FeatureID>-<slug>` (for example `F001-login`) when the spec gives the feature a code, in its file or folder name, title or header. A spec without a code uses its slug in uppercase as the feature ID and `<slug>-test-cases` as the base.
|
|
432
|
+
|
|
433
|
+
Each test case has:
|
|
434
|
+
|
|
435
|
+
| Field | Rule |
|
|
436
|
+
|---|---|
|
|
437
|
+
| ID | `TC-<FeatureID>-<3 digits>`, for example `TC-F001-001` |
|
|
438
|
+
| Title | Short, says what is checked |
|
|
439
|
+
| Category | Functional, UX, Security, Performance or Accessibility |
|
|
440
|
+
| Priority | P0 (blocks the main flow, or security), P1 (important function), P2 (minor, cosmetic) |
|
|
441
|
+
| Preconditions | Data state, user role, starting screen |
|
|
442
|
+
| Steps | Numbered, one action each |
|
|
443
|
+
| Expected Result | Concrete and observable, as the spec words it |
|
|
444
|
+
| Notes | The spec items it traces to, and what QA must confirm |
|
|
445
|
+
|
|
446
|
+
The cases cover what the spec mentions: the positive path of every user story, the roles allowed and refused, screen flow edge cases, validation (required fields, formats, lengths, boundary values) and error states, and what triggers background logic. Both files are rendered by a script from the same data, which checks the ID format and order, duplicates, and that every user story has a positive case. The data is also embedded at the end of the `.md` file, in a comment Markdown viewers do not show, so that QA can change the cases later. When the cases are run (in `create-feature` and `fix-bug`), each gets a `Status` and `Evidence`, shown in the `.md` and as two more columns in the `.xlsx`.
|
|
447
|
+
|
|
448
|
+
This is QA's skill: whichever usecase asks `levi-qa` for test cases, it writes them with this format and these rules.
|
|
449
|
+
|
|
450
|
+
### How it works
|
|
451
|
+
|
|
452
|
+
| Step | Who | What happens |
|
|
453
|
+
|---|---|---|
|
|
454
|
+
| 1. Intake | workflow | Reads the feature codes or spec paths in your request. |
|
|
455
|
+
| 2. Find the specs | workflow | Matches each code against `docs/specs/`. A code with no spec is reported, for example "No spec for F003 in docs/specs/". With no code or path, it lists every feature found. |
|
|
456
|
+
| 3. Ask you once | workflow | Tells you the missing specs, then asks in one round: whether to generate for every feature (only when you named none), which spec a code means when several match, and for each output that already exists, whether to replace it or write a new version with a `-YYYYMMDD` suffix. |
|
|
457
|
+
| 4. Analyze | `levi-qa` | Per feature, reads only the spec: its items, a coverage plan, the ambiguities, and whether there is anything testable at all. |
|
|
458
|
+
| 5. Report gaps | workflow | Before any case is written, tells you what each spec lacks. A spec with nothing testable is skipped. |
|
|
459
|
+
| 6. Generate | `levi-qa` | Writes the cases, runs the check script until it passes, reviews what the script cannot check (one action per step, verifiable results, nothing invented), and renders both files. |
|
|
460
|
+
| 7. Verify and clean up | workflow | Runs the check again, confirms both files exist, and deletes the scratch files. |
|
|
461
|
+
| 8. Report | workflow | The number of cases, the file paths, and the spec points to clarify. |
|
|
462
|
+
|
|
463
|
+
Where the spec is unclear or silent, nothing is decided: the point is written in the case's notes and in the spec ambiguities section.
|
|
464
|
+
|
|
465
|
+
### Requirements
|
|
466
|
+
|
|
467
|
+
Node.js 18 or newer, which levi already needs. The Excel file is written without any extra package.
|
|
468
|
+
|
|
469
|
+
### Scratch files
|
|
470
|
+
|
|
471
|
+
During the run, QA uses `docs/levi/test-cases/`: `<FeatureID>-analysis.md` (spec items, coverage plan, ambiguities) and `<FeatureID>.json` (the cases both files are rendered from). They are deleted at the end.
|
package/package.json
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "levi-gear",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "Install a software team (PM, teamlead, developer, designer, QA) as Claude Code or Codex skills and agents with test-first workflows",
|
|
5
5
|
"bin": {
|
|
6
6
|
"levi": "./bin/levi.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "node --test test/quota-check.test.mjs test/legacy-tools-cleanup.test.mjs"
|
|
9
|
+
"test": "node --test test/quota-check.test.mjs test/legacy-tools-cleanup.test.mjs test/codex-install.test.mjs test/codex-checkpoint.test.mjs test/lock-tests.test.mjs test/agent-effort.test.mjs test/workflow-browser-tests.test.mjs"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"agents",
|
|
13
13
|
"bin",
|
|
14
|
+
"docs",
|
|
14
15
|
"src",
|
|
15
16
|
"usecases"
|
|
16
17
|
],
|
package/src/cli.js
CHANGED
|
@@ -9,8 +9,8 @@ const HELP = `levi ${kitVersion()}
|
|
|
9
9
|
Usage: levi <command>
|
|
10
10
|
|
|
11
11
|
Commands:
|
|
12
|
-
init [usecase...]
|
|
13
|
-
Install usecases (all by default
|
|
12
|
+
init [--tools claude,codex] [usecase...]
|
|
13
|
+
Install usecases (all by default; Claude Code by default)
|
|
14
14
|
update [--force [path...]]
|
|
15
15
|
Refresh installed files to this package version. Files you changed are kept;
|
|
16
16
|
--force overwrites them (all, or only the given paths)
|
package/src/commands/init.js
CHANGED
|
@@ -5,20 +5,30 @@ const { listUsecases, kitVersion } = require('../lib/usecases');
|
|
|
5
5
|
const { INVOCATION_HELP } = require('../lib/tools');
|
|
6
6
|
|
|
7
7
|
function init(projectDir, argv) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const stored = config.read(projectDir);
|
|
9
|
+
const existing = stored || { usecases: {}, router: { files: {} }, team: { files: {} } };
|
|
10
|
+
let selected;
|
|
11
|
+
const args = [];
|
|
12
|
+
for (let i = 0; i < argv.length; i++) {
|
|
13
|
+
const arg = argv[i];
|
|
14
|
+
if (arg === '--tools' || arg.startsWith('--tools=')) {
|
|
15
|
+
if (selected) throw new Error('--tools may only be specified once');
|
|
16
|
+
const value = arg === '--tools' ? argv[++i] : arg.slice(8);
|
|
17
|
+
if (!value) throw new Error('--tools requires claude, codex, or claude,codex');
|
|
18
|
+
selected = value.split(',');
|
|
19
|
+
if (selected.some((x) => !['claude', 'codex'].includes(x))) throw new Error('Unknown tool; choose claude or codex');
|
|
20
|
+
} else if (arg.startsWith('-')) throw new Error(`Unknown option: ${arg}`);
|
|
21
|
+
else args.push(arg);
|
|
12
22
|
}
|
|
13
|
-
const
|
|
14
|
-
const wanted =
|
|
23
|
+
const targets = [...new Set([...(stored ? existing.targets || ['claude'] : []), ...(selected || (existing.targets || ['claude']))])];
|
|
24
|
+
const wanted = args.length ? args : listUsecases().map((u) => u.id);
|
|
15
25
|
const ids = [...new Set([...Object.keys(existing.usecases), ...wanted])];
|
|
16
|
-
const result = sync(projectDir, ids, existing);
|
|
17
|
-
config.write(projectDir, { version: kitVersion(), usecases: result.usecases, router: result.router, team: result.team });
|
|
18
|
-
console.log(`Installed ${Object.keys(result.usecases).length} usecase(s) for
|
|
26
|
+
const result = sync(projectDir, ids, { ...existing, targets });
|
|
27
|
+
config.write(projectDir, { version: kitVersion(), targets, usecases: result.usecases, router: result.router, team: result.team });
|
|
28
|
+
console.log(`Installed ${Object.keys(result.usecases).length} usecase(s) for ${targets.join(', ')}`);
|
|
19
29
|
for (const id of Object.keys(result.usecases)) console.log(` - ${id}`);
|
|
20
30
|
printReport(result.actions);
|
|
21
|
-
if (Object.keys(result.usecases).length) console.log(`\nInvoke with:\n${INVOCATION_HELP}`);
|
|
31
|
+
if (Object.keys(result.usecases).length) console.log(`\nInvoke with:\n${targets.includes('claude') ? INVOCATION_HELP + '\n' : ''}${targets.includes('codex') ? ' $levi <request> $levi-<usecase> <request>' : ''}`);
|
|
22
32
|
if (result.missing.length) {
|
|
23
33
|
console.error(`Not found in kit: ${result.missing.join(', ')}`);
|
|
24
34
|
process.exitCode = 1;
|
package/src/commands/list.js
CHANGED
|
@@ -10,7 +10,7 @@ function list() {
|
|
|
10
10
|
console.log(`${u.id}${roles}${requires}\n ${u.description}`);
|
|
11
11
|
}
|
|
12
12
|
if (usecases.length) {
|
|
13
|
-
console.log(`\nInvoke with:\n${INVOCATION_HELP}`);
|
|
13
|
+
console.log(`\nInvoke with:\n${INVOCATION_HELP} (Claude Code)\n $levi <request> $levi-<usecase> <request> (Codex)`);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
package/src/commands/update.js
CHANGED
|
@@ -19,11 +19,11 @@ function update(projectDir, argv = []) {
|
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
const result = sync(projectDir, Object.keys(existing.usecases), existing, { force: parseForce(argv) });
|
|
22
|
-
config.write(projectDir, { version: kitVersion(), usecases: result.usecases, router: result.router, team: result.team });
|
|
22
|
+
config.write(projectDir, { version: kitVersion(), targets: existing.targets || ['claude'], usecases: result.usecases, router: result.router, team: result.team });
|
|
23
23
|
console.log(`Updated ${existing.version} -> ${kitVersion()} (${Object.keys(result.usecases).length} usecase(s))`);
|
|
24
24
|
printReport(result.actions);
|
|
25
25
|
for (const id of result.missing) console.log(`\n${id} is no longer in the kit; its unchanged files were removed.`);
|
|
26
|
-
if (Object.keys(result.usecases).length) console.log(`\nInvoke with:\n${INVOCATION_HELP}`);
|
|
26
|
+
if (Object.keys(result.usecases).length) console.log(`\nInvoke with:\n${(existing.targets || ['claude']).includes('claude') ? INVOCATION_HELP + '\n' : ''}${(existing.targets || []).includes('codex') ? ' $levi <request> $levi-<usecase> <request>' : ''}`);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
module.exports = { update };
|
package/src/lib/agents.js
CHANGED
|
@@ -10,6 +10,7 @@ const PARTIAL = '_';
|
|
|
10
10
|
// Tool-neutral fields. The installer maps them to Claude Code in tools.js.
|
|
11
11
|
const CAPABILITIES = ['read', 'edit', 'execute', 'web'];
|
|
12
12
|
const MODEL_TIERS = ['strong', 'standard', 'fast'];
|
|
13
|
+
const EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
13
14
|
|
|
14
15
|
function parseList(value) {
|
|
15
16
|
return value ? value.split(',').map((s) => s.trim()).filter(Boolean) : null;
|
|
@@ -34,6 +35,9 @@ function readAgent(file, label, expectedName, owner, appendix = '') {
|
|
|
34
35
|
if (data.model && !MODEL_TIERS.includes(data.model)) {
|
|
35
36
|
throw new Error(`${label}: unknown model "${data.model}"; use ${MODEL_TIERS.join(', ')}`);
|
|
36
37
|
}
|
|
38
|
+
if (data.effort && !EFFORTS.includes(data.effort)) {
|
|
39
|
+
throw new Error(`${label}: unknown effort "${data.effort}"; use ${EFFORTS.join(', ')}`);
|
|
40
|
+
}
|
|
37
41
|
return {
|
|
38
42
|
name: data.name,
|
|
39
43
|
description: data.description,
|
|
@@ -44,6 +48,7 @@ function readAgent(file, label, expectedName, owner, appendix = '') {
|
|
|
44
48
|
owner,
|
|
45
49
|
tools,
|
|
46
50
|
model: data.model || null,
|
|
51
|
+
effort: data.effort || null,
|
|
47
52
|
};
|
|
48
53
|
}
|
|
49
54
|
|
|
@@ -59,4 +64,4 @@ function loadTeam() {
|
|
|
59
64
|
.map((f) => readAgent(path.join(TEAM_DIR, f), `agents/${f}`, PREFIX + f.slice(0, -3), null, appendix));
|
|
60
65
|
}
|
|
61
66
|
|
|
62
|
-
module.exports = { PREFIX, CAPABILITIES, MODEL_TIERS, joinSections, readAgent, loadTeam };
|
|
67
|
+
module.exports = { PREFIX, CAPABILITIES, MODEL_TIERS, EFFORTS, joinSections, readAgent, loadTeam };
|