Gates
Gates are automated quality checks that must pass before a WU can be completed. They replace manual code review with consistent, automated enforcement.
Why Gates?
Section titled “Why Gates?”Traditional review:
- Human bottleneck (waiting for reviewers)
- Inconsistent (different reviewers, different standards)
- Slow feedback (review happens after code is written)
Gates:
- Instant (run automatically)
- Consistent (same checks every time)
- Fast feedback (run locally before pushing)
Default Gates
Section titled “Default Gates”gates: format: true # prettier, etc. lint: true # eslint, ruff, etc. typecheck: true # tsc, mypy, etc. test: true # jest, pytest, etc.Running Gates
Section titled “Running Gates”# Run all gatespnpm gates
# Output> Format check... ✅> Lint check... ✅> Type check... ✅> Test suite... ✅> All gates passed!If any gate fails, wu:done is blocked until fixed.
Gate Configuration
Section titled “Gate Configuration”Per-Project Detection
Section titled “Per-Project Detection”LumenFlow auto-detects your stack:
| File Detected | Gates Run |
|---|---|
package.json + TypeScript | prettier, eslint, tsc, vitest/jest |
pyproject.toml | ruff, mypy, pytest |
go.mod | gofmt, golint, go test |
Custom Gate Commands
Section titled “Custom Gate Commands”Override auto-detection with explicit commands:
gates: format: command: pnpm prettier --check . lint: command: pnpm eslint src/ typecheck: command: pnpm tsc --noEmit test: command: pnpm vitest runAdditional Gates
Section titled “Additional Gates”Add project-specific gates:
gates: format: true lint: true typecheck: true test: true # Custom gates security: command: pnpm audit --audit-level=high a11y: command: pnpm test:a11yGate Behavior
Section titled “Gate Behavior”On Claim
Section titled “On Claim”When you wu:claim:
- Worktree is created
- Gates status is “pending”
During Work
Section titled “During Work”Run pnpm gates frequently:
# Quick feedback looppnpm gates# Fix issuespnpm gates# All green? ContinueOn Done
Section titled “On Done”When you wu:done:
- Gates run automatically
- If any fail → error, WU stays
in_progress - If all pass → WU marked
done, stamp created
Gate Failures
Section titled “Gate Failures”pnpm wu:done --id WU-042
> Running gates...> Format check... ❌> src/utils/validation.ts - needs formatting>> Fix the issues above before completing.Fix and retry:
pnpm prettier --write src/utils/validation.tspnpm wu:done --id WU-042# ✅ SuccessSafety-Critical Gates
Section titled “Safety-Critical Gates”For healthcare/compliance contexts, add mandatory gates:
gates: # Standard format: true lint: true typecheck: true test: true
# Safety-critical spec-linter: command: pnpm spec:lint required: true phi-check: command: pnpm phi:audit required: trueCI Integration
Section titled “CI Integration”Gates can run in CI for team enforcement:
name: Gateson: [pull_request]jobs: gates: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v2 - run: pnpm install - run: pnpm gatesNext Steps
Section titled “Next Steps”- Memory Layer – Context persistence
- CLI Reference – All gate commands