neat-freak
End-of-session knowledge cleanup with OCD-level rigor — reconciles project docs (CLAUDE.md, README.md, docs/) and agent memory against the code so nothing rots. OCD-level review and synchronization of project documents and agent memory after a session. MUST trigger when the user says: "sync up", "tidy up docs", "update memory", "clean up docs", "/sync", "/neat", "sync up", "tidy up docs", "tidy up", "update memory", "organize", "wrap up", "this phase is done", "newcomers can start directly", or any phrase suggesting a development milestone where knowledge needs reconciliation. Also trigger when the user reports stale docs, conflicting memories, or wants a clean handoff to teammates or other agents. A standalone "tidy" with prior development context counts — do not under-trigger. Cross-platform: works on Claude Code, OpenAI Codex, OpenCode, and OpenClaw.
NPX Install
npx skill4agent add kkkkhazix/khazix-skills neat-freakTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →OCD — Knowledge Base Neat-Freak
Cross-platform Agent Skill — Compatible with Claude Code · OpenAI Codex · OpenCode · OpenClaw. Cross-platform SKILL.md, following the Open Agent Skill Specification.
Why This Matters
Key Concept: Three Types of Knowledge, Three Audiences
| Location | Audience | Responsibilities | Cost of Desynchronization |
|---|---|---|---|
| Agent Memory System (if supported by the agent) | The agent itself for cross-session reuse | Personal preferences, non-obvious project facts, cross-project references | The agent forgets historical decisions in the next session |
Project root | AIs in the current project (including itself in the next session) | Project conventions, structure, red lines, environment variables, route lists | The AI takes detours in this project in the next session |
Project | Others (human colleagues, downstream developers, future AI takers) | Access guides, architecture diagrams, operation manuals, handoff instructions, API references | Others or systems cannot properly access or operate the project |
The specific location of the Agent Memory System varies by platform (Claude Code uses, Codex uses~/.claude/projects/<...>/memory/, OpenCode usesAGENTS.md, OpenClaw uses.opencode/). For a quick reference of complete paths, see references/agent-paths.md. If the current agent does not have an independent memory system, skip this layer directly and focus all efforts on docs and project root markdown files.~/.openclaw/
Execution Process
Step 1: Inventory the Current State (Mandatory Mechanical Enumeration, Cannot Skip)
- List the agent's memory files (if any):
- Claude Code: Run and read
ls ~/.claude/projects/<...>/memory/and all referencedMEMORY.mdfiles.md - Codex / OpenCode / Others: Find the equivalent location for the agent (see references/agent-paths.md)
- Claude Code: Run
- For each project involved in this conversation:
- Run → Confirm the root directory structure
ls <project-root>/ - Run → Enumerate all docs (confirm even if missing)
ls <project-root>/docs/ 2>/dev/null - Run → Catch scattered .md files as a fallback
find <project-root> -maxdepth 2 -name "*.md" -not -path "*/node_modules/*" -not -path "*/.git/*" - Read ,
README.md/CLAUDE.md, and everyAGENTS.mddocs/*.md
- Run
- Read global agent configurations (if any, such as ,
~/.claude/CLAUDE.md)~/.codex/AGENTS.md - Review the entire content of this conversation
Step 2: Identify Changes — Think with the "Change Impact Matrix"
- New API / Route → CLAUDE.md route list + integration-guide + Routes in architecture
- New / Renamed Environment Variable → CLAUDE.md environment variable table + runbook + downstream integration-guide
- New Database Table → CLAUDE.md + Data Model in architecture
- New Major Feature (spanning multiple files) → All of the above + new section in architecture + completed list in handoff
- Cross-project Changes → Docs of both upstream and downstream projects must be aligned (the most common missed modification scenario)
- Memory Layer: Relative time → Absolute date, outdated facts → Modify, duplicates → Merge, completed todos → Delete
Step 3: Actual Modification (Use Tools, Don't Just Describe)
- Merge over Append: New information updates old information; modify the old entry instead of adding a new one
- Delete over Keep: Delete completed temporary plans, overturned decisions, and outdated context
- Precision over Verbosity: One memory entry should clearly state one thing, don't cram three
- Absolute Time: Always use , never "today", "recently"
2026-04-29 - Reader-Oriented: The readers of docs/ are "external parties encountering this project for the first time"; write as if they only have 5 minutes to read
- No Audience Mixing: Don't copy the full text of docs/ into CLAUDE.md, and don't write "I remember last time..." in docs/ — that's for memory
- Extreme Restraint on Global Configurations: Only modify /
~/.claude/CLAUDE.mdif the user clearly expresses cross-project core principles in the conversation. Daily project details never go into global configurations.~/.codex/AGENTS.md
- integration-guide or corresponding "external perspective" document: Add how to use it (curl / SDK examples / error code tables)
- architecture: Add how it works (data flow, state machines, design trade-offs)
- runbook: Add how to operate and maintain it (smoke test commands, troubleshooting, environment variables)
- handoff or CHANGELOG: Add completed items
Step 4: Self-Check List (Must Go Through Item by Item)
- Every file listed in Step 1 has been judged as "No Modification Needed" or "Modified"
- Every link in the memory index (if any) points to an existing file
- The description and content of each memory file match
- There are no contradictions between memories
- Paths / commands / tools / environment variables mentioned in CLAUDE.md / AGENTS.md actually exist in the code
- The installation / running steps in README are consistent with the code
- New API routes: Appear in both integration-guide and architecture
- New environment variables: Appear in both runbook and project root markdown
- New database tables: Appear in both the Data Model of architecture and project root markdown
- Cross-project impact: Docs of downstream projects have also been modified accordingly
- No relative time remains (zero results from )
grep -E "today|yesterday|just now|recent|last week|today|yesterday|recently"
Step 5: Change Summary
## Synchronization Completed
### Memory Changes
- Updated: xxx (reason)
- Added: xxx
- Deleted: xxx (reason)
### Document Changes (Grouped by Project, list all modified files for each project)
- <Project A>/CLAUDE.md — xxx
- <Project A>/docs/integration-guide.md — xxx
- <Project A>/docs/architecture.md — xxx
- <Project B>/docs/<integration>.md — xxx
### Unhandled Items
- xxx (reason for not handling, e.g., needs user confirmation)Special Cases
References
- references/sync-matrix.md — Complete mapping table of "Change Type → Files to Modify"
- references/agent-paths.md — Quick reference for memory and configuration paths of Claude Code / Codex / OpenCode