@lemoncode/lemony 0.1.2 → 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.
@@ -29,7 +29,7 @@ the gap by guessing — surface it (see "When the PRD is insufficient").
29
29
  real from the start — there is no `draft-<slug>` holder:
30
30
  - `requirements.md` — EARS requirements with acceptance criteria
31
31
  - `design.md` — files, functions, approach, edge cases, testing
32
- - `tasks.md` — atomic, ordered, checkbox tasks
32
+ - `tasks.md` — atomic, ordered checkbox tasks, grouped under risk-sized step headers
33
33
 
34
34
  ## Process
35
35
 
@@ -126,16 +126,40 @@ Atomic, ordered checkboxes. Each task is a **vertical slice** (a behavior, not a
126
126
  layer) so the Implementer can run TDD red→green per task. Reference the requirements
127
127
  each task satisfies.
128
128
 
129
+ Group the tasks under **risk-sized step headers**. In step-by-step mode the loop runs
130
+ one implement→review→human-checkpoint cycle **per group**, so the grouping decides how
131
+ often the human is interrupted; the human approves it at the spec gate with the rest
132
+ of the spec. Grouping criterion:
133
+
134
+ 1. **Risk isolates — hard rule.** A task gets its own group iff it concentrates risk:
135
+ a new seam, a hard-to-reverse decision, a data-loss or security surface.
136
+ 2. **Runnable surface closes — soft rule.** Among trivial stretches, prefer group
137
+ boundaries that leave something the human can run at the checkpoint. Never invent
138
+ a group to fabricate a demo.
139
+ 3. **Soft cap: 4 tasks per group**, exceedable only with explicit justification in
140
+ the group's rationale (e.g. "5 identical mechanical renames").
141
+ 4. **Every group header carries a one-line boundary rationale** so the grouping is
142
+ auditable at the spec gate.
143
+
129
144
  ```markdown
130
145
  # Tasks — <topic>
131
146
 
147
+ ## Group 1 — <name> _(<one-line boundary rationale>)_
148
+
132
149
  - [ ] T1 — <smallest behavior that proves the path end-to-end> (R1)
133
150
  - [ ] T2 — <next behavior> (R2)
151
+
152
+ ## Group 2 — <name> _(<one-line boundary rationale>)_
153
+
134
154
  - [ ] T3 — <error path> (R2, R3)
135
155
  ```
136
156
 
137
157
  Rules: order so the first task is a tracer bullet; never "write all tests" then
138
- "write all code"; keep each task small enough to verify on its own.
158
+ "write all code"; keep each task small enough to verify on its own. Grouping never
159
+ changes task granularity — checkboxes stay atomic and TDD runs per task; only review
160
+ and checkpoint frequency follow the groups (all-at-once mode ignores the headers).
161
+ Tasks added mid-implementation (from a discovery) default to **their own group** —
162
+ they are risk by definition.
139
163
 
140
164
  ### 5. Self-check before handing off
141
165
 
@@ -143,6 +167,8 @@ Rules: order so the first task is a tracer bullet; never "write all tests" then
143
167
  - [ ] Every requirement is EARS-formatted and testable.
144
168
  - [ ] At least one unwanted-behavior (`If … then …`) requirement exists.
145
169
  - [ ] Every requirement is covered by at least one task.
170
+ - [ ] Every task sits in a group, and every group header carries a one-line
171
+ boundary rationale.
146
172
  - [ ] No closed PRD decision is contradicted.
147
173
 
148
174
  ### 6. Emit `spec_created`
@@ -64,7 +64,9 @@ is a second discovery — append it, don't fold it in.
64
64
 
65
65
  The agent that **created** an artifact is the one that updates it. Map the decision to
66
66
  the artifact it changes, then invoke that owner (fresh context, Task tool) with the
67
- decision + the entry as context:
67
+ decision **stated in full** — at this moment it exists nowhere on disk; the entry's
68
+ `**Resolution**` block is only written at step 4 — plus the `discoveries.md` entry
69
+ **by path** for the surrounding context (it reads the entry itself):
68
70
 
69
71
  | Artifact changed by the decision | Owner to invoke |
70
72
  | -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -104,7 +106,9 @@ do not edit the raise fields):
104
106
  Same fail-loud contract: a non-zero exit means the flag/status did not flip back.
105
107
 
106
108
  2. Re-invoke the paused sub-agent (fresh context) with: the issue, the task-state
107
- paths, the decision, and the updated artifact. It picks up from where it stopped.
109
+ paths, a one-line gist of the decision (the full `**Resolution**` block now
110
+ lives in the `discoveries.md` entry — reference it), and the updated artifact's
111
+ **path**. It reads the files itself and picks up from where it stopped.
108
112
 
109
113
  ## Closeout invariant
110
114
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spec-compliance-check
3
- description: Walk an L1 spec point by point against the implementation and emit a per-requirement pass/fail verdict. Use during review of an SDD task to prove every EARS requirement (including unwanted-behavior paths) is satisfied and tested — a committable audit trail. Complements `senior-review` (quality) with traceability (coverage of intent).
3
+ description: Walk an L1 spec point by point against the implementation and emit a per-requirement pass/fail verdict. Use during review of an SDD task to prove every EARS requirement (including unwanted-behavior paths) is satisfied and tested — a durable audit trail. Complements `senior-review` (quality) with traceability (coverage of intent).
4
4
  origin: vendor
5
5
  vendor_version: '{{vendor_version}}'
6
6
  phase: post-implementation
@@ -11,7 +11,7 @@ invoked-by: [reviewer]
11
11
 
12
12
  `senior-review` judges whether the code is _good_; this skill proves it does what the
13
13
  **spec said** — every requirement, point by point. It produces a traceability matrix:
14
- a committable audit trail mapping each requirement to its implementation and its test.
14
+ a durable audit trail mapping each requirement to its implementation and its test.
15
15
  Only meaningful for **L1 (SDD) tasks** that have a spec under
16
16
  `.claude/state/tasks/<id>/spec/`; skip it for L2.
17
17
 
@@ -25,8 +25,8 @@ Read all three spec artifacts for the task:
25
25
  state-driven / optional-feature / **unwanted-behavior**), each numbered with
26
26
  acceptance criteria.
27
27
  - `design.md` — the intended files, interfaces, approach, edge cases.
28
- - `tasks.md` — the atomic checklist, each item referencing the requirements it
29
- satisfies.
28
+ - `tasks.md` — the atomic checklist grouped under risk-sized step headers, each
29
+ item referencing the requirements it satisfies.
30
30
 
31
31
  ### 2. Trace each requirement to the implementation
32
32
 
@@ -55,6 +55,10 @@ and asserts the rejection/guard.
55
55
 
56
56
  ### 4. Emit the matrix
57
57
 
58
+ Destination: the full-pass **issue comment**. In your return summary — and always on
59
+ a per-step review, which posts no comment — carry only the counts + the failing
60
+ rows, per the Reviewer's verdict-size rule.
61
+
58
62
  ```
59
63
  ## Spec Compliance — task #<id>
60
64
 
@@ -87,8 +87,9 @@ The three differ in **who decides** — and the asymmetry is deliberate:
87
87
 
88
88
  - **`update-architecture` — automatic dispatch, no pre-offer.** Only when
89
89
  `docs/architecture.md` exists (the skill installs solely then). Dispatch the
90
- **Architect** (`update-architecture`, fresh context) with the task's **merged diff**
91
- (`gh pr diff <pr>`) plus the task's `spec/design.md` (still live here — archival is
90
+ **Architect** (`update-architecture`, fresh context) with the task's **PR number**
91
+ (it runs `gh pr diff <pr>` itself) plus the **path** of the task's `spec/design.md`
92
+ (still live here — archival is
92
93
  step 4 below). The Architect reads the change, makes
93
94
  the smallest true edit if the system's **shape** moved (referencing any ADR just
94
95
  written — `see ADR-NNNN`), or reports **no-op** when nothing architectural changed.
@@ -52,6 +52,10 @@ For each file in the "always" set:
52
52
 
53
53
  ### 3. Report
54
54
 
55
+ Destination: the full-pass **issue comment**. In your return summary — and always on
56
+ a per-step review, which posts no comment — carry only the counts + the gaps, per
57
+ the Reviewer's verdict-size rule (a REJECT lifts the cap entirely).
58
+
55
59
  ```
56
60
  ## Test Gap Report — <task name>
57
61
 
@@ -84,6 +84,9 @@ and the error output (unexpected warnings/errors even when the happy path worked
84
84
  **Verdict**: works / does not work — <one-line reason>
85
85
  ```
86
86
 
87
+ This block is your working record; a capped return summary condenses it to the
88
+ verdict line (plus any ❌ detail — failures are signal, never trimmed).
89
+
87
90
  On a failure, read the **full** error, find the origin (not where it surfaced), fix
88
91
  the root cause, and re-run from the failed gate. If a failure reveals the spec itself
89
92
  is wrong or silent, that's a **discovery** — run `raise-discovery`, don't paper over
@@ -57,7 +57,8 @@ A task deserves the harness if it is **specifiable**, **verifiable**, or
57
57
  `harness:sdd` + `harness:status:spec-in-progress`) and the branch
58
58
  `harness/<id>-<slug>`. `<id>` is the GitHub issue number in this build; spec and code
59
59
  both live on that branch — nothing touches the default branch until the merge gate.
60
- 3. **UI design (if it touches UI)** — **UI design gate** (§UI design in `orchestrator.md`):
60
+ 3. **UI design (if it touches UI)** — **UI design gate** (canonical: the orchestrator's
61
+ L1 step 3, evaluated core-only — read `.claude/agents/ui-design.md` only when it fires):
61
62
  if the repo has a frontend AND the task touches UI, put `harness:needs-design`, offer the
62
63
  design-stop, and on "continue" **run `grill-ui` yourself** (the interactive design
63
64
  interview) to author `ui-handoff.md` under `tasks/<id>/spec/`, then dispatch the **UI
@@ -67,7 +68,7 @@ A task deserves the harness if it is **specifiable**, **verifiable**, or
67
68
  under `tasks/<id>/spec/`) then `spec-to-issue` (fills the issue body — it creates nothing
68
69
  and moves no labels).
69
70
  5. **Spec-ready + handoff** — remove `harness:needs-design` once `ui-handoff.md` is
70
- complete (a spec-ready task never carries it), flip to `harness:status:spec-ready`,
71
+ complete (a spec-ready task never carries the label), flip to `harness:status:spec-ready`,
71
72
  commit and push the task state to the branch. DEFINE can stop here: the spec-ready
72
73
  queue (`gh issue list -l harness:status:spec-ready`) is the handoff. Ask: implement
73
74
  now or hand off?
@@ -83,8 +84,10 @@ A task deserves the harness if it is **specifiable**, **verifiable**, or
83
84
  — either lens rejecting routes back to the Implementer.
84
85
  9. **Merge gate** — never auto-merge. Surface the approved PR; the human merges (or
85
86
  authorizes you to). The task stays at `in-review` until merged.
86
- 10. **Closeout** — `task-closeout`: confirm the merge via `gh`, offer durable discoveries
87
- to the Architect (`write-adr`, HITL), archive the spec + discoveries to `_archive/<id>/` (drop
87
+ 10. **Closeout** — `task-closeout`: confirm the merge via `gh`, run the three Architect
88
+ activations (`write-adr` HITL offer per resolved discovery; `update-architecture`
89
+ automatic when `docs/architecture.md` exists; `playbook-iterate` — HITL offer once
90
+ per task), archive the spec + discoveries to `_archive/<id>/` (drop
88
91
  `progress.md`), and land `history.md` + the archival via a dedicated
89
92
  `harness/closeout-<id>` PR (`gh pr merge --auto`) — never a direct push to the base.
90
93
  If protection needs approval the PR waits: park at `closeout-pending`, `/resume`
@@ -92,6 +95,8 @@ A task deserves the harness if it is **specifiable**, **verifiable**, or
92
95
 
93
96
  ## L2 round-trip (TRIAGE)
94
97
 
98
+ Authority for the steps: `.claude/agents/triage.md` (the Orchestrator's lazy companion).
99
+
95
100
  1. **Triage** — `triage-issue`: investigate, find root cause, draft a TDD-based fix
96
101
  plan, and create the issue with `harness:managed` (no `harness:sdd` — its absence
97
102
  marks the lightweight path).
package/dist/cli.mjs CHANGED
@@ -3930,6 +3930,12 @@ const CORE_AGENTS = [
3930
3930
  "architect",
3931
3931
  "ui-designer"
3932
3932
  ];
3933
+ const COMPANION_DOCS = [
3934
+ "fit-assessment",
3935
+ "triage",
3936
+ "spinoff",
3937
+ "ui-design"
3938
+ ];
3933
3939
  const renderFile = async (templatePath, relPath, vars) => {
3934
3940
  return {
3935
3941
  relPath,
@@ -3955,7 +3961,7 @@ const materializeVendorFiles = async (ctx) => {
3955
3961
  SKILLS: renderRoleSkills(skills, role),
3956
3962
  vendor_version: vendorVersion
3957
3963
  }), vendorVersion)));
3958
- const fitAssessment = await copyFileEntry(join(vendorRoot, "agents", "fit-assessment.md"), join(AGENTS_DIR, "fit-assessment.md"));
3964
+ const companionFiles = await Promise.all(COMPANION_DOCS.map((doc) => copyFileEntry(join(vendorRoot, "agents", `${doc}.md`), join(AGENTS_DIR, `${doc}.md`))));
3959
3965
  const skillFiles = (await Promise.all(skills.map(async (skill) => {
3960
3966
  const skillDir = join(vendorRoot, "skills", skill.name);
3961
3967
  const rels = await listFiles(skillDir);
@@ -3972,7 +3978,7 @@ const materializeVendorFiles = async (ctx) => {
3972
3978
  return [
3973
3979
  entryProtocol,
3974
3980
  ...agentFiles,
3975
- fitAssessment,
3981
+ ...companionFiles,
3976
3982
  ...skillFiles,
3977
3983
  playbooksReadme,
3978
3984
  ...hookFiles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemoncode/lemony",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "Lemony — a Harness for AI Coding. Vendor package: installer, agent role catalog, generic skill catalog, hooks, and templates for a Spec-Driven Development workflow.",
5
5
  "type": "module",
6
6
  "private": false,