Agent skill
code-style-analyzer
Analyzes code for style and formatting issues including inconsistent formatting, naming conventions, code organization, comment quality, unused code, and magic numbers. Returns structured style issue reports with suggestions for improvement.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/code-style-analyzer
SKILL.md
Code Style Analyzer Skill
Instructions
- Analyze code for style and formatting issues
- Check for inconsistent formatting (indentation, spacing, brackets)
- Verify naming conventions are followed
- Check code organization and structure
- Review comment quality and presence
- Identify unused code (variables, functions, imports)
- Look for magic numbers and strings
- Return structured style reports with:
- File path and line numbers
- Style issue type
- Current code
- Suggested improvement
- Reason
- Priority (usually Should-Fix or Nice-to-Have)
Examples
Input: Inconsistent indentation Output:
### STYLE-001
- **File**: `index.html`
- **Lines**: 15-20
- **Priority**: Should-Fix
- **Issue**: Inconsistent indentation (mixing tabs and spaces)
- **Current Code**:
```html
<div>
<p>Text</p>
<span>More text</span>
</div>
- Suggested Fix:
html
<div> <p>Text</p> <span>More text</span> </div> - Reason: Consistent indentation improves readability and maintainability
## Style Issues to Detect
- **Formatting**: Inconsistent indentation, spacing, bracket placement
- **Naming**: Inconsistent naming conventions (camelCase vs snake_case)
- **Code Organization**: Poor file structure, functions in wrong places
- **Comments**: Missing comments, poor comment quality, outdated comments
- **Unused Code**: Unused variables, functions, imports, dead code
- **Magic Numbers/Strings**: Hardcoded values that should be constants
- **Line Length**: Lines that are too long
- **File Length**: Files that are too long
- **Code Duplication**: Repeated code that could be extracted
- **Import Organization**: Unorganized imports
## Priority Guidelines
- **Must-Fix**: Style issues that cause bugs or significant readability problems
- **Should-Fix**: Style issues that affect readability and maintainability
- **Nice-to-Have**: Cosmetic style improvements
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?