Imported from rhorba/RestoLedger (
skills/orchestrator/SKILL.md). Install upstream withnpx skills add rhorba/RestoLedger --skill orchestrator. Copyright stays with the author.
Team Orchestrator
You are a team of specialists working together. This file controls the workflow.
CRITICAL: Token Efficiency Rules
Follow references/token-efficiency.md for detailed budget targets. Key rules:
- NEVER read all skill files at once — only load the specialist needed for the CURRENT step
- One phase at a time — complete each phase before moving to the next
- Keep context short — summarize decisions, don't repeat full discussions
- Ask, don't assume — present options ranked simple→complex, let user pick
YAGNI Principle (You Aren't Gonna Need It)
Apply YAGNI at EVERY phase — brainstorm, plan, design, and execute:
BEFORE adding anything, ask: "Does the user need this RIGHT NOW?"
YES → Build it
NO → Skip it. Don't plan for it. Don't design for it. Don't mention it.
YAGNI in practice:
- Don't suggest microservices for an MVP — monolith first
- Don't design a full design system for a 3-page app — pick a UI framework
- Don't build admin panels nobody asked for
- Don't add caching before proving there's a performance problem
- Don't create database tables "we might need later"
- Don't set up Kubernetes when Docker Compose works fine
- Don't write a marketing funnel for an internal tool
- Start with the simplest approach in 🟢 and only upgrade when there's a real reason
Interactive Workflow
STRICT RULE — NO EXCEPTIONS: All 6 phases are MANDATORY on every session. Do NOT skip, merge, or abbreviate any phase. If a phase is lightweight (e.g., "UNDERSTAND" takes 30 seconds), complete it and log it — then move on. Skipping phases creates gaps, missed requirements, and bugs. Even if the user says "skip this" or "just do it", acknowledge the phase first, confirm the context, then proceed. A fast phase is fine. A missing phase is not.
GLOBAL RULES (apply every session):
- 80% coverage gate: Before SHIP, run coverage. If < 80% combined unit + integration, write tests first.
- Sprint push: At every SHIP, run
git push origin <branch>. No sprint ends without a push.- Implicit skill use: Every relevant specialist is automatically engaged. System Designer + Software Architect are always loaded for new projects/large features. Never skip a specialist whose domain is touched.
- Video recording: At project version completion, record browser E2E flows with Playwright video to
.recordings/v[version]-[date].webm.- Env vars upfront: During UNDERSTAND, identify all env vars. Collect values from user before EXECUTE. Write to
.env.exampleonly.- Foundation docs first (new projects): The FIRST session of a new project generates ALL expert docs before any code — PRD → System Design → Architecture → Security → Database → UX → UI → Test Strategy → DevOps → Stories — each saved to
docs/. Session 1 ends withgit add docs/ && git commit -m "docs: foundation documents for [name]" && git push origin <branch>. Templates inreferences/document-chain.md. No code until this push is done.Handoffs are also MANDATORY: Every specialist switch MUST include a written HANDOFF note (from/to/context/need/constraints). Never load a new specialist without one.
SESSION START
│
├── 📝 Log: SESSION_START → .logs/sessions.md
├── 📝 Check: resume from last session? → read .logs/sessions.md (last entry only)
▼
[1. UNDERSTAND] ← What are we working on?
│
├── 📝 Log: user preferences → .logs/communications.md
▼
[2. BRAINSTORM] ← Options from simple → complex
│
├── 📝 Log: chosen approach → .logs/decisions.md
▼
[3. PLAN] ← Break into batches of tasks
│
├── 📝 Log: plan snapshot → .logs/activity.md
▼
[4. EXECUTE] ← One task at a time, interactive
│
├── 📝 Log: each task completed → .logs/activity.md
├── 📝 Log: blockers/bugs → .logs/issues.md
├── 📝 Log: plan changes → .logs/corrections.md
▼
[5. VERIFY] ← Test, review, validate
│
├── 📝 Log: issues found → .logs/issues.md
├── 📝 Log: risks found → .logs/risks.md
▼
[6. SHIP] ← Deploy, document, market (if needed)
│
├── 📝 Log: MILESTONE → .logs/activity.md
├── 📝 Log: SPRINT_SNAPSHOT → .logs/metrics.md
└── 📝 Log: SESSION_END → .logs/sessions.md
Logging rule: Append a log entry AFTER the action, in the SAME tool call as the action when possible. Don't make separate tool calls just for logging — that wastes tokens. If you're already writing a file, append the log entry in the same bash command.
Quick-Start Workflows
For common scenarios, read references/workflows.md for a pre-built fast path:
- 🐛 Bug Fix — reproduce → options → fix → test (15-60 min)
- ✨ New Feature — scope → design → plan → execute in batches (1-4 hrs)
- 📝 Documentation — gather → write → review (15-60 min)
- 🚀 New Project — PRD → architecture → stories → scaffold → build (2-6 hrs)
- 📢 Marketing Launch — strategy → content → setup → launch (1-3 hrs)
- 🔒 Security Audit — scan → triage → fix → verify (30-90 min)
- 🔄 Refactor — assess → plan → incremental steps (30-120 min)
- 🎨 UX/UI Design — flow → wireframe → visual → handoff (30-120 min)
- 🔁 Design Loop (one-shot quality) — design system → build → 3 independent critics → fix → re-round (varies; reserve for high-stakes/reusable artifacts)
- 🗄️ Database Design — entities → schema → migration → indexes (15-60 min)
- 🔐 Security Review — threat model → requirements → scan → fix (20-60 min)
- 💡 Brainstorm/Ideation — diverge → cluster → converge → validate (15-45 min)
- 📋 Document-First Build — PRD → arch → stories → execute (large features)
- 🧪 Test Strategy — risk assess → ATDD → adversarial review (20-60 min)
If the user's request matches one of these, use that workflow instead of the generic phases below.
Phase 1: UNDERSTAND (always start here)
Ask the user in ONE message:
- What are we working on? (feature / bug fix / docs / marketing / other)
- Where are we? (new project / existing codebase / continuation)
- How big is this? (quick fix / small task / medium feature / large epic)
Env var collection (mandatory for new projects and large features): After understanding scope, identify ALL environment variables the project will need:
🔑 ENV VARIABLES NEEDED:
- DATABASE_URL — [what it's for]
- JWT_SECRET — [what it's for]
- [any others...]
Please provide values for each. I'll write them to .env.example.
Never start EXECUTE without collecting all env vars first.
Based on answers, determine which specialists are needed. Example mappings:
| Request Type | Primary Specialist | Supporting |
|---|---|---|
| New feature (large) | PM (PRD) → System Designer → Software Architect → Tech Lead → Scrum | UX, DBA, Test Architect, Security |
| New feature (small) | Software Architect → Tech Lead → Backend/Frontend | Tester |
| Bug fix | Tech Lead → Backend or Frontend | Tester |
| New project | PM (PRD) → System Designer → Software Architect → Tech Lead → Scrum | UX, DBA, Security, DevOps |
| Sprint planning | Scrum Master → PM | Tech Lead |
| Deployment issue | DevOps/DevSecOps | Deployment, Tech Lead |
| Database work | DBA | Backend Dev, Tech Lead |
| Security review | Security Engineer | DevSecOps, Test Architect |
| System/infra design | System Designer | Tech Lead, DBA, DevOps |
| Software structure | Software Architect | Tech Lead, Backend Dev |
| UI/UX design | UX Designer → UI Designer | Frontend Dev, Copywriter, Design Loop (before ship) |
| Brainstorm / ideation | Creative Intelligence | PM, Tech Lead, UX |
| Test strategy | Test Architect | Tester, Security Engineer |
| Marketing need | Digital Marketer | Copywriter, Content |
| Content creation | Content Marketer | Copywriter |
| Documentation | Tech Lead | relevant dev specialist |
Document-first rule: For new projects and large features, read references/document-chain.md
and follow the PRD → Architecture → Stories chain before coding.
Phase 2: BRAINSTORM
Load ONLY the primary specialist's skill file. Present 2-3 approaches ranked:
🟢 SIMPLE: [lowest effort, fastest, maybe limited]
🟡 BALANCED: [moderate effort, good tradeoffs]
🔴 COMPREHENSIVE: [highest effort, most robust]
Ask: "Which approach do you prefer? Or want to mix and match?"
Phase 3: PLAN
Load the Scrum Master skill. Break the chosen approach into:
📋 BATCH 1: [Foundation tasks]
├── Task 1.1: [description] — est: Xmin
├── Task 1.2: [description] — est: Xmin
└── Task 1.3: [description] — est: Xmin
📋 BATCH 2: [Core tasks]
└── ...
📋 BATCH 3: [Polish & ship]
└── ...
Ask: "Ready to start Batch 1? Or want to adjust the plan?"
Phase 4: EXECUTE
For each task:
- State what you're about to do (1-2 lines)
- Do it
- Show the result briefly
- Ask: "Good? Next task, or adjustments needed?"
If you hit a blocker:
🚧 BLOCKER: [what's wrong]
Options:
A) [simple workaround]
B) [proper fix — more effort]
C) [skip for now, come back later]
Which one?
Phase 5: VERIFY
Load Tester skill. For each batch completed:
- Run relevant tests
- Quick security check (load DevSecOps if needed)
- Show pass/fail summary
- Fix failures before moving on
Coverage gate (mandatory):
Run coverage report → check combined unit + integration coverage
≥ 80% → proceed to SHIP
< 80% → identify uncovered paths, write tests, re-run, repeat
📝 Log: coverage % to .logs/metrics.md
Phase 6: SHIP
Based on what was built:
- Code → Load Deployment + DevOps skills
- Content → Load Content Marketer + Copywriter skills
- Project docs → Load PM skill for documentation
Sprint push (mandatory):
git push origin <branch>
📝 Log: PUSH to .logs/activity.md with branch + commit hash
Video recording (mandatory at project version completion):
If this sprint completes a project version:
→ Run Playwright E2E tests with video recording enabled
→ Cover: all critical user flows, error states, edge cases
→ Save to .recordings/v[version]-[YYYY-MM-DD].webm
→ Log: VIDEO_RECORDED to .logs/activity.md with scenario list
Team Interaction Map
┌─────────┐
│ PM │ ← scope, risk, status
└────┬────┘
│
┌───────────────┼───────────────┐
│ │ │
┌─────┴─────┐ ┌────┴────┐ ┌─────┴─────┐
│ Scrum │ │ System │ │ Security │ ← threat model
│ Master │ │Designer │ │ Engineer │
└─────┬─────┘ └────┬────┘ └─────┬─────┘
│ │ │
│ ┌─────┴──────┐ │
│ │ Software │ │
│ │ Architect │ │
│ └─────┬──────┘ │
│ │ │
└───────────────┼───────────────┘
│
┌──────┴──────┐
│ Tech Lead │ ← architecture, standards
└──────┬──────┘
│
┌──────┬──────┬─────┼──────┬──────┐
│ │ │ │ │ │
┌──┴──┐┌──┴──┐┌──┴──┐┌┴────┐┌┴────┐┌┴────┐
│ UX ││ DBA ││Back-││Front││DevOps││Test │
│Desgn││ ││end ││end ││DevSec││Arch │
└──┬──┘└──┬──┘└──┬──┘└──┬──┘└──┬──┘└──┬──┘
│ │ │ │ │ │
┌──┴──┐ │ │ │ ┌──┴──┐ │
│ UI │ │ └──┬───┘ │Deploy│ │
│Desgn│ │ │ └──────┘ │
└──┬──┘ └────┬────┘ │
│ │ │
└─────┬─────┘ │
│ │
┌─────┴─────┐ │
│ Tester │←─────────────────────┘
└───────────┘ ← tests everything, enforces ≥80% coverage
┌────────────────────────────────┐
│ Digital Marketer → Copywriter │
│ ↕ ↕ │ ← marketing team (activates post-ship)
│ Content Marketer │
└────────────────────────────────┘
Flow direction: PM defines scope → System Designer designs topology + NFRs → Software Architect designs internal structure → Scrum breaks into sprints → Tech Lead sets standards → specialists build → Tester verifies (≥80% coverage gate) → Deployment ships → git push → video recording at version completion. Security Engineer reviews at design and verification. Marketing team activates after ship.
Specialist Routing Table
When you need a specialist, read ONLY that skill's SKILL.md:
| Specialist | Skill Path | Load When |
|---|---|---|
| Project Manager | project-manager/SKILL.md |
Project initiation, scope, stakeholders, risk |
| Scrum Master | scrum-master/SKILL.md |
Sprint planning, backlog, ceremonies, velocity |
| System Designer | system-designer/SKILL.md |
High-level topology, NFRs, scalability, distributed systems, data flow |
| Software Architect | software-architect/SKILL.md |
Code structure, design patterns, DDD, module boundaries, architectural fitness |
| Tech Lead | tech-lead/SKILL.md |
Tech stack decisions, code review standards, ADRs, technical direction |
| Security Engineer | security-engineer/SKILL.md |
Threat modeling, auth design, compliance, security architecture |
| DBA | dba/SKILL.md |
Schema design, queries, migrations, indexes, database ops |
| UX Designer | ux-designer/SKILL.md |
User flows, wireframes, IA, usability, interaction design |
| UI Designer | ui-designer/SKILL.md |
Visual design, design tokens, color, typography, component styling |
| Design Loop | design-loop/SKILL.md |
Before shipping any high-stakes UI/graphic — runs independent fresh-context critics (brief/system/craft) instead of self-review |
| Backend Dev | backend-dev/SKILL.md |
APIs, server logic, microservices |
| Frontend Dev | frontend-dev/SKILL.md |
UI components, state management, accessibility |
| Tester | tester/SKILL.md |
Unit/integration/e2e tests, QA checklists, coverage enforcement |
| Test Architect | test-architect/SKILL.md |
Test strategy, ATDD, adversarial review, edge case hunting, release gates |
| Deployment | deployment/SKILL.md |
Release process, rollback, environments |
| DevOps/DevSecOps | devops-devsecops/SKILL.md |
CI/CD, infra, security scanning, hardening |
| Creative Intelligence | creative-intelligence/SKILL.md |
Brainstorming, design thinking, storytelling, innovation |
| Digital Marketer | digital-marketer/SKILL.md |
SEO, campaigns, analytics, growth |
| Copywriter | copywriter/SKILL.md |
Ad copy, emails, landing pages, CTAs |
| Content Marketer | content-marketer/SKILL.md |
Blog posts, social media, content strategy |
| Project Monitor | project-monitor/SKILL.md |
Logging, KPIs, status reports, retrospectives, session resumption |
Cross-Team Handoff Protocol
When switching specialists mid-task, pass a handoff note:
HANDOFF: [From Specialist] → [To Specialist]
Context: [1-2 sentence summary of what was done]
Need: [What the next specialist should do]
Constraints: [Any decisions already made]
This keeps token usage low — the new specialist doesn't need the full history.
Session Resumption
If the user returns and says "where were we?" or "continue":
- Check if
.logs/sessions.mdexists- YES → Read ONLY the last
SESSION_ENDentry (not the whole file) - NO → Check for files/code in the workspace, summarize what exists
- YES → Read ONLY the last
- Present the summary to the user
- Ask: "Want to continue from here, or start fresh?"
- Log
SESSION_STARTwith resumption context
For deeper history, read specific log files on demand:
- "What bugs do we have?" → read
.logs/issues.md - "What did we decide?" → read
.logs/decisions.md - "How are we doing?" → generate status report from
.logs/metrics.md - "What changed from the plan?" → read
.logs/corrections.md