A complete operating model for the team — three foundational questions, one set of tools, and a clear path from where we are today to where we're going. The model is adopted and rolling out in phases. Read it before you write your first line.
This is no longer a hypothetical. The model below is the team's operating system, ratified across docs/adr/ (ADR-0083–0096). Most of the foundation is live; the rest is rolling out. Here's the honest split, so you can tell the vision from what works today.
CLAUDE.md + the precedence cascade · gated-path Hard Stops.github/CODEOWNERS · Mike + JJ as global Secondary Ownercascade-guards.yml CI check · runs on every PRmain · the final enforcement stepdocs/lookbook.md · canonical-example seed (path already pre-gated)pr-review-toolkit) as a required CI gate · today it's a pre-commit disciplineIf you've worked on small teams, some of these will be new. The full definitions live in docs/GLOSSARY.md.
CLAUDE.md → sub-CLAUDE.md per area → Lookbook → Onboarding.Features/Loyalty/CLAUDE.md). Auto-loaded by Claude in that folder.CLAUDE.md · changes here ripple far.QIIUB today is unusually coherent — every endpoint follows the same pattern, every screen uses the same components, every ADR is consistent. This is the project's biggest asset. It's also the one most easily lost when the team expands.
Knowledge, Ownership, Flow. Each one fits into ~30 seconds of explanation. Together they form the operating model.
A four-level cascade of guides every Claude reads before generating code. CLAUDE.md → sub-CLAUDE.md per area → Lookbook → Onboarding pass. Same patterns, every laptop.
Gated paths in CODEOWNERS need owner sign-off — Mike, or JJ as Secondary Owner. Everything else (95% of PRs) needs only 1 approval from any teammate. Enforced server-side by CI + (soon) branch protection.
Seven stages: idea → spec → issue → branch → PR → review → post-merge. Each stage has clear conventions, templates, and CI checks. The path is predictable for everyone.
When seven developers each work with their own Claude, every Claude reads only the code it can see and infers its own conventions. The result: seven implicit styles. The fix: a cascade of guides everyone (human and AI) reads first.
docs/lookbook.md mapping "I need to build X" to "look at this file." Pattern matching against real, working examples in the repo.The biggest mistake a growing team makes is reviewing everything as if it were equally dangerous. We don't. Only eight paths in the repo carry permanent consequences if a wrong change merges — those need owner approval. Everything else needs one teammate's eyes, no more.
| Path | Owner | Why it's gated |
|---|---|---|
| /src/QIIUB.Domain/Entities/ | Mike | A new entity is permanent schema. Mistakes propagate to migrations, sync, RLS, and offline POS clients. |
| /src/QIIUB.Infrastructure/Migrations/ | Mike | Migrations are irreversible once shipped. Offline clients may run an old schema mid-deploy. |
| /docs/adr/ | Mike + JJ | ADRs are decisions everyone inherits. A bad ADR shapes months of work in the wrong direction. |
| /CLAUDE.md | Mike + JJ | Affects every Claude session on every dev's laptop. Wrong rule = drift everywhere. |
| /docs/lookbook.md | Mike + JJ | The canonical examples reference. A wrong entry teaches everyone the wrong pattern. |
| /packages/qiiub-ui/src/styles/tokens.css | Mike + JJ (+ Designer) | One token change ripples across 100+ screens. Color, spacing, font shifts affect every page at once. |
| /.github/workflows/ | Mike + JJ | Breaking CI breaks the whole team's ability to merge. Fragile and global. |
| /.github/CODEOWNERS | Mike + JJ | Self-gating: the file that defines gates cannot change without owner review. JJ as co-owner exists so Mike's own CODEOWNERS PRs can be approved when he's out. |
The live .github/CODEOWNERS is the authoritative list and has grown beyond these eight as the repo matured — it also gates DESIGN-SYSTEM.md, the design-token assets, the doctor / smoke-test scripts, and the Auth / Identity / Invitations feature folders. Schema (Entities/, Migrations/) and auth stay Mike-only; everywhere else Mike and JJ co-own.
The gates are server-side: the cascade-guards.yml CI workflow runs on every PR and checks the gated paths against the manifest (live); CODEOWNERS auto-requests the right reviewer (live); branch protection on main — the final activation step — hard-blocks the merge button until both pass. No client-side pre-commit hook controls governance. Hooks can be bypassed with --no-verify, so they're not trustworthy as gates. CI is the trust boundary.
As the project grows, more paths join the gated set — but only at real business milestones, not arbitrarily. First pilot live? Add Sync Engine + Payments + Auth. Three merchants in production? Move to a primary+secondary owner model per area. Multi-region rollout? Full release management. The model tightens with the stakes, never ahead of them.
From "someone has an idea" to "it's merged in main" — seven concrete steps with clear tooling at each. No mystery about where work is or who owns the next move.
Each issue uses one of four templates:
type:feature · requires approved spec, has acceptance criteriatype:bug · has reproduction steps, severitytype:tech-debt · explains the debt + impacttype:task · catch-all for chore, docs, infraBranch prefix = PR-title type = commit type. Drawn from the CC standard set (feat · fix · chore · docs · refactor · test · build · ci · perf) plus spec/ and hotfix/ as local extensions. Commit subject ≤ 50 chars.
feat/mgandia/sales-report-by-categoryfix/jflores/sync-deadlockchore/mgandia/upgrade-fastendpointsdocs/mgandia/adr-0083spec/jflores/customer-notesSome changes are so small they don't need an issue or a manifest. Six criteria: 1 sentence describable, 1 file, < 50 lines, not in src/QIIUB.*, not in docs/adr/, not in CODEOWNERS gated paths. Examples: locale key typo, missing aria-label, hardcoded hex → token, missing test. Title prefix qa-fix:. The PR is the tracking. CI validates the criteria — you can't lie your way past them.
Every PR squashes to one commit on main. The PR title + body becomes the commit message. Clean linear history. Easy reverts. The full PR history (every individual commit) is preserved in GHES for context. No merge commits, no rebase merges — one button, one rule.
Before development with the full team starts, the three available developers (Manager + 2 new hires) spend 2-3 weeks mechanically validating the existing codebase. The point: build shared mental model, find gaps, and exit the phase with a triaged backlog — not to "do new work."
qa-pass-1src/QIIUB.* beyond cosmetic fixes
A QA finding can be fixed on the spot (with qa-fix: prefix) only if:
1 · Describable in one sentence ·
2 · Touches exactly one file ·
3 · Under 50 lines changed
4 · NOT under src/QIIUB.* ·
5 · NOT under docs/adr/ ·
6 · NOT matched by any CODEOWNERS gated path
Otherwise → file an issue with qa-pass-1 label. The triage at end of QA Phase handles it.
If you're a PM, dev, or QA, here's the day-to-day reality with this system. Skip to your row.
docs/superpowers/specs/ using the light template (~1 page, 7 sections)status:ready queue, self-assign, start codingtype/author/topicqa-pass-1 issues for anything beyond trivial fixesNo process matters until you can describe it as a normal day. Here's yours:
main, fresh. Open the GHES Projects board, filter to your area + status:ready. Pick the next issue based on your capacity + priority. Self-assign.feat/yourname/topic branch from main (Conventional Commits prefix). Open Claude Code in the area folder. Claude auto-loads CLAUDE.md root + the sub-CLAUDE.md for your area. You're working against the same patterns Mike uses.--no-verify, CI catches it anyway. The trust boundary is server-side.Fixes #234), and the manifest (likely all "None" for a regular feature). Self-review checklist. Convert from Draft to Ready for review. GHES auto-requests reviewers based on CODEOWNERS — almost certainly NOT Mike, since you didn't touch a gated path.pr-review-toolkit agents (code-reviewer, code-simplifier, silent-failure-hunter, type-design-analyzer) — mandated by CLAUDE.md. They check drift vs CLAUDE.md, catch unused code, find swallowed errors, scan type safety. You fix what they flag before a human ever opens the PR. Today this is a pre-commit discipline; wiring it as a required CI gate is a planned rollout step.blocking:, nit:, question:, suggestion:. You know what needs to change vs what's optional.Closes #N. (Moving its Project board card to Done is currently manual — GHES 3.20's built-in close→Done doesn't fire yet.)mainmain itself (not your PR snapshot). Catches semantic conflicts: two PRs each green in isolation that break together. If post-merge CI fails, #qiiub-devs is alerted within minutes — you can revert your merge in one command (squash makes every merge one revertable commit) and the team continues. Detection + revert-first norm: restoring green is the priority; diagnosis is a follow-up PR.Today we're at "dev iteration" — no paying customers yet, so the gates are minimal. As QIIUB acquires real customers, more paths join the gated list. The triggers are business events, not arbitrary dates.
hotfix: branch type and process · mandatory integration test on every gated PR · monthly retro beginsNote the inversion: today Mike is on every gated path. At scale he's on almost nothing day-to-day — area owners do it. The system was designed from day one so this scaling works without re-architecting.
Phase 0 lays the load-bearing minimum before the team builds new features. Most of it is live: ✓ shipped — root CLAUDE.md updates, .github/CODEOWNERS, cascade-guards.yml, the 4 issue templates + PR template, and the T1–T5 cascade tests. ◷ still rolling out — branch protection on main, the Lookbook seed, the onboarding-ritual doc, and the label taxonomy. After this, QA Phase runs with the cascade already operational, and full Flow kicks in at QA's Definition of Done.
Validate the actual behavior of nested CLAUDE.md files in Claude Code. Without these, sub-CLAUDE.md design is betting on assumptions. ~1-2 hours of Mike's time.
Precedence rules · hard-stop reminders · versioning header. Already excellent; small additions only.
.github/CODEOWNERS is live — Mike + JJ co-own, with schema and auth Mike-only. Still pending: branch protection on main (Require Code Owner reviews · approval from someone other than the last pusher · Include administrators).
cascade-guards.ymlThe single CI workflow that enforces the gated paths server-side. Cannot be bypassed locally. Migration safety, locale parity, design discipline, cross-tenant isolation, manifest presence.
One canonical example per common task: endpoint, page, test, ADR. Links to real files in the repo. New devs pattern-match against these.
Four issue templates (feature, bug, tech-debt, task) + PR template, live on main. The label taxonomy (type: / priority: / area:) is still being set up as part of ADR-0096 P2.
Two-day mentor-led ritual. For Dev 2 and Dev 3 immediately; refined for Devs 4–7 as they join.
Recurring tasks (GHES Issues / calendar) for Monday triage, Friday spot-check, monthly milestone check, quarterly self-check. ~1 hour/month of Mike-discipline overhead, sustainable.
blocking:, nit:, suggestion:) make it clear what's a real disagreement vs a preference. Most of what becomes a fight is actually a nit; the prefix forces clarity.main a clean, linear history where each commit is one logical change, easy to revert, easy to read in git log. The trade-off is small for the dev (you can still see your work-in-progress commits in the PR) and large for the codebase (no "WIP" or "fix typo" commits cluttering main).type:bug issue. Don't fix it inside your feature PR — that's scope creep, makes the PR harder to review, and pollutes the squash commit. The rule is: a PR does one thing. If you found 3 bugs while building 1 feature, that's 3 follow-up issues, not 4 things squashed into your feature merge.The model is adopted and rolling out. What we still need from each of you:
Ask questions in the team channel. Push back. The system is meant to be edited, not memorized.
So Mike can wire CODEOWNERS correctly when Phase 0 ships.
Which functional areas (Auth, Loyalty, Inventory, etc.) do you want to own primarily?
2-3 weeks of mechanical validation comes first. Bring your skepticism — that's what this phase is for.