スキル一覧に戻る
dug-21

save-pattern

by dug-21

0🍴 0📅 2026年1月21日
GitHubで見るManusで実行

SKILL.md


name: "save-pattern" description: "Store APPLICATION patterns (architecture, procedures, conventions) in AgentDB's skills table. NOT for swarm/transient memory."

Save Pattern - Store Application Knowledge

What This Skill Does

Stores application patterns to AgentDB's skills table with semantic embeddings. Patterns are searchable via get-pattern using skill search.

Use this AFTER completing work to share reusable knowledge with future agents.


Quick Reference

# Store a new pattern
agentdb skill create "pattern-name" "description of the pattern" "optional details or code"

# Check existing patterns
agentdb db stats

# Search before creating (avoid duplicates)
agentdb skill search "pattern name" 3

Primary Method: Skill Create

agentdb skill create "<name>" "<description>" "[code/details]"

Parameters (positional)

PositionParameterDescriptionRequired
1namePattern identifier (kebab-case)Yes
2descriptionFull pattern contentYes
3codeOptional implementation detailsNo

Examples

Store Architecture Pattern

agentdb skill create \
  "domain-adapter-source" \
  "Domain Adapter Pattern for Data Sources: All data sources implement the Source trait for uniform handling. Steps: 1) Create struct implementing Source trait, 2) Implement fetch() -> Vec<TimeSeriesPoint>, 3) Implement health_check() -> HealthStatus. Related files: core/src/traits.rs, core/src/sources/http_poll.rs" \
  "tags: hexagonal, traits, source, architecture"

Store Development Procedure

agentdb skill create \
  "add-data-stream" \
  "Add New Data Stream: Prerequisites - Stream config YAML ready, etcd running. Steps: 1) Create config/base/streams/{stream-id}/config.yaml, 2) Define fields array with name, source_path, unit, 3) Run ./deploy.sh sync, 4) Verify: etcdctl get /streams/{id}/config" \
  "tags: streams, config, etcd, development"

Store Troubleshooting Pattern

agentdb skill create \
  "mqtt-data-not-appearing" \
  "MQTT Data Not Appearing - Symptoms: Sensor data not in Parquet files, no errors in logs. Root Causes: 1) Topic mismatch, 2) Missing stream_id in routing. Solution: 1) Check mosquitto_sub -t # for actual topics, 2) Verify config.yaml source.topics matches, 3) Ensure IngestionRouter tags stream_id" \
  "tags: mqtt, debugging, parquet, troubleshooting"

Store Product Vision

agentdb skill create \
  "ndp-product-vision" \
  "The Neural Data Platform is a generic, extensible data ingestion and analytics system built in Rust. Uses Domain Adapter Pattern (hexagonal architecture) for pluggable sources/stores, configuration-driven stream management, Bronze->Silver->Gold data lake model." \
  "tags: vision, product, architecture"

Pattern Categories

Use consistent naming prefixes:

CategoryPrefixExamples
Architecturearch-arch-domain-adapter, arch-data-layers
Developmentdev-dev-add-stream, dev-implement-source
Deploymentdeploy-deploy-docker, deploy-raspberry-pi
Troubleshootingdebug-debug-mqtt-issues, debug-parquet-errors
Conventionsconv-conv-naming, conv-code-style

Best Practices

1. Check First

Always search before creating to avoid duplicates:

agentdb skill search "pattern topic" 5

2. Be Specific

Include concrete details:

  • Good: "Create config/base/streams/{id}/config.yaml with fields array containing name, source_path, unit"
  • Bad: "Create a config file"

3. Include Tags

Add tags in the code/details field for better searchability:

"tags: category, topic1, topic2"

4. Reference Files

Mention actual code paths:

"Related files: core/src/traits.rs, docs/procedures/HOW_TO_ADD_STREAM.md"

5. Include Verification

How to confirm the pattern worked:

"Verify: Run cargo test, check logs for 'Source initialized'"

Update vs. Create New

AgentDB tracks skill usage and success rates. To update a pattern:

  1. Search for existing: agentdb skill search "pattern-name" 3
  2. If found with low success rate: Create improved version with -v2 suffix
  3. If found with high success rate: Only create new if fundamentally different
# Original
agentdb skill create "add-stream" "Original approach..."

# Updated version (when original is insufficient)
agentdb skill create "add-stream-v2" "Updated approach with retention field requirement..."

The Pattern Workflow

1. BEFORE work:  get-pattern  → Search for existing patterns
2. DURING work:  Note gaps, discover new approaches
3. AFTER work:   save-pattern → Store NEW discoveries (THIS SKILL)
                 reflexion    → Record if existing patterns helped
                 learner      → Auto-discover patterns from episodes

  • get-pattern - Search patterns BEFORE work (always check first)
  • reflexion - Record feedback on pattern effectiveness
  • learner - Auto-discover patterns from successful episodes

What NOT to Use This For

Don't StoreUse Instead
Swarm coordination stateclaude-flow memory tools
Agent task statusclaude-flow task tools
Temporary working memoryclaude-flow memory with TTL
Session-specific contextclaude-flow memory tools
Feedback on patternsreflexion skill

Patterns are PERMANENT application knowledge, not transient swarm state.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です