analyzthis_design 1.8.0 → 1.11.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.
Files changed (39) hide show
  1. package/README.md +212 -26
  2. package/agents/cards/anuj.md +22 -0
  3. package/agents/cards/arjun.md +23 -0
  4. package/agents/cards/kavi.md +26 -0
  5. package/agents/cards/meera.md +21 -0
  6. package/agents/cards/noor.md +22 -0
  7. package/agents/cards/priya.md +21 -0
  8. package/agents/cards/raj.md +23 -0
  9. package/agents/cards/zara.md +24 -0
  10. package/agents/chain.json +42 -14
  11. package/agents/manifests/anuj.json +9 -1
  12. package/agents/manifests/arjun.json +22 -1
  13. package/agents/manifests/kavi.json +33 -0
  14. package/agents/manifests/meera.json +9 -1
  15. package/agents/manifests/noor.json +9 -1
  16. package/agents/manifests/priya.json +9 -1
  17. package/agents/manifests/raj.json +9 -1
  18. package/agents/manifests/zara.json +9 -1
  19. package/agents/router.json +7 -0
  20. package/agents/session-schema.json +23 -2
  21. package/dist/bin/cli.js +1 -1
  22. package/dist/lib/cache.js +1 -0
  23. package/dist/lib/collect.js +2 -0
  24. package/dist/lib/cost.js +1 -0
  25. package/dist/lib/export.js +1 -0
  26. package/dist/lib/install.js +1 -1
  27. package/dist/lib/knowledge.js +1 -1
  28. package/dist/lib/orchestrator/run.js +1 -1
  29. package/dist/lib/platforms.js +1 -0
  30. package/dist/lib/research.js +1 -1
  31. package/dist/lib/retrieve.js +1 -0
  32. package/dist/lib/session.js +1 -1
  33. package/package.json +11 -3
  34. package/skills/collect-knowledge/SKILL.md +128 -0
  35. package/skills/design-critic/SKILL.md +1 -1
  36. package/skills/knowledge-bank/SKILL.md +8 -2
  37. package/skills/persona-orchestrator/SKILL.md +39 -15
  38. package/skills/ux-ideator/SKILL.md +1 -1
  39. package/skills/ux-story-gate/SKILL.md +6 -2
package/README.md CHANGED
@@ -11,24 +11,35 @@ Install once. Run structured UX critiques, multi-phase ideation, and task-ground
11
11
  ## Install
12
12
 
13
13
  ```bash
14
- # Cursor (default)
14
+ # Cursor (default) + cross-agent path on postinstall
15
15
  npx analyzthis_design
16
16
 
17
- # Claude Code
17
+ # Claude Code (skills dir + legacy commands)
18
18
  npx analyzthis_design --target claude
19
19
 
20
20
  # Codex CLI
21
21
  npx analyzthis_design --target codex
22
22
 
23
- # All three at once
24
- npx analyzthis_design --target all
23
+ # Grok Build (xAI)
24
+ npx analyzthis_design --target grok
25
+
26
+ # Windsurf Cascade
27
+ npx analyzthis_design --target windsurf
28
+
29
+ # All supported hosts at once
30
+ npx analyzthis_design --target all --force
25
31
  ```
26
32
 
27
- | Tool | Skills installed to |
28
- |---|---|
29
- | Cursor | `~/.cursor/skills/` |
30
- | Claude Code | `~/.claude/commands/` |
31
- | Codex CLI | `~/.codex/skills/` |
33
+ | Tool | Skills installed to | Invoke |
34
+ |---|---|---|
35
+ | Cursor | `~/.cursor/skills/<name>/SKILL.md` | `/collect-knowledge` |
36
+ | Claude Code | `~/.claude/skills/<name>/SKILL.md` (+ legacy `~/.claude/commands/`) | `/collect-knowledge` |
37
+ | Codex CLI | `~/.codex/skills/<name>/SKILL.md` | skill name / AGENTS.md |
38
+ | Grok Build | `~/.grok/skills/<name>/SKILL.md` | `/collect-knowledge` |
39
+ | Windsurf Cascade | `~/.codeium/windsurf/skills/<name>/SKILL.md` | `@collect-knowledge` |
40
+ | Cross-agent | `~/.agents/skills/<name>/SKILL.md` | discovered by multiple hosts |
41
+
42
+ All skills use the **Agent Skills** `SKILL.md` standard — same files work across Cursor, Claude, Grok, Windsurf, and Codex. The CLI (`collect`, `run`, `sync`) is host-agnostic; only *where skills are discovered* differs.
32
43
 
33
44
  ---
34
45
 
@@ -38,17 +49,19 @@ npx analyzthis_design --target all
38
49
 
39
50
  | Command | What it does |
40
51
  |---|---|
41
- | `/persona-orchestrator` | **Recommended agentic entry point.** Loads MoE router + session state, runs ux-story-gate intake, executes the right persona chain, enforces DS / hierarchy / verify gates, synthesises a SHIP/REVISE/BLOCK verdict. |
52
+ | `/collect-knowledge` | **Kavi Knowledge Archivist.** Scans the codebase, builds an Obsidian vault, LLM-enriches notes, syncs into the knowledge bank so every critique persona reads company context first. Run this once per project before critiques. |
53
+ | `/persona-orchestrator` | **Recommended agentic critique entry point.** Loads MoE router + session state, runs ux-story-gate intake, executes the right persona chain, enforces DS / hierarchy / verify gates, synthesises a SHIP/REVISE/BLOCK verdict. |
42
54
  | `/ux-story-gate` | Task-first gate: discovers PRDs, DS/Figma discovery, MoE routing, browser verify, assess-only mode. |
43
55
  | `/design-critic` | 4-persona critique → `SHIP / REVISE / BLOCK` verdict with a Composite Score out of 20 + Information Hierarchy Gate. |
44
56
  | `/ux-ideator` | 6-phase ideation → two competing IA concepts, deliberation, delight pass, feasibility check. |
45
57
 
46
- ### 7 Individual Personas
58
+ ### 8 Personas
47
59
 
48
- Invoke directly for targeted, already-grounded questions. For full screen evaluation, prefer `/persona-orchestrator` or `/ux-story-gate`.
60
+ Invoke critique personas for targeted, already-grounded questions. For full screen evaluation, prefer `/persona-orchestrator` or `/ux-story-gate`. Run `/collect-knowledge` first so they have project context.
49
61
 
50
62
  | Command | Persona | What they evaluate |
51
63
  |---|---|---|
64
+ | `/collect-knowledge` | Kavi — Knowledge Archivist | Scan repo → Obsidian vault → enrich → sync knowledge bank (producer, not a critic) |
52
65
  | `/arjun` | UX + Visual Design | UX Honeycomb + Visual Design Audit (hierarchy, color, type, spacing, components, style fit, micro-interactions) |
53
66
  | `/meera` | Business Agent | Retention, ARR, GTM lever, adoption risk; hierarchy vs north-star check |
54
67
  | `/priya` | Feasibility Agent | Engineering effort (T-shirt sizing, 2-axis model), state machine traps |
@@ -62,12 +75,12 @@ Invoke directly for targeted, already-grounded questions. For full screen evalua
62
75
  | Command | Purpose |
63
76
  |---|---|
64
77
  | `/design-personas` | Session context template — fill in once before a session |
65
- | `/knowledge-bank` | Auto-populated from your connected vault. All personas read this first. |
78
+ | `/knowledge-bank` | Auto-populated from your connected vault (or from Kavi collect). All personas read this first. |
66
79
  | `/design-reference` | CSV reference data (colors, typography, UX guidelines, stacks, …) |
67
80
 
68
81
  ---
69
82
 
70
- ## Agentic system (v1.8)
83
+ ## Agentic system (v1.11)
71
84
 
72
85
  ```
73
86
  User ask / Figma URL
@@ -76,11 +89,11 @@ User ask / Figma URL
76
89
 
77
90
  ux-story-gate Phases 0–1.5 (PRD + DS/Figma + MoE router)
78
91
 
79
- MoE subset OR design-critic / ideation chain
92
+ MoE subset (default, 1–2 experts) OR design-critic / ideation chain (explicit "full")
80
93
 
81
- Hard gates: DS tokens → Information Hierarchy → Browser verify
94
+ Hard gates: DS tokens → Information Hierarchy → Browser verify (skipped if assess_only + no URL)
82
95
 
83
- Session state persisted → SHIP / REVISE / BLOCK
96
+ Session state + cost metrics persisted → SHIP / REVISE / BLOCK
84
97
  ```
85
98
 
86
99
  **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 +120,42 @@ agents/
107
120
  # Print routing only (no API calls)
108
121
  npx analyzthis_design run --task "Fix contrast on landing page" --dry-run
109
122
 
110
- # Call Anthropic / OpenAI per persona step
123
+ # Call Anthropic / OpenAI per persona step (MoE subset, lite schema — the default)
111
124
  export ANTHROPIC_API_KEY=sk-...
112
125
  npx analyzthis_design run --task "Review this screen" --figma https://figma.com/... --provider anthropic
126
+
127
+ # Force the full design-critic chain, or bypass the router entirely
128
+ npx analyzthis_design run --task "Full critique of onboarding" --full
129
+ npx analyzthis_design run --task "Just check spacing" --experts arjun
113
130
  ```
114
131
 
115
132
  Provider defaults live in `~/.analyzthis_design/config.json`:
116
133
 
117
134
  ```json
118
135
  {
119
- "orchestrator": { "provider": "anthropic", "model": "claude-sonnet-4-20250514" },
136
+ "orchestrator": {
137
+ "provider": "anthropic",
138
+ "model": "claude-sonnet-5",
139
+ "mode": "lite",
140
+ "tiers": {
141
+ "structured": { "provider": "openai", "model": "gpt-4o-mini" },
142
+ "critique": { "provider": "anthropic", "model": "claude-sonnet-5" },
143
+ "arbitrate": { "provider": "anthropic", "model": "claude-sonnet-5" }
144
+ },
145
+ "max_tokens": { "structured": 900, "critique": 1800, "arbitrate": 1200 }
146
+ },
147
+ "pricing": {
148
+ "glm-4.5-flash": { "input_per_m": 0, "output_per_m": 0 },
149
+ "gemini-2.5-flash": { "input_per_m": 0.30, "output_per_m": 2.50 },
150
+ "claude-sonnet-5": { "input_per_m": 2, "output_per_m": 10 },
151
+ "gpt-4o": { "input_per_m": 2.50, "output_per_m": 10 }
152
+ },
120
153
  "research": { "provider": "https://example.com/search?q={query}" }
121
154
  }
122
155
  ```
123
156
 
157
+ 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.
158
+
124
159
  **Web research:**
125
160
 
126
161
  ```bash
@@ -132,6 +167,101 @@ Writes to `~/.analyzthis_design/sessions/{id}/web-context.md` and merges into th
132
167
 
133
168
  ---
134
169
 
170
+ ## Efficiency & cost (v1.10)
171
+
172
+ 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.
173
+
174
+ ### Effort-graded model selection (v1.10)
175
+
176
+ 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.
177
+
178
+ ```mermaid
179
+ flowchart TB
180
+ Ask[User ask] --> Router[MoE router + effort classifier]
181
+ Router -->|effort| Resolve[resolveModel persona effort]
182
+ Resolve -->|gate? hard override| Matrix[effort_matrix in chain.json]
183
+ Resolve -->|persona| Overrides[manifest.effort_overrides]
184
+ Matrix --> Call[callLlm provider model maxTokens]
185
+ Overrides --> Call
186
+ Call --> Metrics[metrics.effort_log + cost_usd]
187
+ Metrics --> CostCmd[npx analyzthis_design cost]
188
+ ```
189
+
190
+ Classifier rules (first match wins, safety rules before savings rules):
191
+ - scoped mode active → **trivial** (single dimension by construction)
192
+ - stalemate / any BLOCK / `full_chain` / `full_screen_review` → **hard**
193
+ - `digest.ds_at_risk` non-empty → **hard**
194
+ - REVISE delta follow-up → **trivial**
195
+ - `manifest.tier == structured` → **trivial**, `arbitrate` → **standard**
196
+ - default → **standard**
197
+
198
+ **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.
199
+
200
+ Default effort matrix (in `agents/chain.json`):
201
+ - trivial → `glm-4.5-flash` (free) or Gemini Flash-Lite, ~500-token cap
202
+ - standard → `gemini-2.5-flash` or `gpt-4o-mini`, ~1200-token cap
203
+ - hard → `claude-sonnet-5` or `gpt-5`, ~1800-token cap
204
+
205
+ 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).
206
+
207
+ ```
208
+ Ask → session digest → MoE router (1–2 experts, not 4) → persona cards (not full skills)
209
+ → retrieve-on-demand CSV rows (not whole files) → model tier by step → caches → cost metrics
210
+ ```
211
+
212
+ | Lever | Default behavior |
213
+ |---|---|
214
+ | **Expert budget** | 1–2 personas per ask. Full `design-critic` chain only runs for an explicit "full critique" or `full_screen_review`. |
215
+ | **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. |
216
+ | **Delta re-evaluation** | A follow-up after REVISE re-runs only the personas assigned to the prior Top 3 changes, never the full chain. |
217
+ | **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. |
218
+ | **Lite output schema** | Grades + Top 2 fixes + score, by default. Deep/full schema is opt-in. |
219
+ | **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. |
220
+ | **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`. |
221
+ | **Caching** | `lib/cache.js` caches retrieve results (invalidated automatically when the source CSV changes) and knowledge-bank slices (invalidated on `sync` / `session reset`). |
222
+ | **Cost metrics** | Every `run` records `metrics` (llm_calls, experts_run, estimated tokens, cache_hits) into session state. |
223
+
224
+ ```bash
225
+ npx analyzthis_design metrics # last run's cost summary for this project
226
+ npx analyzthis_design metrics --all # across every project
227
+ ```
228
+
229
+ ### What this actually saves (and what it doesn't)
230
+
231
+ 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.
232
+
233
+ **Honest, measurable savings on the critique path:**
234
+
235
+ - ~50–75% fewer expert LLM calls on narrow asks (1–2 personas vs. 4).
236
+ - ~50%+ fewer input tokens per `run` (persona cards vs. full SKILL.md).
237
+ - 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).
238
+ - Structured/extract steps can run on a cheaper model with a 900-token cap; only critique/arbitrate uses the strong model.
239
+ - Repeat runs on the same file hit the cache instead of re-processing Figma screenshots, KB slices, and CSV packs.
240
+ - Every saving above is **observable** via `npx analyzthis_design metrics` (`llm_calls`, `input_tokens_est`, `output_tokens_est`, `cache_hits`).
241
+
242
+ **Where the savings come from across the whole loop** (when the host LLM routes a design through the personas):
243
+
244
+ - Fewer revision rounds — DS / hierarchy / contrast failures are caught early instead of after a full review.
245
+ - Data-driven citations ground the LLM so it doesn't hallucinate or re-derive design rules.
246
+ - The host LLM gets a compact digest + targeted fixes, not a wall of prose.
247
+
248
+ **What this is *not*:**
249
+
250
+ - It does **not** generate end-to-end designs using fewer tokens — it critiques.
251
+ - It does **not** save tokens vs. "using no AI at all" — it adds a review layer; it saves tokens vs. an *unstructured* review loop.
252
+ - 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.
253
+
254
+ **LoRA readiness (export hook only — no training in this release):**
255
+
256
+ ```bash
257
+ npx analyzthis_design session accept --persona arjun # mark the last output as a good example
258
+ npx analyzthis_design export-training --persona arjun --all
259
+ ```
260
+
261
+ 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.
262
+
263
+ ---
264
+
135
265
  ## UX Story Gate — How it works
136
266
 
137
267
  `/ux-story-gate` is the task-first gate for any screen evaluation:
@@ -151,9 +281,45 @@ Writes to `~/.analyzthis_design/sessions/{id}/web-context.md` and merges into th
151
281
 
152
282
  ---
153
283
 
284
+ ## Knowledge collection — Kavi (v1.11)
285
+
286
+ Kavi is a **producer** persona (not a critic). One command scans the current repo, writes an Obsidian vault, optionally enriches notes with an LLM, then auto-connects and syncs into the knowledge bank.
287
+
288
+ ```
289
+ /collect-knowledge (or npx analyzthis_design collect)
290
+
291
+ Scan codebase (gitignore-aware) → draft Obsidian notes
292
+
293
+ LLM enrich (batched; skip with --no-enrich if no API key)
294
+
295
+ ~/.analyzthis_design/vaults/{project-id}/
296
+
297
+ connect + sync → knowledge-bank skill
298
+
299
+ Arjun / Meera / … read company context first
300
+ ```
301
+
302
+ ```bash
303
+ # In your app repo (sync KB to every host):
304
+ npx analyzthis_design collect --target all
305
+ npx analyzthis_design collect --dry-run
306
+ npx analyzthis_design collect --no-enrich --limit 50
307
+ npx analyzthis_design collect --vault ~/Documents/MyProjectVault --target claude
308
+ ```
309
+
310
+ Vault folders: `PRDs/`, `Brand/`, `Product/`, `Pages/`, `Components/`, `Design/`, `Tech/`, `Research/`, `_meta/`. Notes use YAML frontmatter + `[[wikilinks]]`. Re-runs skip unchanged enriched notes via content hash.
311
+
312
+ Enrichment needs one of: `OPENAI_API_KEY`, `GEMINI_API_KEY`, `ANTHROPIC_API_KEY`, `ZAI_API_KEY`. Without a key, Kavi still writes a draft vault and syncs it.
313
+
314
+ ---
315
+
154
316
  ## Knowledge Bank — Connect your vault
155
317
 
156
318
  ```bash
319
+ # Option A — let Kavi build the vault from the codebase (recommended for new projects)
320
+ npx analyzthis_design collect
321
+
322
+ # Option B — connect an existing Obsidian vault or markdown folder
157
323
  npx analyzthis_design connect --vault ~/Documents/MyVault
158
324
  npx analyzthis_design connect --vault ~/vault --tags design,brand,prd,product
159
325
  npx analyzthis_design connect --vault ~/vault --include Design,Brand,PRDs,Research
@@ -179,6 +345,9 @@ npx analyzthis_design --force
179
345
  npx analyzthis_design remove --target all
180
346
  npx analyzthis_design list --target all
181
347
 
348
+ # Knowledge collection (Kavi)
349
+ npx analyzthis_design collect [--vault path] [--dry-run] [--no-enrich] [--limit N] [--target cursor|claude|grok|windsurf|agents|all]
350
+
182
351
  # Knowledge bank
183
352
  npx analyzthis_design connect --vault <path> [--tags ...] [--include ...]
184
353
  npx analyzthis_design sync [--target all]
@@ -187,13 +356,23 @@ npx analyzthis_design status
187
356
 
188
357
  # Session (agentic)
189
358
  npx analyzthis_design session init|show|reset [--project id] [--all]
359
+ npx analyzthis_design session accept --persona <id> [--reject]
190
360
 
191
361
  # Research
192
362
  npx analyzthis_design research --url <url>
193
363
  npx analyzthis_design research --query <text>
194
364
 
365
+ # Reference data (retrieve-on-demand)
366
+ npx analyzthis_design retrieve --file <csv> --column <col> --keywords a,b [--limit N]
367
+
195
368
  # Standalone orchestrator
196
- npx analyzthis_design run --task "..." [--figma URL] [--provider anthropic|openai] [--dry-run] [--output path]
369
+ npx analyzthis_design run --task "..." [--figma URL] [--provider anthropic|openai|google|zai] [--dry-run] [--output path]
370
+ npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b]
371
+
372
+ # Efficiency / cost
373
+ npx analyzthis_design metrics [--project id] [--all]
374
+ npx analyzthis_design cost [--project id] [--all]
375
+ npx analyzthis_design export-training --persona <id> [--project id] [--all] [--output path]
197
376
  ```
198
377
 
199
378
  ---
@@ -202,16 +381,24 @@ npx analyzthis_design run --task "..." [--figma URL] [--provider anthropic|opena
202
381
 
203
382
  ```
204
383
  agents/ Portable MoE graph (manifests, router, chain, session schema)
384
+ cards/ Short per-persona system prompts (~500 tokens each)
205
385
  bin/cli.js CLI entry point
206
386
  lib/
207
387
  install.js Skill installation
208
388
  knowledge.js Vault sync + web-context merge
209
- session.js Shared session-state.json
389
+ collect.js Kavi — codebase scan → Obsidian vault → enrich → sync
390
+ platforms.js Cross-host skill paths (Cursor, Claude, Codex, Grok, Windsurf, agents)
391
+ session.js Shared session-state.json (+ digest, metrics, vault_path)
210
392
  research.js URL / query → web-context.md
211
- orchestrator/run.js Standalone LLM runtime (v2)
393
+ retrieve.js Filtered, citation-ready CSV row retrieval
394
+ cache.js On-disk cache for retrieve/kb slices
395
+ export.js LoRA training-pair export hook
396
+ cost.js $-cost report from metrics × config.pricing
397
+ orchestrator/run.js Standalone LLM runtime (v2) — MoE, effort-graded tiers, caps, cache-aware
212
398
  scripts/obfuscate.js Build step → dist/
213
399
  skills/
214
- persona-orchestrator/ Agentic entry point
400
+ collect-knowledge/ Kavi Knowledge Archivist
401
+ persona-orchestrator/ Agentic critique entry point
215
402
  ux-story-gate/ Task-first gate + DS/MoE/verify/assess phases
216
403
  design-critic/ 4-persona critique + hierarchy gate
217
404
  ux-ideator/ 6-phase ideation
@@ -224,9 +411,8 @@ skills/
224
411
  ## Requirements
225
412
 
226
413
  - Node.js 16+
227
- - [Cursor](https://cursor.com) with Agent Mode (for `/skill` commands)
228
- - Claude Code or Codex CLI if using those targets
229
- - For `run` (non–dry-run): `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`
414
+ - Any Agent Skills–compatible host: [Cursor](https://cursor.com), [Claude Code](https://code.claude.com), Codex CLI, [Grok Build](https://x.ai), or Windsurf Cascade
415
+ - For `run` / `collect` enrichment: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, or `ZAI_API_KEY`
230
416
 
231
417
  ---
232
418
 
@@ -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,26 @@
1
+ # Kavi — Knowledge Archivist (card)
2
+
3
+ Producer persona. Scans a codebase, builds an Obsidian vault, enriches notes into readable project knowledge, then wires that vault into the knowledge bank so every critique persona reads company context first.
4
+
5
+ **Allowed:** codebase inventory (PRDs, brand/tokens, pages, components, tech stack, research); writing Obsidian notes with YAML frontmatter + `[[wikilinks]]`; LLM enrichment of draft extracts into concise purpose + key facts; connecting and syncing the vault into `knowledge-bank`.
6
+
7
+ **Forbidden:** UX / visual / business critique (→ Arjun / Meera / etc.); inventing files, APIs, or components not present in the raw extract; design generation; code edits in the scanned repo.
8
+
9
+ ## Output schema (enrichment batches)
10
+ For each draft note, emit a full Obsidian markdown file:
11
+ 1. Keep the original YAML frontmatter; set `enriched: true`.
12
+ 2. Sections: Purpose, Key facts (bullets), Related (`[[Folder/Note]]` wikilinks only to notes that exist in the batch or were listed under Related).
13
+ 3. Do not paste large code blocks — summarize what the file does in plain language.
14
+ 4. Do not invent APIs, routes, or props that are not in the Raw extract / Exports / Imports.
15
+
16
+ ## Lite report (after collect CLI)
17
+ ```
18
+ ## Kavi — Collect report
19
+ Vault: [path]
20
+ Notes: [N written / S skipped unchanged]
21
+ Enriched: [E]
22
+ Knowledge bank: [synced count] → [targets]
23
+ Next: run /persona-orchestrator or any critique persona — they read this bank first.
24
+ ```
25
+
26
+ Consult `skills/collect-knowledge/SKILL.md` for the host workflow. Prefer running `npx analyzthis_design collect` over re-scanning files in chat.
@@ -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
  }