config/ruff-rule-map.json exists (ships with the adapter; maps ruff rule IDs to M-engine severity + category).
Optional: ruff is installed in the developer's environment for the richer invocation path. If absent, fall back to Python stdlib ast-based idiom checks using the rule-map's stdlib-feasible subset (~40 of ~120 rules).
Inputs
Chained from lich-core: {file: "foo.py", ast_tree: <parsed>}
Steps
Detect ruff availability. Run ruff --version via subprocess. Record the version for version-drift detection.
1---2name: enchanter-ai-lich-lich-python3description: lich-python4---56# lich-python78## Preconditions910- Target file extension is `.py`.11- `config/ruff-rule-map.json` exists (ships with the adapter; maps ruff rule IDs to M-engine severity + category).12- Optional: `ruff` is installed in the developer's environment for the richer invocation path. If absent, fall back to Python stdlib `ast`-based idiom checks using the rule-map's stdlib-feasible subset (~40 of ~120 rules).1314## Inputs1516- **Chained from lich-core**: `{file: "foo.py", ast_tree: <parsed>}`1718## Steps19201. **Detect ruff availability.** Run `ruff --version` via subprocess. Record the version for version-drift detection.212. **Invoke ruff (if available).** `ruff check --output-format=json <file>` — parse the JSON output.223. **Fall back (if ruff absent).** Run the stdlib-feasible rule subset directly over the `ast_tree` from lich-core.234. **Map rule IDs to M-engine categories.** For each finding, load `config/ruff-rule-map.json` and emit:24 - `M1 runtime-failure candidate` — if rule is in the "correctness" category (E501 exceptions, F401 unused imports that may cause NameError, etc.)25 - `M7 idiom suggestion` — if rule is in the "style/idiom" category (UP-series pyupgrade, SIM simplify)26 - `skip` — if rule is in the "Hydra-overlap" category (CWE-tagged security rules — these belong to Hydra R3)275. **Emit findings.** Append to `plugins/lich-core/state/review-flags.jsonl` under the lich-core sub-plugin's collection point.2829## Outputs3031- Appends to `plugins/lich-core/state/review-flags.jsonl`.32- Return value: `{ruff_version: "...", rules_fired: N, skipped_hydra_overlap: N}`.3334## Handoff3536Findings flow back through lich-core → lich-sandbox (for M1-class flags) → lich-rubric → lich-verdict.3738## Failure modes3940- **F14 version drift** — ruff's JSON output format changes; the adapter must pin a tested range and warn on mismatch.41- **F04 task drift** — re-implementing ruff rules in the adapter. Don't. The adapter *maps*; ruff does the work.42- **F07 over-helpful substitution** — running ruff with `--fix` and auto-rewriting code. Never. Lich is advisory.4344## Why Haiku tier4546This skill is a thin mapping layer: invoke subprocess, parse JSON, lookup in rule-map, emit. No reasoning. Haiku is appropriate.4748---49> Source: [enchanter-ai/lich](https://github.com/enchanter-ai/lich) — distributed by [TomeVault](https://tomevault.io).50<!-- tomevault:4.0:skill_md:2026-06-15 -->
Run npx skillmds@latest add tomevault-io/enchanter-ai-lich-lich-python in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
lich-python It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.