# nanako0129/pilotfish architecture

> Architecture diagram of the GitHub repository nanako0129/pilotfish, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nanako0129/pilotfish
- Repository: https://github.com/nanako0129/pilotfish

## Overview

pilotfish is a Claude Code orchestration policy and Plugin. The main session selects an interaction shape, plans and retains approval/integration responsibility, then delegates bounded work to role agents; independent reviewers challenge plans or verify outcomes. The Plugin packages the policy and roles and uses SessionStart hooks for ambient activation. Edges follow the README’s documented lifecycle; source excerpts are limited, so implementation-level hook behavior and other unshown connections are not inferred.

Main entry points: [`templates/claude-md.orchestration.md`](https://github.com/nanako0129/pilotfish/blob/main/templates/claude-md.orchestration.md) (Orchestrator), [`templates/agents/verifier.md`](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/verifier.md) (Verifier), [`templates/agents/plan-verifier.md`](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/plan-verifier.md) (Plan verifier), [`templates/agents/security-reviewer.md`](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/security-reviewer.md) (Security reviewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Main orchestration"]
  node_session["Main session"]
  node_shape["Interaction shape"]
  node_orchestrator["Orchestrator"]
end

subgraph group_roles["Delegated roles"]
  node_scout["Scout<br/>[scout.md]"]
  node_planverifier["Plan verifier<br/>[plan-verifier.md]"]
  node_securityreviewer["Security reviewer"]
  node_mech["Mechanical executor<br/>[mech-executor.md]"]
  node_executor["Executor<br/>[executor.md]"]
  node_securityexecutor["Security executor"]
  node_verifier["Verifier<br/>[verifier.md]"]
end

subgraph group_plugin["Plugin activation"]
  node_pluginhook["SessionStart hook"]
  node_hookconfig["Hook registration<br/>[hooks.json]"]
end

subgraph group_policy["Policy assets"]
  node_ambient["Ambient policy<br/>[ambient.md]"]
  node_sessionpolicy["SessionStart policy<br/>[sessionstart.txt]"]
end

node_user(("User"))
node_claude["Claude Code"]

node_user -->|"initiates"| node_session
node_session -->|"selects shape"| node_shape
node_shape -->|"guides collaboration"| node_orchestrator
node_orchestrator -->|"dispatches reconnaissance"| node_scout
node_orchestrator -->|"requests plan challenge"| node_planverifier
node_planverifier -->|"returns verdict"| node_orchestrator
node_orchestrator -->|"requests evidence"| node_securityreviewer
node_securityreviewer -->|"returns review"| node_orchestrator
node_orchestrator -->|"delegates mechanical work"| node_mech
node_orchestrator -->|"delegates judgment work"| node_executor
node_orchestrator -->|"delegates approved work"| node_securityexecutor
node_mech -->|"requests verification"| node_verifier
node_executor -->|"requests verification"| node_verifier
node_securityexecutor -->|"requests verification"| node_verifier
node_verifier -->|"returns verdict"| node_orchestrator
node_claude -->|"loads Plugin hooks"| node_hookconfig
node_hookconfig -.->|"registers command"| node_pluginhook
node_pluginhook -.->|"activates policy"| node_sessionpolicy
node_ambient -->|"provides Plugin policy"| node_session

click node_session "https://github.com/nanako0129/pilotfish/blob/main/templates/claude-md.orchestration.md"
click node_shape "https://github.com/nanako0129/pilotfish/blob/main/templates/claude-md.orchestration.md"
click node_orchestrator "https://github.com/nanako0129/pilotfish/blob/main/templates/claude-md.orchestration.md"
click node_scout "https://github.com/nanako0129/pilotfish/blob/main/templates/agents/scout.md"
click node_planverifier "https://github.com/nanako0129/pilotfish/blob/main/templates/agents/plan-verifier.md"
click node_securityreviewer "https://github.com/nanako0129/pilotfish/blob/main/templates/agents/security-reviewer.md"
click node_mech "https://github.com/nanako0129/pilotfish/blob/main/templates/agents/mech-executor.md"
click node_executor "https://github.com/nanako0129/pilotfish/blob/main/templates/agents/executor.md"
click node_securityexecutor "https://github.com/nanako0129/pilotfish/blob/main/templates/agents/security-executor.md"
click node_verifier "https://github.com/nanako0129/pilotfish/blob/main/templates/agents/verifier.md"
click node_pluginhook "https://github.com/nanako0129/pilotfish/blob/main/plugin/hooks/emit-sessionstart.sh"
click node_hookconfig "https://github.com/nanako0129/pilotfish/blob/main/plugin/hooks/hooks.json"
click node_ambient "https://github.com/nanako0129/pilotfish/blob/main/plugin/policy/ambient.md"
click node_sessionpolicy "https://github.com/nanako0129/pilotfish/blob/main/plugin/policy/sessionstart.txt"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_session,node_shape,node_orchestrator,node_user toneBlue
class node_scout,node_planverifier,node_securityreviewer,node_mech,node_executor,node_securityexecutor,node_verifier toneAmber
class node_pluginhook,node_hookconfig toneMint
class node_ambient,node_sessionpolicy toneRose
class node_claude toneIndigo
```

## Components

### Main orchestration

- [Main session](https://github.com/nanako0129/pilotfish/blob/main/templates/claude-md.orchestration.md): `templates/claude-md.orchestration.md`
- [Interaction shape](https://github.com/nanako0129/pilotfish/blob/main/templates/claude-md.orchestration.md): `templates/claude-md.orchestration.md`
- [Orchestrator](https://github.com/nanako0129/pilotfish/blob/main/templates/claude-md.orchestration.md): `templates/claude-md.orchestration.md`

### Delegated roles

- [Scout](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/scout.md): `templates/agents/scout.md`
- [Plan verifier](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/plan-verifier.md): `templates/agents/plan-verifier.md`
- [Security reviewer](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/security-reviewer.md): `templates/agents/security-reviewer.md`
- [Mechanical executor](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/mech-executor.md): `templates/agents/mech-executor.md`
- [Executor](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/executor.md): `templates/agents/executor.md`
- [Security executor](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/security-executor.md): `templates/agents/security-executor.md`
- [Verifier](https://github.com/nanako0129/pilotfish/blob/main/templates/agents/verifier.md): `templates/agents/verifier.md`

### Plugin activation

- [SessionStart hook](https://github.com/nanako0129/pilotfish/blob/main/plugin/hooks/emit-sessionstart.sh): `plugin/hooks/emit-sessionstart.sh`
- [Hook registration](https://github.com/nanako0129/pilotfish/blob/main/plugin/hooks/hooks.json): `plugin/hooks/hooks.json`

### Policy assets

- [Ambient policy](https://github.com/nanako0129/pilotfish/blob/main/plugin/policy/ambient.md): `plugin/policy/ambient.md`
- [SessionStart policy](https://github.com/nanako0129/pilotfish/blob/main/plugin/policy/sessionstart.txt): `plugin/policy/sessionstart.txt`

### Other components

- **User**
- **Claude Code**

## Connections

- User → Main session: initiates (evidence: `README.md`)
- Main session → Interaction shape: selects shape (evidence: `README.md`)
- Interaction shape → Orchestrator: guides collaboration (evidence: `README.md`)
- Orchestrator → Scout: dispatches reconnaissance (evidence: `README.md`)
- Orchestrator → Plan verifier: requests plan challenge (evidence: `README.md`)
- Plan verifier → Orchestrator: returns verdict (evidence: `README.md`)
- Orchestrator → Security reviewer: requests evidence (evidence: `README.md`)
- Security reviewer → Orchestrator: returns review (evidence: `README.md`)
- Orchestrator → Mechanical executor: delegates mechanical work (evidence: `README.md`)
- Orchestrator → Executor: delegates judgment work (evidence: `README.md`)
- Orchestrator → Security executor: delegates approved work (evidence: `README.md`)
- Mechanical executor → Verifier: requests verification (evidence: `README.md`)
- Executor → Verifier: requests verification (evidence: `README.md`)
- Security executor → Verifier: requests verification (evidence: `README.md`)
- Verifier → Orchestrator: returns verdict (evidence: `README.md`)
- Claude Code → Hook registration: loads Plugin hooks (evidence: `README.md`)
- Hook registration → SessionStart hook: registers command
- SessionStart hook → SessionStart policy: activates policy
- Ambient policy → Main session: provides Plugin policy (evidence: `README.md`)
