get-pattern

Retrieve APPLICATION patterns (architecture, procedures, conventions) from AgentDB skills table. Use BEFORE implementing to ensure consistency.

⭐5stars🔀1forks📁View on GitHub🕐Updated Jan 11, 2026

When & Why to Use This Skill

The get-pattern skill is a specialized utility designed to maintain architectural integrity and implementation consistency within a development project. By performing semantic searches against AgentDB, it allows developers to retrieve established application patterns, procedures, and conventions before writing code. This ensures that every new contribution aligns with project standards, utilizes proven success patterns, and avoids reinventing the wheel.

Use Cases

  • Architectural Alignment: Searching for specific design patterns like 'domain adapter' or 'hexagonal architecture' to guide the structure of a new feature.
  • Standardized Procedures: Retrieving step-by-step deployment guides or environment setup instructions (e.g., 'deploy to raspberry pi') to ensure error-free operations.
  • Convention Enforcement: Accessing project-specific naming conventions and code organization rules to maintain a clean and uniform codebase.
  • Knowledge Recovery: Using the fallback 'reflexion' search to synthesize context from past successful task executions when a formal pattern hasn't been documented yet.
  • Onboarding and Troubleshooting: Providing new team members with instant access to troubleshooting guides and 'how-to' patterns for common technical hurdles.
name"get-pattern"
description"Retrieve APPLICATION patterns (architecture, procedures, conventions) from AgentDB skills table. Use BEFORE implementing to ensure consistency."

Get Pattern - Retrieve Application Knowledge

What This Skill Does

Retrieves established application patterns (architecture, procedures, conventions) for the Neural Data Platform using AgentDB's semantic skill search.

Use this BEFORE implementing anything to ensure you follow project standards.


Quick Reference

# Search for patterns by description
npx agentdb skill search "domain adapter pattern" 5

# Fallback: search reflexion episodes for past experiences
npx agentdb reflexion retrieve "how to add a stream" --k 5 --only-successes

# View all stored patterns
npx agentdb db stats

npx agentdb skill search "<query>" <k>

Parameters

Parameter Description
<query> What you're looking for (semantic search)
<k> Number of results (default: 5)

Examples

# Find architecture patterns
npx agentdb skill search "domain adapter pattern" 5

# Find deployment procedures
npx agentdb skill search "deploy to raspberry pi" 3

# Find naming conventions
npx agentdb skill search "naming conventions streams fields" 3

# Find troubleshooting guides
npx agentdb skill search "mqtt data not appearing" 5

Fallback Method: Reflexion Retrieve

If no skill patterns exist, search past experiences:

npx agentdb reflexion retrieve "<query>" --k 5 --only-successes --synthesize-context

Parameters

Parameter Description
<query> Task description to find similar work
--k Number of results
--only-successes Only successful episodes
--min-reward Minimum success score (0-1)
--synthesize-context Generate coherent summary

Examples

# Find successful similar work
npx agentdb reflexion retrieve "HTTP source implementation" \
  --k 5 \
  --only-successes \
  --min-reward 0.7

# Get synthesized context
npx agentdb reflexion retrieve "timescaledb schema" \
  --k 10 \
  --synthesize-context

Pattern Categories

Category Example Queries
Architecture "domain adapter pattern", "hexagonal architecture"
Data Flow "ingestion pipeline", "bronze silver gold"
Development "add new stream", "implement source trait"
Deployment "docker deployment", "raspberry pi setup"
Troubleshooting "mqtt not working", "parquet write errors"
Conventions "naming conventions", "code organization"

Interpreting Results

Results from skill search include:

Field Meaning
Name Pattern identifier
Description The pattern content
Success Rate How often this pattern succeeded (0-100%)
Uses Number of times used

High-value patterns: Success Rate > 80% AND Uses > 3


Typical Workflow

# 1. Search for existing patterns
npx agentdb skill search "what I'm about to implement" 5

# 2. If found: Follow the pattern
# 3. If not found: Check reflexion for past experiences
npx agentdb reflexion retrieve "similar task" --k 5 --only-successes

# 4. After work: Record feedback
npx agentdb reflexion store "feature-id" "task" 0.9 true "Pattern worked well"

# 5. If you discovered something new: Save it
npx agentdb skill create "pattern-name" "description" "optional-details"

CRITICAL: Record Pattern Usage

After using a pattern, always use the reflexion skill to record whether it helped:

# Pattern worked well
npx agentdb reflexion store "dp-004" \
  "Used domain-adapter pattern for new HTTP source" \
  1.0 true \
  "Pattern was complete - followed steps exactly, tests passed"

# Pattern needed fixes
npx agentdb reflexion store "dp-004" \
  "Used add-stream pattern but needed adjustment" \
  0.6 true \
  "Pattern missing retention field - should update via save-pattern"

Without feedback, the system can't learn which patterns work.


If No Patterns Found

  1. Check pattern stats:

    npx agentdb db stats
    
  2. Search reflexion episodes:

    npx agentdb reflexion retrieve "your query" --k 10 --synthesize-context
    
  3. Check file-based documentation:

    • docs/architecture/ - Architecture documents
    • docs/procedures/ - Step-by-step procedures
    • product/features/*/architecture/ - Feature ADRs
  4. After implementing, store the new pattern via save-pattern


The Pattern Workflow

1. BEFORE work:  get-pattern  → Search for relevant patterns (THIS SKILL)
2. DURING work:  Apply the pattern, note what works/gaps
3. AFTER work:   reflexion    → Record if pattern helped (required)
                 save-pattern → Store NEW discoveries (if any)
                 learner      → Auto-discover patterns from episodes (periodic)

  • save-pattern - Store NEW patterns after discovering reusable approaches
  • reflexion - Record feedback on pattern effectiveness (REQUIRED after using patterns)
  • learner - Auto-discover patterns from successful episodes (user-invoked)

What NOT to Use This For

Don't Search For Use Instead
Current swarm status claude-flow swarm tools
Agent task state claude-flow task tools
Working memory claude-flow memory tools
Session context claude-flow memory with TTL

Patterns are PERMANENT application knowledge, not transient swarm state.