TAKEOFF69/codex-skills-kit / skills/gate-engineering
gate-engineering
UnverifiedDesign, implement, review, or repair durable quality gates such as linters, CI checks, tripwires, corpus detectors, contract suites, and snapshot or golden tests. Use when asked to add a check that catches a defect, when a recurring defect needs class-wide prevention, when a gate is being trusted or recalibrated, or when all-green output may be misleading.
Gate Engineering
Build standing quality nets that prove they detect intended defect class.
Scope
This skill applies to persistent repository gates: lint rules, CI checks, tripwires, contract suites, corpus detectors, and golden tests. Ordinary unit tests written with a feature do not each need full gate ceremony.
Core rule
A gate never observed failing is unproven. Ship known-bad input, known-good twin, and repeatable way to prove catch.
Five laws
- Prove red, then green. Seed representative defect and observe non-zero failure. Fix it and observe pass. Preserve both fixtures and expose
--selftestor equivalent deterministic command. - Fix classes, not instances. Recurrence turns one reported case into corpus problem. Detect class, scan full owned corpus, fix all findings, then keep detector as gate.
- Keep fixtures hermetic. Commit inputs. Avoid live database, mutable cache, network, current date, or content SHA dependencies unless gate explicitly tests those boundaries.
- Assert contract, not incidental snapshot. Prefer invariant such as presence, range, mapping, ordering, or semantic label. Byte-exact and pixel-exact snapshots need clear reason and controlled update process.
- Audit consumers. Producer validation does not protect cached, read, import, or alternate write paths. Enumerate bypasses and gate contract where consumers can violate it.
Assertion traps
- Assert presence before uniqueness – zero matches are trivially unique.
- Assert selection is non-empty before
all(...)or universal validity. - Ensure failure fixture reaches code path under test rather than being filtered earlier.
- Include near-miss good fixture so detector does not encode broad false positives.
- Test disabled or feature-flagged path by toggling it in controlled run.
Gate lifecycle
- Recalibrate baseline after legitimate behavior change; do not weaken invariant to make CI green.
- Re-enable disabled gate only after current corpus passes it.
- Refresh tripwire baseline with producer or consumer refresh that changes expected truth.
- Match gate cadence to data cadence.
- Version fixture schema when parser or contract changes.
- Record scoped skip with owner and expiry; never silently disable.
Implementation workflow
- Name defect class in one sentence.
- Locate producer, readers, caches, alternate writers, and current checks.
- Create minimal bad and good fixtures.
- Implement detector against contract.
- Run red fixture and capture expected failure.
- Run green fixture and capture pass.
- Run detector across full owned corpus.
- Fix findings or document scoped exceptions.
- Wire gate into repository's existing check path.
- Add selftest and prove selftest itself fails if catch is removed.
Proof block
Include with change:
Gate: <name and path>
Defect class: <what it catches>
Seeded red: <fixture> -> <failure output>
Green twin: <fixture> -> <pass output>
Selftest: <command>
Corpus result: <scope and finding count>
Consumer audit: <readers, caches, alternate writers>
Exceptions: <none or explicit list>
Review checklist
- Known-bad fixture committed and observed red.
- Known-good and near-miss fixtures observed green.
- Selftest deterministic and hermetic.
- Assertions describe contract rather than current formatting.
- Empty-set and filtered-out traps covered.
- Full owned corpus scanned.
- Read, cache, and alternate write paths audited.
- Baseline update explained by changed truth.
Stop conditions
- Gate has no red proof: treat its green history as no evidence.
- Request is only to disable gate: propose repair, recalibration, or scoped expiring exception.
- Correct assertion requires unstable live state: separate deterministic contract gate from operational monitor.
Related skills
verify-honestlygoverns claims about gate coverage.retro-distillidentifies recurring failures worth promoting into gates.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |