원클릭으로
automated-code-review
Comprehensive code review practices including checklists, automated tools, and effective feedback
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Comprehensive code review practices including checklists, automated tools, and effective feedback
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Write commit messages following the Conventional Commits format. Use when composing, reviewing, or fixing git commit messages.
Amazon Web Services CLI operations and infrastructure patterns for AWS resource management. Activate when user mentions: aws, AWS, Amazon Web Services, EC2, EKS, ECS, S3, RDS, Lambda, CloudFormation, CloudWatch, IAM roles, IAM policies, aws cli commands, AWS deployment, AWS infrastructure, ECR, ALB, NLB, VPC, Route53, DynamoDB, SQS, SNS, EventBridge, Systems Manager, Secrets Manager, CloudTrail, AWS Organizations. Use for: AWS resource provisioning, aws cli commands, AWS service configuration, infrastructure-as-code for AWS, AWS best practices, OIDC authentication, IAM roles for service accounts (IRSA), AWS security patterns, multi-region deployments, high availability configurations, cost optimization, disaster recovery, Spot instances. Do NOT use for: GCP-specific resources, Azure-specific resources, Kubernetes manifests (use kubernetes-native skill), generic shell scripting unrelated to AWS, Terraform/Pulumi DSL syntax (use terraform-modules or pulumi-cdk skills for IaC DSLs).
AWS EKS cluster provisioning, configuration best practices, security hardening, cost optimization, IRSA (IAM Roles for Service Accounts), VPC CNI networking, node group management, cluster addons, and Kubernetes 1.31+ features including Gateway API v1 and native sidecar containers. Activate when user mentions: AWS EKS, Elastic Kubernetes Service, EKS cluster, eksctl, EKS node groups, managed node groups, self-managed nodes, Fargate profiles, EKS addons, VPC CNI, CoreDNS, kube-proxy, EKS OIDC provider, IRSA, IAM roles for service accounts, EKS security groups, pod security groups, EKS encryption, KMS encryption, EKS logging, control plane logs, EKS access entries, EKS cluster autoscaler, Karpenter, Gateway API on EKS, AWS Load Balancer Controller, EBS CSI driver, EFS CSI driver. Use for: EKS cluster architecture design, Terraform/Pulumi EKS provisioning, security configuration, IRSA setup, VPC networking for EKS, node group optimization, spot instance integration, cluster addon management, multi-AZ high availa
Dockerfile best practices, multi-stage builds, security scanning patterns, CI/CD validation pipelines, and container optimization strategies. Activate when user mentions: Dockerfile, container image, multi-stage build, container security, image optimization, docker build, container layers, base image, distroless, alpine, scratch image, container scanning, vulnerability scanning, dockerfile lint, hadolint, trivy, security pipeline, SBOM generation, container validation, CI/CD security gates, image attestation. Use for: Dockerfile generation patterns, security hardening, build optimization, layer caching strategies, CI/CD security integration, vulnerability management, SBOM generation, policy-as-code validation. Do NOT use for: Runtime orchestration (use kubernetes-native skill), CI/CD pipelines (use github-actions-iac skill), infrastructure provisioning (use terraform-patterns skill).
Crossplane composition patterns for cloud-native infrastructure provisioning. Provides XRD (CompositeResourceDefinition), Composition, and Claim patterns for AWS, Azure, GCP resources with security best practices, validation pipelines, and hallucination detection for AI-generated compositions. Activate when user mentions: crossplane, XRD, composite resource, composition, claim, provider config, managed resources, crossplane composition, infrastructure composition, declarative infrastructure, control plane. Use for: Generating Crossplane compositions, XRDs, Claims, ProviderConfigs, and managed resource patterns following cloud-native best practices with multi-phase validation and cost optimization. Do NOT use for: Direct Terraform/Pulumi code, CloudFormation templates, Kubernetes operators (unless Crossplane-specific), raw cloud provider APIs.
GitHub Actions CI/CD pipeline patterns for IaC deployments. Provides secure workflow configurations with OIDC authentication, multi-environment deployment strategies, reusable workflow architectures, and infrastructure validation with modern security scanning tools. Activate when user mentions: GitHub Actions, CI/CD, workflow, pipeline, deployment, OIDC, GitHub workflow, actions workflow, CI pipeline, continuous deployment, automated deployment, workflow file, .github/workflows, reusable workflows Use for: Generating GitHub Actions workflows for Terraform, Kubernetes, Helm deployments with security best practices (OIDC, Trivy scanning, validation gates, reusable patterns). Do NOT use for: GitLab CI, Jenkins, CircleCI, or other CI/CD platforms. For those, recommend platform-specific tooling.
| title | Code Review Techniques |
| description | Comprehensive code review practices including checklists, automated tools, and effective feedback |
| tags | ["skill","code-review","quality","collaboration","best-practices"] |
| type | skill |
| version | 1.0.0 |
| category | collaboration |
This skill provides comprehensive code review techniques covering review checklists, automated tools, security review, performance analysis, and effective communication practices. Use this skill to conduct thorough, constructive code reviews that improve code quality and share knowledge across the team.
When to use this skill:
Primary Goals:
Secondary Benefits:
1. Formal Review (Pre-commit)
2. Pair Programming
3. Over-the-Shoulder Review
4. Tool-Assisted Review
## Functionality
- [ ] Code does what it's supposed to do
- [ ] Edge cases are handled
- [ ] Error conditions are handled appropriately
- [ ] No obvious bugs or logic errors
- [ ] Code handles concurrent access if applicable
## Design & Architecture
- [ ] Code follows existing patterns and conventions
- [ ] No unnecessary complexity
- [ ] Appropriate design patterns used
- [ ] Code is modular and reusable
- [ ] Dependencies are appropriate
- [ ] No circular dependencies
- [ ] Follows SOLID principles
## Code Quality
- [ ] Code is readable and self-documenting
- [ ] Functions are small and focused
- [ ] Variable and function names are descriptive
- [ ] No commented-out code
- [ ] No duplicate code (DRY principle)
- [ ] Magic numbers replaced with constants
- [ ] Consistent with team style guide
## Performance
- [ ] No obvious performance issues
- [ ] Algorithms have appropriate complexity
- [ ] Database queries are optimized (no N+1)
- [ ] Appropriate caching if needed
- [ ] No memory leaks
- [ ] Resources are properly closed
## Security
- [ ] No hardcoded secrets or credentials
- [ ] Input validation implemented
- [ ] SQL injection prevention (parameterized queries)
- [ ] XSS prevention (output encoding)
- [ ] CSRF tokens used appropriately
- [ ] Authentication and authorization checks
- [ ] Sensitive data is encrypted
- [ ] No exposure of sensitive information in logs
## Testing
- [ ] Adequate test coverage (>80% for new code)
- [ ] Tests are meaningful, not just coverage padding
- [ ] Edge cases are tested
- [ ] Error conditions are tested
- [ ] Tests are independent and isolated
- [ ] No flaky tests introduced
- [ ] Tests follow AAA pattern (Arrange, Act, Assert)
## Documentation
- [ ] Public APIs are documented
- [ ] Complex logic has explanatory comments
- [ ] README updated if needed
- [ ] API documentation updated (OpenAPI/Swagger)
- [ ] Changelog updated for user-facing changes
- [ ] Migration notes if database changes
## Dependencies
- [ ] New dependencies are justified
- [ ] Dependencies are up-to-date
- [ ] No vulnerable dependencies (check security audit)
- [ ] License compatibility verified
- [ ] Bundle size impact considered (frontend)
## Git & Process
- [ ] Commit messages are descriptive
- [ ] Commits are logical and atomic
- [ ] No merge conflicts
- [ ] Branch is up-to-date with main
- [ ] CI/CD pipeline passes
- [ ] Breaking changes are documented
# Example: GitHub PR Review Process
def review_pull_request(pr_number: int) -> ReviewResult:
"""
Comprehensive pull request review process.
Steps:
1. Understand the context (read PR description, linked issues)
2. Check automated checks (CI/CD, linting, tests)
3. Review code changes
4. Run code locally if needed
5. Provide feedback
6. Approve or request changes
"""
# Step 1: Context
pr = github.get_pull_request(pr_number)
issue = pr.linked_issue
print(f"Reviewing: {pr.title}")
print(f"Related issue: {issue.title if issue else 'None'}")
print(f"Description: {pr.description}")
# Step 2: Automated Checks
checks = pr.get_checks()
if not all(check.status == "success" for check in checks):
return ReviewResult(
status="CHANGES_REQUESTED",
comment="Please fix failing CI/CD checks before review."
)
# Step 3: Code Review
files_changed = pr.get_files()
comments = []
for file in files_changed:
# Check file-level concerns
if file.lines_changed > 500:
comments.append({
"file": file.name,
"comment": "⚠️ Large file change. Consider breaking into smaller PRs."
})
# Review specific changes
for change in file.changes:
# Check for common issues
if "TODO" in change.added_line:
comments.append({
"file": file.name,
"line": change.line_number,
"comment": "❓ TODO comment. Should this be done before merge?"
})
if "console.log" in change.added_line:
comments.append({
"file": file.name,
"line": change.line_number,
"comment": "🔍 Debug console.log left in code. Remove before merge."
})
if "password" in change.added_line.lower() and "=" in change.added_line:
comments.append({
"file": file.name,
"line": change.line_number,
"comment": "🚨 Potential hardcoded password. Use environment variable."
})
# Step 4: Local Testing (if needed)
if pr.affects_critical_path():
local_test_result = run_local_tests(pr.branch)
if not local_test_result.passed:
comments.append({
"general": True,
"comment": f"❌ Local testing failed: {local_test_result.error}"
})
# Step 5: Provide Feedback
return ReviewResult(
status="APPROVED" if len(comments) == 0 else "CHANGES_REQUESTED",
comments=comments,
summary=generate_review_summary(pr, comments)
)
❌ Poor Feedback:
"This is wrong."
"Bad code."
"Why did you do it this way?"
"This won't work."
✅ Good Feedback:
"Consider using a dictionary here instead of multiple if-else statements.
This would make the code more maintainable and easier to extend."
"This could potentially cause a race condition if two requests
come in simultaneously. Consider using a database lock or mutex.
Example: db.query(User).with_for_update().filter(...)"
"Great use of the factory pattern here! One suggestion: we could
extract the validation logic into a separate validator class to
make it more reusable. What do you think?"
"I noticed this query could have an N+1 problem with large datasets.
We might want to use eager loading here. Would you like me to show
you an example?"
# Use prefixes to indicate comment severity
# 🔴 Blocking (must fix)
"🔴 BLOCKING: This SQL query is vulnerable to injection attacks.
Please use parameterized queries instead."
# 🟡 Important (should fix)
"🟡 SUGGESTION: This function is doing too much. Consider splitting
into smaller, focused functions following Single Responsibility Principle."
# 🟢 Optional (nice to have)
"🟢 NIT: Minor style issue - we typically use const instead of let
when the variable isn't reassigned."
# 💡 Learning opportunity
"💡 FYI: You might find the functools.lru_cache decorator useful here
for memoization. Not necessary for this PR, but good to know!"
# ❓ Question (seeking clarification)
"❓ QUESTION: Why did we choose to use polling here instead of
websockets? Is there a specific requirement I'm missing?"
# ✅ Praise (positive reinforcement)
"✅ Nice! I really like how you handled the error cases here.
Very thorough!"
# .github/workflows/code-review.yml
name: Automated Code Review
on: [pull_request]
jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Linting
- name: Run ESLint
run: npm run lint
- name: Run Prettier
run: npm run format:check
# Type Checking
- name: TypeScript Check
run: npm run typecheck
# Security Scanning
- name: Run Semgrep
uses: returntocorp/semgrep-action@v1
- name: Dependency Security Audit
run: npm audit --audit-level=moderate
# Code Quality Metrics
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Test Coverage
- name: Run Tests with Coverage
run: npm run test:coverage
- name: Coverage Report
uses: codecov/codecov-action@v3
with:
files: ./coverage/coverage-final.json
fail_ci_if_error: true
verbose: true
# Size Impact Analysis
bundle-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Analyze Bundle Size
uses: andresz1/size-limit-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Before Reviewing:
During Review:
Don't:
Before Requesting Review:
During Review:
Don't:
Target Response Times:
Review SLA:
## Security Review Checklist
### Authentication & Authorization
- [ ] Proper authentication checks on all endpoints
- [ ] Authorization checks (user can only access their own data)
- [ ] Password hashing (bcrypt, Argon2)
- [ ] Secure session management
- [ ] JWT tokens properly validated
### Input Validation
- [ ] All user input is validated
- [ ] SQL injection prevention (parameterized queries)
- [ ] XSS prevention (output encoding)
- [ ] CSRF tokens for state-changing operations
- [ ] File upload validation (type, size, content)
### Data Protection
- [ ] Sensitive data encrypted at rest
- [ ] HTTPS enforced for all communications
- [ ] No secrets in code (use environment variables)
- [ ] PII handling follows regulations (GDPR, CCPA)
- [ ] Secure headers configured (HSTS, CSP, etc.)
### API Security
- [ ] Rate limiting implemented
- [ ] API authentication required
- [ ] CORS properly configured
- [ ] Appropriate HTTP methods used
- [ ] Sensitive data not in URL parameters
### Dependencies
- [ ] No known vulnerabilities (npm audit, Snyk)
- [ ] Dependencies from trusted sources
- [ ] Minimal dependency footprint
## Performance Review Checklist
### Database
- [ ] No N+1 query problems
- [ ] Appropriate indexes on queried columns
- [ ] Query complexity is acceptable (EXPLAIN ANALYZE)
- [ ] Connection pooling configured
- [ ] Transactions used appropriately
### Caching
- [ ] Appropriate caching strategy
- [ ] Cache invalidation logic correct
- [ ] Cache TTL configured appropriately
### Frontend
- [ ] Bundle size impact analyzed
- [ ] Images optimized
- [ ] Lazy loading for non-critical resources
- [ ] Unnecessary re-renders minimized (React)
- [ ] Web vitals considered (LCP, FID, CLS)
### API
- [ ] Pagination for large datasets
- [ ] Response size reasonable
- [ ] Appropriate HTTP caching headers
- [ ] No synchronous operations on critical path
### Algorithms
- [ ] Time complexity is acceptable
- [ ] Space complexity is acceptable
- [ ] No unnecessary loops or iterations
❌ "Change this to use async/await."
✅ "Have you considered using async/await here? It might make
the error handling clearer. Something like:
```javascript
async function fetchData() {
try {
const response = await fetch(url);
return await response.json();
} catch (error) {
logger.error('Failed to fetch', error);
throw error;
}
}
What do you think?"
### Pattern: Ask Questions
```markdown
❌ "This is inefficient."
✅ "I'm curious about the performance of this approach with large
datasets. Have we tested it with 10,000+ items? Would a Map data
structure be more efficient here for O(1) lookups?"
❌ "Don't use var."
✅ "We typically use 'const' or 'let' instead of 'var' to avoid
issues with function-scoped hoisting. 'const' is preferred when
the variable won't be reassigned.
Example:
const userEmail = 'user@example.com'; // Won't be reassigned
let counter = 0; // Will be reassigned
✅ "Love this! The error handling here is really comprehensive.
The specific error messages will make debugging much easier."
✅ "Great catch on the edge case with negative numbers. This
kind of defensive programming prevents a lot of bugs."
✅ "Nice refactoring! This is much more readable than the previous
version."
Version: 1.0.0 Last Updated: 2025-10-25 Maintainer: Conventions MCP License: MIT