agentleFS
aws-solutions-library-samplesaws-solutions-library-samples/accelerated-intelligent-document-processing-on-aws/.claude/skills/code-review/SKILL.md

code-review

Skill329 starsChanged 6 days agoMIT-0View on GitHub

Use before committing or returning your own changes: the pre-submit self-review checklist (gates to run, Python, UI, infrastructure, security, tests, published commit text).

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use close-spec, design-with-images 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.
  • dzhngSkill

    close-spec

    When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).

    Also in 5 projects that use this

  • dzhngSkill

    design-with-images

    Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.

    Also in 5 projects that use this

  • PydanticSkill

    add-new-model

    Add support for a newly-released language or image generation model in pydantic-ai (e.g. openai:gpt-5.6, anthropic:claude-sonnet-5, openai:gpt-image-2). Use when a provider ships a new model id and you need to wire literals, profile flags, adapters, and tests to recognize it. Handles SDK-lag, gateway list conventions, capability probing, and direct image-model geometry. Also use when Anthropic, OpenAI or Google deprecates or retires a model, to update the deprecation tables.

    Also in 10 projects that use this

  • Microsoft AzureSkill

    azsdk-common-apiview-feedback-resolution

    Analyze and resolve APIView review feedback on Azure SDK PRs. **UTILITY SKILL**. USE FOR: APIView comments, API review feedback, SDK API surface changes. DO NOT USE FOR: general code review, non-APIView feedback. INVOKES: azure-sdk-mcp:azsdk_apiview_get_comments, azure-sdk-mcp:azsdk_customized_code_update, azure-sdk-mcp:azsdk_typespec_delegate_apiview_feedback, azure-sdk-mcp:azsdk_run_typespec_validation, azure-sdk-mcp:azsdk_package_generate_code.

    Also in 6 projects that use this

  • Microsoft AzureSkill

    azsdk-common-generate-sdk-locally

    Generate and finalize Azure SDKs locally from TypeSpec, including build, checks, tests, changelog, metadata, and version updates by default. WHEN: "generate SDK locally", "build SDK", "run SDK tests", "run CI checks", "validate package", "run checks", "update changelog", "fix SDK build errors", "resolve SDK generation errors", "customize TypeSpec", "rename SDK client", "rename SDK model", "hide operation from SDK", "fix analyzer errors", "resolve customization drift", "create subclient", "update metadata", "update version". INVOKES: azsdk_verify_setup, azsdk_package_generate_code, azsdk_package_build_code, azsdk_package_run_check, azsdk_package_run_tests, azsdk_customized_code_update, azsdk_package_update_changelog_content, azsdk_package_update_metadata, azsdk_package_update_version.

    Also in 6 projects that use this

  • +4 more from dzhng
  • +3 more from Azure

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 186 edited versions we read keep these.

  • 4

    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:

    Run these before every commit:

    line 9
  2. Distinctive:

    Every check above is about a test's *shape*.

    line 152
  3. Distinctive:

    unproven: when it stopped at "cited".

    line 192
  4. Distinctive:

    Treat both as published text.

    line 204

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

Code Review Checklist — GenAI IDP Accelerator

Pre-Submit Checks (REQUIRED)

Run these before every commit:

make lint               # Full lint (ruff + format + ARN + buildspec + UI + codegen)
make test               # All tests
make typecheck          # basedpyright

The SRT security scan runs in CI on every pull request and merge request, on both platforms, and fails on HIGH open findings, so read that check before merging rather than running the scan by default. Run it locally only when you need the answer before CI does — for example to fix a finding without a round trip, or on a branch whose merges do not wait for CI:

make srt-scan           # requires one-time `make srt-setup`; ~5–10 min
# or: make srt          # clean → setup → scan → optional interactive fix

Locally the scan exits 0 even with findings — read the OPEN HIGH PRIORITY SECURITY ISSUES table it prints (or .srt/issues.json), don't rely on the exit code. Fix real issues; for false positives use make srt-fix to suppress with a specific justification and commit the updated scripts/srt/issues.json. Or use the convenience command:

make commit             # lint + test + auto-generate commit message + push
make fastcommit         # fastlint (skip UI) + auto-commit + push

Python Backend Review

Style & Formatting

  • ruff check --fix passes clean
  • ruff format applied (double quotes, 88-char lines)
  • basedpyright passes (basic mode)
  • License header present: # Copyright Amazon.com, Inc. ... + # SPDX-License-Identifier: MIT-0

Lambda Functions

  • Handler is handler(event, context) in index.py
  • X-Ray tracing: patch_all() at module level
  • AWS clients initialized at module level (not inside handler)
  • Logging via logging.getLogger() with LOG_LEVEL env var
  • Type hints on function signatures
  • Explicit ClientError catches with exc_info=True
  • No hardcoded AWS account IDs or regions

DynamoDB Access

  • make check-filtered-scans passes — a filtered Scan must paginate (LastEvaluatedKey), because DynamoDB bounds Limit and the 1MB page by items examined, not items matching FilterExpression. An unpaginated one finds a match only when it lands in the examined window, so it breaks silently and later, as data grows (issue #599). Deliberate bounded samples need an inline # filtered-scan-ok: <reason>.
  • Project only the attributes you need (ProjectionExpression) on a scan used to locate a row — without it the page is spent reading whole item bodies, so far fewer rows are examined per call
  • A boto3 paginator for one service is NOT pagination for another; check that the paginator in view actually wraps this call

idp_common Library

  • New modules use lazy loading pattern (register in __init__.py.__getattr__)
  • Modular dependency groups updated if new deps added (pyproject.toml)
  • No direct imports from idp_sdk._core (use IDPClient)
  • Tests added mirroring module structure in tests/unit/

Frontend UI Review

Style & Formatting

  • ESLint passes (make ui-lint)
  • Prettier applied (140-char lines, single quotes, trailing commas)
  • TypeScript strict mode passes (npm run typecheck)

Component Standards

  • Arrow function components (not function declarations)
  • Cloudscape Design System components used (not Material UI, Ant Design, etc.)
  • ConsoleLogger for logging (not console.log in production code)
  • Context API for state (not Redux)
  • New hooks use kebab-case filenames (use-my-hook.ts)

GraphQL

  • If schema changed, make codegen run and committed
  • Generated files (src/graphql/generated/) not manually edited

Translations

  • New or edited text is a react-intl message with an id, defaultMessage and description, and make ui-i18n-extract was run
  • Its French is in the same change (make ui-i18n-todo, then make ui-i18n-ingest), or its stale entries were dropped (make ui-i18n-drop-stale); a new product term has its row in glossary.fr-CA.csv
  • The French meets the review criteria in ui-i18n.md, and make check-ui-i18n-catalog passes

Infrastructure Review

CloudFormation Templates

  • make check-arn-partitions passes — NO hardcoded arn:aws:
  • Service endpoints use ${AWS::URLSuffix} — NO hardcoded amazonaws.com
  • PermissionsBoundary conditional on all IAM roles
  • New IAM role or AWS service? → both docs/aws-services-and-roles.md AND iam-roles/cloudformation-management/ updated (see infrastructure.md)
  • Dedicated LogGroup per Lambda with KMS encryption
  • cfn-nag + checkov suppression metadata where needed (with justification)
  • make validate-buildspec passes
  • make terraform-check passes (it includes make terraform-scan-diff), and so does the terraform/translator suite in make test — the release's Terraform module is generated from these templates (see the "Terraform parity" checks in pr-review.md)
  • A renamed logical ID or nested stack of a stateful resource has a terraform/translator/renames.yaml entry; a changed create-only property of one comes with a note on how existing Terraform deployments upgrade
  • No custom-output edge: ... [stateful, UNHANDLED] in the translator's output; a new STABLE_CUSTOM_OUTPUTS entry states, from the handler's code, why its output does not change on Update

Security

  • No credentials, API keys, or secrets in code or templates
  • Fake AWS credentials in tests use the …EXAMPLE placeholder shape, and no 40-character literal sits in a file beside a key ID (testing-qa.md, "Fake credentials in fixtures")
  • No full JWT tokens logged in plaintext (Talos finding #10)
  • S3 access properly scoped (no wildcard resource ARNs without justification)
  • Input validation on all API endpoints
  • DOMPurify used for any HTML rendering in UI

Agent capability

Apply when the change touches a tool, an agent, a prompt, a model call, an MCP tool or client, a markdown renderer, the web UI content policy, or the grants of a role that runs a model.

  • I can say, from the code, what the model can read (its tools, and the credentials they run with), what document-derived or external text reaches it, and where its output can go
  • Where all three hold (untrusted text in, private data readable, an external channel out), each external channel is limited by code, not by a prompt instruction
  • scripts/tests/agent_capabilities.yaml is updated to match: new surfaces have an entry, changed reads/inputs/outputs are reflected, and every named control and test still exists (python3 -m pytest scripts/tests/test_agent_capabilities.py scripts/tests/test_analytics_role_grants.py)
  • A capability nothing limits yet is recorded as a finding in the manifest and in PENDING_CONTROL_FINDINGS, not left out

Documentation

  • New features documented in docs/
  • YAML frontmatter with title field
  • License header after frontmatter
  • CHANGELOG.md updated for user-facing changes
  • Cross-references to related docs where appropriate
  • Touches a surface Quick Start calls, or renames a page, navigation item or product term? → Quick Start still works, and its agent's prompt, docs/quick-start.md and its stories still match (see .claude/rules/quick-start.md)

Testing

  • Unit tests added (@pytest.mark.unit)
  • Tests use moto @mock_aws for AWS service mocking
  • Class-based test organization with setup_method
  • Test files mirror module structure in tests/unit/
  • Integration tests tagged with @pytest.mark.integration
  • Config library validation tests pass: make test-config-library

A green test says nothing until you have seen it red

Every check above is about a test's shape. None of them asks whether the assertion can fail, and a test written alongside the fix it covers is written to pass — so this is the part a passing suite cannot tell you, and the part only the author is placed to do. The procedure, with the __pycache__ staleness trap that makes a mutation silently lie about its own result, is in testing-qa.md.

  • For every line of non-test code this PR changes, mutate it and confirm a named test goes red. Then record the observed pre-fix value in the PR body — "4,189 bytes before, 7,792 after", not "verified". A number from the broken state is the one claim here that cannot be made up.
  • Re-run that after every later commit on the branch. A one-time verification does not survive iteration: a mutation check that passed, then a second commit that moved the code it was about, is how a gate came to read past the loop it existed to protect while its own test stayed green.
  • Assert the mechanism, not only the outcome. Where a change makes a code path take effect, assert the path — the outcome is usually reachable another way, and then the test passes on both. metadata["extraction_method"] == "agentic" is the model: without it every value assertion in that test held on the traditional path too. The same applies to a one-sided bound: "under the limit" was satisfied by a URL using 54% of its budget.
  • For a non-vacuity probe, check it fails for the right reason. Breaking everything often trips an assertion the defect would not have — a probe that failed every image build exited non-zero on the unfixed loop as well, because the last iteration failed too, and so certified a fix while measuring nothing.

What could this break outside the diff?

The tests above cover the code you changed. They say nothing about a consumer the diff does not show: a UI field reading a renamed key, a nested stack consuming a parameter, a stored config or DynamoDB record written by the old version, another language parsing the same JSON.

  • Write down the one fact your change is safe because of, and take it as far as is cheap down the ladder in pr-review.md: asserted, cited, walked, run, reproduced. For a change you are not sure of, "run" is one small script that imports the real code and fails loudly if the fact is false. Put the fact and its level in the PR body; say unproven when it stopped at "cited".

Git Workflow

  • Branch from develop using prefix: feature/, fix/, docs/
  • Focused, single-issue changes
  • Version bump if needed: make version V=x.y.z (PEP 440 compliant)

Commit messages and PR descriptions are public and permanent

This repository is public, and a commit message cannot be edited once merged. A force-push does not remove it either: GitHub keeps a merged PR's own commits and diff view independently of any branch, so the only remedy is a support request. Treat both as published text.

  • No internal-only references: corporate email addresses, hostnames that resolve only on the internal network, internal review or ticket ids. A PreToolUse hook (scripts/hooks/check_commit_text.py) blocks the common cases; if it fires, fix the text rather than working around it.
  • No CI-suppressing directive ([skip ci] and its four siblings). Both platforms honour them natively, so one in a head commit runs no gate on either, and with no required status check the pull request shows nothing rather than red. The same hook refuses it; ALLOW_SKIP_CI=1 is the override if you mean it, and scripts/tests/test_no_skip_ci_markers.py reports one that reached history anyway.
  • Written at summary altitude: what the change accomplishes and why, not an inventory of the individual strings it touched. "Trim the governance docs to community-facing guidance" is the right altitude; the line-by-line detail belongs in the diff, where it stays accurate.
  • No third-party or personal information published on someone else's behalf: contributor names, contribution metrics or rankings, individual repository permissions.
  • Exploitable security findings go through the private channel in SECURITY.md, not into a commit message, roadmap entry or changelog line.
  • Facts that rot are dated or omitted: live permission tables, "as of today" counts and in-flight PR states are stale within a week.

The blast-radius check is adapted from the blast-radius skill in pstack (MIT licence).

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.