agentleFS
AgentShekelAgentShekel/agentic-workflow/skills/code-reviewing/SKILL.md

code-reviewing

Skill4 starsChanged 29 days agoMITView on GitHub

[METHODOLOGY] Code review standards across 11 review dimensions, process, quality gates. Preloaded by code-reviewer agent.

  • Reads credentials

6 other projects use a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

44 rules. 0 are common, 37 are distinctive, and 7 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 37

    Distinctive

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Verify layer separation and dependency direction

    line 21
  2. Distinctive:

    Check for architectural anti-patterns (circular dependencies, god objects, tight coupling)

    line 22
  3. Distinctive:

    Check for appropriate use of comments and documentation

    line 41
  4. Distinctive:

    Verify consistent code style and formatting

    line 43
  5. Very specific:

    No magic numbers: extract to named constants (MAX_UPLOAD_SIZE not 5242880)

    line 49
  6. Distinctive:

    Verify appropriate use of try-catch blocks

    line 54
  7. Distinctive:

    Check error messages clarity and actionability

    line 55
  8. Distinctive:

    Always use try-catch for operations that can fail (API calls, DB operations, file I/O)

    line 59
  9. Distinctive:

    Don't swallow errors: always re-throw after logging (unless explicitly handling)

    line 60
  10. Distinctive:

    Every log includes context: userId, action, resourceId (not just a bare message)

    line 67
  11. Distinctive:

    No secrets or PII in logs (passwords, tokens, API keys, emails, phone numbers)

    line 71
  12. Very specific:

    No empty catch blocks (catch (e) {} — silent error swallowing)

    line 72
  13. Distinctive:

    No logging inside tight loops (generates thousands of duplicate lines)

    line 73
  14. Very specific:

    Check for inappropriate use of any type (TypeScript) or equivalent loose typing

    line 90
  15. Distinctive:

    Verify null/undefined handling and optional chaining

    line 93
  16. Distinctive:

    Check for type assertions and their justification

    line 94
  17. Distinctive:

    Check for integration and E2E test needs

    line 101
  18. Distinctive:

    Verify mocking strategies and test isolation

    line 102
  19. Distinctive:

    Check for dependency version conflicts

    line 113
  20. Distinctive:

    Verify security vulnerabilities (outdated packages)

    line 115
  21. Distinctive:

    Verify imports exist before using: read source files to confirm exports match expected usage

    line 119
  22. Distinctive:

    Check function signatures: ensure signatures match how you're calling them

    line 120
  23. Distinctive:

    Prefer well-maintained packages: check npm/PyPI activity, security advisories

    line 121
  24. Distinctive:

    Check for security vulnerabilities (injection, XSS, CSRF)

    line 126
  25. Distinctive:

    Verify secrets management (no hardcoded credentials)

    line 127
  26. Distinctive:

    Check for sensitive data exposure

    line 130
  27. Very specific:

    Never hardcode secrets: use environment variables (.env) for all sensitive data

    line 133
  28. Distinctive:

    Always validate input: check types, formats, ranges before processing

    line 134
  29. Very specific:

    Add to .gitignore: .env, *.key, credentials.json, secrets/

    line 136
  30. Distinctive:

    Check for unnecessary re-renders (React) or recomputations

    line 142
  31. Distinctive:

    Avoid N+1 queries: use batch operations, eager loading, or caching

    line 147
  32. Distinctive:

    Use pagination for large datasets: don't load all records at once

    line 150
  33. Distinctive:

    When code CALLS a function from another file → Read that file, verify signature matches

    line 158
  34. Distinctive:

    When code USES a class/method → Read class definition, verify method exists and signature matches

    line 159
  35. Distinctive:

    When code IMPORTS something → Verify import path is correct

    line 160
  36. Distinctive:

    Import paths are valid

    line 165
  37. Distinctive:

    Import path broken (load failure)

    line 171
  38. Distinctive:

    Read the source files where functions/classes are defined to verify signatures match.

    line 173
  39. Distinctive:

    Check if heavy resources are created as singletons (one instance shared) or duplicated across files/components

    line 178
  40. Very specific:

    When code creates a heavy resource (new Model(), ModelClass(...), create_pool()): search the project for other instantiations of the same …

    line 179
  41. Distinctive:

    Verify resource lifecycle: who creates, who consumes, when disposed

    line 180
  42. Very specific:

    Check for resource leaks: opened connections/files/handles that are never closed

    line 181
  43. Distinctive:

    Consider project context and constraints from project documentation (if available)

    line 225
  44. Distinctive:

    Use technical precision appropriate for senior developers

    line 231

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

Comprehensive code review methodology for ensuring production-ready quality and maintainable architecture.

Review Dimensions

Perform systematic analysis across these 11 dimensions:

1. Architectural Patterns

  • Evaluate adherence to established architectural patterns (MVC, MVVM, Clean Architecture, etc.)
  • Assess design patterns usage (Factory, Strategy, Observer, etc.)
  • Verify layer separation and dependency direction
  • Check for architectural anti-patterns (circular dependencies, god objects, tight coupling)

2. Separation of Concerns

  • Validate single responsibility principle compliance
  • Examine module boundaries and cohesion
  • Review business logic vs presentation logic separation
  • Assess data layer abstraction and persistence logic isolation

Good practices:

  • One file = one responsibility (UserService in one file, PaymentService in another)
  • Functions < 50 lines; if larger, break into smaller functions
  • Maximum 3 levels of nesting; use early returns to reduce nesting
  • High-level modules should not depend on low-level details

3. Code Readability & Maintainability

  • Evaluate naming conventions (variables, functions, classes)
  • Assess code organization and file structure
  • Check for appropriate use of comments and documentation
  • Review complexity metrics (cyclomatic complexity, nesting depth)
  • Verify consistent code style and formatting

Good practices:

  • Meaningful comments focus on "why" rather than obvious "what"
  • DRY principle: extract repeated code into functions/modules
  • Readable > clever: clear code is better than short but cryptic code
  • No magic numbers: extract to named constants (MAX_UPLOAD_SIZE not 5242880)

4. Error Handling & Logging

  • Examine error propagation strategy
  • Verify appropriate use of try-catch blocks
  • Check error messages clarity and actionability
  • Assess graceful degradation and fallback mechanisms

Good practices (error handling):

  • Always use try-catch for operations that can fail (API calls, DB operations, file I/O)
  • Don't swallow errors: always re-throw after logging (unless explicitly handling)
  • Fail fast: validate inputs early; throw errors immediately when invalid
  • User-friendly errors: show generic message to users, log details internally

Logging review checklist:

  • Key operations have logs (external calls, auth events, state transitions, business operations)
  • Structured format used (JSON / logger library), not string concatenation or console.log
  • Every log includes context: userId, action, resourceId (not just a bare message)
  • Correlation/request ID propagated through call chain
  • Log levels used correctly (info for success, warn for recoverable, error for failures)
  • Error logs include stack traces
  • No secrets or PII in logs (passwords, tokens, API keys, emails, phone numbers)
  • No empty catch blocks (catch (e) {} — silent error swallowing)
  • No logging inside tight loops (generates thousands of duplicate lines)

Automatic severity mappings:

PatternSeverity
Secrets or PII logged (tokens, passwords, emails in plaintext)critical
Empty catch block — error swallowed without loggingmajor
External call (API, DB) without any loggingmajor
Missing correlation/request ID in service handling requestsminor
console.log / print used instead of structured loggerminor

5. Type Safety (TypeScript/typed languages)

For TypeScript or other typed codebases:

  • Validate type definitions completeness and accuracy
  • Check for inappropriate use of any type (TypeScript) or equivalent loose typing
  • Assess interface and type alias design
  • Review generic type usage and constraints
  • Verify null/undefined handling and optional chaining
  • Check for type assertions and their justification

6. Testing Coverage

  • Evaluate unit test presence and quality
  • Assess test coverage for critical paths
  • Review test organization and naming
  • Check for integration and E2E test needs
  • Verify mocking strategies and test isolation
  • Assess edge case and error scenario coverage

Good practices:

  • Tests needed for: business logic, validations, transforms, error handling
  • Tests not needed for: simple getters/setters, one-line configs, trivial updates
  • Rule: if mocking >3 dependencies → wrong test type, use integration test

7. Dependencies Management

  • Review new dependencies necessity and appropriateness
  • Check for dependency version conflicts
  • Assess bundle size impact
  • Verify security vulnerabilities (outdated packages)
  • Evaluate licensing compatibility

Good practices:

  • Verify imports exist before using: read source files to confirm exports match expected usage
  • Check function signatures: ensure signatures match how you're calling them
  • Prefer well-maintained packages: check npm/PyPI activity, security advisories
  • Pin major versions: use ^ (caret) for npm to allow patch updates

8. Security Considerations

  • Check for security vulnerabilities (injection, XSS, CSRF)
  • Verify secrets management (no hardcoded credentials)
  • Assess input validation and sanitization
  • Review authentication and authorization logic
  • Check for sensitive data exposure

Good practices:

  • Never hardcode secrets: use environment variables (.env) for all sensitive data
  • Always validate input: check types, formats, ranges before processing
  • Sanitize user data: before database operations, API calls, or displaying
  • Add to .gitignore: .env, *.key, credentials.json, secrets/

9. Performance Implications

  • Identify potential performance bottlenecks
  • Review algorithmic complexity
  • Check for unnecessary re-renders (React) or recomputations
  • Assess memory leak risks
  • Evaluate database query efficiency

Good practices:

  • Avoid N+1 queries: use batch operations, eager loading, or caching
  • Cache expensive computations: use memoization for functions
  • Prevent memory leaks: clean up event listeners, timers, subscriptions in cleanup functions
  • Use pagination for large datasets: don't load all records at once
  • Profile before optimizing: measure actual bottlenecks before making changes

10. Cross-File Consistency

For the code under review, verify correctness of function/class usage:

Process:

  1. When code CALLS a function from another file → Read that file, verify signature matches
  2. When code USES a class/method → Read class definition, verify method exists and signature matches
  3. When code IMPORTS something → Verify import path is correct

What to check:

  • Function called with correct arguments
  • Method exists on the class
  • Import paths are valid
  • Types match (if TypeScript)

Report as issue if:

  • Function called with wrong arguments (runtime crash)
  • Method doesn't exist (runtime crash)
  • Import path broken (load failure)

Read the source files where functions/classes are defined to verify signatures match.

11. Resource Management

  • Identify heavy resources: ML models, database connection pools, browser instances, API clients, large caches
  • Check if heavy resources are created as singletons (one instance shared) or duplicated across files/components
  • When code creates a heavy resource (new Model(), ModelClass(...), create_pool()): search the project for other instantiations of the same class
  • Verify resource lifecycle: who creates, who consumes, when disposed
  • Check for resource leaks: opened connections/files/handles that are never closed

Automatic severity mappings:

PatternSeverity
Same heavy resource class instantiated in multiple files without shared instancemajor
Heavy resource created inside a loop or per-request handlercritical
Resource opened but never closed (connection, file handle, cursor)major

Dimension Prioritization

Focus on dimensions based on code context:

ContextPrioritizeReason
Auth/login codeSecurity (8), Error Handling (4)Auth vulnerabilities are critical
User input handlingSecurity (8), Type Safety (5)Input validation prevents attacks
Database queriesSecurity (8), Performance (9)SQL injection, N+1 queries
New featureArchitecture (1), Testing (6)Foundation for future changes
RefactoringCross-File (10), Testing (6)Avoid breaking existing code
Performance fixPerformance (9), Dependencies (7)Target the actual bottleneck
Typed codebaseType Safety (5), Cross-File (10)Type errors cause runtime crashes
ML/AI pipelineResource Mgmt (11), Performance (9)Heavy models duplicated waste memory
Microservice initResource Mgmt (11), Architecture (1)Connection pools and clients should be shared

Review Process

  1. Initial Scan: Quick overview to understand scope and context
  2. Deep Analysis: Systematic review of each dimension listed above
  3. Cross-Reference: Compare implementation against userspec, techspec, and project standards
  4. Issue Categorization: Classify findings by severity:
    • critical → blocking issues that must be fixed
    • major → significant concerns that should be addressed
    • minor → improvements that are valuable but optional
  5. Recommendation Formulation: Provide specific, actionable suggestions

Quality Standards

Be thorough but pragmatic:

  • Focus on issues that materially impact code quality, security, or maintainability
  • Distinguish between critical problems and stylistic preferences
  • Provide constructive feedback with specific examples
  • Acknowledge good practices when present
  • Consider project context and constraints from project documentation (if available)
  • Balance idealism with practical delivery needs

Communication Style

  • Be direct and specific - avoid vague feedback
  • Use technical precision appropriate for senior developers
  • Provide code examples in recommendations when helpful
  • Explain the "why" behind each issue, not just the "what"
  • Maintain professional, respectful tone
  • Prioritize actionability over completeness

Goal: ensure production-ready code that is secure, maintainable, and aligned with project standards. Be thorough in analysis but efficient in communication.

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.