/second-brain:kb-lintfrom second-brain
Health-checks a knowledge bank for orphan documents, broken WikiLinks, stale content, index drift, and missing frontmatter. Generates a severity-graded report. Useful for KB maintenance and quality assurance.
Ships in second-brain. 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.
Read when SKILL.md points to them; scripts run unread.
Health-check the knowledge bank to detect quality issues that accumulate over time. Without periodic linting, orphan documents pile up, cross-references break, and stale content persists unchallenged.
Knowledge Bank Location: Read from ~/.claude/plugins/config/second-brain/config.json.
/second-brain:kb-lintSkill({ skill: "second-brain:kb-lint" })Run lint checks in order. Each check produces findings with a severity level.
Find WikiLinks that don't resolve to any file in the KB:
./scripts/lint_broken_links.sh "$KB_PATH"
Reuses WikiLink extraction from knowledge-bank-lookup/scripts/wikilink-utils.sh and resolution logic.
Find documents missing required frontmatter fields (title, type, created):
./scripts/lint_frontmatter.sh "$KB_PATH"
Reuses frontmatter reading from skills/common/obsidian_helpers.sh.
Find documents with zero incoming WikiLinks (not referenced by any other document):
./scripts/lint_orphans.sh "$KB_PATH"
Builds a reverse-link index across the entire KB. Excludes structural files (_meta/, _index/, _sessions/).
Find documents that exist on disk but are missing from _meta/index.md:
./scripts/lint_index_drift.sh "$KB_PATH"
Compares filesystem against the generated index. Also detects entries in the index that no longer have backing files.
Find documents not modified in 90+ days:
./scripts/lint_stale.sh "$KB_PATH"
Uses file modification timestamps. Excludes _sessions/ and daily-log/ (inherently historical).
Find session folders registered for a session id that never became a conversation:
./scripts/lint_ghost_folders.sh "$KB_PATH" [min_age_hours]
Hooks never delete a session folder (see docs/adr/0001-hooks-never-delete-session-folders.md), so
collecting ghosts is this check's job. The signature is one no live session can match: a note nobody
updated, no documents, no end time, older than a day by default, and a transcript that is absent or
never grew. A folder with an end time but no start metadata is an end stub, not a ghost — that
means a note was lost or registration was missed, so it is repaired rather than swept.
Generate a lint report at _meta/lint-report-YYYY-MM-DD.md:
---
title: KB Lint Report YYYY-MM-DD
type: lint-report
generated: YYYY-MM-DDTHH:MM:SSZ
---
# KB Lint Report
| Severity | Count |
|----------|-------|
| Error | N |
| Warning | N |
| Info | N |
## Errors
### Broken WikiLinks
- [[Target]] referenced from [[Source]] — target not found
### Missing Frontmatter
- /path/to/doc.md — missing: title, type
## Warnings
### Orphan Documents
- [[Doc Name]] — zero incoming references
### Index Drift
- /path/to/doc.md — exists on disk but missing from index
### Ghost Session Folders
- _sessions/YYYY-MM-DD/<session-id> — no transcript, N hours old
## Info
### Stale Documents
- [[Doc Name]] — last modified YYYY-MM-DD (N days ago)
Append operation to _meta/log.md:
source skills/common/obsidian_helpers.sh
append_kb_log "$KB_PATH" "lint" "kb-lint" "N errors, N warnings, N info findings"
After presenting the report, use AskUserQuestion tool to offer resolution:
status: stub (see below).[[Related Concept 1]]. Remove from source files.generate_index.sh to rebuild _meta/index.md_meta/trash/<timestamp>-<session-id> and record it with append_kb_log. Never delete outright: the check is deliberately conservative, but a move is reversible and a delete is not.See fix-guide.md for stub creation templates, classification heuristics, alias resolution, and template placeholder removal details.
| Severity | Meaning | Action |
|---|---|---|
| Error | Data integrity issue | Fix immediately — broken links mislead lookups |
| Warning | Quality degradation | Fix soon — orphans and drift reduce discoverability |
| Info | Potential staleness | Review periodically — may need updating or archiving |
| Mode | Complete when |
|---|---|
| Report only | All 5 checks run, lint report generated, log appended, findings summarized |
| Report + Fix | All of above, plus chosen fixes applied, index regenerated |
references/fix-guide.md (opens in a new tab)scripts/lint_broken_links.sh (opens in a new tab)scripts/lint_frontmatter.sh (opens in a new tab)scripts/lint_ghost_folders.sh (opens in a new tab)scripts/lint_index_drift.sh (opens in a new tab)scripts/lint_orphans.sh (opens in a new tab)scripts/lint_stale.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
knowledge-bank, lint, health-check, wiki-links, orphan-documents, stale-content
Other plugins' skills for the same job
npx claudepluginhub sxhmilyoyo/sundayhao-plugins --plugin second-brain6 skills in this plugin
/kb-ingestIngest external sources into the knowledge bank through interactive study or quick filing. Two modes — Quick (summarize → file) and Study (theme-by-theme deep dive with online research and personal notes → multi-layer KB output → optional blog/slack synthesis). Triggers on "ingest this", "study this article", "add to knowledge bank", "learn from this", "process this article", "take notes on this", "what are the key takeaways", "break this down for me", or when user provides external reference material for long-term retention. Also use when user says "let's go through this", wants to deeply engage with a source document, or shares an article/gist/doc and asks about its content./knowledge-bank-lookupDelegates knowledge bank lookups to Explore subagents with reflections-first strategy that learns from past mistakes. Checks /reflections/ directory before documentation to extract documented failures to avoid and proven approaches to apply. Automatically triggers when user mentions services ([project-a], [project-b], [project-c], Claude Code), requests investigations, or queries past lessons. Returns structured, actionable insights achieving 69-94% context reduction. (project, gitignored)/session-managerSet the current session's name, project, tags, or summary on its session note. Use when the user names, tags, or summarizes this session, sets its project, or mentions in passing what this session has been about./session-recapDocument Claude Code sessions by extracting knowledge into cross-referenced documentation. Triggers on "recap the session", "summarize the work", or after significant code changes./wdymFrom-zero decode of this session's agent work for the person supervising it. Use when the person does not follow something the agent said or showed ('wdym', 'what do you mean'), wants it from zero ('like I have no context', 'from scratch'), asks what a word, step or output of this session means or why the agent did it that way, asks for proof ('how did you verify', 'prove it'), or says 'wdym debrief'. An explanation for an audience other than the person belongs to the eli5 skill; a pure visual request belongs to show-me.