analyze-patterns

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

16 stars

Best use case

analyze-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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

Teams using analyze-patterns 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/analyze-patterns/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/tools/analyze-patterns/SKILL.md"

Manual Installation

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

How analyze-patterns Compares

Feature / Agentanalyze-patternsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Use this skill when you need to analyze code for design patterns, anti-patterns, naming conventions, and code duplication. This skill 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

aria-patterns

16
from diegosouzapw/awesome-omni-skill

Provides ARIA roles, states, and properties for interactive components. Use when building custom widgets, fixing screen reader issues, or implementing modals, tabs, accordions, menus, or dialogs accessibly.

analyze-video-performance-skill

16
from diegosouzapw/awesome-omni-skill

Analyze your uploaded YouTube videos' performance against competitor benchmarks using Playwright MCP. Use when asked to review video analytics, compare performance, check how a video is doing, or reflect on a video's success.

analyze-perf

16
from diegosouzapw/awesome-omni-skill

Go プロジェクトのパフォーマンスを計測・分析する。「パフォーマンス計測」「ベンチマーク」「perf」「性能測定」「プロファイリング」「最適化提案」「パフォーマンス分析」などで起動。ベンチマーク実行、プロファイリング、改善案の提示をサポート。

analyze-copper-inventory-rebuild-signal

16
from diegosouzapw/awesome-omni-skill

用「庫存快速回補」作為短期警戒訊號,評估銅價是否接近短線高點,同時給出一個「長期是否偏便宜」的歷史分位數判讀。

acc-stability-patterns-knowledge

16
from diegosouzapw/awesome-omni-skill

Stability Patterns knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Circuit Breaker, Retry, Rate Limiter, Bulkhead, and resilience audits.

acc-analyze-coupling-cohesion

16
from diegosouzapw/awesome-omni-skill

Analyzes coupling and cohesion metrics in PHP codebases. Calculates Afferent/Efferent coupling (Ca/Ce), LCOM metrics, instability index, and abstractness. Identifies highly coupled modules and low cohesion classes.

ac-stop-hook-analyzer

16
from diegosouzapw/awesome-omni-skill

Analyze context and decide on continuation via Stop hook. Use when determining if work should continue, analyzing completion status, making continuation decisions, or implementing the Two-Claude pattern.

a2a-patterns

16
from diegosouzapw/awesome-omni-skill

Agent-to-Agent (A2A) protocol implementation patterns for Google ADK - exposing agents via A2A, consuming external agents, multi-agent communication, and protocol configuration. Use when building multi-agent systems, implementing A2A protocol, exposing agents as services, consuming remote agents, configuring agent cards, or when user mentions A2A, agent-to-agent, multi-agent collaboration, remote agents, or agent orchestration.

wcag-audit-patterns

16
from diegosouzapw/awesome-omni-skill

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 ac...

testing-patterns

16
from diegosouzapw/awesome-omni-skill

Testing patterns using bun:test with in-memory SQLite. Use when writing unit tests, integration tests, or router tests.

midnight-dapp:testing-patterns

16
from diegosouzapw/awesome-omni-skill

Use when writing unit tests for Midnight contract interaction code, integration testing without ZK proofs, E2E testing with Playwright or Cypress, or setting up CI/CD pipelines for Midnight DApps.

e2e-testing-patterns

16
from diegosouzapw/awesome-omni-skill

Master end-to-end testing with Playwright and Cypress to build reliable test suites that catch bugs, improve confidence, and enable fast deployment. Use when implementing E2E tests, debugging flaky tests, or establishing testing standards.