@cratis/pi 3.1.0 → 3.1.1

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.
@@ -115,7 +115,7 @@ When you receive a goal:
115
115
  - [ ] [security-reviewer] Security review of all changed files
116
116
 
117
117
  ### Phase 5 — Documentation (if applicable)
118
- - [ ] [write-documentation skill] Document <feature/concept>
118
+ - [ ] [documentation] Document <feature/concept> in its authored source with cratis-documentation-writing (or cratis-engineering-docs-authoring) and cratis-technical-examples for code, when the repository's profiles install them; otherwise follow the repository's own documentation rules
119
119
  ```
120
120
 
121
121
  ---
@@ -1,21 +1,30 @@
1
1
  ---
2
2
  agent: agent
3
- description: "Write documentation following the Diátaxis framework."
3
+ description: "Write reader-centered documentation using the Cratis documentation skills."
4
4
  ---
5
5
 
6
6
  # Write Documentation
7
7
 
8
- Write documentation for a feature, component, or concept. Invoke the **write-documentation** skill and follow `.cratis/ai/rules/documentation.md`.
8
+ Write documentation for a feature, component, or concept. Follow
9
+ `.cratis/ai/rules/documentation.md` and invoke **cratis-documentation-writing**.
10
+ For a Cratis product page, also use **cratis-engineering-docs-authoring**;
11
+ for samples or snippets, use **cratis-technical-examples**.
9
12
 
10
- ## Confirm first
13
+ ## Determine the reader's job
11
14
 
12
- - **Subject**, **audience**, and the **Diátaxis type** — exactly one:
13
- - **Tutorial** — guided lesson for newcomers
14
- - **How-to guide** — recipe for a specific task
15
- - **Reference** — exhaustive, terse technical description
16
- - **Explanation** — concepts, trade-offs, architecture (the *why*)
17
- - The source files to document.
15
+ From the request and neighboring authored pages, identify the reader, the
16
+ question they have, the outcome they need, and the page's primary purpose:
17
+ tutorial, how-to, explanation, or reference. Ask only when plausible choices
18
+ would materially change the result; don't require an outline approval before
19
+ ordinary drafting. Find the owning source before editing, never a synced copy.
18
20
 
19
- ## Workflow
21
+ ## Write and verify
20
22
 
21
- Clarify type/audience/scope → propose an outline → write. Active voice, present tense, second person; lead with *why*; complete and correct code examples; Mermaid diagrams for non-trivial concepts; descriptive link text; relative links that resolve. Update `toc.yml` and run the documentation verification before considering it done. The skill carries the per-page detail; don't duplicate it here.
23
+ Lead with the problem and payoff. Use active voice and show how the reader can
24
+ recognize success. A tutorial can briefly explain an observed result without
25
+ turning into a reference dump; link to deeper material. Verify framework APIs
26
+ against first-party source at the applicable version, check the sample at its
27
+ claimed scope, and run the owning repository's content and link gates. Add a
28
+ new page to the owning product's `toc.yml`
29
+ (a page missing from it silently drops out of the sidebar); otherwise update
30
+ navigation only when the page's placement or route changes.
@@ -24,7 +24,7 @@ sidebar:
24
24
  ```
25
25
 
26
26
  - Product pages should declare `title` and `description`. The title becomes the page H1; the description feeds metadata and AI-facing exports.
27
- - Preserve existing frontmatter when editing unless the task deliberately changes it. The converter preserves only `title`, `description`, `sidebar`, and `tableOfContents`; it drops DocFX keys and other Starlight keys. Features such as `template`, `hero`, `banner`, `head`, `prev`, `next`, `slug`, and `draft` work only on site-level pages authored directly in the Documentation repository.
27
+ - Preserve existing frontmatter when editing unless the task deliberately changes it. The converter preserves only `title`, `description`, `sidebar`, and `tableOfContents` from authored frontmatter; it drops DocFX keys and other Starlight keys. It generates `editUrl` separately from the owning product source path, so the page's edit action does not point to the synchronized copy. Features such as `template`, `hero`, `banner`, `head`, `prev`, `next`, `slug`, and `draft` work only on site-level pages authored directly in the Documentation repository.
28
28
  - Product navigation comes from `toc.yml`, not Starlight autogeneration. `sidebar.badge` works, but `sidebar.order`, `sidebar.label`, and `sidebar.hidden` do not control product navigation.
29
29
  - A frontmatter-less page falls back to its first H1, but that loses the description and relies on converter inference. Do not add new pages that way.
30
30
 
@@ -12,9 +12,9 @@ Every page should answer: “If I were a developer encountering this concept for
12
12
 
13
13
  The site is built with [Astro Starlight](https://starlight.astro.build/). Documentation lives in the `Documentation/` folder of each product repository as [GitHub Flavored Markdown](https://github.github.com/gfm/); a converter synchronizes product `.md`/`.mdx` into the Starlight site, and all repositories are aggregated into one published site. Readers experience it as a single place — write for that whole, not for one repository in isolation. For the authoritative rendering contract, see [Documentation Structure and Formatting](./documentation-structure-and-formatting.md).
14
14
 
15
- ## Every page is exactly one Diátaxis type
15
+ ## Give each page one primary reader purpose
16
16
 
17
- We organize documentation with the [Diátaxis framework](https://diataxis.fr/). Before writing, decide which of the four types a page is — and write *only* that type. Mixing types is the most common way docs fail: a tutorial padded with reference detail overwhelms the learner; a how-to interrupted by concept digressions stops being a quick recipe.
17
+ Use [Diátaxis](https://diataxis.fr/) as a compass: decide whether the reader is primarily learning, solving a task, looking up a contract, or understanding a concept. Brief context that helps someone complete a tutorial or how-to is welcome. Move an exhaustive lookup or a long conceptual detour to its own linked page; do not split a coherent reader task merely to keep categories pure.
18
18
 
19
19
  | Type | The reader is… | Reads like | Rule |
20
20
  |---|---|---|---|
@@ -31,9 +31,9 @@ For a reader-centered writing workflow, use the **cratis-documentation-writing**
31
31
 
32
32
  Most readers decide whether to adopt Cratis in the first ten minutes. Protect that path.
33
33
 
34
- - **One canonical getting-started per product**, not a menu of competing quickstarts. Host variants are how-to guides linked *from* the canonical path — never rival front doors.
34
+ - **One clear 'start here' entry per product**, not a menu of competing front doors. Let it direct readers to separate language or host procedures when those are genuinely different; do not force incompatible readers through one runnable recipe.
35
35
  - Drive to a **visible payoff fast** — something running the reader can see. State it up front: “By the end you'll have X running.”
36
- - **One threaded tutorial per product** builds a single realistic domain across chapters, each adding one concept. Open every chapter with what the reader will build or learn and close with a recap. The reader finishes with a working application, not a pile of snippets.
36
+ - **Thread tutorials when the product warrants a multi-chapter journey.** Use one realistic domain across chapters, each adding one concept and visible result. A small tool may need only a short guided lesson; don't create filler chapters to satisfy a template.
37
37
  - **One cross-product capstone tutorial** builds a real full-stack feature using the relevant Cratis products together. This is the connective tissue between products — keep it current and runnable.
38
38
 
39
39
  ## Connect the products
@@ -54,7 +54,7 @@ The project's voice is **direct, practical, and opinionated**. Write like an exp
54
54
  - **Do not document the obvious.** If the API is self-explanatory, a complete code example is enough.
55
55
  - Use headings, lists, tables, and code blocks — dense paragraphs lose readers.
56
56
  - **Be honest about trade-offs.** A “when this is the wrong fit” section builds more trust than omitting the limits.
57
- - Focus on public APIs and behavior — never internal implementation or third-party libraries.
57
+ - Focus on public APIs and behavior. Explain internals only where they clarify a supported boundary or failure mode; link to third-party documentation rather than retelling it.
58
58
 
59
59
  ## Diagrams
60
60
 
@@ -64,8 +64,8 @@ The project's voice is **direct, practical, and opinionated**. Write like an exp
64
64
 
65
65
  - Prefer `record` types for events, commands, and read models — match the codebase.
66
66
  - Use argument-free `[EventType]` for new events. A new generation or an explicit legacy identifier is valid only when documenting evolution of an existing stored-event contract.
67
- - Every example must be **complete and correct** — no pseudo-code, no `// ...` elisions that leave the reader guessing.
68
- - **Short illustrative snippets** may be purpose-built. **Longer or real samples must be embedded from compiled, tested source** when snippet tooling is available, so they cannot drift as APIs change. Never paste untested code, and never substitute a bare “see the repository” link for showing the code.
67
+ - A standalone example must be **complete and correct** at its stated scope. Mark a partial excerpt as an excerpt, state its prerequisites, and never leave an essential step behind `// ...`. Do not offer an incomplete block as click-to-copy code.
68
+ - **Short illustrative snippets** may be purpose-built after checking their framework APIs against source. Derive substantial or runnable examples from compiled, tested sample or spec code; extract or check displayed snippets with the owning repository's tooling so they do not drift. Never substitute a bare “see the repository” link for showing the code.
69
69
  - Where a feature spans products or languages, show both sides when both matter. Keep causal explanations sequential; use tabs only for alternatives.
70
70
 
71
71
  ## Links
@@ -73,15 +73,11 @@ The project's voice is **direct, practical, and opinionated**. Write like an exp
73
73
  - **Link text must describe the destination.** Write `[Event types](...)`, never `[see documentation](...)`, `[here](...)`, or `[click here](...)`. Non-descriptive link text is a defect.
74
74
  - Use relative links for internal product-source references. Verify every link resolves — broken links and links to non-existent folders fail review.
75
75
 
76
- ## What every product's docs must have
76
+ ## Cover the reader's needs at the product's scale
77
77
 
78
- - A front-door **index** with a one-sentence definition and a “start here” link.
79
- - A **“Why <product>”** explanation page covering the problem it solves and when *not* to use it.
80
- - A canonical **getting started** with a visible payoff.
81
- - A **threaded tutorial**.
82
- - A **concepts/glossary** page and an **architecture diagram**.
83
- - A **troubleshooting/FAQ** page.
84
- - An **`llms.txt`** and **`llms-full.txt`** output so AI assistants can ground answers in the docs.
78
+ - Every navigable product needs an **index** that defines it and points to a first useful outcome.
79
+ - Provide a **getting-started route**, exact reference, limitations, and recovery information where the product's complexity requires them. A small tool need not manufacture a multi-chapter tutorial, FAQ, glossary, or architecture diagram.
80
+ - Connect related products with links instead of duplicating the same explanation. Share task-area and product indexes through the site's AI-facing exports where useful; don't require a separate full-text download per product or claim that an export alone proves answer quality.
85
81
 
86
82
  ## File rules
87
83
 
@@ -16,7 +16,7 @@ The Cratis docs must **take the reader on a tour, like a teacher** — the way [
16
16
  - **Active voice, present tense, second person.** “You append the event,” not “the event is appended.”
17
17
  - **Be honest about limits.** A “when this is the wrong fit” section builds more trust than omitting the limits.
18
18
 
19
- ## One page equals one Diátaxis type
19
+ ## One primary purpose per page
20
20
 
21
21
  | Type | Reader is… | Reads like |
22
22
  |---|---|---|
@@ -25,7 +25,7 @@ The Cratis docs must **take the reader on a tour, like a teacher** — the way [
25
25
  | **Explanation** | trying to understand | a discussion — concepts, trade-offs, *why*, a diagram |
26
26
  | **Reference** | looking something up | a dictionary — exhaustive, terse, tables/signatures |
27
27
 
28
- Never mix types. A tutorial padded with reference detail overwhelms; a how-to interrupted by concept digressions stops being a recipe. Diátaxis type does not imply a universal navigation bucket; bucket names are product-specific.
28
+ Use the page's primary reader need to guide its structure, not to ban a brief prerequisite or explanation. A tutorial padded with a reference dump overwhelms; a how-to interrupted by a long conceptual detour stops being a recipe. Link out when the other material deserves sustained attention. Diátaxis does not imply a universal navigation bucket; bucket names are product-specific.
29
29
 
30
30
  ## The tour-voice checklist
31
31
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-documentation-writing
3
- description: Plan, write, and improve user-centered Cratis documentation with a clear reader journey and one Diátaxis purpose per page. Use for product docs, tutorials, how-to guides, reference, explanations, and documentation reviews. For executable examples use cratis-technical-examples; for release notes use cratis-release-notes. Do not invent APIs or publish content.
3
+ description: Plan, write, and improve user-centered Cratis documentation with a clear reader journey and one primary Diátaxis purpose per page. Use for product docs, tutorials, how-to guides, reference, explanations, and documentation reviews. For executable examples use cratis-technical-examples; for release notes use cratis-release-notes. Do not invent APIs or publish content.
4
4
  license: MIT
5
5
  ---
6
6
 
@@ -8,9 +8,10 @@ license: MIT
8
8
 
9
9
  A developer arrives with a job to do, not with an interest in our repository
10
10
  structure. Start from that job: what did they try, what stopped them, and what
11
- would let them know they succeeded? Use [Diátaxis](https://diataxis.fr/) to give
12
- each page one primary purpose. This skill governs content and reader journeys;
13
- the owning repository governs page placement, navigation, and rendering.
11
+ would let them know they succeeded? Use [Diátaxis](https://diataxis.fr/)
12
+ as a compass for each page's primary purpose, not a purity test. This skill
13
+ governs content and reader journeys; the owning repository governs page
14
+ placement, navigation, and rendering.
14
15
 
15
16
  ## Classify before writing
16
17
 
@@ -40,8 +41,9 @@ Rules per type:
40
41
  - **Explanation** — no steps. Discuss concepts, trade-offs, and design
41
42
  decisions. Diagrams are welcome here.
42
43
 
43
- If a reader needs both a lesson and a lookup, link two pages rather than
44
- mixing their jobs. Resolve routine audience or type choices from the request
44
+ A brief prerequisite or explanation may serve the main journey. If a reader
45
+ also needs an exhaustive lookup, link a reference page rather than burying it
46
+ in the lesson. Resolve routine audience or type choices from the request
45
47
  and neighboring pages; ask only when the alternatives change the outcome.
46
48
 
47
49
  ## Work from the reader outward
@@ -52,10 +54,11 @@ and neighboring pages; ask only when the alternatives change the outcome.
52
54
  2. Write the question they came with and the success signal in one sentence.
53
55
  Draft a title and first paragraph that make the problem and payoff clear;
54
56
  avoid opening with an abstract product definition or an internal type name.
55
- 3. Trace a short route from that page to one canonical getting-started journey,
56
- targeted recipes, and exact reference. Offer task- and background-based
57
- links without inventing competing quickstarts. A 'coming from X' bridge
58
- should map familiar concepts to the new workflow, not replace it.
57
+ 3. Trace a short route from that page to one clear 'start here' entry,
58
+ targeted recipes, and exact reference. Give different languages or hosts
59
+ their own procedures when a shared path cannot be run as written. A
60
+ 'coming from X' bridge should map familiar concepts to the new workflow,
61
+ not replace it.
59
62
  4. Draft in workflow order. For a tutorial, use one working domain throughout,
60
63
  show what to run and what appears, and recap before adding another concept.
61
64
  For a how-to, keep only what the specific task needs. Link out for details.
@@ -114,8 +117,9 @@ Never transcribe an API from memory, hand-translate an unsupported client, or
114
117
  claim a pasted block is runnable when it requires unstated setup. Show the
115
118
  command and observable output for a substantial walkthrough.
116
119
 
117
- Keep the page-specific edit link aimed at the *authored* file, not a synced
118
- copy. Recheck examples against the supported version when that version changes.
120
+ Edit the *authored* file, never a synced copy. The Cratis site derives each
121
+ product page's edit link from that source path, so don't hand-author
122
+ `editUrl` in product frontmatter. Recheck examples against the supported version when that version changes.
119
123
  A review of docs is not complete just because the site builds: syntax and
120
124
  behavior are different checks.
121
125
 
@@ -150,8 +154,8 @@ do not copy Wolverine's information architecture onto a different product.
150
154
 
151
155
  A page is done when:
152
156
 
153
- - The Diátaxis type is chosen deliberately and the page holds to that one
154
- type, linking out to the other types instead of drifting into them.
157
+ - The page has a deliberate primary purpose; short supporting context helps
158
+ the reader proceed, while substantial digressions link to their own pages.
155
159
  - The audience and their goal were identified before writing, and the first
156
160
  screen serves that goal. The first working path needs no unexplained setup
157
161
  or up-front choice among configuration alternatives.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: cratis-engineering-docs-authoring
3
- description: Draft accurate Cratis documentation content after the owning repository, page placement, document type, and authoritative product sources are known. Use for tutorials, how-to guides, explanations, and references; defer placement, existing-page discovery, and visual QA to their companion workflows.
3
+ description: Draft accurate Cratis product or engineering documentation once the reader's goal, owning source, and product evidence are known. Use for tutorials, how-to guides, explanations, and references; use the owning repository's navigation and visual QA workflows for placement and rendering.
4
4
  license: LICENSE
5
5
  ---
6
6
 
@@ -37,9 +37,9 @@ different document types, audiences, or product choices remain plausible.
37
37
  - The subject is not Cratis product or engineering documentation: do not apply
38
38
  this skill.
39
39
 
40
- ## Write one document type
40
+ ## Write to one primary reader need
41
41
 
42
- Do not mix Diátaxis types on one page:
42
+ Use Diátaxis to choose the page's main job. Include brief context needed to make the task work; link out instead of embedding a different page's full lesson or lookup:
43
43
 
44
44
  | Type | Reader need | Shape |
45
45
  | --- | --- | --- |
@@ -65,6 +65,21 @@ language tabs. Never hand-edit a generated proxy or a synchronized docs copy.
65
65
  6. Record the source revision and verification scope in the change summary,
66
66
  not as a permanent receipt embedded in the page.
67
67
 
68
+ ## Know what the owning gate actually checks
69
+
70
+ Look for a snippet validator before designing another checker. Arc and
71
+ Chronicle's .NET repositories use `Documentation/validate-client-snippets.py`
72
+ for supported **C#** fences in `Documentation/client-snippets/**`; Arc's
73
+ validator has a `--self-test` that plants a failing snippet. Other client
74
+ repositories own their own validators and toolchains. Check the validator's
75
+ reported count and exclusions: unsupported markers or legacy snippets are not
76
+ proved compilable just because the run passed. Run the owning validator for
77
+ every changed client snippet, or name a missing toolchain and rely on its
78
+ required CI gate. These checks **do not** compile ordinary Markdown/MDX fences
79
+ elsewhere in product documentation. For those, verify against real source and
80
+ a runnable sample/spec or an explicit snippet comparison; do not claim
81
+ coverage from a site build or a validator that never scans the page.
82
+
68
83
  A simple process beats a large unmaintained examples gallery: give the reader
69
84
  one small success first, then link to a fuller sample when they need it. Update
70
85
  examples alongside public API changes and incoming reports of copy/paste failure.
@@ -860,6 +860,7 @@
860
860
  {
861
861
  "id": "cratis/engineering/core",
862
862
  "availableTargets": [
863
+ "cratis-documentation-writing",
863
864
  "cratis-engineering-decision-record",
864
865
  "cratis-engineering-docs-authoring",
865
866
  "cratis-engineering-effect-boundaries",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cratis/pi",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Configuration-aware Cratis AI integration for Pi",
5
5
  "type": "module",
6
6
  "files": [