@sumrco/cli 0.3.9 → 0.4.2

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 (41) hide show
  1. package/ARTIFACT-MANIFEST.json +18 -0
  2. package/README.md +12 -0
  3. package/THIRD_PARTY_NOTICES.md +1119 -0
  4. package/ai/modules/kontract/resources/api-generation-standards.rf.md +18 -5
  5. package/ai/modules/kontract/resources/authoring/configuration.rf.md +568 -12
  6. package/ai/modules/kontract/resources/authoring/schema-reuse.rf.md +25 -4
  7. package/ai/modules/kontract/resources/authoring/scope-and-splitting.rf.md +8 -6
  8. package/ai/modules/kontract/resources/authoring/spec-layout.rf.md +4 -0
  9. package/ai/modules/kontract/resources/generated-output.rf.md +712 -44
  10. package/ai/modules/kontract/resources/nestjs-eslint.rf.md +153 -0
  11. package/ai/modules/kontract/resources/openapi-sdk-generator-research.rf.md +177 -0
  12. package/ai/modules/kontract/resources/overview.md +70 -8
  13. package/ai/modules/kontract/resources/performance.rf.md +11 -2
  14. package/ai/modules/kontract/sumr.module.yaml +15 -14
  15. package/ai/modules/mission/resources/flow-config.rf.md +2 -2
  16. package/ai/modules/mission/resources/overview.md +42 -35
  17. package/ai/modules/mission/resources/stage-closeout.rf.md +5 -5
  18. package/ai/modules/mission/resources/stage-delivery.rf.md +5 -5
  19. package/ai/modules/mission/resources/stage-intake.rf.md +2 -2
  20. package/ai/modules/mission/resources/stage-planning.rf.md +43 -4
  21. package/ai/modules/mission/resources/stage-pull-request.rf.md +2 -2
  22. package/ai/modules/mission/resources/stage-quality.rf.md +8 -8
  23. package/ai/modules/mission/resources/team-members/planner.tm.md +17 -5
  24. package/ai/modules/mission/resources/workflows/daily-triage.cmd.md +5 -1
  25. package/ai/modules/mission/resources/workflows/mission-cycle.cmd.md +7 -5
  26. package/ai/modules/mission/resources/workflows/planning-only.cmd.md +8 -3
  27. package/ai/modules/mission/sumr.module.yaml +20 -16
  28. package/ai/modules/playbook/resources/authoring/extraction.rf.md +28 -1
  29. package/ai/modules/playbook/resources/authoring/frontmatter.rf.md +7 -0
  30. package/ai/modules/playbook/resources/authoring/overview.md +33 -2
  31. package/ai/modules/playbook/resources/authoring/patterns.rf.md +21 -0
  32. package/ai/modules/playbook/resources/team-members/technical-writer.tm.md +5 -1
  33. package/ai/modules/playbook/sumr.module.yaml +13 -12
  34. package/ai/registry.json +3 -3
  35. package/bin/sumr +18 -3
  36. package/eslint/index.mjs +2 -0
  37. package/eslint/kontract/index.mjs +22 -0
  38. package/eslint/kontract/rules/typescript-nestjs/operation-contract.mjs +656 -0
  39. package/index.js +3060 -462
  40. package/package.json +26 -23
  41. package/sbom.cdx.json +5111 -0
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: workflow
3
3
  title: Mission Workflow
4
- description: "Mission-based AI work orchestration for SUMR CLI. Use when a user mentions missions, {{MISSION_TRIGGER_HINTS}}, worktrees, planning, implementation, review, validation, PRs, blockers, handoffs, or closing AI-assisted work."
4
+ description: "Mission-based AI work orchestration for SUMR CLI. Use when a user mentions missions, work items, issues, tickets, tasks, work item IDs, issue keys, worktrees, planning, implementation, review, validation, PRs, blockers, handoffs, or closing AI-assisted work."
5
5
  tags: [mission, tickets, issues, worktree, ai-workflow, state, pr]
6
6
  ---
7
7
 
@@ -11,12 +11,15 @@ Use Mission when AI-assisted work needs durable state across sessions, agents, t
11
11
 
12
12
  ## Repo Identifier Context
13
13
 
14
- {{MISSION_IDENTIFIER_GUIDANCE}}
14
+ Run `sumr mission providers --json` and `sumr mission flow export --json` before interpreting
15
+ a bare work-item ID. Use the configured provider-owned identifier with `start`; after Mission
16
+ normalizes it, use the returned Mission key for later commands. Do not infer provider
17
+ capabilities from its name—the runtime capability catalog is authoritative.
15
18
 
16
19
  ## Configured Providers
17
20
 
18
- - Work provider: `{{MISSION_TRACKER_PROVIDER_LABEL}}` (`{{MISSION_TRACKER_PROVIDER}}`)
19
- - Repository provider: `{{MISSION_GIT_PROVIDER_LABEL}}` (`{{MISSION_GIT_PROVIDER}}`)
21
+ Read the configured work and repository providers from `sumr mission flow export --json`, then
22
+ verify their capabilities with `sumr mission providers --json`.
20
23
 
21
24
  Run `sumr mission providers --json` before assuming that either configured provider supports a
22
25
  capability. The runtime catalogs, not product names or remembered behavior, are the source of
@@ -24,44 +27,43 @@ truth.
24
27
 
25
28
  ## Configured Mission Flow
26
29
 
27
- This repo uses `{{MISSION_FLOW_PRESET}}`.
30
+ Mission owns flow interpretation. Run:
28
31
 
29
- ```text
30
- {{MISSION_FLOW_TEXT}}
32
+ ```bash
33
+ sumr mission flow export --json
31
34
  ```
32
35
 
33
- Steps:
34
-
35
- {{MISSION_FLOW_STEPS}}
36
-
37
- PR mode: `{{MISSION_PR_MODE}}`
36
+ Use the returned preset, ordered steps, advance policies, providers, issue prefixes, and PR mode.
37
+ Never reconstruct preset defaults in Playbook resources or from memory.
38
38
 
39
39
  ## Core Commands
40
40
 
41
41
  ```bash
42
42
  sumr mission init
43
43
  sumr mission providers --json
44
- sumr mission start {{MISSION_ISSUE_KEY_EXAMPLE}} --title "Fix checkout flow"
45
- sumr mission sync {{MISSION_ISSUE_KEY_EXAMPLE}}
46
- sumr mission status {{MISSION_ISSUE_KEY_EXAMPLE}}
47
- sumr mission plan {{MISSION_ISSUE_KEY_EXAMPLE}} --from plan.md
48
- sumr mission approve {{MISSION_ISSUE_KEY_EXAMPLE}}
49
- sumr mission claim {{MISSION_ISSUE_KEY_EXAMPLE}} --agent <actor> --workspace-owner <owner> --confirm-branch
50
- sumr mission task list {{MISSION_ISSUE_KEY_EXAMPLE}}
51
- sumr mission task start {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --actor <actor>
52
- sumr mission task submit {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --from task-1.md --actor <actor>
53
- sumr mission verify record {{MISSION_ISSUE_KEY_EXAMPLE}} --from task-receipt.json
54
- sumr mission review {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --from spec-review.json
55
- sumr mission review {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --from quality-review.json
56
- sumr mission finding resolve {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 <finding-id> --resolution fixed --reason "Fixed and ready for re-review" --actor <actor>
57
- sumr mission task complete {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --actor <actor>
58
- sumr mission report {{MISSION_ISSUE_KEY_EXAMPLE}} --type validation --from validation.md --accept
59
- sumr mission report {{MISSION_ISSUE_KEY_EXAMPLE}} --type quality --from quality.md --accept
60
- sumr mission verify record {{MISSION_ISSUE_KEY_EXAMPLE}} --from mission-receipt.json
61
- sumr mission pr {{MISSION_ISSUE_KEY_EXAMPLE}} --preview
62
- sumr mission pr {{MISSION_ISSUE_KEY_EXAMPLE}} --accept-preview
63
- sumr mission finish {{MISSION_ISSUE_KEY_EXAMPLE}} --from disposition.json
64
- sumr mission close {{MISSION_ISSUE_KEY_EXAMPLE}}
44
+ sumr mission start <issue-key> --title "Fix checkout flow"
45
+ sumr mission sync <issue-key>
46
+ sumr mission status <issue-key>
47
+ sumr mission plan <issue-key> --from plan.md
48
+ sumr mission plan show <issue-key> --json
49
+ sumr mission approvals pending --json
50
+ sumr mission approve <issue-key> --revision <revision> --fingerprint <sha256>
51
+ sumr mission claim <issue-key> --agent <actor> --workspace-owner <owner> --confirm-branch
52
+ sumr mission task list <issue-key>
53
+ sumr mission task start <issue-key> task-1 --actor <actor>
54
+ sumr mission task submit <issue-key> task-1 --from task-1.md --actor <actor>
55
+ sumr mission verify record <issue-key> --from task-receipt.json
56
+ sumr mission review <issue-key> task-1 --from spec-review.json
57
+ sumr mission review <issue-key> task-1 --from quality-review.json
58
+ sumr mission finding resolve <issue-key> task-1 <finding-id> --resolution fixed --reason "Fixed and ready for re-review" --actor <actor>
59
+ sumr mission task complete <issue-key> task-1 --actor <actor>
60
+ sumr mission report <issue-key> --type validation --from validation.md --accept
61
+ sumr mission report <issue-key> --type quality --from quality.md --accept
62
+ sumr mission verify record <issue-key> --from mission-receipt.json
63
+ sumr mission pr <issue-key> --preview
64
+ sumr mission pr <issue-key> --accept-preview
65
+ sumr mission finish <issue-key> --from disposition.json
66
+ sumr mission close <issue-key>
65
67
  ```
66
68
 
67
69
  ## Facts and Methodology
@@ -101,7 +103,9 @@ human approval before pushing and creating the remote PR.
101
103
  the complete work item and record it with `mission sync --from <file>` before planning; do not
102
104
  imply that remote context was fetched.
103
105
  - Never combine plan creation with approval. Stop after the draft and wait for the separate
104
- `mission approve` action at a human gate.
106
+ revision/fingerprint-bound `mission approve` action at a human gate. Before asking, render the
107
+ full `plan show --json` presentation: Markdown, tasks, decisions, contradictions, risks,
108
+ revision, fingerprint, blockers, and returned controls. Never offer a blocked control.
105
109
  - At an `ask` branch gate, confirm the selected branch before passing `--confirm-branch` to claim.
106
110
  - Set `--workspace-owner` explicitly to `user`, `mission`, `platform`, or `external`; Mission never
107
111
  infers ownership from the checkout path.
@@ -123,5 +127,8 @@ When a worktree is used, Mission evidence must say whether the work was merged b
123
127
  ## Start Examples
124
128
 
125
129
  ```bash
126
- {{MISSION_START_EXAMPLES}}
130
+ sumr mission providers --json
131
+ sumr mission flow export --json
132
+ sumr mission start <issue-key> --title "Fix checkout flow"
133
+ sumr mission status <issue-key>
127
134
  ```
@@ -12,11 +12,11 @@ order: 90
12
12
  Use blockers and handoffs instead of ambiguous partial state:
13
13
 
14
14
  ```bash
15
- sumr mission block {{MISSION_ISSUE_KEY_EXAMPLE}} --reason "Waiting for API contract approval"
16
- sumr mission report {{MISSION_ISSUE_KEY_EXAMPLE}} --type handoff --from handoff.md --accept
17
- sumr mission verify record {{MISSION_ISSUE_KEY_EXAMPLE}} --from mission-receipt.json
18
- sumr mission finish {{MISSION_ISSUE_KEY_EXAMPLE}} --from disposition.json
19
- sumr mission close {{MISSION_ISSUE_KEY_EXAMPLE}}
15
+ sumr mission block <issue-key> --reason "Waiting for API contract approval"
16
+ sumr mission report <issue-key> --type handoff --from handoff.md --accept
17
+ sumr mission verify record <issue-key> --from mission-receipt.json
18
+ sumr mission finish <issue-key> --from disposition.json
19
+ sumr mission close <issue-key>
20
20
  sumr mission clean
21
21
  sumr mission clean --older-than 30 --delete --yes
22
22
  ```
@@ -12,8 +12,8 @@ order: 60
12
12
  Before editing:
13
13
 
14
14
  ```bash
15
- sumr mission status {{MISSION_ISSUE_KEY_EXAMPLE}}
16
- sumr mission claim {{MISSION_ISSUE_KEY_EXAMPLE}} --agent <actor> --workspace-owner <owner> --confirm-branch
15
+ sumr mission status <issue-key>
16
+ sumr mission claim <issue-key> --agent <actor> --workspace-owner <owner> --confirm-branch
17
17
  ```
18
18
 
19
19
  `sumr mission status` is the branch authority for an existing Mission. If it already records a Mission branch or claim branch, switch to that branch before editing or explicitly ask whether to reclaim the Mission on a different branch. Do not create a second issue branch silently. If the recorded branch contains unrelated work, stop and propose cleanup, splitting, or intentional reclaiming before implementation.
@@ -27,9 +27,9 @@ Use the current checkout by default for small single-agent work. Ask before crea
27
27
  Work through the accepted-plan ledger one task at a time:
28
28
 
29
29
  ```bash
30
- sumr mission task list {{MISSION_ISSUE_KEY_EXAMPLE}}
31
- sumr mission task start {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --actor <actor>
32
- sumr mission task submit {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --from task-1.md --actor <actor>
30
+ sumr mission task list <issue-key>
31
+ sumr mission task start <issue-key> task-1 --actor <actor>
32
+ sumr mission task submit <issue-key> task-1 --from task-1.md --actor <actor>
33
33
  ```
34
34
 
35
35
  Only one task may be active. `task block` records a classified reason and `task unblock` resumes the
@@ -11,9 +11,9 @@ order: 40
11
11
 
12
12
  Normalize user language into a Mission key before planning:
13
13
 
14
- - Configured work provider: `{{MISSION_TRACKER_PROVIDER_LABEL}}` (`{{MISSION_TRACKER_PROVIDER}}`).
14
+ - Configured work provider: `configured work provider` (`<work-provider>`).
15
15
  - `issue 4501` uses the configured work provider when one exists.
16
- - `{{MISSION_ISSUE_KEY_EXAMPLE}}` shows the configured issue-key format.
16
+ - `<issue-key>` shows the configured issue-key format.
17
17
  - When no work provider is configured, ask which system owns the work rather than guessing.
18
18
 
19
19
  Create or resume state with `sumr mission start`, then check `sumr mission status`.
@@ -12,13 +12,34 @@ order: 50
12
12
  Create reviewable plans before implementation:
13
13
 
14
14
  ```bash
15
- sumr mission plan {{MISSION_ISSUE_KEY_EXAMPLE}} --from plan.md
16
- sumr mission approve {{MISSION_ISSUE_KEY_EXAMPLE}}
15
+ sumr mission plan <issue-key> --from plan.md
16
+ sumr mission plan show <issue-key> --json
17
+ sumr mission approve <issue-key> --revision <revision> --fingerprint <sha256>
17
18
  ```
18
19
 
19
20
  Plans are drafts until accepted. Acceptance rejects placeholder or incomplete content. Run the
20
- separate `sumr mission approve <key>` command only after the user or trusted automation has
21
- explicitly approved implementation.
21
+ separate bound approval command only after the user or trusted automation has explicitly approved
22
+ the exact presented revision and fingerprint. Never ask for approval from a status summary or plan
23
+ path alone.
24
+
25
+ Before asking the user to approve, run `plan show --json` and render all of these fields in the
26
+ conversation or native approval surface:
27
+
28
+ 1. Mission issue key and title.
29
+ 2. Full plan Markdown, without summarizing away task detail.
30
+ 3. Every structured task.
31
+ 4. Every decision requiring input and contradiction.
32
+ 5. Every risk.
33
+ 6. Revision and immutable plan fingerprint.
34
+ 7. Approval status and blockers.
35
+ 8. The returned approval controls.
36
+
37
+ Do not present an approval control when `approval.eligible` is false. Unresolved product decisions
38
+ and contradictions block approval; resolve them and register a revised plan first. Clients must use
39
+ the command and argument array returned in `approvalPrompt.controls`, rather than reconstructing an
40
+ unbound approval command. Discover all draft plans in the current repository with
41
+ `sumr mission approvals pending --json`; render each complete presentation and approve selections
42
+ individually because multi-Mission writes are not group-atomic.
22
43
 
23
44
  An implementation plan must contain one or more top-level headings outside code fences and block
24
45
  quotes in this exact form:
@@ -32,4 +53,22 @@ quotes in this exact form:
32
53
  Numbers start at 1 and stay unique, contiguous, and ordered. Approval hashes the accepted plan and
33
54
  creates `task-1` through `task-N`; replacing the plan clears the earlier ledger and task evidence.
34
55
 
56
+ Plans record unresolved review material as list items under explicit headings:
57
+
58
+ ```markdown
59
+ ## Decisions Requiring Input
60
+
61
+ - Which compatibility behavior should be retained?
62
+
63
+ ## Contradictions
64
+
65
+ - The acceptance criterion conflicts with a later comment.
66
+
67
+ ## Risks
68
+
69
+ - Existing automation may require migration.
70
+ ```
71
+
72
+ Use `None.` when a section has no entries. Checked decision items are treated as resolved.
73
+
35
74
  Planning-only flows stop after plan creation and do not claim work, create worktrees, edit code, or open PRs.
@@ -12,9 +12,9 @@ order: 80
12
12
  Prepare PR content safely:
13
13
 
14
14
  ```bash
15
- sumr mission pr {{MISSION_ISSUE_KEY_EXAMPLE}} --preview
15
+ sumr mission pr <issue-key> --preview
16
16
  # Edit the generated preview, then:
17
- sumr mission pr {{MISSION_ISSUE_KEY_EXAMPLE}} --accept-preview
17
+ sumr mission pr <issue-key> --accept-preview
18
18
  ```
19
19
 
20
20
  PR body structure:
@@ -13,14 +13,14 @@ Review and validation are evidence, not confidence. Import task evidence before
13
13
  validation:
14
14
 
15
15
  ```bash
16
- sumr mission verify record {{MISSION_ISSUE_KEY_EXAMPLE}} --from task-receipt.json
17
- sumr mission review {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --from spec-review.json
18
- sumr mission review {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --from quality-review.json
19
- sumr mission finding resolve {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 <finding-id> --resolution fixed --reason "Fixed and ready for re-review" --actor <actor>
20
- sumr mission task complete {{MISSION_ISSUE_KEY_EXAMPLE}} task-1 --actor <actor>
21
- sumr mission report {{MISSION_ISSUE_KEY_EXAMPLE}} --type validation --from validation.md --accept
22
- sumr mission report {{MISSION_ISSUE_KEY_EXAMPLE}} --type quality --from quality.md --accept
23
- sumr mission verify record {{MISSION_ISSUE_KEY_EXAMPLE}} --from mission-receipt.json
16
+ sumr mission verify record <issue-key> --from task-receipt.json
17
+ sumr mission review <issue-key> task-1 --from spec-review.json
18
+ sumr mission review <issue-key> task-1 --from quality-review.json
19
+ sumr mission finding resolve <issue-key> task-1 <finding-id> --resolution fixed --reason "Fixed and ready for re-review" --actor <actor>
20
+ sumr mission task complete <issue-key> task-1 --actor <actor>
21
+ sumr mission report <issue-key> --type validation --from validation.md --accept
22
+ sumr mission report <issue-key> --type quality --from quality.md --accept
23
+ sumr mission verify record <issue-key> --from mission-receipt.json
24
24
  ```
25
25
 
26
26
  Mission imports structured receipts; it does not execute their recorded commands or retain raw
@@ -31,10 +31,10 @@ Do not edit application code, tests, generated files, external trackers, pull re
31
31
 
32
32
  Before drafting:
33
33
 
34
- 1. Identify the configured work provider, `{{MISSION_TRACKER_PROVIDER_LABEL}}`, and run
34
+ 1. Identify the configured work provider, `configured work provider`, and run
35
35
  `sumr mission providers --json` before assuming its capabilities.
36
36
  2. Normalize the work item to the repo's Mission issue key format. Use
37
- `{{MISSION_ISSUE_KEY_EXAMPLE}}` as the configured example.
37
+ `<issue-key>` as the configured example.
38
38
  3. Read current Mission status for the issue key.
39
39
  4. Read external work-provider context when the Mission is provider-backed, including:
40
40
  - Full description/body, acceptance criteria, todos, and checklists.
@@ -59,7 +59,7 @@ Before drafting:
59
59
  2. If the mission does not exist, create it from tracker context:
60
60
 
61
61
  ```bash
62
- sumr mission start {{MISSION_ISSUE_KEY_EXAMPLE}} --title "<title>"
62
+ sumr mission start <issue-key> --title "<title>"
63
63
  ```
64
64
 
65
65
  3. If the mission already has an approved plan, claim, execution-ledger progress, task submission,
@@ -83,7 +83,13 @@ Before drafting:
83
83
  sumr mission plan <issue-key> --from <draft-plan-file>
84
84
  ```
85
85
 
86
- 6. Verify the stop state:
86
+ 6. Load the approval presentation:
87
+
88
+ ```bash
89
+ sumr mission plan show <issue-key> --json
90
+ ```
91
+
92
+ 7. Verify the stop state:
87
93
 
88
94
  ```bash
89
95
  sumr mission status <issue-key>
@@ -102,11 +108,17 @@ Before drafting:
102
108
 
103
109
  ## Output
104
110
 
105
- Return:
111
+ Return and visibly render:
106
112
 
107
113
  - Issue key and title.
108
114
  - Mission status and next action.
109
115
  - Draft plan path.
116
+ - Complete plan Markdown and every structured task.
117
+ - Decisions requiring input, contradictions, and risks.
118
+ - Revision, immutable fingerprint, approval status, blockers, and returned approval controls.
110
119
  - Key files inspected.
111
120
  - Open questions or blockers.
112
121
  - Recommended next human action.
122
+
123
+ Never ask the user to approve before showing every item above. If approval is blocked, ask for the
124
+ specific missing product input instead of offering an approval control.
@@ -86,7 +86,11 @@ Use the `sumr-mission-planner` agent when the channel supports custom agents.
86
86
  sumr mission plan <issueKey> --from <draft-plan-file>
87
87
  ```
88
88
 
89
- 10. Verify the stop state:
89
+ 10. Run `sumr mission approvals pending --json` and render every complete plan presentation,
90
+ including tasks, decisions, contradictions, risks, revision, fingerprint, blockers, and
91
+ returned controls. Never ask for approval from a summary-only triage list.
92
+
93
+ 11. Verify the stop state:
90
94
 
91
95
  ```bash
92
96
  sumr mission status <issueKey>
@@ -11,11 +11,9 @@ Use this workflow when the user gives an issue key, tracker ID, mission ID, or a
11
11
 
12
12
  ## Configured Flow
13
13
 
14
- This repo uses `{{MISSION_FLOW_PRESET}}`.
15
-
16
- ```text
17
- {{MISSION_FLOW_TEXT}}
18
- ```
14
+ Run `sumr mission flow export --json`. Mission owns the configured preset, ordered steps,
15
+ advance policies, provider identifiers, issue prefixes, and PR mode. Follow that runtime
16
+ output; do not reconstruct preset defaults from this document or from memory.
19
17
 
20
18
  ## Steps
21
19
 
@@ -23,6 +21,10 @@ This repo uses `{{MISSION_FLOW_PRESET}}`.
23
21
  2. Identify or create the mission with `sumr mission start`.
24
22
  3. Run `sumr mission status <key>` or `sumr mission next`.
25
23
  4. Follow the returned next action and stop at `human` or `ask` gates.
24
+ At `plan.approve`, first run `sumr mission plan show <key> --json` and render the full plan,
25
+ tasks, decisions, contradictions, risks, revision, fingerprint, blockers, and returned controls.
26
+ Ask for approval only when the presentation says it is eligible, and execute only the exact
27
+ revision/fingerprint-bound control after the user approves.
26
28
  5. For each accepted-plan task, use `task start`, `task submit`, `verify record`, structured
27
29
  `review` imports, `finding resolve` plus re-review when needed, then `task complete`.
28
30
  6. Use Mission reports only for remaining mission-level research, handoff, validation, and quality
@@ -54,8 +54,12 @@ Use the `sumr-mission-planner` agent when the channel supports custom agents.
54
54
  sumr mission plan <issueKey> --from <draft-plan-file>
55
55
  ```
56
56
 
57
- 7. Verify `sumr mission status <issueKey>` shows a plan pending approval.
58
- 8. Return a planning queue grouped by issue key.
57
+ 7. Run `sumr mission plan show <issueKey> --json` and render the complete plan, tasks, decisions,
58
+ contradictions, risks, revision, fingerprint, blockers, and returned approval controls.
59
+ 8. For multiple plans, run `sumr mission approvals pending --json` and render every complete
60
+ presentation. Do not replace the plans with a summary-only queue.
61
+ 9. Verify `sumr mission status <issueKey>` shows a plan pending approval.
62
+ 10. Return a planning queue grouped by issue key.
59
63
 
60
64
  ## Rules
61
65
 
@@ -66,4 +70,5 @@ Use the `sumr-mission-planner` agent when the channel supports custom agents.
66
70
  - Do not mutate external trackers, labels, assignees, project status, PRs, deployments, or external systems without explicit approval.
67
71
  - If a mission already has an approved plan, claim, execution-ledger progress, task submission, or
68
72
  validation evidence, skip planning and report the existing state instead of overwriting it.
69
- - If the issue is ambiguous or blocked by missing product context, create the draft plan with open questions and leave the Mission waiting for approval.
73
+ - If the issue is ambiguous or blocked by missing product context, create the draft plan with open
74
+ questions, render those structured blockers, and request the missing input. Do not ask for approval.
@@ -1,21 +1,17 @@
1
1
  apiVersion: sumr.dev/v1
2
2
  kind: CliModule
3
+
3
4
  metadata:
4
- name: mission
5
- package: "@sumrco/cli"
6
5
  description: File-backed execution state for AI-assisted work
6
+ name: mission
7
7
  owners:
8
8
  - team: "@sumr-org/mission-team"
9
+ package: "@sumrco/cli"
9
10
  tags:
10
11
  - ai-workflow
11
12
  - state
12
13
  - cache
13
14
  spec:
14
- visibility: public
15
- group: modules
16
- targets:
17
- contractVersion: ^1.0.0
18
- bunVersion: ">=1.1.0"
19
15
  commands:
20
16
  - name: init
21
17
  summary: Initialize Mission state for the current repository or global workspace
@@ -36,10 +32,13 @@ spec:
36
32
  summary: List missions
37
33
  visibility: public
38
34
  - name: plan
39
- summary: Create or register a mission plan
35
+ summary: Create, register, or present a mission plan
36
+ visibility: public
37
+ - name: approvals
38
+ summary: Discover and present plans waiting for approval
40
39
  visibility: public
41
40
  - name: approve
42
- summary: Approve the current mission plan for implementation
41
+ summary: Approve one exact mission plan revision for implementation
43
42
  visibility: public
44
43
  - name: claim
45
44
  summary: Claim a mission for implementation
@@ -87,16 +86,21 @@ spec:
87
86
  summary: Record an explicit finish disposition without external or destructive actions
88
87
  visibility: public
89
88
  exports:
90
- resources: []
91
- binaries: []
92
89
  aiResources:
93
- module: mission
94
- roots:
95
- - ./resources
96
90
  activation:
97
- mode: command
98
91
  initCommand: mission init
99
92
  key: mission
93
+ mode: command
94
+ module: mission
95
+ roots:
96
+ - ./resources
97
+ binaries: []
98
+ resources: []
100
99
  flags:
101
- experimental: false
102
100
  deprecated: null
101
+ experimental: false
102
+ group: modules
103
+ targets:
104
+ bunVersion: ">=1.1.0"
105
+ contractVersion: ^1.0.0
106
+ visibility: public
@@ -4,12 +4,33 @@ name: authoring-extraction
4
4
  title: Content Extraction
5
5
  description: "extract:examples marker syntax, code block classification, and size guidelines for SUMR docs."
6
6
  label: Extraction
7
- when: Adding examples sections to a doc, deciding whether to extract a code block, checking size limits, classifying a fenced code block
7
+ when: Adding or editing any fenced code block, adding examples sections, deciding whether to extract content, checking size limits, or reviewing extraction markers
8
8
  order: 20
9
9
  ---
10
10
 
11
11
  # Content Extraction
12
12
 
13
+ ## Fenced Code Block Gate
14
+
15
+ Classify **every fenced code block when it is added or edited**. Do not wait for a section to
16
+ be named `Examples`; naming, folder, and workflow comparisons are examples even when their
17
+ heading uses another label.
18
+
19
+ 1. Identify whether the block is required to understand or execute the surrounding rule.
20
+ 2. Keep it inline when removing it would make the generated `SKILL.md` incomplete.
21
+ 3. Extract it when it is supplementary, reusable, long, template-like, or a ✅ Good / ❌ Bad
22
+ comparison.
23
+ 4. When the block demonstrates a non-obvious convention, check whether a plausible bad or good
24
+ counterpart would make the acceptance boundary clearer; suggest the pair when it would.
25
+ 5. Put a descriptive Markdown heading inside the markers so the generated support filename is
26
+ stable.
27
+ 6. Re-read the remaining main content without the block; it must still state the complete rule.
28
+
29
+ > [!IMPORTANT]
30
+ > A fenced block does not become extractable merely because it contains code. Its purpose and
31
+ > role in the instruction flow determine whether it stays inline or moves to support content.
32
+ > Likewise, do not manufacture a bad example when it teaches no additional boundary.
33
+
13
34
  ## Marker Syntax
14
35
 
15
36
  Wrap dedicated examples sections with extraction markers:
@@ -53,6 +74,11 @@ In any file, if you create a dedicated `## Examples` section or equivalent sampl
53
74
 
54
75
  Do not leave standalone examples sections unwrapped. Do not wrap marker examples shown inside fenced code blocks; the renderer treats those as literal documentation and does not extract them.
55
76
 
77
+ `sumr playbook validate` reports `UNEXTRACTED_EXAMPLE_SECTION` when it finds the
78
+ high-confidence case of a dedicated `Examples`, `Sample`, or `Template` heading with a fenced
79
+ block outside extraction markers. The authoring checklist still owns semantic cases whose
80
+ headings do not advertise that they contain examples.
81
+
56
82
  ## Code Block Classification
57
83
 
58
84
  Before wrapping any `` ``` `` block, classify it:
@@ -67,6 +93,7 @@ Before wrapping any `` ``` `` block, classify it:
67
93
  | **File structure / schema** | Directory tree, schema outline | Keep in main doc |
68
94
  | **ASCII diagram** | Decision tree, flow diagram | Keep in main doc |
69
95
  | **Inline snippet** | Core instruction, short 2-5 line example | Keep in main doc |
96
+ | **Contrastive pair** | ✅ Good / ❌ Bad naming, folder, code, or configuration comparison | `extract:examples` |
70
97
 
71
98
  **Default:** Short inline snippets, file structure trees, and core-instruction diagrams stay in the main doc without markers. Use `extract:examples` only when the block is supplementary and long enough to warrant a separate reference.
72
99
 
@@ -114,6 +114,7 @@ codex:
114
114
  claude:
115
115
  tools: Read, Grep, Glob
116
116
  mode: subagent
117
+ skills: [typescript, security]
117
118
 
118
119
  # Cursor project rule options
119
120
  cursor:
@@ -136,6 +137,12 @@ opencode:
136
137
 
137
138
  `channels:` remains supported as a legacy-compatible alias. If both shapes set the same channel property, the top-level channel block wins.
138
139
 
140
+ Claude `skills` entries are references to authored Playbook topic names. Use the
141
+ complete `name` value from each skill topic—never a shortened alias and never a
142
+ generated `sumr-` name. Playbook resolves those references to their local or
143
+ managed Claude names during rendering and rejects missing skill topics before
144
+ writing outputs.
145
+
139
146
  ## Team-Member Terminology Placeholder
140
147
 
141
148
  Canonical source docs must use `{{TEAM-MEMBER}}` when prose means a generated delegated role. Do not hardcode `agent` or `subagent` in reusable source prose unless you are describing a specific vendor field such as `mode: subagent`.
@@ -12,6 +12,7 @@ tags: [authoring, docs, markdown, ai-docs, technical-docs, specs, skills]
12
12
  - Writing or reviewing technical docs, engineering docs, architecture docs, runbooks, specs, ADRs, standards, or process docs.
13
13
  - Writing AI-facing docs, agent instructions, AI skills, agent skills, Codex/Claude resources, or Markdown files meant to guide an AI tool.
14
14
  - Reviewing a doc for schema or structure compliance.
15
+ - Adding or editing a fenced code block and deciding whether it is core instruction or extractable example material.
15
16
  - Checking whether a Markdown file should be treated as Playbook format before editing it.
16
17
  - Deciding whether to split a long doc into main + references.
17
18
  - Explaining workflow, lifecycle, approval, or handoff flows.
@@ -179,6 +180,11 @@ See **Folder Structure** for naming alternatives, placement rules, and a full st
179
180
 
180
181
  Wrap dedicated examples sections with markers so they can be consumed separately:
181
182
 
183
+ Before finishing any fenced code block, classify it. Keep core instructions, short config,
184
+ directory trees, schemas, and diagrams inline. Wrap supplementary demonstrations, reusable
185
+ samples/templates, long boilerplate, and every ✅ Good / ❌ Bad comparison. If the generated
186
+ `SKILL.md` remains complete without the block, extraction is normally the right choice.
187
+
182
188
  ```markdown
183
189
  <!-- extract:examples -->
184
190
  ## Examples
@@ -202,7 +208,16 @@ See **Extraction** for the full code-block classification table.
202
208
 
203
209
  ## Good/Bad Patterns and Non-Negotiables
204
210
 
205
- 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`.
211
+ Teach AI channels with contrast, not prose. Whenever a fenced block demonstrates a non-obvious
212
+ code, configuration, naming, folder, or structure convention, actively check whether a plausible
213
+ wrong version would clarify the boundary. If it would, suggest or author a ✅ Good example beside
214
+ an ❌ Bad one, give each a one-line *why*, and wrap the complete pair with
215
+ `<!-- extract:examples -->`.
216
+
217
+ The pair teaches both the target shape and the rejection boundary. The one-line reasons help AI
218
+ agents generalize the rule to new code instead of copying surface syntax or repeating the bad
219
+ pattern in a slightly different form. Put absolute rules in a dedicated `## Non-Negotiables`
220
+ section using `MUST`/`NEVER`; keep softer defaults as `SHOULD`/`PREFER`.
206
221
 
207
222
  See **Patterns** for the labelling convention, the signal-word calibration table, and where emoji belong.
208
223
 
@@ -250,8 +265,10 @@ Before committing any `.md` file under `{{PLAYBOOK_PATH}}/`:
250
265
  - [ ] `description` is in double quotes, third person, specific
251
266
  - [ ] Main how-to docs have `## When to Use` section
252
267
  - [ ] Reference files have `title`, `label`, `when`, `order` — and no `## When to Use` in body
268
+ - [ ] Every added or edited fenced code block was classified as core inline instruction or extractable support content
253
269
  - [ ] Dedicated examples, samples, and templates wrapped with `<!-- extract:examples -->`; no standalone examples section left unwrapped
254
- - [ ] Non-obvious naming, folder, or structure conventions show a ✅ Good / ❌ Bad pair with a one-line why
270
+ - [ ] Every ✅ Good / ❌ Bad comparison is self-contained under a heading and wrapped with `<!-- extract:examples -->`
271
+ - [ ] Every non-obvious code, configuration, naming, folder, or structure block was checked for a useful ✅ Good / ❌ Bad pair with a one-line why
255
272
  - [ ] Absolute rules sit in a `## Non-Negotiables` section using `MUST`/`NEVER`; soft defaults use `SHOULD`/`PREFER`
256
273
  - [ ] Workflow and lifecycle docs use a compact arrow flow or Mermaid diagram when state transitions matter
257
274
  - [ ] No `references:` frontmatter field
@@ -262,5 +279,19 @@ Before committing any `.md` file under `{{PLAYBOOK_PATH}}/`:
262
279
  tool-entrypoint file was hand-edited
263
280
  - [ ] Every generated behavioral instruction is traceable to canonical source
264
281
  prose or metadata, not renderer inference
282
+ - [ ] Ran `sumr playbook validate` and resolved every reported error
283
+
284
+ ## Finish
285
+
286
+ Before committing any new or edited doc, run:
287
+
288
+ ```bash
289
+ sumr playbook validate
290
+ ```
291
+
292
+ It checks every doc for frontmatter, structure, and relationship errors without
293
+ writing files, reading the source folders from `sumr.yaml`. Resolve every error
294
+ before syncing or committing; warnings are advisory. Add `--verbose` to list
295
+ each source that was checked, or `--json` for a machine-readable envelope.
265
296
 
266
297
  See **Markdown** for formatting rules (headings, callouts, code blocks, anti-patterns).
@@ -16,12 +16,33 @@ Contrastive examples and absolute rules are the highest-signal way to steer an A
16
16
 
17
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
18
 
19
+ ### Contrast Gate for Fenced Blocks
20
+
21
+ Whenever adding or editing a fenced block that demonstrates a convention:
22
+
23
+ 1. Identify the decision boundary the block is teaching.
24
+ 2. Ask whether an author or agent could plausibly produce the wrong shape while believing it is
25
+ acceptable.
26
+ 3. If yes, suggest or author the missing counterpart and explain why each side is accepted or
27
+ rejected.
28
+ 4. Put the complete pair under one descriptive heading inside
29
+ `<!-- extract:examples -->` markers.
30
+ 5. If contrast would add no meaningful boundary, keep the core snippet inline and do not invent
31
+ a bad example merely to satisfy a template.
32
+
33
+ Contrast is valuable to AI agents because the ✅ example supplies the target pattern, the ❌
34
+ example supplies the negative constraint, and the reasons connect both shapes to a reusable
35
+ principle. This reduces surface-level copying and makes the rule more reliable on code that does
36
+ not exactly match the original sample.
37
+
19
38
  Rules:
20
39
 
21
40
  - Label each block with a bold header: `**✅ Good** — <why>` then `**❌ Bad** — <why>`.
22
41
  - Put the ✅ Good block first.
23
42
  - Keep both blocks minimal — only the lines that carry the contrast.
24
43
  - Always wrap the pair with `<!-- extract:examples -->` so it becomes a standalone example file (see **Extraction**).
44
+ - If only one explicit ✅ or ❌ example exists, add its counterpart or remove the contrast label
45
+ and explain why a pair would not improve the instruction.
25
46
 
26
47
  Rendered, a pair looks like this:
27
48