Use at the start of every task — master orchestrator that classifies work, routes it to the right domain pack (engineering, documents, brand, marketing, social, finance, small business, legal, leadership) and the right model tier (Opus by default, Fable reserved for adjudication), fetches live docs via Context7, gates frontend work behind an anti-template design mockup, enforces layered security (OWASP + edit scanning + supply-chain skill vetting), verifies visually via Playwright, reviews deeply before and after the PR, and orchestrates superpowers skills in the correct order
Everything else is optional and degrades gracefully — a missing pack never blocks a task. Install commands, per-pack caveats, and degradation rules live in references/ecosystem.md. Read that file only when a pack you need is missing, or the user asks how to install one — never routinely.
example-skills (mcp-builder, skill-creator), Everything Claude Code, karpathy-skills
Step 8 VERIFY
playwright MCP, example-skills (webapp-testing)
Step 8.5 REVIEW
pr-review-toolkit, skillspector
Domain deliverables
see Domain Routing below
Domain Routing
Engineering is the default domain and runs the full flow below. When the task is a non-code deliverable, CLASSIFY names the domain and routes to its pack:
Task is about
Domain
Pack
Copy, SEO, CRO, launches, ads, email, pricing pages
Routing to a non-engineering domain? Read references/skill-pack-registry.md — it carries the shortened Deliverable flow, each pack's gates, and its caveats. Engineering tasks skip it entirely. Mixed tasks split: the engineering flow owns the repo diff, the Deliverable flow owns the non-code half, and each half passes its own gates.
Model Routing
opus by default; fable for security adjudication, review arbitration, and high-stakes domain judgement. Tier aliases, not pinned versions.
A blind head-to-head (2026-07-29) could not separate the two on architecture, planning, or root-cause analysis, so those run on opus. fable is reserved for the three rows that experiment did not measure and whose failure cost is asymmetric: security adjudication, final review arbitration, and high-stakes domain judgement.
Pass model: per dispatch (Agent tool, workflow agent(), agent frontmatter); N generators on opus, the single adjudicator on fable. The main-conversation model is user-selected — recommend a tier at CLASSIFY, then proceed regardless.
Full table, escalation rules, fallback, and cost discipline: references/model-routing.md.
Unified Flow
Every task follows this flow. Steps are skipped only when explicitly not applicable.
1. CLASSIFY → Determine task type, scope, domain pack, and model tier
2. CONTEXT7 → Detect libraries → fetch current docs
3. BRAINSTORM → Invoke superpowers:brainstorming
4. PLAN → Invoke superpowers:writing-plans
5. UI/UX GATE → Generate design mockup → run design system checklist
6. SECURITY → Run OWASP + LLM security checklist
7. IMPLEMENT → Invoke superpowers:test-driven-development
8. VERIFY → Invoke superpowers:verification-before-completion
8.5 LOCAL REVIEW → Run code-reviewer (and security-reviewer if sensitive) on local diff
9. FINISH → Invoke superpowers:finishing-a-development-branch
10. REVIEW → PR review loop until clean approval
Step 1: CLASSIFY
Determine the task type and scope before doing anything else.
Ask yourself:
What type of task is this? (feature, bug fix, refactor, config change, documentation, UI-only)
What parts of the codebase are affected? (frontend, backend, full-stack, infrastructure)
Is this trivial (one-line config, comment fix) or non-trivial?
Are there libraries/frameworks involved that I need current docs for?
Which domain does this belong to? (engineering by default; documents, brand, marketing, social media, finance, small business, legal, or leadership when a domain pack from the Skill Pack Registry applies — non-code deliverables take the Deliverable flow)
Which model tier fits each phase? (consult Model Routing: opus unless the step is security adjudication, review arbitration, or high-stakes domain judgement)
Output: A one-line classification statement, e.g.:
"Feature: full-stack — adding OKR alignment suggestions. Involves: Next.js (frontend), FastAPI + DSPy (backend). Non-trivial. Domain: engineering. Model: opus throughout; fable only if Step 8.5 turns up a security verdict to adjudicate."
Ledger: for non-trivial engineering tasks, create .maestro/evidence-<date>-<task-slug>.md now, recording the classification, skip row, supply-chain flag, and model tier — later steps re-read these from the file, never from memory. Format, the stable-key rule, and read-back points: references/evidence-ledger.md. Skipped on the trivial row and the Deliverable flow.
Memory-assisted classification (if claude-mem is available):
Before locking in the classification, query prior observations to avoid re-deriving context that already exists:
Call the search MCP tool with keywords from the user's request (feature name, affected file paths, library names)
Call timeline for the affected project path if recent activity may be relevant
Weave any high-signal prior observations into the classification statement — surfacing the raw observation text (no paraphrasing) so the user can eyeball relevance. Example: "Feature: full-stack OKR alignment suggestions. Prior observation (2026-03-20): user rejected a DSPy-based retriever due to 4× latency — favour cached retrieval."
If claude-mem is unavailable, skip this substep and proceed with the classification from the user's current request alone.
Skip logic determined here:
Classification
Steps to Skip
Trivial config/docs change (see Supply-chain trigger below — a SKILL.md, plugin-manifest, or MCP-config edit is never trivial)
Skip 3–6 and 8.5, go straight to 7 (implement without TDD ceremony)
Skip 5a–5c (mockup) and 5d (UI UX Pro Max refinement), still run 5e (checklist)
Bug fix
Step 3 becomes superpowers:systematic-debugging instead of brainstorming
No libraries detected
Skip 2 (no Context7 calls)
Independent subtasks identified
Step 7 can use superpowers:dispatching-parallel-agents
No dev server running
Skip visual verification (Playwright) in step 8
No new types introduced
Skip type-design-analyzer in step 10
No comments added/modified
Skip comment-analyzer in step 10
Non-code deliverable (marketing, social, finance, small-business, legal, or leadership content/analysis with no repo diff)
Run the Deliverable flow (see Skill Pack Registry): skip 5, 7 (TDD), 8.5, 9, 10; Step 6 only if credentials/customer data/PII are handled; Step 7 becomes DRAFT with the domain pack's skills; Step 8 Evidence Gate + domain gate still run
Supply-chain trigger: if the task is authoring, installing, or updating a skill, plugin, or MCP server — i.e. the diff will touch a SKILL.md, a plugin manifest, or an MCP server config — flag it here. Step 8.5 then runs the SkillSpector supply-chain scan on the changed artefact before the PR. This is orthogonal to the code-review agents: it vets the skill supply chain (malicious instructions, prompt injection, agent-config snooping, MCP rug-pull, excessive agency), a surface ordinary code review does not cover. It does not fire on normal app-code diffs. It overrides the "Trivial config/docs change" row above for every gate that row skips, Step 6 included: a SKILL.md, plugin-manifest, or MCP-config edit is never "trivial" for gate purposes, however small the diff. The security checklist's prompt-injection, excessive-agency and supply-chain rows apply to exactly these diffs, so Step 6 runs too.
Step 2: CONTEXT7 — Fetch Live Documentation
Purpose: Ensure you plan and code against current API documentation, not stale training data.
Process:
From the classification, identify all libraries/frameworks involved in this task
For each library, resolve its Context7 ID:
Use Context7's resolve-library-id tool (or ctx7 library <name>)
For each resolved library, fetch relevant documentation:
Use Context7's query-docs tool with a query specific to the current task
Focus the query on the APIs/features you'll actually use, not the entire library
Hold the fetched docs in context — they inform brainstorming, planning, and implementation
Example:
Task: "Add server-side pagination to the OKR list endpoint"
Libraries detected: FastAPI, SQLAlchemy, TanStack Query
→ resolve-library-id("fastapi") → fetch docs for "pagination query parameters"
→ resolve-library-id("sqlalchemy") → fetch docs for "limit offset pagination"
→ resolve-library-id("tanstack-query") → fetch docs for "useInfiniteQuery pagination"
If Context7 is unavailable: Note it and proceed — do not block the workflow. Use your training knowledge but flag that docs were not verified against the latest version.
Optional supplement for very large codebases — LightRAG (if installed and wired via an MCP bridge): For repos where Context7's scope is too narrow (e.g., proprietary frameworks, niche internal APIs), a running lightrag-server instance can provide a graph+vector RAG layer. No off-the-shelf MCP bridge ships with maestro: the user must run lightrag-server and either query its REST API directly (via a scratch MCP shim) or use it outside the Claude Code loop. Treat LightRAG as an optional external service, not as a drop-in Context7 replacement.
Step 3: BRAINSTORM
Invoke superpowers:brainstorming to explore the idea before committing to an approach.
Maestro additions on top of brainstorming:
Reference the Context7 docs fetched in step 2 when evaluating approaches
Ensure every proposed approach includes a solution justification:
Why this approach is best
At least 2 alternatives considered
Why each alternative was rejected (concrete downsides)
Trade-offs of the chosen approach acknowledged upfront
Apply self-critique: after designing a solution, find at least 2 weaknesses before presenting
Perform impact analysis: what WILL this change? What WON'T? What could break?
Memory lookup (if claude-mem available) — before proposing approaches, call get_observations scoped to similar prior work (same library, same feature area). Surface any rejected approaches and their concrete failure reasons. Do not re-propose a previously rejected approach unless the rejection reason no longer applies (state why explicitly).
For bug fixes: Replace this step with superpowers:systematic-debugging — diagnose the root cause before proposing any fix.
Step 4: PLAN
Invoke superpowers:writing-plans to create a detailed implementation plan.
Maestro additions on top of planning:
The plan must reference specific APIs from the Context7 docs (not guessed signatures)
If frontend work is included, the plan must note which UI/UX checklist items apply
If security-sensitive (auth, input handling, LLM calls), the plan must note which security checklist items apply
Every plan must include a testing strategy section
Every plan task names its verification command and expected success marker; copy these into the evidence ledger as pre-registered gates before Step 7 starts — the oracle is fixed before implementation, not chosen after to fit the result
Plan reuse (if claude-mem available) — call search for prior plans with similar scope (e.g., "pagination endpoint", "OKR checkin migration"). If a close structural match exists, reuse the proven plan skeleton and cite the prior plan in the justification — do not duplicate planning work the user has already approved.
Step 5: UI/UX GATE & DESIGN MOCKUP
Skip if: No frontend files are touched.
Trigger taxonomy (see references/frontend-design-trigger.md for the full decision matrix):
Frontend change type
5a–5c Mockup?
5e Checklist?
New surface (page, route, major component)
Yes
Yes
Significant redesign (layout shift, new states, new interaction model)
Yes
Yes
Style refresh of existing surface (palette, typography, spacing)
Yes
Yes
New variant of existing component (new size/intent of an existing button, card, modal)
Test-only change (Vitest, Playwright, or Storybook coverage with no UI change)
No
No
If the table says "Yes" in column 5a–5c Mockup, you MUST run substeps 5a–5c before Step 6. Do not proceed to SECURITY or IMPLEMENT until the user has approved the mockup.
If the change type is not in the table or is ambiguous, default to Yes (run the mockup gate). The user can override with "skip the mockup, just code it" — but the default must be safe.
5a. Generate design direction
Invoke the frontend-design skill (a light sketch suffices for new variants of existing components) to produce a concrete design direction. Output must include all of:
Style direction — pick exactly one from a worthwhile list and justify it. Worthwhile: editorial / magazine, neo-brutalism, glassmorphism with real depth, light or dark luxury, bento, scrollytelling, 3D integration, Swiss / international, retro-futurism. Banned as a "direction": "clean minimal", "modern", "professional", "simple", "elegant". These are non-directions and produce template output.
Palette — concrete tokens (oklch / hex), not vague colour names. Reference the project's existing tokens before introducing new ones.
Typography pairing — specific families, weights, and the type scale.
Layout strategy — grid, bento, sidebar+canvas, scrollytelling, magazine, asymmetric. Banned default: centred single-column max-w-md card with icon → headline → body → CTA → secondary link. That is the canonical generic template; if the proposed layout looks like that, reject and re-pick.
Motion language — what motion clarifies (hierarchy, state change, focus) vs. what it distracts from. Respect prefers-reduced-motion: reduce.
Optional direction voices (if installed): Taste can contribute direction candidates, Transitions the motion language. Both are additive only — their output still faces the anti-template ban below, the required-qualities check, and the 5c gate. Neither replaces frontend-design as the direction generator.
Anti-template ban — these are forbidden in the output:
Default card grids with uniform spacing and no hierarchy
Unmodified Tailwind / shadcn / Material / Bootstrap defaults passed off as finished design
Flat layouts with no layering, depth, or motion
Uniform radius, spacing, and shadows across every component
Safe gray-on-white styling with one decorative accent colour
Dashboard-by-numbers: sidebar + uniform cards + generic charts with no point of view
Default font stacks used without a deliberate reason
Required qualities — output must demonstrate at least four:
Clear hierarchy through scale contrast
Intentional rhythm in spacing, not uniform padding everywhere
Depth or layering through overlap, shadows, surfaces, or motion
Typography with character and a real pairing strategy
Colour used semantically, not just decoratively
Hover, focus, and active states that feel designed
Grid-breaking editorial or bento composition where appropriate
Texture, grain, or atmosphere when it fits the visual direction
Motion that clarifies flow instead of distracting from it
Data visualisation treated as part of the design system, not an afterthought
Reference at least 2 real precedents (existing pages in the same product, or external products like Linear, Vercel, Stripe, Apple Newsroom, NYT Cooking, Things 3, etc.) and explain what specifically you are borrowing from each — not just "Linear" but "Linear's command-bar density and keyboard hint chips".
Before moving to 5b, self-audit: open the design direction and ask "could a 2018 admin template ship this?" If yes, re-pick. If no, proceed.
5b. Generate mockup artefact
Produce a tangible artefact the user can eyeball before any production code is written. Pick the lightest form that conveys the design:
Artefact
When to use
Where it lives
HTML prototype (single file, Tailwind via CDN)
New surfaces, redesigns, exploration
proposed-*.html in repo root or docs/mockups/
Annotated component sketch in markdown
Small new components
Inline in the plan
Existing-page screenshot + redline overlay
Refreshes of existing pages
Attached to the plan
Storybook story (if Storybook is configured)
Component-level work
Storybook's tree
The mockup must show: hero state, loading state, empty state, error state, and at least one responsive breakpoint. No placeholder lorem ipsum — use realistic copy from the actual product domain.
Pre-approval self-check (run before presenting to user):
Does the mockup avoid looking like a default Tailwind / shadcn / Material template?
Are hover, focus, and active states drawn or specified — not implicit defaults?
Is hierarchy expressed through scale contrast rather than uniform emphasis?
Would this look believable in a real product screenshot, side-by-side with Linear, Vercel, Stripe?
If the artefact supports both themes, do both light and dark feel deliberate?
Does at least one element break the predictable grid (asymmetry, overlap, sidecar, marquee, etc.)?
If any of the first four checkboxes is "no", regenerate the mockup before going to 5c. Do not present a mockup that fails these checks.
5c. Mockup approval gate
Present the mockup to the user. Wait for explicit approval (yes / go on / approved). Iterate on feedback without writing production code.
Do not skip this gate even if the design feels obvious. If the user is in caveman mode and replies "yes", that is sufficient — but the gate must still be hit.
5d. UI UX Pro Max refinement (if installed)
If UI UX Pro Max is installed, invoke it to refine palette and typography against the direction approved in 5c. Treat its suggestions as additive — the user has already approved the direction in 5c, so UI UX Pro Max can suggest refinements (different palette token, better font pairing, tweaked spacing scale) but cannot override the approved direction. If UI UX Pro Max recommends a fundamental direction change, surface it to the user explicitly ("UI UX Pro Max suggests switching from editorial to brutalist because X. Stick with editorial, or pivot?") and wait for an answer.
The maestro checklist in 5e remains the canonical gate (accessibility, responsive, loading/error states, etc.). Do not let UI UX Pro Max override checklist-level accessibility or state-coverage requirements.
5e. Run UI/UX checklist against the approved mockup
Read and run through references/uiux-checklist.md against the approved mockup (not against your imagination of the final UI).
This is not optional for frontend work. Every frontend change that alters rendered output, even "just a small tweak", gets checked against the design system; test-only changes are exempt per the trigger matrix.
Insecure deserialisation (pickle.loads(), yaml.load() without SafeLoader)
Hardcoded secrets (API keys, tokens, passwords in source code)
When a vulnerability is detected, the hook shows a warning with remediation advice after the edit lands: re-read the flagged file and remediate before continuing the TDD loop. This catches issues that pass checklist review but appear during implementation.
If the Security Guidance plugin is not installed: This step still functions via the checklist alone. Note the missing plugin in your response so the user can install it for automated post-edit protection.
Step 7: IMPLEMENT
Invoke superpowers:test-driven-development to write tests first, then implementation.
Maestro additions on top of TDD:
Decision ladder — run before implementing anything non-trivial: does this need to exist at all (YAGNI) → is it already in this codebase (where existing candidates conflict, the pattern-conflict rule below decides) → does the stdlib do it → does a native platform feature cover it → does an installed dependency solve it → can it be one line → only then write the minimum that works. Question complexity instead of building it by default ("do you actually need X, or does Y cover it?"); no unrequested abstractions, no avoidable dependencies, fewest files. The ladder governs how much implementation code gets written — it never relaxes a maestro gate: Step 5's approved design (states, accessibility), Step 6 security (all input hostile, validate at every boundary), the mandatory pytest/Vitest suite with its security-focused tests, and type annotations all stand. If the ladder says a user-approved plan item should not exist, surface it and ask — never silently drop it. A yagni: comment marks an intentional ceiling and must name it (e.g. global lock, O(n²) scan, naive heuristic) plus the upgrade path; it is never cover for leaving TODO-quality gaps.
Use the Context7 docs from step 2 when writing code — do not guess API signatures
Follow Google style guides strictly (Python and TypeScript)
British English in all prose, comments, commit messages, and documentation
Type annotations everywhere (Python type hints, TypeScript types)
No any types in TypeScript — use specific types
snake_case for API interface fields (match backend FastAPI)
Surface pattern conflicts, don't blend them — if two existing patterns in the codebase contradict (e.g. mixed error-handling, mixed state management, mixed naming conventions in adjacent modules), pick the more recent or more tested one, justify the choice in the PR description, and flag the other for cleanup in a follow-up. Blended code that satisfies both patterns is the worst outcome: it doubles the surface area to maintain and obscures the canonical pattern for future readers
Every test file must include security-focused tests where applicable
For independent subtasks: Use superpowers:dispatching-parallel-agents or superpowers:subagent-driven-development to parallelise work. Dispatch implementation subagents on opus per Model Routing — the plan already carries the judgement, and it was written on opus too. Escalate a subagent to fable only after two failed attempts on the same task.
Step 8: VERIFY
Step 8.0: Evidence Gate (run before ANY completion language)
Before writing "done/fixed/passing/works/verified" or any synonym:
Name the command or artefact that proves it.
Run it FRESH this message — no cached or prior runs.
Paste the actual output (or line/byte count, response, figures) inline.
No evidence ⇒ state UNVERIFIED + the missing check. Do not claim.
Update the evidence ledger: fill each gate's EVIDENCE from this message's fresh output; demote any gate that no longer passes; the final report names every unmet or abandoned gate with its reason, not only the ones that passed.
Deliberately duplicates superpowers:verification-before-completion — the gate must be visible in the workflow, because the sub-skill only fires if invoked.
No regressions — read changed code once more before committing
Visual Verification with Playwright
Skip if: No frontend files are touched, or no dev server is running.
When frontend changes are involved and Playwright MCP is available, perform visual verification:
Ensure a dev server is running — if not, suggest the user starts one (npm run dev or equivalent). Do not start one silently.
Navigate to affected routes — use Playwright to open each route that was changed or added
Verify visual rendering — check that the page renders without errors, layout is correct, and no elements are broken
Test interactive elements — click buttons, fill forms, toggle states that were changed
Check responsive behaviour — verify at key breakpoints (375px mobile, 768px tablet, 1280px desktop) if layout changes were made
Verify accessibility — use Playwright's accessibility tree to check for missing labels, broken focus order, or missing ARIA attributes
Take screenshots — capture before/after screenshots for the PR description if the change is visually significant
If Playwright MCP is not available: Skip visual verification. Note the missing tool in your response so the user can install it. The remaining quality gates (tests, lint, types) still apply.
Do NOT claim work is done until every applicable gate passes.
Run for every other task — bug fixes included. This step closes the gap between local correctness gates (Step 8) and the external PR review loop (Step 10). It is the user's "code review BEFORE PR creation" rule, made explicit and enforceable in the workflow. Catching maintainability and security issues here saves a full claude-review bot cycle on every PR.
Why a separate step
Step 8 VERIFY enforces correctness (tests pass, types compile, lint clean). Step 10 REVIEW happens after the PR is open and runs against the merged-base diff. Neither covers the local pre-push window where a focused diff review prevents predictable bot rework. Step 8.5 owns that window.
What to dispatch
Run as parallel Agent calls against the local diff (git diff main...HEAD, or git diff if work is uncommitted):
Agent
When to Dispatch
What It Checks
code-reviewer
Always (non-trivial changes)
Project-convention adherence, design quality, dead code, naming, structure, error handling, test coverage gaps
security-reviewer
When the diff touches authentication, authorisation, user input, database queries, file uploads, LLM calls, secrets, or PII handling
OWASP Top 10, injection, XSS, CSRF, broken access control, sensitive data exposure, insecure deserialisation, audit logging gaps
When the diff is concentrated in one language and the corresponding agent is installed
Language-idiomatic issues, type safety, async correctness, language-specific footguns
For mixed-language diffs, dispatch the relevant per-language reviewers in parallel alongside code-reviewer. Do not serialise — run them in a single message with multiple Agent tool uses. Bare names here resolve per the agent precedence rule below; Step 10's pr-review-toolkit:-prefixed dispatches are a separate, namespaced set.
Model routing here: dispatch the reviewer agents on opus; when their findings conflict, or a security-reviewer/SkillSpector verdict needs adjudication, the final judgement call runs on fable (generator/judge asymmetry — see Model Routing).
Severity thresholds
After collecting findings:
Severity
Action
CRITICAL
Block — fix before Step 9. No exceptions.
HIGH
Block — fix before Step 9. No exceptions.
MEDIUM
Fix where practical in this step. If deferred, document why in the PR description.
LOW / nit
Fix opportunistically. Do not block on these — Step 10 will catch any that genuinely matter.
Loop until clean
Dispatch reviewers in parallel
Collect all findings
Fix CRITICAL + HIGH
Fix MEDIUM where practical
Re-run only the agents whose scope was affected by the fixes
Repeat until CRITICAL + HIGH are clear
Then proceed to Step 9 FINISH. Do not commit-and-push without this step passing on non-trivial changes — it is the cheapest place to catch issues before they cost a bot review cycle.
Supply-chain scan — SkillSpector (conditional)
Run only if the diff adds or modifies an agent artefact — a skill (SKILL.md), a plugin manifest, or an MCP server config. Skip entirely for ordinary feature/bug-fix diffs (React, Python, app code): SkillSpector is not a code scanner and will only add noise.
Why it is separate from the agents above: the code-review agents check your code. SkillSpector checks the skill supply chain — prompt injection, agent-config snooping, MCP rug-pull, excessive agency, malicious or vulnerable skill instructions — a surface the code reviewers do not cover.
Process:
Call scan_skill(<path-to-changed-artefact>, use_llm=false) on each changed skill/plugin/MCP artefact — static-only, no API key required.
SkillSpector returns candidate findings. It over-flags: teaching-skills, session observers, and security skills routinely trip its regex on benign guideline text and defensive code — e.g. a PID-validation guard, a mobile UX guideline about gesture conflicts, or a React XSS anti-pattern shown as a "don't do this" example.
Claude adjudicates every HIGH/CRITICAL finding — read the flagged file:line and rule real-vs-false-positive. Do not accept the raw DO_NOT_INSTALL verdict; it is a static heuristic that cannot judge intent.
Gate: a Claude-confirmed CRITICAL/HIGH (not a raw-static flag) → block, surface the real issue, fix or reject before Step 9. Findings Claude clears as false positives → note and proceed. MEDIUM/LOW findings → note in the PR description if plausibly real; otherwise disregard (static-only MEDIUM/LOW on a trusted artefact is almost always guideline-text or defensive-code noise).
Do not rely on SkillSpector's own LLM pass (it needs a provider key). Claude is the semantic judge — keyless, no recurring cost, fuller repo context.
When the reviewer agents are unavailable
If code-reviewer and language-specific reviewers are not available in the current environment:
Perform a manual self-review — read every changed file end-to-end against the user's CLAUDE.md, the project's coding-style rules, and the security checklist from Step 6
Note the missing agents in your response so the user can install the corresponding source (pr-review-toolkit ships the code-reviewer class; security-reviewer and the language reviewers come from user-scope agent packs such as Everything Claude Code)
Do not skip the step entirely — manual review is the fallback, not skipping
Type encapsulation, invariant expression, design quality
pr-review-toolkit:comment-analyzer
When docstrings or documentation comments are added/modified
Comment accuracy, staleness risk, maintainability
Process:
Determine which agents are relevant based on the PR diff
Dispatch all relevant agents in parallel using the Agent tool (on opus per Model Routing)
Collect findings from all agents — when specialists disagree, arbitrate the conflict on fable
Fix any issues flagged by the agents — commit and push
Re-run any agents whose scope was affected by the fixes (if needed)
Phase 2: PR Review Polling Loop
After specialist analysis is clean, enter the external review loop:
Poll GitHub every 4 minutes using gh pr checks and gh api to read review comments
If the review has any issues (suggestions, warnings, nits, dead code findings, errors):
Fix them
Commit and push
Continue polling
Only stop when the review is fully clean — approved with zero outstanding comments
Report the final clean status to the user
Precondition: first check whether an external reviewer or review bot is configured (gh pr checks, a prior PR's timeline). If none exists, Phase 2's terminal state is CI green: say no reviewer is configured, stop polling once checks pass, and record that as the clean status. Never poll for an approval that cannot arrive.
When PR Review Toolkit Is Unavailable
If the PR Review Toolkit agents are not available, skip Phase 1 and proceed directly to Phase 2 (the polling loop). Note the missing toolkit in your response.
Orchestration Rules
Always Enforce (Every Task)
Plan first — never write code without a plan (exception: trivial one-liners)
Tests are mandatory — every code change ships with tests, no exceptions
Solution justification — every approach must explain why, alternatives, and trade-offs
British English — in all responses, comments, commits, and documentation
Security-first — assume all input is hostile, validate at every boundary
Never push to main — always branch + PR
Self-Critique Protocol
After designing any solution, before presenting it:
Ask "what's wrong with this?" — find at least 2 weaknesses
State the impact of each weakness
Explain why the approach is still the best option despite them (or revise)
Progress Protocol (responses inside a multi-step flow)
Applies once CLASSIFY names a step set with more than one step left, and stops when the final step closes — never on trivial single-step tasks or conversational turns. The reader cannot hold flow position between messages, so each response carries it:
Open with flow position — name the step and its state: "Step 5 (UI/UX gate) — blocked on your mockup approval." No total and no percentage: the step set varies by classification, and Step 8.5 makes any fixed denominator wrong. Name the stage instead on the Deliverable flow. Response order is position, then evidence, then prose.
Leave at most one open ask — 5c is the usual case. If two gates come due together, present both and rank them; never drop one to satisfy this rule. A question may be deferred, never suppressed. Most steps need nothing from the user and git operations are auto-approved, so when no action is due, close by naming the step you are moving to.
Evidence above justification — Step 8.0 already forces a fresh command run; put its output above the justification prose, not below. The justification still ships in full.
No wall-clock estimates — a duration is a guess dressed as a figure, and nothing here can check it. State steps or gates remaining. A fixed cadence, like Step 10's four-minute poll, is a schedule and fine to quote.
Governs reporting order and ask count only. Never truncates a checklist, drops a justification, or suppresses a gate's question.
…(truncated)
1---2name: maestro3description: Use at the start of every task — master orchestrator that classifies work, routes it to the right domain pack (engineering, documents, brand, marketing, social, finance, small business, legal, leadership) and the right model tier (Opus by default, Fable reserved for adjudication), fetches live docs via Context7, gates frontend work behind an anti-template design mockup, enforces layered security (OWASP + edit scanning + supply-chain skill vetting), verifies visually via Playwright, reviews deeply before and after the PR, and orchestrates superpowers skills in the correct order4---56# Maestro — Master Orchestrator78A single unified workflow for every task. Classify, gather context, plan, implement, verify, ship.910<HARD-GATE>11You MUST run through this orchestration flow at the start of every task. No exceptions. No shortcuts. Speed is never an excuse to skip discipline.12</HARD-GATE>1314## Ecosystem1516**Required:** superpowers (workflow skills), Context7 MCP (live docs).1718Everything else is optional and degrades gracefully — a missing pack never blocks a task. Install commands, per-pack caveats, and degradation rules live in `references/ecosystem.md`. **Read that file only when a pack you need is missing, or the user asks how to install one** — never routinely.1920| Consumed at | Packs |21| --- | --- |22| Step 1 CLASSIFY | claude-mem (prior observations) |23| Step 2 CONTEXT7 | Context7 MCP; LightRAG (very large repos) |24| Step 5 UI/UX | frontend-design, ui-ux-pro-max, taste-skill, transitions-dev |25| Step 6 SECURITY | security-guidance (edit-time hook) |26| Step 7 IMPLEMENT | example-skills (mcp-builder, skill-creator), Everything Claude Code, karpathy-skills |27| Step 8 VERIFY | playwright MCP, example-skills (webapp-testing) |28| Step 8.5 REVIEW | pr-review-toolkit, skillspector |29| Domain deliverables | see Domain Routing below |3031## Domain Routing3233Engineering is the default domain and runs the full flow below. When the task is a **non-code deliverable**, CLASSIFY names the domain and routes to its pack:3435| Task is about | Domain | Pack |36| --- | --- | --- |37| Copy, SEO, CRO, launches, ads, email, pricing pages | marketing | `marketing-skills` (50) |38| Posts, threads, reels, thumbnails, content calendars | social | `social-media-skills` (17) |39| Statements, reconciliation, close, audit, variance | finance | `finance` (8) |40| Cash flow, payroll, invoicing, CRM and customer ops | small-business | `small-business` (31) |41| Contracts, NDAs, compliance, legal risk | legal | `legal` (9) |42| Jira tickets, status roll-ups, exec updates, impact write-ups, 1:1s, performance reviews, opportunity scans | leadership | `atlassian` + `pm-*` (installed) + `leadership-skills`, `pm-product-discovery`, `c-level-skills`, `pm-claude-skills` (pinned) |43| Artefacts, long-form docs, office files | documents | `example-skills`, `document-skills` |44| Brand compliance, internal announcements | brand | `example-skills` |45| Code, tests, infra, MCP servers, skill authoring | engineering | superpowers + the flow below |4647Routing to a non-engineering domain? **Read `references/skill-pack-registry.md`** — it carries the shortened Deliverable flow, each pack's gates, and its caveats. Engineering tasks skip it entirely. **Mixed tasks split:** the engineering flow owns the repo diff, the Deliverable flow owns the non-code half, and each half passes its own gates.4849## Model Routing5051**`opus` by default; `fable` for security adjudication, review arbitration, and high-stakes domain judgement.** Tier aliases, not pinned versions.5253A blind head-to-head (2026-07-29) could not separate the two on architecture, planning, or root-cause analysis, so those run on `opus`. `fable` is reserved for the three rows that experiment did not measure and whose failure cost is asymmetric: security adjudication, final review arbitration, and high-stakes domain judgement.5455Pass `model:` per dispatch (Agent tool, workflow `agent()`, agent frontmatter); N generators on `opus`, the single adjudicator on `fable`. The main-conversation model is user-selected — recommend a tier at CLASSIFY, then proceed regardless.5657Full table, escalation rules, fallback, and cost discipline: `references/model-routing.md`.5859## Unified Flow6061Every task follows this flow. Steps are skipped only when explicitly not applicable.6263```64 1. CLASSIFY → Determine task type, scope, domain pack, and model tier65 2. CONTEXT7 → Detect libraries → fetch current docs66 3. BRAINSTORM → Invoke superpowers:brainstorming67 4. PLAN → Invoke superpowers:writing-plans68 5. UI/UX GATE → Generate design mockup → run design system checklist69 6. SECURITY → Run OWASP + LLM security checklist70 7. IMPLEMENT → Invoke superpowers:test-driven-development71 8. VERIFY → Invoke superpowers:verification-before-completion72 8.5 LOCAL REVIEW → Run code-reviewer (and security-reviewer if sensitive) on local diff73 9. FINISH → Invoke superpowers:finishing-a-development-branch7410. REVIEW → PR review loop until clean approval75```7677---7879## Step 1: CLASSIFY8081Determine the task type and scope before doing anything else.8283**Ask yourself:**84- What type of task is this? (feature, bug fix, refactor, config change, documentation, UI-only)85- What parts of the codebase are affected? (frontend, backend, full-stack, infrastructure)86- Is this trivial (one-line config, comment fix) or non-trivial?87- Are there libraries/frameworks involved that I need current docs for?88- Which **domain** does this belong to? (engineering by default; documents, brand, marketing, social media, finance, small business, legal, or leadership when a domain pack from the Skill Pack Registry applies — non-code deliverables take the Deliverable flow)89- Which **model tier** fits each phase? (consult Model Routing: `opus` unless the step is security adjudication, review arbitration, or high-stakes domain judgement)9091**Output:** A one-line classification statement, e.g.:92> "Feature: full-stack — adding OKR alignment suggestions. Involves: Next.js (frontend), FastAPI + DSPy (backend). Non-trivial. Domain: engineering. Model: opus throughout; fable only if Step 8.5 turns up a security verdict to adjudicate."9394**Ledger:** for non-trivial engineering tasks, create `.maestro/evidence-<date>-<task-slug>.md` now, recording the classification, skip row, supply-chain flag, and model tier — later steps re-read these from the file, never from memory. Format, the stable-key rule, and read-back points: `references/evidence-ledger.md`. Skipped on the trivial row and the Deliverable flow.9596**Memory-assisted classification (if claude-mem is available):**9798Before locking in the classification, query prior observations to avoid re-deriving context that already exists:991001. Call the `search` MCP tool with keywords from the user's request (feature name, affected file paths, library names)1012. Call `timeline` for the affected project path if recent activity may be relevant1023. Weave any high-signal prior observations into the classification statement — surfacing the **raw observation text** (no paraphrasing) so the user can eyeball relevance. Example: "Feature: full-stack OKR alignment suggestions. Prior observation (2026-03-20): user rejected a DSPy-based retriever due to 4× latency — favour cached retrieval."103104If claude-mem is unavailable, skip this substep and proceed with the classification from the user's current request alone.105106**Skip logic determined here:**107108| Classification | Steps to Skip |109|---------------|---------------|110| Trivial config/docs change (see Supply-chain trigger below — a `SKILL.md`, plugin-manifest, or MCP-config edit is never trivial) | Skip 3–6 and 8.5, go straight to 7 (implement without TDD ceremony) |111| No frontend touched | Skip 5 (UI/UX gate + design mockup), skip visual verification in 8 |112| Component-level frontend tweak (className change, copy edit, prop rename) | Skip 5a–5c (mockup) and 5d (UI UX Pro Max refinement), still run 5e (checklist) |113| Bug fix | Step 3 becomes `superpowers:systematic-debugging` instead of brainstorming |114| No libraries detected | Skip 2 (no Context7 calls) |115| Independent subtasks identified | Step 7 can use `superpowers:dispatching-parallel-agents` |116| No dev server running | Skip visual verification (Playwright) in step 8 |117| No new types introduced | Skip `type-design-analyzer` in step 10 |118| No comments added/modified | Skip `comment-analyzer` in step 10 |119| Non-code deliverable (marketing, social, finance, small-business, legal, or leadership content/analysis with no repo diff) | Run the **Deliverable flow** (see Skill Pack Registry): skip 5, 7 (TDD), 8.5, 9, 10; Step 6 only if credentials/customer data/PII are handled; Step 7 becomes DRAFT with the domain pack's skills; Step 8 Evidence Gate + domain gate still run |120121**Supply-chain trigger:** if the task is *authoring, installing, or updating a skill, plugin, or MCP server* — i.e. the diff will touch a `SKILL.md`, a plugin manifest, or an MCP server config — flag it here. **Step 8.5** then runs the SkillSpector supply-chain scan on the changed artefact before the PR. This is orthogonal to the code-review agents: it vets the *skill supply chain* (malicious instructions, prompt injection, agent-config snooping, MCP rug-pull, excessive agency), a surface ordinary code review does not cover. It does **not** fire on normal app-code diffs. It **overrides** the "Trivial config/docs change" row above for every gate that row skips, Step 6 included: a `SKILL.md`, plugin-manifest, or MCP-config edit is never "trivial" for gate purposes, however small the diff. The security checklist's prompt-injection, excessive-agency and supply-chain rows apply to exactly these diffs, so Step 6 runs too.122123---124125## Step 2: CONTEXT7 — Fetch Live Documentation126127**Purpose:** Ensure you plan and code against *current* API documentation, not stale training data.128129**Process:**1301311. From the classification, identify all libraries/frameworks involved in this task1322. For each library, resolve its Context7 ID:133 - Use Context7's `resolve-library-id` tool (or `ctx7 library <name>`)1343. For each resolved library, fetch relevant documentation:135 - Use Context7's `query-docs` tool with a query specific to the current task136 - Focus the query on the APIs/features you'll actually use, not the entire library1374. Hold the fetched docs in context — they inform brainstorming, planning, and implementation138139**Example:**140```141Task: "Add server-side pagination to the OKR list endpoint"142Libraries detected: FastAPI, SQLAlchemy, TanStack Query143→ resolve-library-id("fastapi") → fetch docs for "pagination query parameters"144→ resolve-library-id("sqlalchemy") → fetch docs for "limit offset pagination"145→ resolve-library-id("tanstack-query") → fetch docs for "useInfiniteQuery pagination"146```147148**If Context7 is unavailable:** Note it and proceed — do not block the workflow. Use your training knowledge but flag that docs were not verified against the latest version.149150**Optional supplement for very large codebases — LightRAG (if installed and wired via an MCP bridge):** For repos where Context7's scope is too narrow (e.g., proprietary frameworks, niche internal APIs), a running `lightrag-server` instance can provide a graph+vector RAG layer. No off-the-shelf MCP bridge ships with maestro: the user must run `lightrag-server` and either query its REST API directly (via a scratch MCP shim) or use it outside the Claude Code loop. Treat LightRAG as an optional *external* service, not as a drop-in Context7 replacement.151152---153154## Step 3: BRAINSTORM155156Invoke `superpowers:brainstorming` to explore the idea before committing to an approach.157158**Maestro additions on top of brainstorming:**159- Reference the Context7 docs fetched in step 2 when evaluating approaches160- Ensure every proposed approach includes a **solution justification**:161 1. Why this approach is best162 2. At least 2 alternatives considered163 3. Why each alternative was rejected (concrete downsides)164 4. Trade-offs of the chosen approach acknowledged upfront165- Apply **self-critique**: after designing a solution, find at least 2 weaknesses before presenting166- Perform **impact analysis**: what WILL this change? What WON'T? What could break?167- **Memory lookup (if claude-mem available)** — before proposing approaches, call `get_observations` scoped to similar prior work (same library, same feature area). Surface any rejected approaches and their concrete failure reasons. Do not re-propose a previously rejected approach unless the rejection reason no longer applies (state why explicitly).168169**For bug fixes:** Replace this step with `superpowers:systematic-debugging` — diagnose the root cause before proposing any fix.170171---172173## Step 4: PLAN174175Invoke `superpowers:writing-plans` to create a detailed implementation plan.176177**Maestro additions on top of planning:**178- The plan must reference specific APIs from the Context7 docs (not guessed signatures)179- If frontend work is included, the plan must note which UI/UX checklist items apply180- If security-sensitive (auth, input handling, LLM calls), the plan must note which security checklist items apply181- Every plan must include a testing strategy section182- Every plan task names its verification command and expected success marker; copy these into the evidence ledger as pre-registered gates before Step 7 starts — the oracle is fixed before implementation, not chosen after to fit the result183- **Plan reuse (if claude-mem available)** — call `search` for prior plans with similar scope (e.g., "pagination endpoint", "OKR checkin migration"). If a close structural match exists, reuse the proven plan skeleton and cite the prior plan in the justification — do not duplicate planning work the user has already approved.184185---186187## Step 5: UI/UX GATE & DESIGN MOCKUP188189**Skip if:** No frontend files are touched.190191**Trigger taxonomy** (see `references/frontend-design-trigger.md` for the full decision matrix):192193| Frontend change type | 5a–5c Mockup? | 5e Checklist? |194|---|---|---|195| New surface (page, route, major component) | **Yes** | Yes |196| Significant redesign (layout shift, new states, new interaction model) | **Yes** | Yes |197| Style refresh of existing surface (palette, typography, spacing) | **Yes** | Yes |198| New variant of existing component (new size/intent of an existing button, card, modal) | **Yes** (light — sketch is enough) | Yes |199| Component-level tweak (className change, copy edit, prop rename, prop drilling fix) | No | Yes |200| Bug fix without visual change | No | Yes |201| A11y-only fix (add aria-label, fix focus order, fix contrast) | No | Yes |202| Test-only change (Vitest, Playwright, or Storybook coverage with no UI change) | No | No |203204If the table says "Yes" in column **5a–5c Mockup**, you MUST run substeps 5a–5c **before** Step 6. Do not proceed to SECURITY or IMPLEMENT until the user has approved the mockup.205206If the change type is not in the table or is ambiguous, default to **Yes** (run the mockup gate). The user can override with "skip the mockup, just code it" — but the default must be safe.207208---209210### 5a. Generate design direction211212Invoke the `frontend-design` skill (a light sketch suffices for **new variants of existing components**) to produce a concrete design direction. Output **must** include all of:213214- **Style direction** — pick exactly one from a worthwhile list and justify it. Worthwhile: editorial / magazine, neo-brutalism, glassmorphism with real depth, light or dark luxury, bento, scrollytelling, 3D integration, Swiss / international, retro-futurism. **Banned as a "direction":** "clean minimal", "modern", "professional", "simple", "elegant". These are non-directions and produce template output.215- **Palette** — concrete tokens (oklch / hex), not vague colour names. Reference the project's existing tokens before introducing new ones.216- **Typography pairing** — specific families, weights, and the type scale.217- **Layout strategy** — grid, bento, sidebar+canvas, scrollytelling, magazine, asymmetric. **Banned default:** centred single-column max-w-md card with icon → headline → body → CTA → secondary link. That is the canonical generic template; if the proposed layout looks like that, reject and re-pick.218- **Motion language** — what motion clarifies (hierarchy, state change, focus) vs. what it distracts from. Respect `prefers-reduced-motion: reduce`.219220**Optional direction voices (if installed):** Taste can contribute direction candidates, Transitions the motion language. Both are **additive only** — their output still faces the anti-template ban below, the required-qualities check, and the 5c gate. Neither replaces `frontend-design` as the direction generator.221222**Anti-template ban — these are forbidden in the output:**223224- Default card grids with uniform spacing and no hierarchy225- Stock hero section: centred headline, gradient blob, generic CTA226- Unmodified Tailwind / shadcn / Material / Bootstrap defaults passed off as finished design227- Flat layouts with no layering, depth, or motion228- Uniform radius, spacing, and shadows across every component229- Safe gray-on-white styling with one decorative accent colour230- Dashboard-by-numbers: sidebar + uniform cards + generic charts with no point of view231- Default font stacks used without a deliberate reason232233**Required qualities — output must demonstrate at least four:**2342351. Clear hierarchy through scale contrast2362. Intentional rhythm in spacing, not uniform padding everywhere2373. Depth or layering through overlap, shadows, surfaces, or motion2384. Typography with character and a real pairing strategy2395. Colour used semantically, not just decoratively2406. Hover, focus, and active states that feel designed2417. Grid-breaking editorial or bento composition where appropriate2428. Texture, grain, or atmosphere when it fits the visual direction2439. Motion that clarifies flow instead of distracting from it24410. Data visualisation treated as part of the design system, not an afterthought245246Reference at least 2 real precedents (existing pages in the same product, or external products like Linear, Vercel, Stripe, Apple Newsroom, NYT Cooking, Things 3, etc.) and explain **what specifically** you are borrowing from each — not just "Linear" but "Linear's command-bar density and keyboard hint chips".247248Before moving to 5b, **self-audit**: open the design direction and ask "could a 2018 admin template ship this?" If yes, re-pick. If no, proceed.249250### 5b. Generate mockup artefact251252Produce a tangible artefact the user can eyeball **before** any production code is written. Pick the lightest form that conveys the design:253254| Artefact | When to use | Where it lives |255|---|---|---|256| HTML prototype (single file, Tailwind via CDN) | New surfaces, redesigns, exploration | `proposed-*.html` in repo root or `docs/mockups/` |257| Annotated component sketch in markdown | Small new components | Inline in the plan |258| Existing-page screenshot + redline overlay | Refreshes of existing pages | Attached to the plan |259| Storybook story (if Storybook is configured) | Component-level work | Storybook's tree |260261The mockup must show: hero state, loading state, empty state, error state, and at least one responsive breakpoint. **No placeholder lorem ipsum** — use realistic copy from the actual product domain.262263**Pre-approval self-check (run before presenting to user):**264265- [ ] Does the mockup avoid looking like a default Tailwind / shadcn / Material template?266- [ ] Are hover, focus, and active states drawn or specified — not implicit defaults?267- [ ] Is hierarchy expressed through scale contrast rather than uniform emphasis?268- [ ] Would this look believable in a real product screenshot, side-by-side with Linear, Vercel, Stripe?269- [ ] If the artefact supports both themes, do both light and dark feel deliberate?270- [ ] Does at least one element break the predictable grid (asymmetry, overlap, sidecar, marquee, etc.)?271272If any of the first four checkboxes is "no", **regenerate the mockup before going to 5c**. Do not present a mockup that fails these checks.273274### 5c. Mockup approval gate275276Present the mockup to the user. Wait for explicit approval (`yes` / `go on` / `approved`). Iterate on feedback **without** writing production code.277278**Do not skip this gate** even if the design feels obvious. If the user is in caveman mode and replies "yes", that is sufficient — but the gate must still be hit.279280### 5d. UI UX Pro Max refinement (if installed)281282If UI UX Pro Max is installed, invoke it to refine palette and typography against the direction approved in 5c. Treat its suggestions as **additive** — the user has already approved the direction in 5c, so UI UX Pro Max can suggest refinements (different palette token, better font pairing, tweaked spacing scale) but **cannot override the approved direction**. If UI UX Pro Max recommends a fundamental direction change, surface it to the user explicitly ("UI UX Pro Max suggests switching from editorial to brutalist because X. Stick with editorial, or pivot?") and wait for an answer.283284The maestro checklist in 5e remains the canonical gate (accessibility, responsive, loading/error states, etc.). Do not let UI UX Pro Max override checklist-level accessibility or state-coverage requirements.285286### 5e. Run UI/UX checklist against the approved mockup287288Read and run through `references/uiux-checklist.md` against the approved mockup (not against your imagination of the final UI).289290**This is not optional for frontend work.** Every frontend change that alters rendered output, even "just a small tweak", gets checked against the design system; test-only changes are exempt per the trigger matrix.291292**Key enforcement areas:**293- **Visual Design** — Tailwind tokens, spacing scale, typography, colour palette, dark mode294- **Accessibility (WCAG 2.1 AA)** — keyboard nav, focus, contrast, ARIA, semantic HTML, motion, touch targets295- **Component Patterns** — shadcn/ui, composition, loading/error/empty states, responsive296- **Performance** — CLS, image optimisation, client component boundaries, bundle impact297298Flag any checklist violations against the mockup, fix the mockup, re-confirm with the user, then proceed to Step 6.299300---301302## Step 6: SECURITY303304Read and run through `references/security-checklist.md` against the planned changes.305306**This applies to every task that touches:**307- API endpoints or middleware308- User input handling309- Database queries310- LLM calls (input sanitisation, output scanning)311- Authentication or authorisation312- File uploads or external data processing313314Flag any checklist violations in the plan and resolve them before proceeding to implementation.315316### Layered Defence with Security Guidance317318Maestro provides **two layers** of security enforcement:3193201. **Planning-time** (this step) — the security checklist catches architectural and design-level security issues *before* code is written3212. **Edit-time** (Security Guidance plugin) — a post-edit hook that automatically scans every code change for common vulnerability patterns as it lands322323**If the Security Guidance plugin is installed**, it runs automatically on every file edit. It detects:324- Command injection (`os.system()`, `subprocess` with shell=True, `child_process.exec()`)325- Code injection (`eval()`, `Function()` constructor, `vm.runInNewContext()`)326- XSS vectors (`dangerouslySetInnerHTML`, unsanitised template literals)327- Insecure deserialisation (`pickle.loads()`, `yaml.load()` without SafeLoader)328- Hardcoded secrets (API keys, tokens, passwords in source code)329330When a vulnerability is detected, the hook shows a warning with remediation advice after the edit lands: re-read the flagged file and remediate before continuing the TDD loop. This catches issues that pass checklist review but appear during implementation.331332**If the Security Guidance plugin is not installed:** This step still functions via the checklist alone. Note the missing plugin in your response so the user can install it for automated post-edit protection.333334---335336## Step 7: IMPLEMENT337338Invoke `superpowers:test-driven-development` to write tests first, then implementation.339340**Maestro additions on top of TDD:**341- **Decision ladder — run before implementing anything non-trivial**: does this need to exist at all (YAGNI) → is it already in this codebase (where existing candidates conflict, the pattern-conflict rule below decides) → does the stdlib do it → does a native platform feature cover it → does an installed dependency solve it → can it be one line → only then write the minimum that works. Question complexity instead of building it by default ("do you actually need X, or does Y cover it?"); no unrequested abstractions, no avoidable dependencies, fewest files. **The ladder governs how much implementation code gets written — it never relaxes a maestro gate**: Step 5's approved design (states, accessibility), Step 6 security (all input hostile, validate at every boundary), the mandatory pytest/Vitest suite with its security-focused tests, and type annotations all stand. If the ladder says a user-approved plan item should not exist, surface it and ask — never silently drop it. A `yagni:` comment marks an intentional ceiling and must name it (e.g. global lock, O(n²) scan, naive heuristic) plus the upgrade path; it is never cover for leaving TODO-quality gaps.342- Use the Context7 docs from step 2 when writing code — do not guess API signatures343- Follow **Google style guides** strictly (Python and TypeScript)344- **British English** in all prose, comments, commit messages, and documentation345- Type annotations everywhere (Python type hints, TypeScript types)346- No `any` types in TypeScript — use specific types347- `snake_case` for API interface fields (match backend FastAPI)348- **Surface pattern conflicts, don't blend them** — if two existing patterns in the codebase contradict (e.g. mixed error-handling, mixed state management, mixed naming conventions in adjacent modules), pick the more recent or more tested one, justify the choice in the PR description, and flag the other for cleanup in a follow-up. Blended code that satisfies both patterns is the worst outcome: it doubles the surface area to maintain and obscures the canonical pattern for future readers349- Every test file must include security-focused tests where applicable350351**For independent subtasks:** Use `superpowers:dispatching-parallel-agents` or `superpowers:subagent-driven-development` to parallelise work. Dispatch implementation subagents on `opus` per Model Routing — the plan already carries the judgement, and it was written on `opus` too. Escalate a subagent to `fable` only after two failed attempts on the same task.352353---354355## Step 8: VERIFY356357### Step 8.0: Evidence Gate (run before ANY completion language)358359Before writing "done/fixed/passing/works/verified" or any synonym:3601. Name the command or artefact that proves it.3612. Run it FRESH this message — no cached or prior runs.3623. Paste the actual output (or line/byte count, response, figures) inline.3634. No evidence ⇒ state UNVERIFIED + the missing check. Do not claim.3645. Update the evidence ledger: fill each gate's EVIDENCE from this message's fresh output; demote any gate that no longer passes; the final report names every unmet or abandoned gate with its reason, not only the ones that passed.365366Deliberately duplicates `superpowers:verification-before-completion` — the gate must be visible in the workflow, because the sub-skill only fires if invoked.367368Invoke `superpowers:verification-before-completion`.369370**Then run through `references/quality-gates.md`:**371372- [ ] Tests written and passing (pytest for Python, Vitest for TypeScript)373- [ ] Lint clean: `ruff check --fix .` (Python) / `npm run lint` (TypeScript)374- [ ] Format clean: `ruff format --check .` (Python) / `npx prettier --check .` (TypeScript)375- [ ] TypeScript clean: `npx tsc --noEmit` (zero errors)376- [ ] Solution justification documented (why, alternatives, trade-offs)377- [ ] British English verified in all new prose378- [ ] Imports verified — all exist, signatures match379- [ ] No regressions — read changed code once more before committing380381### Visual Verification with Playwright382383**Skip if:** No frontend files are touched, or no dev server is running.384385When frontend changes are involved and Playwright MCP is available, perform visual verification:3863871. **Ensure a dev server is running** — if not, suggest the user starts one (`npm run dev` or equivalent). Do not start one silently.3882. **Navigate to affected routes** — use Playwright to open each route that was changed or added3893. **Verify visual rendering** — check that the page renders without errors, layout is correct, and no elements are broken3904. **Test interactive elements** — click buttons, fill forms, toggle states that were changed3915. **Check responsive behaviour** — verify at key breakpoints (375px mobile, 768px tablet, 1280px desktop) if layout changes were made3926. **Verify accessibility** — use Playwright's accessibility tree to check for missing labels, broken focus order, or missing ARIA attributes3937. **Take screenshots** — capture before/after screenshots for the PR description if the change is visually significant394395**If Playwright MCP is not available:** Skip visual verification. Note the missing tool in your response so the user can install it. The remaining quality gates (tests, lint, types) still apply.396397**Do NOT claim work is done until every applicable gate passes.**398399---400401## Step 8.5: PRE-PR CODE REVIEW (Local Diff)402403**Skip if:** Classification = trivial config/docs change (e.g., one-line config tweak, comment fix, README typo).404405**Run for every other task — bug fixes included.** This step closes the gap between local correctness gates (Step 8) and the external PR review loop (Step 10). It is the user's "code review BEFORE PR creation" rule, made explicit and enforceable in the workflow. Catching maintainability and security issues here saves a full claude-review bot cycle on every PR.406407### Why a separate step408409Step 8 VERIFY enforces *correctness* (tests pass, types compile, lint clean). Step 10 REVIEW happens *after* the PR is open and runs against the merged-base diff. Neither covers the local pre-push window where a focused diff review prevents predictable bot rework. Step 8.5 owns that window.410411### What to dispatch412413Run as **parallel Agent calls** against the local diff (`git diff main...HEAD`, or `git diff` if work is uncommitted):414415| Agent | When to Dispatch | What It Checks |416|-------|------------------|----------------|417| `code-reviewer` | **Always** (non-trivial changes) | Project-convention adherence, design quality, dead code, naming, structure, error handling, test coverage gaps |418| `security-reviewer` | When the diff touches authentication, authorisation, user input, database queries, file uploads, LLM calls, secrets, or PII handling | OWASP Top 10, injection, XSS, CSRF, broken access control, sensitive data exposure, insecure deserialisation, audit logging gaps |419| Language-specific reviewer (`typescript-reviewer`, `python-reviewer`, `go-reviewer`, `rust-reviewer`, etc.) | When the diff is concentrated in one language and the corresponding agent is installed | Language-idiomatic issues, type safety, async correctness, language-specific footguns |420421For mixed-language diffs, dispatch the relevant per-language reviewers in parallel alongside `code-reviewer`. Do **not** serialise — run them in a single message with multiple Agent tool uses. Bare names here resolve per the agent precedence rule below; Step 10's `pr-review-toolkit:`-prefixed dispatches are a separate, namespaced set.422423**Model routing here:** dispatch the reviewer agents on `opus`; when their findings conflict, or a security-reviewer/SkillSpector verdict needs adjudication, the final judgement call runs on `fable` (generator/judge asymmetry — see Model Routing).424425### Severity thresholds426427After collecting findings:428429| Severity | Action |430|----------|--------|431| CRITICAL | **Block** — fix before Step 9. No exceptions. |432| HIGH | **Block** — fix before Step 9. No exceptions. |433| MEDIUM | **Fix where practical** in this step. If deferred, document why in the PR description. |434| LOW / nit | **Fix opportunistically.** Do not block on these — Step 10 will catch any that genuinely matter. |435436### Loop until clean4374381. Dispatch reviewers in parallel4392. Collect all findings4403. Fix CRITICAL + HIGH4414. Fix MEDIUM where practical4425. Re-run only the agents whose scope was affected by the fixes4436. Repeat until CRITICAL + HIGH are clear444445**Then proceed to Step 9 FINISH.** Do not commit-and-push without this step passing on non-trivial changes — it is the cheapest place to catch issues before they cost a bot review cycle.446447### Supply-chain scan — SkillSpector (conditional)448449**Run only if** the diff adds or modifies an *agent artefact* — a skill (`SKILL.md`), a plugin manifest, or an MCP server config. **Skip entirely** for ordinary feature/bug-fix diffs (React, Python, app code): SkillSpector is not a code scanner and will only add noise.450451**Why it is separate from the agents above:** the code-review agents check *your* code. SkillSpector checks the *skill supply chain* — prompt injection, agent-config snooping, MCP rug-pull, excessive agency, malicious or vulnerable skill instructions — a surface the code reviewers do not cover.452453**Process:**4544551. Call `scan_skill(<path-to-changed-artefact>, use_llm=false)` on each changed skill/plugin/MCP artefact — static-only, no API key required.4562. SkillSpector returns candidate findings. **It over-flags:** teaching-skills, session observers, and security skills routinely trip its regex on benign guideline text and defensive code — e.g. a PID-validation guard, a mobile UX guideline about gesture conflicts, or a React XSS anti-pattern shown as a "don't do this" example.4573. **Claude adjudicates every HIGH/CRITICAL finding** — read the flagged `file:line` and rule real-vs-false-positive. Do **not** accept the raw `DO_NOT_INSTALL` verdict; it is a static heuristic that cannot judge intent.4584. **Gate:** a Claude-**confirmed** CRITICAL/HIGH (not a raw-static flag) → block, surface the real issue, fix or reject before Step 9. Findings Claude clears as false positives → note and proceed. **MEDIUM/LOW** findings → note in the PR description if plausibly real; otherwise disregard (static-only MEDIUM/LOW on a trusted artefact is almost always guideline-text or defensive-code noise).459460Do **not** rely on SkillSpector's own LLM pass (it needs a provider key). Claude is the semantic judge — keyless, no recurring cost, fuller repo context.461462### When the reviewer agents are unavailable463464If `code-reviewer` and language-specific reviewers are not available in the current environment:465- Perform a **manual self-review** — read every changed file end-to-end against the user's CLAUDE.md, the project's coding-style rules, and the security checklist from Step 6466- Note the missing agents in your response so the user can install the corresponding source (`pr-review-toolkit` ships the `code-reviewer` class; `security-reviewer` and the language reviewers come from user-scope agent packs such as Everything Claude Code)467- Do **not** skip the step entirely — manual review is the fallback, not skipping468469---470471## Step 9: FINISH472473Invoke `superpowers:finishing-a-development-branch`.474475**Maestro rules:**476- **Never push directly to main.** Always create a branch and PR.477- Commit messages use conventional format: `fix:`, `feat:`, `refactor:`, `docs:`, `style:`, `test:`478- Git operations are auto-approved — do not ask for confirmation to commit, push, or create PRs.479480---481482## Step 10: REVIEW483484After creating the PR, run a **two-phase review process**: specialist agent analysis followed by the PR review polling loop.485486### Phase 1: Specialist Agent Analysis (PR Review Toolkit)487488Dispatch the relevant specialist agents from the PR Review Toolkit in parallel. Select agents based on what the PR contains:489490| Agent | When to Dispatch | What It Checks |491|-------|-----------------|----------------|492| `pr-review-toolkit:code-reviewer` | **Always** | Adherence to project guidelines, style, patterns |493| `pr-review-toolkit:silent-failure-hunter` | **Always** — any PR can introduce silent failures | Swallowed errors, empty catch blocks, inappropriate fallbacks, missing error propagation |494| `pr-review-toolkit:pr-test-analyzer` | **Always** | Test coverage gaps, missing edge cases, critical untested paths |495| `pr-review-toolkit:code-simplifier` | When implementation is complex or touches multiple files | Unnecessary complexity, redundant code, simplification opportunities |496| `pr-review-toolkit:type-design-analyzer` | When new types/interfaces are introduced | Type encapsulation, invariant expression, design quality |497| `pr-review-toolkit:comment-analyzer` | When docstrings or documentation comments are added/modified | Comment accuracy, staleness risk, maintainability |498499**Process:**5001. Determine which agents are relevant based on the PR diff5012. Dispatch all relevant agents **in parallel** using the Agent tool (on `opus` per Model Routing)5023. Collect findings from all agents — when specialists disagree, arbitrate the conflict on `fable`5034. Fix any issues flagged by the agents — commit and push5045. Re-run any agents whose scope was affected by the fixes (if needed)505506### Phase 2: PR Review Polling Loop507508After specialist analysis is clean, enter the external review loop:5095101. Poll GitHub every 4 minutes using `gh pr checks` and `gh api` to read review comments5112. If the review has **any** issues (suggestions, warnings, nits, dead code findings, errors):512 - Fix them513 - Commit and push514 - Continue polling5153. Only stop when the review is **fully clean** — approved with zero outstanding comments5164. Report the final clean status to the user517518**Precondition:** first check whether an external reviewer or review bot is configured (`gh pr checks`, a prior PR's timeline). If none exists, Phase 2's terminal state is **CI green**: say no reviewer is configured, stop polling once checks pass, and record that as the clean status. Never poll for an approval that cannot arrive.519520### When PR Review Toolkit Is Unavailable521522If the PR Review Toolkit agents are not available, skip Phase 1 and proceed directly to Phase 2 (the polling loop). Note the missing toolkit in your response.523524---525526## Orchestration Rules527528### Always Enforce (Every Task)5295301. **Plan first** — never write code without a plan (exception: trivial one-liners)5312. **Tests are mandatory** — every code change ships with tests, no exceptions5323. **Solution justification** — every approach must explain why, alternatives, and trade-offs5334. **British English** — in all responses, comments, commits, and documentation5345. **Security-first** — assume all input is hostile, validate at every boundary5356. **Never push to main** — always branch + PR536537### Self-Critique Protocol538539After designing any solution, before presenting it:5401. Ask "what's wrong with this?" — find at least 2 weaknesses5412. State the impact of each weakness5423. Explain why the approach is still the best option despite them (or revise)543544### Progress Protocol (responses inside a multi-step flow)545546Applies once CLASSIFY names a step set with more than one step left, and stops when the final step closes — never on trivial single-step tasks or conversational turns. The reader cannot hold flow position between messages, so each response carries it:5475481. **Open with flow position** — name the step and its state: "Step 5 (UI/UX gate) — blocked on your mockup approval." No total and no percentage: the step set varies by classification, and Step 8.5 makes any fixed denominator wrong. Name the stage instead on the Deliverable flow. Response order is position, then evidence, then prose.5492. **Leave at most one open ask** — 5c is the usual case. If two gates come due together, present both and rank them; **never drop one to satisfy this rule.** A question may be deferred, never suppressed. Most steps need nothing from the user and git operations are auto-approved, so when no action is due, close by naming the step you are moving to.5503. **Evidence above justification** — Step 8.0 already forces a fresh command run; put its output above the justification prose, not below. The justification still ships in full.5514. **No wall-clock estimates** — a duration is a guess dressed as a figure, and nothing here can check it. State steps or gates remaining. A fixed cadence, like Step 10's four-minute poll, is a schedule and fine to quote.552553Governs **reporting order and ask count only.** Never truncates a checklist, drops a justification, or suppresses a gate's question.554555…(truncated)
Run npx skillmds@latest add impravin22/maestro in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Use at the start of every task — master orchestrator that classifies work, routes it to the right domain pack (engineering, documents, brand, marketing, social, finance, small business, legal, leadership) and the right model tier (Opus by default, Fable reserved for adjudication), fetches live docs via Context7, gates frontend work behind an anti-template design mockup, enforces layered security (OWASP + edit scanning + supply-chain skill vetting), verifies visually via Playwright, reviews deeply before and after the PR, and orchestrates superpowers skills in the correct order It is listed under Marketing & Growth on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
impravin22 (@impravin22) published this skill. Their other Agent Skills are listed on their SkillMD profile.