AgentSkillsCN

retain

当用户要求“存入记忆”、“记住这一点”、“保存这一决策”,或在主动做出架构决策、选定技术方案、解决 Bug、探讨权衡取舍、确立惯例时,应使用此技能。触发短语:“让我们使用……”、“我们决定……”、“原因在于……”、“请记住……”、“从现在开始……”、“解决方案是……”、“我们选择了 X 而不是 Y……”

SKILL.md
--- frontmatter
name: retain
description: This skill should be used when the user asks to "save to memory", "remember this", "store decision", or proactively when an architectural decision is made, technology is chosen, bug is solved, tradeoff discussed, convention established. Trigger phrases: "Let's use...", "We decided...", "The reason is...", "Remember that...", "From now on...", "The solution was...", "We chose X over Y..."
model: sonnet
version: 0.1.0

Save to Memory Bank

Save information with one command. Pick the category, format content, execute:

bash
bash !`echo ${CLAUDE_PLUGIN_ROOT}`/scripts/do-retain.sh <CATEGORY> <<'EOF'
<CONTENT>
EOF

Categories

CategoryWhen to use
architectureSystem design, components, infrastructure
tech-stackTechnology/library choices with reasoning
patternsCode patterns, design patterns
decisionsKey decisions with explicit reasoning
tradeoffsCompromises and justification
bugsComplex bugs and their solutions
lessonsInsights, learnings
requirementsBusiness constraints, performance requirements
conventionsStandards, naming, processes

Content Quality

Each memory MUST include:

  • WHAT was decided
  • WHY it was decided (reasoning)
  • Alternatives considered (if any)

Bad: "Use PostgreSQL" Good: "Use PostgreSQL for user service. Need ACID transactions for payments. MongoDB rejected due to consistency requirements."

After Saving

Report to user: what was stored, category, keywords for future recall.

Check for Duplicates (optional)

Before storing, optionally check if similar exists:

bash
bash !`echo ${CLAUDE_PLUGIN_ROOT}`/scripts/do-recall.sh low 200 <<'EOF'
<brief topic>
EOF