Refactor high-complexity React components in Dify frontend. Use when `pnpm analyze-component...
npx skills add js-skills-sh/conversation-memory-skill --skill "conversation-memory"
Install specific skill from multi-skill repository
# Description
>
# SKILL.md
name: conversation-memory
description: >
Conversation memory management. Triggered when the user says "save memory", "remember this conversation", "save it", "save conversation", "find previous discussion", "view history", "show previous memories".
Conversation Memory Skill
Save conversation context as recallable memory files, enabling persistence and automatic recall of conversations.
Active Memories
See ../../data/conversation-memory/memories/index.md for the active memory collection.
Note: Memory data is stored in the
.claude/data/conversation-memory/directory, separate from the skill code.
Trigger Scenarios
Save Memory
Triggered when the user says:
- "Save memory"
- "Remember this conversation"
- "Save it"
- "Save conversation"
- "Save context"
Save Process (Important)
When saving a memory, you must first generate the title and summary, then call the save command:
Step 1: Generate Title and Summary
Analyze the current conversation and generate complete summary content:
- Title: Concise topic of the conversation (will be displayed in the index)
- Summary: Complete conversation summary, should include:
- Conversation background and main issues
- Core content discussed
- Key decisions and conclusions
- Important technical details or code changes
Step 2: Write Summary File
Write the title and summary to a temporary file, format requirements:
# Title Content
Complete summary text (including main content, key decisions, important conclusions, etc.)
File path: .claude/data/conversation-memory/temp/summary.md
Summary File Example:
# Memory Index Timing Issue Fix
This conversation discussed the timing issue where memory index content was blank during save.
## Main Content
1. Analyzed the root cause: placeholder summary written first, then index rebuilt
2. Determined the improvement plan: generate summary first, then save in one step
3. Modified related code: save_memory.js, MemoryService, MemoryManager
## Key Decisions
- Use --summary-file to pass summary, avoiding command-line escaping issues
- First line of summary file serves as title, subsequent content as complete summary
- Summary is required to ensure index content is always complete
## Important Conclusions
- Changed save memory flow to "generate summary first, then save"
- Index automatically rebuilds, new memories appear at the top
Step 3: Call Save Command
node scripts/save_memory.js --summary-file ../../data/conversation-memory/temp/summary.md
Notes:
- First line of summary file must be the title (starting with#)
- Title will be displayed in the index, formatted as[mem-xxx] Title
- Temporary summary file can be deleted after successful save
View History
Triggered when the user says:
- "View previous conversation"
- "Find last discussion"
- "Restore memory mem-xxx"
- "Show history"
Saved Content
System saves to .claude/data/conversation-memory/memories/active/mem-{timestamp}/:
mem-{timestamp}/
βββ summary.md # Conversation summary (title + metadata + full summary)
βββ conversation.md # Complete original conversation record (readable format)
βββ messages.json # Raw message data (for viewing history)
summary.md Structure:
# Conversation Memory: Title
## Metadata
- **Time**: 2026-01-18 19:00:00
- **Duration**: ~5 minutes
- **Conversation Rounds**: 10 rounds
- **Keywords**: keyword1, keyword2
- **conversationId**: conv-xxx
- **sessionId**: xxx...
## Summary
(User-provided complete summary content, including main content, key decisions, important conclusions, etc.)
## Source
For full original conversation, see [conversation.md](conversation.md)
Index Structure (index.md):
Index file contains directory and all memory summaries, with newest memories at the top:
# Conversation Memory Index
## Directory
- [mem-20260118-190000] Memory Index Timing Issue Fix
- [mem-20260118-180000] Project Architecture Discussion
---
## mem-20260118-190000
(Complete summary.md content)
Recall Mechanism
Active Search
When user says "find previous discussion about xxx":
node scripts/activate_memory.js --search <keyword>
View History Process
When user requests to view history:
List viewable memories:
node scripts/restore_memory.js --list # List active memories
node scripts/restore_memory.js --list-all # Include archived memories
The list shows each memory's conversationId (if available), with fragment count noted for multiple fragments from the same conversation.
View specific memory fragment:
node scripts/restore_memory.js <memory-id>
View complete conversation:
The same conversation round may be saved multiple times as multiple memory fragments. Use the --conversation option to merge and view:
node scripts/restore_memory.js --conversation <conversation-id>
Example:
node scripts/restore_memory.js --conversation conv-20260118-160000
Activation Mechanism
When an archived memory is recalled, it needs to be activated:
node scripts/activate_memory.js <memory-name>
Activation operation (requires app running):
- Moves memory from
memories/archive/back tomemories/active/
Archive Mechanism
Automatic Archive Rules
- Memories inactive for more than 14 days will be archived
- Keep active/ count <= 20
- When total tokens exceed limit, archive oldest memories
Execute Archive
node scripts/archive_old_memories.js
After archiving, the index is automatically updated via backend API.
Storage Locations
Skill code and data are stored separately:
.claude/
βββ skills/conversation-memory/ # Skill code (this directory)
β βββ SKILL.md # This file (skill definition)
β βββ scripts/ # Management scripts (require app running)
β β βββ paths.js # Path resolution utility
β β βββ save_memory.js # Save memory (requires summary)
β β βββ activate_memory.js # Activate/search memory
β β βββ restore_memory.js # View history
β β βββ archive_old_memories.js # Archive memories
β β βββ update_index.js # Update index (calls backend API)
β βββ references/ # Template files
β βββ summary_template.md
β βββ conversation_template.md
β
βββ data/conversation-memory/ # Data directory (separate from skill)
βββ temp/ # Temporary file directory (for summary)
β βββ summary.md # Temporary summary file
βββ memories/ # Memory storage
βββ index.md # Active memory summary collection
βββ active/ # Active memories
β βββ mem-xxx/
β βββ summary.md
β βββ conversation.md
β βββ messages.json
βββ archive/ # Archived memories
Notes
- Title and summary are required: First line of summary file must be title (starting with
#), title will be displayed in index - Index auto-updates: Index automatically rebuilds after successful save, new memories at the top
- Scripts require app: Scripts in
scripts/directory require DeepSeek Cowork app to be running - View compatibility: Only newly saved memories (containing
messages.json) support viewing complete messages - Temporary files: Temporary
temp/summary.mdfile can be deleted after successful save
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.