[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70G7SC89T3ESFFK3F41ZNXR":3,"skill-same:01M70G7SC89T3ESFFK3F41ZNXR":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":54,"commitSha":55,"skillDirectory":56,"forksCount":57,"repositoryHtmlUrl":58,"repositoryHomepageUrl":59,"ownerHtmlUrl":60,"ownerBlogUrl":61,"ownerDescription":62,"updatedAt":63,"install":64,"resources":77},"01M70G7SC89T3ESFFK3F41ZNXR","code-review-excellence",null,"Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use when reviewing pull requests, establishing review standards, or mentoring developers.","shengdabai\u002FTony-Claude-Code-Skills","shengdabai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F116417419?v=4","01M70F6D2WY5PQV5A92BKYJQEW","Tony Sheng","01M70F6D3GAAAYZ5H4CC1G8VXM",3,"MIT","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002F_collections\u002Fplugins\u002Fdeveloper-essentials\u002Fskills\u002Fcode-review-excellence\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"code review excellence","code","review","code review","knowledge sharing","reviewing pull requests","sharing","requests","review standards","use","bugs","feedback","pull","standards","master","catch","pull requests","team","when","knowledge","2026-11-10 10:12:30",false,"---\nname: code-review-excellence\ndescription: Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use when reviewing pull requests, establishing review standards, or mentoring developers.\n---\n\n# Code Review Excellence\n\nTransform code reviews from gatekeeping to knowledge sharing through constructive feedback, systematic analysis, and collaborative improvement.\n\n## When to Use This Skill\n\n- Reviewing pull requests and code changes\n- Establishing code review standards for teams\n- Mentoring junior developers through reviews\n- Conducting architecture reviews\n- Creating review checklists and guidelines\n- Improving team collaboration\n- Reducing code review cycle time\n- Maintaining code quality standards\n\n## Core Principles\n\n### 1. The Review Mindset\n\n**Goals of Code Review:**\n- Catch bugs and edge cases\n- Ensure code maintainability\n- Share knowledge across team\n- Enforce coding standards\n- Improve design and architecture\n- Build team culture\n\n**Not the Goals:**\n- Show off knowledge\n- Nitpick formatting (use linters)\n- Block progress unnecessarily\n- Rewrite to your preference\n\n### 2. Effective Feedback\n\n**Good Feedback is:**\n- Specific and actionable\n- Educational, not judgmental\n- Focused on the code, not the person\n- Balanced (praise good work too)\n- Prioritized (critical vs nice-to-have)\n\n```markdown\n❌ Bad: \"This is wrong.\"\n✅ Good: \"This could cause a race condition when multiple users\n         access simultaneously. Consider using a mutex here.\"\n\n❌ Bad: \"Why didn't you use X pattern?\"\n✅ Good: \"Have you considered the Repository pattern? It would\n         make this easier to test. Here's an example: [link]\"\n\n❌ Bad: \"Rename this variable.\"\n✅ Good: \"[nit] Consider `userCount` instead of `uc` for\n         clarity. Not blocking if you prefer to keep it.\"\n```\n\n### 3. Review Scope\n\n**What to Review:**\n- Logic correctness and edge cases\n- Security vulnerabilities\n- Performance implications\n- Test coverage and quality\n- Error handling\n- Documentation and comments\n- API design and naming\n- Architectural fit\n\n**What Not to Review Manually:**\n- Code formatting (use Prettier, Black, etc.)\n- Import organization\n- Linting violations\n- Simple typos\n\n## Review Process\n\n### Phase 1: Context Gathering (2-3 minutes)\n\n```markdown\nBefore diving into code, understand:\n\n1. Read PR description and linked issue\n2. Check PR size (>400 lines? Ask to split)\n3. Review CI\u002FCD status (tests passing?)\n4. Understand the business requirement\n5. Note any relevant architectural decisions\n```\n\n### Phase 2: High-Level Review (5-10 minutes)\n\n```markdown\n1. **Architecture & Design**\n   - Does the solution fit the problem?\n   - Are there simpler approaches?\n   - Is it consistent with existing patterns?\n   - Will it scale?\n\n2. **File Organization**\n   - Are new files in the right places?\n   - Is code grouped logically?\n   - Are there duplicate files?\n\n3. **Testing Strategy**\n   - Are there tests?\n   - Do tests cover edge cases?\n   - Are tests readable?\n```\n\n### Phase 3: Line-by-Line Review (10-20 minutes)\n\n```markdown\nFor each file:\n\n1. **Logic & Correctness**\n   - Edge cases handled?\n   - Off-by-one errors?\n   - Null\u002Fundefined checks?\n   - Race conditions?\n\n2. **Security**\n   - Input validation?\n   - SQL injection risks?\n   - XSS vulnerabilities?\n   - Sensitive data exposure?\n\n3. **Performance**\n   - N+1 queries?\n   - Unnecessary loops?\n   - Memory leaks?\n   - Blocking operations?\n\n4. **Maintainability**\n   - Clear variable names?\n   - Functions doing one thing?\n   - Complex code commented?\n   - Magic numbers extracted?\n```\n\n### Phase 4: Summary & Decision (2-3 minutes)\n\n```markdown\n1. Summarize key concerns\n2. Highlight what you liked\n3. Make clear decision:\n   - ✅ Approve\n   - 💬 Comment (minor suggestions)\n   - 🔄 Request Changes (must address)\n4. Offer to pair if complex\n```\n\n## Review Techniques\n\n### Technique 1: The Checklist Method\n\n```markdown\n## Security Checklist\n- [ ] User input validated and sanitized\n- [ ] SQL queries use parameterization\n- [ ] Authentication\u002Fauthorization checked\n- [ ] Secrets not hardcoded\n- [ ] Error messages don't leak info\n\n## Performance Checklist\n- [ ] No N+1 queries\n- [ ] Database queries indexed\n- [ ] Large lists paginated\n- [ ] Expensive operations cached\n- [ ] No blocking I\u002FO in hot paths\n\n## Testing Checklist\n- [ ] Happy path tested\n- [ ] Edge cases covered\n- [ ] Error cases tested\n- [ ] Test names are descriptive\n- [ ] Tests are deterministic\n```\n\n### Technique 2: The Question Approach\n\nInstead of stating problems, ask questions to encourage thinking:\n\n```markdown\n❌ \"This will fail if the list is empty.\"\n✅ \"What happens if `items` is an empty array?\"\n\n❌ \"You need error handling here.\"\n✅ \"How should this behave if the API call fails?\"\n\n❌ \"This is inefficient.\"\n✅ \"I see this loops through all users. Have we considered\n    the performance impact with 100k users?\"\n```\n\n### Technique 3: Suggest, Don't Command\n\n```markdown\n## Use Collaborative Language\n\n❌ \"You must change this to use async\u002Fawait\"\n✅ \"Suggestion: async\u002Fawait might make this more readable:\n    ```typescript\n    async function fetchUser(id: string) {\n        const user = await db.query('SELECT * FROM users WHERE id = ?', id);\n        return user;\n    }\n    ```\n    What do you think?\"\n\n❌ \"Extract this into a function\"\n✅ \"This logic appears in 3 places. Would it make sense to\n    extract it into a shared utility function?\"\n```\n\n### Technique 4: Differentiate Severity\n\n```markdown\nUse labels to indicate priority:\n\n🔴 [blocking] - Must fix before merge\n🟡 [important] - Should fix, discuss if disagree\n🟢 [nit] - Nice to have, not blocking\n💡 [suggestion] - Alternative approach to consider\n📚 [learning] - Educational comment, no action needed\n🎉 [praise] - Good work, keep it up!\n\nExample:\n\"🔴 [blocking] This SQL query is vulnerable to injection.\n Please use parameterized queries.\"\n\n\"🟢 [nit] Consider renaming `data` to `userData` for clarity.\"\n\n\"🎉 [praise] Excellent test coverage! This will catch edge cases.\"\n```\n\n## Language-Specific Patterns\n\n### Python Code Review\n\n```python\n# Check for Python-specific issues\n\n# ❌ Mutable default arguments\ndef add_item(item, items=[]):  # Bug! Shared across calls\n    items.append(item)\n    return items\n\n# ✅ Use None as default\ndef add_item(item, items=None):\n    if items is None:\n        items = []\n    items.append(item)\n    return items\n\n# ❌ Catching too broad\ntry:\n    result = risky_operation()\nexcept:  # Catches everything, even KeyboardInterrupt!\n    pass\n\n# ✅ Catch specific exceptions\ntry:\n    result = risky_operation()\nexcept ValueError as e:\n    logger.error(f\"Invalid value: {e}\")\n    raise\n\n# ❌ Using mutable class attributes\nclass User:\n    permissions = []  # Shared across all instances!\n\n# ✅ Initialize in __init__\nclass User:\n    def __init__(self):\n        self.permissions = []\n```\n\n### TypeScript\u002FJavaScript Code Review\n\n```typescript\n\u002F\u002F Check for TypeScript-specific issues\n\n\u002F\u002F ❌ Using any defeats type safety\nfunction processData(data: any) {  \u002F\u002F Avoid any\n    return data.value;\n}\n\n\u002F\u002F ✅ Use proper types\ninterface DataPayload {\n    value: string;\n}\nfunction processData(data: DataPayload) {\n    return data.value;\n}\n\n\u002F\u002F ❌ Not handling async errors\nasync function fetchUser(id: string) {\n    const response = await fetch(`\u002Fapi\u002Fusers\u002F${id}`);\n    return response.json();  \u002F\u002F What if network fails?\n}\n\n\u002F\u002F ✅ Handle errors properly\nasync function fetchUser(id: string): Promise\u003CUser> {\n    try {\n        const response = await fetch(`\u002Fapi\u002Fusers\u002F${id}`);\n        if (!response.ok) {\n            throw new Error(`HTTP ${response.status}`);\n        }\n        return await response.json();\n    } catch (error) {\n        console.error('Failed to fetch user:', error);\n        throw error;\n    }\n}\n\n\u002F\u002F ❌ Mutation of props\nfunction UserProfile({ user }: Props) {\n    user.lastViewed = new Date();  \u002F\u002F Mutating prop!\n    return \u003Cdiv>{user.name}\u003C\u002Fdiv>;\n}\n\n\u002F\u002F ✅ Don't mutate props\nfunction UserProfile({ user, onView }: Props) {\n    useEffect(() => {\n        onView(user.id);  \u002F\u002F Notify parent to update\n    }, [user.id]);\n    return \u003Cdiv>{user.name}\u003C\u002Fdiv>;\n}\n```\n\n## Advanced Review Patterns\n\n### Pattern 1: Architectural Review\n\n```markdown\nWhen reviewing significant changes:\n\n1. **Design Document First**\n   - For large features, request design doc before code\n   - Review design with team before implementation\n   - Agree on approach to avoid rework\n\n2. **Review in Stages**\n   - First PR: Core abstractions and interfaces\n   - Second PR: Implementation\n   - Third PR: Integration and tests\n   - Easier to review, faster to iterate\n\n3. **Consider Alternatives**\n   - \"Have we considered using [pattern\u002Flibrary]?\"\n   - \"What's the tradeoff vs. the simpler approach?\"\n   - \"How will this evolve as requirements change?\"\n```\n\n### Pattern 2: Test Quality Review\n\n```typescript\n\u002F\u002F ❌ Poor test: Implementation detail testing\ntest('increments counter variable', () => {\n    const component = render(\u003CCounter \u002F>);\n    const button = component.getByRole('button');\n    fireEvent.click(button);\n    expect(component.state.counter).toBe(1);  \u002F\u002F Testing internal state\n});\n\n\u002F\u002F ✅ Good test: Behavior testing\ntest('displays incremented count when clicked', () => {\n    render(\u003CCounter \u002F>);\n    const button = screen.getByRole('button', { name: \u002Fincrement\u002Fi });\n    fireEvent.click(button);\n    expect(screen.getByText('Count: 1')).toBeInTheDocument();\n});\n\n\u002F\u002F Review questions for tests:\n\u002F\u002F - Do tests describe behavior, not implementation?\n\u002F\u002F - Are test names clear and descriptive?\n\u002F\u002F - Do tests cover edge cases?\n\u002F\u002F - Are tests independent (no shared state)?\n\u002F\u002F - Can tests run in any order?\n```\n\n### Pattern 3: Security Review\n\n```markdown\n## Security Review Checklist\n\n### Authentication & Authorization\n- [ ] Is authentication required where needed?\n- [ ] Are authorization checks before every action?\n- [ ] Is JWT validation proper (signature, expiry)?\n- [ ] Are API keys\u002Fsecrets properly secured?\n\n### Input Validation\n- [ ] All user inputs validated?\n- [ ] File uploads restricted (size, type)?\n- [ ] SQL queries parameterized?\n- [ ] XSS protection (escape output)?\n\n### Data Protection\n- [ ] Passwords hashed (bcrypt\u002Fargon2)?\n- [ ] Sensitive data encrypted at rest?\n- [ ] HTTPS enforced for sensitive data?\n- [ ] PII handled according to regulations?\n\n### Common Vulnerabilities\n- [ ] No eval() or similar dynamic execution?\n- [ ] No hardcoded secrets?\n- [ ] CSRF protection for state-changing operations?\n- [ ] Rate limiting on public endpoints?\n```\n\n## Giving Difficult Feedback\n\n### Pattern: The Sandwich Method (Modified)\n\n```markdown\nTraditional: Praise + Criticism + Praise (feels fake)\n\nBetter: Context + Specific Issue + Helpful Solution\n\nExample:\n\"I noticed the payment processing logic is inline in the\ncontroller. This makes it harder to test and reuse.\n\n[Specific Issue]\nThe calculateTotal() function mixes tax calculation,\ndiscount logic, and database queries, making it difficult\nto unit test and reason about.\n\n[Helpful Solution]\nCould we extract this into a PaymentService class? That\nwould make it testable and reusable. I can pair with you\non this if helpful.\"\n```\n\n### Handling Disagreements\n\n```markdown\nWhen author disagrees with your feedback:\n\n1. **Seek to Understand**\n   \"Help me understand your approach. What led you to\n    choose this pattern?\"\n\n2. **Acknowledge Valid Points**\n   \"That's a good point about X. I hadn't considered that.\"\n\n3. **Provide Data**\n   \"I'm concerned about performance. Can we add a benchmark\n    to validate the approach?\"\n\n4. **Escalate if Needed**\n   \"Let's get [architect\u002Fsenior dev] to weigh in on this.\"\n\n5. **Know When to Let Go**\n   If it's working and not a critical issue, approve it.\n   Perfection is the enemy of progress.\n```\n\n## Best Practices\n\n1. **Review Promptly**: Within 24 hours, ideally same day\n2. **Limit PR Size**: 200-400 lines max for effective review\n3. **Review in Time Blocks**: 60 minutes max, take breaks\n4. **Use Review Tools**: GitHub, GitLab, or dedicated tools\n5. **Automate What You Can**: Linters, formatters, security scans\n6. **Build Rapport**: Emoji, praise, and empathy matter\n7. **Be Available**: Offer to pair on complex issues\n8. **Learn from Others**: Review others' review comments\n\n## Common Pitfalls\n\n- **Perfectionism**: Blocking PRs for minor style preferences\n- **Scope Creep**: \"While you're at it, can you also...\"\n- **Inconsistency**: Different standards for different people\n- **Delayed Reviews**: Letting PRs sit for days\n- **Ghosting**: Requesting changes then disappearing\n- **Rubber Stamping**: Approving without actually reviewing\n- **Bike Shedding**: Debating trivial details extensively\n\n## Templates\n\n### PR Review Comment Template\n\n```markdown\n## Summary\n[Brief overview of what was reviewed]\n\n## Strengths\n- [What was done well]\n- [Good patterns or approaches]\n\n## Required Changes\n🔴 [Blocking issue 1]\n🔴 [Blocking issue 2]\n\n## Suggestions\n💡 [Improvement 1]\n💡 [Improvement 2]\n\n## Questions\n❓ [Clarification needed on X]\n❓ [Alternative approach consideration]\n\n## Verdict\n✅ Approve after addressing required changes\n```\n\n## Resources\n\n- **references\u002Fcode-review-best-practices.md**: Comprehensive review guidelines\n- **references\u002Fcommon-bugs-checklist.md**: Language-specific bugs to watch for\n- **references\u002Fsecurity-review-guide.md**: Security-focused review checklist\n- **assets\u002Fpr-review-template.md**: Standard review comment template\n- **assets\u002Freview-checklist.md**: Quick reference checklist\n- **scripts\u002Fpr-analyzer.py**: Analyze PR complexity and suggest reviewers\n","# Code Review Excellence\n\nTransform code reviews from gatekeeping to knowledge sharing through constructive feedback, systematic analysis, and collaborative improvement.\n\n## When to Use This Skill\n\n- Reviewing pull requests and code changes\n- Establishing code review standards for teams\n- Mentoring junior developers through reviews\n- Conducting architecture reviews\n- Creating review checklists and guidelines\n- Improving team collaboration\n- Reducing code review cycle time\n- Maintaining code quality standards\n\n## Core Principles\n\n### 1. The Review Mindset\n\n**Goals of Code Review:**\n- Catch bugs and edge cases\n- Ensure code maintainability\n- Share knowledge across team\n- Enforce coding standards\n- Improve design and architecture\n- Build team culture\n\n**Not the Goals:**\n- Show off knowledge\n- Nitpick formatting (use linters)\n- Block progress unnecessarily\n- Rewrite to your preference\n\n### 2. Effective Feedback\n\n**Good Feedback is:**\n- Specific and actionable\n- Educational, not judgmental\n- Focused on the code, not the person\n- Balanced (praise good work too)\n- Prioritized (critical vs nice-to-have)\n\n```markdown\n❌ Bad: \"This is wrong.\"\n✅ Good: \"This could cause a race condition when multiple users\n         access simultaneously. Consider using a mutex here.\"\n\n❌ Bad: \"Why didn't you use X pattern?\"\n✅ Good: \"Have you considered the Repository pattern? It would\n         make this easier to test. Here's an example: [link]\"\n\n❌ Bad: \"Rename this variable.\"\n✅ Good: \"[nit] Consider `userCount` instead of `uc` for\n         clarity. Not blocking if you prefer to keep it.\"\n```\n\n### 3. Review Scope\n\n**What to Review:**\n- Logic correctness and edge cases\n- Security vulnerabilities\n- Performance implications\n- Test coverage and quality\n- Error handling\n- Documentation and comments\n- API design and naming\n- Architectural fit\n\n**What Not to Review Manually:**\n- Code formatting (use Prettier, Black, etc.)\n- Import organization\n- Linting violations\n- Simple typos\n\n## Review Process\n\n### Phase 1: Context Gathering (2-3 minutes)\n\n```markdown\nBefore diving into code, understand:\n\n1. Read PR description and linked issue\n2. Check PR size (>400 lines? Ask to split)\n3. Review CI\u002FCD status (tests passing?)\n4. Understand the business requirement\n5. Note any relevant architectural decisions\n```\n\n### Phase 2: High-Level Review (5-10 minutes)\n\n```markdown\n1. **Architecture & Design**\n   - Does the solution fit the problem?\n   - Are there simpler approaches?\n   - Is it consistent with existing patterns?\n   - Will it scale?\n\n2. **File Organization**\n   - Are new files in the right places?\n   - Is code grouped logically?\n   - Are there duplicate files?\n\n3. **Testing Strategy**\n   - Are there tests?\n   - Do tests cover edge cases?\n   - Are tests readable?\n```\n\n### Phase 3: Line-by-Line Review (10-20 minutes)\n\n```markdown\nFor each file:\n\n1. **Logic & Correctness**\n   - Edge cases handled?\n   - Off-by-one errors?\n   - Null\u002Fundefined checks?\n   - Race conditions?\n\n2. **Security**\n   - Input validation?\n   - SQL injection risks?\n   - XSS vulnerabilities?\n   - Sensitive data exposure?\n\n3. **Performance**\n   - N+1 queries?\n   - Unnecessary loops?\n   - Memory leaks?\n   - Blocking operations?\n\n4. **Maintainability**\n   - Clear variable names?\n   - Functions doing one thing?\n   - Complex code commented?\n   - Magic numbers extracted?\n```\n\n### Phase 4: Summary & Decision (2-3 minutes)\n\n```markdown\n1. Summarize key concerns\n2. Highlight what you liked\n3. Make clear decision:\n   - ✅ Approve\n   - 💬 Comment (minor suggestions)\n   - 🔄 Request Changes (must address)\n4. Offer to pair if complex\n```\n\n## Review Techniques\n\n### Technique 1: The Checklist Method\n\n```markdown\n## Security Checklist\n- [ ] User input validated and sanitized\n- [ ] SQL queries use parameterization\n- [ ] Authentication\u002Fauthorization checked\n- [ ] Secrets not hardcoded\n- [ ] Error messages don't leak info\n\n## Performance Checklist\n- [ ] No N+1 queries\n- [ ] Database queries indexed\n- [ ] Large lists paginated\n- [ ] Expensive operations cached\n- [ ] No blocking I\u002FO in hot paths\n\n## Testing Checklist\n- [ ] Happy path tested\n- [ ] Edge cases covered\n- [ ] Error cases tested\n- [ ] Test names are descriptive\n- [ ] Tests are deterministic\n```\n\n### Technique 2: The Question Approach\n\nInstead of stating problems, ask questions to encourage thinking:\n\n```markdown\n❌ \"This will fail if the list is empty.\"\n✅ \"What happens if `items` is an empty array?\"\n\n❌ \"You need error handling here.\"\n✅ \"How should this behave if the API call fails?\"\n\n❌ \"This is inefficient.\"\n✅ \"I see this loops through all users. Have we considered\n    the performance impact with 100k users?\"\n```\n\n### Technique 3: Suggest, Don't Command\n\n```markdown\n## Use Collaborative Language\n\n❌ \"You must change this to use async\u002Fawait\"\n✅ \"Suggestion: async\u002Fawait might make this more readable:\n    ```typescript\n    async function fetchUser(id: string) {\n        const user = await db.query('SELECT * FROM users WHERE id = ?', id);\n        return user;\n    }\n    ```\n    What do you think?\"\n\n❌ \"Extract this into a function\"\n✅ \"This logic appears in 3 places. Would it make sense to\n    extract it into a shared utility function?\"\n```\n\n### Technique 4: Differentiate Severity\n\n```markdown\nUse labels to indicate priority:\n\n🔴 [blocking] - Must fix before merge\n🟡 [important] - Should fix, discuss if disagree\n🟢 [nit] - Nice to have, not blocking\n💡 [suggestion] - Alternative approach to consider\n📚 [learning] - Educational comment, no action needed\n🎉 [praise] - Good work, keep it up!\n\nExample:\n\"🔴 [blocking] This SQL query is vulnerable to injection.\n Please use parameterized queries.\"\n\n\"🟢 [nit] Consider renaming `data` to `userData` for clarity.\"\n\n\"🎉 [praise] Excellent test coverage! This will catch edge cases.\"\n```\n\n## Language-Specific Patterns\n\n### Python Code Review\n\n```python\n# Check for Python-specific issues\n\n# ❌ Mutable default arguments\ndef add_item(item, items=[]):  # Bug! Shared across calls\n    items.append(item)\n    return items\n\n# ✅ Use None as default\ndef add_item(item, items=None):\n    if items is None:\n        items = []\n    items.append(item)\n    return items\n\n# ❌ Catching too broad\ntry:\n    result = risky_operation()\nexcept:  # Catches everything, even KeyboardInterrupt!\n    pass\n\n# ✅ Catch specific exceptions\ntry:\n    result = risky_operation()\nexcept ValueError as e:\n    logger.error(f\"Invalid value: {e}\")\n    raise\n\n# ❌ Using mutable class attributes\nclass User:\n    permissions = []  # Shared across all instances!\n\n# ✅ Initialize in __init__\nclass User:\n    def __init__(self):\n        self.permissions = []\n```\n\n### TypeScript\u002FJavaScript Code Review\n\n```typescript\n\u002F\u002F Check for TypeScript-specific issues\n\n\u002F\u002F ❌ Using any defeats type safety\nfunction processData(data: any) {  \u002F\u002F Avoid any\n    return data.value;\n}\n\n\u002F\u002F ✅ Use proper types\ninterface DataPayload {\n    value: string;\n}\nfunction processData(data: DataPayload) {\n    return data.value;\n}\n\n\u002F\u002F ❌ Not handling async errors\nasync function fetchUser(id: string) {\n    const response = await fetch(`\u002Fapi\u002Fusers\u002F${id}`);\n    return response.json();  \u002F\u002F What if network fails?\n}\n\n\u002F\u002F ✅ Handle errors properly\nasync function fetchUser(id: string): Promise\u003CUser> {\n    try {\n        const response = await fetch(`\u002Fapi\u002Fusers\u002F${id}`);\n        if (!response.ok) {\n            throw new Error(`HTTP ${response.status}`);\n        }\n        return await response.json();\n    } catch (error) {\n        console.error('Failed to fetch user:', error);\n        throw error;\n    }\n}\n\n\u002F\u002F ❌ Mutation of props\nfunction UserProfile({ user }: Props) {\n    user.lastViewed = new Date();  \u002F\u002F Mutating prop!\n    return \u003Cdiv>{user.name}\u003C\u002Fdiv>;\n}\n\n\u002F\u002F ✅ Don't mutate props\nfunction UserProfile({ user, onView }: Props) {\n    useEffect(() => {\n        onView(user.id);  \u002F\u002F Notify parent to update\n    }, [user.id]);\n    return \u003Cdiv>{user.name}\u003C\u002Fdiv>;\n}\n```\n\n## Advanced Review Patterns\n\n### Pattern 1: Architectural Review\n\n```markdown\nWhen reviewing significant changes:\n\n1. **Design Document First**\n   - For large features, request design doc before code\n   - Review design with team before implementation\n   - Agree on approach to avoid rework\n\n2. **Review in Stages**\n   - First PR: Core abstractions and interfaces\n   - Second PR: Implementation\n   - Third PR: Integration and tests\n   - Easier to review, faster to iterate\n\n3. **Consider Alternatives**\n   - \"Have we considered using [pattern\u002Flibrary]?\"\n   - \"What's the tradeoff vs. the simpler approach?\"\n   - \"How will this evolve as requirements change?\"\n```\n\n### Pattern 2: Test Quality Review\n\n```typescript\n\u002F\u002F ❌ Poor test: Implementation detail testing\ntest('increments counter variable', () => {\n    const component = render(\u003CCounter \u002F>);\n    const button = component.getByRole('button');\n    fireEvent.click(button);\n    expect(component.state.counter).toBe(1);  \u002F\u002F Testing internal state\n});\n\n\u002F\u002F ✅ Good test: Behavior testing\ntest('displays incremented count when clicked', () => {\n    render(\u003CCounter \u002F>);\n    const button = screen.getByRole('button', { name: \u002Fincrement\u002Fi });\n    fireEvent.click(button);\n    expect(screen.getByText('Count: 1')).toBeInTheDocument();\n});\n\n\u002F\u002F Review questions for tests:\n\u002F\u002F - Do tests describe behavior, not implementation?\n\u002F\u002F - Are test names clear and descriptive?\n\u002F\u002F - Do tests cover edge cases?\n\u002F\u002F - Are tests independent (no shared state)?\n\u002F\u002F - Can tests run in any order?\n```\n\n### Pattern 3: Security Review\n\n```markdown\n## Security Review Checklist\n\n### Authentication & Authorization\n- [ ] Is authentication required where needed?\n- [ ] Are authorization checks before every action?\n- [ ] Is JWT validation proper (signature, expiry)?\n- [ ] Are API keys\u002Fsecrets properly secured?\n\n### Input Validation\n- [ ] All user inputs validated?\n- [ ] File uploads restricted (size, type)?\n- [ ] SQL queries parameterized?\n- [ ] XSS protection (escape output)?\n\n### Data Protection\n- [ ] Passwords hashed (bcrypt\u002Fargon2)?\n- [ ] Sensitive data encrypted at rest?\n- [ ] HTTPS enforced for sensitive data?\n- [ ] PII handled according to regulations?\n\n### Common Vulnerabilities\n- [ ] No eval() or similar dynamic execution?\n- [ ] No hardcoded secrets?\n- [ ] CSRF protection for state-changing operations?\n- [ ] Rate limiting on public endpoints?\n```\n\n## Giving Difficult Feedback\n\n### Pattern: The Sandwich Method (Modified)\n\n```markdown\nTraditional: Praise + Criticism + Praise (feels fake)\n\nBetter: Context + Specific Issue + Helpful Solution\n\nExample:\n\"I noticed the payment processing logic is inline in the\ncontroller. This makes it harder to test and reuse.\n\n[Specific Issue]\nThe calculateTotal() function mixes tax calculation,\ndiscount logic, and database queries, making it difficult\nto unit test and reason about.\n\n[Helpful Solution]\nCould we extract this into a PaymentService class? That\nwould make it testable and reusable. I can pair with you\non this if helpful.\"\n```\n\n### Handling Disagreements\n\n```markdown\nWhen author disagrees with your feedback:\n\n1. **Seek to Understand**\n   \"Help me understand your approach. What led you to\n    choose this pattern?\"\n\n2. **Acknowledge Valid Points**\n   \"That's a good point about X. I hadn't considered that.\"\n\n3. **Provide Data**\n   \"I'm concerned about performance. Can we add a benchmark\n    to validate the approach?\"\n\n4. **Escalate if Needed**\n   \"Let's get [architect\u002Fsenior dev] to weigh in on this.\"\n\n5. **Know When to Let Go**\n   If it's working and not a critical issue, approve it.\n   Perfection is the enemy of progress.\n```\n\n## Best Practices\n\n1. **Review Promptly**: Within 24 hours, ideally same day\n2. **Limit PR Size**: 200-400 lines max for effective review\n3. **Review in Time Blocks**: 60 minutes max, take breaks\n4. **Use Review Tools**: GitHub, GitLab, or dedicated tools\n5. **Automate What You Can**: Linters, formatters, security scans\n6. **Build Rapport**: Emoji, praise, and empathy matter\n7. **Be Available**: Offer to pair on complex issues\n8. **Learn from Others**: Review others' review comments\n\n## Common Pitfalls\n\n- **Perfectionism**: Blocking PRs for minor style preferences\n- **Scope Creep**: \"While you're at it, can you also...\"\n- **Inconsistency**: Different standards for different people\n- **Delayed Reviews**: Letting PRs sit for days\n- **Ghosting**: Requesting changes then disappearing\n- **Rubber Stamping**: Approving without actually reviewing\n- **Bike Shedding**: Debating trivial details extensively\n\n## Templates\n\n### PR Review Comment Template\n\n```markdown\n## Summary\n[Brief overview of what was reviewed]\n\n## Strengths\n- [What was done well]\n- [Good patterns or approaches]\n\n## Required Changes\n🔴 [Blocking issue 1]\n🔴 [Blocking issue 2]\n\n## Suggestions\n💡 [Improvement 1]\n💡 [Improvement 2]\n\n## Questions\n❓ [Clarification needed on X]\n❓ [Alternative approach consideration]\n\n## Verdict\n✅ Approve after addressing required changes\n```\n\n## Resources\n\n- **references\u002Fcode-review-best-practices.md**: Comprehensive review guidelines\n- **references\u002Fcommon-bugs-checklist.md**: Language-specific bugs to watch for\n- **references\u002Fsecurity-review-guide.md**: Security-focused review checklist\n- **assets\u002Fpr-review-template.md**: Standard review comment template\n- **assets\u002Freview-checklist.md**: Quick reference checklist\n- **scripts\u002Fpr-analyzer.py**: Analyze PR complexity and suggest reviewers\n",{"name":5,"description":7},"main","7850740bd837adb32f0a109ab2af82482196c6f2","skills\u002F_collections\u002Fplugins\u002Fdeveloper-essentials\u002Fskills\u002Fcode-review-excellence",1,"https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills","https:\u002F\u002Fzturnsgo.com","https:\u002F\u002Fgithub.com\u002Fshengdabai","https:\u002F\u002Fzturnsgo.com\u002F","AI × education creator — producer, not consumer. Taught 6,000+ learners; shipping learning tools & daily essays with Claude Code, practicing @xiaolai's way 🥋","2026-11-01 21:28:23",{"source":8,"skillName":5,"commands":65,"prompt":75,"zipAvailable":76},[66,69,72],{"tool":67,"command":68},"npx","npx skills add shengdabai\u002FTony-Claude-Code-Skills --skill code-review-excellence",{"tool":70,"command":71},"bunx","bunx skills add shengdabai\u002FTony-Claude-Code-Skills --skill code-review-excellence",{"tool":73,"command":74},"pnpm","pnpm dlx skills add shengdabai\u002FTony-Claude-Code-Skills --skill code-review-excellence","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002F_collections\u002Fplugins\u002Fdeveloper-essentials\u002Fskills\u002Fcode-review-excellence\u002FSKILL.md",true,[],[79,88,96,104,112,120],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":87},"01M73H7XKBHE1ETQDZT94MF9HH","seedance-prompt-en","Write effective prompts for Jimeng Seedance 2.0 multimodal AI video generation. Use when users want to create video prompts using text, images, videos, and audio inputs with the @ reference system. Covers camera movements, effects replication, video extension, editing, music beat-matching, e-commerce ads, short dramas, and educational content.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fseedance-prompt-en\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fseedance-prompt-en\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":87},"01M73GRE9998Q1DZWC71N41JWG","onepage-pdf","Convert an HTML page into a single continuous-page PDF (one tall page, no pagination breaks), preserving desktop layout, backgrounds and selectable text. Use when the user asks to turn an HTML file\u002Freport\u002Fproposal into a \"single-page PDF\", \"long PDF\", \"不分页 PDF\", \"单页 PDF\", \"长图式 PDF\", or complains that an HTML-to-PDF export breaks into pages or cuts content. Supports optional string redaction with leak verification.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fonepage-pdf\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fonepage-pdf\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":87},"01M73GQG1KZDADVPV3MHAT1J5A","native-feel-cross-platform-desktop","Use when the user is designing, prototyping, or rewriting a desktop app that must run on multiple OSes (macOS + Windows, optionally Linux) AND feel indistinguishable from a native app to its users — fast launch, native windowing, native input handling, native materials. Trigger words include \"cross-platform desktop\", \"Electron alternative\", \"Tauri vs native\", \"WebView wrapper\", \"near-native performance\", \"Raycast architecture\", \"WebKit\u002FWebView2 quirks\", \"WKWebView\", \"system tray app\", \"global hotkey app\", \"launcher app\". Do NOT trigger this skill for pure web apps, pure mobile apps, or for greenfield projects that have no native-feel requirement.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnative-feel-cross-platform-desktop\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fnative-feel-cross-platform-desktop\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":87},"01M73G87PDNSMKG2FHWCYER6N8","gstack","Router for the gstack skill suite. (gstack)","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fgstack\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fgstack\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":87},"01M73G3EAQWKCM8DB8D0N0QSVG","fireworks-tech-graph","Use when the user wants to create any technical diagram - architecture, data flow, flowchart, sequence, agent\u002Fmemory, or concept map - and export as SVG+PNG. Trigger on: \"画图\" \"帮我画\" \"生成图\" \"做个图\" \"架构图\" \"流程图\" \"可视化一下\" \"出图\" \"generate diagram\" \"draw diagram\" \"visualize\" or any system\u002Fflow description the user wants illustrated.","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ffireworks-tech-graph\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ffireworks-tech-graph\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":87},"01M73G086AXAH9DW1H5G5N3CPB","dbs-video-extract","接收抖音、小红书、微信视频号等短视频链接或分享文案，查询作品／账号数据并提取语音文字稿，按作者和标题归档为 Markdown。用户希望完整解析短视频、取得数据或文字稿时使用；运行前检查 TikHub 与轻抖使用凭证，缺少时用新手能理解的方式引导购买和安全配置。","https:\u002F\u002Fgithub.com\u002Fshengdabai\u002FTony-Claude-Code-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fdbs-video-extract\u002FSKILL.md",[],[]]