vamfi/claude-user-memory/pattern-recognition
Claude Code and agent skill by vamfi/claude-user-memory
- community
Checking that the SKILL.md file is still in the repository.
Systematic methodology for identifying, capturing, and documenting reusable patterns from implementations. Enables automatic learning and knowledge-core.md updates. Claude invokes this after successful implementations to preserve institutional knowledge.
Install
npx vskill@latest install vamfi/claude-user-memory/pattern-recognitionSKILL.md
Pattern Recognition Skill
This skill provides systematic methodology for identifying reusable patterns from completed work and automatically updating the knowledge core to preserve institutional knowledge across sessions.
When Claude Should Use This Skill
Claude will automatically invoke this skill when:
- Implementation successfully completed (tests passing)
- @code-implementer finishes major feature work
- Chief-architect synthesizes results from multiple agents
- User explicitly requests pattern documentation
- Stop hook triggers (end of session)
Core Principles (BRAHMA Constitution)
- Knowledge preservation - Capture patterns for future use
- Reproducibility - Document enough detail to replicate pattern
- Simplicity - Extract essential pattern, not every detail
- Verification - Patterns should be validated by actual code
- Adaptive learning - Learn from outcomes to suggest proven patterns (NEW v3.1)
Before Implementation (Pattern Suggestion - NEW v3.1)
Trigger: User requests feature implementation via /workflow, /implement, or direct agent invocation
Purpose: Leverage past implementation success to accelerate current work by suggesting proven patterns proactively
Pattern Suggestion Workflow
Step 1: Context Extraction (< 5 seconds)
Extract context tags from user request to find similar past implementations:
- Technology keywords: "nodejs", "python", "redis", "postgresql", "express", "fastapi"
- Problem domain: "authentication", "caching", "logging", "error-handling", "validation"
- Solution type: "service-layer", "repository", "factory", "middleware", "api"
Example:
Step 2: Pattern Lookup (< 2 seconds)
Graceful Degradation:
Step 3: Present Suggestions (user interaction)
If HIGH confidence patterns found, show top 3:
Step 4: User Response Handling
- User accepts (y): Track acceptance, use pattern in implementation
- User rejects (n): Track rejection, proceed without pattern
- User views (view): Show full pattern from knowledge-core.md, ask again
- No response: Proceed without pattern (don't block workflow)
Step 5: Record User Feedback
Update pattern acceptance tracking in pattern-index.json:
Performance Target: < 7 seconds total for suggestion workflow
Pattern Recognition Methodology
Step 1: Implementation Analysis (< 30 seconds)
Objective: Review what was just implemented to identify patterns
Analysis questions:
- Architectural patterns:
- What high-level structure was used? (Service layer, Repository, Factory, etc.)
- How are concerns separated? (Business logic, data access, presentation)
- What design patterns were applied? (Singleton, Strategy, Observer, etc.)
- Integration patterns:
- How does new code connect to existing code?
- What interfaces/contracts were established?
- How is dependency injection handled?
- Error handling patterns:
- How are errors caught and handled?
- What logging/monitoring was added?
- How are errors propagated to callers?
- Testing patterns:
- What test structure was used? (AAA: Arrange-Act-Assert, etc.)
- How are mocks/stubs created?
- What edge cases were covered?
- Configuration patterns:
- How are environment-specific values managed?
- Where do defaults live?
- How is configuration validated?
Data to extract:
- File paths demonstrating pattern
- Code snippets showing key concepts
- When this pattern should/shouldn't be used
- Alternatives considered and why rejected
Step 2: Pattern Classification (< 15 seconds)
Classify into knowledge-core.md sections:
Section 1: Architectural Principles (high-level rules)
- Broad guidelines affecting entire codebase
- Example: "Use dependency injection for all external services"
- Example: "All API routes must have auth middleware"
- Example: "Database queries must go through repository layer"
Section 2: Established Patterns (concrete implementations)
- Specific, reusable implementation patterns
- Include: Pattern name, context, implementation example, files
- Example: "Service Layer Pattern for business logic"
- Example: "Factory pattern for creating Redis clients"
Section 3: Key Decisions & Learnings (chronological log)
- Decisions made during specific implementations
- Include: Date, decision, rationale, alternatives considered
- Example: "2025-10-17: Chose Redis over Memcached for caching (reason: better data structure support)"
- Learnings from mistakes or discoveries
Classification criteria:
- Principle: Applies across many features/files
- Pattern: Reusable template for specific problem
- Decision: One-time choice with lasting impact
- Learning: New insight or gotcha discovered
Step 3: Pattern Documentation (< 30 seconds)
For each pattern identified, document:
// Minimal code example showing pattern // File: path/to/example.ts
Quality criteria:
- Actionable: Another developer can apply this pattern from the description
- Specific: Not vague generalities ("use good code" → ❌)
- Verified: Pattern is actually implemented in referenced files
- Complete: Includes when to use AND when not to use
Step 4: Knowledge Core Update (< 20 seconds)
Update `knowledge-core.md` following its structure:
Update protocol:
- Read current
knowledge-core.md - Check for duplicates (don't add pattern if it already exists)
- Append new patterns to appropriate sections
- Increment version number
- Update "Last Updated" timestamp
- Write updated file
Merge strategy (if pattern partially exists):
- Enhance existing pattern with new examples/files
- Note that pattern was "reinforced" in latest implementation
- Don't create duplicate entries
Step 5: Outcome Metrics Capture (< 10 seconds) - NEW v3.1
Purpose: Track implementation outcomes for pattern learning and confidence scoring
Metrics to Capture:
- Success/Failure Classification:
``python success = ( all_tests_passing AND quality_gates_passed AND no_rollback_required ) ``
- Implementation Duration:
``python duration_minutes = (end_time - start_time).total_seconds() / 60 # Start time: When @code-implementer begins # End time: When tests pass and implementation complete ``
- Quality Scores (if available from /workflow):
``python quality_score = (research_pack_score + implementation_plan_score) / 2 # Only available if full workflow used (research + plan phases) ``
- Self-Correction Count:
``python retry_count = number_of_self_correction_attempts # Reported by @code-implementer (0-3 range, lower is better) ``
- User Acceptance (if pattern was suggested):
``python pattern_was_accepted = user_selected_yes_to_suggestion ``
Data Structure:
Capture Process:
- Collect metrics from @code-implementer at end of implementation
- Classify success/failure based on tests and quality gates
- Calculate duration from timestamps
- Retrieve quality scores from research/plan phases (if available)
- Package into outcome_metrics structure
- Pass to pattern-index.json update step
Step 6: pattern-index.json Update (< 15 seconds) - NEW v3.1
Purpose: Update pattern metrics for adaptive learning and future suggestions
Update Workflow:
1. Read Current pattern-index.json:
2. Find or Create Pattern Entry:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingarchive/2026-09-26-install-md-migration/legacy/.claude/skills/pattern-recognition/skill.md
Popularity
- Repository stars
- 212
- Repository forks
- 32
- 7-day trend score
- 32
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
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/vamfi/claude-user-memory/pattern-recognition)