一键导入
docs-refresh
Full documentation hygiene pass: memory, CLAUDE.md, lessons, references, guides. Audit freshness, delete stale, update outdated, compress index.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Full documentation hygiene pass: memory, CLAUDE.md, lessons, references, guides. Audit freshness, delete stale, update outdated, compress index.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Ore in, steel out. Planning pipeline with independent verification, persistent memory, and compounding knowledge. Use for 3+ files or unclear scope.
Codebase health analysis: dead code, test quality, duplicates, complexity, security, architecture mapping. Tool-first, structured storage, forge integration.
| name | docs-refresh |
| description | Full documentation hygiene pass: memory, CLAUDE.md, lessons, references, guides. Audit freshness, delete stale, update outdated, compress index. |
Audit all project documentation for freshness. Delete what's dead, update what drifted, compress what's bloated.
All doc layers, in order:
| Layer | Location | What to check |
|---|---|---|
| Memory files | .claude/projects/.../memory/*.md | Each file vs codebase reality |
| Memory index | .claude/projects/.../memory/MEMORY.md | Orphans, duplicates, line count |
| CLAUDE.md (root) | CLAUDE.md | Gotchas: still real? Commands: still work? |
| CLAUDE.md (.claude) | .claude/CLAUDE.md | OMC config: still accurate? |
| Docs vault | docs/ (architecture, decisions, specs, runbooks, retros, articles) | Stale specs, outdated architecture |
| Lessons index | Lessons in memory + docs/ | Lessons for deleted/rewritten systems |
Catalog everything with dates:
Memory files: count, oldest, newest
MEMORY.md: line count (warn if >170)
CLAUDE.md: gotcha count, last modified
docs/: file count per subdir, oldest files
Flag files older than 14 days for review. Flag any file referencing deleted code paths.
For each doc file, check against reality:
Memory files — classify each:
arch-*: Does the system still exist? Has it changed significantly since the memory was written?lesson-*: Is the lesson about a system that was deleted/rewritten? Is the gotcha now guarded by semgrep/code?feedback_*: Is the preference still relevant? (some become obvious after being applied everywhere)client-*: Are facts current? (pricing, status, contacts)project_*: Is the project/initiative still active?reference-*: Does the external resource still exist? Is the info current?content_*, lead-*, icp-*: Is the strategy still the one we're executing?CLAUDE.md gotchas — for each:
git log --oneline -5 -- <related-files> — was the gotcha recently fixed?grep -r "<gotcha-keyword>" — is the guard/semgrep rule in place?docs/ — for each:
Output a structured report:
## DELETE (stale, system removed, or fully guarded)
- [ ] memory: lesson-X — system deleted on 2026-04-03
- [ ] memory: arch-Y — replaced by arch-Z, duplicate info
- [ ] docs: spec-old.md — implemented and diverged, spec is now a lie
## UPDATE (partially stale, core still valid)
- [ ] memory: client-vladimir — pricing changed
- [ ] CLAUDE.md gotcha line 42 — partially fixed, needs narrowing
## COMPRESS (valid but verbose, can merge or shorten)
- [ ] memory: feedback_A + feedback_B — same theme, merge into one
- [ ] MEMORY.md — 3 entries pointing to same concept
## KEEP (verified fresh)
- (count): N files verified current
User reviews the triage. No deletions without approval.
After user approves (or approves with edits):
After execution:
git diff --stat — review what changedSkip entirely if --skip-mempalace flag is set or if mempalace_status MCP tool is unavailable.
6.1 Re-mine project — push updated docs into palace.
mempalace mine <project-root>
Incremental: mempalace compares source_mtime per file and skips unchanged. Only updated/added memory files, CLAUDE.md, and docs/ get re-chunked. Cheap even on large repos.
Do NOT re-mine the convos wing (~/.claude/projects/... with --mode convos) — conversation history is append-only and handled separately.
6.2 KG invalidate for deleted files — for each file removed in Phase 4:
client-vladimir-yakimenko.md → Vladimir Yakimenko, arch-reply-queue.md → reply-queue).mempalace_kg_query(entity=...) — list facts currently stored.source_file matches the deleted file → mempalace_kg_invalidate(fact_id=...).6.3 KG add for updates — for facts that CHANGED during Phase 4 (e.g. client pricing updated, project status flipped):
mempalace_kg_invalidate on the old fact (if it exists in KG).mempalace_kg_add with the new fact, including source_file pointing to the updated memory file.Only add facts you are confident about. Facts derived from speculation or uncommitted plans should NOT enter the KG.
6.4 Diary write — record the refresh pass:
mempalace_diary_write(
agent_name="claude-code",
topic="docs-refresh",
entry="REFRESH:<date>|deleted:N|updated:M|compressed:K|kg_invalidated:X|kg_added:Y|memory.lines:A→B"
)
Keep AAAK-compressed — one line. Omit details that are already in git history.
| Signal | Action |
|---|---|
| Memory references file/function that doesn't exist | DELETE or UPDATE |
| Lesson about system deleted >7 days ago | DELETE |
| Architecture doc contradicts current code | UPDATE |
| Feedback already baked into CLAUDE.md or code convention | DELETE (redundant) |
| Two memory files covering same topic | MERGE into one, delete other |
| MEMORY.md entry >150 chars | SHORTEN |
| Reference to external URL that 404s | DELETE or UPDATE |
| Project memory about completed initiative | ARCHIVE (move to "completed" or delete) |
When merging:
/docs-refresh — full pipeline: inventory → scan → triage → (approve) → execute → verify → mempalace-sync
/docs-refresh --scan-only — inventory + scan + triage report, no changes
/docs-refresh --memory-only — scope to memory files + MEMORY.md only
/docs-refresh --claude-only — scope to CLAUDE.md files only
/docs-refresh --docs-only — scope to docs/ vault only
/docs-refresh --auto — auto-approve obvious deletions (deleted systems, duplicates), ask for ambiguous
/docs-refresh --skip-mempalace — skip Phase 6 (no re-mine, no KG sync, no diary write)
/docs-refresh --mempalace-only — run Phase 6 only (re-mine + KG sync + diary), no staleness scan