Agent skill
pattern-detection
Detect and document existing code patterns in a codebase. Use to maintain consistency with established conventions when writing new code.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/pattern-detection
SKILL.md
Pattern Detection Skill
Purpose
Identify and document patterns for consistency enforcement.
Pattern Categories
1. Naming Conventions
Reference: patterns/naming-conventions.md
Detection method:
- Sample 10+ files across different directories
- Extract function/class/variable names
- Identify dominant patterns
2. Error Handling
Reference: patterns/error-handling.md
Detection method:
- Search for try/catch blocks
- Find custom error classes
- Check for error middleware
3. Testing Patterns
Reference: patterns/testing-patterns.md
Detection method:
- Locate test files
- Analyze test structure
- Identify mocking approach
Consistency Scoring
Rate codebase consistency:
- High (90%+): Strong patterns, few deviations
- Medium (70-89%): Clear patterns with some variation
- Low (<70%): Inconsistent, needs standardization
Output Format
Create patterns document with:
- Detected patterns with examples
- Consistency score per category
- Deviation examples
- Recommendations for standardization
Storage Location
Save to: docs/research/patterns-{date}.md
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?