levi-gear 0.3.0 → 0.5.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 +33 -33
- package/package.json +3 -3
- package/src/cli.js +3 -3
- package/src/commands/init.js +9 -24
- package/src/commands/list.js +3 -5
- package/src/commands/status.js +1 -1
- package/src/commands/update.js +4 -4
- package/src/lib/agents.js +1 -1
- package/src/lib/desired-state.js +16 -31
- package/src/lib/sync.js +3 -3
- package/src/lib/tools.js +10 -81
- package/src/runtime/quota-check.mjs +21 -142
- package/usecases/_run-rules.md +20 -16
- package/usecases/brainstorming/SKILL.md +0 -4
- package/usecases/code-review/SKILL.md +0 -4
- package/usecases/create-feature/SKILL.md +3 -4
- package/usecases/design/SKILL.md +0 -4
- package/usecases/fix-bug/SKILL.md +3 -4
- package/usecases/generate-test-scenarios/SKILL.md +0 -5
- package/usecases/spec-writing/SKILL.md +0 -4
- package/src/runtime/codex-run-state.mjs +0 -156
- package/usecases/brainstorming/references/codex-runner.md +0 -28
- package/usecases/code-review/references/codex-runner.md +0 -5
- package/usecases/create-feature/references/codex-runner.md +0 -57
- package/usecases/design/references/codex-runner.md +0 -27
- package/usecases/fix-bug/references/codex-runner.md +0 -32
- package/usecases/generate-test-scenarios/references/codex-runner.md +0 -32
- package/usecases/spec-writing/references/codex-runner.md +0 -25
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# Codex runner
|
|
2
|
-
|
|
3
|
-
This file is the durable runner for Codex. It replaces the Claude-only `workflow.js`; do not try to execute that file with Node or translate its state from chat history.
|
|
4
|
-
|
|
5
|
-
## Start or continue
|
|
6
|
-
|
|
7
|
-
After preparation has selected a Ready spec, a plan and any required designs, use the state helper installed in this skill folder. Run every command below from the project root:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
node <this skill folder>/scripts/codex-run-state.mjs status docs/levi/<slug>
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
If there is no state file, start one:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
node <this skill folder>/scripts/codex-run-state.mjs init docs/levi/<slug> create-feature <slug> plan tests lock build
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Never create a second state file for the same run. On a resumed run, read `status`; its `currentStage`, stage `status`, artifacts and history decide the next action. Do not repeat a completed stage.
|
|
20
|
-
|
|
21
|
-
Before starting or retrying the current stage, call `begin`. It is valid to call `begin` again on an active stage; that records a new attempt. A successful stage is recorded only after its required artifact exists:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
node <this skill folder>/scripts/codex-run-state.mjs begin docs/levi/<slug> <stage>
|
|
25
|
-
node <this skill folder>/scripts/codex-run-state.mjs complete docs/levi/<slug> <stage> <artifact>...
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
For a question only the user can settle, or an external blocker, preserve the exact reason before returning it:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
node <this skill folder>/scripts/codex-run-state.mjs wait docs/levi/<slug> <stage> "<questions for the user>"
|
|
32
|
-
node <this skill folder>/scripts/codex-run-state.mjs block docs/levi/<slug> <stage> "<external blocker>"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
When the user answers or supplies the missing dependency, run `resume` and continue the same stage. Do not use `resumeFromRunId`: that is a Claude Workflow capability, not a Codex recovery mechanism.
|
|
36
|
-
|
|
37
|
-
## Stages
|
|
38
|
-
|
|
39
|
-
### `plan`
|
|
40
|
-
|
|
41
|
-
Dispatch `levi-teamlead` with only the spec, plan, designs, project and work-folder paths. It writes `tasks.md`. Check that every acceptance criterion has a test group, then complete this stage with `tasks.md`.
|
|
42
|
-
|
|
43
|
-
### `tests`
|
|
44
|
-
|
|
45
|
-
Run the developer test groups and the QA scenario track as separate named Codex subagents. They may run in parallel only when their output paths do not overlap. The developer tests and QA cases are then independently reviewed and repaired until approved, up to the existing five-review limit. Do not advance until both tracks are approved and `test-cases.json`, `<testBase>.md` and `<testBase>.xlsx` exist. If a reviewer finds a spec ambiguity, mark this stage `wait`; do not guess.
|
|
46
|
-
|
|
47
|
-
### `lock`
|
|
48
|
-
|
|
49
|
-
Run the existing `lock-tests.mjs` commands for the approved test files and QA deliverables. Complete only after both manifests exist: `locked/manifest.json` and `qa-snapshot/manifest.json`.
|
|
50
|
-
|
|
51
|
-
### `build`
|
|
52
|
-
|
|
53
|
-
Keep this stage active through all build rounds. In each round, dispatch only the owner of the pending implementation, test, review or E2E finding. Then run the lock verification, feature tests and whole suite. Run the teamlead review only after the test gate passes; for more than 100 reviewable files follow `levi-code-review/references/large-changes.md` (a teamlead split, parallel teamlead slice reviews that write no file, then one teamlead merge that writes `review.md`). Run QA E2E only after that review approves. Record every real failure in the next Codex subagent prompt. Complete `build` only after the review approves and every QA case is PASS; pass `review.md`, `<testBase>.md` and `<testBase>.xlsx` as artifacts.
|
|
54
|
-
|
|
55
|
-
## Dispatch contract
|
|
56
|
-
|
|
57
|
-
Use the installed named agents (`levi-teamlead`, `levi-developer`, `levi-qa`, `levi-pm`) rather than asking a general agent to impersonate a role. Each prompt must name the allowed input paths, output paths, acceptance criteria, and whether the agent may edit. The coordinator alone advances the state. Keep dependent operations in the coordinator; reserve parallel subagents for independent test groups or implementation batches that the plan says do not overlap.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Codex runner
|
|
2
|
-
|
|
3
|
-
Run from the project root and persist the workflow after intake derives the slug:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
node <this skill folder>/scripts/codex-run-state.mjs status docs/levi/<slug>
|
|
7
|
-
node <this skill folder>/scripts/codex-run-state.mjs init docs/levi/<slug> design <slug> context references draw decide check finalize
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
node <this skill folder>/scripts/codex-run-state.mjs begin docs/levi/<slug> <stage>
|
|
12
|
-
node <this skill folder>/scripts/codex-run-state.mjs complete docs/levi/<slug> <stage> <artifact>...
|
|
13
|
-
node <this skill folder>/scripts/codex-run-state.mjs wait docs/levi/<slug> <stage> "<questions>"
|
|
14
|
-
node <this skill folder>/scripts/codex-run-state.mjs block docs/levi/<slug> <stage> "<blocker>"
|
|
15
|
-
node <this skill folder>/scripts/codex-run-state.mjs resume docs/levi/<slug>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Read `status` first after an interruption. Begin the active stage, complete it only after the listed output is present, and use `wait`, `block`, and `resume` for user decisions and external prerequisites. Do not redo a completed stage or rewrite a user upload.
|
|
19
|
-
|
|
20
|
-
- `context`: select the target design folder and optional read-only spec.
|
|
21
|
-
- `references`: make only the permitted reference descriptions and video frames. If ffmpeg is missing, mark this stage `block` with the request for screenshots or ffmpeg; do not guess the video.
|
|
22
|
-
- `draw`: dispatch `levi-designer` with exact input/output paths. Complete only when the output folder contains its SVG files.
|
|
23
|
-
- `decide`: run the initial checker/render needed to make an informed decision, then preserve the designer's material questions with `wait`. After an answer, `resume` and make the permitted final design change; otherwise complete with the recorded assumptions. Do not mark final verification complete here.
|
|
24
|
-
- `check`: run the final SVG checker and, when available, render the final files. If a repair is needed, keep this stage active while the designer gets the exact findings once, then check again. Record the render/check artifacts.
|
|
25
|
-
- `finalize`: report verified SVG files, then remove frames, reference descriptions, renders and `run.json`. Never delete uploads or the read-only spec.
|
|
26
|
-
|
|
27
|
-
Only `levi-designer` writes SVG files. The coordinator runs checks and advances state.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Codex runner
|
|
2
|
-
|
|
3
|
-
Use this durable runner on Codex instead of the Claude-only `workflow.js`. Run every command below from the project root. After clarification is complete, first inspect `docs/levi/<slug>/run.json`. If absent, initialize it:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
node <this skill folder>/scripts/codex-run-state.mjs init docs/levi/<slug> fix-bug <slug> baseline tests merge-check lock build
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
For each current stage, call `begin` before dispatching the named Levi agent and `complete` only after its artifacts exist. `status` is the source of truth after an interruption; completed stages are never repeated. Use `wait` for questions that need the user, `block` for an external dependency, and `resume` after it is resolved. Do not use the Claude-only `resumeFromRunId`.
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
node <this skill folder>/scripts/codex-run-state.mjs begin docs/levi/<slug> <stage>
|
|
13
|
-
node <this skill folder>/scripts/codex-run-state.mjs complete docs/levi/<slug> <stage> <artifact>...
|
|
14
|
-
node <this skill folder>/scripts/codex-run-state.mjs wait docs/levi/<slug> <stage> "<questions>"
|
|
15
|
-
node <this skill folder>/scripts/codex-run-state.mjs block docs/levi/<slug> <stage> "<blocker>"
|
|
16
|
-
node <this skill folder>/scripts/codex-run-state.mjs resume docs/levi/<slug>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
For a valid terminal result that does not build a fix, use `finish` before cleanup:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
node <this skill folder>/scripts/codex-run-state.mjs finish docs/levi/<slug> tests
|
|
23
|
-
node <this skill folder>/scripts/codex-run-state.mjs finish docs/levi/<slug> merge-check
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- `baseline`: record the baseline commit and dirty paths for the later review.
|
|
27
|
-
- `tests`: QA writes and PM-approved scenarios while the developer investigates and produces a failing test. Both tracks are separate; complete only with `investigation.md`, `test-cases.json`, and the rendered scenario files. When the code already does what is expected, use `finish` at this stage and report `not_a_bug`; do not build a change.
|
|
28
|
-
- `merge-check`: run the existing blame/ancestor check when the initial check did not prove all code merged. For unmerged root-cause code, use `finish` at this stage, report `unmerged`, and do not fix it.
|
|
29
|
-
- `lock`: lock the developer tests and QA cases with the existing lock script. Require both lock manifests.
|
|
30
|
-
- `build`: run the existing code → test gate → teamlead review → QA E2E loop (a review of more than 100 reviewable files follows `levi-code-review/references/large-changes.md`: split, parallel slice reviews, one merge). Keep the stage active across all rounds. Complete only after approved review and all cases PASS.
|
|
31
|
-
|
|
32
|
-
Use installed named roles for every subagent call. The coordinator owns the checkpoint and stages; subagents only read/write their assigned artifacts. Keep dependent work sequential and use parallel calls only for the independent QA and investigation tracks.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
# Codex runner
|
|
2
|
-
|
|
3
|
-
Run from the project root with one durable state per invocation:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
node <this skill folder>/scripts/codex-run-state.mjs status docs/levi/test-cases
|
|
7
|
-
node <this skill folder>/scripts/codex-run-state.mjs init docs/levi/test-cases generate-test-scenarios test-cases select analyze report generate verify
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
node <this skill folder>/scripts/codex-run-state.mjs begin docs/levi/test-cases <stage>
|
|
12
|
-
node <this skill folder>/scripts/codex-run-state.mjs complete docs/levi/test-cases <stage> <artifact>...
|
|
13
|
-
node <this skill folder>/scripts/codex-run-state.mjs wait docs/levi/test-cases <stage> "<questions>"
|
|
14
|
-
node <this skill folder>/scripts/codex-run-state.mjs block docs/levi/test-cases <stage> "<blocker>"
|
|
15
|
-
node <this skill folder>/scripts/codex-run-state.mjs resume docs/levi/test-cases
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
When a valid branch ends before the last stage, use `finish` rather than pretending later stages completed:
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
node <this skill folder>/scripts/codex-run-state.mjs finish docs/levi/test-cases report
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Use `status` before continuing a stopped run. Begin the current stage, complete it only after its outputs exist, and use `wait`, `block`, and `resume` for user choices and dependencies. Record the selected feature list and output bases in `docs/levi/test-cases/selection.md`, then pass that file to `complete` for `select`. Do not regenerate a feature whose verify stage completed.
|
|
25
|
-
|
|
26
|
-
- `select`: find requested specs, report missing ones, and preserve required choices (all features, ambiguous codes, overwrite/versioned output) with `wait`. Complete when exact features and output bases are fixed in `selection.md`.
|
|
27
|
-
- `analyze`: dispatch one `levi-qa` agent per selected feature only. They may run in parallel because each owns `docs/levi/test-cases/<FeatureID>-analysis.md`. Complete only when every selected analysis exists.
|
|
28
|
-
- `report`: report `Generate: no` and ambiguities before any writing. If every selected feature is skipped, use `finish docs/levi/test-cases report` and clean up; otherwise continue.
|
|
29
|
-
- `generate`: dispatch QA only for features marked `Generate: yes`. Complete only when each `json` case source and both requested output files exist.
|
|
30
|
-
- `verify`: run `render-test-cases.mjs check` for every generated feature. QA may repair each failing feature once; a remaining failure marks this stage `block` with its errors. Complete only after all selected outputs validate, then cleanup removes the scratch state.
|
|
31
|
-
|
|
32
|
-
Only `levi-qa` writes analysis, case sources and deliverables. The coordinator does not edit those files.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# Codex runner
|
|
2
|
-
|
|
3
|
-
Run this workflow from the project root with a durable checkpoint. Initialize it immediately after intake:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
node <this skill folder>/scripts/codex-run-state.mjs status docs/levi/<slug>
|
|
7
|
-
node <this skill folder>/scripts/codex-run-state.mjs init docs/levi/<slug> spec-writing <slug> discover decide write verify
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
node <this skill folder>/scripts/codex-run-state.mjs begin docs/levi/<slug> <stage>
|
|
12
|
-
node <this skill folder>/scripts/codex-run-state.mjs complete docs/levi/<slug> <stage> <artifact>...
|
|
13
|
-
node <this skill folder>/scripts/codex-run-state.mjs wait docs/levi/<slug> <stage> "<questions>"
|
|
14
|
-
node <this skill folder>/scripts/codex-run-state.mjs block docs/levi/<slug> <stage> "<blocker>"
|
|
15
|
-
node <this skill folder>/scripts/codex-run-state.mjs resume docs/levi/<slug>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
On a resumed run, `status` is authoritative. Begin the current stage, complete it only after the stated artifact exists, and never repeat a completed stage. Use `wait` to preserve unanswered user questions, `block` for an external dependency, and `resume` after it is resolved.
|
|
19
|
-
|
|
20
|
-
- `discover`: select update/new mode and dispatch `levi-pm` to write `ledger.md`. Complete with that ledger.
|
|
21
|
-
- `decide`: run the up-to-three user-answer rounds. Before each question round use `wait`; after the answer use `resume` and have the PM update `ledger.md`. Complete when it is ready to write, when the user explicitly asks to write with remaining questions, or mark `block` when the goal/users/core scope cannot be confirmed.
|
|
22
|
-
- `write`: dispatch `levi-pm` once with the ledger and selected spec path. Complete only when `docs/specs/<slug>.md` exists.
|
|
23
|
-
- `verify`: confirm the PM-owned spec is the requested new/update output and report its status. Cleanup can remove the state and ledger only after this stage completes.
|
|
24
|
-
|
|
25
|
-
The coordinator never edits the ledger or spec. Only `levi-pm` writes them.
|