@cratis/pi 7.120.0 → 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.
- package/package/corpus/harnesses/copilot/instructions/code-quality.instructions.md +11 -1
- package/package/corpus/harnesses/copilot/instructions/framework.instructions.md +14 -1
- package/package/corpus/harnesses/copilot/instructions/git-commits.instructions.md +9 -102
- package/package/corpus/harnesses/copilot/instructions/glossary.instructions.md +14 -1
- package/package/corpus/harnesses/copilot/instructions/pull-requests.instructions.md +18 -170
- package/package/corpus/harnesses/copilot/instructions/rtk.instructions.md +6 -41
- package/package/corpus/prompts/ship-changes.prompt.md +1 -1
- package/package/corpus/rules/code-quality.md +11 -1
- package/package/corpus/rules/framework.md +14 -1
- package/package/corpus/rules/general.md +11 -10
- package/package/corpus/rules/git-commits.md +9 -102
- package/package/corpus/rules/glossary.md +14 -1
- package/package/corpus/rules/issue-assignment.md +6 -26
- package/package/corpus/rules/pull-requests.md +18 -170
- package/package/corpus/rules/rtk.md +6 -41
- package/package/corpus/skills/cratis-commits-and-pull-requests/LICENSE +2 -0
- package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +48 -0
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/commits.md +110 -0
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +90 -0
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-labels-and-release.md +82 -0
- package/package/corpus/skills/cratis-commits-and-pull-requests/verification.json +11 -0
- package/package/corpus/skills/cratis-engineering-ci-gates/SKILL.md +1 -1
- package/package/corpus/skills/cratis-engineering-issue-hygiene/SKILL.md +17 -3
- package/package/corpus/skills/cratis-engineering-issue-hygiene/verification.json +11 -0
- package/package/corpus/skills/cratis-rtk/LICENSE +2 -0
- package/package/corpus/skills/cratis-rtk/SKILL.md +59 -0
- package/package/corpus/skills/cratis-rtk/verification.json +11 -0
- package/package/profile-catalog.json +90 -1
- package/package.json +1 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
2
|
+
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
3
|
+
|
|
4
|
+
# How to write commits
|
|
5
|
+
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Why history is never rewritten
|
|
9
|
+
- Logical grouping
|
|
10
|
+
- Commit messages
|
|
11
|
+
- When to commit
|
|
12
|
+
- Staging discipline
|
|
13
|
+
|
|
14
|
+
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.
|
|
15
|
+
|
|
16
|
+
The history rules (append-only history, the forbidden commands, merge commits only) stay always-on in [git-commits.md](../../../rules/git-commits.md). This reference holds the procedure.
|
|
17
|
+
|
|
18
|
+
## Why history is never rewritten
|
|
19
|
+
|
|
20
|
+
**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 can be lost exactly this way: a branch checkout carries another session's commit away, the branch is deleted, and the file changes silently revert in the tree. Recovery from the reflog is luck, not process.
|
|
21
|
+
|
|
22
|
+
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.
|
|
23
|
+
|
|
24
|
+
## Logical grouping
|
|
25
|
+
|
|
26
|
+
Every commit must be a **single logical unit of work**. Group related changes together; separate unrelated changes into distinct commits.
|
|
27
|
+
|
|
28
|
+
### What belongs in one commit
|
|
29
|
+
|
|
30
|
+
- A bug fix and the spec that proves it.
|
|
31
|
+
- A new file and the changes to existing files needed to integrate it (imports, registrations, wiring).
|
|
32
|
+
- A refactor that moves or renames code: only the mechanical transformation, nothing else.
|
|
33
|
+
- An interface change together with all implementation updates required to compile.
|
|
34
|
+
|
|
35
|
+
### What does NOT belong in one commit
|
|
36
|
+
|
|
37
|
+
- A bug fix mixed with an unrelated feature.
|
|
38
|
+
- Source code changes mixed with unrelated spec additions for a different area.
|
|
39
|
+
- Formatting or style cleanups bundled with behavioral changes.
|
|
40
|
+
- Multiple independent fixes or features squashed into a single commit.
|
|
41
|
+
|
|
42
|
+
### Deciding where to split
|
|
43
|
+
|
|
44
|
+
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.
|
|
45
|
+
|
|
46
|
+
Common split points:
|
|
47
|
+
|
|
48
|
+
1. **Infrastructure / plumbing first**: interface additions, new types, or schema changes that later commits build on.
|
|
49
|
+
2. **Core logic second**: the behavioral change that uses the new infrastructure.
|
|
50
|
+
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 (for example a TDD red-green cycle or a bug fix with its regression test).
|
|
51
|
+
4. **Integration or wiring last**: connecting the new behavior to the rest of the system (DI registration, routing, UI hookup).
|
|
52
|
+
|
|
53
|
+
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 (for example a single bug fix plus its regression test).
|
|
54
|
+
|
|
55
|
+
## Commit messages
|
|
56
|
+
|
|
57
|
+
### Format
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
<imperative summary of what this commit does>
|
|
61
|
+
|
|
62
|
+
<optional body: why the change was made, context, trade-offs>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
- **Subject line**: imperative mood, present tense. Start with a verb: `Add`, `Fix`, `Remove`, `Rename`, `Extract`, `Update`, `Support`.
|
|
66
|
+
- **No period** at the end of the subject line.
|
|
67
|
+
- **72-character limit** on the subject line. If you cannot describe the change in 72 characters, the commit is probably too large: split it.
|
|
68
|
+
- **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.
|
|
69
|
+
|
|
70
|
+
### Good examples
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
Fix duplicate key crash in IdentityStorage.Populate
|
|
74
|
+
|
|
75
|
+
The upsert used InsertOne which threw on existing identities.
|
|
76
|
+
Replace with ReplaceOne using upsert: true.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
Add type-safe event migration API with expression-based builders
|
|
81
|
+
|
|
82
|
+
Introduce EventTypeMigration<TUpgrade, TPrevious> base class with
|
|
83
|
+
typed property builders for Split, Join, Rename, and DefaultValue
|
|
84
|
+
operations. Migrators are discovered automatically by convention.
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
Add integration specs for observer replay on redaction
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Bad examples
|
|
92
|
+
|
|
93
|
+
- `Fix stuff`: meaningless.
|
|
94
|
+
- `WIP`: never commit work-in-progress; stage and commit when the unit is complete.
|
|
95
|
+
- `Add files`: says nothing about what or why.
|
|
96
|
+
- `Fix bug and add new feature and update docs`: three unrelated things.
|
|
97
|
+
- `Changed Observer.Handling.cs`: describes a file, not a behavior.
|
|
98
|
+
|
|
99
|
+
## When to commit
|
|
100
|
+
|
|
101
|
+
- **After each logical unit passes the build**: `dotnet build` with zero errors and zero warnings, or `yarn compile` with zero errors.
|
|
102
|
+
- **Before starting a different kind of work**: about to switch from fixing a bug to adding a feature? Commit the bug fix first.
|
|
103
|
+
- **After completing specs for a change**: if the specs are a separate commit from the source change.
|
|
104
|
+
- **Never commit code that does not compile.** Every commit must be a buildable, working state of the codebase.
|
|
105
|
+
|
|
106
|
+
## Staging discipline
|
|
107
|
+
|
|
108
|
+
- Use `git add <specific files>` rather than `git add .` or `git add -A`. Only stage files that belong to the current logical unit.
|
|
109
|
+
- Review `git diff --cached` before committing to verify nothing unrelated was staged.
|
|
110
|
+
- If you realize mid-commit that unrelated changes are mixed in, unstage them and commit only the related subset.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
2
|
+
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
3
|
+
|
|
4
|
+
# The pull request description
|
|
5
|
+
|
|
6
|
+
The contract (the description is the release note, the issue-reference rules, the reviewer-note rule) stays always-on in [pull-requests.md](../../../rules/pull-requests.md). This reference holds the detailed shape, the forbidden list and a worked example.
|
|
7
|
+
|
|
8
|
+
**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 example issue references are inline code, and the comment is not published.
|
|
9
|
+
|
|
10
|
+
**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.**
|
|
11
|
+
|
|
12
|
+
## Allowed shape
|
|
13
|
+
|
|
14
|
+
- Follow the repository's pull request template (`.github/pull_request_template.md`) within this contract.
|
|
15
|
+
- 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.
|
|
16
|
+
- 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.
|
|
17
|
+
- A `major`/`minor`/`patch` PR needs at least one bullet under an allowed section.
|
|
18
|
+
- 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.
|
|
19
|
+
- 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.
|
|
20
|
+
- Do not list internal plumbing (storage, converters, gRPC internals, specs, file lists, refactor narration).
|
|
21
|
+
|
|
22
|
+
## Issue references
|
|
23
|
+
|
|
24
|
+
| Write | Meaning |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| `(#n)` at the **end of the bullet that delivers it** | Delivered: in a repository released by `cratis/release-action`, it closes it at release |
|
|
27
|
+
| `(part of #n)` or prose `see #n` | Same issue, related, partial or follow-up: never closes |
|
|
28
|
+
| `Cratis/Repo#n` | Other repository: never closed |
|
|
29
|
+
| one `(#n)` per issue, never `(#n, #m)` | For distinct issues, `(#n, #m)` closes nothing: write `(#n) (#m)` |
|
|
30
|
+
|
|
31
|
+
- 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 `(#n, #m)` closes nothing; write `(#n) (#m)`.
|
|
32
|
+
- 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 #n` line closes nothing and is not a delivery marker: write `(#n)` at the end of the delivering bullet, or `(part of #n)` if it must stay open.
|
|
33
|
+
- 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.
|
|
34
|
+
- 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 example issue number, and verify every number exists in the right repository; never guess.
|
|
35
|
+
|
|
36
|
+
## Forbidden anywhere outside code
|
|
37
|
+
|
|
38
|
+
- **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.
|
|
39
|
+
- **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 (#n)`, `- Reviewed by status is now shown on the dashboard (#m)`) 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`).
|
|
40
|
+
- **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).
|
|
41
|
+
- **Reviewer, merge and deploy instructions**: `Stacked on #n`, `retarget to main once #n 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").
|
|
42
|
+
- **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."
|
|
43
|
+
- **Internal state** that is not a consumer change (for example "npm publication remains disabled").
|
|
44
|
+
- **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:`.
|
|
45
|
+
- **Placeholders and transcripts**: template text, empty sections, Copilot "Original prompt" blocks, agent transcripts.
|
|
46
|
+
|
|
47
|
+
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`.
|
|
48
|
+
|
|
49
|
+
## Keep the note true to the diff
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
## Bad to good
|
|
54
|
+
|
|
55
|
+
Bad (a published release note, bullets abridged):
|
|
56
|
+
|
|
57
|
+
```markdown
|
|
58
|
+
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.
|
|
59
|
+
|
|
60
|
+
## Added
|
|
61
|
+
|
|
62
|
+
- Preview option `withChronicle({ ..., activateArtifactsInScopes: true })` ... (#93)
|
|
63
|
+
|
|
64
|
+
See [Activate reactors and reducers in Arc scopes](Documentation/chronicle/reactors/scoped-activation.md).
|
|
65
|
+
|
|
66
|
+
Review: Opus-only (same-provider) review.
|
|
67
|
+
|
|
68
|
+
Refs #93
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Good (as corrected):
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
Arc can now construct Chronicle reactors and reducers through its own dependency injection, one scope per delivered batch, as an opt-in preview.
|
|
75
|
+
|
|
76
|
+
## Added
|
|
77
|
+
|
|
78
|
+
- 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)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
"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 #n` is a keyword line. The example issue was only partly delivered by this release, so its bullets use the `(part of #n)` form; `(#n)` would have closed it.
|
|
82
|
+
|
|
83
|
+
## Before you create or edit a PR
|
|
84
|
+
|
|
85
|
+
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`.
|
|
86
|
+
2. Read the body against the forbidden list and the issue table above; delete every hit and verify every issue number.
|
|
87
|
+
3. Sections in order, none empty, at most one summary form; every bullet user-facing.
|
|
88
|
+
4. Test plan, verification and review notes are in a PR comment.
|
|
89
|
+
|
|
90
|
+
If the release-note rules fail, fix the description, not the code.
|
package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-labels-and-release.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<!-- Copyright (c) Cratis. All rights reserved. -->
|
|
2
|
+
<!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
|
|
3
|
+
|
|
4
|
+
# Labels, release intent, grouping and quality gates
|
|
5
|
+
|
|
6
|
+
The contract (exactly one release-intent label, the major go-ahead, `no-release` for non-outward changes, required gates) stays always-on in [pull-requests.md](../../../rules/pull-requests.md). This reference holds the procedure and detail.
|
|
7
|
+
|
|
8
|
+
## Commits in a PR
|
|
9
|
+
|
|
10
|
+
See [commits.md](./commits.md) for logical grouping, message format and staging discipline.
|
|
11
|
+
|
|
12
|
+
- Imperative mood: "Add author registration", not "Added author registration".
|
|
13
|
+
- Each commit is one logical unit of work. No WIP commits in the final PR.
|
|
14
|
+
- Never mix unrelated changes in a single commit.
|
|
15
|
+
|
|
16
|
+
## Labels
|
|
17
|
+
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
- 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.
|
|
21
|
+
- 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.
|
|
22
|
+
- Label the PR according to semantic versioning impact:
|
|
23
|
+
- **major**: breaking changes to public APIs
|
|
24
|
+
- **minor**: new features, new slices, non-breaking additions
|
|
25
|
+
- **patch**: bug fixes, refactoring with identical behavior
|
|
26
|
+
|
|
27
|
+
### A major release needs a human's explicit go-ahead
|
|
28
|
+
|
|
29
|
+
A `major` label is the one release-intent label a ship request does not, by itself, authorize through to merge. Breaking a public API is the most consequential and hardest-to-reverse thing a release does (every downstream consumer eventually has to act on it), so it gets a checkpoint the other two intents do not.
|
|
30
|
+
|
|
31
|
+
- Prepare the branch, commits, push, and PR carrying the `major` label exactly as any other ship request would.
|
|
32
|
+
- Before merging, stop and ask a human to confirm the major bump specifically: name the exact breaking change(s), who is affected and how, and the resulting version number. A generic "ready to ship?" is not this checkpoint; say plainly that this release breaks compatibility and needs a yes.
|
|
33
|
+
- A human merges a `major` PR, after answering that question with an explicit yes. An agent never merges it, even after the confirmation. A prior general instruction to "ship" or "land this" does not answer it, even when it named `major` as the intended label.
|
|
34
|
+
- This checkpoint is per release, not per conversation: a human confirming one major release does not pre-authorize the next one.
|
|
35
|
+
|
|
36
|
+
This narrows the general ship-changes authorization in [`ship-changes.prompt.md`](../../../prompts/ship-changes.prompt.md) for exactly this label; every other step of that workflow proceeds under its existing authority.
|
|
37
|
+
|
|
38
|
+
### A pull request that changes nothing outward-facing carries `no-release`
|
|
39
|
+
|
|
40
|
+
**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.
|
|
41
|
+
|
|
42
|
+
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.
|
|
43
|
+
|
|
44
|
+
This covers, whenever the PR touches *only* these:
|
|
45
|
+
|
|
46
|
+
- **Documentation**: anything under `Documentation/**`, READMEs, the `.cratis/ai/` corpus.
|
|
47
|
+
- **CI and repository automation**: `.github/workflows/**`, `.github/scripts/**`, `.github/CODEOWNERS`, issue/PR templates.
|
|
48
|
+
- **Tests and specs**: `*.Specs/**`, `when_*/**`, `for_*/**`, `Integration/**`, and test-only fixtures.
|
|
49
|
+
- **Build and tooling configuration** that produces no shipped artifact difference: lint config, editor config, local scripts.
|
|
50
|
+
|
|
51
|
+
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.
|
|
52
|
+
|
|
53
|
+
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.
|
|
54
|
+
|
|
55
|
+
## Release-action windows and workflow drift
|
|
56
|
+
|
|
57
|
+
Batching is opt-in; success with `batched` or `nothing-pending` is not publication. Read **cratis-release-notes** before configuring windows, handling a pending-major hotfix, or recovering a workflow-drift 403. Major confirmation remains required; a workflow-drift recovery differs from the concurrent-tag retry in the quality gates below.
|
|
58
|
+
|
|
59
|
+
## Group small related changes into one pull request
|
|
60
|
+
|
|
61
|
+
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`.
|
|
62
|
+
|
|
63
|
+
**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.
|
|
64
|
+
|
|
65
|
+
Before a consolidation or a re-land of reverted work merges, prove it dropped nothing with `cratis-engineering-consolidation-guard`.
|
|
66
|
+
|
|
67
|
+
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.
|
|
68
|
+
|
|
69
|
+
## Quality gates
|
|
70
|
+
|
|
71
|
+
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.
|
|
72
|
+
|
|
73
|
+
**`no-release` does not otherwise excuse a PR from these gates.** 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.
|
|
74
|
+
|
|
75
|
+
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:
|
|
76
|
+
|
|
77
|
+
- `dotnet build`: zero errors, zero warnings
|
|
78
|
+
- `dotnet test`: all specs pass
|
|
79
|
+
- `yarn lint`: zero errors
|
|
80
|
+
- `npx tsc -b`: zero TypeScript errors
|
|
81
|
+
- Code follows all project coding standards and conventions
|
|
82
|
+
- **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 fails the job rather than reporting success).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "cratis-commits-and-pull-requests",
|
|
3
|
+
"input": "Prepare a commit and a release-note pull request without rewriting history or publishing reviewer notes.",
|
|
4
|
+
"fixtures": [],
|
|
5
|
+
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "../../rules/git-commits.md" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "../../rules/pull-requests.md" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "cratis-check-pr.mjs --body-file <file> --label <intent>" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "A human confirms and merges a major release." }
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -13,7 +13,7 @@ compatibility: Requires git and the GitHub CLI (gh).
|
|
|
13
13
|
Operate checks; do not redesign workflows here. Read
|
|
14
14
|
[verification-discipline.md](../../rules/verification-discipline.md) for phase
|
|
15
15
|
budgets and exit-status handling, and
|
|
16
|
-
[pull-requests.md](
|
|
16
|
+
[pull-requests.md](../cratis-commits-and-pull-requests/references/pr-labels-and-release.md#quality-gates) for required checks.
|
|
17
17
|
Read [capability-is-not-authority.md](../../rules/capability-is-not-authority.md)
|
|
18
18
|
before an external effect. A request to verify does not authorize a push.
|
|
19
19
|
|
|
@@ -24,9 +24,23 @@ body edits are not conditional writes; a last-minute reread alone cannot prevent
|
|
|
24
24
|
two writers from overwriting each other.
|
|
25
25
|
|
|
26
26
|
Before starting, read the issue, comments, assignees and any status block. Follow
|
|
27
|
-
[issue-assignment.md](../../rules/issue-assignment.md)
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
[issue-assignment.md](../../rules/issue-assignment.md) and this claiming procedure:
|
|
28
|
+
|
|
29
|
+
- Applies when the user, branch, task or handover names an issue number in a
|
|
30
|
+
known repository. No known repository or issue means no guessed assignment.
|
|
31
|
+
- Read assignees and state in that issue's repository:
|
|
32
|
+
`gh issue view <n> --repo <owner>/<repo> --json assignees,state`.
|
|
33
|
+
- If open and unassigned, run
|
|
34
|
+
`gh issue edit <n> --repo <owner>/<repo> --add-assignee @me`.
|
|
35
|
+
`@me` means the authenticated user, not an invented identity.
|
|
36
|
+
- Never replace or add to an existing assignment. Skip a closed issue; say so
|
|
37
|
+
without reopening or assigning it.
|
|
38
|
+
- Do this once, at the start before the first edit, not on every turn. If it
|
|
39
|
+
fails (permissions or authentication), report it and continue with the work.
|
|
40
|
+
|
|
41
|
+
The request to work on the issue authorizes this assignment only, not comments,
|
|
42
|
+
labels or closure. If another writer is active, coordinate rather than starting
|
|
43
|
+
a parallel edit. Delegated workers do not claim or mutate the issue.
|
|
30
44
|
|
|
31
45
|
When the request covers maintaining the issue, set the status block to
|
|
32
46
|
**In progress** before coding. Keep it true as work moves: **In review** for the
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "cratis-engineering-issue-hygiene",
|
|
3
|
+
"input": "Claim a known issue at work start without replacing an assignee or expanding authority.",
|
|
4
|
+
"fixtures": [],
|
|
5
|
+
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "gh issue view <n> --repo <owner>/<repo> --json assignees,state" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "gh issue edit <n> --repo <owner>/<repo> --add-assignee @me" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "Never replace or add to an existing assignment" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "authorizes this assignment only" }
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cratis-rtk
|
|
3
|
+
description: Route human-readable command output through rtk without losing exact diagnostics or exit codes. Use before choosing wrappers for git, searches, builds, tests, lint or package-manager commands, and when a wrapped command fails or a script needs raw output. Not for granting execution authority, choosing CI gates, or changing repository scripts to use rtk.
|
|
4
|
+
license: LICENSE
|
|
5
|
+
compatibility: Local shell; rtk is optional and must already be installed.
|
|
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
|
+
# Token-optimized commands
|
|
12
|
+
|
|
13
|
+
Follow [rtk.md](../../rules/rtk.md): exact output and real exit codes win over
|
|
14
|
+
compression. A wrapper is not verification and never expands authority.
|
|
15
|
+
|
|
16
|
+
1. If `rtk` is not on `PATH`, use normal tools; do not install it or block work.
|
|
17
|
+
2. For human-readable output, let the configured PreToolUse hook rewrite Bash
|
|
18
|
+
commands (for example `git status` → `rtk git status`). Without that hook,
|
|
19
|
+
prefix each supported command, including each command in an `&&` chain.
|
|
20
|
+
3. For parsed output, exact paths/content/Git state, structured diagnostics or
|
|
21
|
+
output that decides the next action, use `rtk proxy <cmd>` (or the plain
|
|
22
|
+
command when no hook rewrites it). Never sacrifice the producer's exit status.
|
|
23
|
+
4. If a wrapped command fails, read the actual error and retry through
|
|
24
|
+
`rtk proxy` before concluding the tool, path or repository is missing.
|
|
25
|
+
5. Keep native commands in scripts, hooks and CI; do not add rtk to them.
|
|
26
|
+
|
|
27
|
+
Examples:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
rtk git status
|
|
31
|
+
rtk proxy git diff --cached
|
|
32
|
+
rtk proxy git status --porcelain
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For builds, lint and specs use the repository's authorized gate command. Do not
|
|
36
|
+
pipe a build or test into `grep`, `sort`, `head` or `tail` as gate evidence.
|
|
37
|
+
A filtered zero-error summary is not a successful check.
|
|
38
|
+
|
|
39
|
+
## Supported output families
|
|
40
|
+
|
|
41
|
+
- Files: `ls`, `tree`, `read`, `find`, `grep`, `diff`.
|
|
42
|
+
- Git and GitHub: `git status/log/diff/add/commit/push/pull`, `gh pr/issue/run …`.
|
|
43
|
+
- Tests: `dotnet test`, Jest, Vitest, Playwright, pytest, Go, Cargo, RSpec.
|
|
44
|
+
- Build and lint: `dotnet build`, `tsc`, ESLint, Biome, Prettier, Cargo Clippy,
|
|
45
|
+
Ruff, golangci-lint, Rubocop.
|
|
46
|
+
- Package managers: pnpm/npm/yarn, pip, Bundler, Prisma.
|
|
47
|
+
- Cloud and containers: AWS CLI, Docker, Kubernetes, OpenShift.
|
|
48
|
+
|
|
49
|
+
## Built-in tools and audits
|
|
50
|
+
|
|
51
|
+
Bash hooks do not wrap built-in Read/Grep/Glob tools. For broad exploration use
|
|
52
|
+
`rtk read`, `rtk grep` or `rtk find` in the terminal to reduce output. For small,
|
|
53
|
+
precise reads and exact replacement text, use the built-in file tools: rtk can
|
|
54
|
+
filter away the line needed for an edit. Raw output remains mandatory whenever
|
|
55
|
+
it drives an operation.
|
|
56
|
+
|
|
57
|
+
Use `rtk gain` to inspect savings and `rtk discover` to find commands that missed
|
|
58
|
+
compression. These are optimization aids, not quality-gate evidence. The rtk
|
|
59
|
+
project is at https://github.com/rtk-ai/rtk; setup is a human's responsibility.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill": "cratis-rtk",
|
|
3
|
+
"input": "Choose wrappers for human-readable status and exact parsed gate diagnostics without losing exit codes.",
|
|
4
|
+
"fixtures": [],
|
|
5
|
+
"assertions": [
|
|
6
|
+
{ "kind": "skill-contains", "value": "rtk proxy <cmd>" },
|
|
7
|
+
{ "kind": "skill-contains", "value": "do not install it or block work" },
|
|
8
|
+
{ "kind": "skill-contains", "value": "Keep native commands in scripts, hooks and CI" },
|
|
9
|
+
{ "kind": "skill-contains", "value": "Never sacrifice the producer's exit status" }
|
|
10
|
+
]
|
|
11
|
+
}
|