agentleFS
MicrosoftKnown publishermicrosoft/rego-cpp/.github/skills/code-review/SKILL.md

code-review

Skill48 starsChanged 5 months agoMITView on GitHub

Perform a multi-perspective code review of rego-cpp changes. Use when: reviewing a release, auditing a branch diff, evaluating a PR, or performing a pre-merge code review. Launches four parallel constructive review subagents (Security, Performance, Usability, Conservative), synthesises findings, then runs a sequential adversarial gap-analysis pass. Verifies key findings, produces a unified report with severity-ranked findings and actionable remediation recommendations.

188 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use starter, media-processing and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • ww-w-aiSkill

    starter

    Static web development guide for beginners. Covers HTML/CSS/JavaScript and Next.js App Router basics. Project initialization with "init starter". Triggers: static website, portfolio, landing page, HTML CSS, beginner, 정적 웹, 포트폴리오, 초보자, 静的サイト, 初心者, 静态网站, 初学者, sitio web estático, site statique, statische Website, sito web statico Do NOT use for: fullstack apps (use $dynamic), enterprise (use $enterprise).

    Also in 4 projects that use this

  • mrgoonieSkill

    media-processing

    Process multimedia files with FFmpeg (video/audio encoding, conversion, streaming, filtering, hardware acceleration) and ImageMagick (image manipulation, format conversion, batch processing, effects, composition). Use when converting media formats, encoding videos with specific codecs (H.264, H.265, VP9), resizing/cropping images, extracting audio from video, applying filters and effects, optimizing file sizes, creating streaming manifests (HLS/DASH), generating thumbnails, batch processing images, creating composite images, or implementing media processing pipelines. Supports 100+ formats, hardware acceleration (NVENC, QSV), and complex filtergraphs.

    Also in 5 projects that use this

  • loulanyueSkill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 15 projects that use this

  • mrgoonieSkill

    aesthetic

    Create aesthetically beautiful interfaces following proven design principles. Use when building UI/UX, analyzing designs from inspiration sites, generating design images with ai-multimodal, implementing visual hierarchy and color theory, adding micro-interactions, or creating design documentation. Includes workflows for capturing and analyzing inspiration screenshots with chrome-devtools and ai-multimodal, iterative design image generation until aesthetic standards are met, and comprehensive design system guidance covering BEAUTIFUL (aesthetic principles), RIGHT (functionality/accessibility), SATISFYING (micro-interactions), and PEAK (storytelling) stages. Integrates with chrome-devtools, ai-multimodal, media-processing, ui-styling, and web-frameworks skills.

    Also in 4 projects that use this

  • AWSSkill

    ask-matt

    Ask which skill or flow fits your situation. A router over the skills in this repo.

    Also in 32 projects that use this

  • AWSSkill

    resolving-merge-conflicts

    Use when you need to resolve an in-progress git merge/rebase conflict.

    Also in 48 projects that use this

  • +1 more from mrgoonie
  • +2 more from aws

The file

Show its rules and text

We split this skill into the rules it gives an agent

18 rules. 0 are common, 8 are distinctive, and 10 are very specific to this project.

  • 0

    Common

    Most of the 174 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 10

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before tagging a release

    line 16
  2. Distinctive:

    When a single-perspective review would miss cross-cutting concerns

    line 19
  3. Distinctive:

    When the user says "resume review" or "restart from step N":

    line 82
  4. Very specific:

    Read the checkpoint directory .copilot/review/<review-slug>/

    line 84
  5. Distinctive:

    If the user specifies a step number, discard checkpoints for that step and later, then re-run from that step using earlier checkpoint data …

    line 87
  6. Very specific:

    Checkpoint: Write .copilot/review/<review-slug>/step-1-diff.md with the commit range, full file list, and subsystem grouping.

    line 115
  7. Very specific:

    Checkpoint: Write .copilot/review/<review-slug>/step-2-reviews.md with each reviewer's output under its own heading.

    line 165
  8. Distinctive:

    After all four constructive reviewers return, synthesise their outputs:

    line 169
  9. Very specific:

    Checkpoint: Write .copilot/review/<review-slug>/step-3-synthesis.md with the deduplicated, classified findings.

    line 187
  10. Very specific:

    After synthesising the four constructive reviewers' findings, spawn a fresh adversarial subagent (adversarial-lens).

    line 191
  11. Very specific:

    Checkpoint: Write .copilot/review/<review-slug>/step-4-adversarial.md with the adversarial findings merged into the full list.

    line 235
  12. Very specific:

    Checkpoint: Write .copilot/review/<review-slug>/step-5-verification.md with the verification results.

    line 255
  13. Very specific:

    Checkpoint: Write .copilot/review/<review-slug>/step-6-report.md with the full unified report.

    line 279
  14. Very specific:

    Before finalising recommendations, check whether existing test suites (OPA conformance tests, regocpp.yaml, fuzzer) already cover the …

    line 283
  15. Very specific:

    Checkpoint: Write .copilot/review/<review-slug>/step-7-calibration.md with the calibration results and final adjusted recommendations.

    line 298
  16. Distinctive:

    If the code under review exceeds ~300 lines, split it into logical segments (by file, pass, or function group) and run Steps 2–5 …

    line 302
  17. Distinctive:

    Do not skip the verification step for CRITICAL/HIGH issues.

    line 318
  18. Distinctive:

    Prefer concrete code suggestions over vague recommendations.

    line 320

“Common” is measured: kept by at least 6 in 10 of the 174 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Multi-Perspective Code Review

Perform a structured code review by examining changes from four independent constructive perspectives, synthesising their findings, then running an adversarial gap-analysis pass to catch what the constructive reviewers missed. Cross-check findings against source code and produce a unified report with actionable recommendations.

When to Use

  • Before tagging a release
  • Reviewing a large branch diff or PR
  • Auditing a new subsystem (crypto, parsing, VM changes)
  • When a single-perspective review would miss cross-cutting concerns

Background

A single reviewer tends toward their own bias — a security expert over-flags performance patterns, a performance expert under-flags input validation. This skill runs four parallel constructive reviews, synthesises their findings, then passes the result to an adversarial red-team reviewer that focuses on gaps the constructive reviewers missed. This sequential adversarial step produces higher-quality findings than running all five in parallel, because the adversary knows what was already found and can focus on blind spots.

Perspectives

Constructive Reviewers (parallel)

PerspectiveLensAgent
SecurityDefence in depth, memory safety, bounded resources, error handling, adversarial inputs, C API boundaries, fuzz coveragesecurity-lens
PerformanceAllocation minimisation, cache-friendly access, pass count, hot-path awareness, algorithmic complexityspeed-lens
UsabilityCorrectness, clarity, naming, WF precision, error message quality, one-concept-per-pass, API ergonomicsusability-lens
ConservativeSmallest diff, backwards compatibility, API stability, reuse, no speculative generality, blast radiusconservative-lens

Adversarial Reviewer (sequential, after synthesis)

PerspectiveLensAgent
AdversarialRed-team attacks, hidden assumptions, untested edge cases, semantic divergence from OPA, consensus blind spots, breaking inputs. Runs after constructive reviewers and receives their synthesised findings.adversarial-lens

Checkpointing

Each step writes a checkpoint file to .copilot/review/<review-slug>/ so that a review can be resumed at any point if the session is interrupted or the user wants to re-run a step.

Checkpoint format

Each checkpoint is a markdown file with YAML frontmatter, named step-<N>-<name>.md:

---
review_slug: <review-slug>
step: <N>
step_name: <name>
timestamp: <ISO-8601>
status: completed
---

<step content in markdown>

Checkpoint files by step

StepFileBody contents
1step-1-diff.mdCommit range, file list, subsystem grouping
2step-2-reviews.mdEach constructive reviewer's output under its own ## Heading
3step-3-synthesis.mdDeduplicated, classified, severity-ranked findings
4step-4-adversarial.mdAdversarial gap-analysis findings
5step-5-verification.mdVerification results for CRITICAL/HIGH findings
6step-6-report.mdFinal unified report
7step-7-calibration.mdTest coverage calibration results

Resuming from a checkpoint

When the user says "resume review" or "restart from step N":

  1. Read the checkpoint directory .copilot/review/<review-slug>/
  2. Find the highest completed step checkpoint
  3. Load its data and continue from the next step
  4. If the user specifies a step number, discard checkpoints for that step and later, then re-run from that step using earlier checkpoint data as input

Review slug

Derive the slug from the review target: e.g., v1.3.0-to-v1.4.0 for a tag range, or feature-branch-name for a branch review. Store the slug in every checkpoint for cross-reference.

Using checkpoints as subagent context

Because checkpoint files are plain markdown, subagents can read them directly using file tools. Instead of inlining all prior results into a subagent prompt, point the subagent at the checkpoint files:

  • Tell the subagent the checkpoint directory path (.copilot/review/<review-slug>/).
  • Instruct it to read the specific checkpoint files it needs (e.g., "Read step-1-diff.md for the file list and step-3-synthesis.md for existing findings").
  • This keeps prompts short, avoids token duplication, and ensures subagents always see the full untruncated content.

Procedure

Step 1: Identify the Diff

Determine the commit range or branch diff to review.

# Example: changes since last release tag
git diff --stat v1.2.0..HEAD

Group changed files by subsystem (parser, builtins, VM, C API, build system, wrappers) to assign review focus areas.

Checkpoint: Write .copilot/review/<review-slug>/step-1-diff.md with the commit range, full file list, and subsystem grouping.

Step 2: Launch Four Constructive Review Subagents

Spawn four Explore subagents in parallel, one per constructive perspective. Do NOT include the adversarial reviewer in this step — it runs later in Step 4.

Each subagent receives:

  1. The same list of changed files and feature summary
  2. The perspective-specific review lens (from the table above)
  3. Specific files to examine based on the subsystem grouping
  4. Instructions to classify findings by severity and provide file/line references

Each subagent is independent — do not allow one reviewer's output to influence another.

Prompt template for each subagent (Security, Performance, Usability, Conservative):

You are performing a {PERSPECTIVE}-focused code review of rego-cpp. The changes add: {FEATURE_SUMMARY}.

Your review lens: {LENS_DESCRIPTION}

THOROUGHNESS: thorough

=== PHASE 1 — INVENTORY === Before writing findings, list every function, rewrite rule, pass definition, match arm, and significant code block in the changed files. Number them. This ensures systematic coverage.

=== PHASE 2 — ASSESS === For each inventory item, check it against your focus areas. If no issues, write "No issues." Do not skip items.

Please examine these files and report findings: {FILE_LIST_WITH_SPECIFIC_QUESTIONS}

For each finding, classify severity as {SEVERITY_SCALE} and provide the file path and approximate line numbers. For bugs, provide a minimal test case or execution trace. If you cannot construct one, mark as UNVERIFIED. Return a structured report.

Severity scales per perspective:

  • Security: CRITICAL / HIGH / MEDIUM / LOW / INFO
  • Performance: HIGH / MEDIUM / LOW impact
  • Usability: CONCERN / SUGGESTION / POSITIVE
  • Conservative: BREAKING / HIGH-RISK / MEDIUM-RISK / LOW-RISK / OK

Checkpoint: Write .copilot/review/<review-slug>/step-2-reviews.md with each reviewer's output under its own heading.

Step 3: Synthesise Constructive Findings

After all four constructive reviewers return, synthesise their outputs:

  1. Deduplicate — merge issues raised by multiple reviewers into a single entry, noting which perspectives flagged it.
  2. Classify each unique issue by type: Security, Correctness, Performance, Quality.
  3. Assign unified severity using this scale:
Unified SeverityMapping
CRITICAL / HIGHSecurity CRITICAL/HIGH, Performance HIGH, Usability CONCERN (correctness bug), Conservative BREAKING
MEDIUMSecurity MEDIUM, Performance MEDIUM, Usability CONCERN (non-correctness), Conservative HIGH-RISK
LOWSecurity LOW, Performance LOW, Usability SUGGESTION, Conservative MEDIUM-RISK

Convergence

Where two or more perspectives agree on the same finding. High convergence indicates high confidence.

Checkpoint: Write .copilot/review/<review-slug>/step-3-synthesis.md with the deduplicated, classified findings.

Step 4: Adversarial Gap-Analysis Pass

After synthesising the four constructive reviewers' findings, spawn a fresh adversarial subagent (adversarial-lens). Provide it with:

  • The full list of changed files and feature summary
  • The complete synthesised findings from Step 3 so it knows what was already found

Prompt template for the Adversarial subagent:

You are a red-team adversary performing gap-analysis on a rego-cpp code review. Four other reviewers (Security, Performance, Usability, Conservative) have already reviewed the changes. Their findings are listed below under EXISTING FINDINGS. Your job is to find what they MISSED.

The changes add: {FEATURE_SUMMARY}.

Do NOT re-report existing findings. Only report NEW issues. Focus on:

  • Code sections in NO existing finding (overlooked)
  • Issue categories not represented
  • Cross-component interactions no single lens would catch
  • Shared assumptions across the other reviewers that may be wrong
  • Untested edge cases and semantic divergence from OPA
  • Breaking inputs (provide concrete Rego policies / JSON data)

THOROUGHNESS: thorough

Please examine these files: {FILE_LIST_WITH_SPECIFIC_QUESTIONS}

EXISTING FINDINGS: {SYNTHESISED_FINDINGS_FROM_STEP_3}

For each attack, classify confidence as HIGH (proven with a test case), MEDIUM (likely based on code analysis), or LOW (theoretical). Provide concrete adversarial inputs wherever possible. Return a structured attack report.

Severity scale for Adversarial:

  • HIGH: Concrete breaking input or proven semantic divergence from OPA
  • MEDIUM: Likely failure based on code analysis, no concrete input yet
  • LOW: Theoretical concern, conditions for failure are speculative

Merge the adversarial reviewer's new findings into the synthesised list using the same unified severity scale, then proceed to verification.

Checkpoint: Write .copilot/review/<review-slug>/step-4-adversarial.md with the adversarial findings merged into the full list.

Step 5: Verify Key Findings

Identify the highest-severity findings (CRITICAL / HIGH) and spot-check them against source code. Launch a verification subagent:

For each claim below, read the relevant code and report whether the claim is CONFIRMED, PARTIALLY CONFIRMED, or REFUTED. Provide exact code evidence. {LIST_OF_CLAIMS_TO_VERIFY}

This step prevents false positives from propagating into the final report. Mark each issue as:

  • Verified — reproduced or confirmed by code inspection
  • Likely — strong evidence but not yet reproduced
  • Unverified — plausible but needs investigation

Downgrade or remove issues that cannot be substantiated after reasonable investigation.

Checkpoint: Write .copilot/review/<review-slug>/step-5-verification.md with the verification results.

Step 6: Produce the Report

Produce a unified report with these sections:

Findings by Severity

A single table combining all verified findings. Each finding gets: number, description, originating perspective(s), verification status, file path and line references.

Positive Highlights

Things the code does well, called out by any perspective. This provides balanced feedback and reinforces good patterns.

Recommendations

Ordered by priority. Split into:

  • Before release: correctness bugs, UB, security issues
  • After release: performance optimisation, tech debt, hardening

Trade-offs

Where perspectives conflict (e.g., security wants more validation, performance wants less overhead), state the conflict and the recommended resolution.

Checkpoint: Write .copilot/review/<review-slug>/step-6-report.md with the full unified report.

Step 7: Calibrate Against Existing Test Coverage

Before finalising recommendations, check whether existing test suites (OPA conformance tests, regocpp.yaml, fuzzer) already cover the flagged scenarios. The OPA test suite is comprehensive — findings about "missing test coverage" must be verified against:

# List OPA test suites
ls build/opa/v1/test/cases/testdata/v1/

# Check specific suite coverage
grep 'note:' build/opa/v1/test/cases/testdata/v1/{suite}/*.yaml

Drop or downgrade recommendations that duplicate existing OPA coverage.

Checkpoint: Write .copilot/review/<review-slug>/step-7-calibration.md with the calibration results and final adjusted recommendations.

Chunking Large Targets

If the code under review exceeds ~300 lines, split it into logical segments (by file, pass, or function group) and run Steps 2–5 independently on each segment. After all segments are reviewed, merge and deduplicate findings across segments before the final report.

This ensures every section receives full attention. Do not skip this for large targets — reviewer quality degrades significantly when a single prompt must cover hundreds of lines.

Guardrails

  • Each reviewer subagent must be a fresh instance — no context contamination between reviewers.
  • The adversarial reviewer runs AFTER the constructive reviewers, not in parallel. It receives the synthesised findings to avoid duplicate work and focus on gaps.
  • Do not skip the verification step for CRITICAL/HIGH issues. Unverified critical findings must be explicitly marked as such.
  • Prefer concrete code suggestions over vague recommendations.

Output Format

The final report should be a structured markdown document (presented in chat, not saved to a file unless requested) with the sections described in Step 6.

Reference

  • Example remediation plan from v1.3.0 review — a concrete example of findings and the resulting fix plan.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.