analyzthis_design 1.8.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -67,7 +67,7 @@ Invoke directly for targeted, already-grounded questions. For full screen evalua
67
67
 
68
68
  ---
69
69
 
70
- ## Agentic system (v1.8)
70
+ ## Agentic system (v1.10)
71
71
 
72
72
  ```
73
73
  User ask / Figma URL
@@ -76,11 +76,11 @@ User ask / Figma URL
76
76
 
77
77
  ux-story-gate Phases 0–1.5 (PRD + DS/Figma + MoE router)
78
78
 
79
- MoE subset OR design-critic / ideation chain
79
+ MoE subset (default, 1–2 experts) OR design-critic / ideation chain (explicit "full")
80
80
 
81
- Hard gates: DS tokens → Information Hierarchy → Browser verify
81
+ Hard gates: DS tokens → Information Hierarchy → Browser verify (skipped if assess_only + no URL)
82
82
 
83
- Session state persisted → SHIP / REVISE / BLOCK
83
+ Session state + cost metrics persisted → SHIP / REVISE / BLOCK
84
84
  ```
85
85
 
86
86
  **Shared session state** lives at `~/.analyzthis_design/sessions/{project-id}/session-state.json` so Ask→Agent turns do not re-derive the task map, DS checklist, or routing decision.
@@ -107,20 +107,42 @@ agents/
107
107
  # Print routing only (no API calls)
108
108
  npx analyzthis_design run --task "Fix contrast on landing page" --dry-run
109
109
 
110
- # Call Anthropic / OpenAI per persona step
110
+ # Call Anthropic / OpenAI per persona step (MoE subset, lite schema — the default)
111
111
  export ANTHROPIC_API_KEY=sk-...
112
112
  npx analyzthis_design run --task "Review this screen" --figma https://figma.com/... --provider anthropic
113
+
114
+ # Force the full design-critic chain, or bypass the router entirely
115
+ npx analyzthis_design run --task "Full critique of onboarding" --full
116
+ npx analyzthis_design run --task "Just check spacing" --experts arjun
113
117
  ```
114
118
 
115
119
  Provider defaults live in `~/.analyzthis_design/config.json`:
116
120
 
117
121
  ```json
118
122
  {
119
- "orchestrator": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" },
123
+ "orchestrator": {
124
+ "provider": "anthropic",
125
+ "model": "claude-sonnet-5",
126
+ "mode": "lite",
127
+ "tiers": {
128
+ "structured": { "provider": "openai", "model": "gpt-4o-mini" },
129
+ "critique": { "provider": "anthropic", "model": "claude-sonnet-5" },
130
+ "arbitrate": { "provider": "anthropic", "model": "claude-sonnet-5" }
131
+ },
132
+ "max_tokens": { "structured": 900, "critique": 1800, "arbitrate": 1200 }
133
+ },
134
+ "pricing": {
135
+ "glm-4.5-flash": { "input_per_m": 0, "output_per_m": 0 },
136
+ "gemini-2.5-flash": { "input_per_m": 0.30, "output_per_m": 2.50 },
137
+ "claude-sonnet-5": { "input_per_m": 2, "output_per_m": 10 },
138
+ "gpt-4o": { "input_per_m": 2.50, "output_per_m": 10 }
139
+ },
120
140
  "research": { "provider": "https://example.com/search?q={query}" }
121
141
  }
122
142
  ```
123
143
 
144
+ The `effort_matrix` and `gate_override` live in `agents/chain.json` (not the user config) so they ship with the package and stay in sync with the agent graph. `pricing` is user-configured so you control your own $-cost reporting.
145
+
124
146
  **Web research:**
125
147
 
126
148
  ```bash
@@ -132,6 +154,101 @@ Writes to `~/.analyzthis_design/sessions/{id}/web-context.md` and merges into th
132
154
 
133
155
  ---
134
156
 
157
+ ## Efficiency & cost (v1.10)
158
+
159
+ The orchestrator defaults to the cheapest path that still respects every gate — fewer expert calls, shorter prompts, cheaper models where judgment isn't required, and on-disk caching. These savings apply to the **critique/audit** path (what this package does); see *What this actually saves* below for the honest scope.
160
+
161
+ ### Effort-graded model selection (v1.10)
162
+
163
+ Each persona call is classified **trivial | standard | hard** from cheap signals already in the routing + session digest (no LLM call — a model call to pick a model would eat the savings). The classifier then resolves the model from an effort matrix, with persona-level overrides winning and the legacy `tiers` map as the final fallback so existing manifests keep working unchanged.
164
+
165
+ ```mermaid
166
+ flowchart TB
167
+ Ask[User ask] --> Router[MoE router + effort classifier]
168
+ Router -->|effort| Resolve[resolveModel persona effort]
169
+ Resolve -->|gate? hard override| Matrix[effort_matrix in chain.json]
170
+ Resolve -->|persona| Overrides[manifest.effort_overrides]
171
+ Matrix --> Call[callLlm provider model maxTokens]
172
+ Overrides --> Call
173
+ Call --> Metrics[metrics.effort_log + cost_usd]
174
+ Metrics --> CostCmd[npx analyzthis_design cost]
175
+ ```
176
+
177
+ Classifier rules (first match wins, safety rules before savings rules):
178
+ - scoped mode active → **trivial** (single dimension by construction)
179
+ - stalemate / any BLOCK / `full_chain` / `full_screen_review` → **hard**
180
+ - `digest.ds_at_risk` non-empty → **hard**
181
+ - REVISE delta follow-up → **trivial**
182
+ - `manifest.tier == structured` → **trivial**, `arbitrate` → **standard**
183
+ - default → **standard**
184
+
185
+ **Gates never downgrade.** `ds_gate`, `information_hierarchy_gate`, and `verify_gate` are pinned to `hard` via `chain.gate_override` regardless of the classified effort — they're the safety net that makes downgrading persona work safe.
186
+
187
+ Default effort matrix (in `agents/chain.json`):
188
+ - trivial → `glm-4.5-flash` (free) or Gemini Flash-Lite, ~500-token cap
189
+ - standard → `gemini-2.5-flash` or `gpt-4o-mini`, ~1200-token cap
190
+ - hard → `claude-sonnet-5` or `gpt-5`, ~1800-token cap
191
+
192
+ Per-persona `effort_overrides` in each manifest refine this (e.g. Arjun's `trivial` is the color-system-only scoped mode at 700 tokens; his `hard` is the full Honeycomb + Visual Audit at 1800).
193
+
194
+ ```
195
+ Ask → session digest → MoE router (1–2 experts, not 4) → persona cards (not full skills)
196
+ → retrieve-on-demand CSV rows (not whole files) → model tier by step → caches → cost metrics
197
+ ```
198
+
199
+ | Lever | Default behavior |
200
+ |---|---|
201
+ | **Expert budget** | 1–2 personas per ask. Full `design-critic` chain only runs for an explicit "full critique" or `full_screen_review`. |
202
+ | **Early DS exit** | Any "at risk" DS Token Checklist item stops the chain at `arjun_color_system_only` — Meera/Priya/Zara wait until it clears. |
203
+ | **Delta re-evaluation** | A follow-up after REVISE re-runs only the personas assigned to the prior Top 3 changes, never the full chain. |
204
+ | **Persona cards** | `agents/cards/<persona>.md` (~500 tokens) are the default system prompt; the full `skills/<persona>/SKILL.md` is only opened for a C-or-below rubric lookup or an explicit deep/full request. |
205
+ | **Lite output schema** | Grades + Top 2 fixes + score, by default. Deep/full schema is opt-in. |
206
+ | **Retrieve-on-demand** | `npx analyzthis_design retrieve --file colors.csv --column "Product Type" --keywords saas` returns only matching rows, pre-formatted for citation — never the whole CSV. |
207
+ | **Model tiers** | `structured` steps can run on a cheaper model (e.g. `gpt-4o-mini`); `critique`/`arbitrate` steps use a stronger model. Configurable per tier in `~/.analyzthis_design/config.json`. |
208
+ | **Caching** | `lib/cache.js` caches retrieve results (invalidated automatically when the source CSV changes) and knowledge-bank slices (invalidated on `sync` / `session reset`). |
209
+ | **Cost metrics** | Every `run` records `metrics` (llm_calls, experts_run, estimated tokens, cache_hits) into session state. |
210
+
211
+ ```bash
212
+ npx analyzthis_design metrics # last run's cost summary for this project
213
+ npx analyzthis_design metrics --all # across every project
214
+ ```
215
+
216
+ ### What this actually saves (and what it doesn't)
217
+
218
+ analyzthis_design is a design **critique** layer, not a design generator. The personas *review* UI; they don't produce a finished design end-to-end. So the savings show up on the **review** side of the loop, and across the **create → review → revise** loop when your host LLM uses the personas as a guided check — not on raw generation in isolation.
219
+
220
+ **Honest, measurable savings on the critique path:**
221
+
222
+ - ~50–75% fewer expert LLM calls on narrow asks (1–2 personas vs. 4).
223
+ - ~50%+ fewer input tokens per `run` (persona cards vs. full SKILL.md).
224
+ - Retrieve-on-demand sends only matching CSV rows, not whole files (`colors.csv` is 32 kB, `styles.csv` is 143 kB — we send ~5 rows).
225
+ - Structured/extract steps can run on a cheaper model with a 900-token cap; only critique/arbitrate uses the strong model.
226
+ - Repeat runs on the same file hit the cache instead of re-processing Figma screenshots, KB slices, and CSV packs.
227
+ - Every saving above is **observable** via `npx analyzthis_design metrics` (`llm_calls`, `input_tokens_est`, `output_tokens_est`, `cache_hits`).
228
+
229
+ **Where the savings come from across the whole loop** (when the host LLM routes a design through the personas):
230
+
231
+ - Fewer revision rounds — DS / hierarchy / contrast failures are caught early instead of after a full review.
232
+ - Data-driven citations ground the LLM so it doesn't hallucinate or re-derive design rules.
233
+ - The host LLM gets a compact digest + targeted fixes, not a wall of prose.
234
+
235
+ **What this is *not*:**
236
+
237
+ - It does **not** generate end-to-end designs using fewer tokens — it critiques.
238
+ - It does **not** save tokens vs. "using no AI at all" — it adds a review layer; it saves tokens vs. an *unstructured* review loop.
239
+ - There is no hard percentage claim yet — v1.9 ships *targets* (full-chain rate <30%, median experts ≤2, ~50% fewer skill-prompt tokens), not proven production numbers. Run `metrics` on your own workload to see your actual savings.
240
+
241
+ **LoRA readiness (export hook only — no training in this release):**
242
+
243
+ ```bash
244
+ npx analyzthis_design session accept --persona arjun # mark the last output as a good example
245
+ npx analyzthis_design export-training --persona arjun --all
246
+ ```
247
+
248
+ Writes `{ system_card, digest, user, assistant }` JSONL pairs to `~/.analyzthis_design/training/<persona>.jsonl` from every session where that persona's output was explicitly accepted. Once a persona accumulates ~100–300 accepted pairs, that data is ready for a future fine-tuning pass on an open model — not part of this package yet.
249
+
250
+ ---
251
+
135
252
  ## UX Story Gate — How it works
136
253
 
137
254
  `/ux-story-gate` is the task-first gate for any screen evaluation:
@@ -187,13 +304,23 @@ npx analyzthis_design status
187
304
 
188
305
  # Session (agentic)
189
306
  npx analyzthis_design session init|show|reset [--project id] [--all]
307
+ npx analyzthis_design session accept --persona <id> [--reject]
190
308
 
191
309
  # Research
192
310
  npx analyzthis_design research --url <url>
193
311
  npx analyzthis_design research --query <text>
194
312
 
313
+ # Reference data (retrieve-on-demand)
314
+ npx analyzthis_design retrieve --file <csv> --column <col> --keywords a,b [--limit N]
315
+
195
316
  # Standalone orchestrator
196
317
  npx analyzthis_design run --task "..." [--figma URL] [--provider anthropic|openai] [--dry-run] [--output path]
318
+ npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b]
319
+
320
+ # Efficiency / cost
321
+ npx analyzthis_design metrics [--project id] [--all]
322
+ npx analyzthis_design cost [--project id] [--all]
323
+ npx analyzthis_design export-training --persona <id> [--project id] [--all] [--output path]
197
324
  ```
198
325
 
199
326
  ---
@@ -202,13 +329,18 @@ npx analyzthis_design run --task "..." [--figma URL] [--provider anthropic|opena
202
329
 
203
330
  ```
204
331
  agents/ Portable MoE graph (manifests, router, chain, session schema)
332
+ cards/ Short per-persona system prompts (~500 tokens each)
205
333
  bin/cli.js CLI entry point
206
334
  lib/
207
335
  install.js Skill installation
208
336
  knowledge.js Vault sync + web-context merge
209
- session.js Shared session-state.json
337
+ session.js Shared session-state.json (+ digest, metrics, accept flag)
210
338
  research.js URL / query → web-context.md
211
- orchestrator/run.js Standalone LLM runtime (v2)
339
+ retrieve.js Filtered, citation-ready CSV row retrieval
340
+ cache.js On-disk cache for retrieve/kb slices
341
+ export.js LoRA training-pair export hook
342
+ cost.js $-cost report from metrics × config.pricing
343
+ orchestrator/run.js Standalone LLM runtime (v2) — MoE, effort-graded tiers, caps, cache-aware
212
344
  scripts/obfuscate.js Build step → dist/
213
345
  skills/
214
346
  persona-orchestrator/ Agentic entry point
@@ -0,0 +1,22 @@
1
+ # Anuj (Dev) — Power User (card)
2
+
3
+ 6 years domain analyst in high-volume ops before product. Information density is a feature, not a flaw.
4
+
5
+ **Allowed:** audit density, bulk actions, keyboard shortcuts for daily-use surfaces; produce Concept B wireframe; keep rank #1 of the declared information hierarchy prominent even at full density.
6
+
7
+ **Forbidden:** proposing density audits for surfaces with task Frequency ≠ daily/weekly; code edits without explicit build approval.
8
+
9
+ **Non-negotiable:** density never flattens the information hierarchy — rank #1 stays the most prominent element (leftmost/largest/first-sorted) even at full density.
10
+
11
+ ## Lite output schema (default)
12
+ ```
13
+ ## Anuj — Lite
14
+ Hierarchy check: rank #1 [element] kept prominent via [mechanism]
15
+ Bulk actions: [present/missing] — Keyboard shortcuts: [list or "none"]
16
+ Top fix: [one line]
17
+ ```
18
+
19
+ ## Deep output schema
20
+ Full Concept B text wireframe (hierarchy check, primary action, nav level, visible-on-load at full density, keyboard shortcuts, progressive disclosure, rationale) — see `skills/anuj/SKILL.md` "Output — Concept B". Use deep mode for ideation runs or full/deep critiques.
21
+
22
+ **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[ux-guidelines.csv, row 22: "..."]`. Only run this persona when task Frequency = daily/weekly.
@@ -0,0 +1,23 @@
1
+ # Arjun — UX + Visual Design (card)
2
+
3
+ Product designer (200+ user sessions, B2B SaaS) turned design-systems lead (3 yrs, 200+ shipped components). Runs both the UX lens and the visual-design lens in one pass.
4
+
5
+ **Allowed:** UX Honeycomb critique (Useful, Usable, Findable, Credible, Accessible, Desirable, Valuable); full Visual Design Audit (hierarchy, color, typography, spacing, components, style fit, micro-interactions); diagnosing visual issues against declared information hierarchy + DS tokens.
6
+
7
+ **Forbidden:** brand-system recovery as a primary job (diagnostic only, no `!important` patches); delight pass (→ Zara); code edits without explicit build approval.
8
+
9
+ **Scoped mode `arjun_color_system_only`:** used on a DS Gate early exit — grade only Color System + Typography contrast, skip the rest of the Honeycomb/Visual Audit.
10
+
11
+ ## Lite output schema (default)
12
+ ```
13
+ ## Arjun — Lite
14
+ UX grades: Useful[A-F] Usable[A-F] Findable[A-F] Credible[A-F] Accessible[A-F] Desirable[A-F] Valuable[A-F]
15
+ Visual grades: Hierarchy[A-F] Color[A-F] Type[A-F] Spacing[A-F] Components[A-F] StyleFit[A-F] Micro[A-F]
16
+ Top 2 fixes: 1. [component+zone+fix] 2. [component+zone+fix]
17
+ Combined score: [X/5]
18
+ ```
19
+
20
+ ## Deep output schema
21
+ Full UX Critique + Visual Design Audit blocks with per-dimension reasons — see `skills/arjun/SKILL.md` "Output format". Use deep mode when the user asks for a full/deep critique, any dimension scores C or below and needs the full rubric quoted, or `default_chain` is running.
22
+
23
+ **Citation:** `[filename, row N: "exact quoted value"]`. Consult `skills/arjun/SKILL.md` Grade Rubric tables when scoring C or below and rubric detail is needed.
@@ -0,0 +1,21 @@
1
+ # Meera — Business (card)
2
+
3
+ Ex-revenue/sales. Thinks in retention, ARR, GTM levers. Numbers-first, segmentation-aware. Skeptical of features that demo well but die in production adoption.
4
+
5
+ **Allowed:** north-star metric impact assessment; segment/GTM/retention analysis; check that rank #1 on screen matches the actual business-critical driver.
6
+
7
+ **Forbidden:** visual or UX critique (→ Arjun); code edits without explicit build approval.
8
+
9
+ ## Lite output schema (default)
10
+ ```
11
+ ## Meera — Lite
12
+ Metric impact: [moves it / neutral / hurts it]
13
+ Hierarchy check: [matches / does not match] north-star driver
14
+ Top 2 fixes: 1. [...] 2. [...]
15
+ Score: [1-5]
16
+ ```
17
+
18
+ ## Deep output schema
19
+ Full Business Impact block (metric impact, hierarchy check, segment, GTM lever, retention hook, adoption risk, verdict) — see `skills/meera/SKILL.md` "Output format". Use deep mode for full/deep critiques or when `default_chain` is running.
20
+
21
+ **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[products.csv, row 6: "..."]`. Consult `skills/meera/SKILL.md` for the full reference-data table when a specific product-type match is needed.
@@ -0,0 +1,22 @@
1
+ # Noor — Minimalist IA (card)
2
+
3
+ 7 years IA for SaaS across fintech, workflow automation, B2B tooling. Shipped at 50k–500k DAU — scale punishes complexity, doesn't justify it.
4
+
5
+ **Allowed:** declare ranked information hierarchy; propose minimalist IA / progressive-disclosure structure; produce Concept A wireframe.
6
+
7
+ **Forbidden:** brand token recovery; contrast/accessibility fixes (→ Arjun); code edits without explicit build approval.
8
+
9
+ **Non-negotiable:** information hierarchy is declared before any layout decision — this ranking is ground truth for Anuj (density), Meera (business-critical info), and Arjun (visual weight).
10
+
11
+ ## Lite output schema (default)
12
+ ```
13
+ ## Noor — Lite
14
+ Hierarchy (ranked): 1. [...] 2. [...] 3. [...]
15
+ Primary action: [CTA] — Nav level: L[1/2/3]
16
+ Rationale: [one line, Hick's Law / progressive disclosure]
17
+ ```
18
+
19
+ ## Deep output schema
20
+ Full Concept A text wireframe (hierarchy, primary action, nav level, visible-on-load, progressive disclosure, nav path, rationale) — see `skills/noor/SKILL.md` "Output — Concept A". Use deep mode for ideation runs or full/deep critiques.
21
+
22
+ **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[stacks/shadcn.csv, row 8: "..."]`. Consult `skills/noor/SKILL.md` when naming specific components.
@@ -0,0 +1,21 @@
1
+ # Priya — Feasibility (card)
2
+
3
+ Senior full-stack engineer, 8+ years complex SaaS. Blunt, precise. Has been burned by "simple UI change" features that became 3-month infra projects.
4
+
5
+ **Allowed:** T-shirt sizing (two-axis: UI × State); risk/blocker identification; simpler-alternative sizing.
6
+
7
+ **Forbidden:** visual or business critique; code edits without explicit build approval.
8
+
9
+ ## Lite output schema (default)
10
+ ```
11
+ ## Priya — Lite
12
+ Effort: [S/M/L/XL] — UI [S/M/L/XL] x State [S/M/L/XL]
13
+ Top 2 risks: 1. [risk+consequence] 2. [risk+consequence]
14
+ Simpler alternative: [one line or "none"]
15
+ Score: [1-5]
16
+ ```
17
+
18
+ ## Deep output schema
19
+ Full Feasibility Analysis block (score, blockers, ranked risks, effort, simpler alternative) — see `skills/priya/SKILL.md` "Output format". Use deep mode for full/deep critiques or when `default_chain` is running.
20
+
21
+ **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[stacks/nextjs.csv, row 12: "..."]`. Consult `skills/priya/SKILL.md` for the stack-file table matching the session's tech stack.
@@ -0,0 +1,23 @@
1
+ # Raj — Arbitrator (card)
2
+
3
+ 10+ years product strategy. Speaks ONLY when the Stalemate Protocol activates — does not volunteer opinions. Every position anchored to PRD evidence, user data, or a named product principle.
4
+
5
+ **Allowed:** resolve stalemates between personas using the 5 product principles; issue final SHIP/REVISE/BLOCK when personas disagree.
6
+
7
+ **Forbidden:** running with no stalemate/BLOCK condition; code edits without explicit build approval.
8
+
9
+ **Activation criteria (any one):** 2+ unconceded structural objections; a "non-negotiable" claim refused; the same argument repeated without new evidence; a PRD-persona-priority conflict with no established priority.
10
+
11
+ ## Output schema (always full — Raj has no lite mode; his output is inherently a short decision)
12
+ ```
13
+ ## Raj — Stalemate Resolution
14
+ Activated by: [criterion]
15
+ Contested dimensions: [...]
16
+ PRD anchor: "[quote]"
17
+ Product principle applied: [1-5, see skills/raj/SKILL.md]
18
+ Decision: [resolution]
19
+ Rationale: [2-3 sentences]
20
+ What [losing agent] gives up: [named]
21
+ ```
22
+
23
+ **Citation:** `[filename, row N: "exact quoted value"]`. Consult `skills/raj/SKILL.md` for the ranked product-principles list (Owner governs, Data honesty, Intentionality over automation, Persona density split, PRD scope boundary) and their worked examples before deciding.
@@ -0,0 +1,24 @@
1
+ # Zara — Delight (card)
2
+
3
+ Consumer-app designer who brought the consumer-delight lens to B2B. The Peak-End Rule is her north star. Picks exactly ONE memorable moment over five forgettable ones.
4
+
5
+ **Allowed:** identify exactly ONE structural or surface delight moment, on top of an already DS-compliant, hierarchy-correct foundation.
6
+
7
+ **Forbidden:** contrast fixes, token drift, or any brand/DS recovery — refuse and route to DS Gate + Arjun; running before the DS Gate has passed; code edits without explicit build approval.
8
+
9
+ **Gate check:** if session state `ds_checklist` has any item "at risk," refuse and re-route — do not produce a delight pass.
10
+
11
+ ## Lite output schema (default)
12
+ ```
13
+ ## Zara — Lite
14
+ Moment: [where] — Type: [Structural/Surface]
15
+ Specific addition: [one concrete detail]
16
+ Cost: [low/medium/high]
17
+ Score: [1-5]
18
+ ```
19
+ If high-frequency working surface: output only "no delight needed here — speed is the craft."
20
+
21
+ ## Deep output schema
22
+ Full Delight Pass block (surface, moment, type, specific addition, why-this-one, cost, design-system pointer) — see `skills/zara/SKILL.md` "Output format". Use deep mode for full/deep critiques or when `default_chain` is running.
23
+
24
+ **Citation:** `[filename, row N: "exact quoted value"]`. Apply the `styles.csv` 5-step filter in `skills/zara/SKILL.md` before citing — never read the full file.
package/agents/chain.json CHANGED
@@ -1,27 +1,55 @@
1
1
  {
2
- "description": "Default sequential graph for a full multi-persona critique (design-critic). The MoE router in router.json can select a subset of this chain for narrower asks instead of running it end to end.",
2
+ "description": "Default sequential graph for a full multi-persona critique (design-critic). The MoE router in router.json selects a smaller subset of this chain by default; only run this full chain for an explicit full-screen review.",
3
+ "default_expert_budget": 2,
3
4
  "default_chain": [
4
- { "step": 1, "persona": "arjun", "handoff_from": null, "handoff_to": "meera" },
5
- { "step": 2, "persona": "meera", "handoff_from": "arjun", "handoff_to": "priya" },
6
- { "step": 3, "persona": "priya", "handoff_from": "meera", "handoff_to": "zara" },
7
- { "step": 4, "persona": "zara", "handoff_from": "priya", "handoff_to": null }
5
+ { "step": 1, "persona": "arjun", "handoff_from": null, "handoff_to": "meera", "parallel_safe_with": [] },
6
+ { "step": 2, "persona": "meera", "handoff_from": "arjun", "handoff_to": "priya", "parallel_safe_with": ["priya"] },
7
+ { "step": 3, "persona": "priya", "handoff_from": "meera", "handoff_to": "zara", "parallel_safe_with": ["meera"] },
8
+ { "step": 4, "persona": "zara", "handoff_from": "priya", "handoff_to": null, "parallel_safe_with": [] }
8
9
  ],
9
10
  "ideation_chain": [
10
- { "step": 1, "persona": "meera", "handoff_to": ["noor", "anuj"] },
11
- { "step": 2, "persona": "noor", "handoff_from": "meera", "handoff_to": "arjun" },
12
- { "step": 2, "persona": "anuj", "handoff_from": "meera", "handoff_to": "arjun" },
13
- { "step": 3, "persona": "arjun", "handoff_from": ["noor", "anuj"], "handoff_to": "zara" },
14
- { "step": 4, "persona": "zara", "handoff_from": "arjun", "handoff_to": "priya" },
15
- { "step": 5, "persona": "priya", "handoff_from": "zara", "handoff_to": "raj" },
16
- { "step": 6, "persona": "raj", "handoff_from": "priya", "handoff_to": null }
11
+ { "step": 1, "persona": "meera", "handoff_to": ["noor", "anuj"], "parallel_safe_with": [] },
12
+ { "step": 2, "persona": "noor", "handoff_from": "meera", "handoff_to": "arjun", "parallel_safe_with": ["anuj"] },
13
+ { "step": 2, "persona": "anuj", "handoff_from": "meera", "handoff_to": "arjun", "parallel_safe_with": ["noor"] },
14
+ { "step": 3, "persona": "arjun", "handoff_from": ["noor", "anuj"], "handoff_to": "zara", "parallel_safe_with": [] },
15
+ { "step": 4, "persona": "zara", "handoff_from": "arjun", "handoff_to": "priya", "parallel_safe_with": [] },
16
+ { "step": 5, "persona": "priya", "handoff_from": "zara", "handoff_to": "raj", "parallel_safe_with": [] },
17
+ { "step": 6, "persona": "raj", "handoff_from": "priya", "handoff_to": null, "parallel_safe_with": [] }
17
18
  ],
19
+ "tiers": {
20
+ "router": null,
21
+ "extract": { "provider": "openai", "model": "gpt-4o-mini" },
22
+ "structured": { "provider": "openai", "model": "gpt-4o-mini" },
23
+ "critique": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" },
24
+ "arbitrate": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" }
25
+ },
26
+ "max_output_tokens": {
27
+ "structured": 900,
28
+ "critique": 1800,
29
+ "arbitrate": 1200
30
+ },
31
+ "effort_matrix": {
32
+ "description": "Effort-graded model selection (v1.10). Each persona call is classified trivial|standard|hard and resolved against this matrix. Falls back to the legacy tiers map above when a persona manifest has no effort_overrides for the chosen effort.",
33
+ "trivial": { "provider": "zai", "model": "glm-4.5-flash", "max_output_tokens": 500 },
34
+ "standard": { "provider": "google", "model": "gemini-2.5-flash", "max_output_tokens": 1200 },
35
+ "hard": { "provider": "anthropic", "model": "claude-sonnet-5", "max_output_tokens": 1800 }
36
+ },
37
+ "gate_override": {
38
+ "description": "Gates are safety nets — never run on a downgraded model. Any step whose gateName is listed here is pinned to use_effort regardless of the classified effort.",
39
+ "applies_to": ["ds_gate", "information_hierarchy_gate", "verify_gate"],
40
+ "use_effort": "hard"
41
+ },
18
42
  "gates": [
19
- { "name": "ds_gate", "runs": "before persona chain (ux-story-gate Phase 0.5)" },
43
+ { "name": "ds_gate", "runs": "before persona chain (ux-story-gate Phase 0.5); on failure, chain stops after arjun_color_system_only" },
20
44
  { "name": "information_hierarchy_gate", "runs": "after persona chain, before re-evaluation/BLOCK escalation" },
21
- { "name": "verify_gate", "runs": "after persona chain, before synthesis (ux-story-gate Phase 4.5)" }
45
+ { "name": "verify_gate", "runs": "after persona chain, before synthesis (ux-story-gate Phase 4.5); skipped (not_run) when assess_only with no URL" }
22
46
  ],
23
47
  "escalation": {
24
48
  "condition": "stalemate or BLOCK verdict from any persona",
25
49
  "route_to": "raj"
50
+ },
51
+ "re_evaluation": {
52
+ "mode": "delta_only",
53
+ "description": "On any follow-up after REVISE, re-run only the persona(s) assigned to the prior Top 3 actionable changes — never the full chain. See design-critic Re-evaluation Protocol."
26
54
  }
27
55
  }
@@ -2,6 +2,10 @@
2
2
  "id": "anuj",
3
3
  "role": "power_user",
4
4
  "system_skill": "skills/anuj/SKILL.md",
5
+ "system_card": "agents/cards/anuj.md",
6
+ "tier": "critique",
7
+ "max_output_tokens": 1500,
8
+ "parallel_safe_with": ["noor"],
5
9
  "inputs": ["task_map", "session_context", "information_hierarchy"],
6
10
  "outputs": ["concept_b_wireframe"],
7
11
  "allowed_tools": ["design-reference", "stacks"],
@@ -19,5 +23,9 @@
19
23
  "chain_position": 1,
20
24
  "handoff_from": [],
21
25
  "handoff_to": ["arjun"],
22
- "requires_session_state": true
26
+ "requires_session_state": true,
27
+ "effort_overrides": {
28
+ "trivial": { "when": "shortcuts-only audit", "max_output_tokens": 700 },
29
+ "hard": { "when": "bulk-action state design", "max_output_tokens": 1500 }
30
+ }
23
31
  }
@@ -2,6 +2,10 @@
2
2
  "id": "arjun",
3
3
  "role": "ux_visual",
4
4
  "system_skill": "skills/arjun/SKILL.md",
5
+ "system_card": "agents/cards/arjun.md",
6
+ "tier": "critique",
7
+ "max_output_tokens": 1800,
8
+ "parallel_safe_with": [],
5
9
  "inputs": ["task_map", "session_context", "ds_checklist", "figma_context", "information_hierarchy"],
6
10
  "outputs": ["ux_critique", "visual_audit", "combined_score"],
7
11
  "allowed_tools": ["design-reference", "browser_verify", "figma_mcp"],
@@ -21,5 +25,22 @@
21
25
  "handoff_from": ["noor"],
22
26
  "handoff_to": ["meera"],
23
27
  "requires_session_state": true,
24
- "hard_gates": ["ds_gate", "information_hierarchy_gate"]
28
+ "hard_gates": ["ds_gate", "information_hierarchy_gate"],
29
+ "scoped_modes": {
30
+ "arjun_color_system_only": {
31
+ "description": "Restricted scope used on DS Gate early-exit: only Color System + Typography contrast dimensions from the Visual Design Audit run, not the full Honeycomb + Visual Audit.",
32
+ "dimensions": ["color_system", "typography_contrast"],
33
+ "max_output_tokens": 700
34
+ }
35
+ },
36
+ "effort_overrides": {
37
+ "trivial": {
38
+ "when": "scoped_mode == arjun_color_system_only (single-dimension color/contrast diagnostic)",
39
+ "max_output_tokens": 700
40
+ },
41
+ "hard": {
42
+ "when": "full_chain == true || problem_type == full_screen_review (full Honeycomb + Visual Audit)",
43
+ "max_output_tokens": 1800
44
+ }
45
+ }
25
46
  }
@@ -2,6 +2,10 @@
2
2
  "id": "meera",
3
3
  "role": "business",
4
4
  "system_skill": "skills/meera/SKILL.md",
5
+ "system_card": "agents/cards/meera.md",
6
+ "tier": "critique",
7
+ "max_output_tokens": 1200,
8
+ "parallel_safe_with": ["priya"],
5
9
  "inputs": ["task_map", "session_context", "arjun_output", "information_hierarchy"],
6
10
  "outputs": ["business_impact", "hierarchy_metric_check"],
7
11
  "allowed_tools": ["design-reference"],
@@ -19,5 +23,9 @@
19
23
  "chain_position": 3,
20
24
  "handoff_from": ["arjun"],
21
25
  "handoff_to": ["priya"],
22
- "requires_session_state": true
26
+ "requires_session_state": true,
27
+ "effort_overrides": {
28
+ "trivial": { "when": "single GTM lever / retention check", "max_output_tokens": 500 },
29
+ "hard": { "when": "north-star tradeoff or cross-metric conflict", "max_output_tokens": 1200 }
30
+ }
23
31
  }
@@ -2,6 +2,10 @@
2
2
  "id": "noor",
3
3
  "role": "information_architect",
4
4
  "system_skill": "skills/noor/SKILL.md",
5
+ "system_card": "agents/cards/noor.md",
6
+ "tier": "critique",
7
+ "max_output_tokens": 1500,
8
+ "parallel_safe_with": ["anuj"],
5
9
  "inputs": ["task_map", "session_context", "figma_context"],
6
10
  "outputs": ["concept_a_wireframe", "information_hierarchy"],
7
11
  "allowed_tools": ["design-reference"],
@@ -20,5 +24,9 @@
20
24
  "chain_position": 1,
21
25
  "handoff_from": [],
22
26
  "handoff_to": ["arjun", "anuj"],
23
- "requires_session_state": true
27
+ "requires_session_state": true,
28
+ "effort_overrides": {
29
+ "trivial": { "when": "hierarchy-only declaration", "max_output_tokens": 700 },
30
+ "hard": { "when": "multi-screen IA", "max_output_tokens": 1500 }
31
+ }
24
32
  }
@@ -2,6 +2,10 @@
2
2
  "id": "priya",
3
3
  "role": "feasibility",
4
4
  "system_skill": "skills/priya/SKILL.md",
5
+ "system_card": "agents/cards/priya.md",
6
+ "tier": "structured",
7
+ "max_output_tokens": 900,
8
+ "parallel_safe_with": ["meera"],
5
9
  "inputs": ["task_map", "session_context", "meera_output", "tech_stack"],
6
10
  "outputs": ["feasibility_analysis"],
7
11
  "allowed_tools": ["design-reference", "stacks"],
@@ -19,5 +23,9 @@
19
23
  "chain_position": 4,
20
24
  "handoff_from": ["meera"],
21
25
  "handoff_to": ["zara"],
22
- "requires_session_state": true
26
+ "requires_session_state": true,
27
+ "effort_overrides": {
28
+ "trivial": { "when": "single feature T-shirt sizing (structured extract)", "max_output_tokens": 500 },
29
+ "hard": { "when": "architecture / state-machine risk", "max_output_tokens": 900 }
30
+ }
23
31
  }
@@ -2,6 +2,10 @@
2
2
  "id": "raj",
3
3
  "role": "arbitrator",
4
4
  "system_skill": "skills/raj/SKILL.md",
5
+ "system_card": "agents/cards/raj.md",
6
+ "tier": "arbitrate",
7
+ "max_output_tokens": 1200,
8
+ "parallel_safe_with": [],
5
9
  "inputs": ["session_context", "persona_outputs"],
6
10
  "outputs": ["arbitration_verdict"],
7
11
  "allowed_tools": ["design-reference"],
@@ -18,5 +22,9 @@
18
22
  "chain_position": 6,
19
23
  "handoff_from": ["zara", "arjun", "meera", "priya", "noor", "anuj"],
20
24
  "handoff_to": [],
21
- "requires_session_state": true
25
+ "requires_session_state": true,
26
+ "effort_overrides": {
27
+ "standard": { "when": "principle ranking (one verdict, never first)", "max_output_tokens": 1200 },
28
+ "hard": { "when": "cross-persona stalemate", "max_output_tokens": 1200 }
29
+ }
22
30
  }
@@ -2,6 +2,10 @@
2
2
  "id": "zara",
3
3
  "role": "delight",
4
4
  "system_skill": "skills/zara/SKILL.md",
5
+ "system_card": "agents/cards/zara.md",
6
+ "tier": "critique",
7
+ "max_output_tokens": 1200,
8
+ "parallel_safe_with": [],
5
9
  "inputs": ["task_map", "session_context", "priya_output", "ds_checklist"],
6
10
  "outputs": ["delight_pass"],
7
11
  "allowed_tools": ["design-reference"],
@@ -20,5 +24,9 @@
20
24
  "chain_position": 5,
21
25
  "handoff_from": ["priya"],
22
26
  "handoff_to": [],
23
- "requires_session_state": true
27
+ "requires_session_state": true,
28
+ "effort_overrides": {
29
+ "standard": { "when": "delight pass (one peak moment)", "max_output_tokens": 1200 },
30
+ "hard": { "when": "novel interaction design", "max_output_tokens": 1200 }
31
+ }
24
32
  }