| name | iwiki-lint |
| description | Report documentation health over docs/wiki/: broken [[refs]], orphan pages, stale pages, and gaps (source with no wiki page). Report-only โ makes no edits. |
iwiki-lint
Report docs/wiki/ health by calling the engine's deterministic lint check.
Makes NO edits. The engine ships with this plugin, so this works in any project.
Engine invocation (read first)
The engine is a Python module, not a binary on PATH โ do not treat it as a
shell command (probing with command -v or --help will fail). The launcher
exports IWIKI_ENGINE_DIR; resolve $ENG /
$UV once with the block below (it falls back to the in-repo / newest-cached
engine and exits loud if none is found), then reuse them in the steps:
ENG="${IWIKI_ENGINE_DIR:-}"
[ -f "$ENG/pyproject.toml" ] || ENG="plugin/iwiki/engine"
[ -f "$ENG/pyproject.toml" ] || ENG="$(ls -d "$CLAUDE_CONFIG_DIR"/plugins/cache/*/iwiki/*/engine 2>/dev/null | sort -V | tail -1)"
[ -f "$ENG/pyproject.toml" ] || { echo "iwiki: engine not found โ run ./iclaude.sh --install-iwiki" >&2; exit 1; }
UV="${UV_BIN:-}"; [ -x "$UV" ] || UV="$(command -v uv)"; [ -x "$UV" ] || UV="$CLAUDE_CONFIG_DIR/../bin/uv"
"$UV" run --project "$ENG" python3 -m iwiki_engine --wiki-dir docs/wiki <cmd>
Steps
-
Run the engine lint from the current project root:
"$UV" run --project "$ENG" python3 -m iwiki_engine --wiki-dir docs/wiki lint
This prints one JSON object. It always exits 0 (a real config/engine failure
prints HALT: โ see the Stop rule).
-
If wiki_present is false: print one line โ
"No docs/wiki/ here yet โ run /iwiki-init to bootstrap one." โ and stop.
-
Otherwise format a markdown report from the JSON, grouped by category, each
with its page / ref reference:
- Broken links โ every
{page, ref} in broken.
- Orphans โ every path in
orphans.
- Stale โ every
{page, source} in stale (source changed after ingest).
End with a one-line summary count per category.
-
Gaps (advisory, only when wiki_present is true). Optionally note source
areas with no wiki page. Bound the scan to the set iwiki-init uses โ immediate
subdirs of src/ / lib/ / app/ / packages/ / cmd/ / internal/ plus root entry-point
scripts (*.sh, main.*, index.*, app.*, cli.*) that exist. List
candidates only; do not treat them as errors.
Stop rule
If the engine prints HALT: (missing IWIKI_LLM_* is not needed for lint, but a
genuine engine error may still surface), report it and stop.