pattern
БесплатноБез исполняемых скриптовНе проверенLearn design patterns from the current codebase
Об этом скилле
SourceAtlas: Pattern Learning Mode
Constitution: ANALYSIS_CONSTITUTION.md v1.0
Context
Pattern requested: $ARGUMENTS Goal: Learn how THIS specific codebase implements the requested pattern Time Limit: 5-10 minutes maximum
Quick Start
- Check cache (skip if
--forceflag present) - Detect pattern using
find-patterns.shscript - Apply output mode (--brief / --full / smart)
- Analyze top 2-3 files (high-entropy priority)
- Extract conventions and best practices
- Generate implementation guide
- Verify output using verification-guide.md
- Auto-save to
.sourceatlas/patterns/
Your Task
You are analyzing how THIS codebase implements a specific pattern by:
- Finding 2-3 best example files
- Extracting design patterns and conventions
- Providing actionable implementation guidance
Output Modes
| Parameter | Behavior | Use Case |
|---|---|---|
--brief |
List files only | Quick file browser |
--full |
Analyze all files | Deep learning |
| (default) | Smart: ≤5 files→full; >5→selection UI | Balanced |
Core Workflow
Execute these steps in order. See workflow.md for complete details.
Step 0: Parse Output Mode (10 seconds)
Purpose: Determine how much analysis to perform.
Detect flags:
--brief→ List files only, no analysis--full→ Analyze all found files- No flag → Smart mode (adapt based on file count)
→ See workflow.md#step-0
Step 1: Execute Pattern Detection (1-2 minutes)
Purpose: Find relevant files using optimized search.
Use find-patterns.sh script first:
# Locate script (global → local)
if [ -f ~/.claude/scripts/atlas/find-patterns.sh ]; then
SCRIPT_PATH=~/.claude/scripts/atlas/find-patterns.sh
elif [ -f scripts/atlas/find-patterns.sh ]; then
SCRIPT_PATH=scripts/atlas/find-patterns.sh
fi
bash "$SCRIPT_PATH" "$ARGUMENTS"
Supported patterns:
- api endpoint / api / endpoint
- background job / job / queue
- swiftui view / view
- view controller / viewcontroller
- authentication / auth / login
- file upload / upload
- database query / database
- networking / network
If unsupported: Fallback to manual Glob/Grep search
→ See workflow.md#step-1
Step 1.5: ast-grep Enhanced Search (Optional)
Purpose: More precise search for content-based patterns.
Use ast-grep-search.sh for:
- async/await patterns
- suspend functions (Kotlin)
- custom hooks (React)
- goroutines (Go)
Graceful degradation: Script handles ast-grep unavailability
→ See workflow.md#step-1-5
Step 2: Apply Output Mode Logic (30 seconds)
Purpose: Decide analysis depth based on file count.
Smart mode logic:
FILE_COUNT = 0 → "No files found"
FILE_COUNT ≤ 5 → Full analysis
FILE_COUNT > 5 → Selection interface
Brief mode: List files, end immediately
Full mode: Analyze all files (warn if >10)
→ See workflow.md#step-2
Step 3: Analyze Selected Files (3-5 minutes)
Purpose: Extract patterns from 2-3 best examples.
High-entropy priority:
- ✅ Main implementation files
- ✅ Complete examples (100-500 lines)
- ✅ Well-structured production code
- ❌ NOT: Utilities, trivial code, generated files
Focus areas:
- Overall structure
- Standard flow
- Naming conventions
- Dependencies
- Error handling
- Configuration
→ See workflow.md#step-3
Step 4: Extract the Pattern (2 minutes)
Purpose: Distill findings into reusable guidance.
Extract:
- How this codebase handles it (2-3 sentences)
- Standard flow (numbered steps)
- Key conventions (bullet points)
- Testing patterns
- Common pitfalls
→ See workflow.md#step-4
Step 5: Find Related Tests (1 minute, optional)
Purpose: Understand how pattern is tested.
find . \( -path "*/test/*" -o -path "*/tests/*" -o -name "*.test.*" \) \
-type f -not -path "*/node_modules/*" | head -20
→ See workflow.md#step-5
Step 6: Generate Implementation Guide (1 minute)
Purpose: Provide concrete steps to follow.
Create actionable, step-by-step guide with:
- Specific file locations
- Code structure templates
- Configuration steps
- Testing approach
→ See workflow.md#step-6
Output Format
Your analysis should follow this Markdown structure:
🗺️ SourceAtlas: Pattern
───────────────────────────────
🧩 [Pattern Name] │ [N] files found
## Overview
[2-3 sentence summary]
## Best
Установить pattern в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
BashGlobGrepReadWriteВложенные файлы
FAQ
Что делает скилл pattern?
Learn design patterns from the current codebase
Как установить скилл pattern?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pattern запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic