/book-autopilot [mode]
Autonomous book maintenance system. Modes:
- •
check- Run health check, generate report (default) - •
fix- Fix all issues systematically (CRITICAL → LOW) - •
chapter <name>- Focus on single chapter - •
images- Generate missing section images - •
params- Audit and fix parameter issues - •
citations- Find and add missing citations
Mode: check (default)
Run comprehensive health check:
bash
python scripts/book-health-check.py
Read the report and summarize top priorities:
bash
cat _build_temp/book-health-report.md | head -100
Mode: fix
Step 1: Run Health Check
bash
python scripts/book-health-check.py --json > _build_temp/health-issues.json
Step 2: Process Issues by Priority
Read the JSON output and process issues in order:
- •
CRITICAL - Must fix immediately
- •Missing variables → Add to parameters.py, regenerate
- •Broken critical links → Fix or remove
- •
HIGH - Fix before next render
- •Missing citations → Use
/verify-and-add-sources - •Broken links → Update paths
- •Missing images → Use
/generate-section-images
- •Missing citations → Use
- •
MEDIUM - Batch fix
- •Hardcoded values → Use
/replace-hardcoded-values
- •Hardcoded values → Use
- •
LOW - Opportunistic
- •Stale content → Flag for manual review
- •Readability → Use
/peer-review
Step 3: Verify Fixes
bash
python scripts/book-health-check.py --quick
Mode: chapter <name>
Focus on a single chapter:
bash
python scripts/book-health-check.py --chapter <name>
Then apply all relevant fixes to that chapter:
- •Read the chapter fully
- •Run
/replace-hardcoded-valueson it - •Run
/peer-reviewon it - •Verify links and citations
Mode: images
Generate missing section images:
bash
npx tsx scripts/images/generate-section-images.ts --limit 5
Review generated images and regenerate any that need improvement.
Mode: params
Parameter audit and fix:
- •Check for unused parameters:
bash
python scripts/find-unused-parameters.py
- •Check for hardcoded values across all files:
bash
npx tsx scripts/audit-hardcoded-all.ts
- •Regenerate variables:
bash
python scripts/generate-everything-parameters-variables-calculations-references.py
Mode: citations
Find claims without citations:
- •Search for statistical claims:
bash
grep -rn "studies show\|research indicates\|according to" knowledge/ --include="*.qmd" | head -20
- •For each uncited claim, use
/verify-and-add-sourcesto find and add proper citations.
Continuous Maintenance Loop
For ongoing maintenance, run this sequence periodically:
- •
python scripts/book-health-check.py- Find issues - •Fix CRITICAL/HIGH issues immediately
- •Batch process MEDIUM issues
- •Track LOW issues in todo.md
- •Commit fixes with descriptive messages
Progress Tracking
After each fix session, update progress:
bash
# Count remaining issues
python scripts/book-health-check.py --json | python -c "import json,sys; d=json.load(sys.stdin); print(f'Remaining: {d[\"total_issues\"]} issues')"