pattern-recognition-specialist

Analyze codebases for design patterns, anti-patterns, naming conventions, and duplication.

Updated Jun 28, 2022
One-click install
npx skills add https://github.com/pcasaretto/nix-home --skill pattern-recognition-specialist-pcasaretto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pattern-recognition-specialist
Source: https://github.com/pcasaretto/nix-home/tree/main/home-manager/modules/common/pi/compound-engineering/skills/pattern-recognition-specialist
Command: npx skills add https://github.com/pcasaretto/nix-home --skill pattern-recognition-specialist-pcasaretto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of maintaining code quality and consistency by automatically identifying design patterns, anti-patterns, naming convention violations, and code duplication within a codebase.

Core Features & Use Cases

  • Design Pattern Detection: Identifies common design patterns (e.g., Factory, Singleton, Observer) and assesses their implementation quality.
  • Anti-Pattern Identification: Detects code smells like TODOs, God objects, circular dependencies, and coupling issues.
  • Naming Convention Analysis: Evaluates consistency in naming across variables, functions, classes, and files.
  • Code Duplication Detection: Finds duplicated code blocks that can be refactored.
  • Architectural Boundary Review: Analyzes layer violations and separation of concerns.
  • Use Case: Ensure a newly developed microservice adheres to established architectural patterns and coding standards before merging it into the main branch.

Quick Start

Analyze the current project for design patterns, anti-patterns, and code duplication.

Frequently Asked Questions about pattern-recognition-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect anti-patterns and code smells in my codebase?

You can check codebase consistency by analyzing your project for design patterns, naming conventions, and code duplication. The Skill evaluates variables, functions, classes, and files to ensure newly developed code adheres to established architectural patterns and coding standards.

What is the best way to find code duplication for refactoring?

The best way to find code duplication is using the jscpd tool integrated into this Skill. It scans your codebase to detect duplicated code blocks, allowing you to identify refactoring opportunities and improve overall code quality metrics before merging changes.

Can I use ast-grep to verify architectural boundaries and layer violations?

Yes, you can use ast-grep to verify architectural boundaries by analyzing layer violations and separation of concerns. The Skill leverages structural code searching to assess how well your codebase adheres to established design patterns and architectural standards.

How do I analyze naming convention violations across my project files?

Analyzing naming convention violations involves evaluating consistency across variables, functions, classes, and files using Grep and ast-grep. The Skill identifies deviations from established patterns to help you standardize codebase naming conventions automatically.

What are the limitations of automated design pattern detection in legacy code?

Automated design pattern detection identifies structural implementations of patterns like Factory or Singleton, but may struggle with unconventional or highly coupled legacy code. It reports on implementation quality and architectural adherence, yet complex custom patterns might require manual review.