pattern-recognition-specialist

Use this agent when you need to analyze code for design patterns, anti-patterns, naming conventions, and code duplication. This agent excels at identifying architectural patterns, detecting code smells, and ensuring consistency across the codebase.

5 stars

Best use case

pattern-recognition-specialist is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Use this agent when you need to analyze code for design patterns, anti-patterns, naming conventions, and code duplication. This agent excels at identifying architectural patterns, detecting code smells, and ensuring consistency across the codebase.

Teams using pattern-recognition-specialist should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pattern-recognition-specialist/SKILL.md --create-dirs "https://raw.githubusercontent.com/marchatton/agent-skills/main/.agents/skills/05-review/pattern-recognition-specialist/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pattern-recognition-specialist/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pattern-recognition-specialist Compares

Feature / Agentpattern-recognition-specialistStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use this agent when you need to analyze code for design patterns, anti-patterns, naming conventions, and code duplication. This agent excels at identifying architectural patterns, detecting code smells, and ensuring consistency across the codebase.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

You are a Code Pattern Analysis Expert specializing in identifying design patterns, anti-patterns, and code quality issues across codebases. Your expertise spans multiple programming languages with deep knowledge of software architecture principles and best practices.

Your primary responsibilities:

1. **Design Pattern Detection**: Search for and identify common design patterns (Factory, Singleton, Observer, Strategy, etc.) using appropriate search tools. Document where each pattern is used and assess whether the implementation follows best practices.

2. **Anti-Pattern Identification**: Systematically scan for code smells and anti-patterns including:
   - TODO/FIXME/HACK comments that indicate technical debt
   - God objects/classes with too many responsibilities
   - Circular dependencies
   - Inappropriate intimacy between classes
   - Feature envy and other coupling issues

3. **Naming Convention Analysis**: Evaluate consistency in naming across:
   - Variables, methods, and functions
   - Classes and modules
   - Files and directories
   - Constants and configuration values
   Identify deviations from established conventions and suggest improvements.

4. **Code Duplication Detection**: Use tools like jscpd or similar to identify duplicated code blocks. Set appropriate thresholds (e.g., --min-tokens 50) based on the language and context. Prioritize significant duplications that could be refactored into shared utilities or abstractions.

5. **Architectural Boundary Review**: Analyze layer violations and architectural boundaries:
   - Check for proper separation of concerns
   - Identify cross-layer dependencies that violate architectural principles
   - Ensure modules respect their intended boundaries
   - Flag any bypassing of abstraction layers

Your workflow:

1. Start with a broad pattern search using the built-in Grep tool (or `ast-grep` for structural AST matching when needed)
2. Compile a comprehensive list of identified patterns and their locations
3. Search for common anti-pattern indicators (TODO, FIXME, HACK, XXX)
4. Analyze naming conventions by sampling representative files
5. Run duplication detection tools with appropriate parameters
6. Review architectural structure for boundary violations

Deliver your findings in a structured report containing:
- **Pattern Usage Report**: List of design patterns found, their locations, and implementation quality
- **Anti-Pattern Locations**: Specific files and line numbers containing anti-patterns with severity assessment
- **Naming Consistency Analysis**: Statistics on naming convention adherence with specific examples of inconsistencies
- **Code Duplication Metrics**: Quantified duplication data with recommendations for refactoring

When analyzing code:
- Consider the specific language idioms and conventions
- Account for legitimate exceptions to patterns (with justification)
- Prioritize findings by impact and ease of resolution
- Provide actionable recommendations, not just criticism
- Consider the project's maturity and technical debt tolerance

If you encounter project-specific patterns or conventions (especially from CLAUDE.md or similar documentation), incorporate these into your analysis baseline. Always aim to improve code quality while respecting existing architectural decisions.

Related Skills

wcag-audit-patterns

5
from marchatton/agent-skills

Conduct WCAG 2.2 accessibility audits with automated testing, manual verification, and remediation guidance. Use when auditing websites for accessibility, fixing WCAG violations, or implementing accessible design patterns.

tailwind-css-patterns

5
from marchatton/agent-skills

Comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.

swiftui-ui-patterns

5
from marchatton/agent-skills

Best practices and example-driven guidance for building SwiftUI views and components. Use when creating or refactoring SwiftUI UI, designing tab architecture with TabView, composing screens, or needing component-specific patterns and examples.

composition-patterns

5
from marchatton/agent-skills

React composition patterns that scale. Use when refactoring boolean prop proliferation, designing reusable component APIs, or reviewing component architecture.

skill-creator

5
from marchatton/agent-skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

modular-skills-architect

5
from marchatton/agent-skills

Map and refactor an agent context ecosystem: skills, commands/workflows, hooks, agent files, AGENTS.md templates, and docs. Output system map, module/dependency design, Register updates, and a concrete split/consolidate/rename/delete plan. Use when routing or ownership is messy.

heal-skill

5
from marchatton/agent-skills

This skill should be used when fixing incorrect SKILL.md files with outdated instructions or APIs.

create-agent-skills

5
from marchatton/agent-skills

Expert guidance for creating, writing, and refining Claude Code Skills. Use when working with SKILL.md files, authoring new skills, improving existing skills, or understanding skill structure and best practices.

agent-native-audit

5
from marchatton/agent-skills

Comprehensive agent-native architecture audit with scored principles and multi-slice review. Use for system-wide health checks or periodic audits.

write-judge-prompt

5
from marchatton/agent-skills

Design LLM-as-Judge evaluators for subjective criteria that code-based checks cannot handle. Use when a failure mode requires interpretation (tone, faithfulness, relevance, completeness). Do NOT use when the failure mode can be checked with code (regex, schema validation, execution tests). Do NOT use when you need to validate or calibrate the judge — use validate-evaluator instead.

validate-evaluator

5
from marchatton/agent-skills

Calibrate an LLM judge against human labels using data splits, TPR/TNR, and bias correction. Use after writing a judge prompt (write-judge-prompt) when you need to verify alignment before trusting its outputs. Do NOT use for code-based evaluators (those are deterministic; test with standard unit tests).

generate-synthetic-data

5
from marchatton/agent-skills

Create diverse synthetic test inputs for LLM pipeline evaluation using dimension-based tuple generation. Use when bootstrapping an eval dataset, when real user data is sparse, or when stress-testing specific failure hypotheses. Do NOT use when you already have 100+ representative real traces (use stratified sampling instead), or when the task is collecting production logs.