analyzthis_design 1.20.0 → 2.0.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 +167 -31
- package/agents/cards/anuj.md +1 -1
- package/agents/cards/arjun.md +1 -1
- package/agents/cards/chunk-planner.md +5 -0
- package/agents/cards/meera.md +1 -1
- package/agents/cards/mood-board.md +13 -0
- package/agents/cards/noor.md +1 -1
- package/agents/cards/priya.md +1 -1
- package/agents/cards/query-expander.md +17 -0
- package/agents/cards/raj.md +1 -1
- package/agents/cards/ranker.md +16 -0
- package/agents/cards/run-unchunked.md +7 -0
- package/agents/cards/zara.md +1 -1
- package/agents/chain.json +15 -0
- package/agents/manifests/anuj.json +1 -0
- package/agents/manifests/arjun.json +1 -0
- package/agents/manifests/chunk-planner.json +18 -0
- package/agents/manifests/kavi.json +1 -0
- package/agents/manifests/meera.json +1 -0
- package/agents/manifests/mood-board.json +23 -0
- package/agents/manifests/noor.json +1 -0
- package/agents/manifests/priya.json +1 -0
- package/agents/manifests/query-expander.json +13 -0
- package/agents/manifests/raj.json +1 -0
- package/agents/manifests/ranker.json +13 -0
- package/agents/manifests/run-unchunked.json +19 -0
- package/agents/manifests/zara.json +1 -0
- package/agents/router.json +14 -0
- package/agents/session-schema.json +27 -0
- package/dist/.github/ISSUE_TEMPLATE/persona-feedback.yml +75 -0
- package/dist/HOW-TO-USE.md +424 -0
- package/dist/README.md +858 -0
- package/dist/agents/cards/anuj.md +28 -0
- package/dist/agents/cards/arjun.md +29 -0
- package/dist/agents/cards/chunk-planner.md +5 -0
- package/dist/agents/cards/design-director.md +19 -0
- package/dist/agents/cards/devi.md +15 -0
- package/dist/agents/cards/kavi.md +26 -0
- package/dist/agents/cards/meera.md +27 -0
- package/dist/agents/cards/mood-board.md +13 -0
- package/dist/agents/cards/noor.md +28 -0
- package/dist/agents/cards/priya.md +27 -0
- package/dist/agents/cards/query-expander.md +17 -0
- package/dist/agents/cards/raj.md +29 -0
- package/dist/agents/cards/ranker.md +16 -0
- package/dist/agents/cards/run-unchunked.md +7 -0
- package/dist/agents/cards/zara.md +30 -0
- package/dist/agents/chain.json +76 -0
- package/dist/agents/deliberation-schema.json +44 -0
- package/dist/agents/design-spec-schema.json +111 -0
- package/dist/agents/manifests/anuj.json +32 -0
- package/dist/agents/manifests/arjun.json +47 -0
- package/dist/agents/manifests/chunk-planner.json +18 -0
- package/dist/agents/manifests/design-critic.json +21 -0
- package/dist/agents/manifests/design-director.json +26 -0
- package/dist/agents/manifests/devi.json +31 -0
- package/dist/agents/manifests/kavi.json +34 -0
- package/dist/agents/manifests/meera.json +32 -0
- package/dist/agents/manifests/mood-board.json +23 -0
- package/dist/agents/manifests/noor.json +33 -0
- package/dist/agents/manifests/persona-orchestrator.json +17 -0
- package/dist/agents/manifests/priya.json +32 -0
- package/dist/agents/manifests/query-expander.json +13 -0
- package/dist/agents/manifests/raj.json +31 -0
- package/dist/agents/manifests/ranker.json +13 -0
- package/dist/agents/manifests/run-unchunked.json +19 -0
- package/dist/agents/manifests/ux-story-gate.json +23 -0
- package/dist/agents/manifests/zara.json +33 -0
- package/dist/agents/router.json +99 -0
- package/dist/agents/session-schema.json +152 -0
- package/dist/bin/cli.js +1 -1
- package/dist/lib/cache.js +1 -1
- package/dist/lib/chunk-executor.js +1 -0
- package/dist/lib/chunk-models.js +1 -0
- package/dist/lib/chunk-planner.js +1 -0
- package/dist/lib/chunk-router.js +1 -0
- package/dist/lib/chunk-run.js +1 -0
- package/dist/lib/chunk-synthesis.js +1 -0
- package/dist/lib/chunk-telemetry.js +1 -0
- package/dist/lib/collect.js +1 -1
- package/dist/lib/cost.js +1 -1
- package/dist/lib/dedup.js +1 -0
- package/dist/lib/deliberation.js +1 -1
- package/dist/lib/design-spec.js +1 -1
- package/dist/lib/evolve.js +1 -0
- package/dist/lib/export.js +1 -1
- package/dist/lib/feedback-submit.js +1 -1
- package/dist/lib/feedback.js +1 -1
- package/dist/lib/host-llm.js +1 -1
- package/dist/lib/install.js +1 -1
- package/dist/lib/knowledge.js +1 -1
- package/dist/lib/lessons.js +1 -0
- package/dist/lib/moodboard.js +1 -0
- package/dist/lib/orchestrator/run.js +1 -1
- package/dist/lib/outcome.js +1 -0
- package/dist/lib/platforms.js +1 -1
- package/dist/lib/provider.js +1 -1
- package/dist/lib/query-expander.js +1 -0
- package/dist/lib/ranker.js +1 -0
- package/dist/lib/research.js +1 -1
- package/dist/lib/retrieve.js +1 -1
- package/dist/lib/session.js +1 -1
- package/dist/lib/source-discovery.js +1 -1
- package/dist/lib/synthesis.js +1 -1
- package/dist/lib/token-gate.js +1 -1
- package/dist/skills/anuj/SKILL.md +92 -0
- package/dist/skills/arjun/SKILL.md +291 -0
- package/dist/skills/chunk-planner/SKILL.md +45 -0
- package/dist/skills/collect-knowledge/SKILL.md +20 -0
- package/dist/skills/deliberation-protocol/SKILL.md +131 -0
- package/dist/skills/design-critic/SKILL.md +191 -0
- package/dist/skills/design-director/SKILL.md +181 -0
- package/dist/skills/design-personas/SKILL.md +100 -0
- package/dist/skills/design-reference/SKILL.md +83 -0
- package/dist/skills/design-reference/app-interface.csv +31 -0
- package/dist/skills/design-reference/charts.csv +26 -0
- package/dist/skills/design-reference/colors.csv +162 -0
- package/dist/skills/design-reference/google-fonts.csv +1924 -0
- package/dist/skills/design-reference/icons.csv +106 -0
- package/dist/skills/design-reference/landing.csv +35 -0
- package/dist/skills/design-reference/products.csv +162 -0
- package/dist/skills/design-reference/react-performance.csv +45 -0
- package/dist/skills/design-reference/stacks/angular.csv +51 -0
- package/dist/skills/design-reference/stacks/astro.csv +54 -0
- package/dist/skills/design-reference/stacks/flutter.csv +53 -0
- package/dist/skills/design-reference/stacks/html-tailwind.csv +56 -0
- package/dist/skills/design-reference/stacks/jetpack-compose.csv +53 -0
- package/dist/skills/design-reference/stacks/laravel.csv +51 -0
- package/dist/skills/design-reference/stacks/nextjs.csv +53 -0
- package/dist/skills/design-reference/stacks/nuxt-ui.csv +51 -0
- package/dist/skills/design-reference/stacks/nuxtjs.csv +59 -0
- package/dist/skills/design-reference/stacks/react-native.csv +52 -0
- package/dist/skills/design-reference/stacks/react.csv +54 -0
- package/dist/skills/design-reference/stacks/shadcn.csv +61 -0
- package/dist/skills/design-reference/stacks/svelte.csv +54 -0
- package/dist/skills/design-reference/stacks/swiftui.csv +51 -0
- package/dist/skills/design-reference/stacks/threejs.csv +54 -0
- package/dist/skills/design-reference/stacks/vue.csv +50 -0
- package/dist/skills/design-reference/styles.csv +85 -0
- package/dist/skills/design-reference/typography.csv +74 -0
- package/dist/skills/design-reference/ui-reasoning.csv +162 -0
- package/dist/skills/design-reference/ux-guidelines.csv +100 -0
- package/dist/skills/design-spec/SKILL.md +106 -0
- package/dist/skills/devi/SKILL.md +114 -0
- package/dist/skills/getting-started/SKILL.md +144 -0
- package/dist/skills/kavi/SKILL.md +118 -0
- package/dist/skills/knowledge-bank/SKILL.md +43 -0
- package/dist/skills/meera/SKILL.md +76 -0
- package/dist/skills/mood-board/SKILL.md +113 -0
- package/dist/skills/noor/SKILL.md +96 -0
- package/dist/skills/persona-orchestrator/SKILL.md +220 -0
- package/dist/skills/priya/SKILL.md +75 -0
- package/dist/skills/raj/SKILL.md +77 -0
- package/dist/skills/run-unchunked/SKILL.md +49 -0
- package/dist/skills/ux-ideator/SKILL.md +187 -0
- package/dist/skills/ux-story-gate/SKILL.md +353 -0
- package/dist/skills/zara/SKILL.md +85 -0
- package/dist/supabase/deliberation-config.example.json +15 -0
- package/dist/supabase/feedback-config.example.json +7 -0
- package/dist/supabase/migrations/001_persona_feedback.sql +54 -0
- package/package.json +2 -2
- package/skills/anuj/SKILL.md +1 -1
- package/skills/arjun/SKILL.md +1 -1
- package/skills/chunk-planner/SKILL.md +45 -0
- package/skills/design-critic/SKILL.md +2 -2
- package/skills/design-director/SKILL.md +1 -1
- package/skills/devi/SKILL.md +1 -1
- package/skills/getting-started/SKILL.md +12 -0
- package/skills/meera/SKILL.md +1 -1
- package/skills/mood-board/SKILL.md +113 -0
- package/skills/noor/SKILL.md +1 -1
- package/skills/persona-orchestrator/SKILL.md +37 -3
- package/skills/priya/SKILL.md +1 -1
- package/skills/run-unchunked/SKILL.md +49 -0
- package/skills/ux-ideator/SKILL.md +1 -1
- package/skills/zara/SKILL.md +1 -1
package/dist/README.md
ADDED
|
@@ -0,0 +1,858 @@
|
|
|
1
|
+
# Analyzthis_Design
|
|
2
|
+
|
|
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
|
+
|
|
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
|
+
|
|
7
|
+
## v2.0 — chunked execution by default
|
|
8
|
+
|
|
9
|
+
`npx analyzthis_design run --task "..."` now uses a **frontier planner + cheap chunk models**:
|
|
10
|
+
|
|
11
|
+
1. Frontier/strong model plans the task into small chunks.
|
|
12
|
+
2. Each chunk runs on the cheapest capable model: local Ollama, free cloud APIs (Groq, Gemini, OpenRouter), or cheap cloud APIs with your keys.
|
|
13
|
+
3. Outputs are merged into a final verdict.
|
|
14
|
+
4. Telemetry learns which models work best for each chunk type.
|
|
15
|
+
|
|
16
|
+
Use `npx analyzthis_design run-unchunked` for the legacy single-pass orchestrator.
|
|
17
|
+
|
|
18
|
+
**npm:** [analyzthis_design](https://www.npmjs.com/package/analyzthis_design) · **Current version:** 2.0.0 · **Step-by-step guide:** [HOW-TO-USE.md](./HOW-TO-USE.md)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# 1. Install slash commands (Cursor/Claude/Codex/Grok/Windsurf)
|
|
26
|
+
npx analyzthis_design
|
|
27
|
+
|
|
28
|
+
# 2. Run a task in v2.0 chunked mode (free/cheap models)
|
|
29
|
+
npx analyzthis_design run --task "Review invoice approval screen"
|
|
30
|
+
|
|
31
|
+
# 3. Or use legacy single-pass orchestrator
|
|
32
|
+
npx analyzthis_design run-unchunked --task "Review invoice approval screen" --provider host
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Install by target IDE
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx analyzthis_design --target claude
|
|
39
|
+
npx analyzthis_design --target codex
|
|
40
|
+
npx analyzthis_design --target grok
|
|
41
|
+
npx analyzthis_design --target windsurf
|
|
42
|
+
npx analyzthis_design --target all --force
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**After install:** type `/getting-started` in Cursor or Claude Code (or `@getting-started` in Windsurf). For a complete walkthrough, see [HOW-TO-USE.md](./HOW-TO-USE.md). Re-print CLI help anytime with `npx analyzthis_design welcome`.
|
|
46
|
+
|
|
47
|
+
| Tool | Skills installed to | Invoke |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| Cursor | `~/.cursor/skills/<name>/SKILL.md` | `/getting-started` |
|
|
50
|
+
| Claude Code | `~/.claude/skills/<name>/SKILL.md` (+ legacy `~/.claude/commands/`) | `/getting-started` |
|
|
51
|
+
| Codex CLI | `~/.codex/skills/<name>/SKILL.md` | skill name / AGENTS.md |
|
|
52
|
+
| Grok Build | `~/.grok/skills/<name>/SKILL.md` | `/kavi` |
|
|
53
|
+
| Windsurf Cascade | `~/.codeium/windsurf/skills/<name>/SKILL.md` | `@kavi` |
|
|
54
|
+
| Cross-agent | `~/.agents/skills/<name>/SKILL.md` | discovered by multiple hosts |
|
|
55
|
+
|
|
56
|
+
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.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Skills Overview
|
|
61
|
+
|
|
62
|
+
### Design — wireframes (start here for new screens)
|
|
63
|
+
|
|
64
|
+
| Command | What it does |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `/getting-started` | **First-run guide** — which command to use for wireframes vs critique |
|
|
67
|
+
| `/design-director` | **Full producer path** — ideation → DesignSpec (tokens + components) → spec gates → implement when approved |
|
|
68
|
+
| `/ux-ideator` | **Full ideation** — two competing text wireframes (minimalist vs dense), deliberation, delight, feasibility, DesignSpec |
|
|
69
|
+
| `/design-spec` | **DesignSpec contract** — layout, tokens, component mapping, states (use with design-director) |
|
|
70
|
+
| `/noor` | **Quick minimalist wireframe** — Concept A text wireframe, progressive disclosure |
|
|
71
|
+
| `/anuj` | **Power-user wireframe** — Concept B text wireframe, density + bulk actions |
|
|
72
|
+
|
|
73
|
+
### Evaluate — critique (existing designs)
|
|
74
|
+
|
|
75
|
+
| Command | What it does |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `/kavi` | **Kavi — Knowledge Archivist.** Scans the codebase, builds an Obsidian vault, LLM-enriches notes, syncs into the knowledge bank. Run once per project before critiques. _(Alias: `/collect-knowledge`)_ |
|
|
78
|
+
| `/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 |
|
|
79
|
+
| `/ux-story-gate` | Task-first gate: PRDs, DS/Figma discovery, MoE routing, browser verify, assess-only mode |
|
|
80
|
+
| `/design-critic` | 4-persona critique → Composite Score + Information Hierarchy Gate |
|
|
81
|
+
| `/deliberation-protocol` | Adversarial review rules — grounding, objection JSON, parallel pairs, Raj escalation |
|
|
82
|
+
|
|
83
|
+
### 9 Personas (+ host runtime)
|
|
84
|
+
|
|
85
|
+
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.
|
|
86
|
+
|
|
87
|
+
| Command | Persona | What they evaluate |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| `/kavi` | Kavi — Knowledge Archivist | Scan repo → Obsidian vault → enrich → sync knowledge bank (producer, not a critic) |
|
|
90
|
+
| `/arjun` | UX + Visual Design | UX Honeycomb + Visual Design Audit (hierarchy, color, type, spacing, components, style fit, micro-interactions) |
|
|
91
|
+
| `/meera` | Business Agent | Retention, ARR, GTM lever, adoption risk; hierarchy vs north-star check |
|
|
92
|
+
| `/priya` | Feasibility Agent | Engineering effort (T-shirt sizing, 2-axis model), state machine traps |
|
|
93
|
+
| `/zara` | Delight Agent | Exactly ONE peak delight moment — never contrast/token recovery (routes to DS Gate + Arjun) |
|
|
94
|
+
| `/noor` | IA Architect | Minimalist Concept A + declared ranked information hierarchy |
|
|
95
|
+
| `/anuj` | Power-User Advocate | Dense Concept B — bulk actions, keyboard shortcuts, hierarchy kept prominent |
|
|
96
|
+
| `/raj` | Arbitrator | Resolves persona stalemates using 5 ranked product principles. Never speaks first. |
|
|
97
|
+
| `/devi` | Host LLM runtime | Voices other personas when CLI `run` uses host mode (no API keys). Reads pending prompts → writes responses → `--continue` resumes |
|
|
98
|
+
|
|
99
|
+
### Supporting skills
|
|
100
|
+
|
|
101
|
+
| Command | Purpose |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `/design-personas` | Session context template — fill in once before a session |
|
|
104
|
+
| `/knowledge-bank` | Auto-populated from your connected vault (or from Kavi collect). All personas read this first. |
|
|
105
|
+
| `/design-reference` | CSV reference data (colors, typography, UX guidelines, stacks, …) |
|
|
106
|
+
| `/collect-knowledge` | Alias for `/kavi` |
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## Agentic system (v1.20)
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
User ask / Figma URL
|
|
114
|
+
↓
|
|
115
|
+
/persona-orchestrator
|
|
116
|
+
↓
|
|
117
|
+
ux-story-gate Phases 0–1.5 (PRD + DS/Figma + MoE router)
|
|
118
|
+
↓
|
|
119
|
+
Adversarial deliberation (parallel objection rounds, low satisfaction default)
|
|
120
|
+
↓
|
|
121
|
+
MoE subset (default) OR full chain (explicit "full")
|
|
122
|
+
↓
|
|
123
|
+
Zara (delight) → Raj on stalemate (after all groups — never before Zara)
|
|
124
|
+
↓
|
|
125
|
+
Phase 5 synthesis (composite score + hierarchy gate + top 3)
|
|
126
|
+
↓
|
|
127
|
+
Hard gates: DS → Hierarchy → Verify
|
|
128
|
+
↓
|
|
129
|
+
SHIP / REVISE / BLOCK
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Devi — host LLM (no API keys) · v1.20
|
|
133
|
+
|
|
134
|
+
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.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
# 1. Start run — pauses at first persona with prompt path
|
|
138
|
+
npx analyzthis_design run --task "Review invoice approval screen" --full
|
|
139
|
+
|
|
140
|
+
# 2. In Cursor / Claude: invoke /devi
|
|
141
|
+
# (reads pending/*.json, writes responses/*.md in persona voice)
|
|
142
|
+
|
|
143
|
+
# 3. Check queue + continue
|
|
144
|
+
npx analyzthis_design devi status
|
|
145
|
+
npx analyzthis_design run --continue --task "Review invoice approval screen" --full
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Prompt queue layout:**
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
~/.analyzthis_design/runs/{project-id}/{run-id}/
|
|
152
|
+
pending/001-arjun.json ← orchestrator writes
|
|
153
|
+
responses/001-arjun.md ← Devi / host IDE writes
|
|
154
|
+
manifest.json
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Submit a response manually:**
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
npx analyzthis_design devi respond \
|
|
161
|
+
--run ~/.analyzthis_design/runs/{project-id}/{run-id} \
|
|
162
|
+
--step 001-arjun \
|
|
163
|
+
--file my-arjun-response.md
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Override host mode** when you have API keys:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
export ANTHROPIC_API_KEY=sk-...
|
|
170
|
+
npx analyzthis_design run --task "..." --provider anthropic
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Skill: `/devi` · Implementation: `lib/host-llm.js`, `lib/provider.js`
|
|
174
|
+
|
|
175
|
+
### Phase 5 synthesis · v1.20
|
|
176
|
+
|
|
177
|
+
After deliberation closes, the orchestrator builds a **composite synthesis** automatically:
|
|
178
|
+
|
|
179
|
+
- Per-persona scores (Arjun, Meera, Priya, Zara)
|
|
180
|
+
- **Verdict:** SHIP / REVISE / BLOCK
|
|
181
|
+
- **Top 3 actionable changes** (ranked)
|
|
182
|
+
- **Information Hierarchy Gate** (Arjun visual hierarchy + Meera hierarchy check)
|
|
183
|
+
|
|
184
|
+
Stored in session as `synthesis` (JSON) and `synthesis_markdown` (display block). Printed at end of every completed `run`.
|
|
185
|
+
|
|
186
|
+
### Adversarial deliberation (v1.19+)
|
|
187
|
+
|
|
188
|
+
Personas **debate** grounded in real task_map, PRD, and UI context — they do not pass generic handoff documents.
|
|
189
|
+
|
|
190
|
+
| Knob | Default | Meaning |
|
|
191
|
+
|------|---------|---------|
|
|
192
|
+
| `satisfaction_threshold` | 0.4 | Personas hard to please — must see evidence before `accepts_prior: true` |
|
|
193
|
+
| `max_rounds` | 3 | Cap on objection rounds (token-bounded) |
|
|
194
|
+
| `parallel_pairs` | Noor∥Anuj, Meera∥Priya | Adversarial critique in parallel |
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
npx analyzthis_design run --task "Review onboarding" --full --dry-run # see deliberation groups
|
|
198
|
+
npx analyzthis_design run --task "..." --satisfaction 0.3 # even harder to satisfy
|
|
199
|
+
npx analyzthis_design run --task "..." --no-deliberate # legacy sequential mode
|
|
200
|
+
npx analyzthis_design metrics # deliberation_rounds, objections
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Config: `~/.analyzthis_design/config.json` → `deliberation` block (see `supabase/deliberation-config.example.json`).
|
|
204
|
+
|
|
205
|
+
Skill: `/deliberation-protocol` | Schema: `agents/deliberation-schema.json`
|
|
206
|
+
|
|
207
|
+
**Low satisfaction ≠ unlimited tokens.** Objection rounds use lite schema + 600-token cap; synthesis and Raj use full produce mode.
|
|
208
|
+
|
|
209
|
+
**Raj order (v1.20):** Raj escalates **after all deliberation groups** complete — Zara always runs before Raj in the critique chain.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
**Shared session state** lives at `~/.analyzthis_design/sessions/{project-id}/session-state.json`.
|
|
214
|
+
|
|
215
|
+
Key fields after a run:
|
|
216
|
+
|
|
217
|
+
| Field | Contents |
|
|
218
|
+
|---|---|
|
|
219
|
+
| `persona_outputs` | Each persona's text + parsed deliberation JSON |
|
|
220
|
+
| `full_prompts` | Exact `{ system, user }` prompts sent to the LLM (for training / auditing) |
|
|
221
|
+
| `structured_outputs` | Parsed grades, score, top fixes per persona |
|
|
222
|
+
| `covered_points` | Deduplicated findings across personas (redundancy suppression) |
|
|
223
|
+
| `task_type` | Canonical problem type from the router |
|
|
224
|
+
| `deliberation` | `round_log`, `open_objections`, `consensus_reached`, `raj_escalated` |
|
|
225
|
+
| `synthesis` | Composite scores, verdict, top 3, hierarchy gate |
|
|
226
|
+
| `synthesis_markdown` | Phase 5 block for display / export |
|
|
227
|
+
| `outcome` | `inferred` + `confirmed` outcome per persona (for the evolution loop) |
|
|
228
|
+
| `host_run` | Host-mode checkpoint when paused for Devi (`run_dir`, `checkpoint`) |
|
|
229
|
+
| `metrics` | `llm_calls`, `deliberation_rounds`, `objections_raised`, token estimates |
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
npx analyzthis_design session init
|
|
233
|
+
npx analyzthis_design session show
|
|
234
|
+
npx analyzthis_design session reset
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Portable agent graph** (same manifests for Cursor / Claude / Codex / CLI):
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
agents/
|
|
241
|
+
manifests/ # one JSON per persona + orchestrator
|
|
242
|
+
router.json # MoE problem-type → expert list
|
|
243
|
+
chain.json # default + ideation sequential graphs
|
|
244
|
+
session-schema.json
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**v2.0 chunked runtime (default for `run`):**
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
# Default: frontier planner + sequential chunk execution on free/cheap models
|
|
251
|
+
npx analyzthis_design run --task "Review invoice approval screen"
|
|
252
|
+
|
|
253
|
+
# Auto-detect local Ollama, otherwise use free cloud models
|
|
254
|
+
npx analyzthis_design run --task "Review invoice approval screen" --budget free
|
|
255
|
+
|
|
256
|
+
# Use your paid keys for cheap cloud models
|
|
257
|
+
npx analyzthis_design run --task "..." --budget cheap --provider together
|
|
258
|
+
|
|
259
|
+
# Limit parallelism / chunk count (sequential is default)
|
|
260
|
+
npx analyzthis_design run --task "..." --sequential --max-chunks 4
|
|
261
|
+
npx analyzthis_design run --task "..." --parallel --max-chunks 6
|
|
262
|
+
|
|
263
|
+
# Legacy single-pass orchestrator (unchunked)
|
|
264
|
+
npx analyzthis_design run-unchunked --task "Review invoice approval screen" --full
|
|
265
|
+
|
|
266
|
+
# Host mode (no API keys) — Devi voices personas via prompt queue
|
|
267
|
+
npx analyzthis_design run-unchunked --task "Review invoice screen" --full
|
|
268
|
+
npx analyzthis_design devi status
|
|
269
|
+
npx analyzthis_design run-unchunked --continue --task "Review invoice screen" --full
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Chunk model selection:** Ollama auto-discovered → free cloud (Groq/Gemini/OpenRouter free endpoints) → cheap cloud with user keys. The **planner always runs on a frontier/strong model** and never on a cheap model; if no frontier provider is available, it falls back to the host model with a warning.
|
|
273
|
+
|
|
274
|
+
**Provider resolution order:** explicit `--provider` → config → first available API key → **`host`** (Devi) for unchunked; chunked mode also considers Ollama and free endpoints before paid.
|
|
275
|
+
|
|
276
|
+
Supported providers: `host` | `anthropic` | `openai` | `google` | `zai` | `ollama` | `groq` | `together` | `openrouter` | `deepseek`
|
|
277
|
+
|
|
278
|
+
Provider defaults live in `~/.analyzthis_design/config.json`:
|
|
279
|
+
|
|
280
|
+
```json
|
|
281
|
+
{
|
|
282
|
+
"orchestrator": {
|
|
283
|
+
"provider": "anthropic",
|
|
284
|
+
"model": "claude-sonnet-5",
|
|
285
|
+
"mode": "lite",
|
|
286
|
+
"tiers": {
|
|
287
|
+
"structured": { "provider": "openai", "model": "gpt-4o-mini" },
|
|
288
|
+
"critique": { "provider": "anthropic", "model": "claude-sonnet-5" },
|
|
289
|
+
"arbitrate": { "provider": "anthropic", "model": "claude-sonnet-5" }
|
|
290
|
+
},
|
|
291
|
+
"max_tokens": { "structured": 900, "critique": 1800, "arbitrate": 1200 }
|
|
292
|
+
},
|
|
293
|
+
"pricing": {
|
|
294
|
+
"glm-4.5-flash": { "input_per_m": 0, "output_per_m": 0 },
|
|
295
|
+
"gemini-2.5-flash": { "input_per_m": 0.30, "output_per_m": 2.50 },
|
|
296
|
+
"claude-sonnet-5": { "input_per_m": 2, "output_per_m": 10 },
|
|
297
|
+
"gpt-4o": { "input_per_m": 2.50, "output_per_m": 10 }
|
|
298
|
+
},
|
|
299
|
+
"research": { "provider": "https://example.com/search?q={query}" },
|
|
300
|
+
"collect": {
|
|
301
|
+
"web_urls": ["https://your-company.com/brand-guidelines"],
|
|
302
|
+
"web_queries": ["competitor onboarding patterns"],
|
|
303
|
+
"web_limit": 10,
|
|
304
|
+
"web_from_repo": true
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
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.
|
|
310
|
+
|
|
311
|
+
**Web research (automatic in collect):**
|
|
312
|
+
|
|
313
|
+
Kavi fetches URLs during `collect` — from config and from links in README/PRD markdown — and merges them into the knowledge bank. You usually do **not** need a separate `research` step.
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
npx analyzthis_design collect # repo + web URLs in one pass
|
|
317
|
+
npx analyzthis_design collect --dry-run # preview URLs Kavi will fetch
|
|
318
|
+
npx analyzthis_design collect --no-web # repo only
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
Manual research (optional, when you want one-off fetches without a full collect):
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
npx analyzthis_design research --url https://example.com/design-tokens
|
|
325
|
+
npx analyzthis_design research --query "EY design system tokens"
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
Writes to `~/.analyzthis_design/sessions/{id}/web-context.md` and merges into the knowledge bank on `sync` / `collect`.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Efficiency & cost (v1.10)
|
|
333
|
+
|
|
334
|
+
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.
|
|
335
|
+
|
|
336
|
+
### Effort-graded model selection (v1.10)
|
|
337
|
+
|
|
338
|
+
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.
|
|
339
|
+
|
|
340
|
+
```mermaid
|
|
341
|
+
flowchart TB
|
|
342
|
+
Ask[User ask] --> Router[MoE router + effort classifier]
|
|
343
|
+
Router -->|effort| Resolve[resolveModel persona effort]
|
|
344
|
+
Resolve -->|gate? hard override| Matrix[effort_matrix in chain.json]
|
|
345
|
+
Resolve -->|persona| Overrides[manifest.effort_overrides]
|
|
346
|
+
Matrix --> Call[callLlm host or API provider]
|
|
347
|
+
Overrides --> Call
|
|
348
|
+
Call --> Metrics[metrics.effort_log + cost_usd]
|
|
349
|
+
Metrics --> CostCmd[npx analyzthis_design cost]
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
Classifier rules (first match wins, safety rules before savings rules):
|
|
353
|
+
- scoped mode active → **trivial** (single dimension by construction)
|
|
354
|
+
- stalemate / any BLOCK / `full_chain` / `full_screen_review` → **hard**
|
|
355
|
+
- `digest.ds_at_risk` non-empty → **hard**
|
|
356
|
+
- REVISE delta follow-up → **trivial**
|
|
357
|
+
- `manifest.tier == structured` → **trivial**, `arbitrate` → **standard**
|
|
358
|
+
- default → **standard**
|
|
359
|
+
|
|
360
|
+
**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.
|
|
361
|
+
|
|
362
|
+
Default effort matrix (in `agents/chain.json`):
|
|
363
|
+
- **trivial** → `host` / Devi (~600-token cap for objection rounds) — or API model when keys set
|
|
364
|
+
- **standard** → `gemini-2.5-flash` or `gpt-4o-mini`, ~1200-token cap
|
|
365
|
+
- **hard** → `claude-sonnet-5` or `gpt-5`, ~1800-token cap
|
|
366
|
+
|
|
367
|
+
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).
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
Ask → session digest → MoE router (1–2 experts, not 4) → persona cards (not full skills)
|
|
371
|
+
→ retrieve-on-demand CSV rows (not whole files) → model tier by step → caches → cost metrics
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
| Lever | Default behavior |
|
|
375
|
+
|---|---|
|
|
376
|
+
| **Expert budget** | 1–2 personas per ask. Full `design-critic` chain only runs for an explicit "full critique" or `full_screen_review`. |
|
|
377
|
+
| **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. |
|
|
378
|
+
| **Delta re-evaluation** | A follow-up after REVISE re-runs only the personas assigned to the prior Top 3 changes, never the full chain. |
|
|
379
|
+
| **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. |
|
|
380
|
+
| **Lite output schema** | Grades + Top 2 fixes + score, by default. Deep/full schema is opt-in. |
|
|
381
|
+
| **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. |
|
|
382
|
+
| **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`. |
|
|
383
|
+
| **Caching** | `lib/cache.js` caches retrieve results (invalidated automatically when the source CSV changes) and knowledge-bank slices (invalidated on `sync` / `session reset`). |
|
|
384
|
+
| **Cost metrics** | Every `run` records `metrics` (llm_calls, experts_run, estimated tokens, cache_hits) into session state. |
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
npx analyzthis_design metrics # last run's cost summary for this project
|
|
388
|
+
npx analyzthis_design metrics --all # across every project
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### What this actually saves (and what it doesn't)
|
|
392
|
+
|
|
393
|
+
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.
|
|
394
|
+
|
|
395
|
+
**Honest, measurable savings on the critique path:**
|
|
396
|
+
|
|
397
|
+
- ~50–75% fewer expert LLM calls on narrow asks (1–2 personas vs. 4).
|
|
398
|
+
- ~50%+ fewer input tokens per `run` (persona cards vs. full SKILL.md).
|
|
399
|
+
- 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).
|
|
400
|
+
- Structured/extract steps can run on a cheaper model with a 900-token cap; only critique/arbitrate uses the strong model.
|
|
401
|
+
- Repeat runs on the same file hit the cache instead of re-processing Figma screenshots, KB slices, and CSV packs.
|
|
402
|
+
- Every saving above is **observable** via `npx analyzthis_design metrics` (`llm_calls`, `input_tokens_est`, `output_tokens_est`, `cache_hits`).
|
|
403
|
+
|
|
404
|
+
**Where the savings come from across the whole loop** (when the host LLM routes a design through the personas):
|
|
405
|
+
|
|
406
|
+
- Fewer revision rounds — DS / hierarchy / contrast failures are caught early instead of after a full review.
|
|
407
|
+
- Data-driven citations ground the LLM so it doesn't hallucinate or re-derive design rules.
|
|
408
|
+
- The host LLM gets a compact digest + targeted fixes, not a wall of prose.
|
|
409
|
+
|
|
410
|
+
**What this is *not*:**
|
|
411
|
+
|
|
412
|
+
- It does **not** generate end-to-end designs using fewer tokens — it critiques.
|
|
413
|
+
- It does **not** save tokens vs. "using no AI at all" — it adds a review layer; it saves tokens vs. an *unstructured* review loop.
|
|
414
|
+
- 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.
|
|
415
|
+
|
|
416
|
+
**LoRA readiness (export hook only — no training in this release):**
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
# Good examples (positive pairs)
|
|
420
|
+
npx analyzthis_design session accept --persona arjun
|
|
421
|
+
npx analyzthis_design export-training --persona arjun --all
|
|
422
|
+
|
|
423
|
+
# Bad output + how you corrected it (negative / DPO pairs) — v1.16
|
|
424
|
+
npx analyzthis_design session accept --persona arjun --reject \
|
|
425
|
+
--comment "Invented tokens not in our DS" \
|
|
426
|
+
--correction "Use --color-primary and spacing-4 from tokens.css" \
|
|
427
|
+
--rating 2 --tags invented_tokens,missed_ds
|
|
428
|
+
|
|
429
|
+
npx analyzthis_design feedback record --persona arjun --rating 2 \
|
|
430
|
+
--comment "Hierarchy wrong — CTA buried" \
|
|
431
|
+
--correction "Primary action should be top-right, above the fold"
|
|
432
|
+
|
|
433
|
+
npx analyzthis_design feedback list
|
|
434
|
+
npx analyzthis_design feedback export --persona arjun --all
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
`export-training` now emits richer training pairs: `{ system_card, system_prompt_full, user_prompt_full, digest, user, assistant, structured_output, outcome, task_type }`. The full prompts are captured automatically on every `run`, so fine-tuning datasets include the exact context the persona saw.
|
|
438
|
+
|
|
439
|
+
**Correction export** writes `{ assistant_rejected, assistant_preferred, user_comment, tags }` to `~/.analyzthis_design/feedback/<persona>-corrections.jsonl` — useful when users were unhappy or had to rewrite persona output. Every entry is also appended to a global `corrections.jsonl` across projects.
|
|
440
|
+
|
|
441
|
+
Once a persona accumulates ~100–300 accepted pairs (and optionally correction pairs), that data is ready for a future fine-tuning pass on an open model — not part of this package yet.
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
## Self-evolving persona team (v1.21)
|
|
446
|
+
|
|
447
|
+
The system now captures every run, learns from accepted outputs + confirmed outcomes, and proposes improvements to its own prompts, reference data, and routing — **dry-run by default**, human review before any apply.
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
Run → full prompts + structured output + outcome captured
|
|
451
|
+
↓
|
|
452
|
+
Lessons extracted (accepted outputs) → ~/.analyzthis_design/lessons/<persona>.jsonl
|
|
453
|
+
↓
|
|
454
|
+
Outcome confirmed (shipped / revised / blocked / missed)
|
|
455
|
+
↓
|
|
456
|
+
evolve --extract → proposes:
|
|
457
|
+
- prompt patches (new canonical failure patterns per persona)
|
|
458
|
+
- reference-data rows (new product-type patterns)
|
|
459
|
+
- router patches (task_type → best-performing expert)
|
|
460
|
+
↓
|
|
461
|
+
evolve --apply <patchId> (human review) → skill/CSV/router updated
|
|
462
|
+
↓
|
|
463
|
+
Next run retrieves:
|
|
464
|
+
- per-persona knowledge slices (priority + fallback)
|
|
465
|
+
- past lessons for similar tasks
|
|
466
|
+
- query-expanded + ranked reference rows
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
### Retrieval stack
|
|
470
|
+
|
|
471
|
+
| Layer | What it does | Files |
|
|
472
|
+
|---|---|---|
|
|
473
|
+
| **Query expansion** | One cheap LLM call per run expands the task into search terms (product type, design domain, component, persona lens) | `lib/query-expander.js`, `agents/cards/query-expander.md` |
|
|
474
|
+
| **Per-persona ranking** | A second cheap LLM call per persona ranks the top 5 reference rows + knowledge notes for that persona's lens | `lib/ranker.js`, `agents/cards/ranker.md` |
|
|
475
|
+
| **Lessons retrieval** | Top-3 lessons from past accepted sessions, keyword-matched to the current task | `lib/lessons.js` |
|
|
476
|
+
| **Redundancy suppression** | Before each persona produces, it sees what prior personas already covered and is told to only add NEW insights | `lib/dedup.js`, `lib/deliberation.js` |
|
|
477
|
+
| **Per-persona KB slices** | `sync` now builds a filtered slice per persona (priority categories first, small fallback context at the end) | `lib/knowledge.js` |
|
|
478
|
+
|
|
479
|
+
### Commands
|
|
480
|
+
|
|
481
|
+
```bash
|
|
482
|
+
# Extract lessons + infer outcomes + propose patches (dry-run by default)
|
|
483
|
+
npx analyzthis_design evolve --extract [--window N] [--dry-run]
|
|
484
|
+
|
|
485
|
+
# Review a patch before applying
|
|
486
|
+
npx analyzthis_design evolve --apply <patchId> --dry-run
|
|
487
|
+
|
|
488
|
+
# Apply a patch after review (prompt / reference rows only; router patches need manual edit)
|
|
489
|
+
npx analyzthis_design evolve --apply <patchId>
|
|
490
|
+
|
|
491
|
+
# Outcome tracking
|
|
492
|
+
npx analyzthis_design outcome --infer [--window N] # auto-infer from next session
|
|
493
|
+
npx analyzthis_design outcome --pending # list inferred outcomes awaiting confirmation
|
|
494
|
+
npx analyzthis_design outcome --confirm --persona arjun --result shipped
|
|
495
|
+
```
|
|
496
|
+
|
|
497
|
+
Config in `agents/chain.json` → `evolution` block: `extraction_window_days`, `min_lessons_for_patch`, `min_outcomes_for_router_patch`.
|
|
498
|
+
|
|
499
|
+
---
|
|
500
|
+
|
|
501
|
+
## Persona feedback — corrections & unhappiness (v1.16)
|
|
502
|
+
|
|
503
|
+
When a persona gets it wrong, you can record **what was wrong** and **how you fixed it**. This feeds future fine-tuning (negative / DPO pairs) alongside the existing positive `export-training` path.
|
|
504
|
+
|
|
505
|
+
| Command | Purpose |
|
|
506
|
+
|---------|---------|
|
|
507
|
+
| `feedback record` | Log rating, comment, correction, tags for a persona's last output |
|
|
508
|
+
| `feedback list` | See all feedback for this project (or `--all`) |
|
|
509
|
+
| `feedback export` | Write `{ assistant_rejected, assistant_preferred, … }` JSONL |
|
|
510
|
+
| `session accept --reject --comment …` | Reject + record in one step |
|
|
511
|
+
|
|
512
|
+
Suggested tags: `wrong_hierarchy`, `invented_tokens`, `missed_ds`, `too_verbose`, `bad_ia`, `off_brief`.
|
|
513
|
+
|
|
514
|
+
Stored in `session-state.json` → `feedback_log` and appended globally to `~/.analyzthis_design/feedback/corrections.jsonl`.
|
|
515
|
+
|
|
516
|
+
### Community collection (v1.17) — opt-in submit
|
|
517
|
+
|
|
518
|
+
For **open-source contributors**, share anonymized corrections with maintainers:
|
|
519
|
+
|
|
520
|
+
```bash
|
|
521
|
+
npx analyzthis_design feedback record --persona arjun --rating 2 --comment "..." --correction "..."
|
|
522
|
+
npx analyzthis_design feedback submit --dry-run # preview redacted payload
|
|
523
|
+
npx analyzthis_design feedback submit --all --yes # send unsent entries (asks consent once)
|
|
524
|
+
npx analyzthis_design feedback status
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
**What gets sent:** persona, rating, tags, comment, correction, redacted output snippets, anonymous install id, package version.
|
|
528
|
+
|
|
529
|
+
**What does NOT get sent:** project paths, repo names, emails, API keys, full source trees.
|
|
530
|
+
|
|
531
|
+
**Maintainer setup (Supabase):**
|
|
532
|
+
|
|
533
|
+
1. Create a Supabase project
|
|
534
|
+
2. Run `supabase/migrations/001_persona_feedback.sql` in the SQL editor
|
|
535
|
+
3. Copy `supabase/feedback-config.example.json` into `~/.analyzthis_design/config.json` under `"feedback"` (or set env vars `ANALYZTHIS_FEEDBACK_URL` + `ANALYZTHIS_FEEDBACK_ANON_KEY`)
|
|
536
|
+
4. View submissions in Supabase Table Editor → `persona_feedback`
|
|
537
|
+
|
|
538
|
+
Users can also file GitHub issues via **Persona feedback** template if they prefer not to use CLI submit.
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
## DesignSpec — Designer-grade handoff (v1.15)
|
|
543
|
+
|
|
544
|
+
Personas can now guide **what** and **how** to design — not just critique.
|
|
545
|
+
|
|
546
|
+
```
|
|
547
|
+
/ux-ideator or /design-director
|
|
548
|
+
↓
|
|
549
|
+
Text wireframe + information hierarchy
|
|
550
|
+
↓
|
|
551
|
+
DesignSpec JSON (layout, tokens, components, states)
|
|
552
|
+
↓
|
|
553
|
+
Spec gates: DS + hierarchy + Arjun visual
|
|
554
|
+
↓
|
|
555
|
+
status: ship → implement (if build_approved)
|
|
556
|
+
↓
|
|
557
|
+
Browser verify + delta critique
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
**DesignSpec** fields: `intent`, `information_hierarchy`, `layout.regions`, `tokens` (from your DS), `components[]` (real import paths), `states` (empty/loading/error/success), `do`/`dont`.
|
|
561
|
+
|
|
562
|
+
```bash
|
|
563
|
+
npx analyzthis_design spec template # empty copy-paste block
|
|
564
|
+
npx analyzthis_design spec validate --file design-spec.json
|
|
565
|
+
npx analyzthis_design spec save --file design-spec.json
|
|
566
|
+
npx analyzthis_design spec show
|
|
567
|
+
```
|
|
568
|
+
|
|
569
|
+
Schema: `agents/design-spec-schema.json`. Producer orchestration: `/design-director`.
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
## UX Story Gate — How it works
|
|
574
|
+
|
|
575
|
+
`/ux-story-gate` is the task-first gate for any screen evaluation:
|
|
576
|
+
|
|
577
|
+
| Phase | What it does |
|
|
578
|
+
|---|---|
|
|
579
|
+
| 0 | PRD discovery from knowledge bank + repo |
|
|
580
|
+
| 0.5 | DS / Figma discovery + DS Token Checklist (exit criteria) |
|
|
581
|
+
| 1 | Task map intake gate |
|
|
582
|
+
| 1.5 | MoE problem-type router → writes `routing_decision` to session state |
|
|
583
|
+
| 2 | Field veto pass |
|
|
584
|
+
| 3 | Scale & states declaration |
|
|
585
|
+
| 4 | Per-task persona routing |
|
|
586
|
+
| 4.5 | Browser verify gate (navigate → snapshot → primary flow → mobile+desktop screenshot) |
|
|
587
|
+
| 5 | Task × Finding synthesis |
|
|
588
|
+
| 5.5 | Assess-only mode — no code changes until you say build / implement / apply |
|
|
589
|
+
|
|
590
|
+
---
|
|
591
|
+
|
|
592
|
+
## Knowledge collection — Kavi (v1.14)
|
|
593
|
+
|
|
594
|
+
Kavi is a **producer** persona (not a critic). One command scans the current repo, **discovers Obsidian vaults and knowledge graphs**, **fetches external URLs**, writes an Obsidian vault with dynamic `Sources/*.md` manifests, optionally enriches notes, then auto-connects and syncs everything into the knowledge bank.
|
|
595
|
+
|
|
596
|
+
```
|
|
597
|
+
/kavi (or npx analyzthis_design collect)
|
|
598
|
+
↓
|
|
599
|
+
Scan codebase → draft Obsidian notes
|
|
600
|
+
↓
|
|
601
|
+
Discover knowledge sources (.obsidian vaults, wikis, refs in README/docs)
|
|
602
|
+
↓
|
|
603
|
+
Write Sources/*.md manifest notes + _meta/knowledge-sources.md
|
|
604
|
+
↓
|
|
605
|
+
Auto-connect discovered vaults + fetch web URLs → web-context.md
|
|
606
|
+
↓
|
|
607
|
+
LLM enrich (optional)
|
|
608
|
+
↓
|
|
609
|
+
connect + sync → knowledge bank (repo + vaults + web)
|
|
610
|
+
↓
|
|
611
|
+
Personas read unified context first
|
|
612
|
+
```
|
|
613
|
+
|
|
614
|
+
```bash
|
|
615
|
+
# In your app repo (sync KB to every host):
|
|
616
|
+
npx analyzthis_design collect --target all
|
|
617
|
+
npx analyzthis_design collect --dry-run # preview notes + URLs
|
|
618
|
+
npx analyzthis_design collect --no-web # skip external fetch
|
|
619
|
+
npx analyzthis_design collect --no-enrich --limit 50
|
|
620
|
+
npx analyzthis_design collect --vault ~/Documents/MyProjectVault --target claude
|
|
621
|
+
```
|
|
622
|
+
|
|
623
|
+
Add external sources and vault paths in `~/.analyzthis_design/config.json`:
|
|
624
|
+
|
|
625
|
+
```json
|
|
626
|
+
{
|
|
627
|
+
"collect": {
|
|
628
|
+
"source_paths": ["~/Documents/MyCompanyVault"],
|
|
629
|
+
"scan_home_vaults": false,
|
|
630
|
+
"auto_connect_discovered": true,
|
|
631
|
+
"web_urls": ["https://your-company.com/brand-guidelines"],
|
|
632
|
+
"web_limit": 10
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
Kavi auto-discovers: `.obsidian/` vaults in the repo, markdown wikis, knowledge-graph mentions, and vault paths referenced in README / AGENTS.md / docs. Each discovery gets a `Sources/*.md` manifest note fed into the knowledge bank.
|
|
638
|
+
|
|
639
|
+
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.
|
|
640
|
+
|
|
641
|
+
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.
|
|
642
|
+
|
|
643
|
+
---
|
|
644
|
+
|
|
645
|
+
## Knowledge Bank — Connect your vault
|
|
646
|
+
|
|
647
|
+
```bash
|
|
648
|
+
# Option A — let Kavi build the vault from the codebase (recommended for new projects)
|
|
649
|
+
npx analyzthis_design collect
|
|
650
|
+
|
|
651
|
+
# Option B — connect an existing Obsidian vault or markdown folder
|
|
652
|
+
npx analyzthis_design connect --vault ~/Documents/MyVault
|
|
653
|
+
npx analyzthis_design connect --vault ~/vault --tags design,brand,prd,product
|
|
654
|
+
npx analyzthis_design connect --vault ~/vault --include Design,Brand,PRDs,Research
|
|
655
|
+
npx analyzthis_design sync
|
|
656
|
+
npx analyzthis_design sync --target all
|
|
657
|
+
npx analyzthis_design status
|
|
658
|
+
npx analyzthis_design disconnect --vault ~/Documents/MyVault
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
PRDs and user stories are surfaced at the top of the knowledge bank. Brand / design-system notes feed Phase 0.5. Web research merges under **Web Research Context**.
|
|
662
|
+
|
|
663
|
+
Config: `~/.analyzthis_design/config.json`.
|
|
664
|
+
|
|
665
|
+
---
|
|
666
|
+
|
|
667
|
+
## CLI Reference
|
|
668
|
+
|
|
669
|
+
```bash
|
|
670
|
+
# Install / remove / list / welcome
|
|
671
|
+
npx analyzthis_design
|
|
672
|
+
npx analyzthis_design --target all
|
|
673
|
+
npx analyzthis_design --force
|
|
674
|
+
npx analyzthis_design welcome [--target cursor|claude|all]
|
|
675
|
+
npx analyzthis_design remove --target all
|
|
676
|
+
npx analyzthis_design list --target all
|
|
677
|
+
|
|
678
|
+
# Design spec
|
|
679
|
+
npx analyzthis_design spec template
|
|
680
|
+
npx analyzthis_design spec validate --file design-spec.json
|
|
681
|
+
npx analyzthis_design spec save --file design-spec.json
|
|
682
|
+
npx analyzthis_design spec show
|
|
683
|
+
|
|
684
|
+
# Knowledge collection (Kavi)
|
|
685
|
+
npx analyzthis_design collect [--vault path] [--dry-run] [--no-enrich] [--no-web] [--no-discover] [--web-limit N] [--target ...]
|
|
686
|
+
|
|
687
|
+
# Knowledge bank
|
|
688
|
+
npx analyzthis_design connect --vault <path> [--tags ...] [--include ...]
|
|
689
|
+
npx analyzthis_design sync [--target all]
|
|
690
|
+
npx analyzthis_design disconnect --vault <path>
|
|
691
|
+
npx analyzthis_design status
|
|
692
|
+
|
|
693
|
+
# Session (agentic)
|
|
694
|
+
npx analyzthis_design session init|show|reset [--project id] [--all]
|
|
695
|
+
npx analyzthis_design session accept --persona <id> [--reject] [--comment "..."] [--correction "..."] [--rating 1-5] [--tags a,b]
|
|
696
|
+
|
|
697
|
+
# Persona feedback (v1.16)
|
|
698
|
+
npx analyzthis_design feedback record --persona <id> [--rating 1-5] [--comment "..."] [--correction "..."] [--tags a,b]
|
|
699
|
+
npx analyzthis_design feedback list [--all]
|
|
700
|
+
npx analyzthis_design feedback export [--persona <id>] [--all] [--output path] [--include-positive]
|
|
701
|
+
npx analyzthis_design feedback submit [--persona <id>] [--all] [--yes] [--dry-run]
|
|
702
|
+
npx analyzthis_design feedback status
|
|
703
|
+
npx analyzthis_design feedback revoke
|
|
704
|
+
|
|
705
|
+
# Research
|
|
706
|
+
npx analyzthis_design research --url <url>
|
|
707
|
+
npx analyzthis_design research --query <text>
|
|
708
|
+
|
|
709
|
+
# Reference data (retrieve-on-demand)
|
|
710
|
+
npx analyzthis_design retrieve --file <csv> --column <col> --keywords a,b [--limit N]
|
|
711
|
+
|
|
712
|
+
# Standalone orchestrator
|
|
713
|
+
npx analyzthis_design run --task "..." [--figma URL] [--provider host|anthropic|openai|google|zai] [--dry-run] [--output path]
|
|
714
|
+
npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b]
|
|
715
|
+
npx analyzthis_design run --task "..." [--deliberate | --no-deliberate] [--max-rounds N] [--satisfaction 0.4]
|
|
716
|
+
npx analyzthis_design run --continue --task "..." # resume host-mode run after /devi
|
|
717
|
+
|
|
718
|
+
# Self-evolving team (v1.21)
|
|
719
|
+
npx analyzthis_design evolve --extract [--window N] [--dry-run]
|
|
720
|
+
npx analyzthis_design evolve --apply <patchId> [--dry-run]
|
|
721
|
+
npx analyzthis_design outcome --infer [--window N]
|
|
722
|
+
npx analyzthis_design outcome --pending
|
|
723
|
+
npx analyzthis_design outcome --confirm --persona <id> --result shipped|revised|blocked|missed
|
|
724
|
+
|
|
725
|
+
# Mood board (v1.22)
|
|
726
|
+
npx analyzthis_design moodboard create --task "..." [--auto] [--url <url> ...]
|
|
727
|
+
npx analyzthis_design moodboard critique --board <id>
|
|
728
|
+
npx analyzthis_design moodboard add --board <id> --url <url> --title "..." --tags a,b
|
|
729
|
+
npx analyzthis_design moodboard list
|
|
730
|
+
|
|
731
|
+
# Devi — host LLM queue (v1.20)
|
|
732
|
+
npx analyzthis_design devi status [--run path]
|
|
733
|
+
npx analyzthis_design devi respond --run <run-dir> --step 001-arjun --file response.md
|
|
734
|
+
|
|
735
|
+
# Efficiency / cost
|
|
736
|
+
npx analyzthis_design metrics [--project id] [--all]
|
|
737
|
+
npx analyzthis_design cost [--project id] [--all]
|
|
738
|
+
npx analyzthis_design export-training --persona <id> [--project id] [--all] [--output path]
|
|
739
|
+
npx analyzthis_design feedback export [--persona <id>] [--project id] [--all] [--output path]
|
|
740
|
+
```
|
|
741
|
+
|
|
742
|
+
---
|
|
743
|
+
|
|
744
|
+
## Repository structure
|
|
745
|
+
|
|
746
|
+
```
|
|
747
|
+
agents/ Portable MoE graph (manifests, router, chain, session schema)
|
|
748
|
+
cards/ Short per-persona system prompts (~500 tokens each)
|
|
749
|
+
bin/cli.js CLI entry point
|
|
750
|
+
lib/
|
|
751
|
+
install.js Skill installation
|
|
752
|
+
knowledge.js Vault sync + web-context merge
|
|
753
|
+
collect.js Kavi — codebase scan → vault → source discovery → enrich → sync
|
|
754
|
+
source-discovery.js Obsidian vault / wiki / knowledge-graph discovery + manifest MD
|
|
755
|
+
platforms.js Cross-host skill paths (Cursor, Claude, Codex, Grok, Windsurf, agents)
|
|
756
|
+
session.js Shared session-state.json (+ digest, metrics, vault_path)
|
|
757
|
+
research.js URL / query → web-context.md
|
|
758
|
+
retrieve.js Filtered, citation-ready CSV row retrieval
|
|
759
|
+
cache.js On-disk cache for retrieve/kb slices
|
|
760
|
+
chunk-models.js Curated free/cheap model pool + Ollama auto-discovery
|
|
761
|
+
chunk-planner.js Frontier/strong model chunk planner
|
|
762
|
+
chunk-router.js Cheapest capable model per chunk
|
|
763
|
+
chunk-executor.js Chunk execution with retry + fallback
|
|
764
|
+
chunk-synthesis.js Merge chunk outputs into final verdict
|
|
765
|
+
chunk-telemetry.js Per-chunk model quality tracking
|
|
766
|
+
chunk-run.js Top-level chunked execution coordinator
|
|
767
|
+
moodboard.js Mood-board engine: collect web/DS references, tag, deliberate
|
|
768
|
+
dedup.js Cross-persona redundancy detection
|
|
769
|
+
lessons.js Self-evolving lessons store (extract/retrieve/inject)
|
|
770
|
+
outcome.js Infer + confirm persona outcome labels
|
|
771
|
+
query-expander.js LLM task → search terms for retrieval
|
|
772
|
+
ranker.js LLM per-persona ranking of reference/knowledge candidates
|
|
773
|
+
evolve.js Evolution engine: prompt/reference/router patch proposals
|
|
774
|
+
export.js LoRA training-pair export hook
|
|
775
|
+
feedback.js Persona unhappiness + correction logging (session + global JSONL)
|
|
776
|
+
feedback-submit.js Opt-in anonymized submit to Supabase (community feedback)
|
|
777
|
+
deliberation.js Adversarial satisfaction loops, context pack, Raj escalation
|
|
778
|
+
host-llm.js Devi bridge — pending/response queue, checkpoint on pause
|
|
779
|
+
provider.js Auto-detect API keys or default to host
|
|
780
|
+
synthesis.js Phase 5 composite score + hierarchy gate + top 3
|
|
781
|
+
cost.js $-cost report from metrics × config.pricing
|
|
782
|
+
orchestrator/run.js Standalone runtime (v2) — MoE, host/API providers, synthesis
|
|
783
|
+
scripts/
|
|
784
|
+
run-live-quality.js Host-mode quality test (fixtures through real engine)
|
|
785
|
+
quality-check.js Validate persona outputs vs skill + deliberation protocol
|
|
786
|
+
demo-fictional-deliberation.js Dry-run walkthrough for FlowPay scenario
|
|
787
|
+
scripts/obfuscate.js Build step → dist/
|
|
788
|
+
skills/
|
|
789
|
+
devi/ Host LLM runtime — voices personas from pending prompts
|
|
790
|
+
kavi/ Kavi — Knowledge Archivist (/kavi)
|
|
791
|
+
collect-knowledge/ Alias for Kavi (backward compatible)
|
|
792
|
+
persona-orchestrator/ Agentic critique entry point
|
|
793
|
+
deliberation-protocol/ Adversarial review rules (v1.19+)
|
|
794
|
+
ux-story-gate/ Task-first gate + DS/MoE/verify/assess phases
|
|
795
|
+
design-critic/ 4-persona critique + hierarchy gate
|
|
796
|
+
ux-ideator/ 6-phase ideation
|
|
797
|
+
arjun/ meera/ priya/ zara/ noor/ anuj/ raj/
|
|
798
|
+
design-personas/ knowledge-bank/ design-reference/
|
|
799
|
+
```
|
|
800
|
+
|
|
801
|
+
---
|
|
802
|
+
|
|
803
|
+
## Requirements
|
|
804
|
+
|
|
805
|
+
- Node.js 16+
|
|
806
|
+
- 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
|
|
807
|
+
- **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`
|
|
808
|
+
- **Kavi `collect` enrichment:** optional — same keys as above; without keys, draft vault + sync still run
|
|
809
|
+
|
|
810
|
+
---
|
|
811
|
+
|
|
812
|
+
## What's new in v2.0
|
|
813
|
+
|
|
814
|
+
| Feature | Description |
|
|
815
|
+
|---------|-------------|
|
|
816
|
+
| **Chunked execution by default** | Frontier planner → cheap chunk models (Ollama, free/cheap cloud) → synthesis |
|
|
817
|
+
| **Model router** | Auto-discovers Ollama + uses curated free/cheap cloud model pool |
|
|
818
|
+
| **Chunk telemetry** | Tracks per-model success rate so router improves over time |
|
|
819
|
+
| **Legacy mode preserved** | `npx analyzthis_design run-unchunked` for the original single-pass orchestrator |
|
|
820
|
+
| **Planner never cheap** | Planner always uses frontier/host; chunk models are cost-optimized |
|
|
821
|
+
|
|
822
|
+
## What's new in v1.22
|
|
823
|
+
|
|
824
|
+
| Feature | Description |
|
|
825
|
+
|---------|-------------|
|
|
826
|
+
| **Mood boards** | `/mood-board` collects web references + design-system patterns, tags them, and runs team deliberation |
|
|
827
|
+
| **User-contributed references** | User can add URLs/notes to a board and rerun the critique loop |
|
|
828
|
+
| **Visual direction setting** | Arjun, Meera, Priya, Zara, Noor score references via the UX Honeycomb rigor matrix |
|
|
829
|
+
| **Workspace artifacts** | `moodboard/{boardId}.json` is written into the project for the user to inspect |
|
|
830
|
+
|
|
831
|
+
## What's new in v1.21
|
|
832
|
+
|
|
833
|
+
| Feature | Description |
|
|
834
|
+
|---------|-------------|
|
|
835
|
+
| **Self-evolving team** | `evolve --extract` harvests lessons + outcomes; proposes prompt/CSV/router patches |
|
|
836
|
+
| **Per-persona knowledge slices** | `sync` builds filtered context per persona (priority categories + fallback) |
|
|
837
|
+
| **Query expansion + ranking** | Cheap LLM calls broaden retrieval and rank references per persona lens |
|
|
838
|
+
| **Lessons store** | Past accepted fixes are retrieved for similar future tasks |
|
|
839
|
+
| **Outcome tracking** | `outcome --confirm` / `--infer` labels whether a persona's output actually shipped |
|
|
840
|
+
| **Full-prompt training export** | `export-training` now emits the exact `{ system, user }` prompts + structured output |
|
|
841
|
+
| **Redundancy suppression** | Personas see what prior personas already covered and add only new insights |
|
|
842
|
+
|
|
843
|
+
## What's new in v1.20
|
|
844
|
+
|
|
845
|
+
| Feature | Description |
|
|
846
|
+
|---------|-------------|
|
|
847
|
+
| **`/devi` host LLM** | No API keys needed — orchestrator writes prompts, host IDE voices personas |
|
|
848
|
+
| **`run --continue`** | Resume after Devi fills `responses/*.md` |
|
|
849
|
+
| **Phase 5 synthesis** | Auto composite score, verdict, top 3, hierarchy gate in session |
|
|
850
|
+
| **Raj ordering fix** | Zara always runs before Raj; Raj escalates after all groups |
|
|
851
|
+
| **Rebuttal rounds** | Prompts require new evidence — no verbatim repeat on objection re-runs |
|
|
852
|
+
| **`devi status` / `devi respond`** | CLI helpers for the prompt queue |
|
|
853
|
+
|
|
854
|
+
---
|
|
855
|
+
|
|
856
|
+
## License
|
|
857
|
+
|
|
858
|
+
MIT — [Rishikesh Joshi](https://github.com/rishikeshjoshi)
|