agentleFS
KangaKodeKangaKode/universal-agent-bootstrap/.cursor/rules/worker-gate.mdc

universal-agent-bootstrap / rules

Cursor rule0 starsChanged 6 months agoMITView on GitHub

Enforces the expert review gate between design docs and implementation. Workers must STOP after design docs and wait for expert sign-off before implementing. This rule exists because workers repeatedly skip this gate when not enforced.

We split this worker-gate.mdc into the rules it gives an agent

15 rules. About 0 are common, 14 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    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
  1. Distinctive:

    Before writing ANY production code, you MUST verify:

    line 34
  2. Distinctive:

    If NO to either: STOP. Your only task is to create the design docs.

    line 38
  3. Distinctive:

    Exception: Test-only changes and fixes under 5 lines (e.g., a 1-line bug fix with a test) may skip the 4-doc ceremony if the PM brief …

    line 40
  4. Distinctive:

    If design docs don't exist for the current feature, your ONLY task is to create them

    line 47
  5. Distinctive:

    After creating design docs, STOP and tell the user: "Design docs committed.

    line 48
  6. Distinctive:

    NEVER interpret "implement the plan" as permission to skip design docs

    line 49
  7. Distinctive:

    NEVER interpret "complete all todos" as permission to skip design docs

    line 50
  8. Distinctive:

    If a plan has multiple waves, each wave that modifies production code needs its own design docs reviewed before implementation

    line 51
  9. Distinctive:

    When writing worker briefs:

    line 64
  10. Distinctive:

    Never include implementation details in the design doc brief

    line 66
  11. Distinctive:

    If your brief says "design docs only" or "Step 1 only" or "do NOT implement":

    line 71
  12. Very specific:

    Create the design docs in docs/designs/<feature-name>/

    line 72
  13. Distinctive:

    Do NOT proceed to implementation until explicitly told to in a follow-up message

    line 76
  14. Distinctive:

    If your brief says "implement" but design docs don't exist:

    line 78
  15. Distinctive:

    Create the design docs

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule 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
worker-gate.mdc
---
description: "Enforces the expert review gate between design docs and implementation. Workers must STOP after design docs and wait for expert sign-off before implementing. This rule exists because workers repeatedly skip this gate when not enforced."
globs: []
alwaysApply: true
---

# Worker Gate — Expert Review Between Design and Implementation

## Rule (INVIOLABLE)

Workers must NEVER combine design docs and implementation in the same session.

The workflow has exactly TWO phases with an expert gate between them:

**Phase A: Design Docs**
1. Worker reads the brief
2. Worker creates 4 design docs (01_ARCHITECTURE_MAP, 02_DATA_FLOW, 03_WIREFRAMES, 04_IMPLEMENTATION_PLAN)
3. Worker saves them to `docs/designs/<feature-name>/`
4. Worker commits
5. Worker STOPS. Does NOT implement. Does NOT write source code. Does NOT write tests.
6. Worker tells the user: "Design docs committed. Awaiting expert review before implementation."
7. PM runs expert panel on design docs
8. Experts approve or request changes

**Phase B: Implementation (ONLY after Phase A expert approval)**
1. PM provides a SEPARATE implementation go-ahead (new message or new chat)
2. Worker implements test-first
3. Worker commits (does NOT push)
4. PM runs expert panel on implementation
5. Experts approve before PM pushes

## Pre-Code Checklist (MANDATORY)

Before writing ANY production code, you MUST verify:

1. Does `docs/designs/<feature-name>/` exist with all 4 docs (01_ARCHITECTURE_MAP, 02_DATA_FLOW, 03_WIREFRAMES, 04_IMPLEMENTATION_PLAN)?
2. Has the PM explicitly confirmed expert approval of those docs in this conversation?
3. If NO to either: **STOP. Your only task is to create the design docs.**

**Exception:** Test-only changes and fixes under 5 lines (e.g., a 1-line bug fix with a test) may skip the 4-doc ceremony if the PM brief explicitly says "no Worker Gate needed." The PM decides, not the worker.

## Override Protection

Even if the user says "implement everything" or "don't stop until done":

- Phase A design docs (4 artifacts in `docs/designs/`) must exist AND be committed BEFORE any source code changes
- If design docs don't exist for the current feature, your ONLY task is to create them
- After creating design docs, STOP and tell the user: "Design docs committed. Awaiting expert review before implementation."
- NEVER interpret "implement the plan" as permission to skip design docs
- NEVER interpret "complete all todos" as permission to skip design docs
- If a plan has multiple waves, each wave that modifies production code needs its own design docs reviewed before implementation

## Why This Rule Exists

This gate is repeatedly violated when not enforced:
- Workers skip design docs for velocity, then break things and need full reverts
- Implementations without architecture review introduce structural debt
- Expert panels catch issues before they are expensive to fix

Each violation costs more to fix than it would have cost to do the design properly.

## For PM Chats

When writing worker briefs:
- Give Phase A and Phase B as SEPARATE briefs in SEPARATE messages
- Never include implementation details in the design doc brief
- The design doc brief should end with: "Commit when done. Do NOT implement any code. Do NOT write tests. PM will review with expert panel before giving the implementation go-ahead."

## For Worker Chats

If your brief says "design docs only" or "Step 1 only" or "do NOT implement":
- Create the design docs in `docs/designs/<feature-name>/`
- Commit
- STOP
- Report back to the user what you created
- Do NOT proceed to implementation until explicitly told to in a follow-up message

If your brief says "implement" but design docs don't exist:
- STOP
- Tell the user: "No design docs found at docs/designs/<feature-name>/. Creating design docs first per Worker Gate protocol."
- Create the design docs
- Commit and STOP

Download now (ZIP)

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. KangaKode/universal-agent-workflow-template★ 0100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    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.

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.