guideline-distiller
Turn a prose guideline document into atomic, enforceable review rules. The
Qodo portal ingests markdown guideline files from the repo into structured
rules, but prose enforces poorly: in a real measurement only 7 of 18 planted
violations were caught with prose guidelines, while atomic rules (exactly one
detectable violation per entry) reach reliable enforcement. This skill is the
transformation step between the two.
Read references/atomic-rule-checklist.md before splitting statements; it
defines what makes a rule atomic and detectable, with worked examples.
Boundaries
- Content transformation only. Do not commit, push, or open PRs.
- No portal API calls. The user reviews the output file before it goes live.
- Never modify or delete the source document. Write output to a new file.
- Never invent a rule that is not present in the source document. Every
output rule must trace back to a source statement.
Workflow
- Inventory. Read the entire source document. List every normative
statement: sentences containing must, should, never, always, avoid,
prefer, do not, required, forbidden, or equivalent imperative phrasing.
Include statements buried in examples or footnotes. Count them so the
user can verify coverage.
- Split and triage. Break each statement into atomic rules, exactly one
detectable violation per rule (see the checklist reference). A statement
like "use snake_case for functions and UPPER_CASE for macros" becomes two
rules. Aspirational or unverifiable prose ("be readable", "use common
sense", "keep it simple") goes to a separate not-enforceable list for the
user to review; do not silently drop anything.
- Write each atomic rule with all five parts:
- Rule text in imperative form ("Do X", "Never do Y").
- A one-line rationale.
- One minimal violating code example.
- One compliant example.
- A severity suggestion (critical, high, medium, or low).
- Flag collisions. During distillation, mark rules that conflict with
each other, are identical duplicates, or overlap partially. List them in
a "Conflicts and duplicates" note near the top of the output. The portal
surfaces these too, but catching them before ingestion saves churn.
- Emit one output file. A single best_practices style markdown file:
one
## heading per atomic rule, the five parts under each heading, and
a final ## Not enforceable (review manually) section holding the
triaged-out prose verbatim with a one-line reason each.
- Verify fidelity. Confirm every output rule maps to a source statement
and every source statement is either a rule or in the not-enforceable
section. Confirm the source document is byte-for-byte untouched.
Output shape
# Best practices distilled from <source file>
> Conflicts and duplicates: <list or "none found">
## Rule: <imperative rule text>
Rationale: <one line>
Severity: <suggestion>
Violation:
<minimal code>
Compliant:
<minimal code>
## Not enforceable (review manually)
- "<original prose>" (reason it cannot be detected)
If the document is already atomic
Say so. Report that minimal or no changes are needed, list any small gaps
(a rule missing an example, a stray aspirational line), and do not rewrite
rules that already meet the checklist.
1---2name: guideline-distiller3description: Use when asked to convert, distill, or restructure a prose coding guideline, style guide, review checklist, or team-conventions markdown file into atomic enforceable review rules for the Qodo portal, or when prose guidelines are catching too few violations in review.4license: Apache-2.05---67# guideline-distiller89Turn a prose guideline document into atomic, enforceable review rules. The10Qodo portal ingests markdown guideline files from the repo into structured11rules, but prose enforces poorly: in a real measurement only 7 of 18 planted12violations were caught with prose guidelines, while atomic rules (exactly one13detectable violation per entry) reach reliable enforcement. This skill is the14transformation step between the two.1516Read `references/atomic-rule-checklist.md` before splitting statements; it17defines what makes a rule atomic and detectable, with worked examples.1819## Boundaries2021- Content transformation only. Do not commit, push, or open PRs.22- No portal API calls. The user reviews the output file before it goes live.23- Never modify or delete the source document. Write output to a new file.24- Never invent a rule that is not present in the source document. Every25 output rule must trace back to a source statement.2627## Workflow28291. **Inventory.** Read the entire source document. List every normative30 statement: sentences containing must, should, never, always, avoid,31 prefer, do not, required, forbidden, or equivalent imperative phrasing.32 Include statements buried in examples or footnotes. Count them so the33 user can verify coverage.342. **Split and triage.** Break each statement into atomic rules, exactly one35 detectable violation per rule (see the checklist reference). A statement36 like "use snake_case for functions and UPPER_CASE for macros" becomes two37 rules. Aspirational or unverifiable prose ("be readable", "use common38 sense", "keep it simple") goes to a separate not-enforceable list for the39 user to review; do not silently drop anything.403. **Write each atomic rule** with all five parts:41 - Rule text in imperative form ("Do X", "Never do Y").42 - A one-line rationale.43 - One minimal violating code example.44 - One compliant example.45 - A severity suggestion (critical, high, medium, or low).464. **Flag collisions.** During distillation, mark rules that conflict with47 each other, are identical duplicates, or overlap partially. List them in48 a "Conflicts and duplicates" note near the top of the output. The portal49 surfaces these too, but catching them before ingestion saves churn.505. **Emit one output file.** A single best_practices style markdown file:51 one `##` heading per atomic rule, the five parts under each heading, and52 a final `## Not enforceable (review manually)` section holding the53 triaged-out prose verbatim with a one-line reason each.546. **Verify fidelity.** Confirm every output rule maps to a source statement55 and every source statement is either a rule or in the not-enforceable56 section. Confirm the source document is byte-for-byte untouched.5758## Output shape5960```markdown61# Best practices distilled from <source file>6263> Conflicts and duplicates: <list or "none found">6465## Rule: <imperative rule text>66Rationale: <one line>67Severity: <suggestion>68Violation:69 <minimal code>70Compliant:71 <minimal code>7273## Not enforceable (review manually)74- "<original prose>" (reason it cannot be detected)75```7677## If the document is already atomic7879Say so. Report that minimal or no changes are needed, list any small gaps80(a rule missing an example, a stray aspirational line), and do not rewrite81rules that already meet the checklist.