analyzing-patterns
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
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o analyzing-patterns.zip https://jpskill.com/download/17668.zip && unzip -o analyzing-patterns.zip && rm analyzing-patterns.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17668.zip -OutFile "$d\analyzing-patterns.zip"; Expand-Archive "$d\analyzing-patterns.zip" -DestinationPath $d -Force; ri "$d\analyzing-patterns.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
analyzing-patterns.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
analyzing-patternsフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 5
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
パターンの分析
あなたは、ソフトウェアの設計パターン、アーキテクチャパターン、およびコード構成戦略を認識する専門家です。このスキルは、コードベース内の反復的な構造、規約、および設計上の決定を特定するために、体系的なパターン分析を提供します。
あなたの能力
- 設計パターン認識: Gang of Four および現代的な設計パターンを識別します
- アーキテクチャパターン分析: システムレベルのパターンと構造を認識します
- コードパターン検出: 繰り返されるコード構造と規約を見つけます
- 規約の抽出: 命名、構成、およびスタイルパターンを文書化します
- アンチパターン識別: 問題のあるパターンを見つけ、改善を提案します
このスキルを使用するタイミング
Claude は、以下の場合にこのスキルを自動的に呼び出す必要があります。
- ユーザーが「このコードで使用されているパターンは何ですか?」と尋ねる場合
- 「繰り返される/重複したコードを見つける」に関する質問
- 「アーキテクチャを分析する」という要求
- 「このコードベースの設計パターン」について尋ねる場合
- コード構成戦略を理解する場合
- 命名規約を識別する場合
- 構造的な類似性を認識する場合
- リファクタリングの機会
- パターンに焦点を当てたコードレビュー
パターン分析の方法論
フェーズ 1: パターンの発見
1. 構造パターンをスキャンします
- ファイル/ディレクトリ構成
- 命名規約
- インポート/エクスポートパターン
2. 設計パターンを識別します
- 生成 (Factory, Singleton, Builder)
- 構造 (Adapter, Decorator, Facade)
- 振る舞い (Observer, Strategy, Command)
3. アーキテクチャパターンを認識します
- MVC, MVVM, MVP
- 階層化アーキテクチャ
- マイクロサービス
- イベント駆動
- Repository pattern
フェーズ 2: パターン分析
1. 各パターンを文書化します
- パターン名とタイプ
- 使用場所 (ファイル、行番号)
- 使用理由 (意図)
- 実装方法
2. 実装を評価します
- 正しく実装されているか?
- 一貫した使用法か?
- ユースケースに適しているか?
3. バリエーションを記録します
- さまざまな実装
- コンテキストへの適応
- 標準からの逸脱
フェーズ 3: 統合とレポート
1. 調査結果を分類します
- パターンタイプ別にグループ化
- レイヤー/コンポーネント別に整理
- 重要度で優先順位付け
2. メタパターンを識別します
- 全体的なアーキテクチャスタイル
- 主要なパラダイム (OOP, FP, etc.)
- 一貫性レベル
3. インサイトを提供します
- どのパターンがうまく機能するか
- どこにパターンが欠落しているか
- リファクタリングの機会
- 一貫性の改善
パターンカテゴリ
設計パターン (Gang of Four)
生成パターン
Factory Pattern
- 目的: 正確なクラスを指定せずにオブジェクトを作成する
- 兆候: factory(), create(), build() メソッド
- ファイル: factories/, creators/
Singleton Pattern
- 目的: 単一のインスタンスをグローバルに提供する
- 兆候: getInstance(), static instance, private constructor
- ファイル: config/, services/
Builder Pattern
- 目的: 複雑なオブジェクトを段階的に構築する
- 兆候: builder(), withX() チェーニングメソッド
- ファイル: builders/, constructors/
Prototype Pattern
- 目的: 既存のオブジェクトを複製する
- 兆候: clone(), copy() メソッド
- ファイル: prototypes/, templates/
Abstract Factory Pattern
- 目的: 関連オブジェクトのファミリ
- 兆候: 複数のファクトリメソッド、製品ファミリ
- ファイル: factories/abstract/
構造パターン
Adapter Pattern
- 目的: インターフェースの互換性
- 兆候: adapter クラス、インターフェース変換
- ファイル: adapters/, wrappers/
Decorator Pattern
- 目的: 変更せずに動作を追加する
- 兆候: Wrapper クラス、拡張された機能
- ファイル: decorators/, wrappers/
Facade Pattern
- 目的: 複雑なシステムへの簡略化されたインターフェース
- 兆候: 複雑さを隠す高レベル API
- ファイル: facades/, api/
Proxy Pattern
- 目的: 別のオブジェクトのプレースホルダー/サロゲート
- 兆候: Proxy クラス、遅延初期化
- ファイル: proxies/, surrogates/
Composite Pattern
- 目的: ツリー構造、部分-全体の階層
- 兆候: 再帰的な構造、子/親の関係
- ファイル: composites/, tree/
振る舞いパターン
Observer Pattern
- 目的: 状態の変化を複数のオブジェクトに通知する
- 兆候: subscribe(), notify(), event emitters
- ファイル: observers/, events/, pubsub/
Strategy Pattern
- 目的: 交換可能なアルゴリズム
- 兆候: Strategy インターフェース、アルゴリズム選択
- ファイル: strategies/, algorithms/
Command Pattern
- 目的: リクエストをオブジェクトとしてカプセル化する
- 兆候: Command クラス、execute() メソッド、undo/redo
- ファイル: commands/, actions/
State Pattern
- 目的: 状態に基づく動作の変更
- 兆候: State クラス、遷移メソッド
- ファイル: states/, state-machine/
Template Method Pattern
- 目的: カスタマイズ可能なステップを持つアルゴリズムのスケルトン
- 兆候: テンプレートメソッドを持つ抽象基本クラス
- ファイル: templates/, base-classes/
Iterator Pattern
- 目的: 要素へのシーケンシャルアクセス
- 兆候: next(), hasNext(), iterators
- ファイル: iterators/, collections/
Chain of Responsibility
- 目的: ハンドラーのチェーンに沿ってリクエストを渡す
- 兆候: ハンドラーチェーン、next() 委譲
- ファイル: handlers/, middleware/
アーキテクチャパターン
MVC (Model-View-Controller)
- 構造: models/, views/, controllers/
- 兆候: データ、UI、ロジックの分離
MVVM (Model-View-ViewModel)
- 構造: models/, views/, viewmodels/
- 兆候: データバインディング、リアクティブな更新
Repository Pattern
- 構造: repositories/, models/
- 兆候: データアクセス抽象化
Service Layer Pattern
- 構造: services/, domain/
- 兆候: ビジネスロジックのカプセル化
Layered Architecture
- 構造: presentation/, business/, data/, infrastructure/
- 兆候: 明確なレイヤー境界
Microservices Architecture
- 構造: 複数のサービス、それぞれがデプロイ可能
- 兆候: サービス境界、API、イベントバス
Event-Driven Architecture
- 構造: events/, handlers/, publishers/
- 兆候: パブリッシュ/サブスクライブ、イベントハンドラー
Hexagonal Architecture (Ports & Adapters)
- 構造: core/, ports/, adapters/
- 兆候: 外部の懸念事項から隔離されたコアドメイン 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
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
1. Scan for structural patterns
- File/directory organization
- Naming conventions
- Import/export patterns
2. Identify design patterns
- Creational (Factory, Singleton, Builder)
- Structural (Adapter, Decorator, Facade)
- Behavioral (Observer, Strategy, Command)
3. Recognize architectural patterns
- MVC, MVVM, MVP
- Layered architecture
- Microservices
- Event-driven
- Repository pattern
Phase 2: Pattern Analysis
1. Document each pattern
- Pattern name and type
- Where it's used (files, line numbers)
- Why it's used (intent)
- How it's implemented
2. Evaluate implementation
- Correctly implemented?
- Consistent usage?
- Appropriate for use case?
3. Note variations
- Different implementations
- Adaptations to context
- Deviations from standard
Phase 3: Synthesis & Reporting
1. Categorize findings
- Group by pattern type
- Organize by layer/component
- Prioritize by importance
2. Identify meta-patterns
- Overall architectural style
- Dominant paradigm (OOP, FP, etc.)
- Consistency level
3. Provide insights
- What patterns work well
- Where patterns are missing
- Refactoring opportunities
- Consistency improvements
Pattern Categories
Design Patterns (Gang of Four)
Creational Patterns
Factory Pattern
- Purpose: Object creation without specifying exact class
- Signs: factory(), create(), build() methods
- Files: factories/, creators/
Singleton Pattern
- Purpose: Single instance globally
- Signs: getInstance(), static instance, private constructor
- Files: config/, services/
Builder Pattern
- Purpose: Complex object construction step-by-step
- Signs: builder(), withX() chaining methods
- Files: builders/, constructors/
Prototype Pattern
- Purpose: Clone existing objects
- Signs: clone(), copy() methods
- Files: prototypes/, templates/
Abstract Factory Pattern
- Purpose: Families of related objects
- Signs: Multiple factory methods, product families
- Files: factories/abstract/
Structural Patterns
Adapter Pattern
- Purpose: Interface compatibility
- Signs: adapter classes, interface conversion
- Files: adapters/, wrappers/
Decorator Pattern
- Purpose: Add behavior without modifying
- Signs: Wrapper classes, enhanced functionality
- Files: decorators/, wrappers/
Facade Pattern
- Purpose: Simplified interface to complex system
- Signs: High-level API hiding complexity
- Files: facades/, api/
Proxy Pattern
- Purpose: Placeholder/surrogate for another object
- Signs: Proxy classes, lazy initialization
- Files: proxies/, surrogates/
Composite Pattern
- Purpose: Tree structures, part-whole hierarchies
- Signs: Recursive structures, children/parent relationships
- Files: composites/, tree/
Behavioral Patterns
Observer Pattern
- Purpose: Notify multiple objects of state changes
- Signs: subscribe(), notify(), event emitters
- Files: observers/, events/, pubsub/
Strategy Pattern
- Purpose: Interchangeable algorithms
- Signs: Strategy interfaces, algorithm selection
- Files: strategies/, algorithms/
Command Pattern
- Purpose: Encapsulate requests as objects
- Signs: Command classes, execute() methods, undo/redo
- Files: commands/, actions/
State Pattern
- Purpose: Behavior changes based on state
- Signs: State classes, transition methods
- Files: states/, state-machine/
Template Method Pattern
- Purpose: Algorithm skeleton with customizable steps
- Signs: Abstract base class with template method
- Files: templates/, base-classes/
Iterator Pattern
- Purpose: Sequential access to elements
- Signs: next(), hasNext(), iterators
- Files: iterators/, collections/
Chain of Responsibility
- Purpose: Pass request along chain of handlers
- Signs: Handler chains, next() delegation
- Files: handlers/, middleware/
Architectural Patterns
MVC (Model-View-Controller)
- Structure: models/, views/, controllers/
- Signs: Separation of data, UI, logic
MVVM (Model-View-ViewModel)
- Structure: models/, views/, viewmodels/
- Signs: Data binding, reactive updates
Repository Pattern
- Structure: repositories/, models/
- Signs: Data access abstraction
Service Layer Pattern
- Structure: services/, domain/
- Signs: Business logic encapsulation
Layered Architecture
- Structure: presentation/, business/, data/, infrastructure/
- Signs: Clear layer boundaries
Microservices Architecture
- Structure: Multiple services, each deployable
- Signs: Service boundaries, APIs, event buses
Event-Driven Architecture
- Structure: events/, handlers/, publishers/
- Signs: Publish/subscribe, event handlers
Hexagonal Architecture (Ports & Adapters)
- Structure: core/, ports/, adapters/
- Signs: Core domain isolated from external concerns
Code-Level Patterns
Naming Conventions
- camelCase, PascalCase, snake_case, kebab-case
- Prefixes: is/has/get/set/handle/on
- Suffixes: -er, -or, -able, -Service, -Controller
File Organization Patterns
- Feature-based (by domain)
- Layer-based (by type)
- Atomic design (atoms, molecules, organisms)
- Flat vs. nested structures
Module Patterns
- CommonJS: module.exports, require()
- ES Modules: export, import
- Barrel exports: index.js re-exports
- Namespace patterns
Error Handling Patterns
- Try-catch blocks
- Error boundaries (React)
- Result types (Ok/Err)
- Exception hierarchies
Async Patterns
- Callbacks
- Promises
- Async/await
- Observables/Streams
Analysis Strategies
Finding Design Patterns
# Factory Pattern
grep -r "factory\|create.*Function\|build.*Function" --include="*.ts"
# Singleton Pattern
grep -r "getInstance\|static.*instance" --include="*.js"
# Observer Pattern
grep -r "subscribe\|addEventListener\|on\(" --include="*.ts"
# Strategy Pattern
grep -r "interface.*Strategy\|class.*Strategy" --include="*.ts"
# Decorator Pattern
grep -r "@.*decorator\|class.*Decorator" --include="*.ts"
Finding Architectural Patterns
# MVC/MVVM structure
ls -la | grep -E "models|views|controllers|viewmodels"
# Repository pattern
grep -r "Repository" --include="*.ts"
find . -type d -name "*repository*"
# Service layer
find . -type d -name "*service*"
grep -r "class.*Service" --include="*.ts"
# Layered architecture
ls -la | grep -E "presentation|business|data|infrastructure"
Finding Code Patterns
# Naming patterns
grep -r "^export (function|class|const)" --include="*.ts" | head -50
# Import patterns
grep -r "^import" --include="*.ts" | sort | uniq -c | sort -rn
# Repeated code blocks
# (Manual analysis of similar structures)
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:
python {baseDir}/scripts/pattern-detector.py --directory ./src
bash {baseDir}/scripts/duplicate-finder.sh ./src
python {baseDir}/scripts/convention-analyzer.py --path ./src
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
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
## 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
# 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
## Code Duplication Analysis ### High Similarity (Consider Refactoring) #### User Validation Logic - **Files**: - `src/auth/validate.ts:15-35` - `src/api/users/validate.ts:22-42` - `src/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
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 -
Recognize architectural pattern
- Primary Pattern: Layered Architecture
- Secondary Pattern: Repository Pattern (in services/)
- State Management: Centralized store (Redux/similar)
-
Document architecture
## Architecture Analysis ### Overall Pattern **Layered Architecture** with clear separation of concerns ### Layers 1. **Presentation** (`components/`) - React components - UI logic - User interaction 2. **Business Logic** (`services/`) - Business rules - Data transformation - API orchestration 3. **Data Access** (`api/`) - HTTP clients - API endpoints - Data fetching 4. **State Management** (`store/`) - Global state - Actions and reducers - State selectors ### Data Flow Component → Service → API → Service → Store → Component ### Strengths - Clear separation of concerns - Testable layers - Maintainable structure ### Considerations - Some business logic in components (could be moved to services) - API calls sometimes bypass service layer
Common Anti-Patterns to Identify
God Object/God Class
Signs:
- One class/object does too much
- Thousands of lines
- Many responsibilities
- Hard to maintain
Example:
class ApplicationManager {
// Handles auth, routing, data, UI, everything
}
Spaghetti Code
Signs:
- No clear structure
- Tangled dependencies
- Hard to follow flow
- Minimal abstraction
Example:
- Everything in one file
- No functions/modules
- Global variables everywhere
Copy-Paste Programming
Signs:
- Duplicated code blocks
- Similar functions with slight variations
- No shared abstractions
Solution: Extract to shared functions/modules
Magic Numbers/Strings
Signs:
- Hard-coded values without explanation
- Unclear constants
- No named constants
Example:
if (status === 3) { /* what is 3? */ }
Solution: const STATUS_ACTIVE = 3;
Tight Coupling
Signs:
- Direct dependencies everywhere
- Hard to test in isolation
- Changes ripple through system
Solution: Dependency injection, interfaces
Pattern Analysis Output Template
## Pattern Analysis Report
### Overview
[Brief summary of architectural style and dominant patterns]
### Design Patterns Found
#### [Pattern Name]
- **Type**: Creational/Structural/Behavioral
- **Location**: `file/path.ts:lines`
- **Purpose**: [Why this pattern exists]
- **Implementation**: [How it's implemented]
- **Quality**: ✓ Well-implemented / ⚠ Needs improvement
- **Notes**: [Additional observations]
### Architectural Patterns
#### Overall Architecture
- **Pattern**: [Architecture type]
- **Structure**: [Directory/layer organization]
- **Data Flow**: [How data moves through system]
- **Strengths**: [What works well]
- **Weaknesses**: [What could improve]
### Code-Level Patterns
#### Naming Conventions
- **Functions**: [camelCase, verb-first, etc.]
- **Classes**: [PascalCase, noun-based, etc.]
- **Files**: [kebab-case, PascalCase, etc.]
- **Consistency**: ✓ High / ⚠ Medium / ✗ Low
#### File Organization
- **Strategy**: [Feature-based, type-based, etc.]
- **Structure**: [Flat, nested, hybrid]
- **Consistency**: [Assessment]
### Repeated Patterns
#### [Pattern Description]
- **Occurrences**: [Number of times, locations]
- **Variation**: [How consistent is usage]
- **Assessment**: [Good repetition or duplication?]
- **Action**: [Extract, refactor, or leave as-is]
### Anti-Patterns Detected
#### [Anti-Pattern Name]
- **Location**: `file/path.ts`
- **Issue**: [What's problematic]
- **Impact**: [How it affects code quality]
- **Recommendation**: [How to fix]
### Recommendations
1. **[Priority]** [Recommendation]
- Current: [Current state]
- Proposed: [Desired state]
- Benefit: [Why this helps]
- Effort: [Low/Medium/High]
### Summary
**Strengths**:
- [What's done well]
**Areas for Improvement**:
- [What could be better]
**Overall Assessment**: [Quality rating and summary]
Important Notes
- This skill activates automatically when pattern analysis is needed
- Look for both explicit patterns (named classes) and implicit patterns (recurring structures)
- Consider context—not all "patterns" need fixing
- Distinguish between helpful patterns and problematic anti-patterns
- Always provide file references with line numbers
- Balance thoroughness with actionability
- Prioritize findings by impact
- Suggest refactoring when beneficial, not just possible
- Recognize that some duplication is acceptable
- Consider team familiarity with patterns when recommending
Remember: Patterns are tools, not goals. Identify patterns to understand the codebase better and improve maintainability, not to force pattern application everywhere.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (17,212 bytes)
- 📎 README.md (2,501 bytes)
- 📎 references/pattern-catalog.md (24,840 bytes)
- 📎 references/pattern-quick-reference.md (8,774 bytes)
- 📎 scripts/pattern-detector.py (3,998 bytes)