/memory-toolkit:docs-reflect [optional focus area]from memory-toolkit
Collects DOC: notes from a session, generalizes them into rules, and proposes repo documentation in .claude/rules/ or docs/.
Ships in memory-toolkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Collect DOC: notes accumulated since the last review, generalize them into rules, and propose documentation for the repository.
Two sources: DOC: notes since the last review, and recurring feedback from memory.
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" docs
Lists DOC: notes after the last DOCS_REVIEWED marker (Step 6 writes it). docs --all lists every note, reviewed or not.
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" recurring
This scans feedback/ files for clusters — similar corrections that appeared 2+ times across sessions. Recurring patterns are strong candidates for promotion to .claude/rules/.
If both sources are empty — tell user "No documentation findings." and stop.
If recurring patterns found (3+ occurrences) — these are project conventions, not personal preferences. Treat them as DOC automatically:
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" note "DOC: <domain> — <generalized rule from recurring feedback>"Patterns with 2 occurrences — mention as candidates but don't auto-promote.
For each DOC: note, extract a generalized rule.
Bad (too specific):
"The PaymentService bug was on line 42 in processRefund()"
Good (pattern):
"Refund operations must check transaction state before mutating — stale state causes double-refunds"
Bad (class-level):
"UserService.getProfile() returns null when user is not found"
Good (convention):
"Services return null for missing entities instead of throwing — callers must handle null"
If a note can't be generalized — skip it.
ls .claude/rules/ 2>/dev/null
cat CLAUDE.md 2>/dev/null | head -50
ls docs/ 2>/dev/null
Check memory for saved preference:
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" search "docs_target"
If no saved preference and no .claude/rules/ directory — ask:
Where should project rules go?
1. .claude/rules/ (Claude Code loads these per-directory)
2. docs/
3. CLAUDE.md (single file, always loaded — use sparingly)
4. Other — specify path
Choice? (default: 1)
Save preference:
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" note "CONFIG: docs_target=<chosen path>"
Route using the chosen target directory (default: .claude/rules/):
| Domain | Target |
|---|---|
| testing | <target>/testing.md |
| api | <target>/api.md |
| architecture | <target>/architecture.md |
| state | <target>/state.md |
| workflow | <target>/workflow.md |
| Other domain | <target>/<domain>.md |
| Truly universal (rare) | CLAUDE.md |
If a matching file exists — add to it. If not — create one.
## Docs-reflect: <date>
Found N DOC: notes, grouped into M domains:
### <target>/testing.md
- <rule 1>
- <rule 2>
### <target>/api.md
- <rule 3>
### Skipped
- <notes too specific to generalize>
Apply? (all / pick numbers / skip)
Wait for user confirmation.
For each approved rule:
For rule files (.claude/rules/, docs/, or custom target):
## <Section>
- <Rule>
MANDATORY once the user has answered Step 4 — applied, picked or skipped. Skipped notes count as reviewed:
node "${CLAUDE_PLUGIN_ROOT}/scripts/memory.js" docs --mark-reviewed
Don't mark if the run was limited to a focus area or the user stopped before answering — those notes stay for the next run.
.claude/rules/ file.What SKILL.md sets; muted values are Claude Code's defaults
10 skills in this plugin
/reflectSession reflection — analyzes what happened, proposes backlog items, captures insights.npx claudepluginhub ilyagorsky/memory-toolkit --plugin memory-toolkitOther plugins' skills for the same job