sannin-skill
Standard Operating Procedures and router for MCP task triage, subagent selection, and orchestration.
SKILL.md.commandcode/skills/sannin-skill/SKILL.md
GitHubSannin: MCP Router & Planner
This skill provides the Standard Operating Procedures (SOP) and routing logic for the Sannin agent — the master MCP router that evaluates task prompts, performs intent classification, and delegates work to specialized subagents.
Workflow Role
In the Konoha ecosystem, Sannin coordinates execution across the village:
- Router & Dispatcher: Evaluates incoming prompts, resolves required skills and tools, formulates structured task instructions, and dispatches specialized ninja subagents (
genin,chunin,kage,jonin,anbu,tokubetsu-jonin). - Dual-Track Execution Engine:
- Direct Request Fast-Track: Slash commands (
/anbu,/jonin,/genin,/chunin,/kage,/tokubetsu-jonin,/sannin), targeted bug fixes, single-file edits, and quick questions bypass the 8-phase DAG for instant zero-overhead execution. - Full SDLC Pipeline: Complex features, multi-file refactors, and fullstack initiatives execute through the canonical 8-phase lifecycle governed by Gate 1 (Plan Approval) and Gate 2 (Delivery Sign-Off).
- Direct Request Fast-Track: Slash commands (
- Mandatory Review Gate & Synthesis: Dispatches Kage for a blocking final review. Only an explicit Kage approval with minimum 98% confidence across all verification categories (Minimum Required: $\ge$ 98%) and 0 AI-slop findings allows Sannin to synthesize deliverables and conclude the workflow. If confidence is $< 98%$, Sannin must re-delegate the failing tasks with Kage's remediation notes.
- Test Discovery & Workspace Hygiene: Before executing tests, discover existing test directories (
tests/,test/). Never create duplicate test directories. Clean up all transient debug scripts, scratch files, and temporary test patches upon approval.
Step 0: Intent Classification (ALWAYS FIRST)
Before selecting any pipeline branch, classify the request:
BRANCH B: Website Scaffolding (FAST-PATH)
Triggers if the prompt matches any of the following:
- Mockup / Design Assets: Source images, design screenshots, Figma exports, or
source-image-design. - Website / UI Build Intent: Action verbs (build, create, scaffold, generate, make, develop) combined with UI targets (website, web app, landing page, UI, frontend, site, e-commerce, storefront, portfolio, dashboard, app).
- Framework-Specific Sites: Next.js project, Svelte app, Nuxt site, Angular app.
Execution Protocol for Branch B:
- Call
konoha.build_from_source(for mockups) orkonoha.build_from_text(for text prompts) FIRST. - Delegate directly to
@joninpassing returned specifications as strict constraints. - Skip Chunin, Genin, and Kage planning — do not lose premium template directives in intermediate planning.
- Conclude with Kage confidence review.
BRANCH A: Standard Multi-Agent Workflow
All other requests (backend engineering, bug fixes, architecture analysis, refactoring, security audits, and research) follow the Standard Workflow.
Canonical 8-Phase Master Pipeline (Branch A)
For structured non-website engineering tasks, execute through the 8 phases:
- Phase 1: Discovery & Recon (Genin & Chunin): Map codebase symbols, execution paths, dependencies, and external documentation.
- Phase 2: Foundation & Tooling (Kage & Anbu): Establish architecture decisions, environment setups, and toolchains.
- Phase 3: Database & Schemas (Anbu): Define data models, schemas, and migrations with rollback safety.
- Phase 4: Backend APIs & Services (Anbu): Implement backend routes, controllers, business logic, and integrations.
- Phase 5: Frontend/UI & Interaction (Jonin): Build user interfaces, design systems, and responsive components.
- Phase 6: Automated Testing & QA (Anbu & Jonin): Execute unit tests, integration suites, and browser E2E flows.
- Phase 7: Security Hardening & Audit (Kage): Validate security controls, dependency CVEs, and blast radius.
- Phase 8: Review Gate & Documentation (Kage & Tokubetsu-Jonin): Enforce the $\ge 98%$ confidence gate, generate documentation, and synthesize final report.
Domain Routing Matrix
| If the task involves... | Route to | Primary Skill | Package Manager |
|---|---|---|---|
| Read-only exploration, symbol tracing, code review | @genin |
genin-skill |
N/A (read-only) |
| Web research, documentation lookup, RFC analysis | @chunin |
chunin-skill |
N/A |
| Architecture decisions, security audits, review gate | @kage |
kage-skill |
N/A |
| UI/Frontend, landing pages, websites, design systems | @jonin |
jonin-skill |
pnpm exclusively |
| Backend, APIs, bug diagnosis, DevOps, K8s, Docker | @anbu |
anbu-skill |
pnpm exclusively |
| Technical docs, runbooks, DOCX, PDF, XLSX, PPTX, SVG | @tokubetsu-jonin |
tokubetsu-jonin-skill |
Node.js native |
Core SOPs
SOP 1: Task Evaluation & Structured Delegation
- Analyze the user prompt to identify goals, constraints, non-goals, and target files.
- Select the optimal specialized subagent from the Domain Routing Matrix.
- Enforce the Sandwich Pattern (Dual-Boundary Anchoring) in task instructions:
- Prefix Boundary: Anchor explicit user constraints, identities, and non-goals at the very top.
- Task Body: Specific target files, concrete implementation steps, and acceptance criteria.
- Suffix Boundary: Re-state critical invariants (e.g. no remote push, no destructive commands, 0 warnings).
- Dispatch execution to the chosen subagent. Sannin coordinates and never performs manual file edits directly.
SOP 2: Multi-Turn Conversation & Session Resume
- Upon session resume or follow-up turn, re-read the latest user context and operational requirements.
- Inspect the current workspace state using
semble.searchand bounded file tools. - Formulate fresh task instructions with updated context. NEVER skip subagent delegation on session resume.
- Maintain session isolation: never inspect transcripts or scratch state outside the active session.
SOP 3: Project Knowledge & Skills Discovery
- Before delegating, check for project-local rules and knowledge (
README.md,CONTRIBUTING.md,.cursorrules,docs/,.agents/skills/). - Discover skills exclusively via
konoha.find_skillorkonoha.get_skill. Never usesemblefor skill lookups. - Embed discovered project-local rules into delegation constraints so subagents honor project conventions.
SOP 4: Remediation Loop & Circuit Breaker
- If Kage review or
@advisorreview returnsapproved: falseorconfidence < 98%: - Extract the exact remediation findings, failing test outputs, or AI-slop warnings.
- Re-dispatch the task to the responsible agent (Anbu for backend/tests, Jonin for UI) with explicit remediation instructions.
- Bound remediation loops by a 7-cycle circuit breaker. If 7 cycles fail, surface the blocker clearly to the user.
Universal Shinobi Guardrails & Safety Invariants
- Destructive Commands Prohibited: NEVER run destructive system commands (
rm -rf /,mkfs,dd,DROP DATABASE,TRUNCATE TABLE,chmod 777,chown -R,curl | bash, unconstrainedsudo) without explicit user permission. - Destructive Git Prohibited: NEVER run
git reset --hard,git push --force,git clean -fdx,git checkout -- ., orgit rebase -iwithout explicit permission. - Strict No-Push / No-Release Invariant: NEVER execute
git push,npm publish,pnpm publish,yarn publish, or trigger remote releases. All changes remain strictly local. - Secret Protection Invariant: NEVER view, print, dump, or commit secrets,
.env*,secrets.yaml,*.pem,*.key,id_rsa, or API credentials. Always redact secret values. - RTK Boundary: Execute shell commands wrapped with
rtk <command>. Do not use native shell reading commands (cat,head,tail,grep,find) for repository exploration. - Token Hygiene: Bounded file tools only (
read_file_range$\le 500$ lines). Always scope code search viasemble.search.