원클릭으로
kmg-docs-impact-scan
Fires on pre-ship signals to scan for docs affected by code changes
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Fires on pre-ship signals to scan for docs affected by code changes
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Provide orientation to the Knowledge Graph system architecture and guidance for knowledge capture
Enforce zero-deviation plan execution when user invokes plan implementation
Auto-surface ADR creation when user makes architectural decisions or chooses between technical approaches
Auto-invoke knowledge graph search when user asks about project history, past decisions, or previously solved problems
Ensure the knowledge graph is consulted before any recommendation is made
Route capture-that / remember-that requests to the correct destination via auto-detection
| name | kmg-docs-impact-scan |
| description | Fires on pre-ship signals to scan for docs affected by code changes |
Fires on pre-ship signals:
Does not apply to:
doc-update-router for thoseRun git diff main...HEAD and extract changed identifiers: command names, feature names, flag names, skill names. If the diff is very large, cap at 20 identifiers and note the cap to the user.
Scan the following scope for references to each extracted identifier:
.md files in project root.md files in docs/ — excluding docs/plans/, docs/superpowers/, docs/design/Always add these to the candidate list regardless of grep results (only if the file exists in the project):
README.mdINSTALL.mdCHANGELOG.mdCOMMAND-GUIDE.mdQuery the active KG for any learned correction patterns matching the changed identifiers (stored as "when [identifier] changes, also check [file]"). Add any matched files to the candidate list.
Show the combined list with source labels before running any updates:
Docs likely affected by this change:
✓ README.md (obvious file)
✓ COMMAND-GUIDE.md (matched: "docs-impact-scan")
✓ INSTALL.md (obvious file)
? docs/reference/skills.md (matched: "skills")
+ CONFIGURATION.md (KG pattern: learned from prior release)
Add any missing files, remove any that don't apply, then confirm.
Wait for user confirmation before proceeding.
For each file the user manually added that the grep scan did not find, offer to save a learned pattern:
"Should I save a pattern — when [identifier] changes, also check [file]?"
If yes, save to the active KG patterns file:
When [identifier] changes, also check [file].
Source: docs-impact-scan correction (YYYY-MM-DD)
Call /kmgraph:kmg-update-doc --user-facing [file] for each file in the confirmed list, one at a time in sequence.
Write the per-commit docs-impact-scan completion flag before reporting. The pre-push gate (pre-push-gate.sh Gate 3) checks this flag to confirm the scan ran at the current commit.
Run these commands (or instruct the user to run ! <cmd> if Bash is unavailable):
BRANCH=$(git branch --show-current 2>/dev/null | tr '/' '-')
SHA=$(git rev-parse --short HEAD 2>/dev/null)
if [ -n "$BRANCH" ]; then
touch "/tmp/kmgraph-docs-scan-${BRANCH}-${SHA}.flag"
else
touch "/tmp/kmgraph-docs-scan-${SHA}.flag"
fi
Flag filename formula: /tmp/kmgraph-docs-scan-<branch>-<sha>.flag where <branch> is the sanitized branch name (slashes replaced with -) and <sha> is the short HEAD commit hash. Detached-HEAD fallback: SHA-only flag name. The flag auto-invalidates on every new commit and across branches.
Then report the completed docs:
Docs updated (N files):
✓ README.md
✓ COMMAND-GUIDE.md
✓ docs/reference/skills.md
Completion flag written: /tmp/kmgraph-docs-scan-<branch>-<sha>.flag
(Pre-push gate cleared for this commit.)
| Situation | Behavior |
|---|---|
| Diff has no identifiable identifiers | Skip grep scan; present obvious files only; note "no identifiers extracted from diff" |
| No docs reference changed identifiers | Present obvious files only; note "no additional matches found" |
| User removes all files from list | Confirm intentional skip; log "no doc updates made for this release" |
| KG pattern references a file that no longer exists | Skip the file silently; offer to remove the stale pattern from KG |
| Very large diff (>20 identifiers) | Cap extraction at 20; note cap to user before presenting list |