Memory Management
SEO & GEO Skills Library · 20 skills for SEO + GEO · ClawHub · skills.sh
System Mode: This cross-cutting skill is part of the protocol layer and follows the shared Skill Contract and State Model.
This skill implements a three-tier memory system (HOT/WARM/COLD) for SEO and GEO projects. HOT memory (80 lines max) loads automatically every session via the SessionStart hook. WARM memory loads on demand per skill. COLD memory is archived data queried only when explicitly requested. The skill manages the full lifecycle: capture, promote, demote, and archive.
System role: Campaign Memory Loop. It defines how project context is captured, promoted, archived, and handed off across sessions. It is the sole executor of WARM-to-COLD archival and the aggregator for cross-skill project status queries.
When This Must Trigger
Use this whenever project state should survive the current session — even if the user doesn't use memory terminology:
- - User says "remember this", "save this", "keep track of this"
- User asks "what did we decide", "what do we know", "project status"
- Setting up memory structure for a new SEO project
- After completing audits, ranking checks, or performance reports (Stop hook reminds automatically)
- When project context needs updating (new keywords, competitors, priorities)
- When you need to look up historical data or project-specific terminology
- After 30+ days of work to clean up and archive stale data
- When open-loops.md has items older than 7 days (SessionStart hook reminds automatically)
What This Skill Does
- 1. HOT Cache Management: Maintains
memory/hot-cache.md (80 lines max) — loaded automatically every session by SessionStart hook - WARM Storage: Organizes dated findings in
memory/ subdirectories — loaded on demand by relevant skills - COLD Archive: Moves stale data (90+ days unreferenced) to
memory/archive/ with date prefix - Promotion: Elevates frequently-referenced findings from WARM to HOT (3+ refs in 7 days, or 2+ skill refs)
- Demotion: Moves unreferenced HOT items to WARM (30 days), WARM to COLD (90 days)
- Cross-Skill Aggregation: When user asks "what do we know", aggregates from all
memory/ subdirectories - Open Loop Tracking: Maintains
memory/open-loops.md, reminds user of stale items via SessionStart hook - Wiki Index Maintenance: Compiles
memory/wiki/index.md — a structured, auto-refreshed index of all WARM files with precise fields (score, 健康度, status, next_action, mtime) and best-effort summaries. Supports project isolation via memory/wiki/<project>/index.md. Auto-refreshed on PostToolUse; user confirmation not required (index is a fully rebuildable derived artifact). Delete memory/wiki/ at any time to revert to pre-wiki behavior. - Wiki Compiled Pages (Phase 2): Generates interlinked entity, keyword, and topic pages from WARM files with source hash tracking, contradiction detection, and confidence-labeled reconciliation. Requires user confirmation before writing.
- Wiki Lint (Phase 2): Detects contradictions, orphan pages, stale claims, missing pages, and source hash mismatches across wiki and WARM files via
/seo:wiki-lint. - WARM Retirement Preview (Phase 3):
wiki-lint --retire-preview lists WARM files fully covered by wiki compiled pages as retirement candidates. Actual archival to COLD requires explicit user confirmation.
Quick Start
Start with one of these prompts. Finish with a hot-cache update plan and a handoff summary using the repository format in Skill Contract.
Initialize Wiki Index
CODEBLOCK0
CODEBLOCK1
Generates memory/wiki/index.md from existing WARM files. Required once to enable wiki features; subsequent refreshes happen automatically.
Initialize Memory Structure
CODEBLOCK2
CODEBLOCK3
Update After Analysis
CODEBLOCK4
CODEBLOCK5
Query Stored Context
CODEBLOCK6
CODEBLOCK7
CODEBLOCK8
Promotion and Demotion
CODEBLOCK9
CODEBLOCK10
Glossary Management
CODEBLOCK11
CODEBLOCK12
Skill Contract
Expected output: a memory update plan, hot-cache changes, and a short handoff summary.
- - Reads: current campaign facts, new findings from other skills, approved decisions, and the shared State Model.
- Writes: updates to
memory/hot-cache.md, memory/open-loops.md, memory/decisions.md, and related memory/ folders. Manages WARM-to-COLD archival in memory/archive/. Compiles memory/wiki/index.md (auto-refreshed) and wiki compiled pages (user-confirmed). Auditor handoff archiving (v7.1.0+): when triggered (by the Stop hook, by a direct user request, or via an auditor's "Save these results?" yes-response), append a structured block to memory/audits/YYYY-MM.md using the exact format below. The archive is consumed by /seo:p2-review for the 2026-07-10 tombstone evaluation tied to ADR-001.
Archive block format (append to end of the monthly file, newest entries at bottom):
CODEBLOCK13
Rules:
- One block per audit. Do not overwrite existing blocks.
- target is the URL or domain audited.
- runbook_version is copied from the current runbook header — this is how /seo:p2-review identifies cross-version reruns.
- gap_types is derived from key_findings[].gap_type if the handoff carries them (deferred to P2; until then, leave as []).
- false_positive is the ONLY field that can be added/flipped after initial write, via explicit user annotation.
- If the monthly file does not exist, create it with a single # Audit Archive — YYYY-MM header at top.
- - Promotes: durable strategy, blockers, terminology, entity candidates, and major deltas. Applies temperature lifecycle rules: promote to HOT on high reference frequency, demote on staleness.
- Next handoff: use the
Next Best Skill below when the project memory baseline is ready for active work.
Temperature Lifecycle Rules
See references/promotion-demotion-rules.md for the full promotion/demotion table and action procedures.
Hook Integration
This skill's behavior is reinforced by the library's prompt-based hooks:
- - SessionStart: loads
memory/hot-cache.md, reminds of stale open loops; loads memory/wiki/<project>/index.md (or global index.md) if it exists; provides light-user guidance based on Quick Status when next_action items are available - PostToolUse: after any WARM file write, silently refreshes
memory/wiki/index.md (Phase 1); prompts to update compiled pages (Phase 2) - Stop: prompts to save session findings, auto-saves veto issues to hot-cache; appends changelog entry to index.md bottom
Data Sources
See CONNECTORS.md for tool category placeholders.
With ~~SEO tool + ~~analytics + ~~search console connected:
Automatically populate memory from historical data: keyword rankings over time, competitor domain authority changes, traffic metrics, conversion data, backlink profile evolution. The skill will fetch current rankings, alert on significant changes, and update both hot cache and cold storage.
With manual data only:
Ask the user to provide:
- 1. Current target keywords with priority levels
- Primary competitors (3-5 domains)
- Key performance metrics and last update date
- Active campaigns and their status
- Any project-specific terminology or abbreviations
Proceed with memory structure creation using provided data. Note in CLAUDE.md which data requires manual updates vs. automated refresh.
Instructions
When a user requests SEO memory management:
1. Initialize Memory Structure
For new projects, create the directory structure defined in the State Model. Key directories: memory/ (decisions, open-loops, glossary, entities, research, content, audits, monitoring) plus memory/wiki/ (auto-managed compiled index with optional per-project subdirectories).
Templates: hot-cache-template.md · glossary-template.md · Wiki spec
2. Context Lookup Flow
When a user references something unclear, follow this lookup sequence:
Step 1: Check CLAUDE.md (Hot Cache)
- - Is it in active keywords?
- Is it in primary competitors?
- Is it in current priorities or campaigns?
Step 2: Check Wiki Index (memory/wiki/index.md or project-level) — locate relevant WARM files
Step 3: Check memory/glossary.md
- - Is it defined as project terminology?
- Is it a custom segment or shorthand?
Step 4: Check Cold Storage
- - Search memory/research/keywords/ for historical keyword context
- Search memory/research/competitors/ for past analyses
- Search memory/monitoring/reports/ for archived mentions
Step 5: Ask User
- - If not found in any layer, ask for clarification
- Log the new term in glossary if it's project-specific
Example lookup:
CODEBLOCK14
3. Promotion & Demotion Logic
Reference: See references/promotion-demotion-rules.md for detailed promotion/demotion triggers (keywords, competitors, metrics, campaigns) and the action procedures for each.
4. Update Triggers, Archive Management & Cross-Skill Integration
Reference: See references/update-triggers-integration.md for the complete update procedures after ranking checks, competitor analyses, audits, and reports; monthly/quarterly archive routines; and integration points with all 8 connected skills (keyword-research, rank-tracker, competitor-analysis, content-gap-analysis, seo-content-writer, content-quality-auditor, domain-authority-auditor).
5. Memory Hygiene Checks
When invoked for review or cleanup:
- 1. Line count check: Count lines in
memory/hot-cache.md. If >80, list oldest entries for archival. - Byte check: If hot-cache exceeds 25KB, warn and recommend trimming long entries.
- Staleness scan: List memory files older than 30 days that have not been referenced. Recommend archival for files >90 days.
- Frontmatter audit: Check that all memory files (except hot-cache.md) have
name, description, and type in their frontmatter. Report any missing fields.
6. Save Results
After delivering any memory update or aggregation to the user, ask:
"Save these results for future sessions?"
If yes, write a dated summary to the appropriate memory/ path using filename YYYY-MM-DD-<topic>.md containing:
- - One-line verdict or headline finding
- Top 3-5 actionable items
- Open loops or blockers
- Source data references
If any veto-level issue was found (CORE-EEAT T04, C01, R10 or CITE T03, T05, T09), also append a one-liner to memory/hot-cache.md without asking.
Validation Checkpoints
Structure Validation
- - [ ] memory/hot-cache.md exists and is under 80 lines
- [ ] memory/ directory structure matches the shared state model
- [ ] glossary.md exists and is populated with project basics
- [ ] All historical data files include timestamps in filename or metadata
Content Validation
- - [ ] CLAUDE.md "Last Updated" date is current
- [ ] Every keyword in hot cache has current rank, target rank, and status
- [ ] Every competitor has domain authority and position assessment
- [ ] Every active campaign has status percentage and expected completion date
- [ ] Key Metrics Snapshot shows "Previous" values for comparison
Lookup Validation
- - [ ] Test lookup flow: reference a term → verify it finds it in correct layer
- [ ] Test promotion: manually promote item → verify it appears in CLAUDE.md
- [ ] Test demotion: manually archive item → verify removed from CLAUDE.md
- [ ] Glossary contains all custom segments and shorthand used in CLAUDE.md
Update Validation
- - [ ] After ranking check,
memory/monitoring/rank-history/ has a dated snapshot or export - [ ] After competitor analysis,
memory/research/competitors/ has a dated file - [ ] After audit, top action items appear in CLAUDE.md priorities
- [ ] After monthly report, metrics snapshot reflects new data
Examples
Reference: See references/examples.md for three complete examples: (1) updating hero keyword rankings with memory refresh, (2) glossary lookup flow, and (3) initializing memory for a new e-commerce project.
Advanced Features
- - Smart Context Loading:
Load full context for [campaign name] — retrieves hot cache + all cold storage files for a campaign - Memory Health Check:
Run memory health check — finds orphaned files, missing timestamps, stale items, broken references - Bulk Promotion/Demotion:
Promote all keywords ranking in top 10 to hot cache / INLINECODE48 - Memory Snapshot:
Create memory snapshot for [date/milestone] — point-in-time copy for major milestones - Cross-Project Memory:
Compare memory with [other project] — keyword overlaps, competitor intersections across projects - Wiki Lint:
/seo:wiki-lint [--fix] [--project name] [--retire-preview] — contradictions, orphans, stale claims, hash mismatches. See commands/wiki-lint.md
Practical Limitations
- - Concurrent access: Use timestamped filenames to avoid overwrites from parallel sessions.
- Cold storage retrieval: WARM/COLD files only load on demand. Hot cache is the primary cross-session mechanism.
- Data freshness: Stale data (>90 days) should be flagged for refresh. Wiki index
mtime field helps detect staleness. - Wiki compilation: Index is best-effort for summaries; precise fields (score, status, mtime) are deterministic. Delete
memory/wiki/ anytime to revert.
Reference Materials
Next Best Skill
- - Primary: keyword-research — seed or refresh campaign strategy with current demand signals.
内存管理
SEO & GEO 技能库 · 20项SEO+GEO技能 · ClawHub · skills.sh
系统模式:此跨领域技能属于协议层,遵循共享的技能合约和状态模型。
本技能为SEO和GEO项目实现三层内存系统(热/温/冷)。热内存(最多80行)通过SessionStart钩子自动加载到每个会话中。温内存按需加载到每个技能中。冷内存是存档数据,仅在明确请求时查询。该技能管理完整的生命周期:捕获、提升、降级和归档。
系统角色:活动内存循环。它定义项目上下文如何跨会话捕获、提升、归档和交接。它是温到冷归档的唯一执行者,也是跨技能项目状态查询的聚合器。
何时必须触发
只要项目状态需要在当前会话之外保留,即使使用者不使用内存术语,也应使用此技能:
- - 使用者说记住这个、保存这个、跟踪这个
- 使用者问我们决定了什么、我们知道什么、项目状态
- 为新的SEO项目设置内存结构
- 完成审核、排名检查或绩效报告后(Stop钩子自动提醒)
- 项目上下文需要更新时(新关键词、竞争对手、优先级)
- 需要查找历史数据或项目特定术语时
- 工作超过30天后清理和归档陈旧数据
- 当open-loops.md中有超过7天的项目时(SessionStart钩子自动提醒)
本技能的功能
- 1. 热缓存管理:维护memory/hot-cache.md(最多80行)——由SessionStart钩子自动加载到每个会话
- 温存储:在memory/子目录中组织带日期的发现——由相关技能按需加载
- 冷归档:将陈旧数据(90天以上未被引用)移至memory/archive/,并添加日期前缀
- 提升:将频繁引用的发现从温存储提升到热缓存(7天内3次以上引用,或2次以上技能引用)
- 降级:将未引用的热缓存项移至温存储(30天),温存储移至冷归档(90天)
- 跨技能聚合:当使用者问我们知道什么时,从所有memory/子目录聚合
- 开放循环跟踪:维护memory/open-loops.md,通过SessionStart钩子提醒使用者陈旧项目
- Wiki索引维护:编译memory/wiki/index.md——一个结构化的、自动刷新的所有温文件的索引,包含精确字段(分数、健康度、状态、下一步行动、修改时间)和尽力而为的摘要。通过memory/wiki//index.md支持项目隔离。在PostToolUse时自动刷新;不需要使用者确认(索引是完全可重建的衍生产物)。随时删除memory/wiki/以恢复到预wiki行为。
- Wiki编译页面(第二阶段):从温文件生成相互链接的实体、关键词和主题页面,包含源哈希跟踪、矛盾检测和带置信度标签的调和。写入前需要使用者确认。
- Wiki检查(第二阶段):通过/seo:wiki-lint检测wiki和温文件中的矛盾、孤立页面、陈旧声明、缺失页面和源哈希不匹配。
- 温存储退役预览(第三阶段):wiki-lint --retire-preview列出完全被wiki编译页面覆盖的温文件作为退役候选。实际归档到冷存储需要明确的使用者确认。
快速开始
从以下提示之一开始。使用技能合约中的仓库格式,以热缓存更新计划和交接摘要结束。
初始化Wiki索引
刷新wiki索引
为[项目名称]构建wiki索引
从现有的温文件生成memory/wiki/index.md。需要一次以启用wiki功能;后续刷新自动进行。
初始化内存结构
为[项目名称]设置SEO内存
为新的[行业]网站优化项目初始化内存结构
分析后更新
在[关键词组]排名检查后更新内存
用最新的竞争对手分析发现刷新热缓存
查询存储的上下文
我们的主打关键词是什么?
显示[关键词类别]的最后排名更新日期
查找我们的主要竞争对手及其域名权威
提升和降级
将[关键词]提升到热缓存
归档30天以上未被引用的陈旧数据
术语表管理
将[术语]添加到项目术语表:[定义]
[内部行话]在这个项目中是什么意思?
技能合约
预期输出:内存更新计划、热缓存变更和简短的交接摘要。
- - 读取:当前活动事实、来自其他技能的新发现、已批准的决策以及共享的状态模型。
- 写入:更新memory/hot-cache.md、memory/open-loops.md、memory/decisions.md以及相关的memory/文件夹。管理memory/archive/中的温到冷归档。编译memory/wiki/index.md(自动刷新)和wiki编译页面(使用者确认)。审计员交接归档(v7.1.0+):当触发时(由Stop钩子、直接使用者请求或审计员的保存这些结果?肯定响应),使用以下确切格式将结构化块追加到memory/audits/YYYY-MM.md。该归档由/seo:p2-review用于2026-07-10墓碑评估,与ADR-001相关。
归档块格式(追加到月度文件末尾,最新条目在底部):
markdown
## YYYY-MM-DD · <目标> · <框架>
- runbook_version: 1.1
- status: DONE | DONEWITHCONCERNS | BLOCKED
- framework: CORE-EEAT | CITE
- vetos_failed: [T04, R10] # 如果没有则为空列表[]
- veto_count: 2
- raw_overall: 78
- final_overall: 60 # 如果BLOCKED则为n/a
- cap_applied: true
- gaptypes: [missing, shallow] # 如果存在则从keyfindings派生;如果没有则为[]
- false_positive: false # 使用者注释;默认为false;仅在明确的使用者这是错误的反馈时设为true
- audit_source: content-quality-auditor | domain-authority-auditor
规则:
- 每次审计一个块。不要覆盖现有块。
- target是审计的URL或域名。
- runbook_version从当前runbook标题复制——这是/seo:p2-review识别跨版本重跑的方式。
- gaptypes如果交接携带了keyfindings[].gap_type则从中派生(推迟到P2;在此之前,保留为[])。
- false_positive是唯一可以在初始写入后添加/翻转的字段,通过明确的使用者注释。
- 如果月度文件不存在,则创建它,顶部带有单个# Audit Archive — YYYY-MM标题。
- - 提升:持久的策略、阻塞项、术语、实体候选和主要差异。应用温度生命周期规则:在高引用频率时提升到热缓存,在陈旧时降级。
- 下次交接:当项目内存基线准备好进行主动工作时,使用下面的下一个最佳技能。
温度生命周期规则
参见references/promotion-demotion-rules.md了解完整的提升/降级表和操作程序。
钩子集成
本技能的行为由库的基于提示的钩子强化:
- - SessionStart:加载memory/hot-cache.md,提醒陈旧的开放循环;如果存在则加载memory/wiki//index.md(或全局index.md);当next_action项可用时,基于快速状态提供轻量级使用者指导
- PostToolUse:在任何温文件