| name | book-autopilot |
| description | Automated book maintenance. Runs health checks, prioritizes work, and systematically fixes issues. Use when you want Codex to autonomously improve the book. |
| allowed-tools | ["Read","Edit","Write","Bash","Grep","Glob","Task"] |
/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:
python scripts/book-health-check.py
Read the report and summarize top priorities:
cat _build_temp/book-health-report.md | head -100
Mode: fix
Step 1: Run Health Check
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
-
MEDIUM - Batch fix
- Hardcoded values → Use
/replace-hardcoded-values
-
LOW - Opportunistic
- Stale content → Flag for manual review
- Readability → Use
/peer-review
Step 3: Verify Fixes
python scripts/book-health-check.py --quick
Mode: chapter
Focus on a single chapter:
python scripts/book-health-check.py --chapter <name>
Then apply all relevant fixes to that chapter:
- Read the chapter fully
- Run
/replace-hardcoded-values on it
- Run
/peer-review on it
- Verify links and citations
Mode: images
Generate missing section images:
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:
python scripts/find-unused-parameters.py
- Check for hardcoded values across all files:
npx tsx scripts/audit-hardcoded-all.ts
- Regenerate variables:
python scripts/generate-everything-parameters-variables-calculations-references.py
Mode: citations
Find claims without citations:
- Search for statistical claims:
grep -rn "studies show\|research indicates\|according to" knowledge/ --include="*.qmd" | head -20
- For each uncited claim, use
/verify-and-add-sources to 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:
python scripts/book-health-check.py --json | python -c "import json,sys; d=json.load(sys.stdin); print(f'Remaining: {d[\"total_issues\"]} issues')"