/update — Update Knowledge Base
Solidify the work from this session into documents and reusable knowledge. Three phases are executed in sequence: document update, quality review, and pattern extraction.
ECC Resource Pre-check: Confirm the availability status of the doc-updater agent and learn-eval skill. If they have been deferred, prompt the user to restore first or adjust the workflow.
Division of labor with
:
is responsible for knowledge solidification,
is responsible for git output. They can be used in combination when needed: run
first then
.
Step 1: doc-updater — Update Documents
Use the doc-updater agent to scan changes from this session and update relevant documents.
Agent(subagent_type="everything-claude-code:doc-updater")
Scan Scope:
- Run
git diff --name-only HEAD
to get the list of files changed in this session
- If there are no uncommitted changes, use
git diff --name-only HEAD~3..HEAD
to get files involved in recent commits
- If there are still no changes, use AskUserQuestion to ask:
- Specify Files — Manually specify the documents to check
- Full Scan — Scan all documents for outdated content
- Run learn-eval Only — Skip Step 1-2, go directly to Step 3 to extract patterns
- End — Terminate the /update workflow
- Update according to the change content:
- Relevant documents under the directory
- Architecture diagrams under the directory
- (if there are changes to functionality or usage)
- Other affected document files
HITL Confirmation (Required): Before updating any documents, first list the "planned update file list" and use AskUserQuestion to request user confirmation:
The following files will be updated, please confirm if correct:
1. path/to/file1.md — Reason: xxx
2. path/to/file2.md — Reason: xxx
[Confirm to continue] / [Adjust list] / [Skip]
Document Library / Knowledge Base Ambiguity Handling: If "document library" or "knowledge base" is mentioned in the context, you must first clarify which directory it refers to, do not assume on your own:
- May be , , (project documents)
- May be
~/.claude/projects/.../memory/
(Claude memory library)
- May be (skill library)
- If it cannot be determined from the context, use AskUserQuestion to confirm before proceeding
Handover Information: Record which document files were updated and the change summary, as input for the next step code-reviewer.
Step 2: code-reviewer — Cross-check + Document Quality Review
Use the code-reviewer agent to review the documents updated in Step 1, and cross-check whether the changes are complete and correct.
Agent(subagent_type="everything-claude-code:code-reviewer")
Review Focus:
- Whether the document content accurately reflects the code changes
- Whether there are outdated or inconsistent descriptions
- Whether the format and structure comply with project conventions
- Whether there is missing important information
Cross-check:
- Compare with the actual changes from , confirm one by one whether each updated document covers all important changes
- Confirm there are no "files that should be updated but missed"
- Confirm there are no "files that should not be updated but modified incorrectly"
- If omissions or errors are found, mark them in the output report
Output Format:
| Severity | Item | Description |
|---|
| CRITICAL | Content Error | Document description does not match actual code behavior |
| HIGH | Important Omission | Missing description of key functions or APIs |
| MEDIUM | Format Issue | Inconsistent structure, inconsistent terminology |
If there are CRITICAL or HIGH issues, use AskUserQuestion to ask the user:
- Continue after correction: Fix the issues first before proceeding to Step 3
- Skip, continue directly: Ignore the issues and proceed to run learn-eval
Step 3: learn-eval — Extract Reusable Patterns
Use learn-eval to extract reusable patterns from this session, evaluate the quality and write them to the knowledge base.
Skill(skill="everything-claude-code:learn-eval")
Extraction Scope:
- debugging patterns
- troubleshooting insights
- architectural decisions
- project-specific patterns
- tool usage patterns
- industry standard adoptions
- standardized solution selections
Quality Evaluation: learn-eval will automatically perform 5-dimensional scoring (specificity, actionability, scope fit, non-redundancy, coverage), and only patterns with a score of at least 3 will be saved.
Step 4: Knowledge Base Cross-check (HITL Confirmation)
After learn-eval is completed, perform the final cross-check to confirm that all knowledge bases have been updated correctly.
Inventory of knowledge base locations involved in this session:
| Knowledge Base | Path | Description |
|---|
| Claude Memory Library | ~/.claude/projects/<project-hash>/memory/MEMORY.md
| Project-level memory |
| Global Skill Library | ~/.claude/skills/learned/
| Global reusable patterns |
| Global Memory | | Cross-project memory (if any) |
| Project Documents | , , | Project description documents |
Cross-check Steps:
- Read the actual content of each of the above knowledge bases
- Compare with the work content of this session, confirm one by one:
- Decisions or patterns that were implemented but not recorded
- Whether the recorded content is consistent with the actual situation (no wrong descriptions)
- Whether the industry standards or academic references cited this time have been recorded in the appropriate knowledge base
- Whether there are inconsistencies across knowledge bases (e.g. contradiction between MEMORY.md and learned skill)
- If problems are found, list the specific differences
HITL Confirmation: After the comparison is completed, present the results with AskUserQuestion, and request user confirmation before ending:
Knowledge Base Cross-check Results:
✅ MEMORY.md — xxx has been correctly recorded
✅ learned/yyy.md — Content is consistent with implementation
⚠️ The description on line 12 of MEMORY.md does not match the actual behavior, it is recommended to modify: ...
[Confirm no errors, end] / [Modify before ending]
Step 5: Summary Report
After all steps are completed, output the final report:
markdown
## /update Execution Result
### Document Update
- List all updated document files and change summaries
### Quality Review
- List the review results of code-reviewer
- Mark corrected / uncorrected items
### Knowledge Extraction
- List the patterns extracted by learn-eval
- Mark storage location (global / project-level)
### Knowledge Base Cross-check
- List comparison results (✅ Correct / ⚠️ Difference / ❌ Error)
- Mark corrected / pending correction items
### Suggested Next Steps
- If there are uncorrected issues, suggest handling methods
- If it is suitable to open a PR, suggest running `/pr`