<required_reading> @~/.maestro/workflows/wiki-manage.md </required_reading>
Subcommands:
| Subcommand | Description |
|---|---|
health |
Health dashboard — score, broken links, orphans, hubs (default) |
search <query> |
Interactive BM25 search with follow-up actions |
cleanup |
Find and resolve orphans, broken links, stale entries |
stats |
Graph statistics — type distribution, tag frequency, growth |
Flags:
--type <type>— Filter: spec, knowhow, note, issue--fix— Auto-fix issues during cleanup--json— JSON output
Output boundary: File writes MUST target .workflow/wiki/, .workflow/knowhow/, or .workflow/issues/issues.jsonl (when --create-issues) only. NEVER modify source code or files outside these paths. --dry-run overrides --fix — no writes when both are set.
Phase Gates (MANDATORY, BLOCKING)
GATE 1: Parse → Load (Subcommand routing → Wiki data loading)
- REQUIRED: Subcommand parsed and validated (health/search/cleanup/stats).
- REQUIRED:
.workflow/initialized (E001 if missing). - BLOCKED if E003 (invalid subcommand) or E001.
GATE 2: Load → Execute (Wiki data → Subcommand execution)
- REQUIRED: Wiki data loaded via
maestro wikiCLI. - REQUIRED: At least one wiki entry exists (E002 if none).
- BLOCKED if wiki data loading fails entirely.
GATE 3: Execute → Report (For cleanup --fix only)
- REQUIRED: Preview of changes displayed to user.
- REQUIRED: User confirmation before applying fixes.
- BLOCKED if user declines fixes.
<error_codes>
| Code | Severity | Description |
|---|---|---|
| E001 | fatal | .workflow/ not initialized |
| E002 | fatal | No wiki entries found |
| E003 | error | Invalid subcommand |
| W001 | warning | Health score below 50 |
| W002 | warning | Cleanup had partial failures |
| </error_codes> |
<success_criteria>
- Subcommand parsed (health/search/cleanup/stats)
- Wiki data loaded via
maestro wikiCLI - Results displayed in formatted output
- If cleanup --fix: issues resolved and delta reported
- Next-step suggestions provided </success_criteria>