analyzthis_design 1.12.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
@@ -52,7 +52,9 @@ All skills use the **Agent Skills** `SKILL.md` standard — same files work acro
52
52
  | Command | What it does |
53
53
  |---|---|
54
54
  | `/getting-started` | **First-run guide** — which command to use for wireframes vs critique |
55
- | `/ux-ideator` | **Full ideation** — two competing text wireframes (minimalist vs dense), deliberation, delight, feasibility |
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) |
56
58
  | `/noor` | **Quick minimalist wireframe** — Concept A text wireframe, progressive disclosure |
57
59
  | `/anuj` | **Power-user wireframe** — Concept B text wireframe, density + bulk actions |
58
60
 
@@ -90,7 +92,7 @@ Invoke critique personas for targeted, already-grounded questions. For **wirefra
90
92
 
91
93
  ---
92
94
 
93
- ## Agentic system (v1.12)
95
+ ## Agentic system (v1.15)
94
96
 
95
97
  ```
96
98
  User ask / Figma URL
@@ -160,20 +162,36 @@ Provider defaults live in `~/.analyzthis_design/config.json`:
160
162
  "claude-sonnet-5": { "input_per_m": 2, "output_per_m": 10 },
161
163
  "gpt-4o": { "input_per_m": 2.50, "output_per_m": 10 }
162
164
  },
163
- "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
+ }
164
172
  }
165
173
  ```
166
174
 
167
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.
168
176
 
169
- **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):
170
188
 
171
189
  ```bash
172
190
  npx analyzthis_design research --url https://example.com/design-tokens
173
191
  npx analyzthis_design research --query "EY design system tokens"
174
192
  ```
175
193
 
176
- 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`.
177
195
 
178
196
  ---
179
197
 
@@ -272,6 +290,37 @@ Writes `{ system_card, digest, user, assistant }` JSONL pairs to `~/.analyzthis_
272
290
 
273
291
  ---
274
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
+
275
324
  ## UX Story Gate — How it works
276
325
 
277
326
  `/ux-story-gate` is the task-first gate for any screen evaluation:
@@ -291,32 +340,53 @@ Writes `{ system_card, digest, user, assistant }` JSONL pairs to `~/.analyzthis_
291
340
 
292
341
  ---
293
342
 
294
- ## Knowledge collection — Kavi (v1.11)
343
+ ## Knowledge collection — Kavi (v1.14)
295
344
 
296
- 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.
297
346
 
298
347
  ```
299
348
  /collect-knowledge (or npx analyzthis_design collect)
300
349
 
301
- 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)
353
+
354
+ Write Sources/*.md manifest notes + _meta/knowledge-sources.md
302
355
 
303
- LLM enrich (batched; skip with --no-enrich if no API key)
356
+ Auto-connect discovered vaults + fetch web URLs web-context.md
304
357
 
305
- ~/.analyzthis_design/vaults/{project-id}/
358
+ LLM enrich (optional)
306
359
 
307
- connect + sync → knowledge-bank skill
360
+ connect + sync → knowledge bank (repo + vaults + web)
308
361
 
309
- Arjun / Meera / … read company context first
362
+ Personas read unified context first
310
363
  ```
311
364
 
312
365
  ```bash
313
366
  # In your app repo (sync KB to every host):
314
367
  npx analyzthis_design collect --target all
315
- 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
316
370
  npx analyzthis_design collect --no-enrich --limit 50
317
371
  npx analyzthis_design collect --vault ~/Documents/MyProjectVault --target claude
318
372
  ```
319
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
+
320
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.
321
391
 
322
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.
@@ -356,8 +426,14 @@ npx analyzthis_design welcome [--target cursor|claude|all]
356
426
  npx analyzthis_design remove --target all
357
427
  npx analyzthis_design list --target all
358
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
+
359
435
  # Knowledge collection (Kavi)
360
- 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 ...]
361
437
 
362
438
  # Knowledge bank
363
439
  npx analyzthis_design connect --vault <path> [--tags ...] [--include ...]
@@ -397,7 +473,8 @@ bin/cli.js CLI entry point
397
473
  lib/
398
474
  install.js Skill installation
399
475
  knowledge.js Vault sync + web-context merge
400
- 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
401
478
  platforms.js Cross-host skill paths (Cursor, Claude, Codex, Grok, Windsurf, agents)
402
479
  session.js Shared session-state.json (+ digest, metrics, vault_path)
403
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,13 @@
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
+ },
4
11
  {
5
12
  "problem_type": "ideation_wireframe",
6
13
  "signals": ["wireframe", "mockup", "new screen", "design from scratch", "layout", "ia concept", "ideation", "ux ideator", "text wireframe", "screen layout"],
@@ -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": {