You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-2Lines changed: 10 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ It keeps them in sync continuously.
97
97
|**Reconciled**| Design overrides, code markers, AST values, and defaults are merged with explicit precedence: `override > marker > ast > code`. |
98
98
|**Auditable**| Every operation produces artifacts. Every decision is traceable. CI gates enforce drift thresholds. |
99
99
|**Safe**| Dry-run by default. Opt-in writes. Echo suppression prevents feedback loops. Rollback previews before destructive changes. |
100
-
|**Read-only adapters**| External integrations (e.g., Figma MCP, Storybook) are read-only with default-deny tool policies. Adapters are classified by surface type, access mode, authority role, and stability. AF is the only mutation authority. |
100
+
|**Read-only adapters**| External integrations (Figma MCP, Storybook MCP) are read-only with default-deny tool policies. Adapters are classified by surface type, access mode, authority role, and stability. AF is the only mutation authority. |
101
101
102
102
### How It Differs From…
103
103
@@ -106,6 +106,7 @@ It keeps them in sync continuously.
106
106
|**Prompt-to-code** (v0, Bolt, etc.) | AF doesn't generate code from designs. It *reconciles* code and design as a continuous system. |
107
107
|**Design token export** (Style Dictionary, etc.) | AF goes beyond tokens — it syncs component structure, variants, states, and properties bidirectionally. |
108
108
|**MCP integrations** (figma-console-mcp, etc.) | AF uses MCP as a *read-only data source*, never as a mutation path. AF's control plane is watcher → server → plugin. |
109
+
|**Storybook MCP** (@storybook/addon-mcp) | AF connects to Storybook's MCP endpoint to read component metadata for cross-surface drift analysis — it does not run or control Storybook. |
109
110
|**Figma plugins** (code-gen plugins) | AF's plugin is a *mutation executor*, not a decision-maker. Reconciliation happens in the watcher. |
110
111
111
112
## Architecture
@@ -200,6 +201,7 @@ Available profiles: `designer-first`, `code-first`, `balanced`, `strict-review`.
@@ -21,6 +22,51 @@ AF uses design adapters to read data from external design systems. Adapters are
21
22
- The MCP adapter validates tool names against an allow-list before every call
22
23
- Blocked tools are rejected with a descriptive error, never silently dropped
23
24
25
+
## Storybook MCP Adapter (Phase 16C)
26
+
27
+
The Storybook MCP adapter connects to `@storybook/addon-mcp` running inside a local Storybook dev server. It enables **cross-surface drift analysis** — comparing component metadata across Figma, Storybook, and code AST.
28
+
29
+
### Transport
30
+
31
+
Connects via HTTP to the Storybook dev server's `/mcp` endpoint (not stdio). Falls back to direct HTTP (`/manifests/components.json`) if MCP is unavailable.
|`http-fallback`| Server up, MCP unavailable | Reduced: component metadata from manifest only |
39
+
|`unavailable`| Server unreachable | None — `isAvailable()` returns false |
40
+
41
+
The capability manifest (`getCapabilities()`) reflects the actual operating mode. MCP-only capabilities (e.g., `readScreenshots`) report `false` in HTTP-fallback mode.
The adapter validates that the Storybook instance is React-based. Non-React frameworks (Vue, Angular, Svelte) cause `isAvailable()` to return `false` with an explicit error.
60
+
61
+
### Cross-Surface Drift Analysis
62
+
63
+
The `af design drift` command compares component data across available surfaces:
64
+
-**Figma** — variants, properties from Figma adapter
65
+
-**Storybook** — props, stories, variant axes from Storybook MCP
66
+
-**Code** — props, union types from AST analysis
67
+
68
+
Drift findings use **corroboration rules** to filter noise: a story-derived variant is only reported if (1) the variant axis maps to a real prop, (2) the value appears in the prop's type definition. Findings carry `confidence: 'high'` (constrained union match) or `'low'` (unconstrained type like `string`).
69
+
24
70
## Detailed Reference
25
71
26
-
The full adapter model, including MCP transport configuration, tool policies, and Phase 16A/16B implementation details, is documented in [architecture-reference.md](architecture-reference.md).
72
+
The full adapter model, including MCP transport configuration, tool policies, and Phase 16A/16B/16C implementation details, is documented in [architecture-reference.md](architecture-reference.md).
0 commit comments