home / skills / dmitriiweb / extract-emails / code-review-assistant

code-review-assistant skill

/.codex/skills/code-review-assistant

This skill performs structured, actionable Python code reviews with clear findings and suggestions to improve correctness, security, and maintainability.

npx playbooks add skill dmitriiweb/extract-emails --skill code-review-assistant

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.8 KB
---
name: code-review-assistant
description: Perform structured, actionable code reviews for Python code with clear findings and suggestions.
---

# Code Review Assistant (Python)

## Quick start
- Read the full code to understand intent, architecture, and interactions before commenting.
- Check style, correctness, edge cases, efficiency, security, and maintainability.
- Provide concise, actionable feedback grouped into strengths, issues/risks, and suggestions.
- Include inline code snippets when helpful; ensure recommendations explain the why.
- Follow `references/code_review_rules.md` for the review checklist and output format.

## Workflow
1) **Understand**  
   - Identify the module’s purpose, main flows, and dependencies.  
   - Note assumptions, data shapes, and external interactions.

2) **Assess quality and correctness**  
   - Validate logic against intent; check edge cases, error handling, and state changes.  
   - Verify PEP 8 compliance, naming, imports, and type hints.  
   - Look for dead code, mutable defaults, and duplicated logic.

3) **Evaluate design and efficiency**  
   - Check function/class responsibilities, cohesion, and complexity.  
   - Consider algorithmic complexity and data structure choices; flag inefficiencies.  
   - Ensure configuration/secrets are not hardcoded and that dependencies are isolated.

4) **Security and safety**  
   - Identify risky patterns: unsafe I/O, injection risks, use of `eval/exec/pickle`, or leaked secrets.  
   - Recommend safer alternatives when applicable.

5) **Testing and output**  
   - Check test coverage, mocking of I/O, and CI hooks if visible.  
   - Produce the review using the output format in the rules doc with grouped strengths, risks, and suggestions.

## Reference
- `references/code_review_rules.md`: detailed checklist and response format for Python code reviews.

Overview

This skill performs structured, actionable code reviews for Python projects, with a focus on modules that parse URLs to extract emails and LinkedIn links. It produces grouped findings—strengths, issues/risks, and prioritized suggestions—so developers can quickly apply fixes. Feedback emphasizes correctness, security, performance, and maintainability.

How this skill works

I read the full code to understand intent, data shapes, and external interactions, then evaluate logic, style, and edge cases against common Python best practices. The review checks parsing correctness for email and LinkedIn extraction, error handling for network and HTML parsing, dependency usage, and potential security risks like injection or credential leaks. Results include concise examples and code snippets when needed and prioritize fixes by impact.

When to use it

  • Before merging changes that add or modify URL scraping or parsing logic
  • When evaluating a new parser/scraper for extracting emails and LinkedIn profiles
  • During code audits to ensure compliance with security and privacy rules
  • When onboarding contributors to ensure consistent style and test coverage
  • Before deploying scraping code to production or scheduled jobs

Best practices

  • Validate and sanitize all external inputs and HTTP responses before parsing
  • Use robust HTML parsers (e.g., BeautifulSoup, lxml) and avoid brittle regex-only extraction
  • Isolate networking and parsing for easy unit testing and mocking
  • Avoid storing secrets or API keys in code; read from environment or secure vaults
  • Add clear rate-limiting/backoff and respect robots.txt for ethical scraping

Example use cases

  • Review a new Python module that crawls websites and extracts contact emails and LinkedIn URLs
  • Audit regex patterns used for email detection and replace them with validated parsers
  • Assess error handling for network failures, timeouts, and malformed HTML
  • Identify performance bottlenecks in large-scale scraping jobs and suggest batching/async
  • Confirm tests cover edge cases like obfuscated email formats and redirected LinkedIn links

FAQ

Do you check for legal or ethical scraping issues?

I point out compliance risks (e.g., ignoring robots.txt, collecting personal data) and recommend mitigation, but I do not provide legal advice.

Will you rewrite code for me?

I provide focused code examples and refactor suggestions; full rewrites can be requested but are scoped as follow-up work.