Skip to main content
command CX Codex

check-best-practices — Claude Code command: code standards review

The check-best-practices command reviews code against language-specific standards, conventions, and best practices. It spots issues from critical bugs to style violations and suggests concrete improvements.

MIT ★ 2,744 updated 2026-10-08

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/commands/check-best-practices.md
Open on GitHub

What check-best-practices does

The command identifies your code's language and framework, then applies relevant guidelines: PEP 8 for Python, ES6+ for JavaScript, TypeScript strict mode, React patterns. It checks naming, file organization, separation of concerns, error handling, caching, and test coverage.

Results are structured by priority — high, medium, low — with examples of current code and recommended fixes. The review prioritizes impactful changes over nitpicks and stays grounded in your project's existing patterns. It works best on complete functions, modules, or API endpoints; small snippets without context yield less useful feedback.

Output includes an overall score, key areas to improve, quick wins you can implement today, and longer-term architectural recommendations.

What it helps with

  • verify Python code against PEP 8 and type hints
  • spot ES6+ and async/await issues in JavaScript
  • assess React component structure and state management
  • review REST API design: naming, status codes, versioning
  • strengthen error handling and logging practices

Example prompts for the agent

  • Check if this Python code follows PEP 8
  • Review this React component for best practices
  • What issues would you flag in this REST API?

How to install check-best-practices

Manually: put the files in place

.claude/commands/check-best-practices.md

Call it with /check-best-practices. For all projects use ~/.claude/commands/

Questions about check-best-practices

How do I install check-best-practices in Claude Code?

Save the command file to .claude/commands/check-best-practices.md. Then call it with /check-best-practices in Claude Code or ask Claude to review your code for best practices.

What does check-best-practices do?

It analyzes your code against language standards and conventions — PEP 8 for Python, ES6+ for JavaScript, TypeScript strict mode. It flags issues by priority and provides specific improvements with code examples.

Which languages and frameworks does it support?

The command covers Python, JavaScript, TypeScript, React, Vue, Angular, and REST API design. Each gets its own set of guidelines, from code style to architecture patterns.

Source text

check-best-practices.md · MIT
# Check Best Practices

Analyze code against language-specific best practices, coding standards, and community conventions to improve code quality and maintainability.

## Usage Examples

### Basic Usage
"Check if this code follows Python best practices"
"Review JavaScript code for ES6+ best practices"
"Analyze React components for best practices"

### Specific Checks
"Check if this follows PEP 8 conventions"
"Review TypeScript code for proper type usage"
"Verify REST API design best practices"
"Check Git commit message conventions"

## Instructions for Claude

When checking best practices:

1. **Identify Language/Framework**: Detect the languages and frameworks being used
2. **Apply Relevant Standards**: Use appropriate style guides and conventions
3. **Context Awareness**: Consider project-specific patterns and existing conventions
4. **Actionable Feedback**: Provide specific examples of improvements
5. **Prioritize Issues**: Focus on impactful improvements over nitpicks

### Language-Specific Guidelines

#### Python
- PEP 8 style guide compliance
- PEP 484 type hints usage
- Pythonic idioms and patterns
- Proper exception handling
- Module and package structure

#### JavaScript/TypeScript
- Modern ES6+ features usage
- Async/await over callbacks
- Proper error handling
- Module organization
- TypeScript strict mode compliance

#### React/Vue/Angular
- Component structure and organization
- State management patterns
- Performance optimizations
- Accessibility considerations
- Testing patterns

#### API Design
- RESTful conventions
- Consistent naming patterns
- Proper HTTP status codes
- API versioning strategy
- Documentation standards

### Code Quality Aspects

#### Naming Conventions
- Variable and function names
- Class and module names
- Consistency across codebase
- Meaningful and descriptive names

#### Code Organization
- File and folder structure
- Separation of concerns
- DRY (Don't Repeat Yourself)
- Single Responsibility Principle
- Modular design

#### Error Handling
- Comprehensive error catching
- Meaningful error messages
- Proper logging practices
- Graceful degradation

#### Performance
- Efficient algorithms
- Proper caching strategies
- Lazy loading where appropriate
- Database query optimization
- Memory management

#### Testing
- Test coverage adequacy
- Test naming conventions
- Test organization
- Mock usage patterns
- Integration vs unit tests

### Output Format

Structure the analysis as:

```markdown
## Best Practices Review

### Summary
- Language/Framework: [Detected stack]
- Overall Score: X/10
- Key Areas for Improvement: [List]

### Excellent Practices Found
- [Practice 1]: Brief explanation
- [Practice 2]: Brief explanation

### Areas for Improvement

#### High Priority
1. **[Issue Name]**
   - Current: `code example`
   - Recommended: `improved code`
   - Reason: Explanation of why this matters

#### Medium Priority
[Similar format]

#### Low Priority
[Similar format]

### Quick Wins
- [Easy improvement 1]
- [Easy improvement 2]

### Long-term Recommendations
- [Strategic improvement 1]
- [Strategic improvement 2]
```

Focus on:
- Practical, implementable suggestions
- Learning opportunities
- Maintaining consistency with existing code
- Balancing perfection with pragmatism

© centminmod · MIT · centminmod/my-claude-code-setup

Similar slash commands

All slash commands for Code review and refactoring →

From the same set35

The whole set →
ccusage-daily This command runs ccusage daily -b and turns Claude Code usage figures into a Markdown report. Use it to review costs, token totals, and daily spending. CX Codex +1 ★ 2,744repo stars create-readme-section The create-readme-section command for Claude Code generates README sections based on project files. Create installation instructions, API references, or contribution guides. CX Codex +1 ★ 2,744repo stars 01_claudemd_summarise 01_claudemd_summarise — a Claude Code prompt that compresses CLAUDE.md documentation into exactly 120 words in a single paragraph, without headings or lists. Use it to standardize project architecture summaries for AI coding context. GP ChatGPT ★ 2,744repo stars security-audit The security-audit command scans a codebase for vulnerabilities and unsafe patterns across a project or a specific module. CX Codex +1 ★ 2,744repo stars claude-docs-consultant claude-docs-consultant pulls official Claude Code documentation directly from code.claude.com on demand. Fetches only the markdown files needed for the active task. CX Codex +1 ★ 2,744repo stars explain-architecture-pattern The explain-architecture-pattern command identifies architecture and design patterns in a codebase, then explains the structure behind them. Use it when the project’s organization needs a clear rationale. CX Codex +1 ★ 2,744repo stars convert-to-test-driven-prompt convert-to-test-driven-prompt turns a plain request into a TDD-style prompt with test cases, expected outcomes, and success criteria. Useful when behavior needs to be pinned down before code exists. CX Codex +1 ★ 2,744repo stars batch-operations-prompt batch-operations-prompt transforms bulk code modification requests into structured plans with parallel stages and sequential tasks. It optimizes Claude Code execution through TodoWrite checklists. CX Codex +1 ★ 2,744repo stars

Project sponsors

Companies that keep this analytics open