code-pattern-extractor

Solid

Analyze codebases to identify reusable code patterns, duplications, and implementation patterns for future development. Use when refactoring code, identifying technical debt, finding opportunities for abstraction, or documenting common patterns in a directory or module. Outputs pattern catalogs, refactoring suggestions, and reusable template code.

Data & Documents 160 stars 17 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 87/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Code Pattern Extractor ## Overview Systematically analyze code in directories or modules to identify recurring patterns, code duplication, and implementation patterns that can be abstracted into reusable components, utilities, or design patterns. ## Workflow ### 1. Define Analysis Scope Identify the code to analyze: - **Directory/module**: Analyze all files in a specific directory - **File set**: Analyze a specific set of related files - **Component**: Analyze files related to a specific feature or component Use Glob to find relevant files: ``` **/*.js, **/*.py, **/*.go, etc. ``` ### 2. Scan for Code Duplication Identify repeated code blocks that appear multiple times: **Look for**: - Similar function implementations with minor variations - Repeated code blocks (>5 lines) across files - Copy-pasted code with slight modifications - Similar class structures or method patterns **Analysis criteria**: - Similarity threshold: >70% code similarity - Minimum size: 5+ lines of code - Frequency: Appears 3+ times ### 3. Identify Implementation Patterns Find recurring implementation approaches: **Common patterns**: - **API call patterns**: Similar fetch/request handling - **Error handling**: Repeated try-catch or error checking - **Data validation**: Similar input validation logic - **Data transformation**: Repeated mapping/filtering operations - **State management**: Similar state update patterns - **Configuration**: Repeated configuration setup **Example patterns to det...

Details

Author
ArabelaTso
Repository
ArabelaTso/Skills-4-SE
Created
6 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category