@sumrco/cli 0.4.5 β†’ 0.4.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 (37) hide show
  1. package/ARTIFACT-MANIFEST.json +3 -3
  2. package/THIRD_PARTY_NOTICES.md +231 -9
  3. package/ai/modules/kontract/resources/authoring/configuration.rf.md +37 -0
  4. package/ai/modules/kontract/resources/authoring/contract-copy.rf.md +92 -0
  5. package/ai/modules/kontract/resources/authoring/design-profile/overview.md +2 -1
  6. package/ai/modules/kontract/resources/authoring/overview.md +10 -7
  7. package/ai/modules/kontract/resources/authoring/spec-layout.rf.md +6 -27
  8. package/ai/modules/kontract/resources/authoring/team-members/spec-author.tm.md +15 -14
  9. package/ai/modules/kontract/resources/authoring/workflows/spec-change.cmd.md +29 -21
  10. package/ai/modules/kontract/resources/generated-output.rf.md +60 -0
  11. package/ai/modules/kontract/resources/overview.md +10 -9
  12. package/ai/modules/kontract/sumr.module.yaml +1 -1
  13. package/ai/modules/mission/resources/flow-actions.rf.md +1 -0
  14. package/ai/modules/mission/resources/flow-config.rf.md +1 -0
  15. package/ai/modules/mission/resources/flow-safety-boundaries.rf.md +1 -0
  16. package/ai/modules/mission/resources/overview.md +3 -1
  17. package/ai/modules/mission/resources/stage-closeout.rf.md +1 -0
  18. package/ai/modules/mission/resources/stage-delivery.rf.md +1 -0
  19. package/ai/modules/mission/resources/stage-intake.rf.md +1 -0
  20. package/ai/modules/mission/resources/stage-planning.rf.md +1 -0
  21. package/ai/modules/mission/resources/stage-pull-request.rf.md +1 -0
  22. package/ai/modules/mission/resources/stage-quality.rf.md +1 -0
  23. package/ai/modules/mission/resources/workflows/pr-assist.cmd.md +2 -1
  24. package/ai/modules/mission/sumr.module.yaml +1 -1
  25. package/ai/modules/playbook/resources/authoring/cross-referencing.rf.md +11 -8
  26. package/ai/modules/playbook/resources/authoring/descriptions.rf.md +3 -3
  27. package/ai/modules/playbook/resources/authoring/folder-structure.rf.md +2 -2
  28. package/ai/modules/playbook/resources/authoring/frontmatter.rf.md +73 -33
  29. package/ai/modules/playbook/resources/authoring/lifecycle-hooks.rf.md +1 -1
  30. package/ai/modules/playbook/resources/authoring/markdown.rf.md +2 -1
  31. package/ai/modules/playbook/resources/authoring/overview.md +14 -6
  32. package/ai/modules/playbook/resources/team-members/technical-writer.tm.md +1 -1
  33. package/ai/modules/playbook/sumr.module.yaml +1 -4
  34. package/bin/sumr +6 -1
  35. package/index.js +2060 -2000
  36. package/package.json +2 -2
  37. package/sbom.cdx.json +1156 -123
@@ -2,20 +2,20 @@
2
2
  category: command
3
3
  name: spec-change
4
4
  title: Spec Change
5
- description: "Guides an AI agent through safely changing an API spec and regenerating Kontract contracts. Use when an API surface changes and generated contracts must follow."
5
+ description: "Guides an AI agent through safely changing API or async schema source and regenerating Kontract contracts. Use when an API or messaging surface changes and generated contracts must follow."
6
6
  modelTier: coding
7
7
  access: write
8
8
  ---
9
9
 
10
10
  # Spec Change
11
11
 
12
- Use this workflow whenever an API surface changes (new endpoint, message,
13
- field, or breaking change) and the generated contracts must follow.
12
+ Use this workflow whenever an API or messaging surface changes (new endpoint,
13
+ message, field, or breaking change) and the generated contracts must follow.
14
14
 
15
15
  ## Flow
16
16
 
17
17
  ```text
18
- πŸ• read authoring guidance -> edit spec -> review spec -> validate -> generate -> review diff -> ⏸ HUMAN APPROVES -> commit
18
+ πŸ• read authoring guidance -> edit source YAML -> refactor -> copy review -> validate -> generate -> review diff -> ⏸ HUMAN APPROVES -> commit
19
19
  ```
20
20
 
21
21
  ## Steps
@@ -23,35 +23,43 @@ field, or breaking change) and the generated contracts must follow.
23
23
  1. **Read the authoring guidance** under `resources/authoring/`. Confirm the
24
24
  configured source input, current `kontract.guidance.profile`, selected
25
25
  schema layout style, protocol scenario (API-only, async-only, or both
26
- with shared components), and whether
26
+ with shared components), Contract Copy rules, and whether
27
27
  the user asked for a guidance-only profile change or an actual schema/output
28
28
  namespace migration.
29
- 2. **Edit the spec** under `schema/` (`*.api.yml` / `*.async.yml`).
30
- Before adding new schemas, scan for existing shared components. Reuse shared
31
- components via `$ref`; never duplicate schemas.
29
+ 2. **Edit source YAML** under the selected source's configured
30
+ `kontract.sources[].input` (`*.api.yml`, `*.api.yaml`, `*.async.yml`, or
31
+ `*.async.yaml`). Before adding new schemas, scan for existing shared
32
+ components. Reuse shared components via `$ref`; never duplicate schemas.
32
33
  3. **Review the written spec** before validation. Check new or changed
33
- `*.api.yml` / `*.async.yml` files against Kontract best practices:
34
+ `*.api.yml`, `*.api.yaml`, `*.async.yml`, or `*.async.yaml` files against
35
+ Kontract best practices:
34
36
  stable component names, no inline operation payload schemas, correct `$ref`
35
- paths, selected profile style, concise operation summaries, useful
36
- descriptions where behavior needs context, reusable shared components,
37
+ paths, selected profile style, Contract Copy compliance, reusable shared components,
37
38
  documented size thresholds, clear product ownership, and no duplicated
38
39
  product concepts.
39
40
  4. **Refactor repeated shapes first**. If the change repeats envelope fields,
40
41
  pagination metadata, error bodies, ID/date params, regex scalar constraints,
41
42
  schedules, or config objects, extract a shared component and reference it.
42
- 5. **Validate**: `sumr kontract validate` (scope with `--source` if large).
43
+ 5. **Review changed contract copy**. Send public or developer-facing titles,
44
+ summaries, descriptions, parameters, responses, schemas, and messages
45
+ through the repository's copywriter role. When that role is unavailable,
46
+ apply Contract Copy and the repository's general microcopy guidance
47
+ directly. Require a concise operation summary; keep a description only when
48
+ it adds information. Repeat this review after any later refactor that changes
49
+ contract text.
50
+ 6. **Validate**: `sumr kontract validate` (scope with `--source` if large).
43
51
  Fix every reported error before continuing.
44
- 6. **Generate**: `sumr kontract generate`. Unchanged specs are skipped.
52
+ 7. **Generate**: `sumr kontract generate`. Unchanged specs are skipped.
45
53
  Scope large repos with `--source`, `--target`, or `--specific`.
46
- 7. **Review the diff** of the generated `contracts/` output. Confirm
47
- `http/models`, `http/enums`, `http/zod`, optional `http/dto`,
48
- optional `http/swagger.ts`, and NATS `SUBJECTS` match the intended change;
49
- watch for unintended removals. If the diff introduces many near-identical
50
- generated files, return to the spec and look for a shared component.
51
- 8. **Do not edit generated files** to "fix" the diff β€” change the spec and
54
+ 8. **Review generated diffs** under every selected target's configured output.
55
+ Inspect the artifacts promised by each configured generator, including
56
+ generated contract copy and metadata, and watch for unintended removals. If
57
+ the diff introduces many near-identical files, return to the source YAML and
58
+ look for a shared component.
59
+ 9. **Do not edit generated files** to "fix" the diff β€” change the spec and
52
60
  regenerate instead.
53
- 9. **Commit** the spec change and the regenerated output together so they
54
- never drift.
61
+ 10. **Commit** the spec change and the regenerated output together so they
62
+ never drift.
55
63
 
56
64
  ## Transition rules
57
65
 
@@ -108,6 +108,66 @@ export * from './swagger';
108
108
  Do not flatten-import everything blindly when DTO/model/Zod symbols collide.
109
109
  Use the namespace exports or import from the leaf folder.
110
110
 
111
+ ## Effect schema target β€” one direct file per component
112
+
113
+ The standalone `typescript-effect` target emits this service shape:
114
+
115
+ ```text
116
+ contracts/recipes/
117
+ index.ts
118
+ schemas/
119
+ index.ts
120
+ recipe.schema.ts
121
+ recipe-status.schema.ts
122
+ ```
123
+
124
+ Each leaf can be imported directly, through the `schemas` barrel shown below,
125
+ or through the service barrel's `schemas` namespace:
126
+
127
+ ```typescript
128
+ import * as Schema from 'effect/Schema';
129
+ import {
130
+ RecipeInputSchema,
131
+ RecipeOutputSchema,
132
+ RecipeSchema,
133
+ type Recipe,
134
+ type RecipeEncoded,
135
+ type RecipeInput,
136
+ type RecipeInputEncoded,
137
+ } from './contracts/recipes/schemas';
138
+
139
+ const input: RecipeInput = Schema.decodeUnknownSync(RecipeInputSchema)(unknownValue);
140
+ const encoded: RecipeInputEncoded = Schema.encodeSync(RecipeInputSchema)(input);
141
+ const output: Recipe = Schema.decodeUnknownSync(RecipeOutputSchema)(unknownResponse);
142
+ const wire: RecipeEncoded = Schema.encodeSync(RecipeSchema)(output);
143
+ ```
144
+
145
+ `${Name}InputSchema` excludes `readOnly` properties and
146
+ `${Name}OutputSchema` excludes `writeOnly` properties. `${Name}Schema` and
147
+ `${Name}` are output aliases. These directional names exist only when the
148
+ component's input and output differ. Symmetric components expose only
149
+ `${Name}Schema`, `${Name}`, and `${Name}Encoded`. Recursive component graphs
150
+ use cycle-safe declarations in either form.
151
+
152
+ Omitted `additionalProperties` preserves undeclared values as `unknown` because
153
+ OpenAPI admits them by default. `additionalProperties: false` installs a
154
+ schema-local excess-property error. A map-only typed `additionalProperties`
155
+ schema emits `Schema.Record`. Named fields plus a typed catch-all currently
156
+ fail before any file is written rather than widening or misvalidating the
157
+ contract. Named fields plus `additionalProperties: true` retain undeclared
158
+ values as `unknown`.
159
+
160
+ Fixed tuples, nested nullable values, schema defaults, and deprecation metadata
161
+ are preserved. Open-ended tuples, null-only schemas, and constraints without an
162
+ exact Effect Schema mapping fail before output is written.
163
+ `anyOf` accepts any matching branch; `oneOf` adds an exactly-one-match
164
+ refinement so overlapping branches do not silently acquire `anyOf` semantics.
165
+
166
+ The target preserves wire strings for dates, date-times, money, and unknown
167
+ formats. It does not generate a transport client or silently transform wire
168
+ values. Consumers install `effect` directly; Zod, NestJS, Angular, React, and
169
+ other frameworks are absent from this output.
170
+
111
171
  ## Zod contract β€” one file per API schema `components/schemas` entry
112
172
 
113
173
  ```typescript
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: how-to:concept
2
3
  name: usage
3
4
  title: Kontract Usage
4
5
  description: "How to use the Kontract module in the SUMR CLI to review, validate, and generate API and microservice contracts from API and async schemas. Use when adding, changing, reviewing, validating, or generating API contracts, validation schemas, DTOs, SDK models, message subjects, or microservice message contracts."
@@ -212,15 +213,15 @@ Roadmap and future generator ideas live in `docs/internal/generator-roadmap.md`;
212
213
  dependency and invoke `node_modules/.bin` / `Bun.resolveSync` instead.
213
214
  - Treat everything under the generated `contracts/` output as read-only.
214
215
  - Keep specs the single source of truth; do not hand-write Zod/DTOs that Kontract owns.
215
- - After writing or updating any `*.api.yml` or `*.async.yml` file, review the
216
- schema for duplicated concepts before generation.
217
- - Every API schema and async schema operation should include a concise
218
- `summary`. Add `description` when outcome, scope, permissions, side effects,
219
- constraints, or message semantics need more context.
220
- - Treat `summary`, `description`, `title`, parameter descriptions, response
221
- descriptions, and message descriptions as user-facing copy when they appear in
222
- docs, Swagger, Scalar, generated SDKs, or AI answers. Review changed copy
223
- against the repo's copywriter standard before generation.
216
+ - After writing or updating any `*.api.yml`, `*.api.yaml`, `*.async.yml`, or
217
+ `*.async.yaml` file, review the schema for duplicated concepts before
218
+ generation.
219
+ - Follow the Contract Copy reference for API and async schema text. Every
220
+ operation must have a concise `summary`; keep `description` only when it adds
221
+ information, and route public or developer-facing copy through the
222
+ repository's copywriter role before generation. When that role is
223
+ unavailable, apply Contract Copy and the repository's general microcopy
224
+ guidance directly.
224
225
  - Design specs for reuse: shared parameters, scalar constraints, error responses,
225
226
  response envelope fragments, pagination metadata, repeated nested value
226
227
  objects, and common config objects belong in shared components referenced
@@ -41,6 +41,6 @@ spec:
41
41
  experimental: false
42
42
  group: modules
43
43
  targets:
44
- bunVersion: ">=1.1.0"
44
+ bunVersion: ">=1.4.0"
45
45
  contractVersion: ^1.0.0
46
46
  visibility: public
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: flow-actions
3
4
  title: Mission Flow Actions
4
5
  description: "Canonical Mission action IDs and what each action means."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: flow-config
3
4
  title: Mission Flow Config
4
5
  description: "How Mission reads sumr.yaml flow config, presets, step order, and transition policies."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: safety-boundaries
3
4
  title: Mission Safety Boundaries
4
5
  description: "Human approval rules for external writes, PR creation, tracker changes, branch changes, and destructive operations."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: how-to:concept
2
3
  name: workflow
3
4
  title: Mission Workflow
4
5
  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."
@@ -76,7 +77,8 @@ dispatch, and whether to use TDD, debugging protocols, or worktrees.
76
77
  Mission ledger, evidence-import, and finish commands never push, create or remove worktrees, delete
77
78
  branches, merge, or mutate a work provider. The explicit bounded push exception is
78
79
  `pr --create-draft` and `pr --create`: after every PR safety gate passes, these commands ask for
79
- human approval before pushing and creating the remote PR.
80
+ human approval before pushing and creating the remote PR. If the provider already merged a pull
81
+ request from the Mission branch at the current HEAD, they record it instead, without asking or pushing.
80
82
 
81
83
  ## Operating Rules
82
84
 
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: stage-closeout
3
4
  title: Mission Closeout Stage
4
5
  description: "Handoffs, blockers, closeout, cleanup, and keeping next action clear across sessions."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: stage-delivery
3
4
  title: Mission Delivery Stage
4
5
  description: "Branch checks, work claiming, task execution facts, worktree discipline, and merge-back evidence."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: stage-intake
3
4
  title: Mission Intake Stage
4
5
  description: "Issue normalization, tracker source detection, and initial Mission state creation."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: stage-planning
3
4
  title: Mission Planning Stage
4
5
  description: "Plan creation, human approval, planning-only automation, and stale plan behavior."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: stage-pull-request
3
4
  title: Mission Pull Request Stage
4
5
  description: "Safe PR preview, PR body structure, issue linkage, verification evidence, and human approval for PR creation."
@@ -1,4 +1,5 @@
1
1
  ---
2
+ category: reference
2
3
  name: stage-quality
3
4
  title: Mission Quality Stage
4
5
  description: "Review, validation, quality gate evidence, verification commands, and skipped-check handling."
@@ -15,7 +15,8 @@ Use this workflow after implementation and validation evidence exists.
15
15
  4. Review and edit the generated PR body for scope drift, local-only paths, raw commit logs, and raw diff stats.
16
16
  5. Remove or split unrelated dependency, audit, tooling, infrastructure, or cleanup changes unless they are required for the issue.
17
17
  6. Record the reviewed body with `sumr mission pr <key> --accept-preview`.
18
- 7. Ask before `--create-draft` or `--create`.
18
+ 7. Ask before `--create-draft` or `--create`. If the pull request was already merged from this branch at
19
+ HEAD, either command records it without pushing or creating anything.
19
20
 
20
21
  Never merge or mutate issue/project state.
21
22
 
@@ -101,6 +101,6 @@ spec:
101
101
  experimental: false
102
102
  group: modules
103
103
  targets:
104
- bunVersion: ">=1.1.0"
104
+ bunVersion: ">=1.4.0"
105
105
  contractVersion: ^1.0.0
106
106
  visibility: public
@@ -2,7 +2,7 @@
2
2
  category: reference
3
3
  name: authoring-cross-referencing
4
4
  title: Cross-Referencing
5
- description: "How to reference other topics within SUMR docs: use name for main topics, label for references. Never use file paths."
5
+ description: "How to use safe source-relative links and stable prose references between SUMR Playbook Documents."
6
6
  label: Cross-Refs
7
7
  when: Referencing another topic from within content, choosing how to link to a related doc
8
8
  order: 60
@@ -10,30 +10,33 @@ order: 60
10
10
 
11
11
  # Cross-Referencing
12
12
 
13
- ## Never Use File Paths
13
+ ## Use Contained Source-Relative Links
14
14
 
15
- Do not link to other docs by file path. Files are moved and renamed by generators β€” paths are not stable identifiers.
15
+ Use a source-relative Markdown link when readers need functional navigation to
16
+ another generated Topic, attached reference Document, or heading. Playbook
17
+ validates the source target and rewrites it to the final AI Channel artifact.
18
+ Dangling, escaping, or channel-unmapped links fail validation before rendering.
16
19
 
17
20
  ```markdown
18
- # Bad β€” file paths break after generation
21
+ # Good β€” contained links are validated and rewritten
19
22
  See [Frontmatter](frontmatter.rf.md) for the schema.
20
- Follow [TypeScript](typescript.md) rules.
23
+ Follow [TypeScript](typescript.md#core-rules) rules.
21
24
 
22
- # Good β€” reference by name or label
25
+ # Good β€” stable prose reference when no navigation is needed
23
26
  See **Frontmatter** for the schema.
24
27
  Follow the **typescript** conventions.
25
28
  ```
26
29
 
27
30
  ## How to Reference
28
31
 
29
- **Referencing a main topic** β€” use its `name` field in bold:
32
+ **Referencing a main Topic without a link** β€” use its `name` field in bold:
30
33
 
31
34
  ```markdown
32
35
  Follow the rules in **typescript**.
33
36
  See **patterns** for the renderer pipeline.
34
37
  ```
35
38
 
36
- **Referencing a reference file** β€” use its `label` field in bold (the label is the short column name visible in the generated reference table):
39
+ **Referencing a reference Document without a link** β€” use its `label` field in bold (the label is the short column name visible in the generated reference table):
37
40
 
38
41
  ```markdown
39
42
  See **Extraction** for the code-block classification table.
@@ -34,10 +34,10 @@ Descriptions containing `: `, `#`, `[`, `]`, or `{{` **must** be wrapped in doub
34
34
 
35
35
  ```yaml
36
36
  # Bad β€” unquoted colon causes YAML parse error
37
- description: Config schema: migrations and deprecation codes.
37
+ description: Config schema: version validation and deprecation codes.
38
38
 
39
39
  # Good
40
- description: "Config schema: migrations and deprecation codes. Use when changing config fields."
40
+ description: "Config schema: version validation and deprecation codes. Use when changing config fields."
41
41
  ```
42
42
 
43
43
  Always quote descriptions. It is the safest default and causes no harm.
@@ -66,6 +66,6 @@ description: "Naming, import ordering, type discipline, and Biome rules. Use whe
66
66
  description: "Biome distance-based import ordering, type imports, and #region rules."
67
67
 
68
68
  # Config doc
69
- description: "Config schema: versioning, migration registry, deprecation codes. Use when changing config fields."
69
+ description: "Config schema: version validation, compatibility rules, and deprecation codes. Use when changing config fields."
70
70
  ```
71
71
  <!-- /extract:examples -->
@@ -19,7 +19,7 @@ Start with these root folders under `{{PLAYBOOK_PATH}}/` and add more as the cod
19
19
  | `architecture/` | System design, diagrams, ADRs, infrastructure topology |
20
20
  | `standards/` | Domain-specific technical rules (backend, frontend, security…) |
21
21
  | `team-members/` | Orchestrators and cross-domain AI agents |
22
- | `workflows/` | User-invoked AI workflows (`.wf.md` files), such as issue triage or UI review |
22
+ | `workflows/` | Multi-agent orchestration workflows (`.wf.md` files), such as issue triage or UI review |
23
23
  | `lifecycle/` | Lifecycle automation scripts (`.lc.md` files) that guard or enrich AI sessions |
24
24
  | `processes/` | Workflows, release checklists, incident runbooks, repeatable procedures |
25
25
 
@@ -50,7 +50,7 @@ When a user asks for hooks or automatic AI-tool behavior, create a lifecycle sou
50
50
  β”œβ”€β”€ team-members/ ← orchestrators and cross-domain agents
51
51
  β”‚ β”œβ”€β”€ orchestrator.tm.md
52
52
  β”‚ └── code-audit-runner.tm.md
53
- β”œβ”€β”€ workflows/ ← user-invoked AI workflows
53
+ β”œβ”€β”€ workflows/ ← multi-agent orchestration workflows
54
54
  β”‚ └── ui-review.wf.md
55
55
  └── lifecycle/ ← optional lifecycle automations
56
56
  └── session-start.lc.md
@@ -10,34 +10,48 @@ order: 10
10
10
 
11
11
  # Frontmatter Schema
12
12
 
13
- ## Required Fields (All Files)
13
+ ## Required Fields (Renderable Topics)
14
14
 
15
- These fields are mandatory on every canonical Playbook `.md` file:
15
+ A renderable Playbook Topic requires these fields:
16
16
 
17
17
  | Field | Rule |
18
18
  |-------|------|
19
+ | `category` | Explicit allowed topic kind; use `how-to:concept` for standard concept/how-to docs |
19
20
  | `name` | Unique kebab-case identifier across all docs |
20
21
  | `title` | Human-readable display name |
21
22
  | `description` | Third-person, what + when, specific key terms. Always in double quotes. |
22
23
 
23
24
  ```yaml
24
25
  ---
26
+ category: how-to:concept
25
27
  name: testing
26
28
  title: Testing Guidelines
27
29
  description: "Test isolation rules, temp dir pattern, and integration test approach for the SUMR CLI."
28
30
  ---
29
31
  ```
30
32
 
33
+ Set `category` to an allowed value to make Markdown a Topic. Markdown without
34
+ complete Topic identity remains a Document. A Document that supplies `name`,
35
+ `title`, and `description` but omits or declares an invalid `category` fails
36
+ closed before status reporting, validation completion, AI Channel rendering,
37
+ or pruning. Correct the canonical source frontmatter directly; Playbook does
38
+ not infer or rewrite categories.
39
+
31
40
  ## Categories
32
41
 
33
42
  | Value | Purpose | Required extra fields | AI output |
34
43
  |-------|---------|----------------------|-----------|
35
- | *(omitted)* | General how-to / main doc | β€” | Skill file |
36
- | `reference` | Supporting detail for a main doc | `title`, `label`, `when`, `order` | Skill file (attached) |
44
+ | `how-to:concept` | Standard concept or general how-to doc | β€” | Skill file |
45
+ | `topic` | General Playbook entry | β€” | Skill file |
46
+ | `how-to` | Procedural guide | β€” | Skill file |
47
+ | `reference` | Supporting detail for a main doc | `label`, `when`, `order` | Skill file (attached) |
48
+ | `role` | Recurring role or profile guidance | β€” | Skill file |
37
49
  | `team-member` | Tool-agnostic delegated role | β€” | Native agent/subagent profiles |
38
- | `workflow` | User-invoked AI workflow | β€” | Claude slash command |
39
- | `lifecycle` | Lifecycle automation script | `event` | Hook script + `hooks.json` |
40
- | `hook` | Legacy alias for `lifecycle` | `event` | Hook script + `hooks.json` |
50
+ | `command` | User-invoked AI command | β€” | Native command surface |
51
+ | `workflow` | Multi-agent orchestration workflow | fenced JS workflow script | Native orchestration surface |
52
+ | `lifecycle` | Lifecycle automation script | `event`, `target` | Hook script + channel binding |
53
+ | `hook` | Compatibility alias for `lifecycle` | `event`, `target` | Hook script + channel binding |
54
+ | `index` | Navigation/index Topic used for cross-references | β€” | Not generated |
41
55
 
42
56
  ### Optional Fields for Any Category
43
57
 
@@ -49,7 +63,7 @@ description: "Test isolation rules, temp dir pattern, and integration test appro
49
63
  | `access` | `read-only \| write \| full` | Permission posture. Channels translate it into their sandbox, tool, or permission model. |
50
64
  | `tools` | `string[]` | Agnostic capability tokens (`read`, `edit`, `shell`, `web`, `todo`, `task`). Channels translate them into native tool names or permission keys. |
51
65
  | `nicknames` | `string[]` | Friendly display names for spawned team-member instances. Codex renders this as `nickname_candidates`; other channels ignore it until they expose an equivalent. |
52
- | `channels` | object | Legacy-compatible per-channel overrides. Prefer top-level native channel blocks in new docs. |
66
+ | `channels` | object | Compatibility per-channel overrides. Prefer top-level native channel blocks in new docs. |
53
67
  | `target` | string | Output filename override (basename only, extension inferred) |
54
68
 
55
69
  ### Agent Model + Tools Axes
@@ -64,7 +78,7 @@ tools: [read, web] # read | edit | shell | web | todo | task β†’ channel-na
64
78
  nicknames: [Atlas, Delta, Echo] # friendly spawned-instance labels when supported
65
79
  ```
66
80
 
67
- `modelTier` β†’ concrete model per channel:
81
+ Playbook maps `modelTier` to these Claude aliases by default:
68
82
 
69
83
  | Tier | Claude |
70
84
  |------|--------|
@@ -72,10 +86,27 @@ nicknames: [Atlas, Delta, Echo] # friendly spawned-instance labels when supporte
72
86
  | `coding` | `sonnet` |
73
87
  | `fast` | `haiku` |
74
88
 
75
- Claude uses the short aliases (which never drift). Other channels ship no model
76
- default β€” pin them with `SUMR_MODEL_<CHANNEL>_<TIER>` (e.g. `SUMR_MODEL_CODEX_REASONING=o3`)
77
- or a native block. Codex still derives `model_reasoning_effort` from `effort` (or
78
- `modelTier`) and `sandbox_mode` from `access`.
89
+ Override model tiers for a Project without changing canonical Topics:
90
+
91
+ ```yaml
92
+ playbook:
93
+ models:
94
+ claude:
95
+ reasoning: claude-fable-5
96
+ coding: opus
97
+ ```
98
+
99
+ Run `sumr playbook config` for the interactive editor, or configure the same
100
+ values non-interactively:
101
+
102
+ ```bash
103
+ sumr playbook config --model claude.reasoning=claude-fable-5,claude.coding=opus
104
+ ```
105
+
106
+ Model IDs remain AI Channel-native strings. Playbook supplies no default model
107
+ mapping for other AI Channels, so configure the tiers that their generated
108
+ profiles require. Codex still derives `model_reasoning_effort` from `effort`
109
+ (or `modelTier`) and `sandbox_mode` from `access`.
79
110
 
80
111
  `tools` is transformed per channel, not copied as Claude names:
81
112
 
@@ -87,8 +118,10 @@ or a native block. Codex still derives `model_reasoning_effort` from `effort` (o
87
118
  | OpenCode | `permission:` object with keys such as `read`, `grep`, `edit`, `bash`, `webfetch` |
88
119
  | Codex | no tool allowlist; `access` maps to `sandbox_mode` |
89
120
 
90
- Resolution precedence (highest first): a native channel block (e.g. `codex.model`)
91
- β†’ the `SUMR_MODEL_*` env override β†’ the adapter default.
121
+ Resolution precedence, highest first: a native AI Channel block in the Topic
122
+ (for example, `codex.model`) β†’ the `SUMR_MODEL_*` environment override β†’
123
+ `playbook.models.<channel>.<tier>` in Project configuration β†’ the AI Channel
124
+ adapter default, when one exists.
92
125
 
93
126
  ## Native Channel Props
94
127
 
@@ -116,10 +149,6 @@ claude:
116
149
  mode: subagent
117
150
  skills: [typescript, security]
118
151
 
119
- # Cursor project rule options
120
- cursor:
121
- globs: [src/**/*.ts, tests/**/*.ts]
122
-
123
152
  # GitHub Copilot custom agent options
124
153
  copilot:
125
154
  tools: read
@@ -135,7 +164,7 @@ opencode:
135
164
  ---
136
165
  ```
137
166
 
138
- `channels:` remains supported as a legacy-compatible alias. If both shapes set the same channel property, the top-level channel block wins.
167
+ `channels:` remains supported as a compatibility alias. If both shapes set the same channel property, the top-level channel block wins.
139
168
 
140
169
  Claude `skills` entries are references to authored Playbook topic names. Use the
141
170
  complete `name` value from each skill topicβ€”never a shortened alias and never a
@@ -184,10 +213,11 @@ Use these as naming and writing guidance, not as a required `roleType` field:
184
213
 
185
214
  ## Reference File Fields
186
215
 
187
- All six fields are mandatory for `category: reference` files:
216
+ All seven fields are mandatory for `category: reference` files:
188
217
 
189
218
  | Field | Purpose | Example |
190
219
  |-------|---------|---------|
220
+ | `category` | Reference topic kind | `reference` |
191
221
  | `name` | Unique identifier | `typescript-imports` |
192
222
  | `description` | What it covers | `"Biome import ordering, type imports, #region rules."` |
193
223
  | `title` | Display name | `Import Organization` |
@@ -219,9 +249,9 @@ Use action phrases (present-participle -ing verbs) describing what the reader is
219
249
 
220
250
  ## Workflow File Fields
221
251
 
222
- For `category: workflow` files, no extra frontmatter is required. Use `target` to control the output file name when needed.
223
-
224
- Optional Claude command metadata can be stored under a top-level `claude:` block:
252
+ For `category: workflow` files, no extra frontmatter is required. Use `target`
253
+ to control the JavaScript output file name when needed. The Document must also
254
+ contain a fenced JavaScript orchestration that exports `meta`.
225
255
 
226
256
  ```yaml
227
257
  ---
@@ -229,26 +259,36 @@ category: workflow
229
259
  name: ui-review
230
260
  title: UI Review
231
261
  description: "Runs browser UI review and reports pass/fail evidence."
232
- target: ui-review.md
233
-
234
- # Claude Code slash command options
235
- claude:
236
- model: opus
237
- argument-hint: "[headed] [filename-filter]"
262
+ target: ui-review.js
238
263
  ---
239
264
  ```
240
265
 
266
+ ```js
267
+ export const meta = {
268
+ name: 'ui-review',
269
+ description: 'Runs browser UI review and reports pass/fail evidence.',
270
+ phases: [{ title: 'Review' }],
271
+ };
272
+
273
+ phase('Review');
274
+ return agent('Review the UI and report evidence.');
275
+ ```
276
+
277
+ User-invoked prompts use `category: command` in a `.cmd.md` Document; they are
278
+ not workflows.
279
+
241
280
  ## Lifecycle File Fields
242
281
 
243
282
  Create a lifecycle doc when the user asks for hooks, AI session automation, startup context, stop/closeout quality checks, pre-tool policy checks, post-tool formatters, or automated guardrails in Claude/Codex/Cursor/Copilot/Gemini/OpenCode.
244
283
 
245
284
  Canonical source belongs in `{{PLAYBOOK_PATH}}/lifecycle/<name>.lc.md` for repo-wide behavior. Use tool-native hook files only as generated output.
246
285
 
247
- For `category: lifecycle` files, one additional field is required:
286
+ For `category: lifecycle` files, two additional fields are required:
248
287
 
249
288
  | Field | Purpose | Example values |
250
289
  |-------|---------|---------------|
251
290
  | `event` | Lifecycle event that triggers this automation | `SessionStart`, `PreToolUse`, `PostToolUse`, `Stop` |
291
+ | `target` | Filesystem-safe output basename, including the script extension | `code_quality_closeout.py`, `session_start.sh` |
252
292
 
253
293
  Optional fields for lifecycle automations:
254
294
 
@@ -271,7 +311,7 @@ target: code_quality_closeout.py
271
311
  ---
272
312
  ```
273
313
 
274
- The body must contain a code-fenced script block (Python, Bash, or JS). The fence language determines the interpreter. Existing `category: hook` and `.hk.md` files still work as legacy aliases.
314
+ The body must contain a code-fenced script block (Python, Bash, or JS). The fence language determines the interpreter. Existing `category: hook` and `.hk.md` files still work as compatibility aliases.
275
315
 
276
316
  After authoring a lifecycle doc, run `sumr playbook validate --source docs`, then `sumr playbook sync --source docs --dry-run --json`, then normal sync once the preview shows only expected generated hook outputs.
277
317
 
@@ -287,7 +327,7 @@ tags: [typescript, biome, conventions]
287
327
 
288
328
  When reviewing a `category: reference` file, verify all of the following:
289
329
 
290
- 1. All six required fields present: `name`, `description`, `title`, `label`, `when`, `order`
330
+ 1. All seven required fields present: `category`, `name`, `description`, `title`, `label`, `when`, `order`
291
331
  2. No `## When to Use` section in the body β€” the `when` frontmatter field replaces it
292
332
  3. No `references:` field in frontmatter
293
333
  4. `when` field uses action phrases, not bare keywords
@@ -22,7 +22,7 @@ User asks for hook/automation
22
22
 
23
23
  - Say **lifecycle automation** in canonical Playbook docs.
24
24
  - Treat **hook** as the generated AI Channel mechanism.
25
- - `category: hook` and `.hk.md` are legacy aliases; use `category: lifecycle`
25
+ - `category: hook` and `.hk.md` are compatibility aliases; use `category: lifecycle`
26
26
  and `.lc.md` for new docs.
27
27
 
28
28
  ## Placement
@@ -108,7 +108,8 @@ A checklist is more reliable than the same steps buried in a paragraph.
108
108
  ## Links
109
109
 
110
110
  - Descriptive link text β€” never `"click here"` or `"here"`
111
- - For cross-doc references inside `{{PLAYBOOK_PATH}}/`, reference by **name** (main topics) or **label** (reference files) in bold β€” never by file path. See **Cross-Refs**.
111
+ - Use contained source-relative Markdown links when navigation must remain functional in generated AI Channel outputs. Playbook rewrites links to generated Topics, attached reference Documents, extracted sections, and headings; dangling or unmapped links fail validation.
112
+ - When navigation is unnecessary, reference a main Topic by **name** or a reference Document by **label** in bold. See **Cross-Refs**.
112
113
 
113
114
  ## Anti-Pattern Quick Reference
114
115