agentsclimarketplace

Kb lint

Skill sxhmilyoyo/sundayhao-plugins/second-brain/skills/kb-lint

🧠 Claude Code plugin marketplace featuring Second Brain - an agentic workflow system with persistent memory and tribal knowledge. Transform Claude from goldfish to elephant with cross-session learning.

Install
npx -y skills add sxhmilyoyo/sundayhao-plugins --skill kb-lint

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 8 stars8 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Health-check the knowledge bank for orphan documents, stale content, broken WikiLinks, index drift, and missing frontmatter. Generates a severity-graded report. Use this skill whenever the user mentions lint, health check, KB maintenance, stale docs, broken links, orphan pages, missing references, knowledge bank quality, or hasn't run a check in a while. Also trigger when the user asks "what's not cross-referenced?", "are there any dead links?", or expresses concern about KB quality.

SKILL.md

5.2 KB, as published. Nobody here has run it

Knowledge Bank Lint

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.


Invocation

  • Slash command: /second-brain:kb-lint
  • Skill tool: Skill({ skill: "second-brain:kb-lint" })
  • Natural language: "Run a health check on the knowledge bank", "Find orphan docs in KB"

Workflow

Step 1: SCAN

Run lint checks in order. Each check produces findings with a severity level.

Check 1: Broken WikiLinks (severity: error)

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.

Check 2: Missing Frontmatter (severity: error)

Find documents missing required frontmatter fields (title, type, created):

./scripts/lint_frontmatter.sh "$KB_PATH"

Reuses frontmatter reading from skills/common/obsidian_helpers.sh.

Check 3: Orphan Documents (severity: warning)

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/).

Check 4: Index Drift (severity: warning)

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.

Check 5: Stale Documents (severity: info)

Find documents not modified in 90+ days:

./scripts/lint_stale.sh "$KB_PATH"

Uses file modification timestamps. Excludes _sessions/ and daily-log/ (inherently historical).

Step 2: REPORT

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

## Info

### Stale Documents
- [[Doc Name]] β€” last modified YYYY-MM-DD (N days ago)

Step 3: LOG

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"

Step 4: FIX (optional)

After presenting the report, use AskUserQuestion tool to offer resolution:

  • Fix broken WikiLinks β€” For each broken link, classify as:
    • Stub candidate β€” the target should exist but hasn't been documented yet. Create a stub file with status: stub (see below).
    • Near-match β€” an existing doc with a similar name could resolve it. Add an alias to the existing doc.
    • Bad reference β€” the WikiLink itself is wrong (typo, template placeholder). Fix or remove it from the source file.
    • Template placeholder β€” generic WikiLinks like [[Related Concept 1]]. Remove from source files.
  • Fix index drift β€” Run generate_index.sh to rebuild _meta/index.md
  • Fix missing frontmatter β€” Add required YAML fields to flagged documents
  • Skip β€” Just the report, no fixes needed

See fix-guide.md for stub creation templates, classification heuristics, alias resolution, and template placeholder removal details.


Interpreting Results

SeverityMeaningAction
ErrorData integrity issueFix immediately β€” broken links mislead lookups
WarningQuality degradationFix soon β€” orphans and drift reduce discoverability
InfoPotential stalenessReview periodically β€” may need updating or archiving

Resources

  • KB Schema β€” Conventions that lint checks enforce
  • Fix Guide β€” Stub creation, alias resolution, template cleanup

Completion Criteria

ModeComplete when
Report onlyAll 5 checks run, lint report generated, log appended, findings summarized
Report + FixAll of above, plus chosen fixes applied, index regenerated

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.