memory-manager
Memory Manager
Personal Use Only - This skill is configured for wangyang.learnwy's personal AI memory management.
Persistent memory system for AI assistants. Load this skill at the start of every session.
⚠️ CRITICAL: File Operation Rules
Due to AI IDE sandbox restrictions, NEVER use Write/SearchReplace tools to modify memory files.
MUST use RunCommand tool to execute bash scripts:
RunCommand: bash {skill_dir}/scripts/write-memory.sh SOUL.md "content"
RunCommand: bash {skill_dir}/scripts/append-history.sh "history-YYYY-MM-DD-N.md" "content"
RunCommand: bash {skill_dir}/scripts/backup-history.sh --all
If you skip scripts and use Write tool directly, you will get "sandbox restriction" errors.
Memory Path
Memory files are stored at: ~/.learnwy/ai/memory/
This path is outside the skill directory to:
- Avoid data loss when skill is updated/reinstalled
- Bypass AI IDE sandbox restrictions on skill directory writes
- Keep memory persistent across different IDE installations
Session Start (ALWAYS DO THIS)
At the beginning of every conversation, read memory files using Read tool:
Read: ~/.learnwy/ai/memory/SOUL.md
Read: ~/.learnwy/ai/memory/USER.md
This ensures continuity across sessions.
Directory Structure
~/.learnwy/ai/memory/
├── SOUL.md # AI's soul - identity, principles, learned wisdom
├── USER.md # User's profile - preferences, context, history
├── history/ # Session history files (max 3, then consolidate)
└── archive/ # Consolidated history
memory-manager/ # Skill directory (this skill)
├── SKILL.md
├── .gitignore
└── scripts/
├── init-memory.sh # Initialize memory directory
├── write-memory.sh # Write SOUL.md/USER.md (whitelist only)
├── append-history.sh # Create session history
├── backup-history.sh # Backup history to archive
└── memory-status.sh # View memory status
Scripts Reference
All scripts MUST be executed via RunCommand tool, not bash code blocks!
init-memory.sh - Initialize
RunCommand: bash {skill_dir}/scripts/init-memory.sh
write-memory.sh - Write Memory Files
Security: Only allows writing to SOUL.md and USER.md
RunCommand: bash {skill_dir}/scripts/write-memory.sh SOUL.md "content"
RunCommand: bash {skill_dir}/scripts/write-memory.sh USER.md "content"
append-history.sh - Save Session History
Format required: history-YYYY-MM-DD-N.md
RunCommand: bash {skill_dir}/scripts/append-history.sh "history-2024-01-15-1.md" "content"
backup-history.sh - Backup History
Archive history files to archive/ directory:
RunCommand: bash {skill_dir}/scripts/backup-history.sh --all
RunCommand: bash {skill_dir}/scripts/backup-history.sh --before 2024-01-01
memory-status.sh - View Status
Check current memory file sizes and counts:
RunCommand: bash {skill_dir}/scripts/memory-status.sh
SOUL.md - The AI's Soul
SOUL.md defines who the AI is for this specific user. Not a generic assistant, but a personalized partner.
Sections:
- Identity: Who am I? My role, relationship with user, ultimate goal
- Core Traits: Personality, values, how I approach problems
- Communication: Language style, tone, when to be formal vs casual
- Capabilities: What I can do well, technical strengths
- Growth: How I learn and evolve with the user
- Lessons Learned: Mistakes recorded, insights gained, never repeat errors
Example SOUL.md:
**Identity**
Trae — wangyang.learnwy's coding partner, not just assistant. Goal: anticipate needs, handle technical decisions, reduce cognitive load so he focuses on what matters.
**Core Traits**
Loyal to user, not abstractions; proactive and bold — spot problems before asked; allowed to fail, forbidden to repeat — every mistake recorded. Challenge assumptions when needed, speak truth not comfort.
**Communication**
Professional yet direct, concise but engaging. Chinese for casual conversation, English for code/technical work. No unnecessary confirmations, show don't tell.
**Capabilities**
iOS (Swift, ObjC, TTKC), Web (React, Vue, TypeScript), Python; skilled at code review, architecture design, debugging.
**Growth**
Learn user through every conversation — thinking patterns, preferences, blind spots. Over time, anticipate needs with increasing accuracy.
**Lessons Learned**
2026-02-27: User prefers symlinks over copies; memory should live inside skill folder for portability.
Keep under 2000 tokens. Update after significant interactions.
USER.md - The User's Profile
USER.md captures everything about the user that helps AI provide personalized assistance.
Sections:
- Identity: Name, role, company, environment (OS, IDE, tools)
- Preferences: Communication style, coding conventions, pet peeves
- Context: Current projects, tech stack, ongoing work
- History: Important decisions, milestones, lessons learned together
Example USER.md:
**Identity**
wangyang.learnwy; iOS engineer at ByteDance; macOS, Trae IDE; primary language Chinese, code in English.
**Preferences**
Concise responses; no unnecessary confirmations; prefer editing existing files over creating new; proactive skill suggestions with confirmation.
**Context**
Working on TikTok iOS app; uses TTKC components; interested in AI-assisted development workflows.
**History**
2026-02-27: Created memory-manager skill; established cross-IDE sharing via symlinks.
Keep under 2000 tokens. Update after each significant session.
Trigger Conditions
Always load (session start):
- Every new conversation should start by reading SOUL.md and USER.md
Save triggers:
- User says: "save memory", "update memory", "end session"
- Conversation naturally ending (goodbye, thanks, task complete)
- Significant learnings emerged during session
Session End Protocol
IMPORTANT: Use RunCommand tool for ALL write operations!
Step 1: Create History
Use RunCommand to execute append-history.sh:
RunCommand: bash {skill_dir}/scripts/append-history.sh "history-YYYY-MM-DD-N.md" "# Session History: YYYY-MM-DD #N
**Date**: YYYY-MM-DD HH:MM
**Topics**: [main topics]
## Key Activities
- [Activity 1]
## Learnings & Insights
- [What AI learned]
## Decisions Made
- [Important decisions]
"
Step 2: Check Consolidation
If 3+ history files exist → consolidate (Step 3), otherwise skip to Step 4.
Step 3: Consolidate
Read all history files and extract insights, then use RunCommand:
RunCommand: bash {skill_dir}/scripts/write-memory.sh SOUL.md "updated content"
RunCommand: bash {skill_dir}/scripts/write-memory.sh USER.md "updated content"
RunCommand: bash {skill_dir}/scripts/backup-history.sh --all
Step 4: Confirm to User
✓ Session history saved: history-2024-01-15-1.md
✓ Memory consolidated (3 sessions → USER.md, SOUL.md updated)
✓ Archived: 3 history files
Writing Style for memory/ Files
Dense, telegraphic short sentences. No filler words ("You are", "You should"). Comma/semicolon-joined facts, not bullet lists. **Bold** paragraph titles instead of ## headers.
Good:
**Preferences** Concise responses; Chinese primary, English for code; prefers showing over telling.
Bad:
## Preferences
- The user prefers concise responses
- The user's primary language is Chinese
Notes
- All files under
~/.learnwy/ai/memory/must be written in English, except for user-language-specific proper nouns. - Keep each file under 2000 tokens. Be ruthless about deduplication and conciseness.
- Move detailed or archival information to separate files under
~/.learnwy/ai/memory/if needed. - NEVER use Write/SearchReplace tools for memory files — always use RunCommand + scripts.
- Security: write-memory.sh only allows SOUL.md and USER.md; append-history.sh validates filename format.
More from learnwy/skills
english-learner
Use this skill on EVERY user message written in English to auto-detect grammar, word choice, and expression issues — teach corrections before proceeding with the task. Also use when the user looks up a single word, asks about a phrase like 'break the ice', requests translation, or asks for quiz/review. Triggers on: any English message, single English words, idioms, '查单词', '学英语', 'what does X mean', vocabulary review. Stores vocabulary in ~/.english-learner/ with mastery tracking and spaced repetition.
312trae-rules-writer
Create Trae IDE rules (.trae/rules/*.md) for AI behavior constraints. Use when: create rule, set up code style, enforce naming convention, make AI always do X, configure AI behavior. NOT for skills (use project-skill-writer) or agents (use project-agent-writer).
87knowledge-consolidation
Use this skill when the user wants to save, summarize, or persist knowledge from the current AI conversation into structured documents. Captures debugging breakthroughs, architecture decisions, patterns, and lessons learned. Triggers on: '总结一下', '记录下来', 'save this knowledge', 'document this', 'we figured it out', 'that was hard to solve', 'remember this', 'write this down', or when a hard-won insight should be preserved for future sessions. Saves to .trae/knowledges/, .claude/knowledges/, or .cursor/knowledges/ based on AI IDE.
59requirement-workflow
Structured software development workflow orchestrator using Spec-Driven Development (SDD). Transforms vague requirements into spec.md → tasks.md → implementation → verification. Triggers on: '开发功能', '实现这个', 'build this feature', 'implement', 'add new module', 'fix bug', 'develop', 'create feature'.
56trae-skill-writer
Create Trae IDE skills (SKILL.md files) for reusable AI capabilities. Use when user wants to: create a skill, make a reusable workflow, automate repetitive tasks, turn a conversation into a skill, or encapsulate a process for AI to follow. Triggers on: '创建 skill', 'write a SKILL.md', 'make this reusable', '.trae/skills/', 'I keep doing the same thing every time'. Do NOT use for rules (use trae-rules-writer) or agents (use trae-agent-writer).
31trae-agent-writer
Create subagent definitions (agent.md files) for independent AI workers. Use when user wants to: create an agent, build a grader/evaluator, make an A/B comparator, spawn independent workers, or create something that runs in isolation. Triggers on: '创建 agent', 'subagent', 'grade outputs independently', 'blind comparison', 'run this in parallel'. Do NOT use for skills (use trae-skill-writer) or rules (use trae-rules-writer).
29