agentleFS
hmctshmcts/claude/.claude/skills/review-pr/SKILL.md

review-pr

Skill1 starsChanged 7 months agoMITView on GitHub

Review a pull request for a CPP or HMCTS Crime Common Platform repository against CPP coding standards. Use when asked to review a PR or code changes specifically in a CP or HMCTS context service.

96 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use build-graph, review-delta 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.
  • n24q02mSkill

    build-graph

    Build or update the code review knowledge graph. Run this first to initialize, or let hooks keep it updated automatically.

    Also in 3 projects that use this

  • n24q02mSkill

    review-delta

    Review only changes since last commit using impact analysis. Token-efficient delta review with automatic blast-radius detection.

    Also in 3 projects that use this

  • jasoncrawfordSkill

    work-on

    Use to kick off work on a feature, bug, or task

    Also in 3 projects that use this

  • DockerSkill

    fix-issue

    Fix a single GitHub issue end-to-end: triage, research, write the fix, review, and create a PR. Use when asked to fix an issue: "fix issue 1234", "resolve #500", "create a PR for issue 200".

    Also in 6 projects that use this

  • JetBrainsSkill

    review-plan

    Manually re-run the autonomous plan review (Phase 2 — consistency + structural). The same review runs automatically as the first phase of /execute-tracks; this command is for re-runs after inline replanning or whenever the plan needs explicit re-validation. TRIGGER when: user asks to re-validate the plan after inline replanning; user requests explicit plan review outside /execute-tracks. SKIP: /execute-tracks already running State 0 in this session (autonomous Phase 2 path will fire) — do not double-run.

    Also in 5 projects that use this

  • SentrySkill

    create-pr

    Create pull requests following Sentry conventions. Use when opening PRs, writing PR descriptions, or preparing changes for review. Follows Sentry's code review guidelines.

    Also in 21 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 91 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If given a PR URL or number:

    line 20
  2. Distinctive:

    If reviewing local changes:

    line 26
  3. Distinctive:

    Always check regardless of repo type:

    line 114

“Common” is measured: kept by at least 6 in 10 of the 91 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

PR Review for Common Platform

Reviews pull requests against CP coding standards, architectural patterns, and platform conventions.

When to Use

  • User asks to "review this PR", "check this pull request", "review PR #123"
  • User pastes a PR URL or number
  • User asks for feedback on changes before creating a PR

Process

Step 1: Gather Changes

If given a PR URL or number:

gh pr view <number> --json title,body,files,additions,deletions,baseRefName,headRefName
gh pr diff <number>

If reviewing local changes:

git diff main...HEAD
git log main..HEAD --oneline

Step 2: Identify Repo Type

Determine the repo type from the directory name and build files:

  • cpp-context-* with pom.xml → Legacy context service (Maven, CQRS, Java EE)
  • cpp-mbd-* with build.gradle → Modern by Default service (Gradle, Spring Boot)
  • cpp-ui-* with package.json → Angular UI application
  • cpp-terraform-* with *.tf → Terraform module
  • cpp-helm-chart → Helm chart changes
  • cp-c4-architecture with .c4 files → Architecture model changes
  • cpp-ui-e2e-serenity with serenity.properties → UI E2E test repo (Serenity BDD + Cucumber)
  • cpp-apitests with api-integration-test/ → API integration test repo (JUnit 5 + REST Assured)

Step 3: Apply Repo-Specific Review Criteria

Context Services (Maven/CQRS)

  • Commands produce domain events (not direct state mutation)
  • Queries are read-only (no state changes in query handlers)
  • New viewstore entities have Liquibase migrations with rollback
  • Event handlers are idempotent
  • JSON schemas follow naming convention: {context}.{type}.{name}.json
  • RAML API definitions are updated for new/changed endpoints
  • Integration tests cover the new functionality
  • No domain logic in controllers or repositories (belongs in aggregates/handlers)
  • Framework interceptors not bypassed without justification

Modern by Default Services (Gradle/Spring Boot)

  • Constructor injection used (no @Autowired fields)
  • Java records used for DTOs and event payloads
  • @Operation and @ApiResponse on controller methods
  • RestClient used for outbound HTTP (not RestTemplate)
  • Structured logging with MDC context (correlationId, eventId)
  • E2E tests with WireMock for external service verification
  • SecurityConfig reviewed for appropriate access controls
  • Service Bus consumers handle poison messages gracefully

Angular UI Apps

  • Components follow govuk-frontend design patterns
  • State management uses ngrx (not component-level state for shared data)
  • Tests cover component behavior (not just template rendering)
  • No hardcoded API URLs (use environment configuration)
  • Accessibility: WCAG 2.1 AA compliance (aria labels, keyboard navigation)
  • Lazy loading for feature modules

Terraform Modules

  • Variables have descriptions and type constraints
  • Outputs documented
  • State is not stored locally
  • Sensitive values marked as sensitive = true
  • Tags applied consistently
  • Pre-commit hooks pass (format, validate, docs)

UI E2E Tests (cpp-ui-e2e-serenity)

  • Feature file in correct src/test/resources/features/<domain>/ folder
  • Step definitions extend the relevant page object (no duplicated locators)
  • New locators added to src/test/resources/locators/custom-locators.json (not hard-coded in Java)
  • No Thread.sleep — explicit waits only
  • Scenarios tagged for the intended pipeline profile (regression / BPO / migration / DLRM)
  • No PII, court refs, or real personal data in testdata/ or scenario examples
  • TestRunner glue covers any new step-def package
  • Steps annotated with @Step; cross-step state held in the Serenity session (no static fields)

API Integration Tests (cpp-apitests)

  • Test class name ends IT.java (Failsafe convention — *Test.java is silently skipped)
  • Extends the closest abstract base (AbstractTest / ApplicationsAbstractTest / AuditAbstractTest / AuthorizationAbstractTest)
  • Reuses existing helpers (JsonUtil, DbUtil, ApplicationUtil, RestAssuredFileUploadUtil, domain helpers) and builders rather than adding new ones
  • REST Assured given().when().then() with Hamcrest / AssertJ — no raw assertEquals on JSON paths
  • JSON fixtures under src/test/resources/<domain>/; no inline payload strings
  • No hard-coded bearer tokens, URLs, PII, or court refs
  • Assertions align with the producing service's RAML / OpenAPI contract — see api-contract-check

For authoring guidance in either test repo, see cpp-test-authoring.

Architecture Model (.c4)

  • Relationship titles read as natural language sentences (lowercase first letter)
  • Container-level relationships (not product-level when containers exist)
  • JEE microservices have [auth] and [audit] relationships
  • Technology metadata present on all components
  • Views updated for new elements
  • npm run build && npm run test passes

Step 4: Cross-Cutting Concerns

Always check regardless of repo type:

  • No secrets, API keys, or credentials in code
  • No hardcoded environment-specific values (use configuration)
  • Breaking changes to APIs are clearly documented
  • Changes are backward compatible (or migration path documented)
  • Test coverage is adequate for the change
  • Commit messages are meaningful

Step 5: Generate Review

## PR Review: [title]

### Summary
One paragraph describing what the PR does and whether it achieves its goal.

### Findings

#### Blocking
- [issue]: description and suggested fix

#### Suggestions
- [improvement]: description and rationale

#### Positive
- [what's good]: acknowledge well-done aspects

### Verdict
APPROVE / REQUEST CHANGES / NEEDS DISCUSSION

### Test Checklist
- [ ] Unit tests pass
- [ ] Integration tests pass (if applicable)
- [ ] Manual verification steps (if applicable)

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.