Fail closed code hygiene

From odylith/odylith · View interactive version

Fail closed code hygiene is an AI agent skill from the GitHub repository odylith/odylith. Before acting on a durable error, escaped defect, failed mechanism, failed simulation, bad generated artifact, semantic drift, quality-gate miss, latency breach, architecture decision, validation resu

How to use this skill

Skill file

Fail-Closed Code Hygiene

Governance-Learning Default

Before acting on a durable error, escaped defect, failed mechanism, failed simulation, bad generated artifact, semantic drift, quality-gate miss, latency breach, architecture decision, validation result, or release-risk learning, search Casebook and related governance truth first. Read prior failed mechanisms, failed fix attempts, rejected approaches, guardrails, and validation history; do not repeat a fix path that already failed. Capture new mechanism-level learning in Casebook or Compass, and update Radar or plans, Registry, and Atlas when the learning changes planned work, component contracts, or flows.

Use this maintainer-only skill when a pass is explicitly about removing AI

slop, fake modularization, duplicate helper churn, mirror drift, oversized-file

pressure, or other structural debt in shipped Odylith code.

Treat AI slop as a regression.

Apply that bar to any codebase or project surface in this lane: services,

libraries, apps, CLIs, infra glue, scripts, docs, prompts, hooks, templates,

config, and generated assets all count.

Structural cleanup is not permission to drift behavior, UX, or UI. Preserve

semantics deliberately and prove the touched contract on the real toolchain or

surface that owns it.

No transitional states. Do not replace one slop class with another.

Read First

Required Workflow

helper clones

line counts for any touched 1200+ / 2000+ files, the exact helper or

mirror clones you plan to remove, and the proof surface you will rerun.

generated guidance, Codex assets, Claude assets, shared skills, and shipped

mirrors must stay aligned if the anti-slop rule changes.

config, docs, generators, and installed assets that may be carrying the

same slop class under different file extensions.

into a stable owner instead of adding another wrapper layer.

adopt it in the touched slice or leave a bounded follow-up tied to the same

slop class.

facade accessors, or mirror-only indirection after a nominal extraction.

kernel lands, the touched callers must adopt it or the pass is incomplete.

data-model seam in the same pass unless the change is purely a

safety-critical repair.

closeout.

the replacement smell still exists in the touched slice, the pass is

incomplete.

owned boundary than you found. Do not use a hygiene pass to sneak in net new

unrelated growth.

live source and every shipped mirror in the same change.

consumer repos, run `odylith release migration-gate --repo-root .

--target-version <version> --base-ref <published-predecessor-ref>` on a

clean, frozen candidate. Verify the predecessor against published release

metadata, not local tag ordering. Satisfy the exact emitted

migration-observer:<version>:<surface>:<fingerprint> Radar marker before

release closeout.

consumer-safe shared skills, shared agent guidelines, or bundled install

assets.

assumptions, or non-obvious state transitions.

Hard Bans

the owner is banned.

_json_dict, _normalize_*, _delta, or _parts across files when one

shared owner is appropriate.

hooks, prompt builders, command shims, config templates, or generated

guidance.

narration, or patterned voice rails in maintainer-owned Odylith product

surfaces. Prompts, hooks, renderers, tests, fixtures, skills, docs, and

governance generators must preserve live narration assembled from current

evidence. Tests may pin labels, schemas, evidence use, and anti-mechanical

constraints, but must not force one canned sentence shape or reusable

conversation script.

the pass can split them into data prep, view model, and template/render

stages, or gather, score, and decide stages.

module docstring.

Fail-Closed Exit Criteria

owner exists.

touched callers stay on local forks without a bounded follow-up.

both files once a real shared owner exists.

had on entry when the pass is explicitly about structural debt.

hides the real owner.

entry; if not, the pass is incomplete.

in the touched slice. Fail closed on unresolved slop in the touched slice.

Required Proof

land characterization or contract-focused tests before or alongside the

refactor instead of relying on post hoc confidence.

launchers, hooks, skills, or install-managed mirrors.

contracts, install-generated guidance, shared skills, and shipped mirrors in

the same pass.

guidance, skills, install-generated guidance, host contracts, mirrors, and

enforcement tests together; prose-only hardening is incomplete.

checks is incomplete.

repo-wide structural scan or equivalent inventory before closeout.

behavior proof for the touched slice and a fresh structural inventory for

the claimed scope. One does not substitute for the other.

shell surfaces.

contract: normal, empty/fallback, and degraded or error states when they

exist.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.