Style Rule Contract

A style rule is complete only when it tells the next agent what to do, what to avoid, why the rule exists, when to make an exception, and how to prove the result.

This page is the shared contract for wiki/style/. Individual style pages own domain-specific rules. This page owns the rule shape so style guidance is executable instead of decorative.

Routing

Open this page when:

  • writing or updating any wiki/style/ article
  • converting a review comment into a durable code convention
  • deciding whether a rule belongs in style, design, workflow, or skill docs
  • auditing whether a style page is strong enough for agents to use without asking Kevin again

Rule Shape

Every durable style rule should answer:

Question Meaning
Default What should the agent do first?
Banned pattern What should the agent avoid or delete?
Reason What bug, review failure, or cognitive load does this prevent?
Exception What narrow case justifies breaking the default?
Proof Which check, screenshot, test, lint rule, or review step verifies it?
Codification Should this become a lint rule, doctor, skill, token, component, or test?

Short pages can compress this into a table or checklist. Long pages should make each section easy to scan.

Promotion Rule

Promote a style observation when it changes future code generation or review:

  • repeated reviewer feedback
  • a bug caused by ambiguity or silent fallback
  • a UI inconsistency agents keep recreating
  • a language or framework pattern that should be default
  • a product-quality rule that can be checked in code, browser, or docs

Do not promote one-off taste comments that have no future retrieval value. Preserve them in the relevant review or project note instead.

Source Of Truth

Style pages are source pages. Generated agent packs, _index.md, qmd, and UI search are projections. If a pack or index is stale, update the style page or generator, then regenerate through Generated Surface Contract.

Validation

For style-category edits:

npx tsx scripts/build-index.ts
qmd update && qmd embed
npm run agent-packs:refresh
npm run agent-packs:check
npm run routing-doctor
npm run wiki-quality
npx tsx scripts/doctor.ts --quiet

Use the narrow subset for small edits, but broad rewrites should run the full closeout.

Proof

This contract is working when style pages can be audited mechanically for current dates, tier, generated-surface links, related graph links, a contract/proof section, and a timeline entry. The article still needs human judgment, but the shape should be checkable.

Merge Decision

Style pages should merge only when they govern the same code surface with the same default, exception, and proof path. Similar pages can remain separate when they answer different operating questions:

When a page is folded, preserve old retrieval with aliases or redirect ledger entries.


Timeline