# metafloor-ai/metafloor-scm-plugin architecture

> Architecture diagram of the GitHub repository metafloor-ai/metafloor-scm-plugin, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/metafloor-ai/metafloor-scm-plugin
- Repository: https://github.com/metafloor-ai/metafloor-scm-plugin

## Overview

MetaFloor is a Claude Code plugin combining supply-chain expertise with a deterministic policy gate; it does not provide connectors or execute their operations. Users consult vendor or workflow skills, while consequential connector calls enter through the PreToolUse hook for classification, autonomy resolution, a decision, and audit/state updates. The README documents the broader skills and review-agent capabilities. The graph follows shown source calls and explicit README relationships; unsampled skill behavior is represented at directory level, not inferred in detail.

Main entry points: [`core/hook.py`](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/hook.py) (Policy orchestrator), [`agents`](https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/agents) (Review agents), [`skills/business-workflows`](https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/skills/business-workflows) (Decision workflows), [`core/autonomy.py`](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/autonomy.py) (Autonomy dial)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_expertise["Operator expertise"]
  node_vendor_skills["System expertise"]
  node_workflow_skills["Decision workflows"]
  node_gating_guide["Action classification guide"]
end

subgraph group_policy["Safety policy"]
  node_hook["Policy orchestrator<br/>[hook.py]"]
  node_registry[("Tool registry<br/>[registry.py]")]
  node_autonomy["Autonomy dial<br/>[autonomy.py]"]
  node_session[("Workflow session state<br/>[session.py]")]
  node_gate["Deterministic gate<br/>[gate.py]"]
  node_values["Value extraction<br/>[values.py]"]
  node_audit[("Hash-chained audit<br/>[audit.py]")]
  node_autonomy_config["Shipped dial defaults"]
end

subgraph group_plugin["Claude Code interface"]
  node_commands["Operator commands"]
  node_pretool["PreToolUse entry<br/>[pretooluse.py]"]
end

subgraph group_review["Independent review"]
  node_agents["Review agents"]
  node_review_decision["Decision reviewer"]
  node_review_scope["Scope auditor<br/>[scope-auditor.md]"]
  node_review_genealogy["Genealogy tracer"]
  node_review_reconcile["Cross-system reconciler"]
end

node_operator(("Supply-chain operator"))
node_claude["Claude Code"]
node_connector["Customer connectors"]

node_operator -->|"asks"| node_claude
node_claude -->|"consults"| node_vendor_skills
node_claude -->|"consults"| node_workflow_skills
node_workflow_skills -->|"references"| node_gating_guide
node_claude -->|"delegates"| node_agents
node_agents -->|"includes"| node_review_decision
node_agents -->|"includes"| node_review_scope
node_agents -->|"includes"| node_review_genealogy
node_agents -->|"includes"| node_review_reconcile
node_operator -->|"runs"| node_commands
node_claude -->|"executes via"| node_connector
node_connector -->|"triggers"| node_pretool
node_pretool -->|"evaluates event"| node_hook
node_hook -->|"classifies with"| node_registry
node_hook -->|"resolves level"| node_autonomy
node_hook -->|"reads and updates"| node_session
node_hook -->|"requests decision"| node_gate
node_hook -->|"extracts values"| node_values
node_hook -->|"appends decision"| node_audit
node_gate -->|"extracts limits"| node_values
node_autonomy -->|"loads defaults"| node_autonomy_config

click node_vendor_skills "https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/skills/platforms"
click node_workflow_skills "https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/skills/business-workflows"
click node_gating_guide "https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/skills/gating/supply-chain-gating"
click node_commands "https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/commands"
click node_agents "https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/agents"
click node_review_decision "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/decision-reviewer.md"
click node_review_scope "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/scope-auditor.md"
click node_review_genealogy "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/genealogy-tracer.md"
click node_review_reconcile "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/cross-system-reconciler.md"
click node_pretool "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/hooks/pretooluse.py"
click node_hook "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/hook.py"
click node_registry "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/registry.py"
click node_autonomy "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/autonomy.py"
click node_session "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/session.py"
click node_gate "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/gate.py"
click node_values "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/values.py"
click node_audit "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/audit.py"
click node_autonomy_config "https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/config/autonomy.default.yaml"

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_vendor_skills,node_workflow_skills,node_gating_guide toneBlue
class node_hook,node_registry,node_autonomy,node_session,node_gate,node_values,node_audit,node_autonomy_config toneAmber
class node_commands,node_pretool toneMint
class node_agents,node_review_decision,node_review_scope,node_review_genealogy,node_review_reconcile toneRose
class node_operator,node_claude,node_connector toneIndigo
```

## Components

### Operator expertise

- [System expertise](https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/skills/platforms): `skills/platforms`
- [Decision workflows](https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/skills/business-workflows): `skills/business-workflows`
- [Action classification guide](https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/skills/gating/supply-chain-gating): `skills/gating/supply-chain-gating`

### Safety policy

- [Policy orchestrator](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/hook.py): `core/hook.py`
- [Tool registry](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/registry.py): `core/registry.py`
- [Autonomy dial](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/autonomy.py): `core/autonomy.py`
- [Workflow session state](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/session.py): `core/session.py`
- [Deterministic gate](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/gate.py): `core/gate.py`
- [Value extraction](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/values.py): `core/values.py`
- [Hash-chained audit](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/core/audit.py): `core/audit.py`
- [Shipped dial defaults](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/config/autonomy.default.yaml): `config/autonomy.default.yaml`

### Claude Code interface

- [Operator commands](https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/commands): `commands`
- [PreToolUse entry](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/hooks/pretooluse.py): `hooks/pretooluse.py`

### Independent review

- [Review agents](https://github.com/metafloor-ai/metafloor-scm-plugin/tree/main/agents): `agents`
- [Decision reviewer](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/decision-reviewer.md): `agents/decision-reviewer.md`
- [Scope auditor](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/scope-auditor.md): `agents/scope-auditor.md`
- [Genealogy tracer](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/genealogy-tracer.md): `agents/genealogy-tracer.md`
- [Cross-system reconciler](https://github.com/metafloor-ai/metafloor-scm-plugin/blob/main/agents/cross-system-reconciler.md): `agents/cross-system-reconciler.md`

### Other components

- **Supply-chain operator**
- **Claude Code**
- **Customer connectors**

## Connections

- Supply-chain operator → Claude Code: asks (evidence: `README.md`)
- Claude Code → System expertise: consults (evidence: `README.md`)
- Claude Code → Decision workflows: consults (evidence: `README.md`)
- Decision workflows → Action classification guide: references (evidence: `README.md`)
- Claude Code → Review agents: delegates (evidence: `README.md`)
- Review agents → Decision reviewer: includes (evidence: `README.md`)
- Review agents → Scope auditor: includes (evidence: `README.md`)
- Review agents → Genealogy tracer: includes (evidence: `README.md`)
- Review agents → Cross-system reconciler: includes (evidence: `README.md`)
- Supply-chain operator → Operator commands: runs (evidence: `README.md`)
- Claude Code → Customer connectors: executes via (evidence: `README.md`)
- Customer connectors → PreToolUse entry: triggers (evidence: `README.md`)
- PreToolUse entry → Policy orchestrator: evaluates event (evidence: `hooks/pretooluse.py`)
- Policy orchestrator → Tool registry: classifies with (evidence: `core/hook.py`)
- Policy orchestrator → Autonomy dial: resolves level (evidence: `core/hook.py`)
- Policy orchestrator → Workflow session state: reads and updates (evidence: `core/hook.py`)
- Policy orchestrator → Deterministic gate: requests decision (evidence: `core/hook.py`)
- Policy orchestrator → Value extraction: extracts values (evidence: `core/hook.py`)
- Policy orchestrator → Hash-chained audit: appends decision (evidence: `core/hook.py`)
- Deterministic gate → Value extraction: extracts limits (evidence: `core/gate.py`)
- Autonomy dial → Shipped dial defaults: loads defaults (evidence: `core/autonomy.py`)
