Skip to content

feat(review): bundle review criteria and a verify step into the code-review skill #747

Description

@ss-o

Problem

The organization code-review skill (.github/skills/code-review/SKILL.md) is vendored into at least 15 consumer repositories at the approved revision 5593b7d. The checked copies match the approved content apart from YAML indentation. The skill is mostly a router, though, and the z-shell review criteria it routes to are not present where vendored reviews run.

  1. The criteria are absent from every consumer. The severity table (CRITICAL, IMPORTANT, SUGGESTION), dialect classification and deterministic checks live only in .github/instructions/quality/code-review.instructions.md in this repository. No consumer has a local copy. The skill says to follow that file by its github.com URL, or a local copy "when available". Copilot code review reads instructions and skills from the PR head branch; whether it follows the external URL is unverified. In a plugin, annex or module repository the review may therefore run without the z-shell priorities.
  2. The pin covers only part of the skill. The skill is pinned, but its links to the criteria, tool-integration guidance and the org-review and pull-request runbooks point at blob/main. The effective rules can change without a re-pin, while org-routing.py check still reports the consumer as current.
  3. There is no verification procedure. The criteria ask for verified failure scenarios, but the skill has no step that separates finding suspected defects from verifying them. It also does not ask the reviewer to pin base, head and merge-base, to read existing review threads (thread resolution is a merge gate under ADR-0013), to review only the delta on a re-review, or to recheck the head before reporting.
  4. Every PR review loads org process text. About a third of the body covers repository-health readiness and the ADR-0026 fallback election. Health readiness is already owned by runbooks/org-review.md and enforced by automation/agents/org-routing.py. The fallback election is meaningful to a local agent, not to the hosted reviewer.

No recorded review yet shows Copilot attributing a review to the skill, so its effect on review quality is unmeasured (runbooks/org-review.md already treats invocation as unverified).

Proposal

Scope is this repository. Re-pinning each consumer remains a separate authorized change per runbooks/org-review.md.

  1. Bundle the criteria in the skill. Extend automation/knowledge/knowledge-delivery.py so knowledge/domains/quality/code-review.md also renders .github/skills/code-review/references/criteria.md. The skill reference drops the Copilot frontmatter (applyTo, excludeAgent) and rewrites relative links that leave the skill directory to absolute https://github.com/z-shell/.github/blob/main/... URLs, so no bundled link breaks in a consumer. The core criteria are then pinned with the skill; the linked Zsh scripting standard and machine policy stay org-wide current by design. The knowledge source remains the only editable copy.
  2. Rewrite SKILL.md to about 600 words (currently 756): read references/criteria.md first and use its severity labels; add a verify step (record each suspected defect, check it against code, callers and tests, report confirmed and suspected separately, drop refuted ones); add the PR mechanics above; reduce health readiness to a pointer to runbooks/org-review.md; keep the fallback paragraph, scoped to agents that are not the hosted reviewer.
  3. Add references/criteria.md to the files list of code-review in knowledge/domains/agents/data/approved-skills.json. Advance the approved revision in a follow-up change once the skill commit exists.
  4. Update the install and update section of runbooks/org-review.md and the quality knowledge page for the multi-file skill and the second consumer.
  5. Measure before and after the re-pin, each step separately authorized: a draft PR in one plugin repository with three planted defects (Bash-only syntax in native Zsh, a feature above the declared floor, network activity in the load path), a requested Copilot review, and a record of which defects were found, which severity labels were used and whether the skill was attributed. Close the PR unmerged.
  6. Re-pin in the runbook pilot order: this repository, one standard plugin, one documentation repository, then the remaining consumers.

Acceptance criteria

  • references/criteria.md is generated from the knowledge source, carries the generated header, has no Copilot frontmatter and no relative link that leaves the skill directory.
  • knowledge-delivery.py --check fails when the reference drifts from its source; generator tests cover the second consumer and the link rewrite.
  • SKILL.md names the bundled criteria, contains the verify step and the PR mechanics, and points to runbooks/org-review.md for health readiness.
  • approved-skills.json lists both files and org-routing.py verify-approved passes at the advanced revision.
  • The affected runbook and knowledge pages describe the multi-file skill.
  • Baseline and post-change measurements are recorded on this issue (local Claude Code and Codex runs; Copilot measurement moved to Measure Copilot code review with the bundled code-review criteria #762).

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:metaOrganization-wide policy, templates, or meta-repo work.type:featureA request for new behavior or capability.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions