lehre-preflight
Use FIRST, before any other lehre skill, to determine whether this repository is a blank page or an existing tree, report what doctrine it already declares, and say plainly what lehre can and cannot enforce here. Trigger on 'set up code standards', 'enforce our architecture', 'start a new project properly', 'lehre preflight', or as the automatic first step of any lehre pipeline. Read-only — never writes a ruleset.
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- lehre-preflight
- description
- Use FIRST, before any other lehre skill, to determine whether this repository is a blank page or an existing tree, report what doctrine it already declares, and say plainly what lehre can and cannot enforce here. Trigger on 'set up code standards', 'enforce our architecture', 'start a new project properly', 'lehre preflight', or as the automatic first step of any lehre pipeline. Read-only — never writes a ruleset.
03 SKILL.md 正文
Establish the ground truth before anything is researched or enforced. This skill writes nothing.
Steps
-
Detect mode.
greenfieldif the repository has no source files yet (only a README, a licence, a.git, or nothing at all).brownfieldif source already exists. Report which, and the evidence for it — do not ask the user to confirm something the filesystem already answers. -
Report existing doctrine, without duplicating it. Look for, and list by path:
CLAUDE.md,AGENTS.md,CONTRIBUTING*,docs/adr/*, and any linter config (ruff.toml,pyproject.toml [tool.ruff],.eslintrc*,biome.json,clippy.toml,.editorconfig). A rule these already encode should become alinter-kind rule that defers to the existing tool, never a hand-rewritten duplicate that can drift from it. -
Report lehre state. Whether
.lehre/ruleset.jsonexists; if it does, run:python3 -B "${CLAUDE_PLUGIN_ROOT}/scripts/lehre_cli.py" validateand show its output verbatim. If it fails, say so and stop — a broken ruleset is not a starting point.
-
State the enforcement boundary honestly. Say, in one short block, what will and will not be denied at write time:
- Denied at write time:
blockingrules of kindforbid-path,require-location,python-import,python-construct; and any write into a unit whose dependencies are unvalidated. - Not denied at write time:
linter-kind rules (they fail a sweep and CI instead), anything written throughBashrather thanWrite/Edit, and everyadvisoryrule.
- Denied at write time:
-
Name the next skill. Greenfield →
lehre-decompose. Brownfield →lehre-codify. Do not run it; name it.
Output format
mode: greenfield (no source files; only README.md and LICENSE present)
existing doctrine found
pyproject.toml [tool.ruff] with select = ["E","F","I"]
CLAUDE.md 12 prose conventions, none machine-checked
lehre state
.lehre/ruleset.json absent — no doctrine declared yet, hook is inert
enforcement boundary here
will deny at write time layering, forbidden paths, named AST constructs, unit order
will NOT deny at write time ruff rules (sweep + CI only), Bash-written files, advisory rules
next: lehre-decompose — this project has no units yet, so nothing can be ordered
Rules
- Never write a ruleset here. Preflight reports;
lehre-codifydecides. - Never infer mode from the user's phrasing. "New project" said aloud while 50 source files exist is brownfield. The filesystem decides.
- If
.lehre/ruleset.jsonexists but fails validation, report the exact error and stop. Do not offer to repair it silently.
04 同仓库更多 Skills
toy-check
A skill that checks things in the repository and reports what it finds.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
demo-check
Reports which generated files changed since the last generation run. Use when the user asks what drifted. Read-only; never edits a file.
zirkel-verify-assumptions
Checks exactly ONE named assumption against real evidence in at most 3 steps and reports one outcome: confidence raised (>=90), reading changed, or still unresolved. Use to resolve a single load-bearing uncertainty — typically a blocking entry surfaced by zirkel-clarify-scope: "verify this one assumption", "is it actually true that X", "check this before we rely on it". For multiple uncertainties, invoke once per uncertainty — the step budget is never shared.