Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Refactor Copilot Review Instructions and Skills by ptr727 · Pull Request #799 · ptr727/ProjectTemplate · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor Copilot Review Instructions and Skills by ptr727 · Pull Request #799 · ptr727/ProjectTemplate · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor Copilot Review Instructions and Skills by ptr727 · Pull Request #799 · ptr727/ProjectTemplate · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Refactor Copilot Review Instructions and Skills by ptr727 · Pull Request #799 · ptr727/ProjectTemplate · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor Copilot Review Instructions and Skills by ptr727 · Pull Request #799 · ptr727/ProjectTemplate · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor Copilot Review Instructions and Skills by ptr727 · Pull Request #799 · ptr727/ProjectTemplate · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Refactor Copilot Review Instructions and Skills by ptr727 · Pull Request #799 · ptr727/ProjectTemplate · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/skills/README.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,6 @@

Canonical source for the fleet's Claude Code / opencode / Codex Skills, one directory per skill: `<name>/SKILL.md` plus optional `scripts/` and `references/`. This is the only place a skill's content is hand-authored. Everything else derived from it is generated, never hand-edited.

Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.
Codex and opencode read this directory directly (`.agents/skills/<name>/SKILL.md`), no install step required, walking from a downstream repo's working directory up to its own repository root. Claude Code does not scan this path. GitHub Copilot discovers repository skills under `.github/skills/`. `scripts/build_dist.py` generates both the GitHub tree and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`.

See `AGENTS.md` for how a repo depends on these skills and `scripts/README.md` for `build_dist.py` and the installer. The procedure for creating, changing, or retiring a skill is the `skill-lifecycle` skill (`skill-lifecycle/SKILL.md` here), which this README defers to.
71 changes: 71 additions & 0 deletions .agents/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
8 changes: 4 additions & 4 deletions .agents/skills/copilot-instructions-keeper/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
22 changes: 10 additions & 12 deletions .agents/skills/pr-review-conduct/SKILL.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -13,9 +13,9 @@ description: >-
full diff, or left a suppressed low-confidence finding, which opens no thread at all,
unanswered. Also triggers when a review loop looks stuck
(no review landing, findings that keep reappearing) or when deciding a finding is real, false,
deferred, or a deliberate decline. Provider-specific mechanics (GitHub Copilot's request/poll/
reply API calls) live in .github/copilot-instructions.md's "GitHub Copilot Review Runbook,"
this skill is the contract that runbook implements, not a replacement for it.
deferred, or a deliberate decline. Provider-specific mechanics are implemented by
scripts/pr_review.py and bootstrapped by .github/copilot-instructions.md. This skill is the
contract those surfaces implement, not a replacement for them.
---

# PR Review Conduct
Expand DownExpand Up@@ -134,13 +134,11 @@ head-scoped query while still unanswered.
- A finding is judged real but should not be fixed. That decision is never the agent's alone.
- An architectural redesign is proposed rather than a bug fix.

## Mechanics live elsewhere
## Mechanics Live Elsewhere

This skill is the provider-agnostic contract. For the actual GitHub API calls, requesting a
Copilot review, polling for it, matching the suppressed-findings heading (its wording has moved
more than once), verifying head-SHA and diff coverage, replying and resolving threads without a
hand-typed id, see `.github/copilot-instructions.md` "GitHub Copilot Review Runbook" in the repo
being worked in, and reach for `scripts/pr_review.py` (hub-hosted, invoked from a hub checkout)
before hand-rolling any of it. `status` reports coverage, threads, suppressed findings, and shapes
in one call, `wait` backs off in-process, and `reply` resolves a thread by matching the finding's
own words rather than a line number a fix push can move.
This skill is the provider-agnostic contract. Use `scripts/pr_review.py` from a hub checkout for
the GitHub-specific API operations. `status` reports coverage, threads, body-only findings, and
shapes in one call. `wait` requests and polls in-process. `reply` resolves a thread by matching
the finding's own words instead of a line number a fix push can move. The repository's
`.github/copilot-instructions.md` bootstraps Copilot into the `code-review` skill and its stable
coverage marker. Do not reconstruct the API operations by hand.
8 changes: 4 additions & 4 deletions .agents/skills/skill-lifecycle/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
---
name: skill-lifecycle
description: >-
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/ or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated plugin desyncs the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
Governs the lifecycle of the fleet's own skills in ptr727/ProjectTemplate: creating, changing, splitting, and retiring a skill under .agents/skills/, the source-versus-generated split with .github/skills/ and .claude-plugin/, the regenerate and --check semantics of scripts/build_dist.py, the install and stamp semantics of scripts/skills_install.py, the doc-packaging pattern that keeps a law doc and its skill in agreement, and the trigger-description conventions that make a skill fire. Use this whenever about to create, edit, move, or delete anything under .agents/skills/, .github/skills/, or .claude-plugin/, whenever packaging a doc or a doc section as a skill, and whenever deciding whether a topic deserves a skill at all. Triggers even when the edit looks trivial, such as fixing a typo in one SKILL.md, because the generated distributions desync the moment the source changes without a build_dist.py run, and CI fails the pull request on exactly that. Hub-context only, since .agents/skills/ exists only in the hub.
---

# Skill Lifecycle
Expand All@@ -13,7 +13,7 @@ The agent most likely to get a skill wrong is the one editing a skill, and befor
## The Pipeline

- **`.agents/skills/<name>/SKILL.md` is the only hand-authored source**, with optional `references/` and `scripts/` directories beside it. Codex and opencode read this tree directly, project-local, and also read the global `~/.agents/skills/` copy the installer materializes.
- **Claude Code never scans that path.** `scripts/build_dist.py` generates a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. The generated tree is never hand-edited, and `build_dist.py --check` exits non-zero when it was built from different source bytes than `.agents/skills/` currently holds.
- **Generated distributions serve GitHub Copilot and Claude Code.** `scripts/build_dist.py` generates `.github/skills/` for GitHub Copilot and a Claude-plugin-compatible copy at `.claude-plugin/fleet-skills/`, published through `.claude-plugin/marketplace.json`. Neither generated tree is hand-edited, and `build_dist.py --check` exits non-zero when either tree differs from `.agents/skills/`.
- **The skill set is implicit.** Every `.agents/skills/<name>/` directory carrying a `SKILL.md` is a skill, and the generated `plugin.json` derives its list from those directories, so adding or retiring a skill edits no manifest by hand. `marketplace.json` names the plugin, not the skills, and is untouched by ordinary lifecycle work.
- **`scripts/skills_install.py`, run from a hub checkout, installs both forms per machine**: an overlay copy into `~/.agents/skills/` for Codex and opencode, marked per skill so a retired skill is removed on the next run and a foreign skill is never touched, and a user-scope plugin install for Claude Code via the `claude` CLI. Each run stamps the hub commit into `~/.agents/skills-install-stamp.json`, and `--report` reads that stamp against the checkout and exits non-zero when the machine is behind. The install is global per user, and per-repo pinning is a settled non-goal (`docs/fleet-map.md` "Skills Install Model").

Expand All@@ -28,13 +28,13 @@ A skill surfaces at a trigger moment. A rule that binds every action all the tim
3. **Author the body per the `comment-and-doc-style` skill**: LF (the repo default), present tense, ASCII tiers, no semicolon in prose. Name hub paths as plain code spans rather than repo-relative links, because an installed copy resolves no repo path, and say "from a hub checkout" for anything the reader must run.
4. **Split bulk into `references/`** when the source doc is large: the SKILL.md carries the summary and the binding rules, and each `references/*.md` carries one topic read on demand, the shape `comment-and-doc-style` uses.
5. **Apply the doc-packaging pattern below in the same change** when the skill packages a law doc or one of its sections.
6. **Regenerate and commit both trees together**: `python3 scripts/build_dist.py`, then commit the source and the regenerated `.claude-plugin/` in one commit. CI runs `--check` on every pull request and fails a desynced pair. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
6. **Regenerate and commit all trees together**: `python3 scripts/build_dist.py`, then commit the source and both generated trees in one commit. CI runs `--check` on every pull request and fails a desynced distribution. `python3 scripts/tests/test_build_dist.py` covers the generator itself.
7. **Record the surfacing**: annotate the `AGENTS.md` "Where the Rules Live" row when the skill packages a GOVERNANCE section, or its closing paragraph when the skill is new content, so the map stays the one place coverage is read from.
8. **Refresh the machines after merge**: re-run `python3 scripts/skills_install.py` per machine, the cadence `docs/host-setup.md` "Fleet Skills Install" states. Until then every machine serves the previous skill set, which `--report` says.

## Changing or Retiring a Skill

- **Edit only the source tree.** Any content change under `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Edit only the source tree.** Any skill-content change under `.github/skills/` or `.claude-plugin/` that did not come from a `build_dist.py` run is a defect, whatever it fixes.
- **Retiring is deleting the source directory and regenerating.** The derived `plugin.json` list shrinks with it, and the installer's per-skill markers remove the retired skill from `~/.agents/skills/` on each machine's next run.
- **A deletion sweeps the prose that references the skill**, in the same change rather than as follow-up: the `AGENTS.md` map row or paragraph naming it, any law-doc packaging pointer to it, and any sibling skill that disambiguates against it. A law-doc section that had moved its full rules into the skill takes them back, or is retired with it, so no rule is silently lost with the skill that carried it.
- **Renaming is a retire plus a create** as far as the installer's markers and the plugin list are concerned, so sweep references the same way.
Expand Down
1 change: 1 addition & 0 deletions .claude-plugin/fleet-skills/.claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,6 +9,7 @@
"./skills/agent-conduct",
"./skills/audit-a-repo",
"./skills/carried-instruction-file-guard",
"./skills/code-review",
"./skills/comment-and-doc-style",
"./skills/copilot-instructions-keeper",
"./skills/dotnet-codestyle",
Expand Down
2 changes: 1 addition & 1 deletion .claude-plugin/fleet-skills/.source-digest
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
2796eec540f960cb
cf555123c5d2982d
71 changes: 71 additions & 0 deletions .claude-plugin/fleet-skills/skills/code-review/SKILL.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
---
name: code-review
description: >-
Reviews a pull request or change set against the repository's contracts, with explicit diff
coverage and no suppressed findings. Use this whenever asked to review code, a pull request,
a patch, or a proposed change, and whenever GitHub Copilot performs code review. Triggers even
when the diff is documentation-only or workflow-only, because the review must load the
applicable general, language, documentation, and workflow skills before judging the change.
---

# Code Review

## Establish the Contract

1. Read the root `AGENTS.md` and the sections it routes to for the changed paths.
2. Read the complete diff and enumerate every changed file before forming findings.
3. Load every applicable sibling skill from the current skill distribution:
- `comment-and-doc-style` for Markdown, prose, comments, commit messages, and PR titles.
- `dotnet-codestyle` for C# and .NET changes.
- `python-codestyle` for Python changes.
- `shell-codestyle` for shell changes.
- `workflow-ci-contract` for GitHub Actions and CI/CD changes.
4. Treat a missing executable on `PATH` as no evidence that its check is unavailable. Read the
repository's documented local invocation before reporting a check as skipped.

Do not substitute a familiar convention for the repository's written contract. Report a
conflict between instructions instead of silently choosing one.

## Review the Change

Review for correctness, regressions, security, compatibility, error handling, concurrency,
resource lifetime, tests, and contract drift. Follow data and control flow beyond the edited
lines when the behavior depends on unchanged callers or consumers.

For each candidate finding:

1. Verify it against the current head tree, not an unfetched checkout or the base branch.
2. Identify the concrete failing behavior and the conditions that reach it.
3. Confirm that the repository does not already prevent it elsewhere.
4. Prefer one root-cause finding over several symptoms of the same defect.
5. Omit pure preferences that no repository rule or user-visible risk supports.

Review carried fleet content by intent and fidelity. A byte-locked reference to a path that one
downstream repository does not carry is not a broken link. A substantive defect in canonical
content remains a finding, with the fix located at its canonical source.

## Publish Every Finding

Never suppress or hide a finding because confidence is low. Investigate until it is supported
or discard it. Publish every supported finding as an inline review comment when a changed line
can anchor it. Use the review body only when no valid inline anchor exists.

Each finding states:

- A concise imperative title with a severity.
- The file and smallest useful line range.
- The behavior that fails and the input or state that triggers it.
- Why the change causes the failure.
- A bounded direction for the fix when one is known.

Do not report a clean review until every changed file has been read. End the review body with
exactly one ASCII marker, replacing the numbers with measured counts:

```text
<!-- fleet-review: reviewed=N changed=N findings=N -->
```

`reviewed` is the number of changed files actually reviewed. `changed` is the total number of
changed files. `findings` is the number of published findings, including body-only findings.
Never emit `reviewed=changed` as a placeholder. If full coverage is impossible, emit the actual
counts and explain the limitation in the review body.
Original file line numberDiff line numberDiff line change
Expand Up@@ -18,10 +18,10 @@ description: >-

## Why this exists

`.github/copilot-instructions.md` is read directly by the GitHub Copilot review bot, which
cannot read a `SKILL.md`. Unlike other carried governance content, its rule text is never
pointer-ized into a skill, this file always stays fully intact in every repo that carries it.
This skill is about maintaining that file's carried copy, not a substitute for it.
`.github/copilot-instructions.md` is read directly by GitHub Copilot and bootstraps the shared
`AGENTS.md` instruction set and review-focused skills. Its Copilot-specific rules stay fully
intact in every repo that carries it. This skill maintains that carried copy, it does not replace
the bootstrap.

`spec/files.json` declares it `intent` fidelity, `whole: true`, covering three named sections
(`Commit Messages and Pull Request Titles`, `Reviewing Carried Fleet Content`, `GitHub Copilot
Expand Down
Loading