From obsidian-kb
Refreshes project's Obsidian knowledge base notes to match recent code changes. Reviews git activity, surgically edits stale notes with file:line evidence, flags new concepts for approval.
npx claudepluginhub waelmas/codeplow --plugin obsidian-kbThis skill uses the workspace's default tool permissions.
Keep the project KB aligned with reality as the code evolves. Review recent git activity and session context, surgically update stale KB notes, flag new concepts for documentation.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Executes ctx7 CLI to fetch up-to-date library documentation, manage AI coding skills (install/search/generate/remove/suggest), and configure Context7 MCP. Useful for current API refs, skill handling, or agent setup.
Generates production-ready Python code for Dataverse SDK with error handling, singleton clients, retry logic, OData optimizations, logging, and type hints.
Share bugs, ideas, or general feedback.
Keep the project KB aligned with reality as the code evolves. Review recent git activity and session context, surgically update stale KB notes, flag new concepts for documentation.
Scope distinction:
kb-update (this skill) — edits notes inside the vault (under Architecture/ and Research/, excluding Sessions/ handoffs and Research/Documentation Audit.md) so the agent's memory matches the current code.kb-audit — checks the project's user-owned markdown (README.md, ARCHITECTURE.md, etc.) and produces a stand-alone audit report.Both enforce the same hard rule: no edit or flag without file:line evidence.
Follow the Preflight Check in the obsidian-kb awareness skill (${CLAUDE_PLUGIN_ROOT}/skills/obsidian-kb/SKILL.md). In short: verify command -v obsidian, verify timeout 3 obsidian vaults works, launch Obsidian if needed.
Follow the Vault Resolution Algorithm in ${CLAUDE_PLUGIN_ROOT}/skills/obsidian-kb/SKILL.md. Strict priority: user argument → path overlap → frontmatter project_path → strong name match → STOP and ask.
Capture both $VAULT_NAME and $VAULT_PATH.
Print the confirmation line on your first reply:
"Using vault
<Vault Name>at<path>(matched via<tier>). Reviewing KB notes against recent code changes."
If the user passed a focus area in $ARGUMENTS (e.g., "focus on the auth refactor"), capture it as $FOCUS — it will narrow Step 4's inventory.
Tell the user:
"No knowledge base vault found for this project. Run
/kb-initto create one first, then return here to refresh it."
Stop.
Switch Obsidian's active vault to the resolved one so CLI operations work:
CURRENT=$(timeout 3 obsidian vault info=name 2>/dev/null)
if [[ "$CURRENT" != "$VAULT_NAME" ]]; then
ENCODED=$(printf '%s' "$VAULT_NAME" | sed 's/ /%20/g')
open "obsidian://open?vault=${ENCODED}" # macOS; xdg-open on Linux; start on Windows
sleep 3
CURRENT=$(timeout 3 obsidian vault info=name 2>/dev/null)
fi
if [[ "$CURRENT" == "$VAULT_NAME" ]]; then CLI_MODE=1; else CLI_MODE=0; fi
All writes in this skill go through the filesystem using $VAULT_PATH (safer for multi-line edits than CLI escaping). Reads may use the CLI when CLI_MODE=1.
Identify the range of changes to review. Preference order:
Since the last handoff (most common):
LAST_HANDOFF=$(ls -t "$VAULT_PATH"/Sessions/*handoff*.md 2>/dev/null | head -1)
if [[ -n "$LAST_HANDOFF" ]]; then
LAST_HANDOFF_DATE=$(grep -m1 '^date:' "$LAST_HANDOFF" | sed 's/date:[[:space:]]*//')
SINCE_ARG="--since=$LAST_HANDOFF_DATE"
else
SINCE_ARG="--max-count=15"
fi
User-specified window if $ARGUMENTS includes something like "since last week" — pass through to git log --since="...".
No git history (not a repo) — fall back to session conversation as the sole signal.
Pull evidence of what changed:
# What commits landed
git log --oneline $SINCE_ARG 2>/dev/null
# What files changed, with line-count deltas
git diff $SINCE_ARG --stat 2>/dev/null
# Unstaged work that might not be committed yet
git diff --stat 2>/dev/null
git status --short 2>/dev/null
Also consider the session conversation:
Build a mental list of areas of interest — e.g., "auth middleware", "database connection pool", "new caching layer". $FOCUS (if provided) takes top priority.
List every KB note that could plausibly be affected:
find "$VAULT_PATH" -type f -name '*.md' \
-not -path '*/.obsidian/*' \
-not -path '*/Sessions/*' \
-not -name 'Documentation Audit.md'
Always excluded:
Sessions/ — handoffs are point-in-time records; editing them would corrupt history.Research/Documentation Audit.md — owned by /kb-audit; don't touch.If $FOCUS is set, prioritize notes whose filename or path matches the focus area.
For each KB note in the inventory, read its content and look for concrete claims that can be checked against the code:
src/auth/middleware.ts")npm test")For each concrete claim, verify against the code:
package.json / Makefile / etc.?If any claim fails verification, mark the note as a staleness candidate and capture the concrete evidence (file:line or command output that contradicts the claim).
For each staleness candidate, apply an in-place edit to the affected section:
Rules:
file:line reference (or equivalent, e.g., package.json:15-22, ls src/services/ output).[[Note Name]] references or rename linked notes.last_updated) is specifically stale.Use the Edit tool for each change. Prefer many small edits over one big rewrite.
Example edit:
The auth service lives in \src/services/auth/`.`ls src/services/ returns billing/ notifications/ orders/ — no auth/. grep -l "authenticate" src/middleware/ finds src/middleware/auth.ts.The auth service lives in \src/middleware/auth.ts` (moved from `src/services/auth/` during the JWT refactor).`If the change signals reveal a new concept that isn't covered by any existing KB note — a new service, a new pattern, a new architectural decision, a new dependency that deserves its own note — do NOT create the note silently.
Instead, collect a list of candidates and present them at the end for user approval:
Candidates for new notes (awaiting your approval):
- `Architecture/Refresh Token Flow` - new concept introduced by commit abc123; no existing note
covers token lifecycle. Would document: rotation policy, revocation, storage.
- `Research/Redis Caching Layer` - new dependency (package.json:58); worth a standalone note
describing eviction policy and hit-rate expectations.
The user can approve or redirect. Do not write these without approval.
Summarize at the end:
Updated N KB notes based on recent changes:
- Architecture/System Overview.md - auth section refreshed
(evidence: src/middleware/auth.ts replaces src/services/auth/)
- Architecture/Tech Stack.md - Postgres version 15 → 16
(evidence: package.json:42, docker-compose.yml:8)
- Research/Error Handling.md - added reference to new RetryMiddleware
(evidence: src/middleware/retry.ts:1-47)
Candidates for new notes (awaiting your approval):
- Architecture/Refresh Token Flow
- Research/Redis Caching Layer
Unchanged: K notes - no drift detected against the reviewed window.
Skipped by design: Sessions/* (handoffs), Research/Documentation Audit.md.
Tip: run /kb-audit to cross-check the project's own markdown separately.
Sessions/ or Research/Documentation Audit.md.file:line (or equivalent concrete) evidence.timeout to prevent hangs.