analyzthis_design 1.11.0 → 1.15.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
@@ -30,10 +30,12 @@ npx analyzthis_design --target windsurf
30
30
  npx analyzthis_design --target all --force
31
31
  ```
32
32
 
33
+ **After install:** type `/getting-started` in Cursor or Claude Code (or `@getting-started` in Windsurf). Re-print CLI help anytime with `npx analyzthis_design welcome`.
34
+
33
35
  | Tool | Skills installed to | Invoke |
34
36
  |---|---|---|
35
- | Cursor | `~/.cursor/skills/<name>/SKILL.md` | `/collect-knowledge` |
36
- | Claude Code | `~/.claude/skills/<name>/SKILL.md` (+ legacy `~/.claude/commands/`) | `/collect-knowledge` |
37
+ | Cursor | `~/.cursor/skills/<name>/SKILL.md` | `/getting-started` |
38
+ | Claude Code | `~/.claude/skills/<name>/SKILL.md` (+ legacy `~/.claude/commands/`) | `/getting-started` |
37
39
  | Codex CLI | `~/.codex/skills/<name>/SKILL.md` | skill name / AGENTS.md |
38
40
  | Grok Build | `~/.grok/skills/<name>/SKILL.md` | `/collect-knowledge` |
39
41
  | Windsurf Cascade | `~/.codeium/windsurf/skills/<name>/SKILL.md` | `@collect-knowledge` |
@@ -45,19 +47,29 @@ All skills use the **Agent Skills** `SKILL.md` standard — same files work acro
45
47
 
46
48
  ## Skills Overview
47
49
 
48
- ### Entry points (start here)
50
+ ### Design wireframes (start here for new screens)
51
+
52
+ | Command | What it does |
53
+ |---|---|
54
+ | `/getting-started` | **First-run guide** — which command to use for wireframes vs critique |
55
+ | `/design-director` | **Full producer path** — ideation → DesignSpec (tokens + components) → spec gates → implement when approved |
56
+ | `/ux-ideator` | **Full ideation** — two competing text wireframes (minimalist vs dense), deliberation, delight, feasibility, DesignSpec |
57
+ | `/design-spec` | **DesignSpec contract** — layout, tokens, component mapping, states (use with design-director) |
58
+ | `/noor` | **Quick minimalist wireframe** — Concept A text wireframe, progressive disclosure |
59
+ | `/anuj` | **Power-user wireframe** — Concept B text wireframe, density + bulk actions |
60
+
61
+ ### Evaluate — critique (existing designs)
49
62
 
50
63
  | Command | What it does |
51
64
  |---|---|
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. |
54
- | `/ux-story-gate` | Task-first gate: discovers PRDs, DS/Figma discovery, MoE routing, browser verify, assess-only mode. |
55
- | `/design-critic` | 4-persona critique → `SHIP / REVISE / BLOCK` verdict with a Composite Score out of 20 + Information Hierarchy Gate. |
56
- | `/ux-ideator` | 6-phase ideation → two competing IA concepts, deliberation, delight pass, feasibility check. |
65
+ | `/collect-knowledge` | **Kavi — Knowledge Archivist.** Scans the codebase, builds an Obsidian vault, LLM-enriches notes, syncs into the knowledge bank. Run once per project before critiques. |
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
+ | `/ux-story-gate` | Task-first gate: PRDs, DS/Figma discovery, MoE routing, browser verify, assess-only mode |
68
+ | `/design-critic` | 4-persona critique → Composite Score + Information Hierarchy Gate |
57
69
 
58
70
  ### 8 Personas
59
71
 
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.
72
+ 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 `/collect-knowledge` first so they have project context.
61
73
 
62
74
  | Command | Persona | What they evaluate |
63
75
  |---|---|---|
@@ -80,7 +92,7 @@ Invoke critique personas for targeted, already-grounded questions. For full scre
80
92
 
81
93
  ---
82
94
 
83
- ## Agentic system (v1.11)
95
+ ## Agentic system (v1.15)
84
96
 
85
97
  ```
86
98
  User ask / Figma URL
@@ -150,20 +162,36 @@ Provider defaults live in `~/.analyzthis_design/config.json`:
150
162
  "claude-sonnet-5": { "input_per_m": 2, "output_per_m": 10 },
151
163
  "gpt-4o": { "input_per_m": 2.50, "output_per_m": 10 }
152
164
  },
153
- "research": { "provider": "https://example.com/search?q={query}" }
165
+ "research": { "provider": "https://example.com/search?q={query}" },
166
+ "collect": {
167
+ "web_urls": ["https://your-company.com/brand-guidelines"],
168
+ "web_queries": ["competitor onboarding patterns"],
169
+ "web_limit": 10,
170
+ "web_from_repo": true
171
+ }
154
172
  }
155
173
  ```
156
174
 
157
175
  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
176
 
159
- **Web research:**
177
+ **Web research (automatic in collect):**
178
+
179
+ 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.
180
+
181
+ ```bash
182
+ npx analyzthis_design collect # repo + web URLs in one pass
183
+ npx analyzthis_design collect --dry-run # preview URLs Kavi will fetch
184
+ npx analyzthis_design collect --no-web # repo only
185
+ ```
186
+
187
+ Manual research (optional, when you want one-off fetches without a full collect):
160
188
 
161
189
  ```bash
162
190
  npx analyzthis_design research --url https://example.com/design-tokens
163
191
  npx analyzthis_design research --query "EY design system tokens"
164
192
  ```
165
193
 
166
- Writes to `~/.analyzthis_design/sessions/{id}/web-context.md` and merges into the knowledge bank on `sync`.
194
+ Writes to `~/.analyzthis_design/sessions/{id}/web-context.md` and merges into the knowledge bank on `sync` / `collect`.
167
195
 
168
196
  ---
169
197
 
@@ -262,6 +290,37 @@ Writes `{ system_card, digest, user, assistant }` JSONL pairs to `~/.analyzthis_
262
290
 
263
291
  ---
264
292
 
293
+ ## DesignSpec — Designer-grade handoff (v1.15)
294
+
295
+ Personas can now guide **what** and **how** to design — not just critique.
296
+
297
+ ```
298
+ /ux-ideator or /design-director
299
+
300
+ Text wireframe + information hierarchy
301
+
302
+ DesignSpec JSON (layout, tokens, components, states)
303
+
304
+ Spec gates: DS + hierarchy + Arjun visual
305
+
306
+ status: ship → implement (if build_approved)
307
+
308
+ Browser verify + delta critique
309
+ ```
310
+
311
+ **DesignSpec** fields: `intent`, `information_hierarchy`, `layout.regions`, `tokens` (from your DS), `components[]` (real import paths), `states` (empty/loading/error/success), `do`/`dont`.
312
+
313
+ ```bash
314
+ npx analyzthis_design spec template # empty copy-paste block
315
+ npx analyzthis_design spec validate --file design-spec.json
316
+ npx analyzthis_design spec save --file design-spec.json
317
+ npx analyzthis_design spec show
318
+ ```
319
+
320
+ Schema: `agents/design-spec-schema.json`. Producer orchestration: `/design-director`.
321
+
322
+ ---
323
+
265
324
  ## UX Story Gate — How it works
266
325
 
267
326
  `/ux-story-gate` is the task-first gate for any screen evaluation:
@@ -281,32 +340,53 @@ Writes `{ system_card, digest, user, assistant }` JSONL pairs to `~/.analyzthis_
281
340
 
282
341
  ---
283
342
 
284
- ## Knowledge collection — Kavi (v1.11)
343
+ ## Knowledge collection — Kavi (v1.14)
285
344
 
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.
345
+ 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.
287
346
 
288
347
  ```
289
348
  /collect-knowledge (or npx analyzthis_design collect)
290
349
 
291
- Scan codebase (gitignore-aware) → draft Obsidian notes
350
+ Scan codebase → draft Obsidian notes
351
+
352
+ Discover knowledge sources (.obsidian vaults, wikis, refs in README/docs)
292
353
 
293
- LLM enrich (batched; skip with --no-enrich if no API key)
354
+ Write Sources/*.md manifest notes + _meta/knowledge-sources.md
294
355
 
295
- ~/.analyzthis_design/vaults/{project-id}/
356
+ Auto-connect discovered vaults + fetch web URLs → web-context.md
296
357
 
297
- connect + sync → knowledge-bank skill
358
+ LLM enrich (optional)
298
359
 
299
- Arjun / Meera / read company context first
360
+ connect + sync knowledge bank (repo + vaults + web)
361
+
362
+ Personas read unified context first
300
363
  ```
301
364
 
302
365
  ```bash
303
366
  # In your app repo (sync KB to every host):
304
367
  npx analyzthis_design collect --target all
305
- npx analyzthis_design collect --dry-run
368
+ npx analyzthis_design collect --dry-run # preview notes + URLs
369
+ npx analyzthis_design collect --no-web # skip external fetch
306
370
  npx analyzthis_design collect --no-enrich --limit 50
307
371
  npx analyzthis_design collect --vault ~/Documents/MyProjectVault --target claude
308
372
  ```
309
373
 
374
+ Add external sources and vault paths in `~/.analyzthis_design/config.json`:
375
+
376
+ ```json
377
+ {
378
+ "collect": {
379
+ "source_paths": ["~/Documents/MyCompanyVault"],
380
+ "scan_home_vaults": false,
381
+ "auto_connect_discovered": true,
382
+ "web_urls": ["https://your-company.com/brand-guidelines"],
383
+ "web_limit": 10
384
+ }
385
+ }
386
+ ```
387
+
388
+ 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.
389
+
310
390
  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
391
 
312
392
  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.
@@ -338,15 +418,22 @@ Config: `~/.analyzthis_design/config.json`.
338
418
  ## CLI Reference
339
419
 
340
420
  ```bash
341
- # Install / remove / list
421
+ # Install / remove / list / welcome
342
422
  npx analyzthis_design
343
423
  npx analyzthis_design --target all
344
424
  npx analyzthis_design --force
425
+ npx analyzthis_design welcome [--target cursor|claude|all]
345
426
  npx analyzthis_design remove --target all
346
427
  npx analyzthis_design list --target all
347
428
 
429
+ # Design spec
430
+ npx analyzthis_design spec template
431
+ npx analyzthis_design spec validate --file design-spec.json
432
+ npx analyzthis_design spec save --file design-spec.json
433
+ npx analyzthis_design spec show
434
+
348
435
  # Knowledge collection (Kavi)
349
- npx analyzthis_design collect [--vault path] [--dry-run] [--no-enrich] [--limit N] [--target cursor|claude|grok|windsurf|agents|all]
436
+ npx analyzthis_design collect [--vault path] [--dry-run] [--no-enrich] [--no-web] [--no-discover] [--web-limit N] [--target ...]
350
437
 
351
438
  # Knowledge bank
352
439
  npx analyzthis_design connect --vault <path> [--tags ...] [--include ...]
@@ -386,7 +473,8 @@ bin/cli.js CLI entry point
386
473
  lib/
387
474
  install.js Skill installation
388
475
  knowledge.js Vault sync + web-context merge
389
- collect.js Kavi — codebase scan → Obsidian vault → enrich → sync
476
+ collect.js Kavi — codebase scan → vault → source discovery → enrich → sync
477
+ source-discovery.js Obsidian vault / wiki / knowledge-graph discovery + manifest MD
390
478
  platforms.js Cross-host skill paths (Cursor, Claude, Codex, Grok, Windsurf, agents)
391
479
  session.js Shared session-state.json (+ digest, metrics, vault_path)
392
480
  research.js URL / query → web-context.md
@@ -0,0 +1,19 @@
1
+ # Design Director (card)
2
+
3
+ Producer orchestrator — ideation → **DesignSpec** → spec gates → implementation when `build_approved`.
4
+
5
+ **Allowed:** run ux-ideator wireframes; synthesize DesignSpec; DS + hierarchy + Arjun spec validation; hand off SHIPped spec to host for TSX build; post-build verify.
6
+
7
+ **Forbidden:** implement on `assess_only`; skip spec gates; code without `status: ship`.
8
+
9
+ ## Lite summary (for routing only)
10
+ Use full `skills/design-director/SKILL.md` for any producer run — never lite for spec synthesis.
11
+
12
+ ## Spec gate checklist
13
+ - DS: tokens from project, no invented hex
14
+ - Hierarchy: rank #1 → `hierarchy_rank: 1` component
15
+ - Arjun: type/spacing/contrast classes on spec
16
+ - All pass → `status: ship` → build if approved
17
+
18
+ ## CLI
19
+ `npx analyzthis_design spec show | validate | template`
@@ -0,0 +1,111 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "DesignSpec",
4
+ "description": "Machine-readable design contract produced after ideation. Guides WHAT to design and HOW (tokens, components, layout, states). Personas and the host LLM must not drift from a SHIPped spec.",
5
+ "type": "object",
6
+ "required": ["version", "screen_name", "status", "intent", "information_hierarchy", "layout", "tokens", "components", "states"],
7
+ "properties": {
8
+ "version": { "type": "string", "const": "1.0" },
9
+ "screen_name": { "type": "string", "minLength": 1 },
10
+ "status": { "enum": ["draft", "spec_review", "ship", "revise"] },
11
+ "intent": {
12
+ "type": "object",
13
+ "required": ["primary_user_task", "primary_action"],
14
+ "properties": {
15
+ "primary_user_task": { "type": "string" },
16
+ "north_star_metric": { "type": "string" },
17
+ "primary_action": { "type": "string" },
18
+ "business_framing": { "type": "string" }
19
+ }
20
+ },
21
+ "information_hierarchy": {
22
+ "type": "array",
23
+ "minItems": 1,
24
+ "items": { "type": "string" }
25
+ },
26
+ "layout": {
27
+ "type": "object",
28
+ "required": ["grid", "regions"],
29
+ "properties": {
30
+ "grid": { "type": "string", "description": "e.g. 12-col, single-column" },
31
+ "max_width": { "type": "string", "description": "Tailwind or token, e.g. max-w-7xl" },
32
+ "breakpoints": { "type": "array", "items": { "type": "string" } },
33
+ "nav_level": { "type": "string", "enum": ["L1", "L2", "L3"] },
34
+ "regions": {
35
+ "type": "array",
36
+ "minItems": 1,
37
+ "items": {
38
+ "type": "object",
39
+ "required": ["name", "content"],
40
+ "properties": {
41
+ "name": { "type": "string" },
42
+ "span": { "type": "string" },
43
+ "content": { "type": "string" }
44
+ }
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "tokens": {
50
+ "type": "object",
51
+ "required": ["colors", "typography", "spacing"],
52
+ "properties": {
53
+ "colors": { "type": "object", "additionalProperties": { "type": "string" } },
54
+ "typography": { "type": "object", "additionalProperties": { "type": "string" } },
55
+ "spacing": { "type": "object", "additionalProperties": { "type": "string" } },
56
+ "source": { "type": "string", "description": "tailwind.config | css-vars | figma | knowledge-bank" }
57
+ }
58
+ },
59
+ "components": {
60
+ "type": "array",
61
+ "minItems": 1,
62
+ "items": {
63
+ "type": "object",
64
+ "required": ["region", "component"],
65
+ "properties": {
66
+ "region": { "type": "string" },
67
+ "component": { "type": "string" },
68
+ "import_path": { "type": "string" },
69
+ "variant": { "type": "string" },
70
+ "props": { "type": "object" },
71
+ "hierarchy_rank": { "type": "number", "minimum": 1 }
72
+ }
73
+ }
74
+ },
75
+ "states": {
76
+ "type": "object",
77
+ "required": ["empty", "loading", "error", "success"],
78
+ "properties": {
79
+ "empty": { "type": "string" },
80
+ "loading": { "type": "string" },
81
+ "error": { "type": "string" },
82
+ "success": { "type": "string" }
83
+ }
84
+ },
85
+ "motion": {
86
+ "type": "object",
87
+ "properties": {
88
+ "enabled": { "type": "boolean" },
89
+ "notes": { "type": "string" }
90
+ }
91
+ },
92
+ "do": { "type": "array", "items": { "type": "string" } },
93
+ "dont": { "type": "array", "items": { "type": "string" } },
94
+ "wireframe_ref": { "type": "string" },
95
+ "delight_moment": { "type": "string" },
96
+ "effort_estimate": { "type": "string" },
97
+ "citations": {
98
+ "type": "array",
99
+ "items": { "type": "string", "description": "[filename, row N: \"value\"] format" }
100
+ },
101
+ "spec_verdict": {
102
+ "type": "object",
103
+ "properties": {
104
+ "arjun_visual": { "enum": ["pass", "revise", "pending"] },
105
+ "ds_gate": { "enum": ["pass", "fail", "pending"] },
106
+ "hierarchy_gate": { "enum": ["pass", "fail", "pending"] },
107
+ "notes": { "type": "string" }
108
+ }
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "id": "design-director",
3
+ "role": "design_producer",
4
+ "system_skill": "skills/design-director/SKILL.md",
5
+ "system_card": "agents/cards/design-director.md",
6
+ "tier": "critique",
7
+ "max_output_tokens": 4000,
8
+ "parallel_safe_with": [],
9
+ "inputs": ["task_map", "ds_checklist", "design_spec", "knowledge_bank"],
10
+ "outputs": ["design_spec", "implementation_handoff", "verify_results"],
11
+ "allowed_tools": ["design-reference", "design-spec", "browser_verify", "figma_mcp"],
12
+ "allowed_jobs": [
13
+ "orchestrate ideation → DesignSpec → spec gates → implementation handoff",
14
+ "validate spec against DS and information hierarchy",
15
+ "guide host LLM implementation from SHIPped spec"
16
+ ],
17
+ "forbidden_jobs": [
18
+ "skip spec gates and jump to code",
19
+ "implement when mode is assess_only",
20
+ "invent components not in design_spec.components"
21
+ ],
22
+ "routing_triggers": ["design-director", "design spec", "guide how to design", "build this design", "implement spec"],
23
+ "never_route_for": ["full_screen_review_only"],
24
+ "chain_position": null,
25
+ "requires_session_state": true
26
+ }
@@ -1,6 +1,20 @@
1
1
  {
2
2
  "description": "MoE routing table — maps a classified problem type to the expert(s) that should run, and the experts that must never run for that problem type. Used by ux-story-gate Phase 1.5 and persona-orchestrator.",
3
3
  "rules": [
4
+ {
5
+ "problem_type": "design_director",
6
+ "signals": ["design-director", "design director", "guide how to design", "design and build", "implement the spec", "design spec build", "producer path"],
7
+ "route_to": ["design-director"],
8
+ "never_route_to": ["design-critic_chain"],
9
+ "notes": "Producer path — ideation → DesignSpec → spec gates → build. Use /design-director skill, not critique chain."
10
+ },
11
+ {
12
+ "problem_type": "ideation_wireframe",
13
+ "signals": ["wireframe", "mockup", "new screen", "design from scratch", "layout", "ia concept", "ideation", "ux ideator", "text wireframe", "screen layout"],
14
+ "route_to": ["ideation_chain"],
15
+ "never_route_to": ["design-critic_chain", "zara"],
16
+ "notes": "Uses ideation_chain from chain.json — full text wireframes via Noor + Anuj. Never the critique lite chain."
17
+ },
4
18
  {
5
19
  "problem_type": "structure_ia",
6
20
  "signals": ["structure", "ia", "navigation", "nested_ui", "information architecture", "wizard", "form flow"],
@@ -39,6 +39,19 @@
39
39
  "reason": "string — why not_run, when applicable (e.g. 'assess_only, no URL')"
40
40
  },
41
41
  "mode": "assess_only | build_approved",
42
+ "design_spec": {
43
+ "version": "1.0",
44
+ "screen_name": "string",
45
+ "status": "draft | spec_review | ship | revise",
46
+ "intent": "object — primary_user_task, primary_action, north_star_metric",
47
+ "information_hierarchy": ["string — rank #1 first"],
48
+ "layout": "object — grid, regions, nav_level",
49
+ "tokens": "object — colors, typography, spacing, source",
50
+ "components": "array — region, component, import_path, hierarchy_rank",
51
+ "states": "object — empty, loading, error, success",
52
+ "spec_verdict": "object — arjun_visual, ds_gate, hierarchy_gate, notes",
53
+ "updated_at": "ISO 8601"
54
+ },
42
55
  "vault_path": "string — Obsidian vault written by Kavi collect (empty until first collect)",
43
56
  "last_collect_at": "ISO 8601 timestamp — last successful collect run",
44
57
  "digest": {
@@ -47,6 +60,7 @@
47
60
  "ds_at_risk": ["string — ds_checklist keys currently at risk"],
48
61
  "experts": ["string — persona ids selected for this run"],
49
62
  "prior_scores": { "<persona_id>": "number | string — last known score for delta re-evaluation" },
63
+ "design_spec_status": "draft | spec_review | ship | revise — shortcut from design_spec.status",
50
64
  "mode": "assess_only | build_approved"
51
65
  },
52
66
  "metrics": {