Purpose: Guide for a team lead managing multiple developers on feature branches using Claude Code + Spec-Kit + the anti-flattening methodology.
This guide is for a team lead setting up a project where 2-10 developers work concurrently on feature branches, each using Claude Code with Spec-Kit.
The model is simple: main is the contract. The lead owns the handoff documents on main (VISION, ARCHITECTURE, CONSTITUTION, SCOPE). Developers build features against that contract on numbered branches. PRs are reviewed against the constitution and vision before merging.
Point your CLI agent at the agentic-dev-starter kit and invoke Protocol A (see the kit's root CLAUDE.md):
"Read CLAUDE.md. Set up a new project for my team."
The agent handles the full unfold: directory scaffolding, Spec-Kit install (latest), token-meter startup, 5 DNA enforcement skills, Article 10 interview, handoff-doc authoring, git init, and remote push. Expect 60-90 minutes of real conversation during handoff-doc authoring. that's where your strategic thinking becomes binding contract.
What you provide during the unfold:
| Artifact | What you contribute |
|---|---|
| VISION.md | Problem, target users, experience fidelity scenarios with 3+ negative assertions each |
| ARCHITECTURE.md | Tech stack (pinned versions), module boundaries, data model, data flow |
| CONSTITUTION.md | Answers to the Article 10 interview. rules specific to your stack and team risks |
| SCOPE.md | 8+ explicit non-goals |
The agent produces skeletons and interviews you; you steer the content.
Based on the interview, your agent may propose rules like:
- All PRs require at least 1 approval before merge
- Session budget: each feature implementation completes within 3 Claude Code sessions
- No direct pushes to main. all changes via PR
- Run full test suite locally before opening PR
- Handoff note required at end of every Claude Code session
- TypeScript strict mode everywhere. no `any` types
Accept, edit, or reject each. Articles 1-9 are universal and not negotiable.
Main is now the contract. Every developer builds against it.
For each developer joining the team, send this message:
Clone
<repo-url>,cdinto the project, open Claude Code. Say: "Read CLAUDE.md. I'm a new dev, onboard me."Your agent handles per-machine installs (Spec-Kit CLI, token-meter) and walks you through the handoff docs. Requires: Claude Code,
uv,git, Node.js 18+.
The agent runs the Dev Onboarding protocol baked into the target project's CLAUDE.md: verifies Spec-Kit CLI and Node on the dev's machine, installs Spec-Kit if missing, tells the dev to start npx agent-token-meter in a split pane and install claude-mem if not present, walks them through CONSTITUTION.md (especially Article 10), VISION.md, SCOPE.md, ARCHITECTURE.md in order, summarizes the feature workflow, and offers to pick up an existing spec if one has a handoff note.
Developers should NOT modify handoff documents on their feature branches. If they find a gap or disagreement, they propose a change to main via PR (see section 9).
Each feature follows the Spec-Kit progression:
# 1. Create feature spec (auto-creates numbered branch + spec directory)
/speckit-specify "Add user authentication with OAuth2"
# → Creates branch 001-user-auth
# → Creates specs/001-user-auth/spec.md
# 2. Clarify ambiguities (optional)
/speckit-clarify
# 3. Create technical plan
/speckit-plan
# → Creates plan.md, research.md, data-model.md
# 4. Break into tasks
/speckit-tasks
# → Creates tasks.md with test-first ordering
# 5. Implement
/speckit-implement
# → Build, test, commit on green
# 6. Open PR to main
gh pr create --title "feat: add OAuth2 authentication"Branch numbering: Spec-Kit auto-assigns sequential numbers. Developer A gets 001-user-auth, Developer B gets 002-payment-flow, Developer C gets 003-notifications. Each branch has its own isolated specs/ directory.
One feature per branch. Clean, focused PRs. Don't bundle unrelated work.
The lead reviews every PR against:
- Article 1: Tests written first? Full suite green?
- Article 3: Tasks derived from user behaviors, not feature names?
- Article 5: Any simplifications logged? If 3+ on one scenario, escalate. it's an architecture problem.
- Article 10: Team-specific rules followed?
- Do the Experience Fidelity Scenarios from VISION.md pass?
- Check
[D]requirements specifically. these are the most vulnerable to flattening. - Were negative assertions preserved? (These are the first things cut.)
- Did the developer build anything listed as a non-goal in SCOPE.md?
- Are
[D]requirements truly delivered (multi-component integration)? - Or were they silently downgraded to
[W](works in isolation)?
- Review any simplifications logged per Article 5.
[D]→[W]downgrades need a resolution plan.
## What this PR does
<!-- One paragraph -->
## Constitution checklist
- [ ] Tests written before implementation (Art. 1)
- [ ] All tests green
- [ ] Tasks derived from behaviors, not feature names (Art. 3)
- [ ] All simplifications logged (Art. 5)
- [ ] No scope violations (SCOPE.md)
- [ ] [D] requirements delivered, not downgraded to [W]
- [ ] Team rules followed (Art. 10)
## Spec artifacts
- specs/NNN-feature/spec.md
- specs/NNN-feature/plan.md
- specs/NNN-feature/tasks.md- Articles 1-9 are universal. They apply to every project built with this methodology. They are never changed.
- Article 10 is project-specific. Changes require a PR to main, reviewed and approved by the lead.
- The constitution is law. Developers do not override it on feature branches. If a dev encounters a situation where the constitution seems wrong, they raise it with the lead. they do not work around it.
.specify/memory/constitution.mdis synced from CONSTITUTION.md on main. When main updates, devs pull and the memory copy updates automatically.
Every developer should run the token meter in a split terminal pane:
npx agent-token-meterIt shows burn rate, context tax, and tells you when to write a handoff and /clear.
Install claude-mem once per developer machine:
npx claude-mem installclaude-mem automatically captures what happened each session and makes it searchable in the next one. When dna-context-check fires a handoff and the developer runs /clear, claude-mem persists the session state. At the start of the next session picking up an existing feature:
- Run
/mem-search [feature name]to surface the last session's context (~50 tokens) - Then open
specs/NNN-feature/handoff.mdfor the structured handoff note
The two tools are complementary: token-meter tells you when to hand off; claude-mem carries what across the boundary.
Define a per-feature session budget in Article 10. Example:
- Each feature implementation should complete within 3 Claude Code sessions
- Write a handoff note before ending any session
At the end of each Claude Code session:
- Write a handoff note in the spec directory (
specs/001-feature/handoff.md) - Describe: what's done, what's next, what's blocked
/clearto reset context- Next session: Claude reads the handoff note and picks up where you left off
This prevents quadratic cost growth from bloated conversation history.
Natural handoff points in the Spec-Kit workflow:
- After
/speckit-specifycompletes → handoff,/clear - After
/speckit-plancompletes → handoff,/clear - After
/speckit-taskscompletes → handoff,/clear - During
/speckit-implement. after completing each phase of tasks
Periodically check team token usage for signs of spinning sessions (high token count, low commit count). The token meter makes this visible.
| File | Purpose | Who changes it |
|---|---|---|
CLAUDE.md |
Agent instructions and rules | Lead only |
VISION.md |
What to build and why | Lead only |
ARCHITECTURE.md |
Technical shape | Lead only (see section 9) |
CONSTITUTION.md |
Hard rules | Lead only (Art. 10 via PR) |
SCOPE.md |
What NOT to build | Lead only |
.specify/memory/constitution.md |
Spec-Kit memory copy | Synced from CONSTITUTION.md |
| File | Purpose | Who changes it |
|---|---|---|
specs/001-feature/spec.md |
Feature specification | Developer who owns the branch |
specs/001-feature/plan.md |
Technical plan | Developer |
specs/001-feature/tasks.md |
Task breakdown | Developer |
specs/001-feature/handoff.md |
Session handoff notes | Developer |
| Feature code + tests | Implementation | Developer |
When a feature branch merges to main, the specs/NNN-feature/ directory comes along as a historical record. The shared docs on main are untouched by feature branches.
Architecture evolution is inevitable. Handle it cleanly:
-
Only the lead updates ARCHITECTURE.md on main. Devs never edit it on their feature branches.
-
If a dev discovers architecture needs changing:
- Do NOT change ARCHITECTURE.md on the feature branch
- Create a separate PR to main proposing the change
- Include: what changed, why, and what existing feature work is affected
- Lead reviews and merges (or opens a discussion)
-
After an architecture update on main:
- All active devs pull main into their feature branches
- Re-read ARCHITECTURE.md to understand the change
- Adjust in-progress work if affected
-
Architecture PRs take priority over feature PRs. They unblock the whole team.
Two developers building related features will eventually produce merge conflicts. Handle them cleanly:
- Spec-Kit's numbered branches isolate spec directories. Dev A's
specs/001-auth/never conflicts with Dev B'sspecs/002-payments/. Spec artifacts merge cleanly. - Lead should sequence features with shared dependencies. If two features touch the same data model or module, one should merge first. Plan this during feature assignment.
- Small, focused PRs. One feature per branch. Don't bundle unrelated work. Smaller surface = fewer conflicts.
When conflicts happen despite prevention:
- The second-to-merge developer resolves. Whoever's PR is still open when the first one merges is responsible for rebasing and resolving.
- Rebase on updated main, don't merge main into the feature branch. This keeps the commit history clean.
- If the conflict is architectural (two features made incompatible design choices), escalate to the lead. Don't resolve by picking one side. the lead decides which pattern wins and may update ARCHITECTURE.md.
- Re-run the full test suite after conflict resolution. Constitution Article 1. never commit on red.
- If the conflict is in spec artifacts (
specs/directory): both specs are valid historical records. Merge both. The code is what needs reconciling, not the specs.
Part of agentic-dev-starter. See also: METHODOLOGY.md, HANDOFF_FORMAT.md, CONSTITUTION.md.