← 返回
未分类

Memory Manager EN

Manage WorkBuddy .workbuddy/memory files with analysis, search, token budget checks, cleanup previews, backup/export/import confirmation, and PROMPT_ template management.memory manager, memory analysis, memory search, token check, cache cleanup preview, memory backup, prompt templates
aakook
未分类 community v3.0.0 4 版本 100000 Key: 无需
★ 0
Stars
📥 165
下载
💾 0
安装
4
版本
#latest

概述

Memory Manager V3

中文摘要:当用户需要管理 WorkBuddy 工作区中的 .workbuddy/memory/ 记忆文件、Token 预算、缓存预览、备份导出、导入恢复或 PROMPT_ 模板时使用此 Skill。

Run commands from this skill directory. Use the bundled CLI:

python memory_manager.py --help
python memory_manager.py <command> <workspace>

is the folder that contains, or should contain, .workbuddy/memory/.

Use For

  • Analyze, search, load, rank, summarize, or report memory files.
  • Check estimated Token usage and trends.
  • Preview cache cleanup and memory cleanup.
  • Export or import memory data with explicit confirmation.
  • Manage prompt templates stored as PROMPT_*.md.

Do not use this skill for general file cleanup, code review, document conversion, or deleting unrelated files.

Inputs

Before running a command, identify:

  • Workspace path.
  • Intended action: read-only, preview, or write.
  • Search keyword, date range, tags, output archive, or prompt content when needed.

Read-Only Commands

These commands inspect data and can run without confirmation:

python memory_manager.py analyze <workspace>
python memory_manager.py search <keyword> <workspace>
python memory_manager.py load <workspace> --days 7
python memory_manager.py rank <workspace>
python memory_manager.py summarize <workspace>
python memory_manager.py report <workspace>
python memory_manager.py token-check <workspace>
python memory_manager.py token-trends <workspace> --period week
python memory_manager.py cache-reminder <workspace>
python memory_manager.py scan <workspace>
python memory_manager.py doctor <workspace>
python memory_manager.py prompt-list <workspace>
python memory_manager.py prompt-search <workspace> --keyword <keyword>

Preview Commands

Cleanup and deduplication commands are preview-only unless --execute is provided:

python memory_manager.py cache-clean <workspace>
python memory_manager.py clean <workspace>
python memory_manager.py auto-clean <workspace>
python memory_manager.py dedup <workspace>

Use --execute only after showing the preview and receiving explicit user confirmation:

python memory_manager.py cache-clean <workspace> --execute
python memory_manager.py clean <workspace> --execute
python memory_manager.py auto-clean <workspace> --execute
python memory_manager.py dedup <workspace> --execute

Export, Import, And Backup

Export writes a ZIP archive:

python memory_manager.py export <workspace> <output.zip>

Import writes files into the workspace and requires --confirm:

python memory_manager.py import <workspace> <input.zip> --confirm

Backup defaults to preview mode. Use --execute only after user confirmation:

python memory_manager.py backup <workspace> --path <backup_dir>
python memory_manager.py backup <workspace> --path <backup_dir> --execute

Prompt Templates

Prompt templates are stored under .workbuddy/memory/ with the PROMPT_ prefix:

python memory_manager.py prompt-list <workspace>
python memory_manager.py prompt-get <name> <workspace>
python memory_manager.py prompt-save <name> <workspace> --content "<prompt text>"
python memory_manager.py prompt-search <workspace> --keyword <keyword>

Language

The CLI supports Chinese and English interface output:

python memory_manager.py --lang zh analyze <workspace>
python memory_manager.py --lang en analyze <workspace>

Safety And Privacy

  • Treat memory files and exported ZIP files as sensitive user data.
  • Do not import, delete, archive, restore, or execute cleanup unless the user explicitly confirms.
  • Prefer preview commands before any write operation.
  • Do not claim permanent memory, automatic sync, perfect accuracy, or absolute safety.
  • Exported archives may contain private information; ask the user where to save them.
  • Import checks ZIP paths and size limits, but important memory changes still require user review.

References

  • Read references/cli-reference.md when exact command syntax is needed.
  • Read references/security.md before import, cleanup, backup, restore, or other write operations.

版本历史

共 4 个版本

  • v3.0.0 Added ✅ P2-3: TF-IDF semantic search (--tfidf flag) ✅ P2-4: Summary JSON schema version (schema_version: "1.0") ✅ P2-5: Cross-file reference [[YYYY-MM-DD]] / [[MEMORY]] support ✅ P2-6: Export encryption (--encrypt + AES-256-GCM) ✅ P2-2: pytest automated test suite (69 test cases) Fixed ✅ P1-1: retention_days default value changed from 1 → 7 ✅ P1-2: --agree / --force flags registered to 5 destructive commands ✅ P2-1: Cleaned 11 .pyc files under __pycache__/ Optimized Performance: 7 P0/P1 optimization patches (measured reduction 12–99.5%) Security: Six-layer ZIP defense + TTY confirmation mechanism 当前
    2026-06-14 21:31 安全 安全
  • v2.8.2 | Feature | Command | Effect | |---------|---------|--------| | **Incremental Loading** | `load --days 7 --mode brief` | Loads only 7-day memory, skips old files | | **Smart Summarization** | `summarize` / `struct-summarize` | Extracts headers, bullets, tables — no inflation for short files | | **Token Budget Alert** | `token-check` | 🟢🟡🔴 tri-color daily budget warning | | **Safe Cleanup** | `auto-clean` / `cache-clean` | Y/N confirmation, protected directories, symlink-safe | | **Bilingual** | `--lang en` | Instant English output, 183 i18n keys 100% synced | | **Backup & Restore** | `export` / `import` | ZIP export/import with zip-slip protection |
    2026-05-16 22:43 安全 安全
  • v2.8.1 V2.8.1 Changes – 🆕 Incremental Loading: load--days N loads files only from the past N days, saving 50–70% of tokens – 🆕 Summary Compression: limits output to 300 characters, saving an additional 30% of tokens – 🔒 Security fixes: resolved cache_clean path traversal issues, enhanced ZIP import security, and implemented deduplication confirmation – 🧹 Code optimization: reduced main() by 36%, SKILL.md by 86%, and removed 4 redundant files
    2026-05-01 19:11 安全 安全
  • v1.6.3 :sparkles: V2.6.3 New Features Feature Description Safety Function-level confirm Delete operations require explicit confirmation :white_check_mark: Safer static analysis Enhanced security Cloud Defense compatible :white_check_mark: Lower false positives :sparkles: V2.6 Core Upgrades Dimension V2.5 V2.6 Improvement Diagnostic Tool :x: :white_check_mark: One-click detection of config issues Setup Wizard :x: :white_check_mark: Guide first-time configuration User Feedback :x: :white_check_mark: Collect usage issues and suggestions Bug Fixes - :white_check_mark: Fixed hashlib import, progress bar, etc. :rocket: Core Features (21 total) Basic Features (V2.1) Memory Analysis (analyze) - Analyze memory file status Workspace Scan (scan) - Scan .workbuddy directory Cleanup Preview (preview) - Dry run mode Smart Cleanup (clean) - Preview and confirm execution Memory Archive (archive) - Compress and move Upgraded Features (V2.2) Summary Generation (summarize) - One-click generate all memory summaries Importance Ranking (rank) - Auto-classify core/normal/cold Smart Loading (load) - Load by ranking, save TOKENS Memory Search (search) - Fast keyword search HTML Report (html) - Visual chart display New Features (V2.3) Config Management (config) - View/modify retention strategy Auto Cleanup (auto-clean) - Scheduled archive of expired logs New Features (V2.4) Differentiated Cleanup - Push: next day, personal/work: every 5 days Content Filter (--content) - Filter cleanup scope by content type New Features (V2.5) :star::star::star: Content Deduplication (dedup) - MD5-based smart deduplication Token Stats (stats) - Consumption trend visualization Backup Sync (backup) - Local folder incremental backup Scheduled Tasks (schedule) - Scheduled execution of tasks New Features (V2.6) :new: Diagnostic Tool (doctor) - One-click detection of config issues Setup Wizard (wizard) - Guide first-time configuration User Feedback (feedback) - Collect usage issues and suggestions :moneybag: TOKEN Savings Principle Traditional (full load): Memory files: 10 × 5KB = 50KB → ~12500 TOKENS V2.2+ (smart load): ├── Core (10%) × 5KB = 5KB → ~1250 TOKENS ├── Normal (30%) × 500 char summary = 1.5KB → ~375 TOKENS └── Cold (60%) × compressed archive = 1KB → ~250 TOKENS Total: ~1875 TOKENS (85% savings) :computer: CLI Usage Guide Basic Commands bash 复制 # Analyze memory status memory_manager_en.py analyze # Scan workspace memory_manager_en.py scan # Execute cleanup memory_manager_en.py clean --force V2.3/V2.4 Command Quick Reference bash 复制 # === Summary & Ranking === # Generate all memory summaries memory_manager_en.py summarize # Memory importance ranking memory_manager_en.py rank # Smart load (default normal mode) memory_manager_en.py load # Load summaries only (most token-saving) memory_manager_en.py load --mode brief # Search memories memory_manager_en.py search -k project V2.4 Differentiated Auto Cleanup bash 复制 # View current config (with differentiated rules) memory_manager_en.py config # Differentiated auto cleanup preview memory_manager_en.py auto-clean # Execute differentiated auto cleanup memory_manager_en.py auto-clean --execute # Only clean push content memory_manager_en.py auto-clean --content push --execute V2.5 New Commands :star::star::star: bash 复制 V2.6 New Commands :new: bash 复制 # === Diagnostic Tool === # One-click detection of config issues memory_manager_en.py doctor # === Setup Wizard === memory_manager_en.py wizard # === User Feedback === # Submit bug report memory_manager_en.py feedback --type bug --content "Found an issue" :brain: Smart Ranking Principle Scoring Dimensions Dimension Weight Description Access Frequency 40% More recent accesses = more important Time Decay 30% New memories have higher weight Content Length 15% 1-10KB is optimal Keyword Match 15% Matches user's focus areas Ranking Results Level Threshold Load Strategy Token Consumption :red_circle: Core >=70% Full load High :yellow_circle: Normal 30-70% Summary load Medium :green_circle: Cold <30% Archive & compress Low :shield: Security Features Feature Description Symlink Protection Prevents path traversal Single File Limit Max 1MB Cumulative Read Limit Max 5MB Preview Confirmation Show list before cleanup Protected Directories memory/skills never deleted Content Classification Personal/work never auto-cleaned, requires confirmation Confirm Parameter Delete operations require explicit --execute flag Safe Resolve Path traversal detection Batch Size Limit Max 10 files per batch :chart_with_upwards_trend: Feature Comparison Feature V2.2 V2.3 V2.4 V2.5 V2.6 analyze/scan/preview/clean :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: archive/html :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: summarize :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: rank :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: load :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: search :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: config :x: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: auto-clean :x: :white_check_mark: :white_check_mark: :white_check_mark: :white_check_mark: Differentiated cleanup :x: :x: :white_check_mark: :white_check_mark: :white_check_mark: dedup :x: :x: :x: :white_check_mark: :white_check_mark: stats :x: :x: :x: :white_check_mark: :white_check_mark: backup :x: :x: :x: :white_check_mark: :white_check_mark: schedule :x: :x: :x: :white_check_mark: :white_check_mark: doctor :x: :x: :x: :x: :white_check_mark: wizard :x: :x: :x: :x: :white_check_mark: feedback :x: :x: :x: :x: :white_check_mark: Token savings 50-80% 50-80% 50-80% 50-80% 50-80% :file_folder: Package Structure memory-manager-v2.6.3_en/ ├── memory_manager_en.py # Main script (~2700 lines) ├── analyze_memory_en.py # Memory analysis module ├── scan_workspace_en.py # Workspace scan module ├── SKILL_EN.md # This document └── memory_guide_EN.md # User guide :dart: Use Cases Scenario 1: Reduce TOKEN consumption bash 复制 # First use: Generate all summaries memory_manager_en.py summarize # Daily conversation: Use smart load memory_manager_en.py load --mode brief Scenario 2: Quickly locate information bash 复制 # Search keyword memory_manager_en.py search project # Load related memories memory_manager_en.py load --keyword project --limit 5 Scenario 3: Regular organization bash 复制 # View ranking memory_manager_en.py rank # Archive cold memories memory_manager_en.py archive --age 60 Scenario 4: Scheduled auto cleanup (V2.4+) bash 复制 # Set daily auto organization memory_manager_en.py schedule --task auto_clean --enable --schedule daily --time 18:00 Scenario 5: Deduplication & Backup (V2.5) :star::star::star: bash 复制 # Regular deduplication memory_manager_en.py dedup --execute # Regular backup memory_manager_en.py backup --path "D:\Backup" --execute :warning: Security Notice All delete operations require explicit --execute flag (V2.6.3 confirm parameter) Preview mode (--execute not set) shows what will be deleted without actually deleting Protected directories (memory, skills, .workbuddy) are never affected Personal/work content never auto-cleaned without confirmation
    2026-04-29 01:08 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

office-efficiency

MD格式互转工具

user_98283d0f
>支持 Markdown 与 PDF、Word、HTML、纯文本等 8 种格式双向互转的本地文档处理工具,支持中英日韩四种语言.
★ 1 📥 190
ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,530 📥 583,412
ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,176 📥 946,925