用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/BEKO2210/Firstbrain --skill health命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | health |
| trigger | /health |
| description | Detect orphan notes and broken wiki-links with suggested fixes |
| version | 3.0.0 |
| type | skill |
| tags | ["skill","agent","maintenance","health","links"] |
Quick diagnostic of vault health. Reports orphan notes (0-1 connections) and broken wiki-links with suggested fixes. Auto-fixes obvious typos (single clear match), proposes fixes for ambiguous cases, and flags items with no match for user attention.
/health # Full vault health report
/health --fix # Auto-apply all auto-fixable broken links (Levenshtein <= 1, single match)
| Check | Description | Threshold |
|---|---|---|
| Orphan notes | Notes with 0-1 total connections (inbound + outbound resolved links) | Excludes templates, MOCs, system files |
| Broken links | Wiki-links pointing to nonexistent targets (resolved: false in link-map) | Excludes links from template files |
Claude follows these steps when /health is invoked:
ensureFreshIndexes('.') to rebuild indexes if stale (>5 min)const { loadJson } = require('./.agents/skills/scan/utils.cjs');
const path = require('path');
const indexDir = path.join('.', '.claude', 'indexes');
const vaultIndex = loadJson(path.join(indexDir, 'vault-index.json'));
const linkMap = loadJson(path.join(indexDir, 'link-map.json'));
const { analyzeHealth, classifyFix } = require('./.agents/skills/health/health-utils.cjs');
const { orphans, brokenLinks, stats } = analyzeHealth(vaultIndex, linkMap);
Vault Health: X orphan notes, Y broken links (Z total notes, W total links)
findConnections (from connect-utils.cjs) to suggest potential links based on the orphan's tagsclassifyFix(suggestions) to determine the action
b. If auto: Show the fix and mark for auto-application
AUTO-FIX: [[Docekr]] -> [[Docker]] (in Note.md, typo correction)
c. If propose: Show candidates and ask the user
d. If : Flag for user attention
const { analyzeHealth, suggestFixes, classifyFix, ensureFreshIndexes } = require('./.agents/skills/health/health-utils.cjs');
const { findConnections } = require('./.agents/skills/connect/connect-utils.cjs');
const { loadJson } = require('./.agents/skills/scan/utils.cjs');
const path = require('path');
// Step 1: Ensure indexes are current
ensureFreshIndexes('.');
// Step 2: Load indexes
const indexDir = path.join('.', '.claude', 'indexes');
const vaultIndex = loadJson(path.join(indexDir, 'vault-index.json'));
const linkMap = loadJson(path.join(indexDir, 'link-map.json'));
const tagIndex = loadJson(path.join(indexDir, 'tag-index.json'));
// Step 3: Run health analysis
const { orphans, brokenLinks, stats } = analyzeHealth(vaultIndex, linkMap);
// Step 4: For each orphan, suggest connections
for (const orphan of orphans) {
const suggestions = findConnections(orphan.path, vaultIndex, linkMap, tagIndex);
console.log();
.();
}
( bl brokenLinks) {
classification = (bl.);
.();
}
## Vault Health Report
**Summary:** 3 orphan notes, 2 broken links (47 total notes, 89 total links)
### Orphan Notes (0-1 connections)
1. **Note A** (0 connections)
Suggested links: [[Related Note]], [[Another Note]]
2. **Note B** (1 connection)
Suggested links: [[Topic Note]]
### Broken Wiki-Links
1. AUTO-FIX: [[Docekr]] -> [[Docker]] (in Project Notes.md)
2. PROPOSE: [[dock]] in Daily.md -- Did you mean: [[Docker]] or [[Docker Compose]]?
3. MANUAL: [[Nonexistent]] in Ideas.md -- No match found
### Actions Available
- Reply "fix all" to apply all auto-fixes
- Reply "fix 1" to apply a specific auto-fix
- For PROPOSE items, reply with your choice (e.g., "2: Docker")
This skill respects the three governance zones defined in .claude/rules/governance.md:
| Zone | Action | When |
|---|---|---|
| AUTO | Fix broken link automatically | Single clear match with Levenshtein distance <= 1 (obvious typo) |
| PROPOSE | Present fix candidates for user approval | Multiple possible matches or ambiguous correction |
| MANUAL | Flag for user attention | No match found -- user must decide |
Logging: All auto-fixes are logged to .claude/changelog.md as required by the AUTO zone governance rule.
/maintain in Phase 5.PROPOSE: [[dock]] in Note.md -- Did you mean: [[Docker]] or [[Docker Compose]]?
manualMANUAL: [[Nonexistent Note]] in Note.md -- No match found
--fix flag is used):
[[old target]] with [[correct target]].claude/changelog.md (per governance AUTO zone)scan('.') to update indexes after any fixes are applied