Skip to content

foryourhealth111-pixel/Vibe-Skills / bundled/skills/code-reviewer

code-reviewer

Verified

Default code-quality route for broad code review, PR review, maintainability, correctness, and regression-risk checks. Do not use as the primary route for dedicated OWASP/security audits, review-feedback handling, completion verification, AI-code cleanup, or TDD/test-first work.

references/python-style-guide.md

View on GitHub
# Python Style Guide

## Naming Conventions

### Variables and Functions
- Use `snake_case` for variables and functions
- Use descriptive names that explain the purpose
- Avoid single-letter names except for loop counters

```python
# Good
user_count = 10
def calculate_total_price(items):
    pass

# Bad
uc = 10
def calc(i):
    pass
```

### Classes
- Use `PascalCase` for class names
- Use nouns that describe what the class represents

```python
# Good
class UserAccount:
    pass

class OrderProcessor:
    pass

# Bad
class user_account:
    pass

class Process:
    pass
```

### Constants
- Use `UPPER_SNAKE_CASE` for constants
- Define at module level

```python
# Good
MAX_RETRY_COUNT = 3
DEFAULT_TIMEOUT = 30

# Bad
maxRetryCount = 3
default_timeout = 30
```

## Code Organization

### Imports
- Group imports in this order: standard library, third-party, local
- Sort alphabetically within each group
- Use absolute imports

```python
# Standard library
import os
import sys
from typing import List, Optional

# Third-party
import requests
from pydantic import BaseModel

# Local
from myapp.models import User
from myapp.utils import helper
```

### Function Length
- Keep functions under 50 lines
- If longer, consider breaking into smaller functions
- Each function should do one thing well

### Documentation
- Use docstrings for public functions and classes
- Follow Google or NumPy docstring style
- Include parameter types and return types

```python
def process_user_data(user_id: str, include_history: bool = False) -> dict:
    """Process user data and return formatted result.

    Args:
        user_id: The unique identifier for the user.
        include_history: Whether to include user history. Defaults to False.

    Returns:
        A dictionary containing the processed user data.

    Raises:
        ValueError: If user_id is empty or invalid.
    """
    pass
```

## Error Handling

### Be Specific
- Catch specific exceptions, not bare `except:`
- Include helpful error messages

```python
# Good
try:
    result = process_data(data)
except ValueError as e:
    logger.error(f"Invalid data format: {e}")
    raise
except ConnectionError as e:
    logger.error(f"Failed to connect: {e}")
    return None

# Bad
try:
    result = process_data(data)
except:
    pass
```

## Security

### Never Hardcode Secrets
- Use environment variables or secret managers
- Never commit credentials to version control

```python
# Good
import os
api_key = os.environ.get("API_KEY")

# Bad
api_key = "sk-1234567890abcdef"
```
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall