analyzthis_design 1.19.0 → 1.20.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
@@ -2,9 +2,9 @@
2
2
 
3
3
  A set of AI design personas and a task-first evaluation framework that plugs into Cursor, Claude Code, and Codex CLI as slash commands — plus an agentic MoE router with shared session state so you can call the same graph from any IDE or from the CLI.
4
4
 
5
- Install once. Run structured UX critiques, multi-phase ideation, and task-grounded screen reviews — directly inside your AI chat.
5
+ Install once. Run structured UX critiques, multi-phase ideation, and task-grounded screen reviews — directly inside your AI chat. **No external LLM API keys required** for CLI orchestrator runs: **`/devi`** voices each persona from your host IDE (Cursor, Claude, etc.).
6
6
 
7
- **npm:** [analyzthis_design](https://www.npmjs.com/package/analyzthis_design)
7
+ **npm:** [analyzthis_design](https://www.npmjs.com/package/analyzthis_design) · **Current version:** 1.20.0
8
8
 
9
9
  ---
10
10
 
@@ -66,8 +66,9 @@ All skills use the **Agent Skills** `SKILL.md` standard — same files work acro
66
66
  | `/persona-orchestrator` | **Agentic critique entry point** (not for wireframes). MoE router + session state, ux-story-gate intake, persona chain, DS / hierarchy / verify gates → SHIP/REVISE/BLOCK |
67
67
  | `/ux-story-gate` | Task-first gate: PRDs, DS/Figma discovery, MoE routing, browser verify, assess-only mode |
68
68
  | `/design-critic` | 4-persona critique → Composite Score + Information Hierarchy Gate |
69
+ | `/deliberation-protocol` | Adversarial review rules — grounding, objection JSON, parallel pairs, Raj escalation |
69
70
 
70
- ### 8 Personas
71
+ ### 9 Personas (+ host runtime)
71
72
 
72
73
  Invoke critique personas for targeted, already-grounded questions. For **wireframes**, use `/ux-ideator`, `/noor`, or `/anuj`. For full screen **critique**, prefer `/persona-orchestrator` or `/ux-story-gate`. Run **`/kavi`** first so they have project context.
73
74
 
@@ -81,6 +82,7 @@ Invoke critique personas for targeted, already-grounded questions. For **wirefra
81
82
  | `/noor` | IA Architect | Minimalist Concept A + declared ranked information hierarchy |
82
83
  | `/anuj` | Power-User Advocate | Dense Concept B — bulk actions, keyboard shortcuts, hierarchy kept prominent |
83
84
  | `/raj` | Arbitrator | Resolves persona stalemates using 5 ranked product principles. Never speaks first. |
85
+ | `/devi` | Host LLM runtime | Voices other personas when CLI `run` uses host mode (no API keys). Reads pending prompts → writes responses → `--continue` resumes |
84
86
 
85
87
  ### Supporting skills
86
88
 
@@ -89,10 +91,11 @@ Invoke critique personas for targeted, already-grounded questions. For **wirefra
89
91
  | `/design-personas` | Session context template — fill in once before a session |
90
92
  | `/knowledge-bank` | Auto-populated from your connected vault (or from Kavi collect). All personas read this first. |
91
93
  | `/design-reference` | CSV reference data (colors, typography, UX guidelines, stacks, …) |
94
+ | `/collect-knowledge` | Alias for `/kavi` |
92
95
 
93
96
  ---
94
97
 
95
- ## Agentic system (v1.19)
98
+ ## Agentic system (v1.20)
96
99
 
97
100
  ```
98
101
  User ask / Figma URL
@@ -105,14 +108,70 @@ User ask / Figma URL
105
108
 
106
109
  MoE subset (default) OR full chain (explicit "full")
107
110
 
108
- Raj on stalemate (2+ blocking objections)
111
+ Zara (delight) → Raj on stalemate (after all groups — never before Zara)
112
+
113
+ Phase 5 synthesis (composite score + hierarchy gate + top 3)
109
114
 
110
115
  Hard gates: DS → Hierarchy → Verify
111
116
 
112
117
  SHIP / REVISE / BLOCK
113
118
  ```
114
119
 
115
- ### Adversarial deliberation (v1.19)
120
+ ### Devi host LLM (no API keys) · v1.20
121
+
122
+ When no `OPENAI_API_KEY` / `ANTHROPIC_API_KEY` / `GEMINI_API_KEY` / `ZAI_API_KEY` is set, **`run` defaults to `provider: host`**. The orchestrator writes each persona step as a prompt file; **`/devi`** (or your host IDE agent) embodies that persona and writes the response back. No paid API calls.
123
+
124
+ ```bash
125
+ # 1. Start run — pauses at first persona with prompt path
126
+ npx analyzthis_design run --task "Review invoice approval screen" --full
127
+
128
+ # 2. In Cursor / Claude: invoke /devi
129
+ # (reads pending/*.json, writes responses/*.md in persona voice)
130
+
131
+ # 3. Check queue + continue
132
+ npx analyzthis_design devi status
133
+ npx analyzthis_design run --continue --task "Review invoice approval screen" --full
134
+ ```
135
+
136
+ **Prompt queue layout:**
137
+
138
+ ```
139
+ ~/.analyzthis_design/runs/{project-id}/{run-id}/
140
+ pending/001-arjun.json ← orchestrator writes
141
+ responses/001-arjun.md ← Devi / host IDE writes
142
+ manifest.json
143
+ ```
144
+
145
+ **Submit a response manually:**
146
+
147
+ ```bash
148
+ npx analyzthis_design devi respond \
149
+ --run ~/.analyzthis_design/runs/{project-id}/{run-id} \
150
+ --step 001-arjun \
151
+ --file my-arjun-response.md
152
+ ```
153
+
154
+ **Override host mode** when you have API keys:
155
+
156
+ ```bash
157
+ export ANTHROPIC_API_KEY=sk-...
158
+ npx analyzthis_design run --task "..." --provider anthropic
159
+ ```
160
+
161
+ Skill: `/devi` · Implementation: `lib/host-llm.js`, `lib/provider.js`
162
+
163
+ ### Phase 5 synthesis · v1.20
164
+
165
+ After deliberation closes, the orchestrator builds a **composite synthesis** automatically:
166
+
167
+ - Per-persona scores (Arjun, Meera, Priya, Zara)
168
+ - **Verdict:** SHIP / REVISE / BLOCK
169
+ - **Top 3 actionable changes** (ranked)
170
+ - **Information Hierarchy Gate** (Arjun visual hierarchy + Meera hierarchy check)
171
+
172
+ Stored in session as `synthesis` (JSON) and `synthesis_markdown` (display block). Printed at end of every completed `run`.
173
+
174
+ ### Adversarial deliberation (v1.19+)
116
175
 
117
176
  Personas **debate** grounded in real task_map, PRD, and UI context — they do not pass generic handoff documents.
118
177
 
@@ -133,11 +192,24 @@ Config: `~/.analyzthis_design/config.json` → `deliberation` block (see `supaba
133
192
 
134
193
  Skill: `/deliberation-protocol` | Schema: `agents/deliberation-schema.json`
135
194
 
136
- **Low satisfaction ≠ unlimited tokens.** Objection rounds use lite schema + 600-token cap; synthesis and Raj use full models.
195
+ **Low satisfaction ≠ unlimited tokens.** Objection rounds use lite schema + 600-token cap; synthesis and Raj use full produce mode.
196
+
197
+ **Raj order (v1.20):** Raj escalates **after all deliberation groups** complete — Zara always runs before Raj in the critique chain.
137
198
 
138
199
  ---
139
200
 
140
- **Shared session state** lives at `~/.analyzthis_design/sessions/{project-id}/session-state.json` (includes `deliberation.round_log` after adversarial runs).
201
+ **Shared session state** lives at `~/.analyzthis_design/sessions/{project-id}/session-state.json`.
202
+
203
+ Key fields after a run:
204
+
205
+ | Field | Contents |
206
+ |---|---|
207
+ | `persona_outputs` | Each persona's text + parsed deliberation JSON |
208
+ | `deliberation` | `round_log`, `open_objections`, `consensus_reached`, `raj_escalated` |
209
+ | `synthesis` | Composite scores, verdict, top 3, hierarchy gate |
210
+ | `synthesis_markdown` | Phase 5 block for display / export |
211
+ | `host_run` | Host-mode checkpoint when paused for Devi (`run_dir`, `checkpoint`) |
212
+ | `metrics` | `llm_calls`, `deliberation_rounds`, `objections_raised`, token estimates |
141
213
 
142
214
  ```bash
143
215
  npx analyzthis_design session init
@@ -158,19 +230,29 @@ agents/
158
230
  **Standalone runtime (v2):**
159
231
 
160
232
  ```bash
161
- # Print routing only (no API calls)
233
+ # Print routing + deliberation groups (no LLM calls)
162
234
  npx analyzthis_design run --task "Fix contrast on landing page" --dry-run
163
235
 
164
- # Call Anthropic / OpenAI per persona step (MoE subset, lite schema — the default)
236
+ # Host mode (default when no API keys) Devi voices personas
237
+ npx analyzthis_design run --task "Review invoice screen" --full
238
+ npx analyzthis_design devi status
239
+ npx analyzthis_design run --continue --task "Review invoice screen" --full
240
+
241
+ # External API providers (optional)
165
242
  export ANTHROPIC_API_KEY=sk-...
166
243
  npx analyzthis_design run --task "Review this screen" --figma https://figma.com/... --provider anthropic
167
244
 
168
- # Force the full design-critic chain, or bypass the router entirely
245
+ # Force full chain, bypass router, tune deliberation
169
246
  npx analyzthis_design run --task "Full critique of onboarding" --full
170
247
  npx analyzthis_design run --task "Just check spacing" --experts arjun
171
- npx analyzthis_design run --task "..." --max-rounds 2 --satisfaction 0.5 --no-deliberate
248
+ npx analyzthis_design run --task "..." --max-rounds 2 --satisfaction 0.5
249
+ npx analyzthis_design run --task "..." --no-deliberate # legacy sequential handoff
172
250
  ```
173
251
 
252
+ **Provider resolution order:** explicit `--provider` → config → first available API key → **`host`** (Devi).
253
+
254
+ Supported providers: `host` | `anthropic` | `openai` | `google` | `zai`
255
+
174
256
  Provider defaults live in `~/.analyzthis_design/config.json`:
175
257
 
176
258
  ```json
@@ -239,7 +321,7 @@ flowchart TB
239
321
  Router -->|effort| Resolve[resolveModel persona effort]
240
322
  Resolve -->|gate? hard override| Matrix[effort_matrix in chain.json]
241
323
  Resolve -->|persona| Overrides[manifest.effort_overrides]
242
- Matrix --> Call[callLlm provider model maxTokens]
324
+ Matrix --> Call[callLlm host or API provider]
243
325
  Overrides --> Call
244
326
  Call --> Metrics[metrics.effort_log + cost_usd]
245
327
  Metrics --> CostCmd[npx analyzthis_design cost]
@@ -256,9 +338,9 @@ Classifier rules (first match wins, safety rules before savings rules):
256
338
  **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.
257
339
 
258
340
  Default effort matrix (in `agents/chain.json`):
259
- - trivial → `glm-4.5-flash` (free) or Gemini Flash-Lite, ~500-token cap
260
- - standard → `gemini-2.5-flash` or `gpt-4o-mini`, ~1200-token cap
261
- - hard → `claude-sonnet-5` or `gpt-5`, ~1800-token cap
341
+ - **trivial** → `host` / Devi (~600-token cap for objection rounds) or API model when keys set
342
+ - **standard** → `gemini-2.5-flash` or `gpt-4o-mini`, ~1200-token cap
343
+ - **hard** → `claude-sonnet-5` or `gpt-5`, ~1800-token cap
262
344
 
263
345
  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).
264
346
 
@@ -550,8 +632,14 @@ npx analyzthis_design research --query <text>
550
632
  npx analyzthis_design retrieve --file <csv> --column <col> --keywords a,b [--limit N]
551
633
 
552
634
  # Standalone orchestrator
553
- npx analyzthis_design run --task "..." [--figma URL] [--provider anthropic|openai|google|zai] [--dry-run] [--output path]
554
- npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b] [--deliberate | --no-deliberate] [--max-rounds N] [--satisfaction 0.4]
635
+ npx analyzthis_design run --task "..." [--figma URL] [--provider host|anthropic|openai|google|zai] [--dry-run] [--output path]
636
+ npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b]
637
+ npx analyzthis_design run --task "..." [--deliberate | --no-deliberate] [--max-rounds N] [--satisfaction 0.4]
638
+ npx analyzthis_design run --continue --task "..." # resume host-mode run after /devi
639
+
640
+ # Devi — host LLM queue (v1.20)
641
+ npx analyzthis_design devi status [--run path]
642
+ npx analyzthis_design devi respond --run <run-dir> --step 001-arjun --file response.md
555
643
 
556
644
  # Efficiency / cost
557
645
  npx analyzthis_design metrics [--project id] [--all]
@@ -582,14 +670,22 @@ lib/
582
670
  feedback.js Persona unhappiness + correction logging (session + global JSONL)
583
671
  feedback-submit.js Opt-in anonymized submit to Supabase (community feedback)
584
672
  deliberation.js Adversarial satisfaction loops, context pack, Raj escalation
673
+ host-llm.js Devi bridge — pending/response queue, checkpoint on pause
674
+ provider.js Auto-detect API keys or default to host
675
+ synthesis.js Phase 5 composite score + hierarchy gate + top 3
585
676
  cost.js $-cost report from metrics × config.pricing
586
- orchestrator/run.js Standalone LLM runtime (v2) — MoE, effort-graded tiers, caps, cache-aware
677
+ orchestrator/run.js Standalone runtime (v2) — MoE, host/API providers, synthesis
678
+ scripts/
679
+ run-live-quality.js Host-mode quality test (fixtures through real engine)
680
+ quality-check.js Validate persona outputs vs skill + deliberation protocol
681
+ demo-fictional-deliberation.js Dry-run walkthrough for FlowPay scenario
587
682
  scripts/obfuscate.js Build step → dist/
588
683
  skills/
684
+ devi/ Host LLM runtime — voices personas from pending prompts
589
685
  kavi/ Kavi — Knowledge Archivist (/kavi)
590
686
  collect-knowledge/ Alias for Kavi (backward compatible)
591
687
  persona-orchestrator/ Agentic critique entry point
592
- deliberation-protocol/ Adversarial review rules (v1.19)
688
+ deliberation-protocol/ Adversarial review rules (v1.19+)
593
689
  ux-story-gate/ Task-first gate + DS/MoE/verify/assess phases
594
690
  design-critic/ 4-persona critique + hierarchy gate
595
691
  ux-ideator/ 6-phase ideation
@@ -603,7 +699,21 @@ skills/
603
699
 
604
700
  - Node.js 16+
605
701
  - 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
606
- - For `run` / `collect` enrichment: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, or `ZAI_API_KEY`
702
+ - **CLI `run`:** works without API keys via **`/devi`** host mode (default). Optional keys for automated API runs: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `ZAI_API_KEY`
703
+ - **Kavi `collect` enrichment:** optional — same keys as above; without keys, draft vault + sync still run
704
+
705
+ ---
706
+
707
+ ## What's new in v1.20
708
+
709
+ | Feature | Description |
710
+ |---------|-------------|
711
+ | **`/devi` host LLM** | No API keys needed — orchestrator writes prompts, host IDE voices personas |
712
+ | **`run --continue`** | Resume after Devi fills `responses/*.md` |
713
+ | **Phase 5 synthesis** | Auto composite score, verdict, top 3, hierarchy gate in session |
714
+ | **Raj ordering fix** | Zara always runs before Raj; Raj escalates after all groups |
715
+ | **Rebuttal rounds** | Prompts require new evidence — no verbatim repeat on objection re-runs |
716
+ | **`devi status` / `devi respond`** | CLI helpers for the prompt queue |
607
717
 
608
718
  ---
609
719
 
@@ -0,0 +1,15 @@
1
+ # Devi — Host LLM runtime (card)
2
+
3
+ Meta-agent that **voices** other personas when the orchestrator runs in `host` mode (no external API keys).
4
+
5
+ **Allowed:** read pending orchestrator prompts; embody any persona skill/card; write response files; batch-process a run directory; resume orchestrator via `--continue`.
6
+
7
+ **Forbidden:** produce final code edits; skip deliberation JSON; speak as Devi in persona output (always write as the target persona).
8
+
9
+ ## Quick flow
10
+
11
+ ```
12
+ run --task "..." → pending/001-arjun.json → /devi → responses/001-arjun.md → run --continue
13
+ ```
14
+
15
+ See `skills/devi/SKILL.md` for the full protocol.
package/agents/chain.json CHANGED
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "effort_matrix": {
38
38
  "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.",
39
- "trivial": { "provider": "zai", "model": "glm-4.5-flash", "max_output_tokens": 500 },
39
+ "trivial": { "provider": "host", "model": "devi", "max_output_tokens": 600 },
40
40
  "standard": { "provider": "google", "model": "gemini-2.5-flash", "max_output_tokens": 1200 },
41
41
  "hard": { "provider": "anthropic", "model": "claude-sonnet-5", "max_output_tokens": 1800 }
42
42
  },
@@ -0,0 +1,31 @@
1
+ {
2
+ "id": "devi",
3
+ "role": "host_llm",
4
+ "system_skill": "skills/devi/SKILL.md",
5
+ "system_card": "agents/cards/devi.md",
6
+ "tier": "structured",
7
+ "max_output_tokens": 900,
8
+ "parallel_safe_with": [],
9
+ "inputs": ["pending_prompts", "persona_skills", "session_state"],
10
+ "outputs": ["persona_responses"],
11
+ "allowed_tools": [],
12
+ "allowed_jobs": [
13
+ "read orchestrator pending prompts and embody target personas",
14
+ "write response files for host-mode orchestrator runs",
15
+ "batch-process all pending steps in a run directory"
16
+ ],
17
+ "forbidden_jobs": [
18
+ "replace persona critique content with meta-commentary",
19
+ "call external LLM APIs (Devi IS the host LLM)",
20
+ "implement code without explicit build approval"
21
+ ],
22
+ "routing_triggers": ["host_llm", "devi", "pending", "continue run"],
23
+ "never_route_for": ["design_critique", "wireframe"],
24
+ "chain_position": 0,
25
+ "handoff_from": [],
26
+ "handoff_to": ["arjun", "meera", "priya", "zara", "noor", "anuj", "raj"],
27
+ "requires_session_state": true,
28
+ "effort_overrides": {
29
+ "trivial": { "provider": "host", "max_output_tokens": 900 }
30
+ }
31
+ }
@@ -79,6 +79,25 @@
79
79
  "raj_escalated": "boolean",
80
80
  "mode": "adversarial | legacy"
81
81
  },
82
+ "host_run": {
83
+ "run_id": "string — host LLM run directory id",
84
+ "run_dir": "string — absolute path to pending/responses queue",
85
+ "task": "string — task text for --continue",
86
+ "status": "in_progress | pending_devi | complete",
87
+ "last_pending": { "step_id": "string", "persona": "string" },
88
+ "checkpoint": "object | null — deliberation resume state",
89
+ "started_at": "ISO 8601",
90
+ "completed_at": "ISO 8601 | omitted"
91
+ },
92
+ "synthesis": {
93
+ "scores": "object — per-persona scores",
94
+ "total": "number",
95
+ "max_total": "number",
96
+ "verdict": "SHIP | REVISE | BLOCK",
97
+ "top3": ["object — ranked actionable changes"],
98
+ "hierarchy_gate": "object — gate status"
99
+ },
100
+ "synthesis_markdown": "string — Phase 5 composite block for display/export",
82
101
  "digest": {
83
102
  "task_map_summary": "string — short summary passed to persona calls instead of the full task_map/persona_outputs history",
84
103
  "hierarchy_top3": ["string — top 3 ranked hierarchy items, if declared"],