agentleFS
supportersimulatorsupportersimulator/3-surgeons/skills/architectural-gate/SKILL.md

architectural-gate

Skill2 starsChanged 9 months agoMITView on GitHub

HARD-GATE — multi-model review of architectural decisions before implementation proceeds

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT implement changes until this gate passes.

    line 20
  2. Distinctive:

    Not all changes need full gating.

    line 41
  3. Very specific:

    Run sentinel scan on planned change description

    line 68
  4. Distinctive:

    If sentinel risk = none or low: GATE PASSES — proceed

    line 69
  5. Distinctive:

    If sentinel risk >= medium: escalate to Standard mode

    line 70
  6. Very specific:

    Run gains-gate to verify infra health before implementation

    line 74
  7. Very specific:

    If sentinel risk >= medium: run cross-examination on the plan

    line 75
  8. Very specific:

    After implementation: run gains-gate again (post-gate)

    line 77
  9. Very specific:

    Run cross-examination on the plan (all 3 surgeons)

    line 81
  10. Very specific:

    Run counter-position protocol — argue why this plan will FAIL

    line 82
  11. Very specific:

    Run gains-gate to verify infra health

    line 83
  12. Distinctive:

    If post-gate fails: diagnose and fix before claiming done

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Architectural Gate

The Core Invariance Skill

This is the primary quality gate for the 3-Surgeons invariance suite. It ensures that no significant change proceeds without proportional scrutiny.

<HARD-GATE> Do NOT implement changes until this gate passes. The gate can be quick (Light mode) or thorough (Full mode), but it MUST run. Skipping this gate violates epistemological invariance. </HARD-GATE>

Auto-Invocation Triggers

Invoke this skill when ANY of these signals are present:

SignalExamples
Architectural decisionNew subsystem, data flow change, module restructuring
>3 files will changeMulti-file refactor, cross-cutting concern
New dependency addednpm/pip package, external service, API integration
Security-sensitive codeAuth, crypto, input validation, secrets handling
Database schema changeMigration, new table, index change, column alter
API surface changeNew endpoint, modified contract, breaking change
Config/infrastructure changeDocker, CI/CD, env vars, deploy config

If even ONE signal is present, this gate fires.

Risk Stratification

Not all changes need full gating. The gate assesses risk across multiple dimensions and selects a proportional mode:

Risk Dimensions (multi-axis, not scalar)

DimensionLowMediumHigh
Blast radius1 file2-5 files>5 files
ReversibilityEasy rollbackModerate effortHard/impossible
Security exposureNo auth/cryptoTouches validationAuth/crypto/secrets
Data impactRead-onlySchema additiveSchema destructive
External couplingNo new depsNew internal depNew external service

Mode Selection

ModeWhenWhat RunsTarget Time
LightAll dimensions Low. Single-file, clear scope, no arch changeSentinel scan only. If risk=low, proceed.<30s
StandardAny dimension Medium. 2-5 files, moderate complexitySentinel + gains-gate. Cross-exam if sentinel >= medium.<120s
FullAny dimension High. >5 files, security, schema, new subsystemSentinel + cross-exam + counter-position + gains-gate.<300s

Mode is determined by highest-risk dimension, not average. One High dimension = Full mode, even if everything else is Low.

Checklist

You MUST create a TodoWrite task for each step and complete them in order:

Light Mode

  1. Run sentinel scan on planned change description
  2. If sentinel risk = none or low: GATE PASSES — proceed
  3. If sentinel risk >= medium: escalate to Standard mode

Standard Mode

  1. Run sentinel scan on planned change description
  2. Run gains-gate to verify infra health before implementation
  3. If sentinel risk >= medium: run cross-examination on the plan
  4. Present gate results — proceed only if no critical flags
  5. After implementation: run gains-gate again (post-gate)

Full Mode

  1. Run sentinel scan on planned change description
  2. Run cross-examination on the plan (all 3 surgeons)
  3. Run counter-position protocol — argue why this plan will FAIL
  4. Run gains-gate to verify infra health
  5. Present gate results with all surgeon opinions — proceed only with approval
  6. After implementation: run gains-gate again (post-gate)
  7. If post-gate fails: diagnose and fix before claiming done

Emergency Bypass Protocol

For critical hotfixes (production down, security vulnerability, data loss):

  1. Declare emergency — state what is broken and why bypass is needed
  2. Implement fix — proceed without full gating
  3. Post-mortem gate — within 24h, run Full mode architectural-gate on the emergency fix
  4. Evidence capture — log bypass reason, outcome, and whether the gate would have caught the issue
  5. Surface to Aaron — emergency bypasses always surface to the human operator

This is the release valve. It exists so the gate does not become the thing that kills the system it protects.

Integration with Superpowers

This skill fires BEFORE brainstorming/writing-plans. It supplements the superpowers workflow:

Signal detected → architectural-gate → [brainstorming] → [writing-plans] → [executing-plans]

The gate does NOT replace superpowers' process invariance. It adds epistemological invariance on top — ensuring the right questions are asked before the process begins.

What NOT to Do

  • Do NOT skip the gate because it "seems simple" — Light mode exists for simple changes. Use it.
  • Do NOT run Full mode on everything — that creates cross-exam fatigue and delivery freeze.
  • Do NOT ignore sentinel warnings — if sentinel flags medium+, escalate. The flag is the value.
  • Do NOT override surgeon disagreements without evidence — present disagreements to Aaron.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.