levi-gear 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +135 -2
- package/agents/_team-protocol.md +41 -0
- package/agents/designer.md +25 -0
- package/agents/developer.md +23 -0
- package/agents/pm.md +28 -0
- package/agents/qa.md +24 -0
- package/agents/teamlead.md +26 -0
- package/bin/levi.js +2 -0
- package/package.json +16 -4
- package/src/cli.js +51 -0
- package/src/commands/init.js +43 -0
- package/src/commands/list.js +19 -0
- package/src/commands/status.js +17 -0
- package/src/commands/update.js +29 -0
- package/src/lib/agents.js +62 -0
- package/src/lib/config.js +27 -0
- package/src/lib/desired-state.js +93 -0
- package/src/lib/frontmatter.js +36 -0
- package/src/lib/report.js +21 -0
- package/src/lib/role-skills.js +23 -0
- package/src/lib/router.js +38 -0
- package/src/lib/sync.js +110 -0
- package/src/lib/tools.js +98 -0
- package/src/lib/usecases.js +109 -0
- package/usecases/.gitkeep +0 -0
- package/usecases/brainstorming/SKILL.md +84 -0
- package/usecases/code-review/SKILL.md +79 -0
- package/usecases/code-review/references/performance-and-correctness.md +101 -0
- package/usecases/code-review/references/review-guide.md +70 -0
- package/usecases/code-review/references/security.md +119 -0
- package/usecases/create-feature/SKILL.md +94 -0
- package/usecases/create-feature/scripts/lock-tests.mjs +66 -0
- package/usecases/create-feature/workflow.js +440 -0
- package/usecases/design/SKILL.md +61 -0
- package/usecases/design/references/svg-guide.md +14 -0
- package/usecases/design/scripts/check-svg.py +77 -0
- package/usecases/fix-bug/SKILL.md +96 -0
- package/usecases/fix-bug/workflow.js +298 -0
- package/usecases/generate-test-scenarios/SKILL.md +97 -0
- package/usecases/generate-test-scenarios/references/test-case-guide.md +171 -0
- package/usecases/generate-test-scenarios/scripts/render-test-cases-markdown.mjs +76 -0
- package/usecases/generate-test-scenarios/scripts/render-test-cases.mjs +68 -0
- package/usecases/generate-test-scenarios/scripts/test-case-fields.mjs +63 -0
- package/usecases/generate-test-scenarios/scripts/validate-test-cases.mjs +69 -0
- package/usecases/generate-test-scenarios/scripts/write-xlsx.mjs +157 -0
- package/usecases/spec-writing/SKILL.md +59 -0
- package/usecases/spec-writing/references/spec-guide.md +62 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: levi-spec-writing
|
|
3
|
+
description: Write or update a project spec with the PM, without inventing anything. The PM lists every open question and doubt, the user confirms them, and the spec is written only once the facts are sufficient and confirmed; whatever is still unconfirmed is left as an open question, never filled in. The spec goes to docs/specs/<slug>.md. Fits requests such as "write a spec for X", "update the spec of X", "turn this idea into a spec", "viết spec cho X".
|
|
4
|
+
argument-hint: "<what the spec is about>"
|
|
5
|
+
skill-for: pm
|
|
6
|
+
skill-when: you write or update a spec
|
|
7
|
+
skill-guide: references/spec-guide.md
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Spec writing
|
|
11
|
+
|
|
12
|
+
Turn a request into a spec that contains only what is certain. `levi-pm` is the only agent that writes the spec; you run it in turn, relay its questions to the user, and never write, edit or answer any part of the spec yourself.
|
|
13
|
+
|
|
14
|
+
A spec is a promise to the rest of the team: **a line goes into the spec only when it is confirmed.** What counts as confirmed, and the format of the spec, are in `references/spec-guide.md`; the PM follows that guide.
|
|
15
|
+
|
|
16
|
+
## Files
|
|
17
|
+
|
|
18
|
+
| File | Owner | Purpose |
|
|
19
|
+
|---|---|---|
|
|
20
|
+
| `docs/specs/<slug>.md` | PM | **The deliverable**: the spec |
|
|
21
|
+
| `docs/levi/<slug>/ledger.md` | PM | Scratch: confirmed facts, open questions and the readiness verdict. Deleted at the end |
|
|
22
|
+
|
|
23
|
+
`<slug>` is a short kebab-case name for the subject, in English (for example `export-orders-csv`). Create folders as needed. Pass the PM the exact paths it should read and write. Only the PM touches either file.
|
|
24
|
+
|
|
25
|
+
## Steps
|
|
26
|
+
|
|
27
|
+
1. **Intake.** The request is the subject. If it is empty, ask what the spec is about and stop. Derive the slug. Note every file or link the user mentioned: they are sources.
|
|
28
|
+
2. **Find an existing spec.** List `docs/specs/` and match files against the subject by name and title.
|
|
29
|
+
- One clear match: update mode, using that file.
|
|
30
|
+
- Two or more equally plausible: ask the user which one (or "new spec"), then continue.
|
|
31
|
+
- None: new spec at `docs/specs/<slug>.md`.
|
|
32
|
+
3. **PM discovers.** Call `levi-pm` with the subject, the source paths, the existing spec path (update mode), and the ledger path. It reads every source and writes `ledger.md` in this format:
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
## Confirmed
|
|
36
|
+
| ID | Fact | Source |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| F1 | <one fact> | user / <file path> / existing spec |
|
|
39
|
+
|
|
40
|
+
## Open questions
|
|
41
|
+
| ID | Question | Why it matters | Options (recommended first) | Blocks |
|
|
42
|
+
|---|---|---|---|---|
|
|
43
|
+
| Q1 | <question> | <what in the spec changes with the answer> | A, B, C | goal / scope / story / criterion / ... |
|
|
44
|
+
|
|
45
|
+
## Readiness
|
|
46
|
+
Ready to write: yes | no
|
|
47
|
+
Missing: <what is still unconfirmed and which section it blocks>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The PM must look hard for what is unclear before it says anything is ready: unclear rules, missing states, edge cases and error cases, who the users are and their permissions, what is out of scope, data and limits, priorities, integrations, and terms that could mean two things. Anything it cannot point to a source for is an open question, not a fact. It also lists the questions in its reply.
|
|
51
|
+
4. **Ask the user, all at once.** Take every open question from the ledger and ask them in one round (use the tool's structured question feature if it has one; if it limits the number of questions per call, make the calls back to back). Give each question two to four options with the recommended one first, and let the user answer freely instead. "Not sure yet" is a valid answer and leaves the question open. Do not answer a question for the user and do not treat its recommended option as the answer. Skip this step when there are no open questions.
|
|
52
|
+
5. **PM absorbs the answers.** Call `levi-pm` with the user's answers, quoted as given, and the ledger path. It moves each answered question into Confirmed (source: user), closes it, adds any follow-up question the answers newly raise, and updates Readiness. Then:
|
|
53
|
+
- The ledger says ready: go to step 6.
|
|
54
|
+
- Not ready, and there are open questions the user can still answer: go back to step 4. Ask only the new and the still-open ones. At most three rounds in total.
|
|
55
|
+
- The user says to write now, or the three rounds are used up: go to step 6 with what is confirmed. Say what is still open.
|
|
56
|
+
- The goal, the users or the core scope are still unconfirmed: do not write a spec. Tell the user exactly what is missing and stop. Keep `ledger.md` so a later run can continue; do not delete it.
|
|
57
|
+
6. **PM writes the spec.** Call `levi-pm` with the ledger path and the spec path. It writes `docs/specs/<slug>.md` following `references/spec-guide.md`, using only Confirmed facts, in the language of the request. In update mode it changes only what a confirmed fact touches and leaves the rest as it was. Every unresolved question goes into the spec's Open questions; a section that depends on one says so instead of being filled in.
|
|
58
|
+
7. **Clean up.** Delete `ledger.md`, then remove `docs/levi/<slug>/` if empty, and `docs/levi` if that is empty. Delete only after the spec is written. The spec's Source column keeps the traceability.
|
|
59
|
+
8. **Report.** Tell the user the spec path, whether it is new or updated, its Status, how many stories and acceptance criteria it holds, the open questions still in it (one line each).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Spec guide
|
|
2
|
+
|
|
3
|
+
How `levi-pm` writes or updates a spec, in the `spec-writing` usecase and in every usecase that has it write one. The prompt names the spec to write, the sources, and the facts already confirmed (for example a ledger).
|
|
4
|
+
|
|
5
|
+
## Only what is confirmed
|
|
6
|
+
|
|
7
|
+
A spec is a promise to the rest of the team, so the rule is simple: **a line goes into the spec only when it is confirmed.** Confirmed means one of:
|
|
8
|
+
|
|
9
|
+
- the user stated it, in the request or in an answer to a question;
|
|
10
|
+
- it is written in a document the user pointed to, or in a project file the PM read (the path is the proof);
|
|
11
|
+
- for an update, it is already in the existing spec and the user did not change it.
|
|
12
|
+
|
|
13
|
+
These are not confirmed, and never go into the spec as fact: a guess, a plausible default, "what products like this usually do", a recommended option the user did not accept, an unanswered question. They stay open questions.
|
|
14
|
+
|
|
15
|
+
In update mode, change only what a confirmed fact touches and leave the rest as it was.
|
|
16
|
+
|
|
17
|
+
## Format
|
|
18
|
+
|
|
19
|
+
`docs/specs/<slug>.md`, in the language of the request:
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
# <Title>
|
|
23
|
+
|
|
24
|
+
- **Status:** Ready | Draft (open questions remain)
|
|
25
|
+
- **Sources:** <documents and people the facts come from>
|
|
26
|
+
|
|
27
|
+
## Goal
|
|
28
|
+
<What the product or change must achieve, and for whom.>
|
|
29
|
+
|
|
30
|
+
## Users
|
|
31
|
+
<Who uses it and what each kind of user may do.>
|
|
32
|
+
|
|
33
|
+
## Scope
|
|
34
|
+
<What is included.>
|
|
35
|
+
|
|
36
|
+
## Out of scope
|
|
37
|
+
<What is explicitly excluded.>
|
|
38
|
+
|
|
39
|
+
## User stories
|
|
40
|
+
| ID | Story | Source |
|
|
41
|
+
|---|---|---|
|
|
42
|
+
| US-1 | As a <user>, I want <goal>, so that <reason> | user / <file path> |
|
|
43
|
+
|
|
44
|
+
## Acceptance criteria
|
|
45
|
+
| ID | Story | Criterion | Source |
|
|
46
|
+
|---|---|---|---|
|
|
47
|
+
| AC-1 | US-1 | <observable behavior that can be checked yes or no> | user / <file path> |
|
|
48
|
+
|
|
49
|
+
## Rules and constraints
|
|
50
|
+
<Business rules, limits, states and error cases. Omit this section when none is confirmed.>
|
|
51
|
+
|
|
52
|
+
## Open questions
|
|
53
|
+
| # | Question | Blocks |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
| 1 | <unanswered question> | <the section it blocks> |
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- **Status** is Ready only when Open questions is empty; otherwise Draft.
|
|
59
|
+
- Every story and criterion has a **Source**. A row with no source does not belong in the spec.
|
|
60
|
+
- Criteria describe behavior the user or a tester can observe, never how it is built. Do not name technologies, tables or classes unless the user stated them as a requirement.
|
|
61
|
+
- Goal, Users, Scope, Out of scope, Stories and Criteria are always present. When nothing is confirmed for one, its body is `Not yet defined. See Open questions.`, with the matching question listed.
|
|
62
|
+
- Open questions are written as questions, never as assumptions. The spec has no "Assumptions" section.
|