@cratis/pi 7.119.1 → 7.121.0

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 (34) hide show
  1. package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +11 -1
  2. package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +14 -1
  3. package/package/corpus/harnesses/copilot/instructions/git-commits.instructions.md +9 -102
  4. package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +14 -1
  5. package/package/corpus/harnesses/copilot/instructions/pull-requests.instructions.md +18 -170
  6. package/package/corpus/harnesses/copilot/instructions/rtk.instructions.md +6 -41
  7. package/package/corpus/prompts/ship-changes.prompt.md +1 -1
  8. package/package/corpus/rules/code-quality.md +11 -1
  9. package/package/corpus/rules/framework.md +14 -1
  10. package/package/corpus/rules/general.md +11 -10
  11. package/package/corpus/rules/git-commits.md +9 -102
  12. package/package/corpus/rules/glossary.md +14 -1
  13. package/package/corpus/rules/issue-assignment.md +6 -26
  14. package/package/corpus/rules/pull-requests.md +18 -170
  15. package/package/corpus/rules/rtk.md +6 -41
  16. package/package/corpus/skills/cratis-commits-and-pull-requests/LICENSE +2 -0
  17. package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +48 -0
  18. package/package/corpus/skills/cratis-commits-and-pull-requests/references/commits.md +110 -0
  19. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +90 -0
  20. package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-labels-and-release.md +82 -0
  21. package/package/corpus/skills/cratis-commits-and-pull-requests/verification.json +11 -0
  22. package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +1 -1
  23. package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +17 -3
  24. package/package/corpus/skills/cratis-engineering-issue-hygiene/verification.json +11 -0
  25. package/package/corpus/skills/cratis-rtk/LICENSE +2 -0
  26. package/package/corpus/skills/cratis-rtk/SKILL.md +59 -0
  27. package/package/corpus/skills/cratis-rtk/verification.json +11 -0
  28. package/package/corpus/skills/cratis-screenplay-read-surface/SKILL.md +30 -0
  29. package/package/corpus/skills/cratis-screenplay-render-and-gap-fill/references/renderability-gate.md +1 -1
  30. package/package/corpus/skills/cratis-screenplay-slice-design/SKILL.md +1 -1
  31. package/package/corpus/skills/cratis-screenplay-toolchain/references/executable-subset.md +2 -2
  32. package/package/corpus/skills/cratis-stage-rendering-and-sandbox/references/admission.md +1 -1
  33. package/package/profile-catalog.json +90 -1
  34. package/package.json +1 -1
@@ -4,7 +4,9 @@ applyTo: "**/*"
4
4
 
5
5
  # How to Write Git Commits
6
6
 
7
- Commits are the permanent record of how the codebase evolved. Each commit should tell a clear story: *what* changed and *why*. A reviewer reading `git log --oneline` should understand the arc of the work without opening any diffs.
7
+ **Before writing any commit message, committing, pushing, or creating/editing a PR, read the `cratis-commits-and-pull-requests` skill.** It holds the commit format, grouping, staging and when-to-commit procedure. This rule keeps the history contract that must hold even before the skill is read.
8
+
9
+ Commits are the permanent record of how the codebase evolved. Each commit is a single logical unit of work: *what* changed and *why*, in an imperative subject of at most 72 characters, never WIP, never uncompilable. Stage specific files, never `git add .`.
8
10
 
9
11
  ## Never rewrite history
10
12
 
@@ -24,115 +26,20 @@ These commands are **forbidden** unless the human explicitly asks for that speci
24
26
  | `git gc --prune=now`, `git reflog expire` | destroys the recovery path for anything already stranded |
25
27
  | `git merge --squash`, `gh pr merge --squash`, `--rebase`, the **Squash and merge** / **Rebase and merge** buttons | collapses or replays the branch's commits into new ones; every original commit becomes unreachable and the branch's real history is destroyed at the moment of merge |
26
28
 
27
- **Merging is part of this rule, and it is the easiest place to get it wrong.** A squash merge feels
28
- like an integration step rather than a rewrite, which is exactly why it slips past: the branch is
29
- deleted straight afterwards, so the commits it collapsed have no ref left and `gc` eventually takes
30
- them. **Always merge with a true merge commit** — `git merge --no-ff`, or `gh pr merge --merge`.
31
- Never `--squash`, never `--rebase`, and never the equivalent buttons in the GitHub UI.
32
-
33
- If a repository's settings only allow squash or rebase merges, that is a **setting to raise with the
34
- owner, not a licence to squash.** Stop and ask.
29
+ **Merging is part of this rule, and it is the easiest place to get it wrong.** A squash merge feels like an integration step rather than a rewrite, which is exactly why it slips past: the branch is deleted straight afterwards, so the commits it collapsed have no ref left and `gc` eventually takes them. **Always merge with a true merge commit** — `git merge --no-ff`, or `gh pr merge --merge`. Never `--squash`, never `--rebase`, and never the equivalent buttons in the GitHub UI.
35
30
 
36
- **This is not stylistic.** A commit can exist as an object (`git cat-file -t <sha>` succeeds) while being absent from every branch *and* from the working tree — reachable only through `git reflog`, and only until `gc` runs. Work has already been lost in this repository exactly this way: a branch checkout carried another session's commit away, the branch was deleted, and the file changes silently reverted in the tree. It was recovered from the reflog by luck, because someone asked the right question in time.
31
+ If a repository's settings only allow squash or rebase merges, that is a **setting to raise with the owner, not a licence to squash.** Stop and ask.
37
32
 
38
33
  ### What to do instead
39
34
 
40
- - **Made a mistake in the last commit?** Add a new commit that corrects it. The wrong state stays in history, and that is fine — history is a record of what happened, not a curated story of what you wish had happened.
35
+ - **Made a mistake in the last commit?** Add a new commit that corrects it.
41
36
  - **Need to undo a commit?** `git revert <sha>` — it records the undo as a new commit and loses nothing.
42
- - **Messy commits before a PR?** Leave them. A reviewer reading a coherent series of small commits is better served than by one squashed blob, and the project does not require a linear history.
43
- - **Landing a PR?** `gh pr merge --merge` (a real merge commit). **Not `--squash`, not `--rebase`.** The commits on the branch are the record of how the change was actually built; squashing throws that away permanently in exchange for a tidier `main`, which is not a trade this project makes.
37
+ - **Messy commits before a PR?** Leave them; the project does not require a linear history.
38
+ - **Landing a PR?** `gh pr merge --merge` (a real merge commit). **Not `--squash`, not `--rebase`.**
44
39
  - **Need someone else's changes?** `git merge`, never `git rebase`.
45
40
  - **Need to move a commit to another branch?** `git cherry-pick` — it copies, leaving the original reachable.
46
41
  - **Working alongside another agent or session?** Use `git worktree add` so each has its own checkout and branch. Never two sessions committing in one working tree.
47
42
 
48
43
  ### Before you finish
49
44
 
50
- Verify your own commits are still reachable on the branch **and** that their content is still in the working tree — those are two different things. `git log --oneline -5` plus a `grep` for something the commit introduced. If a commit has gone missing, `git reflog` is the recovery tool: find the SHA, `git tag` it immediately so `gc` cannot take it, then `git cherry-pick` it back.
51
-
52
- ## Logical Grouping
53
-
54
- Every commit must be a **single logical unit of work**. Group related changes together; separate unrelated changes into distinct commits.
55
-
56
- ### What belongs in one commit
57
-
58
- - A bug fix and the spec that proves it.
59
- - A new file and the changes to existing files needed to integrate it (imports, registrations, wiring).
60
- - A refactor that moves or renames code — only the mechanical transformation, nothing else.
61
- - An interface change together with all implementation updates required to compile.
62
-
63
- ### What does NOT belong in one commit
64
-
65
- - A bug fix mixed with an unrelated feature.
66
- - Source code changes mixed with unrelated spec additions for a different area.
67
- - Formatting or style cleanups bundled with behavioral changes.
68
- - Multiple independent fixes or features squashed into a single commit.
69
-
70
- ### Deciding where to split
71
-
72
- Ask: "If I needed to revert this commit, would I lose exactly one coherent change?" If reverting would undo two unrelated things, it should be two commits.
73
-
74
- Common split points:
75
-
76
- 1. **Infrastructure / plumbing first** — interface additions, new types, or schema changes that later commits build on.
77
- 2. **Core logic second** — the behavioral change that uses the new infrastructure.
78
- 3. **Specs / tests third** — the specs that prove the behavioral change works. Specs may also be combined with the core logic commit when they are tightly coupled (e.g., a TDD red-green cycle or a bug fix with its regression test).
79
- 4. **Integration or wiring last** — connecting the new behavior to the rest of the system (DI registration, routing, UI hookup).
80
-
81
- When a task produces both source fixes and new integration specs, prefer separate commits for the source changes and the specs — unless the specs are inseparable from the fix (e.g., a single bug fix + its regression test).
82
-
83
- ## Commit Messages
84
-
85
- ### Format
86
-
87
- ```text
88
- <imperative summary of what this commit does>
89
-
90
- <optional body — why the change was made, context, trade-offs>
91
- ```
92
-
93
- - **Subject line**: imperative mood, present tense. Start with a verb: `Add`, `Fix`, `Remove`, `Rename`, `Extract`, `Update`, `Support`.
94
- - **No period** at the end of the subject line.
95
- - **72-character limit** on the subject line. If you cannot describe the change in 72 characters, the commit is probably too large — split it.
96
- - **Body**: separated from the subject by a blank line. Explain *why*, not *what* (the diff shows the what). Use bullet points for multi-part changes.
97
-
98
- ### Good examples
99
-
100
- ```text
101
- Fix duplicate key crash in IdentityStorage.Populate
102
-
103
- The upsert used InsertOne which threw on existing identities.
104
- Replace with ReplaceOne using upsert: true.
105
- ```
106
-
107
- ```text
108
- Add type-safe event migration API with expression-based builders
109
-
110
- Introduce EventTypeMigration<TUpgrade, TPrevious> base class with
111
- typed property builders for Split, Join, Rename, and DefaultValue
112
- operations. Migrators are discovered automatically by convention.
113
- ```
114
-
115
- ```text
116
- Add integration specs for observer replay on redaction
117
- ```
118
-
119
- ### Bad examples
120
-
121
- - `Fix stuff` — meaningless.
122
- - `WIP` — never commit work-in-progress; stage and commit when the unit is complete.
123
- - `Add files` — says nothing about what or why.
124
- - `Fix bug and add new feature and update docs` — three unrelated things.
125
- - `Changed Observer.Handling.cs` — describes a file, not a behavior.
126
-
127
- ## When to Commit
128
-
129
- - **After each logical unit passes the build** — `dotnet build` with zero errors and zero warnings, or `yarn compile` with zero errors.
130
- - **Before starting a different kind of work** — about to switch from fixing a bug to adding a feature? Commit the bug fix first.
131
- - **After completing specs for a change** — if the specs are a separate commit from the source change.
132
- - **Never commit code that does not compile.** Every commit must be a buildable, working state of the codebase.
133
-
134
- ## Staging Discipline
135
-
136
- - Use `git add <specific files>` rather than `git add .` or `git add -A`. Only stage files that belong to the current logical unit.
137
- - Review `git diff --cached` before committing to verify nothing unrelated was staged.
138
- - If you realize mid-commit that unrelated changes are mixed in, unstage them and commit only the related subset.
45
+ Verify your own commits are still reachable on the branch **and** that their content is still in the working tree: `git log --oneline -5` plus a `grep` for something the commit introduced. If a commit has gone missing, recover it from `git reflog`, `git tag` it immediately, then `git cherry-pick` it back.
@@ -1,5 +1,18 @@
1
1
  ---
2
- applyTo: "**/*"
2
+ applyTo: "**/*.cs,**/*.ts,**/*.tsx,**/*.go,**/*.kt,**/*.kts,**/*.java,**/*.ex,**/*.exs,**/*.play,**/Documentation/**/*.md,**/Documentation/**/*.mdx"
3
+ paths:
4
+ - "**/*.cs"
5
+ - "**/*.ts"
6
+ - "**/*.tsx"
7
+ - "**/*.go"
8
+ - "**/*.kt"
9
+ - "**/*.kts"
10
+ - "**/*.java"
11
+ - "**/*.ex"
12
+ - "**/*.exs"
13
+ - "**/*.play"
14
+ - "**/Documentation/**/*.md"
15
+ - "**/Documentation/**/*.mdx"
3
16
  ---
4
17
 
5
18
  # Cratis Glossary
@@ -4,29 +4,9 @@ profile: cratis/engineering
4
4
 
5
5
  # Claim the issue you start work on
6
6
 
7
- When an agent starts work on a GitHub issue, the issue says who is on it. Nobody can
8
- tell from an unassigned issue that work has begun, so two people (or two agents) pick it
9
- up, or it looks abandoned while it is being done.
10
-
11
- - **Applies when** the work is tied to an issue with a number in a known repository: the
12
- user named it (`#123`, `Cratis/Repo#123`, an issue URL), or the branch, task or handover
13
- names it. Work with no issue, or an issue whose repository you cannot determine, is
14
- outside this rule; never guess a number or a repository.
15
- - **Read the assignees first**, in the issue's own repository:
16
- `gh issue view <n> --repo <owner>/<repo> --json assignees,state`.
17
- - **Assign only when nobody is assigned.** Run
18
- `gh issue edit <n> --repo <owner>/<repo> --add-assignee @me` so the current `gh` user is
19
- the assignee. `@me` resolves to whoever is authenticated, so it is the user the agent
20
- works for, not a name you invent.
21
- - **Never replace or add to an existing assignment.** Someone already on the issue means
22
- it is claimed; leave it, and mention it if it affects the work.
23
- - **Do it once, at the start,** before the first edit. Do not re-check on every turn.
24
- - **Skip a closed issue** and say so; do not reopen or assign it.
25
- - **If assigning fails** (no permission, `gh` not authenticated, the issue is in a
26
- repository you cannot write to), say so in one line and continue with the work. A missing
27
- assignee is never a reason to stop.
28
-
29
- The user's request to work on the issue is the authority for this assignment; do not ask
30
- before doing it. It authorizes assigning the issue and nothing else: commenting, labeling
31
- or closing still follow [pull-requests.md](./pull-requests.md) and the user's request.
32
- - **After claiming,** keep the issue current per `cratis-engineering-issue-hygiene`.
7
+ Before editing issue-linked work, read **cratis-engineering-issue-hygiene**.
8
+ Claim once at start: read state and assignees, assign `@me` only if open and
9
+ unassigned. Never guess an issue/repository, replace an assignee or reopen a
10
+ closed issue. Report assignment failures and continue. The request to work on
11
+ the issue authorizes this claim only, not comments, labels or closure; follow
12
+ [pull-requests.md](./pull-requests.md) and the user's request for those.
@@ -4,184 +4,32 @@ applyTo: "**/*"
4
4
 
5
5
  # How to Do Pull Requests
6
6
 
7
- ## The description is the release note
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 `policy / verify` check enforces it on release-bound PRs into the default branch carrying `major`/`minor`/`patch` (it re-runs when the label is added); its release-note step 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, and `release-action` removes them before publishing, so a `(#n)` only inside a comment closes nothing; 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, and the comment is not published.
7
+ **Before writing any commit message, committing, pushing, or creating/editing a PR, read the `cratis-commits-and-pull-requests` skill.** It holds the allowed description shape, the forbidden list, worked examples, label procedure, grouping and release-action windows. This rule keeps the contract that must hold even before the skill is read. Commit rules are in [git-commits.md](./git-commits.md).
10
8
 
11
- **A change to a hook script or its wiring (`.cratis/ai/hooks/**`) needs a release-note line that tells consumers to run `cratis ai update`; a hook fix does not reach a repository until they do.**
9
+ ## The description is the release note
12
10
 
13
- ### Allowed shape
11
+ **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.
14
12
 
15
- - Follow the repository's pull request template (`.github/pull_request_template.md`) within this contract.
16
- - An optional summary, first, only when one cohesive theme spans the bullets: **either** a `## Summary` section (short, user-facing prose) **or** one unheaded lead paragraph (1–3 sentences), never both. `Summary` is a level-2 heading; `# Summary` is the wrong level. No bullets before the first section.
17
- - Then only these `##` sections, each at most once, in this order after any `## Summary`: `## Added`, `## Changed`, `## Fixed`, `## Removed`, `## Security`, `## Deprecated`. Keep only the sections that have bullets: a section holding only prose, a code example or `None.` fails the check, so delete it. `###` sub-headings inside a section are fine unless they use a forbidden name; inside a section even `### Added` is only a sub-heading, and a section itself is always level 2.
18
- - A `major`/`minor`/`patch` PR needs at least one bullet under an allowed section.
19
- - Bullets are short, self-contained and user-facing: what a consumer compiles against, runs or observes. A user-visible fix may add one sentence of root cause or regression guard, stated as observable behavior. Credit an external contributor by name or handle, unless they asked not to be named.
20
- - Breaking changes and upgrade actions are bullets in `## Changed` or `## Removed` that state the action. A longer migration story goes in the docs, linked by absolute URL.
21
- - Do not list internal plumbing (storage, converters, gRPC internals, specs, file lists, refactor narration).
13
+ - Follow the repository's pull request template within this contract: an optional summary first, then only `## Added`, `## Changed`, `## Fixed`, `## Removed`, `## Security`, `## Deprecated`, each with short, user-facing bullets and none empty.
14
+ - Never put review, verification, test or CI results, provenance, merge or deploy instructions, internal state, relative links or placeholders in the description. **Reviewer-facing information goes in a PR comment** posted right after creating the PR (`gh pr comment <n> --body-file .ai-work/pr-notes.md`), even when the PR is labelled `no-release`.
15
+ - A change to a hook script or its wiring (`.cratis/ai/hooks/**`) needs a release-note line that tells consumers to run `cratis ai update`; a hook fix does not reach a repository until they do.
22
16
 
23
17
  ### Issue references
24
18
 
25
- | Write | Meaning |
26
- | --- | --- |
27
- | `(#351)` at the **end of the bullet that delivers it** | Delivered: in a repository released by `cratis/release-action`, it closes it at release |
28
- | `(part of #351)` or prose `see #351` | Related, partial or follow-up: never closes |
29
- | `Cratis/Repo#351` | Other repository: never closed |
30
- | one `(#351)` per issue, never `(#351, #352)` | `(#351, #352)` closes nothing: write `(#351) (#352)` |
31
-
32
- - Nothing but more issue references (also `(part of #n)`, `(see #n)` and `(Cratis/Repo#n)`), closing emphasis, `<br>` and sentence punctuation (a `:` may introduce nested bullets) may follow the delivering `(#n)`. Write one `(#n)` per issue: release-action only matches `(#n)`, so `(#56, #57)` closes nothing; write `(#56) (#57)`.
33
- - Never use a linking or closing keyword before a number, anywhere: `Close`, `Closes`, `Closed`, `Fix`, `Fixes`, `Fixed`, `Resolve`, `Resolves`, `Resolved`, `Refs`, `Ref`, `References`, also as `Keyword: #n`, with `owner/repo#n`, followed by an issue URL, and wrapped in bold, italics or a link (`**Closes** #n`, `Closes [#n](url)`, `[Closes #n](url)`, and `[Closes](url)` where the link starts a clause). A `Refs #93` line closes nothing and is not a delivery marker: write `(#93)` at the end of the delivering bullet, or `(part of #93)` if it must stay open.
34
- - Comment on or close an issue when the user's request includes that effect; otherwise prepare a bounded post-merge disposition without performing it. In repositories released by `cratis/release-action`, a delivered `(#n)` is closed by release-action at release, so do not close it by hand; for a `no-release` PR release-action does not run, so any disposition follows this same rule. Elsewhere, follow the repository's own release and issue-closing process.
35
- - Use a bare `(#n)` only for an issue this PR fully delivers. No issue means no reference. Never use a placeholder such as `(#issue)` or the template's `(#123)`, and verify every number exists in the right repository; never guess.
36
-
37
- ### Forbidden anywhere outside code
38
-
39
- - **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.
40
- - **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`).
41
- - **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).
42
- - **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").
43
- - **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."
44
- - **Internal state** that is not a consumer change (for example "npm publication remains disabled").
45
- - **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:`.
46
- - **Placeholders and transcripts**: template text, empty sections, Copilot "Original prompt" blocks, agent transcripts.
47
-
48
- 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`.
49
-
50
- ### Keep the note true to the diff
51
-
52
- 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.
53
-
54
- ### Bad to good
55
-
56
- Bad (Cratis/Arc.TypeScript v0.48.0 as first published, bullets abridged):
57
-
58
- ```markdown
59
- Arc can now construct Chronicle reactors and reducers through its own dependency injection, one scope per delivered batch, as an opt-in preview. npm publication remains disabled.
60
-
61
- ## Added
62
-
63
- - Preview option `withChronicle({ ..., activateArtifactsInScopes: true })` ... (#93)
64
-
65
- See [Activate reactors and reducers in Arc scopes](Documentation/chronicle/reactors/scoped-activation.md).
66
-
67
- Review: Opus-only (same-provider) review.
68
-
69
- Refs #93
70
- ```
71
-
72
- Good (as corrected):
73
-
74
- ```markdown
75
- Arc can now construct Chronicle reactors and reducers through its own dependency injection, one scope per delivered batch, as an opt-in preview.
76
-
77
- ## Added
78
-
79
- - Preview option `withChronicle({ ..., activateArtifactsInScopes: true })` ... See [Activate reactors and reducers in Arc scopes](https://github.com/Cratis/Arc.TypeScript/blob/main/Documentation/chronicle/reactors/scoped-activation.md). (part of #93)
80
- ```
81
-
82
- "npm publication remains disabled" is internal status, the link was relative (it 404s on the release page), the review line is provenance for reviewers, and `Refs #93` is a keyword line. #93 was only partly delivered by this release, so its bullets say `(part of #93)`; `(#93)` would have closed it.
83
-
84
- ### Before you create or edit a PR
85
-
86
- 1. Run `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs --body-file <file> --label <intent>`. It runs the exact `policy / verify` release-note rules plus the label and diff checks, and the Bash hook runs it on `gh pr create` and `gh pr edit`.
87
- 2. Read the body against the forbidden list and the issue table above; delete every hit and verify every issue number.
88
- 3. Sections in order, none empty, at most one summary form; every bullet user-facing.
89
- 4. Test plan, verification and review notes are in a PR comment.
90
-
91
- If the release-note rules fail, fix the description, not the code.
92
-
93
- ## Commits
94
-
95
- See the full [Git Commits guide](./git-commits.md) for rules on logical grouping, message format, and staging discipline.
96
-
97
- Quick reminders:
98
-
99
- - Imperative mood: "Add author registration" not "Added author registration".
100
- - Each commit = one logical unit of work. No WIP commits in the final PR.
101
- - Never mix unrelated changes in a single commit.
19
+ - `(#n)` at the end of the bullet that delivers it closes the issue at release: use it **only** for an issue this PR fully delivers. One `(#n)` per issue: `(#351, #352)` closes nothing, write `(#351) (#352)`.
20
+ - `(part of #n)`, prose `see #n` or `Cratis/Repo#n` relate without closing. No issue means no reference; never use a placeholder or guess a number.
21
+ - Never use a linking or closing keyword before a number, anywhere (`Close`, `Closes`, `Fix`, `Fixes`, `Resolve`, `Resolves`, `Refs`, `References`, in any form). `Refs #n` closes nothing: write `(#n)` or `(part of #n)`.
22
+ - Comment on or close an issue only when the user's request includes that effect. A delivered `(#n)` in a repository released by `cratis/release-action` is closed at release; do not close it by hand.
102
23
 
103
24
  ## Labels
104
25
 
105
- 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.
106
-
107
- - 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: with more than one of them, release-action releases nothing and reports `reason=error`. Re-running a `pull_request` workflow replays the original label payload, so fix a label mistake by editing the PR or pushing; a `workflow_dispatch` run needs an explicit `version` and the PR description as `release-notes`, and without notes it closes no issues.
108
- - 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.
109
- - Label the PR according to semantic versioning impact:
110
- - **major** — breaking changes to public APIs
111
- - **minor** — new features, new slices, non-breaking additions
112
- - **patch** — bug fixes, refactoring with identical behavior
113
-
114
- ### A major release needs a human's explicit go-ahead
115
-
116
- A `major` label is the one release-intent label a ship request does not, by
117
- itself, authorize through to merge. Breaking a public API is the most
118
- consequential and hardest-to-reverse thing a release does — every downstream
119
- consumer eventually has to act on it — so it gets a checkpoint the other two
120
- intents do not.
121
-
122
- - Prepare the branch, commits, push, and PR carrying the `major` label exactly
123
- as any other ship request would.
124
- - Before merging, stop and ask a human to confirm the major bump specifically:
125
- name the exact breaking change(s), who is affected and how, and the
126
- resulting version number. A generic "ready to ship?" is not this checkpoint —
127
- say plainly that this release breaks compatibility and needs a yes.
128
- - A human merges a `major` PR, after answering that question with an explicit
129
- yes. An agent never merges it, even after the confirmation. A prior general
130
- instruction to "ship" or "land this" does not answer it, even when it named
131
- `major` as the intended label.
132
- - This checkpoint is per release, not per conversation — a human confirming
133
- one major release does not pre-authorize the next one.
134
-
135
- This narrows the general ship-changes authorization in
136
- [`ship-changes.prompt.md`](../prompts/ship-changes.prompt.md) for exactly this
137
- label; every other step of that workflow proceeds under its existing
138
- authority.
139
-
140
- ### A pull request that changes nothing outward-facing carries `no-release`
141
-
142
- **If nothing in the PR can change what a consumer compiles against, runs, or observes, propose repository-supported non-release intent, ordinarily `no-release`** — not `patch`. Confirm that the current workflow supports the label, requires exactly one release-intent label, and suppresses publication as intended before applying it with authorization.
143
-
144
- Where the repository requires release intent, `no-release` is a decision, not an omission. Missing required labels are blockers, not a reason to bypass the check.
145
-
146
- This covers, whenever the PR touches *only* these:
147
-
148
- - **Documentation** — anything under `Documentation/**`, READMEs, the `.cratis/ai/` corpus.
149
- - **CI and repository automation** — `.github/workflows/**`, `.github/scripts/**`, `.github/CODEOWNERS`, issue/PR templates.
150
- - **Tests and specs** — `*.Specs/**`, `when_*/**`, `for_*/**`, `Integration/**`, and test-only fixtures.
151
- - **Build and tooling configuration** that produces no shipped artifact difference — lint config, editor config, local scripts.
152
-
153
- The test is **outward-facing effect, not file location**. A change under `Source/**` that only touches specs is not shippable; a one-line change to a published package's behavior is, however small. If a consumer could not tell the difference by upgrading, there is nothing to version. When genuinely unsure, ask rather than defaulting to `patch` — an unnecessary release is not free: it burns a version number, ships release notes describing nothing, and buries the releases that matter.
154
-
155
- A non-release pull request must satisfy the relevant required checks like any other. Confirm label acceptance and publication suppression against the current workflow contract; do not assume external CI or API state.
156
-
157
- ### Release-action windows and workflow drift
158
-
159
- Batching is opt-in; success with `batched` or `nothing-pending` is not publication.
160
- Read **cratis-release-notes** before configuring windows, handling a pending-major
161
- hotfix, or recovering a workflow-drift 403. Major confirmation remains required;
162
- a workflow-drift recovery differs from the concurrent-tag retry above.
163
-
164
- ### Group small related changes into one pull request
165
-
166
- Do not open a pull request per task when the tasks belong to the same body of work. Several small merged PRs become several releases, and a stream of near-empty patch releases makes the release history useless for the people it is written for. Collect related work — a set of CI gates, a group of fixes in one area, the steps of one refactor — onto **one branch, as separate commits**, and open **one** pull request. Commits stay one-logical-unit-each; the pull request is the release boundary, and the release boundary should be a coherent, describable change. Joining an open candidate, folding superseded PRs and the cut are in `cratis-engineering-release-trains`.
167
-
168
- **Before consolidating open PRs, review each PR’s release intent and workflow effects.** Integration may trigger completion/publication behavior on an absorbed PR. Use supported non-release intent where appropriate. A direct request to consolidate the named pull requests authorizes the necessary relabeling and merge; it does not authorize unrelated notifications.
169
-
170
- Before a consolidation or a re-land of reverted work merges, prove it dropped nothing with `cratis-engineering-consolidation-guard`.
171
-
172
- Split into separate pull requests when the changes are genuinely unrelated, when one is urgent and the others are not, or when one is risky enough to want its own revert.
173
-
174
- ## Quality Gates
175
-
176
- Documentation-only changes use repository-supported non-release intent, ordinarily `no-release`; confirm the workflow contract rather than assuming a label or API state. Run relevant content, link, frontmatter, and corpus checks instead of unrelated application builds, and satisfy every repository-required check, including release-intent checks where supported. Documentation is never a blanket exemption from red CI.
177
-
178
- **`no-release` does not otherwise excuse a PR from this section.** A CI, tooling, or spec-only pull request ships nothing, but it is exactly the kind of change that can break the build or the pipeline for everyone else — a broken workflow or a deleted spec does its damage without ever being released. Hold it to every gate below.
26
+ - **Exactly one** of `major`/`minor`/`patch`/`no-release`, set in the creating command (`gh pr create --label patch`), in every repository. Never add a second: release-action then releases nothing. Swap in one command with `gh pr edit --remove-label … --add-label …`. Dependabot PRs carry only `no-release`.
27
+ - Confirm the repository workflow before choosing, because the label can trigger publication. A direct request to ship with a named label authorizes applying it and the standard workflow; without a ship request a proposed label describes impact but grants no authority.
28
+ - **A major release needs a human's explicit go-ahead, and a human merges it.** Prepare the branch and PR with `major`, then stop and ask a human to confirm the major bump: name the breaking changes, who is affected and the resulting version. A general "ship" instruction does not answer it. An agent never merges a `major` PR, even after confirmation; the checkpoint is per release.
29
+ - **If nothing in the PR can change what a consumer compiles against, runs or observes, use `no-release`**, not `patch`: documentation, CI and automation, tests and specs, tooling configuration. The test is outward-facing effect, not file location. When unsure, ask rather than defaulting to `patch`.
179
30
 
180
- Before marking code/automation work ready, select the affected-project gates that apply from the following list; run wider checks for cross-cutting changes and repository-required merge/release gates:
31
+ ## Before you create or edit a PR
181
32
 
182
- - `dotnet build` — zero errors, zero warnings
183
- - `dotnet test` — all specs pass
184
- - `yarn lint` — zero errors
185
- - `npx tsc -b` — zero TypeScript errors
186
- - Code follows all project coding standards and conventions
187
- - **Required CI checks pass.** After an authorized push, inspect checks and failure logs. Diagnose within a bounded attempt, fix in-scope causes, and re-run relevant gates after each fix. Report unrelated/environmental failures and missing authority as blockers rather than retrying indefinitely or silently waiving required checks. Waiting, cancelling and tiered local gates are in `cratis-engineering-ci-gates`. If a release job fails after a concurrent merge (the release for the tag exists for another commit), re-run it: it releases under the next version (release-action v1.4.2 fails the job rather than reporting success).
33
+ - Run `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs --body-file <file> --label <intent>`; it applies the exact `policy / verify` release-note rules and the Bash hook runs it on `gh pr create` and `gh pr edit`. If it fails, fix the description, not the code. Before every body edit, run `git diff --stat origin/main...HEAD` and delete bullets the diff no longer supports.
34
+ - Run the affected-project gates before marking work ready (`dotnet build`/`dotnet test` with zero warnings, `yarn lint`, `npx tsc -b`), and the repository's required CI checks after an authorized push. `no-release` and documentation-only PRs still satisfy every required check; none is a blanket exemption from red CI.
35
+ - Group small related changes into one branch and one PR; see the skill for consolidation and the release-action windows.
@@ -1,47 +1,12 @@
1
1
  ---
2
2
  applyTo: "**/*"
3
- description: "Use when running any shell command, reading files, or searching code. Route commands through rtk for human-readable output (a hook auto-rewrites Bash commands; prefix rtk yourself where it does not); use raw output when the result is parsed, compared exactly, or drives another operation."
3
+ description: "Choose command wrappers without losing exact output or exit codes."
4
4
  ---
5
5
 
6
6
  # Using rtk (Token-Optimized Commands)
7
7
 
8
- [rtk](https://github.com/rtk-ai/rtk) (Rust Token Killer) is a CLI proxy that filters and compresses command output *before it reaches the model* — typically **60–90% fewer tokens** on common dev commands, with no loss of the signal you actually need. The default in this corpus is to **run every command rtk supports through rtk**. The savings are real and compound across a session: build, test, lint, git, search, and file-read output are exactly the high-volume, low-signal outputs rtk trims.
9
-
10
- ## How it works — let the hook do its job
11
-
12
- A `PreToolUse` hook **auto-rewrites Bash commands** to their `rtk` equivalent transparently and at zero token overhead (`git status` → `rtk git status`). For any supported command you do **nothing special** — run it normally and the hook wraps it. Where no hook is configured, prefix the command yourself — including each command in an `&&` chain: `rtk git add . && rtk git commit -m "msg"`.
13
-
14
- - **Audit coverage** with `rtk gain` (savings so far) and `rtk discover` (commands that slipped past rtk — missed opportunities to close).
15
-
16
- ## When to use raw output instead
17
-
18
- rtk output is a summary for a reader. It is never evidence of exact file contents, paths, Git state, or command semantics, and a filter can drop the line you needed. Use the raw command — `rtk proxy <cmd>`, or the plain command where nothing rewrites it — whenever:
19
-
20
- - the output is parsed by a script, compared exactly, or fed to another command;
21
- - the output is the evidence for a claim about content, paths, or Git state;
22
- - the command's exit code or exact diagnostics decide what happens next (security checks, structured JSON, machine-readable diagnostics);
23
- - a wrapped command failed. Read the actual error and retry through `rtk proxy` before concluding the tool, path, or repository is missing.
24
-
25
- Do not add `rtk` to scripts, hooks, or CI steps that deliberately use native commands; their raw output is the point. Exit codes are never traded for token savings — see [`exit-codes-and-wrappers.md`](./exit-codes-and-wrappers.md).
26
-
27
- ## What rtk supports (route these through rtk)
28
-
29
- - **Files** — `ls`, `tree`, `read`, `find`, `grep`, `diff`
30
- - **Git & GitHub** — `git status/log/diff/add/commit/push/pull`, `gh pr/issue/run …`
31
- - **Tests** — `dotnet test`, Jest, Vitest, Playwright, pytest, Go, Cargo, RSpec
32
- - **Build & lint** — `dotnet build`, `tsc`, ESLint, Biome, Prettier, Cargo Clippy, Ruff, golangci-lint, Rubocop
33
- - **Package managers** — pnpm/npm/yarn, pip, Bundler, Prisma
34
- - **Cloud & containers** — AWS CLI, Docker, Kubernetes, OpenShift
35
-
36
- In practice this means the Cratis **quality-gate commands** — `dotnet build`, `dotnet test`, `yarn lint`, `npx tsc -b`, `git`, `gh` — all flow through rtk automatically. Just run them.
37
-
38
- ## The one gap — built-in tools bypass the hook
39
-
40
- The hook only sees **Bash** commands. Claude Code's built-in `Read`, `Grep`, and `Glob` tools (and the Copilot equivalents) do **not** pass through it, so they are **not** auto-rewritten — and those are some of the most token-heavy operations in a session.
41
-
42
- - For **bulk reads and broad searches** where output volume is large, call **`rtk read` / `rtk grep` / `rtk find`** from the terminal so the savings are captured. This is a deliberate override of the usual "prefer the built-in file tools" default.
43
- - Keep the **built-in** `Read`/`Grep`/`Glob` for **small, targeted reads** and when you need exact line references for an edit — rtk filters output, so it serves exploration and volume, not the precise content an `Edit` must match verbatim.
44
-
45
- ## Availability
46
-
47
- This assumes the `rtk` binary is installed and the hook configured (`rtk init -g`). If `rtk` is **not** on `PATH`, ignore this rule and use the normal tools — never block work on rtk being present.
8
+ Read **cratis-rtk** before choosing wrappers. The Bash hook rewrites supported
9
+ commands; built-in tools bypass it. Exact output and real exit codes win:
10
+ use `rtk proxy <cmd>` for parsed output, diagnostics and evidence driving an
11
+ operation, including wrapped failures. Never use summaries as gate evidence.
12
+ If rtk is absent, use normal tools. Keep scripts, hooks and CI native.
@@ -0,0 +1,2 @@
1
+ Copyright (c) Cratis. All rights reserved.
2
+ Licensed under the MIT license. See LICENSE file in the project root for full license information.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: cratis-commits-and-pull-requests
3
+ description: Prepare coherent commits and release-note pull requests with the right release-intent label. Use when writing a commit message, staging commits, pushing, creating or editing a PR description, choosing major/minor/patch/no-release, or checking issue references in release notes. Not for assembling release candidates (use cratis-engineering-release-trains), issue status updates (use cratis-engineering-issue-hygiene), or batching release windows (use cratis-release-notes).
4
+ license: LICENSE
5
+ compatibility: Requires git and the GitHub CLI (gh).
6
+ ---
7
+
8
+ <!-- Copyright (c) Cratis. All rights reserved. -->
9
+ <!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
10
+
11
+ # Commits and pull requests
12
+
13
+ Read [git-commits.md](../../rules/git-commits.md) and
14
+ [pull-requests.md](../../rules/pull-requests.md) before acting. Their always-on
15
+ contracts govern history, release notes, labels, authority and required gates.
16
+ Loading this skill grants no permission to push, publish, merge or mutate issues.
17
+
18
+ 1. Inspect the diff and the repository's workflow before choosing the logical
19
+ commit boundaries and release intent. Read [references/commits.md](references/commits.md)
20
+ when staging, writing a message or deciding when to commit. Stage specific
21
+ files and inspect `git diff --cached`; never commit an unbuildable unit.
22
+ 2. Read [references/pr-description.md](references/pr-description.md) when writing
23
+ or editing a PR or manual release note. Write consumer-facing bullets, not a
24
+ work report. Only fully delivered issues get a closing delivery reference.
25
+ 3. Read [references/pr-labels-and-release.md](references/pr-labels-and-release.md)
26
+ when choosing or swapping a label, grouping related work, checking gates or
27
+ handling a release-action window. Confirm publication effects before applying
28
+ the single label. A human confirms and merges a major release.
29
+ 4. Run affected-project gates, then the repository-required checks. Before each
30
+ body edit, compare `git diff --stat origin/main...HEAD` and remove unsupported
31
+ bullets. Validate the description with
32
+ `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs --body-file <file> --label <intent>`.
33
+ A zero exit status is the pass signal; fix the description on failure.
34
+ 5. Create or edit only when authorized. Put verification, review and deployment
35
+ notes in a PR comment, not the published release note. Confirm the applied
36
+ label and body after writing. Never replace history for a tidier PR.
37
+
38
+ Minimal description for a delivered consumer fix without an issue reference:
39
+
40
+ ```markdown
41
+ ## Fixed
42
+
43
+ - Preserve command validation messages when a request is retried.
44
+ ```
45
+
46
+ If the diff only changes non-outward documentation or tooling, choose
47
+ `no-release` rather than manufacturing a patch release. If the workflow or
48
+ impact is unclear, ask about that specific choice rather than guessing.