Skip to Content
Mengty Learns
Process

DoR, DoD, and Quality Gates

Practical Definition of Ready, Definition of Done, and measurable quality gates from PR to production—using Mengty Learns' real CI, labs, and Lighthouse/axe gates.

referencebeginnerTested with node 22.22.3, pnpm 11.6.0, next 16.4.6, vitest 5.1.1Updated Nov 27, 2026

TL;DR

Definition of Ready (DoR) stops half-baked tickets from entering In Progress. Definition of Done (DoD) stops half-tested code from being called "finished." Enforce repeatable checks as automated quality gates at PR, merge, release, and deploy—like this repo's ci.yml, labs.yml, and quality.yml.

1. Definition of Ready (DoR)

Before a developer or AI agent picks up a task:

  • Clear outcome: Problem and non-goals fit in 3–5 lines.
  • Acceptance criteria: At least 2 testable Given/When/Then checks (or a concrete spec).
  • Dependencies unblocked: Required secrets, APIs, or upstream PRs are available.
  • Right-sized: Fits in 1–2 days (if larger, split first).
  • (For docs on this site) Official source URL identified (CONTENT-PLAN.md §1).

2. Definition of Done (DoD)

Before a task moves to Done:

  • Code + unit/component tests written and passing.
  • Self-reviewed diff; no dead code, debug logs, or hardcoded secrets.
  • Local/CI verification green (pnpm lint && pnpm typecheck && pnpm test && pnpm build).
  • UI/diagram changes visually checked at 360px and 1280px in light & dark themes.
  • Docs/ADRs/cards updated if behavior or architecture changed.

3. Measurable quality gates (worked example: Mengty Learns)

StageGateConcrete target in this repoWhere enforced
Pre-commit / PRLint, types, unit tests, static build0 ESLint errors, 0 TS errors, all vitest suites pass, next build succeedsLocal (AGENTS.md §6) + .github/workflows/ci.yml
PR (changed code)Changed-line coverage & scopeNew helpers/parsers have unit tests; PR touches only scoped filesPR review + vitest run
PR (labs)Infrastructure & container lintinghadolint + docker build, tofu fmt/validate + tflint, kubeconform -strict, actionlint.github/workflows/labs.yml
Merge to mainReview approval + clean git≥ 1 review approval (Lead/Owner), conventional commit, 0 secret leaksBranch protection / Lead review
Release / QualityAccessibility & performance0 serious/critical @axe-core/playwright violations; Lighthouse CI (lhci autorun) ≥ 95.github/workflows/quality.yml
Production deployLive verificationPreview/prod smoke check (200 on key routes, headers present, 0 console errors)Post-deploy check / RUNBOOK.md

Minimum viable version (1–3 person team + AI agents)

If you are starting a new repo today, set up just three gates:

  1. One CI command on every PR: lint && typecheck && test && build.
  2. Dependency/secret scan (GitHub Dependabot/Renovate + secret scanning).
  3. 30-second post-deploy smoke check on the live URL.

When it's overkill

  • Blocking a 1-person prototype with 40-minute E2E suites before you even have users.
  • Turning DoR into a rigid gatekeeper where nobody can fix a broken test without a "grooming meeting." DoR is a guideline, not a weapon.

Gotchas

  • Flaky gates train people to ignore CI: If a Lighthouse or Playwright check fails randomly, fix the flakiness immediately or move it to non-blocking until stable—never leave a broken red gate.
  • Unenforced DoD: A DoD written in a wiki that isn't checked in CI or PR templates is quickly forgotten under deadline pressure.
  • Ignoring changed-line quality: Legacy files might have low test coverage, so gate new/changed lines rather than blocking every PR on historical debt.

Production checklist

  • ci.yml runs lint, typecheck, test, and build on every PR.
  • quality.yml checks accessibility (axe-core) and performance (lhci) on rendered output.
  • Workflows declare minimal permissions: contents: read.
  • Every team member and AI agent knows the exact DoD command before committing.

Check yourself

Check Yourself

1. Why should a team's Definition of Done (DoD) be backed by automated CI gates wherever possible?

2. Which workflow in Mengty Learns runs Lighthouse CI and @axe-core/playwright against the built out/ directory?

Sources