@cratis/pi 3.0.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.
Files changed (25) hide show
  1. package/package/corpus/agents/orchestrator.md +1 -1
  2. package/package/corpus/harnesses/pi/extensions/cratis-mcp/ConnectionFailure.ts +11 -0
  3. package/package/corpus/harnesses/pi/extensions/cratis-mcp/DiscoveredTool.ts +12 -0
  4. package/package/corpus/harnesses/pi/extensions/cratis-mcp/PendingRequest.ts +10 -0
  5. package/package/corpus/harnesses/pi/extensions/cratis-mcp/StdioConnection.ts +160 -0
  6. package/package/corpus/harnesses/pi/extensions/cratis-mcp/configuration.ts +102 -0
  7. package/package/corpus/harnesses/pi/extensions/cratis-mcp/index.ts +149 -0
  8. package/package/corpus/harnesses/pi/extensions/cratis-mcp/process.ts +24 -0
  9. package/package/corpus/harnesses/pi/extensions/cratis-mcp/protocol.ts +67 -0
  10. package/package/corpus/mcp-servers.json +14 -0
  11. package/package/corpus/prompts/write-documentation.prompt.md +20 -11
  12. package/package/corpus/rules/ai-distribution.md +20 -1
  13. package/package/corpus/rules/documentation-structure-and-formatting.md +1 -1
  14. package/package/corpus/rules/documentation.md +11 -15
  15. package/package/corpus/rules/profiles.md +8 -1
  16. package/package/corpus/rules/writing-cratis-docs.md +2 -2
  17. package/package/corpus/skills/cratis-documentation-writing/SKILL.md +18 -14
  18. package/package/corpus/skills/cratis-engineering-docs-authoring/SKILL.md +3 -3
  19. package/package/corpus/skills/cratis-screenplay-model-authoring/SKILL.md +122 -258
  20. package/package/corpus/skills/cratis-screenplay-model-authoring/references/language-reference.md +112 -0
  21. package/package/corpus/skills/cratis-screenplay-model-authoring/references/mcp-tools.md +72 -0
  22. package/package/corpus/skills/cratis-screenplay-model-authoring/verification.json +20 -0
  23. package/package/corpus/skills/cratis-technical-examples/SKILL.md +15 -0
  24. package/package/profile-catalog.json +1 -0
  25. package/package.json +2 -1
@@ -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
 
@@ -138,7 +138,14 @@ per surface so only the relevant one loads:
138
138
  | `cratis-screenplay-ui-composition` | `layout`, templates, `form`, `contribute`, `ui profile`, `theme`, `$strings`, `file` |
139
139
  | `cratis-screenplay-captures-and-reactions` | The Change Data Capture Language, `reaction`, `trigger` |
140
140
  | `cratis-screenplay-specifications` | Given/when/then and the reference execution |
141
- | `cratis-screenplay-model-authoring` | The compiler, the CLI, diagnostics, and the parsed-versus-admitted boundary |
141
+ | `cratis-screenplay-model-authoring` | Typed MCP authoring, model navigation/refactoring, compiler diagnostics, and source-versus-executable readiness |
142
+
143
+ The profile also selects the corpus-owned Screenplay MCP declaration from
144
+ `mcp-servers.json`. The Cratis CLI hosts the server as `cratis screenplay mcp`
145
+ and registers a scoped entry for supported clients without replacing their other
146
+ servers. Inspect install/status results for adapter support or configuration
147
+ conflicts. The conventional model root is `.cratis/screenplay/`; project-owned
148
+ configuration can choose another root.
142
149
 
143
150
  ## How to Use Profiles
144
151
 
@@ -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
  | --- | --- | --- |