@sumrco/cli 0.3.0 → 0.3.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 (35) hide show
  1. package/ai/modules/kontract/resources/api-generation-standards.rf.md +83 -0
  2. package/ai/modules/kontract/resources/{configuration.rf.md → authoring/configuration.rf.md} +49 -11
  3. package/ai/modules/kontract/resources/authoring/design-profile/api-styles.rf.md +241 -0
  4. package/ai/modules/kontract/resources/authoring/design-profile/async-styles.rf.md +134 -0
  5. package/ai/modules/kontract/resources/authoring/design-profile/overview.md +64 -0
  6. package/ai/modules/kontract/resources/authoring/design-profile/schema-layout-styles.rf.md +356 -0
  7. package/ai/modules/kontract/resources/authoring/overview.md +56 -0
  8. package/ai/modules/kontract/resources/{schema-reuse.rf.md → authoring/schema-reuse.rf.md} +222 -46
  9. package/ai/modules/kontract/resources/{scope-and-splitting.rf.md → authoring/scope-and-splitting.rf.md} +113 -57
  10. package/ai/modules/kontract/resources/authoring/spec-layout.rf.md +492 -0
  11. package/ai/modules/kontract/resources/authoring/team-members/spec-author.tm.md +77 -0
  12. package/ai/modules/kontract/resources/{workflows/contract-change.wf.md → authoring/workflows/spec-change.wf.md} +21 -15
  13. package/ai/modules/kontract/resources/generated-output.rf.md +19 -14
  14. package/ai/modules/kontract/resources/openapi-sdk-generator-research.rf.md +17 -19
  15. package/ai/modules/kontract/resources/overview.md +115 -82
  16. package/ai/modules/kontract/resources/performance.rf.md +7 -7
  17. package/ai/modules/kontract/sumr.module.yaml +3 -0
  18. package/ai/modules/mission/sumr.module.yaml +6 -0
  19. package/ai/modules/playbook/resources/authoring/content-structure.rf.md +1 -1
  20. package/ai/modules/playbook/resources/authoring/cross-referencing.rf.md +1 -1
  21. package/ai/modules/playbook/resources/authoring/descriptions.rf.md +1 -1
  22. package/ai/modules/playbook/resources/authoring/extraction.rf.md +1 -1
  23. package/ai/modules/playbook/resources/authoring/flows.rf.md +1 -1
  24. package/ai/modules/playbook/resources/authoring/folder-structure.rf.md +1 -1
  25. package/ai/modules/playbook/resources/authoring/frontmatter.rf.md +4 -1
  26. package/ai/modules/playbook/resources/authoring/markdown.rf.md +1 -1
  27. package/ai/modules/playbook/resources/authoring/overview.md +1 -1
  28. package/ai/modules/playbook/resources/team-members/{playbook-technical-writer.tm.md → technical-writer.tm.md} +3 -2
  29. package/ai/modules/playbook/sumr.module.yaml +7 -2
  30. package/index.js +332 -276
  31. package/package.json +1 -1
  32. package/ai/modules/kontract/resources/language-sdk-generator-extension.rf.md +0 -62
  33. package/ai/modules/kontract/resources/openapi-generator-lessons.rf.md +0 -61
  34. package/ai/modules/kontract/resources/spec-layout.rf.md +0 -275
  35. package/ai/modules/kontract/resources/team-members/contract-author.tm.md +0 -60
@@ -14,9 +14,9 @@ Generated files are deterministic outputs. Import them; never edit them.
14
14
  Every generated TypeScript file starts with an `<auto-generated>` comment that
15
15
  warns users not to edit the file directly.
16
16
 
17
- ## HTTP output — one folder per OpenAPI service
17
+ ## HTTP output — one folder per API schema service
18
18
 
19
- For an OpenAPI service such as `recipes.openapi.yml`, the NestJS target
19
+ For an API schema service such as `recipes.api.yml`, the NestJS target
20
20
  emits a service folder:
21
21
 
22
22
  ```text
@@ -60,7 +60,7 @@ export * from './swagger';
60
60
  Do not flatten-import everything blindly when DTO/model/Zod symbols collide.
61
61
  Use the namespace exports or import from the leaf folder.
62
62
 
63
- ## Zod contract — one file per OpenAPI `components/schemas` entry
63
+ ## Zod contract — one file per API schema `components/schemas` entry
64
64
 
65
65
  ```typescript
66
66
  // contracts/recipes/http/zod/recipe.contract.ts
@@ -91,17 +91,17 @@ export interface Recipe {
91
91
  }
92
92
  ```
93
93
 
94
- Model interfaces are framework-neutral and are safe for backend and frontend
94
+ Model interfaces are framework-and are safe for backend and frontend
95
95
  type-only imports.
96
96
 
97
- Map-shaped schemas follow OpenAPI `additionalProperties` semantics:
97
+ Map-shaped schemas follow API schema `additionalProperties` semantics:
98
98
 
99
99
  - map-only schemas generate index signatures such as `[key: string]: string`;
100
100
  - named properties with `additionalProperties: true` preserve the named fields
101
101
  and use `[key: string]: unknown`;
102
102
  - named properties with typed `additionalProperties` preserve named fields and
103
103
  widen the index signature with known property value types, matching the
104
- practical TypeScript approach used by current OpenAPI TypeScript generators.
104
+ practical TypeScript approach used by current API schema TypeScript generators.
105
105
 
106
106
  ## Class-validator DTO — when `dtos: true`
107
107
 
@@ -151,7 +151,7 @@ export const SWG_LIST_RECIPES = {
151
151
  `swagger: true` works with either `zod: true` or `dtos: true`. Generated
152
152
  metadata preserves operation IDs, paths, summaries, descriptions, params, query
153
153
  params, body DTOs, response DTOs, success response status, `x-kontract-surface`,
154
- and standard OpenAPI `security`.
154
+ and standard API schema `security`.
155
155
 
156
156
  ## Generated `ApiDoc` decorator — when `swagger: true`
157
157
 
@@ -164,7 +164,7 @@ export function ApiDoc(operation: ApiDocOperation): MethodDecorator {
164
164
  ```
165
165
 
166
166
  Controllers can consume `ApiDoc(SWG_*)` metadata to keep runtime Swagger output
167
- aligned with the OpenAPI design contract:
167
+ aligned with the API schema design contract:
168
168
 
169
169
  ```typescript
170
170
  import { SWG_LIST_RECIPES } from 'SUMR Schemas module/recipes/http';
@@ -197,7 +197,7 @@ export class RecipesFetchClient {
197
197
  constructor(private readonly config: RequestConfig = {}) {}
198
198
 
199
199
  async getRecipe(request: GetRecipeRequest): Promise<Models.Recipe> {
200
- // fetch call generated from OpenAPI operation metadata
200
+ // fetch call generated from API schema operation metadata
201
201
  }
202
202
  }
203
203
  ```
@@ -227,10 +227,11 @@ Example React usage with the fetch SDK:
227
227
 
228
228
  ```typescript
229
229
  import { ProductsFetchClient } from './generated/api';
230
+ import { decodeProductApiJson } from './product-api-decoder';
230
231
 
231
232
  const api = new ProductsFetchClient({
232
233
  baseUrl: '/api',
233
- decodeJson: (value) => value as never,
234
+ decodeJson: decodeProductApiJson,
234
235
  });
235
236
 
236
237
  export async function loadProduct(id: string) {
@@ -238,6 +239,10 @@ export async function loadProduct(id: string) {
238
239
  }
239
240
  ```
240
241
 
242
+ Use an application-owned decoder such as a generated Zod schema, Valibot schema,
243
+ or reviewed type guard at the `decodeJson` boundary. Do not cast unknown JSON in
244
+ consumer code.
245
+
241
246
  Example Angular usage:
242
247
 
243
248
  ```typescript
@@ -258,7 +263,7 @@ The generated SDK owns path interpolation, query serialization, request body
258
263
  encoding, response typing, and generated model imports. Consumers call methods
259
264
  instead of rewriting API URLs and `fetch`/`HttpClient` calls by hand.
260
265
 
261
- ## NATS contract — one `nats/index.ts` per AsyncAPI service
266
+ ## NATS contract — one `nats/index.ts` per async schema service
262
267
 
263
268
  ```typescript
264
269
  // contracts/recipes/nats/index.ts
@@ -286,12 +291,12 @@ export namespace Recipes {
286
291
  }
287
292
  ```
288
293
 
289
- - Namespace name comes from AsyncAPI `info.title`.
294
+ - Namespace name comes from async schema `info.title`.
290
295
  - Every message yields a Zod const + `z.infer<>` type + `z.input<>` input type.
291
296
  - Subjects live in a single `SUBJECTS` const used directly by NestJS NATS.
292
297
  - Clients validate input with `.parse()` before sending.
293
298
 
294
- ## NATS enum constants — `nats/enums/` per AsyncAPI service
299
+ ## NATS enum constants — `nats/enums/` per async schema service
295
300
 
296
301
  Named `components/schemas` entries that are string or number enums emit one
297
302
  constant file each, mirroring `http/enums/`:
@@ -328,7 +333,7 @@ export const RecipeStatusMap = {
328
333
  validation.
329
334
  - Use per-service `http/swagger.ts` and the shared
330
335
  `shared/http/decorators/api-doc.ts` helper when a controller should prove
331
- runtime Swagger/OpenAPI behavior from generated metadata.
336
+ runtime Swagger/API schema behavior from generated metadata.
332
337
  - Use `http/dto` classes when a controller follows the class-validator DTO
333
338
  pattern.
334
339
  - Use `http/models` interfaces for type-only internal code.
@@ -1,32 +1,33 @@
1
1
  ---
2
2
  category: reference
3
3
  name: openapi-sdk-generator-research
4
- title: OpenAPI SDK Generator Research
5
- description: "Public generator lessons Kontract applies when evolving TypeScript SDK output."
6
- label: OpenAPI SDK Generator Research
7
- when: Designing or reviewing Kontract SDK output, runtime helpers, config options, or schema preview work
4
+ title: API schema SDK Generator Research
5
+ description: "Generator design inputs Kontract uses for current TypeScript SDK output."
6
+ label: API schema SDK Generator Research
7
+ when: Designing or reviewing Kontract SDK output, runtime helpers, config options, or model imports
8
8
  order: 46
9
9
  ---
10
10
 
11
- # OpenAPI SDK Generator Research
11
+ # API schema SDK Generator Research
12
12
 
13
- Kontract learns from public OpenAPI generators without inheriting their runtime
14
- shape, Java dependency chain, or template system.
13
+ Kontract reviews public API schema generator behavior to keep TypeScript SDK output
14
+ familiar, small, and Bun-native without inheriting Java dependency chains or
15
+ template systems.
15
16
 
16
- ## References reviewed
17
+ ## Reviewed generator inputs
17
18
 
18
- - OpenAPI Generator `typescript-fetch`:
19
+ - API schema Generator `typescript-fetch`:
19
20
  <https://openapi-generator.tech/docs/generators/typescript-fetch/>
20
- - OpenAPI Generator `typescript-axios`:
21
+ - API schema Generator `typescript-axios`:
21
22
  <https://openapi-generator.tech/docs/generators/typescript-axios/>
22
- - OpenAPI Generator `typescript-angular`:
23
+ - API schema Generator `typescript-angular`:
23
24
  <https://openapi-generator.tech/docs/generators/typescript-angular/>
24
- - OpenAPI Generator `typescript-nestjs`:
25
+ - API schema Generator `typescript-nestjs`:
25
26
  <https://openapi-generator.tech/docs/generators/typescript-nestjs/>
26
- - OpenAPI TypeScript `openapi-fetch`:
27
+ - API schema TypeScript `openapi-fetch`:
27
28
  <https://openapi-ts.dev/openapi-fetch/>
28
29
 
29
- ## Lessons for Kontract
30
+ ## SDK generation standards
30
31
 
31
32
  - Keep SDK config options familiar where they are useful:
32
33
  `useSingleRequestParameter`, `paramNaming`, `modelPropertyNaming`,
@@ -40,20 +41,17 @@ shape, Java dependency chain, or template system.
40
41
  - Keep reserved-word handling in the SDK path. Wire names such as `from`,
41
42
  `class`, and `default` must remain valid request keys while local variables
42
43
  stay valid TypeScript identifiers.
43
- - Preserve OpenAPI `additionalProperties` semantics in models and SDK types.
44
+ - Preserve API schema `additionalProperties` semantics in models and SDK types.
44
45
  - Fail before partial output for unsupported polymorphism rather than generating
45
46
  missing or unsafe symbols.
46
47
  - Keep the fetch runtime small. `openapi-fetch` is a useful benchmark for a
47
48
  low-runtime client; Kontract should avoid pulling in a heavy client runtime
48
49
  unless a target explicitly asks for it.
49
50
 
50
- ## Product decisions
51
+ ## Current product decisions
51
52
 
52
53
  - `typescript-nestjs` remains a server-contract generator. Its `sdk: true`
53
54
  option adds a companion fetch client for NestJS consumers; it does not turn
54
55
  the target into a standalone frontend package.
55
56
  - `typescript-fetch`, `typescript-axios`, and `typescript-angular` remain
56
57
  standalone SDK targets with their own generated models.
57
- - Schema preview HTML needs a separate research spike because bundle size,
58
- license, and static-output feasibility affect whether the feature belongs in
59
- Kontract, Website, or both.
@@ -1,74 +1,111 @@
1
1
  ---
2
2
  name: usage
3
3
  title: Kontract Usage
4
- description: "How to use the SUMR Kontract CLI to generate configured contract artifacts from OpenAPI and AsyncAPI sources. Use when adding, changing, reviewing, validating, or generating API contracts."
5
- tags: [kontract, contracts, openapi, asyncapi, nestjs, codegen]
4
+ 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."
5
+ tags: [kontract, contracts, api, async, microservices, codegen]
6
6
  ---
7
7
 
8
8
  # Kontract Usage
9
9
 
10
10
  Kontract generates the artifacts that keep APIs honest: validation schemas,
11
- framework decorators, SDKs, docs inputs, runtime evidence, and message contracts
12
- from OpenAPI and AsyncAPI sources.
11
+ SDKs, docs inputs, runtime evidence, and message contracts from API and async
12
+ schemas.
13
13
 
14
14
  ## When to Use
15
15
 
16
- - Adding or editing an OpenAPI (`*.openapi.yml`) or AsyncAPI (`*.asyncapi.yml`) spec.
17
- - Adding domain/subdomain specs with the neutral `*.schema.yml` suffix when the
18
- YAML marker (`openapi:` or `asyncapi:`) should decide the protocol.
19
- - Reviewing newly written or updated `*.openapi.yml`, `*.asyncapi.yml`, or
20
- `*.schema.yml` files against Kontract best practices before validation or
21
- generation.
22
- - Refactoring duplicated schema fields into shared `$ref` components.
16
+ - Adding or editing an API schema (`*.api.yml`) or async schema (`*.async.yml`).
17
+ - Adding product-capability/API-surface schema modules with local `shared/`
18
+ folders only when concepts are reused.
19
+ - Reviewing newly written or updated `*.api.yml` or `*.async.yml` files against
20
+ Kontract best practices before validation or generation.
21
+ - Refactoring duplicated schema fields into shared `$ref` components or
22
+ `kontract.sets` map fragments.
23
23
  - Regenerating contracts after a spec change.
24
24
  - Validating specs before committing or in CI.
25
- - Wiring generated contracts into a NestJS microservice.
25
+ - Wiring generated contracts into a service or client.
26
26
 
27
27
  ## Commands
28
28
 
29
29
  ```bash
30
30
  sumr kontract init # activate Kontract AI guidance for this repo
31
- sumr kontract validate # validate configured OpenAPI/AsyncAPI sources
31
+ sumr kontract config # show or update guidance profile settings
32
+ sumr kontract validate # validate configured schema sources
32
33
  sumr kontract generate # generate configured contract artifacts
33
34
  ```
34
35
 
35
- Useful flags:
36
+ Activation also keeps local VS Code Material Icon associations in sync for
37
+ Kontract API and async YAML source files.
36
38
 
37
- - `--source <name>` limit to one configured source
38
- - `--target <name>` — limit to one configured target
39
- - `-c, --concurrency <n>` — max parallel workers
40
- - `--verbose` / `--quiet` — log level (`CI=true` implies quiet)
41
- - `generate` also accepts `-s, --specific <name>` to generate one service spec
42
- - `generate` also accepts `--clean` to remove selected generated outputs and the
43
- selected Kontract bundle cache before regenerating
39
+ For the full current option list, run the CLI help instead of duplicating flags
40
+ across resources:
41
+
42
+ ```bash
43
+ sumr kontract help
44
+ sumr kontract <command> --help
45
+ ```
46
+
47
+ Common workflows:
48
+
49
+ ```bash
50
+ # Review guidance profile settings.
51
+ sumr kontract config
52
+
53
+ # Generate one selected service/schema.
54
+ sumr kontract generate --source api --target backend --specific recipes
55
+
56
+ # Clean and regenerate selected outputs.
57
+ sumr kontract generate --source api --target backend --clean
58
+ ```
44
59
 
45
60
  ## The Model
46
61
 
62
+ Choose the protocol scenario first:
63
+
64
+ - API-only: HTTP roots and API schema components.
65
+ - async-only: messaging roots, channels, messages, and payload schemas.
66
+ - API + async: separate roots and protocol layers, with shared neutral
67
+ components only when meanings match, especially enums and scalar value objects.
68
+ - Keep schemas local to the owning surface first. Promote to capability
69
+ `shared/` only after multiple surfaces reuse the same concept; promote to
70
+ `schema/shared/` only after multiple capabilities need it.
71
+
47
72
  ```text
48
73
  schema/
49
- recipes.openapi.yml → contracts/recipes/http/
50
- recipes.asyncapi.yml → contracts/recipes/nats/index.ts
51
- recipes/
52
- catalog.schema.yml → contracts/recipes/http/
53
- events.schema.yml → contracts/recipes/nats/index.ts
74
+ recipes.api.yml → contracts/recipes/http/
75
+ recipes.async.yml → contracts/recipes/nats/index.ts
76
+ orders/
77
+ main.api.yml → contracts/orders/http/
78
+ public.api.yml → contracts/orders/http/
79
+ lifecycle.api.yml → contracts/orders/http/
80
+ shared/
81
+ enums.yml → reused by multiple orders surfaces
82
+ components.yml → reused by multiple orders surfaces
83
+ shared/
84
+ errors.yml → reused by multiple capabilities
54
85
  ```
55
86
 
56
- One OpenAPI or AsyncAPI source → many generated, always-consistent artifacts.
57
- Generated files are outputs: never hand-edit them — change the spec and
58
- regenerate.
87
+ One schema source → many generated, always-consistent artifacts. Generated files
88
+ are outputs: never hand-edit them — change the spec and regenerate.
59
89
 
60
90
  ## Configuration
61
91
 
62
92
  Kontract is configured from the repo's `sumr.yaml` under `kontract.sources`.
63
- Each source points at an input directory and one or more targets:
93
+ Optional guidance under `kontract.guidance.profile` selects documentation and AI
94
+ examples only; it does not change validation or generation. Each source points
95
+ at an input directory and one or more targets:
64
96
 
65
97
  ```yaml
66
98
  kontract:
99
+ guidance:
100
+ profile:
101
+ apiStyle: pragmatic-rest
102
+ asyncStyle: command-event
103
+ schemaLayoutStyle: by-product-capability
67
104
  sources:
68
105
  - name: api
69
106
  input: schema
70
107
  targets:
71
- - name: backend
108
+ - name: service-contracts
72
109
  output: backend/src/shared/models
73
110
  generator:
74
111
  type: typescript-nestjs
@@ -80,85 +117,81 @@ kontract:
80
117
  type: typescript-fetch
81
118
  ```
82
119
 
83
- For `typescript-nestjs`:
120
+ For server-contract targets:
84
121
 
85
- - `zod: true` emits NestJS-Zod contracts under `http/zod/`.
86
- - `dtos: true` emits class-validator DTOs under `http/dto/` plus
87
- compatibility `http/swagger.ts` operation metadata.
122
+ - `zod: true` emits runtime validation contracts under `http/zod/`.
123
+ - `dtos: true` emits DTO classes under `http/dto/` plus compatibility
124
+ `http/swagger.ts` operation metadata.
88
125
  - `swagger: true` emits per-service `http/swagger.ts` operation metadata and one
89
- shared `shared/http/decorators/api-doc.ts` helper for NestJS controllers.
126
+ shared `shared/http/decorators/api-doc.ts` helper.
90
127
  - `sdk: true` emits a fetch-based `http/sdk/` client that reuses the same
91
- `http/models/` and `http/enums/` generated for the NestJS target.
128
+ `http/models/` and `http/enums/` generated for the target.
92
129
  - `dto: true` is accepted as a compatibility alias for `dtos: true`; prefer
93
130
  `dtos` in new config.
94
131
  - Framework-neutral model interfaces are emitted under `http/models/`.
95
132
 
96
- If a consuming repo is missing `http/swagger.ts` or
97
- `shared/http/decorators/api-doc.ts`, first confirm the target has
133
+ If a consuming repo is missing API metadata output, first confirm the target has
98
134
  `swagger: true`, and that the installed `SUMR Kontract module` version contains
99
- Swagger/ApiDoc support.
135
+ the metadata helper.
100
136
 
101
137
  ## Generator Catalog
102
138
 
103
- ### Current
104
-
105
139
  | Category | Generator | Outputs |
106
140
  |---|---|---|
107
- | Server/framework | `typescript-nestjs` | Zod DTOs, class-validator DTOs, models, Swagger metadata, generated `ApiDoc`, optional SDK. |
108
- | Messaging | `asyncapi-nats` | NATS subjects, message schemas, client/server interfaces. |
141
+ | Server contracts | `typescript-nestjs` | Runtime validation contracts, DTOs, models, API metadata, optional SDK. |
142
+ | Messaging | `asyncapi-nats` | Message subjects, message schemas, client/server interfaces. |
109
143
  | Client/SDK | `typescript-fetch` / `typescript-axios` / `typescript-angular` | Standalone TypeScript clients with bundled models. |
110
- | Model | `typescript-models` | Framework-neutral model-only output. |
144
+ | Model | `typescript-models` | Framework-model-only output. |
111
145
 
112
- ### Near-term
113
-
114
- | Category | Generator | Outputs |
115
- |---|---|---|
116
- | Runtime evidence | NestJS Swagger extraction | OpenAPI JSON from real Nest routes. |
117
- | API package | API contracts package | Packaged OpenAPI artifacts. |
118
- | Docs | docs-ready OpenAPI | Filtered public/app/admin docs inputs. |
119
- | Preview | schema preview HTML | Static API reference output after Scalar/free-option research. |
120
- | SDK | TypeScript SDK | Public/app/admin clients. |
121
- | Quality | contract tests | Route/spec drift and response-shape tests. |
122
-
123
- ### Future
124
-
125
- - Java, Rust, Python, Go, and Swift SDKs.
126
- - Postman or Bruno collections.
127
- - mock servers.
128
- - breaking-change and OpenAPI diff reports.
129
- - API changelog artifacts.
130
- - docs snippets and examples.
146
+ Roadmap and future generator ideas live in `docs/internal/generator-roadmap.md`; exported AI resources describe current supported behavior only.
131
147
 
132
148
  ## Core Rules
133
149
 
134
150
  - Validate before you generate: `sumr kontract validate` then `sumr kontract generate`.
135
151
  - Treat everything under the generated `contracts/` output as read-only.
136
152
  - Keep specs the single source of truth; do not hand-write Zod/DTOs that Kontract owns.
137
- - After writing or updating any `*.openapi.yml`, `*.asyncapi.yml`, or
138
- `*.schema.yml` file, review the spec for duplicated concepts before
139
- generation.
153
+ - After writing or updating any `*.api.yml` or `*.async.yml` file, review the
154
+ schema for duplicated concepts before generation.
140
155
  - Treat `summary`, `description`, `title`, parameter descriptions, response
141
156
  descriptions, and message descriptions as user-facing copy when they appear in
142
- docs, Swagger, Scalar, generated SDKs, or AI answers. Route changed copy
143
- through the repo's copywriter/microcopy standard before generation.
157
+ docs, Swagger, Scalar, generated SDKs, or AI answers. Review changed copy
158
+ against the repo's copywriter standard before generation.
144
159
  - Design specs for reuse: shared parameters, scalar constraints, error responses,
145
160
  response envelope fragments, pagination metadata, schedule/time-slot shapes,
146
161
  and common config objects belong in shared components referenced with `$ref`.
162
+ - Read `kontract.guidance.profile` before writing examples. Align path,
163
+ channel, component, and folder samples to the selected API, async, and schema
164
+ layout styles.
165
+ - Inspect the actual source protocols before writing examples. For an
166
+ API-only repo, do not invent async schema roots, channel examples, or
167
+ `messages/` folders.
168
+ - For an async-only repo, do not invent API schema roots, `paths/` folders, or
169
+ HTTP component examples.
170
+ - When API schema and async schema both exist, keep protocol-specific layers separate
171
+ and share only schemas with identical meaning, especially enums,
172
+ scalar value objects, IDs, and slugs.
173
+ - Keep simple API schema specs simple: use a focused root file with local
174
+ `components.schemas` first, and split into `paths/` fragments only when size,
175
+ ownership, or reuse pressure justifies it.
176
+ - Start from the contract authoring overview before proposing schema files,
177
+ folder moves, or profile-specific examples.
147
178
  - Use compact YAML readability rules for editor navigation: section comments are
148
- visual landmarks only, naming follows domain meaning, and large files should
149
- split by domain/subdomain before comments become a table of contents.
150
- - See the spec layout and generated output references for the exact file shapes.
151
- - See the scope and splitting reference when a spec or Kontract source file
152
- crosses the review thresholds, mixes domains, or needs domain/subdomain
153
- structure.
154
- - See the schema reuse reference before adding repeated fields or reviewing a
155
- generated diff with many near-identical DTO/model files.
156
- - See the OpenAPI generator lessons reference before changing query params,
179
+ visual landmarks only, naming follows product meaning, and large files should
180
+ split by product capability or API surface before comments become a table of
181
+ contents.
182
+ - See the authoring design-profile overview and axis references before choosing
183
+ or explaining HTTP, async schema, and schema layout examples.
184
+ - See the authoring spec layout and generated output references for the exact
185
+ source and output file shapes.
186
+ - See the authoring scope and splitting reference when a spec or Kontract source
187
+ file crosses the review thresholds, mixes product areas, or needs
188
+ capability/surface structure.
189
+ - See the authoring schema reuse reference before adding repeated fields or
190
+ reviewing a generated diff with many near-identical DTO/model files.
191
+ - See the API schema generation standards reference before changing query params,
157
192
  inline schemas, SDK serialization, or strict TypeScript compatibility rules.
158
- - See the OpenAPI SDK generator research reference before changing SDK runtime
159
- shape, target defaults, model imports, or preview-docs direction.
160
- - See the language SDK generator extension reference before adding Java, Rust,
161
- or any non-TypeScript SDK target.
193
+ - See the API schema SDK generator research reference before changing SDK runtime
194
+ shape, target defaults, or model imports.
162
195
  - Use scoped flags (`--source`, `--target`, `--specific`) before `--clean` in a
163
196
  large consumer repo.
164
197
  - Warm generation is manifest-driven. Kontract stores per-service manifests in
@@ -40,17 +40,17 @@ CLI generation does not spawn Biome once per generated file. It writes changed f
40
40
 
41
41
  ## Bundling strategy
42
42
 
43
- OpenAPI roots with no `$ref` or only internal `#/...` refs skip bundling. Roots with external
44
- refs use Redocly's OpenAPI core in-process, and safe bundles are cached under:
43
+ API schema roots with no `$ref` or only internal `#/...` refs skip bundling. Roots with external
44
+ refs use Redocly's API schema core in-process, and safe bundles are cached under:
45
45
 
46
46
  ```text
47
47
  .sumr-cache/kontract/bundles/<source>/source-cache/bundle-cache/
48
48
  ```
49
49
 
50
- The source-scoped bundle cache is shared across targets in the same source. A BCHQ-style source
51
- that generates backend NestJS contracts and frontend models should bundle each unchanged external
52
- OpenAPI root once, not once per target. Unsafe or ambiguous refs still fall back to target-scoped
53
- temporary bundling.
50
+ The source-scoped bundle cache is shared across targets in the same source. A
51
+ source that generates backend contracts and frontend models should bundle each
52
+ unchanged external API schema root once, not once per target. Unsafe or ambiguous
53
+ refs still fall back to target-scoped temporary bundling.
54
54
 
55
55
  Ambiguous multiline or remote refs take the safe path and regenerate/bundle rather than trusting a stale cache.
56
56
 
@@ -83,7 +83,7 @@ bun run tools perf generate --count=20 --concurrency=8 --mode=both --refs=extern
83
83
 
84
84
  Benchmark output stays under `.tmp/` and writes both `results.json` and `README.md` with phase timings, counters, and subprocess resource usage. Use `--refs=internal` to confirm bundling is skipped, and `--refs=external --targets=both` to confirm the shared bundle cache keeps cold-run in-process bundling at roughly one per schema root instead of one per target.
85
85
 
86
- Local signal after in-process OpenAPI bundling:
86
+ Local signal after in-process API schema bundling:
87
87
 
88
88
  - `--count=1000 --refs=external --targets=both --concurrency=8`: cold `8.72s`, warm `0.83s`.
89
89
  - Warm manifests skipped all `2000` source/target work items and ran zero formatter/bundler subprocesses.
@@ -20,6 +20,9 @@ spec:
20
20
  - name: init
21
21
  summary: Activate Kontract AI guidance for this workspace
22
22
  visibility: public
23
+ - name: config
24
+ summary: Show or update Kontract guidance profile settings
25
+ visibility: public
23
26
  - name: generate
24
27
  summary: Generate configured contract artifacts from API specs
25
28
  visibility: public
@@ -29,6 +29,9 @@ spec:
29
29
  - name: next
30
30
  summary: Show the next mission action
31
31
  visibility: public
32
+ - name: sync
33
+ summary: Fetch issue context and board status from the tracker
34
+ visibility: public
32
35
  - name: list
33
36
  summary: List missions
34
37
  visibility: public
@@ -44,6 +47,9 @@ spec:
44
47
  - name: report
45
48
  summary: Create a mission report
46
49
  visibility: public
50
+ - name: reopen
51
+ summary: Record a QA failure and drive a corrective cycle
52
+ visibility: public
47
53
  - name: block
48
54
  summary: Mark a mission as blocked
49
55
  visibility: public
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-structure
3
+ name: authoring-structure
4
4
  title: Content Structure
5
5
  description: "Body templates for canonical Playbook topics and reference files, with required sections and structure rules."
6
6
  label: Structure
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-cross-referencing
3
+ name: authoring-cross-referencing
4
4
  title: Cross-Referencing
5
5
  description: "How to reference other topics within SUMR docs: use name for main topics, label for references. Never use file paths."
6
6
  label: Cross-Refs
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-descriptions
3
+ name: authoring-descriptions
4
4
  title: Writing Descriptions
5
5
  description: "Rules for writing effective frontmatter descriptions — third person, what-plus-when, specific key terms, length, and YAML safety."
6
6
  label: Descriptions
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-extraction
3
+ 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
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-flows
3
+ name: authoring-flows
4
4
  title: Flow Documentation
5
5
  description: "Flow documentation patterns for Playbook docs, including compact arrow flows, human approval gates, Mermaid diagrams, and transition rules."
6
6
  label: Flows
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-folder-structure
3
+ name: authoring-folder-structure
4
4
  title: Folder Structure
5
5
  description: "Recommended Playbook folder layout, top-level naming, team-member placement patterns (root vs domain-embedded), and standards folder naming alternatives."
6
6
  label: Folder Structure
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-frontmatter
3
+ name: authoring-frontmatter
4
4
  title: Frontmatter Schema
5
5
  description: "Required and optional frontmatter fields, category values, and per-category validation rules for SUMR Playbook docs."
6
6
  label: Frontmatter
@@ -48,6 +48,7 @@ description: "Test isolation rules, temp dir pattern, and integration test appro
48
48
  | `effort` | `low \| medium \| high` | Reasoning depth for team-member/agent topics. Channels that support effort emit their native knob. |
49
49
  | `access` | `read-only \| write \| full` | Permission posture. Channels translate it into their sandbox, tool, or permission model. |
50
50
  | `tools` | `string[]` | Agnostic capability tokens (`read`, `edit`, `shell`, `web`, `todo`, `task`). Channels translate them into native tool names or permission keys. |
51
+ | `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. |
51
52
  | `channels` | object | Legacy-compatible per-channel overrides. Prefer top-level native channel blocks in new docs. |
52
53
  | `target` | string | Output filename override (basename only, extension inferred) |
53
54
 
@@ -60,6 +61,7 @@ modelTier: reasoning # reasoning | coding | fast → model class
60
61
  effort: high # low | medium | high → Codex model_reasoning_effort
61
62
  access: read-only # read-only | write | full → channel-native permission posture
62
63
  tools: [read, web] # read | edit | shell | web | todo | task → channel-native tools/permissions
64
+ nicknames: [Atlas, Delta, Echo] # friendly spawned-instance labels when supported
63
65
  ```
64
66
 
65
67
  `modelTier` → concrete model per channel:
@@ -101,6 +103,7 @@ name: codebase-reviewer
101
103
  title: Codebase Reviewer
102
104
  description: "Reviews code for correctness, security, behavior regressions, and missing tests."
103
105
  modelTier: reasoning
106
+ nicknames: [Atlas, Delta, Echo]
104
107
 
105
108
  # Codex CLI agent profile options
106
109
  codex:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  category: reference
3
- name: playbook-authoring-markdown
3
+ name: authoring-markdown
4
4
  title: Markdown Formatting
5
5
  description: "Markdown formatting rules: headings, callouts, emphasis, lists, code blocks, tables, and common anti-patterns."
6
6
  label: Markdown
@@ -1,5 +1,5 @@
1
1
  ---
2
- name: playbook-authoring
2
+ name: authoring
3
3
  title: Playbook Authoring
4
4
  description: "How to write canonical SUMR Playbook docs: frontmatter schema, references, extraction markers, and authoring checklist. Use when creating or editing Markdown docs, technical docs, AI docs, agent skills, specs, runbooks, or Playbook sources."
5
5
  tags: [authoring, docs, markdown, ai-docs, technical-docs, specs, skills]