@cratis/pi 7.4.0 → 7.5.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.
- package/package/corpus/harnesses/pi/extensions/cratis-hooks/index.ts +19 -2
- package/package/corpus/hooks/README.md +59 -3
- package/package/corpus/hooks/scripts/cratis-check-pr.mjs +397 -0
- package/package/corpus/hooks/scripts/cratis-guard-pr-body.sh +41 -0
- package/package/corpus/hooks/scripts/cratis-release-notes-reviewed.cjs +867 -0
- package/package/corpus/hooks/settings.template.json +4 -0
- package/package/corpus/prompts/ship-changes.prompt.md +7 -2
- package/package/corpus/rules/documentation-structure-and-formatting.md +5 -1
- package/package/corpus/rules/documentation.md +1 -1
- package/package/corpus/rules/editing-cratis-docs.md +2 -1
- package/package/corpus/rules/pull-requests.md +15 -5
- package/package/corpus/skills/cratis-engineering-docs-authoring/references/site-format.md +4 -1
- package/package/corpus/skills/cratis-release-notes/SKILL.md +10 -7
- package/package/corpus/skills/cratis-release-notes/verification.json +4 -1
- package/package.json +1 -1
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
{
|
|
18
18
|
"type": "command",
|
|
19
19
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.cratis/ai/hooks/scripts/cratis-guard-store-mutations.sh"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "command",
|
|
23
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.cratis/ai/hooks/scripts/cratis-guard-pr-body.sh"
|
|
20
24
|
}
|
|
21
25
|
]
|
|
22
26
|
}
|
|
@@ -14,7 +14,7 @@ branch → commits → PR → merge → issue disposition → cleanup workflow.
|
|
|
14
14
|
## Inputs
|
|
15
15
|
|
|
16
16
|
- **What changed** — brief description of the work (used for branch name and PR title)
|
|
17
|
-
- **Label** — `no-release`, `patch`, `minor`, or `major`,
|
|
17
|
+
- **Label** — exactly one of `no-release`, `patch`, `minor`, or `major`, selected from the repository's release contract and applied in `gh pr create --label <intent>`
|
|
18
18
|
- **Related issue** — optional exact repository and issue number; if unknown, search read-only first. Comment on or close it only when the user's request includes that effect; otherwise prepare the disposition as a proposal. In repositories released by `cratis/release-action`, a delivered issue is closed by release-action through `(#n)` in the description, but release-action does not run for a `no-release` PR, so `(#n)` closes nothing there; elsewhere follow the repository's own release and issue-closing process.
|
|
19
19
|
|
|
20
20
|
Invoking this prompt is direct authority for the standard branch, commit, push, pull-request,
|
|
@@ -39,11 +39,16 @@ The description is published verbatim as the release notes, so it follows the co
|
|
|
39
39
|
[`pull-requests.md`](../rules/pull-requests.md#the-description-is-the-release-note).
|
|
40
40
|
|
|
41
41
|
- Before `gh pr create` or `gh pr edit`, write the body from `.github/pull_request_template.md` and
|
|
42
|
-
|
|
42
|
+
save it to `.ai-work/pr-body.md`, and run `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs --body-file .ai-work/pr-body.md --label <intent>`.
|
|
43
|
+
After a merge or rebase from main and before a body edit, reconcile every bullet with
|
|
44
|
+
`git diff --stat origin/main...HEAD`. The rules agents most often break:
|
|
43
45
|
- No development write-up: no Overview/Verification/Test plan headings (only a first `## Summary`
|
|
44
46
|
is allowed), no review, testing or provenance notes. Those go in a PR comment.
|
|
45
47
|
- `(#n)` ends the bullet that delivers an issue and `(part of #n)` marks anything that stays open;
|
|
46
48
|
never `Closes`/`Fixes`/`Refs` before a number, and never an issue reference inside an HTML comment,
|
|
47
49
|
which still closes the issue.
|
|
48
50
|
- Links are absolute `https://` URLs, never relative paths.
|
|
51
|
+
- Post reviewer notes (checks run, what was not verified, review provenance, stacking, merge or
|
|
52
|
+
deploy order) right after creating the PR with `gh pr comment <n> --body-file .ai-work/pr-notes.md`.
|
|
53
|
+
Never put them in the description, even for `no-release`.
|
|
49
54
|
- After pushing, if `verify-release-notes` fails, fix it by editing the description; it re-runs on edit.
|
|
@@ -99,7 +99,11 @@ In MDX, `<Aside type="tip" title="A specific title">…</Aside>` is available wh
|
|
|
99
99
|
- Use GFM tables with a separator row and a blank line before the table. `remarkGfm` in the Documentation site's Astro config is load-bearing for `.mdx`; raw pipe text in a rendered page indicates that integration is missing or degraded.
|
|
100
100
|
- Keep images beside the source page, use meaningful alt text, and rely on the site's click-to-zoom behavior.
|
|
101
101
|
- In product source, relative links to files keep their real `.md` or `.mdx` extension. The converter strips either extension for the public route. Directory URLs end in `/`.
|
|
102
|
-
- Site-level MDX uses clean root-relative routes such as `/arc/backend/commands/`. Cross-product links are also root-relative.
|
|
102
|
+
- Site-level MDX uses clean root-relative routes such as `/arc/backend/commands/`. Cross-product links are also root-relative: link from a CLI page to an Arc page as `[Browse your embedded event model](/arc/backend/csharp/embedded-event-model/)`. The route is the owning product's key plus the page's source path without its extension, slugified.
|
|
103
|
+
- Do not link another product's page through `https://cratis.io/...` or a GitHub `blob/` URL. Neither is checked by the site build: the first 404s until the next publish when the target is new, and the second sends a reader to raw source instead of the page.
|
|
104
|
+
- There are no symbol links. DocFX `[text](xref:UID)` and `<xref:UID>` are converted to plain text or inline code, never to a link, and `lint-docs.mjs` reports any `xref:` left in the synced output. Link to a page route; name an API type in inline code.
|
|
105
|
+
- A product's own link gate cannot resolve root-relative links to other products. It skips them by rule, not by product name - with linkinator, skip the local-server URLs outside `/Documentation/` (`^https?://(localhost|127\.0\.0\.1):[0-9]+/(?!Documentation/)`). A name such as `arc/` would also match a product's own `Documentation/arc/` folder and silently stop checking its internal links. The Documentation site's `check-links.mjs` verifies every rendered root-relative link against the built site.
|
|
106
|
+
- Content published outside the site - a repository README, a package readme, pull request descriptions and release notes - is not rewritten, so it uses absolute `https://` URLs.
|
|
103
107
|
- Link text describes the destination; `here`, `click here`, and `see documentation` are hard lint errors.
|
|
104
108
|
- Use `mermaid` for architecture, sequence, flow, and state diagrams. Use `eventmodeling` for EventModeling diagrams. Both are pre-rendered to responsive SVG at build time.
|
|
105
109
|
|
|
@@ -71,7 +71,7 @@ The project's voice is **direct, practical, and opinionated**. Write like an exp
|
|
|
71
71
|
## Links
|
|
72
72
|
|
|
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
|
-
- Use relative links for internal product-source references. Verify every link resolves — broken links and links to non-existent folders fail review.
|
|
74
|
+
- Use relative links for internal product-source references and root-relative site routes (`/arc/backend/commands/`) for another product's pages — not absolute `cratis.io` or GitHub URLs, and not `xref:` symbol links, which the site does not support. Verify every link resolves — broken links and links to non-existent folders fail review.
|
|
75
75
|
|
|
76
76
|
## Cover the reader's needs at the product's scale
|
|
77
77
|
|
|
@@ -60,7 +60,8 @@ Restart `npm run dev` after a build/check. The build re-sync can degrade a runni
|
|
|
60
60
|
|
|
61
61
|
- Product source links to files keep the real `.md` or `.mdx` extension. The converter removes either extension for the public route.
|
|
62
62
|
- Directory links end in `/`.
|
|
63
|
-
- Site-level MDX and cross-product links use clean root-relative public routes such as `/arc/backend/commands
|
|
63
|
+
- Site-level MDX and cross-product links use clean root-relative public routes such as `/arc/backend/commands/` - never `https://cratis.io/...` or a GitHub `blob/` URL, which the site build does not check. There are no symbol (`xref:`) links: the converter turns them into plain text.
|
|
64
|
+
- A product's local link gate skips root-relative links to other products by rule, not by product name; the full site check is what verifies them. See [Documentation Structure and Formatting](./documentation-structure-and-formatting.md#tables-images-links-and-diagrams).
|
|
64
65
|
- Slugification removes punctuation from path segments (`react.mvvm` becomes `reactmvvm`), so verify hand-authored site-absolute paths against the build.
|
|
65
66
|
|
|
66
67
|
## Content and rendering
|
|
@@ -6,7 +6,7 @@ applyTo: "**/*"
|
|
|
6
6
|
|
|
7
7
|
## The description is the release note
|
|
8
8
|
|
|
9
|
-
**The PR description is published verbatim as the GitHub release. In repositories released by `cratis/release-action`, it also closes every issue written as `(#n)`; elsewhere, follow the repository's own release and issue-closing process.** Write the note the person upgrading should read, not a development write-up. The same contract applies to release notes typed into a manual workflow run or written straight into a release. Where it is installed, the `verify-release-notes` check enforces it on
|
|
9
|
+
**The PR description is published verbatim as the GitHub release. In repositories released by `cratis/release-action`, it also closes every issue written as `(#n)`; elsewhere, follow the repository's own release and issue-closing process.** Write the note the person upgrading should read, not a development write-up. The same contract applies to release notes typed into a manual workflow run or written straight into a release. Where it is installed, the `verify-release-notes` check enforces it on release-bound PRs into the default branch carrying `major`/`minor`/`patch` (it re-runs when the label is added); it warns on `no-release` and unlabelled PRs, which must still be written this way because any of them may become releasable. `release-action` does not run for a `no-release` PR, so `(#n)` closes nothing there. Editing the description re-runs the check. HTML comments are not shown on the release page and the check ignores them for headings, keywords and placeholders, but a `(#n)` inside a comment still closes the issue (`release-action` skips only fenced and inline code) and the check fails it, so never put an issue reference in a comment. The template's own comment can stay: its `(#123)` examples are inline code.
|
|
10
10
|
|
|
11
11
|
### Allowed shape
|
|
12
12
|
|
|
@@ -36,11 +36,18 @@ applyTo: "**/*"
|
|
|
36
36
|
|
|
37
37
|
- **Headings** (any level, also written as HTML `<h2>`, `<b>`, `<i>` or a possibly multi-line `<summary>`, or as an `*italic*` line; a heading line is checked like any other, so a keyword, relative link or `(#n)` in one fails too) other than a first `## Summary`, such as Overview, Description, What, Why, How, Context, Changes, What changed, Test plan, Testing, Tests, Verification, Verified, Validation, Quality, Review, Notes, Notes for reviewers, Limitations, Known follow-up, Acceptance, Details, and any `#`/`##` heading not in the allowed list.
|
|
38
38
|
- **Review, verification, testing and provenance notes**: `Review:`, `Reviewed:`, a stand-alone `Reviewed by` line, `Verification:`, `Tested:`, `Testing:`, `Validation:` lines that stand alone or report a result (`Tests: 400 passed`, `Review: approved`); same-provider, cross-provider, Opus-only or Anthropic-only review remarks; the review workflow having passed, returned or run; CI or gate results (`CI green`, `all tests passed`); and a line stating which agent or model wrote the description (`Generated with Claude Code`, `Co-Authored-By:`). A bullet that describes a product change and only mentions review, validation, tests or an AI model (`- Validation: rules now apply to commands (#3)`, `- Reviewed by status is now shown on the dashboard (#4)`) is fine: inside a bullet, a summary or the lead paragraph the check reads a note only when it ends the clause (`- Cross-provider review pending`).
|
|
39
|
+
- **Verification and scope notes**: how or where something was checked (`verified by building …`, `verified in Storybook`, `tested locally`, `Storybook only`), what was not checked (`not yet verified`, `Not verified against a real kernel`), and results (`492/492`, `9 of 9 runs`, `Tier 1 PASS`, `0 warnings, 0 errors`, a `Local:`, `CI:`, `Checks:` or `Checked locally:` line).
|
|
40
|
+
- **Reviewer, merge and deploy instructions**: `Stacked on #207`, `retarget to main once #207 merges`, `This PR should be deployed separately`, `Draft:`, `do not merge`, merge or deploy order. If a consumer must upgrade in a set order, write that as an upgrade bullet ("Upgrade the Chronicle kernel to 19.25 before this client").
|
|
41
|
+
- **Provenance**: which branch, commit or build something was checked against (`verified against Arc.TypeScript main (v0.34.0)`). If compatibility matters to the reader, state it as a fact about the release: "Requires `@cratis/arc` 0.34 or later."
|
|
39
42
|
- **Internal state** that is not a consumer change (for example "npm publication remains disabled").
|
|
40
43
|
- **Relative links** (`](Documentation/x.md)`, `](./x)`, `](Source/...)`): they 404 on the release page. Use `https://github.com/Cratis/<Repo>/blob/main/<path>`, a `#anchor` or `mailto:`.
|
|
41
44
|
- **Placeholders and transcripts**: template text, empty sections, Copilot "Original prompt" blocks, agent transcripts.
|
|
42
45
|
|
|
43
|
-
Reviewer-facing information (test plan, verification, review provenance,
|
|
46
|
+
Reviewer-facing information (test plan, verification, what was not verified, review provenance, stacking, merge or deploy order) goes in a **PR comment** posted right after creating the PR: `gh pr comment <n> --body-file .ai-work/pr-notes.md`. Never put it in the description, even when the PR is labelled `no-release`.
|
|
47
|
+
|
|
48
|
+
### Keep the note true to the diff
|
|
49
|
+
|
|
50
|
+
After merging or rebasing the base branch, and before every body edit, run `git diff --stat origin/main...HEAD`. Delete each bullet whose change is now on main through another PR, or was dropped in conflict resolution. Check every version, package name and registry against the diff and the current `.github/workflows/publish*.yml`; never name a registry the publish workflow does not push to.
|
|
44
51
|
|
|
45
52
|
### Bad to good
|
|
46
53
|
|
|
@@ -74,9 +81,10 @@ Arc can now construct Chronicle reactors and reducers through its own dependency
|
|
|
74
81
|
|
|
75
82
|
### Before you create or edit a PR
|
|
76
83
|
|
|
77
|
-
1.
|
|
78
|
-
2.
|
|
79
|
-
3.
|
|
84
|
+
1. Run `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs --body-file <file> --label <intent>`. It runs the exact `verify-release-notes` rules plus the label and diff checks, and the Bash hook runs it on `gh pr create` and `gh pr edit`.
|
|
85
|
+
2. Read the body against the forbidden list and the issue table above; delete every hit and verify every issue number.
|
|
86
|
+
3. Sections in order, none empty, at most one summary form; every bullet user-facing.
|
|
87
|
+
4. Test plan, verification and review notes are in a PR comment.
|
|
80
88
|
|
|
81
89
|
If `verify-release-notes` fails, fix it by editing the description, not by pushing code.
|
|
82
90
|
|
|
@@ -94,6 +102,8 @@ Quick reminders:
|
|
|
94
102
|
|
|
95
103
|
Confirm the current repository workflow contract before selecting release intent because release-intent labels can trigger publication. A direct request to ship with a named label authorizes applying that label and completing the repository's standard pull-request workflow, including the release it normally triggers. Do not ask for separate authorization at each step. If the user did not request shipping or publication, a proposed semantic label describes impact but does not grant authority.
|
|
96
104
|
|
|
105
|
+
- Exactly one of `major`/`minor`/`patch`/`no-release`, set in the creating command (`gh pr create --label patch`), in every repository, including samples, docs and tooling repositories (`no-release` when nothing is shipped). To change intent, swap labels in one command: `gh pr edit <n> --remove-label minor --add-label patch`. Never add a second.
|
|
106
|
+
- Dependabot PRs carry only `no-release`. release-action never releases them, and the `major`/`minor`/`patch` Dependabot adds describe the dependency's version, not this product's.
|
|
97
107
|
- Label the PR according to semantic versioning impact:
|
|
98
108
|
- **major** — breaking changes to public APIs
|
|
99
109
|
- **minor** — new features, new slices, non-breaking additions
|
|
@@ -25,7 +25,10 @@ The owning repository remains authoritative when it defines a stricter format.
|
|
|
25
25
|
## Links and navigation
|
|
26
26
|
|
|
27
27
|
- Use descriptive link text, never "here" or "read more."
|
|
28
|
-
- Use root-relative links between products
|
|
28
|
+
- Use root-relative links between products (`/arc/backend/csharp/embedded-event-model/`), never
|
|
29
|
+
`https://cratis.io/...` or GitHub `blob/` URLs.
|
|
30
|
+
- Do not use DocFX `xref:` symbol links; the site turns them into plain text. Name an API type in
|
|
31
|
+
inline code and link to the page that documents it.
|
|
29
32
|
- Keep site-level links extensionless.
|
|
30
33
|
- Preserve the owning product repository's source-link convention.
|
|
31
34
|
- Do not edit generated synchronized pages; edit the owning source repository.
|
|
@@ -29,14 +29,16 @@ For each change, ask: who uses this path, what happened before, what happens
|
|
|
29
29
|
now, is action required, and how would they notice? Check changed defaults,
|
|
30
30
|
serialization/schema/data migrations, runtime and dependency compatibility,
|
|
31
31
|
deploy ordering, deprecations/removals, and upgrade/rollback limits. Report
|
|
32
|
-
|
|
32
|
+
what was not verified to the requester or in a PR comment; the published note
|
|
33
|
+
states only verified facts and never says 'not verified'.
|
|
33
34
|
|
|
34
35
|
Cratis products move together at their seams: the Chronicle kernel and its
|
|
35
36
|
clients, Arc and Chronicle, Components and Arc. When a change touches a
|
|
36
|
-
seam, state
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
seam, state supported pairings as facts the reader can act on ('Requires
|
|
38
|
+
Chronicle kernel 19.25 or later'). Which pairings were tested, and against
|
|
39
|
+
which branch or commit, is evidence for the PR comment. There is no central
|
|
40
|
+
compatibility matrix to defer to, so the release note may be the only place
|
|
41
|
+
a reader learns the supported pairings. Where a measurement drove the change,
|
|
40
42
|
such as how many deployments hit a failure, give the number; never estimate
|
|
41
43
|
one to add weight.
|
|
42
44
|
|
|
@@ -125,8 +127,9 @@ Only when asked to fix a release that violates the contract:
|
|
|
125
127
|
metadata, and explicit `**You do:**` actions.
|
|
126
128
|
Check `sync-upgrade-paths.mjs` and an existing guide before changing that
|
|
127
129
|
structure, then verify the generated picker as well as the page.
|
|
128
|
-
4. Name the checks actually run and the combinations not checked
|
|
129
|
-
|
|
130
|
+
4. Name the checks actually run and the combinations not checked to the
|
|
131
|
+
requester or in a PR comment, never in the published note. Do not imply
|
|
132
|
+
that a green docs build proved an upgrade safe.
|
|
130
133
|
|
|
131
134
|
The pattern is informed by [Wolverine's migration guide](https://wolverinefx.io/guide/migration.html)
|
|
132
135
|
and [Marten's migration guide](https://martendb.io/migration-guide.html),
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
{ "kind": "skill-contains", "value": "drafting never authorizes publishing" },
|
|
10
10
|
{ "kind": "skill-contains", "value": "`(part of #n)`" },
|
|
11
11
|
{ "kind": "skill-contains", "value": "gh release edit TAG --notes-file" },
|
|
12
|
-
{ "kind": "skill-contains", "value": "does not re-run release-action" }
|
|
12
|
+
{ "kind": "skill-contains", "value": "does not re-run release-action" },
|
|
13
|
+
{ "kind": "skill-contains", "value": "states only verified facts and never says 'not verified'" },
|
|
14
|
+
{ "kind": "skill-contains", "value": "state supported pairings as facts" },
|
|
15
|
+
{ "kind": "skill-contains", "value": "which branch or commit, is evidence for the PR comment" }
|
|
13
16
|
]
|
|
14
17
|
}
|