MCP HubMCP Hub
スキル一覧に戻る

SQLite Memory ACL Query Patterns

masharratt
更新日 Today
68 閲覧
9
1
9
GitHubで表示
その他general

について

このスキルは、分散メモリシステムにおけるマルチレベルアクセス制御を実装するための高度なSQLiteクエリパターンを提供します。エージェント固有からシステム全体まで5段階のACLレベルにわたるデータアクセスを、適切な暗号化と保持ポリシーで管理できます。さまざまな組織スコープにわたる詳細な権限制御を必要とする、セキュアなマルチテナントアプリケーションの構築にご利用ください。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/masharratt/claude-flow-novice
Git クローン代替
git clone https://github.com/masharratt/claude-flow-novice.git ~/.claude/skills/SQLite Memory ACL Query Patterns

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント


name: SQLite Memory ACL Query Patterns description: Advanced query strategies for multi-level access control in distributed memory systems version: 2.1 sprint: skills allowed-tools:

  • Bash
  • Read
  • SQLite
  • Redis complexity: Advanced

SQLite Memory: ACL Query Patterns

1. ACL Levels Overview

LevelScopeEncryptionUse CaseMax Duration
1AgentAES-256Personal workspace24h
2TeamAES-256Team collaboration7d
3SwarmNoneInter-agent coordination30d
4ProjectNoneLong-term project tracking90d
5SystemMaster KeyAudit & Compliance365d

2. Query Patterns

Level 1 (Agent-Private)

// Strict agent-level encryption
await memory.set('agent_secret', value, {
  agentId: 'unique_agent_id',
  aclLevel: 1,
  encrypt: true
})

Level 2 (Team-Scoped)

// Team-level shared memory with encryption
await memory.set('team_strategy', value, {
  teamId: 'engineering_team',
  aclLevel: 2,
  encrypt: true
})

Level 3 (Swarm-Coordination)

// Lightweight, unencrypted swarm coordination
await memory.set('swarm_status', value, {
  swarmId: 'skills_sprint_2_1',
  aclLevel: 3
})

Level 4 (Project-Wide)

// Project-level persistent storage
await memory.set('project_metrics', value, {
  projectId: 'claude_flow_novice',
  aclLevel: 4,
  ttl: 90 * 24 * 60 * 60  // 90 days
})

Level 5 (System Audit)

// High-security system audit logging
await memory.set('system_audit_log', value, {
  aclLevel: 5,
  encrypt: 'master_key',
  ttl: 365 * 24 * 60 * 60  // 1 year
})

3. Redis Integration

Hot Cache Strategy

  • In-memory storage with 1-hour expiration
  • Real-time coordination via pub/sub
  • Automatic pruning every 15 minutes

Cold Storage (SQLite)

  • Persistent storage with graduated TTL
  • Backup and archival mechanism
  • Encrypted backups for sensitive levels

4. TTL Management

Data TypeRedis TTLSQLite TTLCleanup Strategy
Agent Data1h24hAggressive pruning
Team Data4h7dWeekly rotation
Swarm Data12h30dMonthly archival
Project Data24h90dQuarterly backup
System Audit48h365dAnnual compliance

5. Sample ACL Queries (acl-queries.sql)

-- Level 1: Agent-Private Query
SELECT * FROM memory
WHERE agent_id = ?
  AND acl_level = 1
  AND encrypted = TRUE;

-- Level 3: Swarm Coordination Query
SELECT * FROM memory
WHERE swarm_id = ?
  AND acl_level = 3
  AND created_at > (NOW() - INTERVAL 30 DAY);

6. TTL Cleanup Script (ttl-cleanup.sh)

#!/bin/bash
# Automated memory cleanup script

# Level 1 (Agent) - Daily cleanup
sqlite3 memory.db "DELETE FROM memory
  WHERE acl_level = 1 AND
  created_at < datetime('now', '-1 day');"

# Level 5 (System Audit) - Yearly archival
sqlite3 memory.db "INSERT INTO audit_archive
  SELECT * FROM memory
  WHERE acl_level = 5 AND
  created_at < datetime('now', '-1 year');"

7. Performance Considerations

  • Read operations: <5ms (Redis), <20ms (SQLite)
  • Write operations: <60ms
  • Encryption overhead: ~10-15ms per operation

8. Failure & Recovery

  • Automatic fallback from Redis to SQLite
  • Partial data recovery mechanisms
  • Graceful degradation on connection loss

Confidence Assessment

Confidence Score: 0.92

  • Comprehensive multi-level design
  • Clear separation of concerns
  • Robust encryption strategy
  • Flexible TTL management

Redis Coordination Payload

{
  "design": "SQLite Memory ACL",
  "confidence": 0.92,
  "version": "2.1",
  "status": "completed"
}

GitHub リポジトリ

masharratt/claude-flow-novice
パス: legacy/v1/docs/skills

関連スキル

algorithmic-art

メタ

This Claude Skill creates original algorithmic art using p5.js with seeded randomness and interactive parameters. It generates .md files for algorithmic philosophies, plus .html and .js files for interactive generative art implementations. Use it when developers need to create flow fields, particle systems, or other computational art while avoiding copyright issues.

スキルを見る

subagent-driven-development

開発

This skill executes implementation plans by dispatching a fresh subagent for each independent task, with code review between tasks. It enables fast iteration while maintaining quality gates through this review process. Use it when working on mostly independent tasks within the same session to ensure continuous progress with built-in quality checks.

スキルを見る

executing-plans

デザイン

Use the executing-plans skill when you have a complete implementation plan to execute in controlled batches with review checkpoints. It loads and critically reviews the plan, then executes tasks in small batches (default 3 tasks) while reporting progress between each batch for architect review. This ensures systematic implementation with built-in quality control checkpoints.

スキルを見る

cost-optimization

その他

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

スキルを見る