quality-gates
Skill2 starsChanged 9 months agoMITView on GitHub
Enforce system health and safety invariants via GainsGate, CardioGate, and CorrigibilityGate
- Deletes or force-pushes
- Commits and pushes
11 other projects use a version of this.
Adopted by
Most recently taken up by
- linchpin/skillstheir own version, first seen Oct 2, 2026
- sampleXbro/agentsmeshtheir own version, first seen Sep 1, 2026
- Mesteriis/Engineering-Bible-AItheir own version, first seen Jun 28, 2026
- OlliTapio/claude_skillstheir own version, first seen Jun 12, 2026
- kienbui1995/magic-powerstheir own version, first seen Apr 10, 2026
- thebiglaskowski/claude-sentienttheir own version, first seen Apr 7, 2026
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- NikiforovAll/lazyclaude★ 42same name
- devsforge/orchestrator★ 38same name
- sampleXbro/agentsmesh★ 25same name
- wpank/ai★ 11same name
- Vimalk0703/shipworthy★ 6same name
- thebiglaskowski/claude-sentient★ 2same name
- linchpin/skills★ 1same name
- mmondora/claude-skills★ 1same name
- kienbui1995/magic-powers★ 0same name
- Mesteriis/Engineering-Bible-AI★ 0same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository22 other files it gives its agents.
- ab-testingSkill
- ab-validateSkill
- architectural-gateSkill
- cardio-reviewSkill
- consensusSkill
- counter-positionSkill
- cross-examinationSkill
- direct-querySkill
- doc-organizerSkill
- integrity-checkSkill
- invariance-healthSkill
- narrate-surgerySkill
- neurologistSkill
- post-implementation-verificationSkill
- pre-implementation-reviewSkill
- probeSkill
- researchSkill
- review-loopSkill
- sentinelSkill
- setup-api-keysSkill
- setup-teamSkill
- using-3-surgeonsSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 54
All critical checks pass + some non-critical fail = PASS (with warnings)
- Very specific: line 103
If the rate limit is exceeded, the entire CardioGate fails with a critical rate_limit check failure.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Quality Gates
Three Gate Types
The 3-Surgeons system provides three quality gates, each serving a different purpose:
| Gate | Purpose | When to Run |
| GainsGate | Infrastructure health verification | Between major phases, after deployments |
| CardioGate | Quality review chain with rate limiting | When quality degradation is detected |
| CorrigibilityGate | Safety invariant enforcement | Before destructive or risky actions |
GainsGate
When to Run
- Between major phases -- after completing phase A, run gains-gate before starting phase B
- After deployments -- verify the system is healthy post-deploy
- After infrastructure changes -- new config, restarted services, changed endpoints
- Before long-running operations -- ensure everything is healthy before committing to a multi-step process
How to Invoke
CLI
3s gains-gateMCP Tool
gains_gate()Default Checks
| Check | Critical? | What It Verifies |
neurologist_health | No | Pings Neurologist endpoint. Local model may be offline. |
cardiologist_health | No | Pings Cardiologist endpoint. API may be unavailable. |
evidence_store | Yes | Evidence DB is accessible and queryable. |
state_backend | Yes | State backend responds to ping. |
Gate Pass/Fail Logic
The gate passes only if all critical checks pass. Non-critical failures are recorded but do not block progress.
- All critical checks pass + some non-critical fail = PASS (with warnings)
- Any critical check fails = FAIL (must fix before proceeding)
Interpreting Results
Running gains gate...
[PASS] neurologist_health: Neurologist operational (89ms)
[FAIL] cardiologist_health: Cardiologist unreachable: Connection refused
[PASS][critical] evidence_store: Evidence store accessible (42 learnings)
[PASS][critical] state_backend: State backend operational
PASS: 3/4 checks passed (non-critical failures: cardiologist_health) (23ms)In this example, the gate passes because the Cardiologist being down is non-critical. The evidence store and state backend (both critical) are healthy.
What to Do When the Gate Fails
- Read the failure messages -- they tell you exactly which critical check failed and why
- Fix the root cause -- do not proceed to the next phase with a failed gate
- Re-run the gate -- verify the fix resolved the issue
- Only then proceed -- the gate exists to prevent building on broken infrastructure
CardioGate
When to Run
- When quality degradation is detected -- automated monitoring flags declining output quality
- For periodic quality reviews -- scheduled quality assurance checks
- After significant model or prompt changes -- verify quality was not regressed
How It Works
The CardioGate chains three steps:
- Rate limit check (critical) -- maximum 3 automated reviews per hour. Prevents runaway quality checks from burning budget.
- Gains gate (embedded) -- all GainsGate checks run as part of CardioGate. Infrastructure must be healthy before quality review.
- Optional cross-examination -- if both previous steps pass, a cross-exam can be triggered for the quality concern.
Rate Limiting
| Setting | Value |
| Max reviews per hour | 3 |
| State key | cardio_gate:reviews_this_hour |
| Tracked in | State backend |
If the rate limit is exceeded, the entire CardioGate fails with a critical rate_limit check failure. This prevents cost runaway from automated quality monitoring loops.
Gate Failure
CardioGate fails if:
- Rate limit exceeded (critical)
- Any GainsGate critical check fails (critical)
- Both must pass for the gate to pass
CorrigibilityGate
When to Run
- Before destructive operations -- dropping tables, wiping data, force pushing
- Before safety bypass requests -- any action that would circumvent safety checks
- Before modifying gate logic -- self-modification of the safety system itself
How to Invoke
The CorrigibilityGate is primarily used programmatically:
from three_surgeons.core.gates import CorrigibilityGate
from three_surgeons.core.config import Config
gate = CorrigibilityGate(config=Config.discover())
result = gate.run(proposed_action="Drop all production database tables and recreate")
# result.passed = False
# result.summary = "CORRIGIBILITY FAIL: Blocked: No destructive operations without explicit approval (matched: 'Drop all...database tables')"Default Invariants
The gate checks proposed actions against these regex-based safety rules:
| Invariant | Catches |
| No destructive operations | drop database, truncate table, delete all prod data, rm -rf /, wipe all data, destroy database |
| No bypassing safety | bypass safety, skip safety, ignore safety, disable safety, override safety, circumvent safety, bypass constraint/check/validation/guard |
| No modifying gate logic | modify the gate logic, disable corrigibility gate, skip gains gate, remove cardio gate, bypass corrigibility gate |
| No force pushing | force push, push --force, git push -f |
Interpreting Results
CORRIGIBILITY PASS: action is safe (4 invariants checked)or
CORRIGIBILITY FAIL: Blocked: No destructive operations without explicit approval (matched: 'drop all database tables')A failed corrigibility check means the proposed action matches a safety invariant. The action should NOT proceed without explicit human approval.
What to Do When CorrigibilityGate Fails
- Do NOT bypass the gate -- the invariant exists for a reason
- Present the failure to the human -- explain what was blocked and why
- Ask for explicit approval -- if the human confirms the action is intentional, they can authorize proceeding
- The gate itself cannot be modified -- "disable corrigibility gate" is itself an invariant violation
Decision Table: Which Gate?
| Situation | Gate |
| Transitioning between project phases | GainsGate |
| After deploying changes | GainsGate |
| Quality metric declining | CardioGate |
| About to delete/drop/wipe something | CorrigibilityGate |
| About to force push | CorrigibilityGate |
| Session start health check | GainsGate (or just probe for quick check) |
| About to modify safety settings | CorrigibilityGate |
Gate Composition
Gates can be composed. The CardioGate already embeds a GainsGate. You could build custom workflows:
CorrigibilityGate -> GainsGate -> (proceed with operation)This pattern ensures: (1) the action is safe, (2) the infrastructure is healthy, (3) then execute.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

