Synchronize knowledge base documentation with current codebase implementation. Performs full, incremental, or targeted audits of source code and updates code maps, PRDs, patterns, SOPs, and...
Synchronize knowledge base documentation with current codebase implementation.
ALWAYS run /pmc:kb first to understand KB structure and document formats.
| Type | Scope | When to Use |
|---|---|---|
| Full | Read all source files, create/update all code maps | First time, major version, annual |
| Incremental | Compare git diff since last anchor, update affected docs | After feature work, monthly |
| Targeted | Focus on specific area (e.g., just CLI or just dashboard) | After focused changes |
git rev-parse HEAD
git log -1 --format="%H %s (%ai)"
Create audit notes file: .pmc/docs/6-references/audit-{date}.md
# Code Audit Notes - {date}
**Anchor Commit:** `{hash}` - "{message}" ({date})
**Status:** In Progress
## Files Read
(track as you go)
## Features Discovered
(update incrementally)
Decision: Always record anchor for future incremental audits.
Glob: src/**/*.py (or appropriate pattern for your codebase)
Group by area (example for Python):
Critical: For full audit, read every file. Do not sample or infer.
Read in parallel where possible. Update audit notes incrementally:
### {Area} ({n}/{total} read)
| File | Lines | Features Identified |
|------|-------|---------------------|
| file.py | 123 | Feature1, Feature2 |
Decision: Reading is non-negotiable for full audit. Sampling leads to gaps.
After reading all files, create comprehensive feature list organized by functional area.
Glob: .pmc/docs/5-code-maps/*.md
For each feature area, decide:
Decision: Feature-based approach (not file-based) ensures user-relevant documentation.
For each code map:
Format: See kb/references/codemap-format.md
Mark audit as complete:
After code maps are current, verify other docs match reality.
Glob: .pmc/docs/1-prd/*.md
For each PRD:
Glob: .pmc/docs/4-patterns/*.md
For each pattern:
Status: open patterns - still valid?Status: resolved patterns - solution still applies?Status: open | resolvedSource: CLI help, README, code map features
personas.md - Who uses this?use-cases.md - Common scenariosfaq.md - Questions answered in sessionsGlob: .pmc/docs/2-sop/*.md
For each SOP:
git log --oneline {last-anchor}..HEAD
git diff --name-only {last-anchor}..HEAD -- src/
Focus on files that changed. Update affected code maps.
Update audit notes with new anchor commit.
6-references/ - permanent record