wiki-lint
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWiki Lint
维基审核工具(Wiki Lint)
Audit the wiki. Produce a categorized report. Offer concrete fixes. Log the operation.
审核维基内容,生成分类报告,提供具体修复方案,并记录操作过程。
Pre-condition
前置条件
Find (search from cwd upward, or ). If not found, tell the user to run first. Read it to get wiki root path and conventions.
SCHEMA.md~/wikis/wiki-init查找文件(从当前工作目录向上搜索,或在目录中查找)。如果未找到,请告知用户先运行命令。读取该文件以获取维基根路径和约定规则。
SCHEMA.md~/wikis/wiki-initProcess
执行流程
1. Build the page inventory
1. 构建页面清单
Read , , and all files in . Build a map of:
wiki/index.mdwiki/overview.mdwiki/pages/- All existing slugs (filenames without )
.md - All references found in any page
[[slug]] - All listed in frontmatter
sources
读取、以及目录下的所有文件,构建包含以下内容的映射表:
wiki/index.mdwiki/overview.mdwiki/pages/- 所有已存在的slug(不含的文件名)
.md - 所有页面中出现的引用
[[slug]] - frontmatter中列出的所有
sources
2. Run all checks
2. 执行所有检查
🔴 Errors (must fix)
- Broken links — references where no corresponding
[[slug]]existswiki/pages/<slug>.md - Missing frontmatter — pages without required ,
title,tags, orsourcesfieldsupdated
🟡 Warnings (should fix)
- Orphan pages — pages with zero inbound links from any other page (excluding index.md and overview.md)
[[slug]] - Contradictions — claims in one page that directly conflict with claims in another (look for the same entity described differently: dates, counts, names, relationships)
- Stale claims — pages not updated within 90 days that contain "current", "latest", "recent", "state-of-the-art", or year literals two or more years old
- Chronological update sections — page bodies containing date-stamped headers matching patterns like ,
## [Month], or## [Month] \d+— these are journal entries that should be integrated in-place**[Month] \d+ update
🔵 Info (consider addressing)
- Missing concept pages — references that appear 3+ times across the wiki but have no dedicated page
[[slug]] - Coverage gaps — open questions listed in that could be answered by a web search or new ingest
overview.md - Missing cross-references — two pages that discuss the same entity but don't link to each other
🔴 错误(必须修复)
- 失效链接 — 存在引用,但对应的
[[slug]]文件不存在wiki/pages/<slug>.md - 缺失frontmatter — 页面缺少必填的、
title、tags或sources字段updated
🟡 警告(建议修复)
- 孤立页面 — 除index.md和overview.md外,没有其他页面通过链接指向该页面
[[slug]] - 内容矛盾 — 一个页面中的声明与另一个页面的声明直接冲突(查找同一实体的不同描述:日期、数量、名称、关系等)
- 过时声明 — 超过90天未更新的页面中包含"current"、"latest"、"recent"、"state-of-the-art"等词汇,或存在距今两年及以上的年份字面量
- 按时间排序的更新章节 — 页面正文中包含符合、
## [Month]或## [Month] \d+格式的带日期戳标题,这些属于日志条目,应整合到页面内容中**[Month] \d+ update
🔵 信息(建议处理)
- 缺失概念页面 — 引用在维基中出现3次及以上,但没有对应的专属页面
[[slug]] - 覆盖缺口 — 中列出的开放式问题,可通过网络搜索或新的数据导入来解答
overview.md - 缺失交叉引用 — 两个讨论同一实体的页面之间没有互相链接
3. Write the lint report
3. 生成审核报告
Write (do not ask permission — always write this):
wiki/pages/lint-<today>.mdmarkdown
---
title: Lint Report <today>
tags: [lint, maintenance]
sources: []
updated: <today>
---生成文件(无需询问权限,直接生成):
wiki/pages/lint-<today>.mdmarkdown
---
title: Lint Report <today>
tags: [lint, maintenance]
sources: []
updated: <today>
---Lint Report — <today>
Lint Report — <today>
Summary
Summary
- 🔴 Errors: N
- 🟡 Warnings: N
- 🔵 Info: N
- 🔴 Errors: N
- 🟡 Warnings: N
- 🔵 Info: N
🔴 Broken Links
🔴 Broken Links
- [[source-page]] references [[missing-slug]] — does not exist Fix: create the page or remove the reference
- [[source-page]] references [[missing-slug]] — does not exist Fix: create the page or remove the reference
🔴 Missing Frontmatter
🔴 Missing Frontmatter
- [[page]] is missing: title, updated
- [[page]] is missing: title, updated
🟡 Orphan Pages
🟡 Orphan Pages
- [[slug]] — no inbound links Fix: add link from [[related-page]], or delete if no longer relevant
- [[slug]] — no inbound links Fix: add link from [[related-page]], or delete if no longer relevant
🟡 Contradictions
🟡 Contradictions
- [[page-a]] says: "<claim>"
- [[page-b]] says: "<conflicting claim>" Recommendation: <which to trust, or "investigate further">
- [[page-a]] says: "<claim>"
- [[page-b]] says: "<conflicting claim>" Recommendation: <which to trust, or "investigate further">
🟡 Stale Claims
🟡 Stale Claims
- [[page]] last updated <date>, contains "latest" — may be outdated Fix: re-verify claims or add a "as of <date>" qualifier
- [[page]] last updated <date>, contains "latest" — may be outdated Fix: re-verify claims or add a "as of <date>" qualifier
🔵 Missing Concept Pages
🔵 Missing Concept Pages
- [[slug]] referenced N times but no page exists Fix: run wiki-ingest or create a stub
- [[slug]] referenced N times but no page exists Fix: run wiki-ingest or create a stub
🔵 Coverage Gaps
🔵 Coverage Gaps
- Open question from overview.md: "<question>" Suggestion: search for <X> or ingest <source type>
- Open question from overview.md: "<question>" Suggestion: search for <X> or ingest <source type>
🔵 Missing Cross-References
🔵 Missing Cross-References
- [[page-a]] and [[page-b]] both discuss <entity> but don't link to each other
Add the lint report to `wiki/index.md` under a Maintenance category (create it if it doesn't exist).- [[page-a]] and [[page-b]] both discuss <entity> but don't link to each other
将审核报告添加到`wiki/index.md`的Maintenance分类下(如果该分类不存在则创建)。4. Offer concrete fixes
4. 提供具体修复方案
For each fixable category, offer:
- Broken links: "Remove the broken references? (I'll show each change before writing)"
[[slug]] - Missing cross-references: "Add the missing links between these page pairs?"
- Orphan page tags: "Add to frontmatter of orphan pages?"
status: orphan - Missing frontmatter: "Add missing frontmatter fields with placeholder values?"
Show the exact diff for each change before writing. Apply only after confirmation.
针对每个可修复的类别,提供以下选项:
- 失效链接:“是否移除失效的引用?(我会在修改前展示所有变更内容)”
[[slug]] - 缺失交叉引用:“是否在这些页面之间添加缺失的链接?”
- 孤立页面标签:“是否在孤立页面的frontmatter中添加?”
status: orphan - 缺失frontmatter:“是否用占位符值添加缺失的frontmatter字段?”
在修改前展示每个变更的精确差异,仅在获得确认后执行修改。
5. Append to wiki/log.md
wiki/log.md5. 追加到wiki/log.md
wiki/log.mdAlways append — do not ask permission:
undefined直接追加内容,无需询问权限:
undefined[<today>] lint | <N errors> errors, <N warnings> warnings, <N info> info
[<today>] lint | <N errors> errors, <N warnings> warnings, <N info> info
Report: [[lint-<today>]]
Fixed: <list what was auto-fixed, or "none">
undefinedReport: [[lint-<today>]]
Fixed: <list what was auto-fixed, or "none">
undefined