agentleFS
aneja5aneja5/forge-skills/skills/code-review-and-quality/SKILL.md

code-review-and-quality

Skill3 starsChanged 7 months agoMITView on GitHub

Use when a task is complete and ready for review, when reviewing a PR, when validating an implementation against its contract, when checking quality before merging, or when a five-axis quality gate is needed before approving code.

45 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use constraint-driven-development, code-simplification and 9 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.
  • vinvcnSkill

    constraint-driven-development

    把一个项目的质量线确立为书面契约,并阻止 agent 悄悄降低它。通过访谈确定用户在意哪些维度,当用户心里没有数字时提供合理的默认阈值,把一切记录进 CONSTRAINTS.md,并盯住 diff 中质量线被削弱的迹象——新增的 @ts-ignore 或 eslint-disable 抑制注释、被跳过或删除的测试、被剥掉的断言、未实现的 stub、被调低的阈值。当没有任何质量线被写下来时使用;当用户说 "set up constraints" 或 "define our standards" 时;当用户希望把他们在意的维度——无障碍性、Web 性能、覆盖率——设置成被强制执行的约束时;当 agent 为了变绿不断静默检查或跳过测试时;当你需要一个覆盖率或性能阈值却不知道该选什么数字时;或者当 agent 写下的代码超出任何人会读的体量时。

    Also in 4 projects that use this

  • az9713Skill

    code-simplification

    Simplifies code for clarity. Use when refactoring code for clarity without changing behavior. Use when code works but is harder to read, maintain, or extend than it should be. Use when reviewing code that has accumulated unnecessary complexity.

    Also in 31 projects that use this

  • borhen68Skill

    observability-and-instrumentation

    Instruments code so production behavior is visible and diagnosable. Use when adding logging, metrics, tracing, or alerting. Use when shipping any feature that runs in production and you need evidence it works. Use when production issues are reported but you can't tell what happened from the available data.

    Also in 12 projects that use this

  • az9713Skill

    deprecation-and-migration

    Manages deprecation and migration. Use when removing old systems, APIs, or features. Use when migrating users from one implementation to another. Use when deciding whether to maintain or sunset existing code.

    Also in 19 projects that use this

  • mycelium-hqSkill

    doubt-driven-development

    Use when correctness matters more than speed: about to commit non-trivial code, make an architectural call under uncertainty, work in unfamiliar code, or assert what the compiler cannot check (''this is safe'', ''thread-safe'', ''this scales'', ''matches the spec''). Strongest on high-stakes surfaces (production deploys, security-sensitive logic, data migrations, irreversible operations) and when the user asks to sanity-check, red-team, double-check, or get a second opinion on a decision.

    Also in 18 projects that use this

  • galandoSkill

    source-driven-development

    Version-aware, source-driven development — fetch official docs before writing framework code

    Also in 21 projects that use this

The file

Files
SKILL.md

Code Review and Quality

Overview

Five-axis review: correctness, contract compliance, readability, security, performance. Each finding is categorized as Critical / Important / Suggestion. Contract compliance is the forge-specific axis — implementations must match .forge/contracts/ exactly.

When to Use

  • A task from .forge/tasks.yaml is marked done and needs review
  • A PR is ready for merge review
  • User asks to review a specific change or file

When NOT to Use

  • Code hasn't been tested yet — run tdd first
  • Looking for performance profiling — that's a separate investigation
  • Security audit with threat modeling — use security-auditor agent persona

Common Rationalizations

ThoughtReality
"It passes tests so it's correct"Tests don't prove correctness — they prove what was tested
"I'll leave style comments but not block"Style inconsistencies compound into readability debt
"The contract is close enough"Contracts exist precisely to prevent "close enough"
"Security issues are edge cases"Edge cases are where attackers operate
"We can optimize later"Performance regressions rarely get addressed later

Red Flags

  • Implementation ignores an error type defined in the contract
  • Function signature differs from contract's typed schema
  • Invariant in contract is not enforced in implementation
  • Input validation missing at module boundary (contract says it's not caller's job)
  • Magic numbers with no explanation
  • Error paths return 200 with error message in body

Five-Axis Review

Axis 1: Contract Compliance (forge-specific)

For each module touched, check against .forge/contracts/<module>.md:

  • Input types match contract schema exactly
  • Output types match contract schema exactly
  • Every error type in the contract is handled
  • Every invariant in the contract is enforced
  • "Not responsible for" items are not implemented here

Axis 2: Correctness

  • All acceptance criteria from the task are satisfied
  • Edge cases and error paths handled
  • No off-by-one, null deref, or race condition visible
  • Side effects are intentional and documented

Axis 3: Readability

  • Names describe what, not how
  • Complex logic has a comment explaining WHY (not WHAT)
  • No dead code or commented-out blocks
  • Function length: if it doesn't fit in one screen, it should be decomposed

Axis 4: Security

  • All user input validated before use
  • No SQL/command/HTML injection vectors
  • Secrets not logged, not in error messages
  • Authentication checked before authorization checked before business logic

Axis 5: Performance

  • No N+1 queries introduced
  • No synchronous blocking in async paths
  • No unbounded operations on user-controlled input size

Finding Format

[CRITICAL] Contract violation: UserService.create() returns `userId: string` per contract
           but implementation returns `id: number`. Callers will break at runtime.
           File: src/user/service.ts:47

[IMPORTANT] Missing error handling: `RateLimitError` is defined in AuthService contract
            but never caught — will surface as unhandled exception.
            File: src/auth/middleware.ts:23

[SUGGESTION] Variable name `d` on line 12 — consider `durationMs` for clarity.

Verification

  • All five axes reviewed
  • Contract compliance checked against .forge/contracts/ for each touched module
  • Every Critical finding listed (must be fixed before merge)
  • Every Important finding listed (should be fixed or explicitly deferred)
  • Findings cite file:line for each issue
  • Suggestions separated from required changes

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.