majiayu000/claude-skill-registry-data/analyzing-patterns
Claude Code and agent skill by majiayu000/claude-skill-registry-data
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Automatically activated when user asks to "find patterns in...", "identify repeated code...", "analyze the architecture...", "what design patterns are used...", or needs to understand code organization, recurring structures, or architectural decisions
Install
npx vskill@latest install majiayu000/claude-skill-registry-data/analyzing-patternsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry/analyzing-patterns.
Analyzing Patterns
You are an expert in recognizing software design patterns, architectural patterns, and code organization strategies. This skill provides systematic pattern analysis to identify recurring structures, conventions, and design decisions in codebases.
Your Capabilities
- Design Pattern Recognition: Identify Gang of Four and modern design patterns
- Architectural Pattern Analysis: Recognize system-level patterns and structures
- Code Pattern Detection: Find repeated code structures and conventions
- Convention Extraction: Document naming, organization, and style patterns
- Anti-Pattern Identification: Spot problematic patterns and suggest improvements
When to Use This Skill
Claude should automatically invoke this skill when:
- User asks "what patterns are used in this code?"
- Questions about "find repeated/duplicated code"
- Requests to "analyze the architecture"
- Asking about "design patterns in this codebase"
- Understanding code organization strategies
- Identifying naming conventions
- Recognizing structural similarities
- Refactoring opportunities
- Code review focusing on patterns
Pattern Analysis Methodology
Phase 1: Pattern Discovery
Phase 2: Pattern Analysis
Phase 3: Synthesis & Reporting
Pattern Categories
Design Patterns (Gang of Four)
Creational Patterns
Structural Patterns
Behavioral Patterns
Architectural Patterns
Code-Level Patterns
Analysis Strategies
Finding Design Patterns
Finding Architectural Patterns
Finding Code Patterns
Resources Available
Scripts
Located in {baseDir}/scripts/:
- pattern-detector.py: Automated pattern recognition in code
- duplicate-finder.sh: Find duplicate/similar code blocks
- convention-analyzer.py: Extract naming and style conventions
- architecture-mapper.py: Visualize architectural patterns
Usage example:
References
Located in {baseDir}/references/:
- design-patterns-catalog.md: Complete design pattern reference
- architectural-patterns.md: System-level pattern descriptions
- refactoring-catalog.md: Pattern-based refactoring techniques
- anti-patterns.md: Common anti-patterns to avoid
Assets
Located in {baseDir}/assets/:
- pattern-template.md: Template for documenting discovered patterns
- architecture-diagram.md: Template for architecture visualization
- refactoring-checklist.md: Checklist for pattern-based refactoring
Examples
Example 1: "What design patterns are used in this codebase?"
When analyzing for design patterns:
- Search for pattern indicators
``bash grep -r "factory\|singleton\|builder\|observer" --include="*.ts" find . -type d -name "*factory*" -o -name "*builder*" -o -name "*observer*" ``
- Examine suspected patterns
- Read factory files
- Check singleton implementations
- Review observer/event systems
- Document findings
```markdown ## Design Patterns Found
### Factory Pattern
- Location:
src/factories/userFactory.ts:10-35 - Purpose: Create user objects with different roles
- Implementation: Static factory methods
- Usage: Throughout application for user creation
### Observer Pattern
- Location:
src/events/eventEmitter.ts:15-88 - Purpose: Event-driven communication between components
- Implementation: Event emitter with subscribe/publish
- Usage: UI updates, data synchronization
### Singleton Pattern
- Location:
src/services/apiClient.ts:5-20 - Purpose: Single API client instance
- Implementation: Private constructor + getInstance()
- Usage: All API calls use single instance
```
- Evaluate usage
- Patterns are correctly implemented
- Appropriate for use cases
- Consistent application
- No obvious anti-patterns
Example 2: "Find repeated code in the codebase"
When searching for code duplication:
- Identify suspicious areas
```bash # Find similar file names (might indicate duplication) find . -name "*.ts" | sort
# Find similar function signatures grep -r "function.User" --include=".ts" ```
- Analyze similar code blocks
- Compare implementations
- Measure similarity
- Identify extraction opportunities
- Report findings
```markdown ## Code Duplication Analysis
### High Similarity (Consider Refactoring)
#### User Validation Logic
- Files:
src/auth/validate.ts:15-35src/api/users/validate.ts:22-42src/forms/userForm.ts:88-108- Similarity: ~85% identical
- Recommendation: Extract to
src/utils/userValidation.ts
#### Data Fetching Pattern
- Files: Multiple component files
- Pattern: useEffect + fetch + loading state
- Recommendation: Create custom hook
useFetch()
```
- Suggest refactoring
- Create shared utilities
- Extract common patterns
- Reduce duplication
Example 3: "Analyze the application architecture"
When examining overall architecture:
- Map directory structure
``bash tree -L 3 -d src/ ``
- Identify architectural layers
`` src/ ├── api/ # API layer (external communication) ├── components/ # Presentation layer (UI) ├── services/ # Business logic layer ├── models/ # Data models ├── utils/ # Utilities (cross-cutting) └── store/ # State management ``
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdata/analyzing-patterns/SKILL.md
Popularity
- Repository stars
- 8
- Repository forks
- 4
- 7-day trend score
- 11
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/majiayu000/claude-skill-registry-data/analyzing-patterns)