In this article
📐 What is the staff-engineer pattern
A staff engineer doesn't write all the code. They guide discovery, establish architecture, decompose work into atomic tasks, and orchestrate specialized agents that execute with precision. Each phase has a gate—nothing moves to the next level without explicit approval.
The claude-code-staff-engineer repo encapsulates this as:
- Hooks (management layer): Context initialization at session start, injection of the employee handbook
- Skills (employee handbook): Brainstorming, TDD Iron Law, forensic debugging, delegation, review
- Agents (team roster): Implementer, spec reviewer, code quality reviewer, peer reviewer
- Commands & sub-agents: Specialized workers per task, with context isolation
🔧 How to use it: Setup and Structure
The project structure maps to real functions in an engineering team. Each folder represents a role, a process, or a lifecycle.
When a session starts, a hook automatically loads the Employee Handbook. This file contains the non-negotiable principle: the 1% Rule.
- 1% Rule: If you think there's even a 1% chance that a skill applies, you MUST invoke it. It's not optional.
- TDD Iron Law: No production code without a failing test FIRST. If you write code before the test: DELETE, retry.
- Explicit Approval Gates: Each phase has human sign-off. Not "no one objected" (implicit approval). "I reviewed it, it's OK" (explicit approval).
📋 The Phase Pipeline
Every project follows a rigid pipeline. No shortcuts, no "small tasks that skip review."
- 1. Brainstorming & Design (discovery skill): Scope detection, 2–3 approach proposals with trade-offs, no code until design is approved
- 2. Spec Review (sub-agent reviewer): Fresh agent audits the design; checks for completeness, consistency, clarity
- 3. Planning & Backlog Grooming (writing-plans skill): Break design into 2–5 minute tasks, exact file paths, no TBD
- 4. Plan Review (sub-agent reviewer): Verify that an engineer could follow the plan without getting stuck
- 5. Execution per Task (delegation skill): Dispatch isolated sub-agent, fresh context, zero session history
- 6. Quality Gates—two serial reviews: Spec Compliance (are we building the right thing?) + Code Quality (are we building it well?)
- 7. TDD Iron Law (tdd-discipline skill): Red (test fails) → Green (minimal code) → Refactor. NO exceptions.
- 8. Verification & Sign-off (evidence-verification skill): Terminal output that proves it, fresh run, deployment check
💡 Why it matters for SMEs and dev teams
The pattern solves the central problem: every agent tends toward "ship it" without discipline. With this framework, no rationalization is possible.
- For dev teams: No rationalization possible. Segregated reviews (spec reviewer ≠ code reviewer ≠ implementer). TDD enforced as iron law. Context isolation for sub-agents.
- For SMEs: Scales without chaos. Automatic hooks & skill onboarding. Separation of concerns. Reusable skills (brainstorming, TDD, debugging). Audit trail committed to git—compliance and accountability built-in.
🎯 Key elements of the pattern
Three fundamental rules that no agent can rationalize away:
- The 1% Rule: Skill discovery BEFORE any action. Even a "simple question" might benefit from a skill.
- TDD Iron Law: No production code without a failing test FIRST. If you write code before the test: DELETE.
- Explicit Approval Gates: Each phase has explicit human sign-off. No implicit approval.
📊 Model selection for task complexity
Not all tasks require the best model. The subagent-driven-development skill teaches:
- Mechanical tasks (isolated functions, clear spec): cheap/fast model
- Integration tasks (multi-file coordination): standard model
- Architecture/review tasks: best available model
🚀 Real-world use cases
Case 1: Complex Feature in a Startup
An SME wants to add a payment system with webhooks, idempotency checks, async reconciliation. Without the pattern: rationalization, skipped tests, vulnerabilities. With the pattern: brainstorming → design doc → detailed plan → spec review → isolated task execution → dual review → TDD verify → sign-off.
Time: +20% for rigor, but -80% post-launch debugging.
Case 2: Risky Refactoring
Team wants to move 5k LOC from a monolithic file to modules. With the pattern: brainstorming (goal: maintainability, testability) → design (dependency graph, module boundaries) → plan (atomic task: move file, update import, test, commit) × 5 → review step-by-step → zero runtime issues.
⚖️ Critiques and limitations
The pattern is not a silver bullet:
- Initial overhead: For tiny features, the pipeline is overkill. (Solution: skill check decides scalability.)
- Token/cost: Sub-agents, multiple reviewer rounds, TDD test output—consume more tokens. (Solution: model selection for task complexity.)
- Human judgment: Approval gates require humans in the loop. It's not "set it and forget it." (Solution: that's the point—guarantees human control.)
✅ Conclusion
The staff-engineer pattern is not a technical architecture. It's a governance structure for AI agents, replicating how mature human teams operate:
Separate discovery (thing worth building?) from implementation (build it well?). Formalize review as part of the process, not an afterthought. Enforce TDD as iron law. Escalate blockers, don't force brute-force retries. Document design & plan in git, not just in conversation.
For anyone using Claude Code for serious work—production features, SME governance, startup scaling—this is the template to copy.
Frequently asked questions about claude-code-staff-engineer
Is the staff-engineer pattern only for large teams?
No. It's scalable. For small features, some pipeline steps can be condensed or delegated to automatic skills that decide whether to skip phases. For critical features or distributed teams, all 8 steps are mandatory. The idea is that rigor is proportional to risk, not team size.
How do you balance rigor with speed?
The pattern adds ~20% overhead for rigor, but eliminates -80% of post-launch debugging and manual review cycles. It's a deliberate trade-off: it prioritizes code quality and accountability over raw speed.
Can I use the pattern without Claude Code?
The pattern is model-agnostic. It's replicable with Copilot, Cursor, Gemini, or any agent capable of using skills and sub-agents. The FareedKhan-dev/claude-code-staff-engineer repo is Claude Code-specific, but the structure (brainstorming, spec review, plan review, execution, dual review, TDD, verification) works anywhere.
Let's talk
If this topic is relevant to you, write to me: comparing notes on code and AI is always time well spent.



