Comprehensive wiki maintenance: daily structural health checks (index reconciliation, log separator fixes, pipeline watchdog alerts), comparison page updates (adding items to multi-section comparison tables), and page relocation (moving/renaming pages while maintaining link integrity).
Resources
2Install
npx skillscat add kzinmr/ai-topics/wiki-maintenance Install via the SkillsCat registry.
Wiki Maintenance
Comprehensive wiki maintenance covering three domains: daily structural health, content updates, and structural reorganization.
Quick Reference
| Task | Trigger | Section |
|---|---|---|
| Daily structural health | Watchdog cron / broken links | §1 Daily Structural Health |
| Add item to comparison | "Add X to pricing page" | §2 Comparison Page Updates |
| Move/rename pages | "Move wiki page" | §3 Page Relocation |
Common Constraints
execute_code Blocked in Cron
execute_code is blocked in cron mode. Use patch() and terminal() (shell commands) instead.
Git Commit Conventions
cd ~/ai-topics && git add wiki/ && git commit -m "wiki: <summary>" && git pushShell variable trap: If the commit message contains $ (e.g., $10/$50), use single quotes or escape: \$10/\$50.
Index.md Maintenance
- Section headers use filesystem count (including
_index.md) - Summary line
Indexed entries:uses index entry count (all- [[...]]lines) - Always verify both after any index modification
- Concepts section drifts the most — always check first
NEVER use write_file for log.md
write_file overwrites the entire file. log.md is append-only — always use terminal("cat >> wiki/log.md") or patch().
1. Daily Structural Health (Watchdog)
When to Use
- Daily watchdog cron job (
wiki_watchdog_fix_context.py) at 17:35 UTC - User reports of broken links or index inconsistencies
- Any task involving wiki structure health checks
Auto-Fixable Issues
Index.md Corruption:
- Pipe table corruption:
|- [[→- [[ - Line number prefix corruption:
\d+|patterns - Duplicate entries: exact duplicate
- [[...]]lines - Header count mismatch: section headers vs filesystem
Log.md Missing Separators:
Consecutive ## [YYYY-MM-DD] headers without ---. Pre-flight: verify ALL ## lines are date-stamped before bulk fixing.
Orphan Page Handling:
- Ghost entry detection (index.md → file existence)
- Orphan addition (file existence → index.md)
- Alphabetical insertion within correct section
- Max 20 orphans per run; filter stubs (<30 lines, TODO marker)
Pitfalls
rstrip(".md")is a character set, not substring — usere.sub(r'\.md$', '', target)- Schedule inversion: watchdog runs BEFORE health-fix (17:35 vs 17:50 UTC)
wiki_snapshotcounts may be stale — verify against filesystem- Summary line
Indexed entries:must count ALL- [[...]]lines, not just one section - Tag taxonomy: Pre-commit validates tags against SCHEMA.md. Common misses:
exploration,interview,llm-training,rl(usereinforcement-learning). Verify withgrep -o "tagname" wiki/SCHEMA.md. - Language enforcement: Non-raw pages must be in English. Japanese content blocks commit — translate before committing.
- Symlink + git add: Changes made through
~/wikisymlink may not stage withgit add wiki/. Usegit add -A wiki/and verify withgit show --stat HEAD.
→ Full detail: references/daily-structural-health.md
→ Scripts: scripts/build-orphan-sed.py, scripts/misplaced-entries-detection.py
→ Reference: references/misplaced-stub-cleanup.md
2. Comparison Page Updates
When to Use
- Adding a new item (model, provider, tool) to an existing multi-section comparison page
- "Add X to the pricing/comparison page"
- "Update comparison table with new model"
Workflow
- Read the FULL comparison page first
- Identify ALL sections to update (typically 8+)
- Gather all pricing/spec data before editing
- Edit with
patchtool - Verify no duplicate frontmatter fields
- Update index.md and log.md
- Commit and push
Sections Typically Updated (8 total)
- Main table — new row with tier classification
- Cache pricing section
- Batch pricing section
- Tier analysis section
- Cost comparison section (chat + code gen workloads)
- Key Trends — if significant market shift
- Changelog — always add entry
- Related Pages — wikilink to entity/concept page
Key Pitfalls
- Duplicate frontmatter: Always read lines 1-10 before patching
- Non-unique patch context: Include surrounding lines for uniqueness
- Section numbering cascade: Renumber ALL subsequent sections when inserting
- execute_code blocked in cron: Use
terminal+sedfor bulk edits
→ Price verification: references/llm-api-pricing-verification.md
→ Case study: references/llm-api-pricing-fable5-update.md
→ Full detail: references/comparison-page-updates.md
→ Case study: references/llm-api-pricing-fable5-update.md
Scheduled Pricing Monitor (absorbed from llm-api-pricing-monitor)
When running the periodic LLM API pricing monitor cron (or "check LLM pricing" / "update API pricing"):
- Fetch live pricing from verified provider URLs and parse per the extraction recipes in
references/llm-pricing-extraction-recipes.md(OpenAI = Astro SSR props, no__NEXT_DATA__; Anthropic = docs.anthropic.com RSC data, NOT the JS-rendered claude.com redirect; Google =cloud.google.comstandard HTML tables,ai.google.devblocked by lookalike-TLD detection; DeepSeek =api-docs.deepseek.com, NOTplatform.deepseek.comwhich 403s). - Cross-check uncertain prices via the OpenRouter API (
references/llm-api-pricing-verification.md). - Update
wiki/comparisons/llm-api-pricing.mdusing the 8-section workflow above; watch promo/intro pricing windows (record live rate + list price in footnote) and peak/off-peak structures. DeepSeek historical structure:references/deepseek-pricing-structure.md. - Commit narrowly: stage ONLY
wiki/comparisons/llm-api-pricing.mdandwiki/log.md— the repo carries unrelated sibling-cron edits; blindgit add wiki/sweeps them in. If the tree is dirty,git stash && git pull --rebase && git stash popfirst. - log.md prepend hazard: after prepending your entry, verify the pre-existing first entry still has its
## [date]header immediately after yours; re-insert withpatchif the merge stripped it.
3. Page Relocation & Restructuring
When to Use
- Moving a page to a new directory
- Renaming a page
- Reorganizing directory structure
- Merging directories or splitting pages
Workflow
- Verify target and backlinks (
search_files) - Create target directory if needed
- Copy and transform
- Remove original
- Update backlinks (small:
patchper file; bulk: Python regex script) - Update index.md
- Update log.md
- Commit and push
Link Update Patterns
[[concepts/old/page]][[concepts/old/page|Display Text]][[concepts/old/_index]][[old/page]](relative links)
Decision Matrix: Subdirectory vs MOC Page
| Signal | Subdirectory | MOC Page |
|---|---|---|
| Pages share a concrete prefix (≥5) | ✅ | — |
| Pages form a coherent domain by tag (≥5) | ✅ | — |
| Theme is cross-cutting / universal | ❌ | ✅ |
| ≤4 pages in cluster | ❌ | ✅ or skip |
Universal themes (too generic for subdirs): agent-*, agentic-*, llm-*, open-*, multi-*, software-*
Directory Restructuring Patterns
_index.mdto descriptive name- Creating new hierarchy
- Merging directories
- Semantic classification move (by tags)
- Directory rename
- Product tool split (model vs tool pages)
- Prefix restoration
Pitfalls
- Double-prefix display bug: Ensure display name doesn't duplicate slug prefix
- Missing relative links: Search for and update relative links too
- Prefix stripping: User preference — keep prefix in filenames even inside subdirectories
- Overlapping concepts: Keep separate, add disambiguation blockquotes
- Prefix suffix capture for directory renames: Use
(?old-name(/?[^\\\\]|]*?)(?:\\\\|([^\\\\]]+))?\\\\]\\\\]pattern - Symlink + git add:
git add wiki/from repo root may not stage changes made through~/wikisymlink. Usegit add -A wiki/and verify withgit show --stat HEAD. - Double-nesting in bulk sed: If
post-trainingis in the moved pages list AND the sed replacesconcepts/post-training→concepts/post-training/post-training, you get triple-nesting. Always verify:grep -rli "double-pattern/"after bulk sed. - Tag taxonomy violations: Pre-commit blocks unknown tags. Verify tags exist in SCHEMA.md before committing. Common misses:
exploration,interview,llm-training,rl. - Language enforcement: Non-raw pages must be in English. Japanese content blocks commit.
- Scope estimation: For N moved pages, expect ~2-3N files needing reference updates.
→ Batch reorg checklist + pitfalls: references/batch-directory-reorganization-pitfalls.md
→ Full detail: references/page-relocation.md
→ Batch reorg pitfalls: references/batch-directory-reorganization-pitfalls.md (symlink+git trap, double-nesting, tag validation, scope estimation)
Support Files
References
| File | Source | Content |
|---|---|---|
references/daily-structural-health.md |
wiki-watchdog-auto-fix | Full watchdog workflow with all auto-fix patterns |
references/comparison-page-updates.md |
wiki-comparison-page-update | Full comparison page update workflow |
references/page-relocation.md |
wiki-page-relocation | Full page relocation workflow with all patterns |
references/misplaced-stub-cleanup.md |
wiki-watchdog-auto-fix | Detection heuristics for misplaced concept stubs |
references/llm-api-pricing-fable5-update.md |
wiki-comparison-page-update | Case study: adding Fable5 to LLM API pricing |
references/llm-api-pricing-verification.md |
wiki-maintenance | SPA price verification via OpenRouter API, ~ removal workflow, model name change detection |
references/agent-semantic-classification-migration.md |
wiki-page-relocation | Semantic classification of 47 agent pages |
references/batch-hierarchy-reorganization.md |
wiki-page-relocation | Multiple sequential directory reorganizations |
references/context-engineering-hierarchy-migration.md |
wiki-page-relocation | 16 pages into subdirectory, prefix restoration |
references/death-of-browser-relocation-example.md |
wiki-page-relocation | Real-world page relocation example |
references/directory-rename-and-product-split.md |
wiki-page-relocation | Directory rename patterns and product splits |
references/evaluation-safety-benchmarks-separation.md |
wiki-page-relocation | Three-way taxonomy separation |
references/orphan-page-deletion-example.md |
wiki-page-relocation | Orphan page detection and deletion |
references/post-relocation-enrichment-pattern.md |
wiki-page-relocation | Enriching relocated pages from past sessions |
references/batch-directory-reorganization-pitfalls.md |
wiki-maintenance | Symlink+git trap, double-nesting, tag validation, scope estimation, checklist |
references/llm-pricing-extraction-recipes.md |
llm-api-pricing-monitor | Verified per-provider fetch URLs, extraction patterns, model lineup snapshot, monitor pitfalls |
references/deepseek-pricing-structure.md |
llm-api-pricing-monitor | DeepSeek full pricing table with historical comparison (cache hit/miss, peak/off-peak) |
Scripts
| File | Source | Content |
|---|---|---|
scripts/build-orphan-sed.py |
wiki-watchdog-auto-fix | Build sed script for orphan insertion |
scripts/misplaced-entries-detection.py |
wiki-watchdog-auto-fix | Detect misplaced entries between sections |