@sumrco/cli 0.3.5 → 0.3.7

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.
Files changed (42) hide show
  1. package/ai/modules/kontract/resources/api-generation-standards.rf.md +2 -0
  2. package/ai/modules/kontract/resources/authoring/configuration.rf.md +13 -0
  3. package/ai/modules/kontract/resources/authoring/design-profile/api-styles.rf.md +11 -0
  4. package/ai/modules/kontract/resources/authoring/design-profile/async-styles.rf.md +53 -0
  5. package/ai/modules/kontract/resources/authoring/overview.md +3 -0
  6. package/ai/modules/kontract/resources/authoring/schema-reuse.rf.md +3 -0
  7. package/ai/modules/kontract/resources/authoring/spec-layout.rf.md +12 -4
  8. package/ai/modules/kontract/resources/authoring/team-members/spec-author.tm.md +3 -0
  9. package/ai/modules/kontract/resources/authoring/workflows/{spec-change.wf.md → spec-change.cmd.md} +5 -3
  10. package/ai/modules/kontract/resources/generated-output.rf.md +99 -4
  11. package/ai/modules/kontract/resources/overview.md +3 -0
  12. package/ai/modules/mission/resources/flow-actions.rf.md +28 -3
  13. package/ai/modules/mission/resources/flow-config.rf.md +2 -2
  14. package/ai/modules/mission/resources/flow-safety-boundaries.rf.md +7 -0
  15. package/ai/modules/mission/resources/overview.md +69 -11
  16. package/ai/modules/mission/resources/stage-closeout.rf.md +15 -5
  17. package/ai/modules/mission/resources/stage-delivery.rf.md +19 -6
  18. package/ai/modules/mission/resources/stage-intake.rf.md +58 -8
  19. package/ai/modules/mission/resources/stage-planning.rf.md +17 -3
  20. package/ai/modules/mission/resources/stage-pull-request.rf.md +5 -2
  21. package/ai/modules/mission/resources/stage-quality.rf.md +25 -4
  22. package/ai/modules/mission/resources/team-members/delivery-lead.tm.md +5 -3
  23. package/ai/modules/mission/resources/team-members/implementer.tm.md +10 -3
  24. package/ai/modules/mission/resources/team-members/planner.tm.md +25 -15
  25. package/ai/modules/mission/resources/team-members/pr-writer.tm.md +4 -3
  26. package/ai/modules/mission/resources/team-members/product-owner.tm.md +8 -2
  27. package/ai/modules/mission/resources/team-members/quality-lead.tm.md +16 -3
  28. package/ai/modules/mission/resources/workflows/{daily-triage.wf.md → daily-triage.cmd.md} +5 -4
  29. package/ai/modules/mission/resources/workflows/{full-delivery.wf.md → full-delivery.cmd.md} +3 -3
  30. package/ai/modules/mission/resources/workflows/{mission-cycle.wf.md → mission-cycle.cmd.md} +9 -5
  31. package/ai/modules/mission/resources/workflows/{planning-only.wf.md → planning-only.cmd.md} +5 -4
  32. package/ai/modules/mission/resources/workflows/{pr-assist.wf.md → pr-assist.cmd.md} +5 -4
  33. package/ai/modules/mission/resources/workflows/{standard-delivery.wf.md → standard-delivery.cmd.md} +3 -3
  34. package/ai/modules/mission/sumr.module.yaml +20 -2
  35. package/ai/modules/playbook/resources/authoring/content-structure.rf.md +16 -1
  36. package/ai/modules/playbook/resources/authoring/extraction.rf.md +4 -2
  37. package/ai/modules/playbook/resources/authoring/markdown.rf.md +20 -0
  38. package/ai/modules/playbook/resources/authoring/overview.md +9 -1
  39. package/ai/modules/playbook/resources/authoring/patterns.rf.md +99 -0
  40. package/ai/modules/playbook/sumr.module.yaml +3 -0
  41. package/index.js +475 -319
  42. package/package.json +8 -8
@@ -1,8 +1,8 @@
1
1
  ---
2
- category: workflow
2
+ category: command
3
3
  name: standard-delivery
4
4
  title: Standard Mission Delivery
5
- description: "Runs the default practical Mission flow from issue intake through plan approval, implementation evidence, validation, quality gate, and PR preview."
5
+ description: "Runs the default practical Mission flow from issue intake through plan approval, implementation evidence, validation, quality gate, and PR preview. Use when delivering a normal, well-scoped issue."
6
6
  ---
7
7
 
8
8
  # Standard Mission Delivery
@@ -10,7 +10,7 @@ description: "Runs the default practical Mission flow from issue intake through
10
10
  Use this workflow for normal issue delivery.
11
11
 
12
12
  ```text
13
- issue.sync -> context.research(skipped) -> plan.create -> plan.approve(human) -> branch.check(ask) -> work.claim -> implementation.report -> review.report -> validation.report -> quality.gate -> pr.prepare(ask) -> pr.create(human)
13
+ issue.sync -> context.research(skipped) -> plan.create -> plan.approve(human) -> branch.check(ask) -> work.claim -> tasks.execute -> tasks.review -> validation.report -> quality.gate -> pr.prepare(ask) -> pr.create(human)
14
14
  ```
15
15
 
16
16
  Stop for human approval before implementation and before PR creation.
@@ -45,7 +45,7 @@ spec:
45
45
  summary: Claim a mission for implementation
46
46
  visibility: public
47
47
  - name: report
48
- summary: Create a mission report
48
+ summary: Create a mission-level research, handoff, validation, or quality report
49
49
  visibility: public
50
50
  - name: reopen
51
51
  summary: Record a QA failure and drive a corrective cycle
@@ -57,7 +57,7 @@ spec:
57
57
  summary: Clear a mission blocker
58
58
  visibility: public
59
59
  - name: close
60
- summary: Close a completed mission
60
+ summary: Close an eligible mission after a terminal finish disposition
61
61
  visibility: public
62
62
  - name: clean
63
63
  summary: Remove expired closed mission cache
@@ -65,9 +65,27 @@ spec:
65
65
  - name: flow
66
66
  summary: Inspect and configure Mission flow presets
67
67
  visibility: public
68
+ - name: providers
69
+ summary: Inspect registered work and repository provider capabilities
70
+ visibility: public
68
71
  - name: pr
69
72
  summary: Prepare or create a pull request from Mission evidence
70
73
  visibility: public
74
+ - name: task
75
+ summary: Inspect and advance accepted-plan execution tasks
76
+ visibility: public
77
+ - name: review
78
+ summary: Import a structured spec or quality review for a submitted task
79
+ visibility: public
80
+ - name: finding
81
+ summary: Append a resolution to a task review finding
82
+ visibility: public
83
+ - name: verify
84
+ summary: Import and inspect structured verification receipts
85
+ visibility: public
86
+ - name: finish
87
+ summary: Record an explicit finish disposition without external or destructive actions
88
+ visibility: public
71
89
  exports:
72
90
  resources: []
73
91
  binaries: []
@@ -35,12 +35,19 @@ Brief intro — one or two sentences. Optional.
35
35
  High-level rules or overview. Keep concise.
36
36
  Push deep details to reference files in the same folder.
37
37
 
38
+ ## Non-Negotiables
39
+
40
+ - **MUST** state hard rules with a signal word, one per line.
41
+ - **NEVER** bury an absolute rule inside prose — it belongs here.
42
+
38
43
  ## Key Section
39
44
 
40
45
  Main content. Code snippets inline for short examples.
41
46
 
42
47
  <!-- extract:examples -->
43
- ## Examples
48
+ ## State Map Example
49
+
50
+ **✅ Good** — model transitions as data so the AI extends one object
44
51
 
45
52
  \`\`\`ts
46
53
  const stateByTransition = {
@@ -48,11 +55,19 @@ const stateByTransition = {
48
55
  review: ['approved', 'changes-requested'],
49
56
  } as const;
50
57
  \`\`\`
58
+
59
+ **❌ Bad** — scattered if/else branches the AI cannot reason about as a whole
60
+
61
+ \`\`\`ts
62
+ if (state === 'draft') return ['review'];
63
+ if (state === 'review') return ['approved', 'changes-requested'];
64
+ \`\`\`
51
65
  <!-- /extract:examples -->
52
66
  ```
53
67
 
54
68
  Rules:
55
69
  - `## When to Use` is required in every main doc.
70
+ - Use a `## Non-Negotiables` section for hard rules and a ✅/❌ paired example for non-obvious conventions — see **Patterns**.
56
71
  - Keep the main doc under ~180 lines. If it goes over, move deep sections to `category: reference` files.
57
72
  - Do not add a `## References` or `## Related` section manually — the playbook sync generates the reference table automatically.
58
73
 
@@ -29,15 +29,17 @@ Wrap dedicated examples sections with extraction markers:
29
29
  <!-- /extract:examples -->
30
30
  ```
31
31
 
32
- Skill-folder channels remove the extracted block from `SKILL.md`, write it to `examples.md`, and add an `## Additional resources` link. Flat-file channels keep extracted content inline because they cannot attach supporting files.
32
+ Skill-folder channels remove the extracted block from `SKILL.md`, write it to a heading-based support file under `examples/`, and add an `## Additional resources` link. Main-topic extracts render as `examples/<heading-slug>.md` (for example `examples/examples.md`). Reference doc extracts render as `examples/<reference-stem>-<heading-slug>.md`. Flat-file channels keep extracted content inline because they cannot attach supporting files.
33
33
 
34
- Multiple `<!-- extract:examples -->` blocks in the same file are **merged** into one output. Each block must be self-contained — include any intro or title inside the marker, not outside it.
34
+ Each `<!-- extract:examples -->` block must start with a Markdown heading because the heading becomes the generated file name. Blocks that produce the same file name are merged with a separator. Each block must be self-contained — include any intro or title inside the marker, not outside it.
35
35
 
36
36
  > [!CAUTION]
37
37
  > Do not leave an intro sentence outside the marker with nothing below it:
38
38
  > ```markdown
39
39
  > Use the following pattern: ← orphaned intro — BAD
40
40
  > <!-- extract:examples -->
41
+ > ## Role Map Example
42
+ >
41
43
  > \`\`\`ts
42
44
  > const roleByStatus = { draft: 'writer', ready: 'reviewer' } as const;
43
45
  > \`\`\`
@@ -56,6 +56,24 @@ Limit to **1-2 callouts per major section**. If everything is critical, nothing
56
56
  - `*italic*` sparingly for secondary emphasis
57
57
  - Pick asterisks consistently — never mix `*` and `_`
58
58
 
59
+ ## Signal Words and Status Markers
60
+
61
+ Calibrate rule strength with keywords agents weight: `MUST`, `MUST NEVER`, `ALWAYS`, `NEVER` for hard rules; `SHOULD`, `PREFER`, `AVOID` for defaults. Reserve the hard words for the few truly absolute rules — see **Patterns** for the full calibration table and non-negotiable conventions.
62
+
63
+ Status markers (`✅`, `❌`, `⚠`) are allowed as inline labels and inside callout bodies — never in headings. Use them to mark paired good/bad examples, not as decoration.
64
+
65
+ ## Validation Checklists
66
+
67
+ When a doc describes a process the agent must follow, end it with a task checklist it can walk literally:
68
+
69
+ ```markdown
70
+ - [ ] Run `sumr playbook validate --source docs`
71
+ - [ ] Preview with `sumr playbook sync --source docs --dry-run`
72
+ - [ ] Resolve every warning before a real sync
73
+ ```
74
+
75
+ A checklist is more reliable than the same steps buried in a paragraph.
76
+
59
77
  ## Lists
60
78
 
61
79
  - Ordered (`1.`) when sequence matters (steps, priority order)
@@ -106,3 +124,5 @@ Limit to **1-2 callouts per major section**. If everything is critical, nothing
106
124
  | Trailing colon on heading (`## When to Use:`) | Remove trailing punctuation |
107
125
  | Bare URLs | Wrap in `[text](url)` |
108
126
  | Table for non-tabular data | Use a list instead |
127
+ | Hard signal word on a soft preference (`MUST` for a nicety) | Use `SHOULD`/`PREFER` for defaults |
128
+ | Prose "do X, not Y" with no example | Add a ✅/❌ paired block (see **Patterns**) |
@@ -176,12 +176,18 @@ Wrap dedicated examples sections with markers so they can be consumed separately
176
176
  <!-- /extract:examples -->
177
177
  ```
178
178
 
179
- **When to extract:** Dedicated `## Examples` sections, sample templates, and long boilerplate blocks. Skill-folder channels remove the block from `SKILL.md`, write it to `examples.md`, and add an `## Additional resources` link.
179
+ **When to extract:** Dedicated `## Examples` sections, sample templates, and long boilerplate blocks. Each extract block must start with a Markdown heading; skill-folder channels use that heading for the support filename, remove the block from `SKILL.md`, and add an `## Additional resources` link. Main-topic extracts render as `examples/<heading-slug>.md`; reference extracts render as `examples/<reference-stem>-<heading-slug>.md`.
180
180
 
181
181
  **Keep in main doc:** Short inline snippets, file structure trees, ASCII diagrams, schema outlines that are core to the instructions.
182
182
 
183
183
  See **Extraction** for the full code-block classification table.
184
184
 
185
+ ## Good/Bad Patterns and Non-Negotiables
186
+
187
+ Teach AI channels with contrast, not prose. For any non-obvious naming, folder, or structure convention, show a ✅ Good example beside an ❌ Bad one — each with a one-line *why* — and wrap the pair with `<!-- extract:examples -->`. Put absolute rules in a dedicated `## Non-Negotiables` section using `MUST`/`NEVER`; keep softer defaults as `SHOULD`/`PREFER`.
188
+
189
+ See **Patterns** for the labelling convention, the signal-word calibration table, and where emoji belong.
190
+
185
191
  ## Flow Documentation
186
192
 
187
193
  Use a compact arrow flow for simple workflows:
@@ -227,6 +233,8 @@ Before committing any `.md` file under `{{PLAYBOOK_PATH}}/`:
227
233
  - [ ] Main how-to docs have `## When to Use` section
228
234
  - [ ] Reference files have `title`, `label`, `when`, `order` — and no `## When to Use` in body
229
235
  - [ ] Dedicated examples, samples, and templates wrapped with `<!-- extract:examples -->`; no standalone examples section left unwrapped
236
+ - [ ] Non-obvious naming, folder, or structure conventions show a ✅ Good / ❌ Bad pair with a one-line why
237
+ - [ ] Absolute rules sit in a `## Non-Negotiables` section using `MUST`/`NEVER`; soft defaults use `SHOULD`/`PREFER`
230
238
  - [ ] Workflow and lifecycle docs use a compact arrow flow or Mermaid diagram when state transitions matter
231
239
  - [ ] No `references:` frontmatter field
232
240
  - [ ] No `## References` or `## Related` sections added manually
@@ -0,0 +1,99 @@
1
+ ---
2
+ category: reference
3
+ name: authoring-patterns
4
+ title: Good/Bad Patterns and Non-Negotiables
5
+ description: "Conventions for paired good/bad code examples and non-negotiable rules that steer how AI channels name, structure, and build code."
6
+ label: Patterns
7
+ when: Writing good/bad code examples, adding non-negotiable rules, calibrating MUST/NEVER vs SHOULD/PREFER, teaching naming and folder conventions
8
+ order: 25
9
+ ---
10
+
11
+ # Good/Bad Patterns and Non-Negotiables
12
+
13
+ Contrastive examples and absolute rules are the highest-signal way to steer an AI channel's output. A paired good/bad example teaches the *principle*; a non-negotiable draws a hard line the agent must not cross. A doc that only describes rules in prose produces vaguer code than a doc that shows the right shape beside the wrong one.
14
+
15
+ ## Paired Good/Bad Examples
16
+
17
+ Show the correct shape next to the wrong one, each with a one-line reason. The *why* is what generalizes — without it the agent copies the shape but misses the rule.
18
+
19
+ Rules:
20
+
21
+ - Label each block with a bold header: `**✅ Good** — <why>` then `**❌ Bad** — <why>`.
22
+ - Put the ✅ Good block first.
23
+ - Keep both blocks minimal — only the lines that carry the contrast.
24
+ - Always wrap the pair with `<!-- extract:examples -->` so it becomes a standalone example file (see **Extraction**).
25
+
26
+ Rendered, a pair looks like this:
27
+
28
+ **✅ Good** — colocate the test beside the unit so they move and rename together
29
+
30
+ ```text
31
+ user/
32
+ ├── user.service.ts
33
+ └── user.service.test.ts
34
+ ```
35
+
36
+ **❌ Bad** — a parallel mirror tree drifts out of sync the moment a file moves
37
+
38
+ ```text
39
+ tests/unit/user/user.service.test.ts
40
+ ```
41
+
42
+ In the source doc, wrap the pair so it extracts as a self-contained example file:
43
+
44
+ ````markdown
45
+ <!-- extract:examples -->
46
+ ## Test Colocation
47
+
48
+ **✅ Good** — colocate the test beside the unit
49
+
50
+ ```text
51
+ user/
52
+ ├── user.service.ts
53
+ └── user.service.test.ts
54
+ ```
55
+
56
+ **❌ Bad** — a distant mirror tree drifts out of sync
57
+
58
+ ```text
59
+ tests/unit/user/user.service.test.ts
60
+ ```
61
+ <!-- /extract:examples -->
62
+ ````
63
+
64
+ When the example is real code rather than a tree, the labels can also live as `// ✅ DO` / `// ❌ DON'T` comments inside the block so they survive copy-paste.
65
+
66
+ ## Non-Negotiables
67
+
68
+ Hard rules go in a dedicated `## Non-Negotiables` section near the top of the doc, as a short list. Keep it to the few rules that are truly inviolable — if everything is non-negotiable, nothing is.
69
+
70
+ - State each rule on one line, imperative, with a signal word.
71
+ - Pair a prohibition with its correct alternative where one exists.
72
+
73
+ ```markdown
74
+ ## Non-Negotiables
75
+
76
+ - **MUST** validate external input against a schema at the boundary before use.
77
+ - **NEVER** edit generated channel folders (`.claude/`, `.agents/`) — edit the source doc.
78
+ - **ALWAYS** colocate a test with the unit it covers.
79
+ ```
80
+
81
+ For the single hardest rule, a callout adds weight without inflating the list:
82
+
83
+ > [!CAUTION]
84
+ > Never commit secrets or `.env` files. A leaked credential cannot be un-leaked.
85
+
86
+ ## Signal-Word Calibration
87
+
88
+ Match the keyword to how absolute the rule is. Don't spend hard words on soft preferences — the contrast is what gives MUST and NEVER their weight.
89
+
90
+ | Strength | Keywords | Use for |
91
+ |----------|----------|---------|
92
+ | Hard | MUST, MUST NEVER, ALWAYS, NEVER | Non-negotiables, security, data-loss risk |
93
+ | Soft | SHOULD, PREFER, AVOID | Defaults the agent may override with a stated reason |
94
+
95
+ ## Where Emoji and Signal Words Belong
96
+
97
+ - ✅ / ❌ / ⚠ are allowed as **inline pattern labels** and **inside callout bodies**.
98
+ - Keep emoji and signal words out of **headings** — headings stay structural (see **Markdown**).
99
+ - One ✅/❌ pair per concept. Stacking many pairs or callouts flattens the signal.
@@ -38,6 +38,9 @@ spec:
38
38
  - name: authoring
39
39
  summary: Print the canonical Playbook Markdown authoring contract
40
40
  visibility: public
41
+ - name: migrate
42
+ summary: Move command-era category workflow docs to command and .wf.md to .cmd.md
43
+ visibility: public
41
44
  exports:
42
45
  resources: []
43
46
  binaries: []