analyzthis_design 1.15.0 → 1.18.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.
@@ -0,0 +1,75 @@
1
+ name: Persona feedback
2
+ description: Report when a design persona got it wrong or you had to correct it
3
+ title: "[feedback] "
4
+ labels: ["persona-feedback"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Help improve analyzthis_design personas. Prefer CLI submit when possible:
10
+ `npx analyzthis_design feedback record ...` then `npx analyzthis_design feedback submit --yes`
11
+
12
+ - type: dropdown
13
+ id: persona
14
+ attributes:
15
+ label: Persona
16
+ options:
17
+ - arjun
18
+ - meera
19
+ - priya
20
+ - zara
21
+ - raj
22
+ - noor
23
+ - anuj
24
+ - design-director
25
+ - other
26
+ validations:
27
+ required: true
28
+
29
+ - type: dropdown
30
+ id: rating
31
+ attributes:
32
+ label: How happy were you with the output?
33
+ options:
34
+ - "1 — very unhappy"
35
+ - "2 — unhappy"
36
+ - "3 — okay"
37
+ - "4 — good"
38
+ - "5 — great"
39
+ validations:
40
+ required: true
41
+
42
+ - type: checkboxes
43
+ id: tags
44
+ attributes:
45
+ label: What went wrong?
46
+ options:
47
+ - label: wrong_hierarchy
48
+ - label: invented_tokens
49
+ - label: missed_ds
50
+ - label: too_verbose
51
+ - label: bad_ia
52
+ - label: off_brief
53
+ - label: other
54
+
55
+ - type: textarea
56
+ id: comment
57
+ attributes:
58
+ label: What was wrong?
59
+ placeholder: The persona suggested colors that aren't in our design system...
60
+ validations:
61
+ required: true
62
+
63
+ - type: textarea
64
+ id: correction
65
+ attributes:
66
+ label: What did you want instead? (how you corrected it)
67
+ placeholder: Use --color-primary from tokens.css; primary CTA should be top-right...
68
+ validations:
69
+ required: true
70
+
71
+ - type: input
72
+ id: version
73
+ attributes:
74
+ label: Package version (optional)
75
+ placeholder: "1.17.0"
package/README.md CHANGED
@@ -37,8 +37,8 @@ npx analyzthis_design --target all --force
37
37
  | Cursor | `~/.cursor/skills/<name>/SKILL.md` | `/getting-started` |
38
38
  | Claude Code | `~/.claude/skills/<name>/SKILL.md` (+ legacy `~/.claude/commands/`) | `/getting-started` |
39
39
  | Codex CLI | `~/.codex/skills/<name>/SKILL.md` | skill name / AGENTS.md |
40
- | Grok Build | `~/.grok/skills/<name>/SKILL.md` | `/collect-knowledge` |
41
- | Windsurf Cascade | `~/.codeium/windsurf/skills/<name>/SKILL.md` | `@collect-knowledge` |
40
+ | Grok Build | `~/.grok/skills/<name>/SKILL.md` | `/kavi` |
41
+ | Windsurf Cascade | `~/.codeium/windsurf/skills/<name>/SKILL.md` | `@kavi` |
42
42
  | Cross-agent | `~/.agents/skills/<name>/SKILL.md` | discovered by multiple hosts |
43
43
 
44
44
  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.
@@ -62,18 +62,18 @@ All skills use the **Agent Skills** `SKILL.md` standard — same files work acro
62
62
 
63
63
  | Command | What it does |
64
64
  |---|---|
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. |
65
+ | `/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`)_ |
66
66
  | `/persona-orchestrator` | **Agentic critique entry point** (not for wireframes). MoE router + session state, ux-story-gate intake, persona chain, DS / hierarchy / verify gates → SHIP/REVISE/BLOCK |
67
67
  | `/ux-story-gate` | Task-first gate: PRDs, DS/Figma discovery, MoE routing, browser verify, assess-only mode |
68
68
  | `/design-critic` | 4-persona critique → Composite Score + Information Hierarchy Gate |
69
69
 
70
70
  ### 8 Personas
71
71
 
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.
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 **`/kavi`** first so they have project context.
73
73
 
74
74
  | Command | Persona | What they evaluate |
75
75
  |---|---|---|
76
- | `/collect-knowledge` | Kavi — Knowledge Archivist | Scan repo → Obsidian vault → enrich → sync knowledge bank (producer, not a critic) |
76
+ | `/kavi` | Kavi — Knowledge Archivist | Scan repo → Obsidian vault → enrich → sync knowledge bank (producer, not a critic) |
77
77
  | `/arjun` | UX + Visual Design | UX Honeycomb + Visual Design Audit (hierarchy, color, type, spacing, components, style fit, micro-interactions) |
78
78
  | `/meera` | Business Agent | Retention, ARR, GTM lever, adoption risk; hierarchy vs north-star check |
79
79
  | `/priya` | Feasibility Agent | Engineering effort (T-shirt sizing, 2-axis model), state machine traps |
@@ -282,11 +282,70 @@ analyzthis_design is a design **critique** layer, not a design generator. The pe
282
282
  **LoRA readiness (export hook only — no training in this release):**
283
283
 
284
284
  ```bash
285
- npx analyzthis_design session accept --persona arjun # mark the last output as a good example
285
+ # Good examples (positive pairs)
286
+ npx analyzthis_design session accept --persona arjun
286
287
  npx analyzthis_design export-training --persona arjun --all
288
+
289
+ # Bad output + how you corrected it (negative / DPO pairs) — v1.16
290
+ npx analyzthis_design session accept --persona arjun --reject \
291
+ --comment "Invented tokens not in our DS" \
292
+ --correction "Use --color-primary and spacing-4 from tokens.css" \
293
+ --rating 2 --tags invented_tokens,missed_ds
294
+
295
+ npx analyzthis_design feedback record --persona arjun --rating 2 \
296
+ --comment "Hierarchy wrong — CTA buried" \
297
+ --correction "Primary action should be top-right, above the fold"
298
+
299
+ npx analyzthis_design feedback list
300
+ npx analyzthis_design feedback export --persona arjun --all
301
+ ```
302
+
303
+ Writes `{ system_card, digest, user, assistant }` JSONL pairs to `~/.analyzthis_design/training/<persona>.jsonl` from every session where that persona's output was explicitly accepted.
304
+
305
+ **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.
306
+
307
+ 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.
308
+
309
+ ---
310
+
311
+ ## Persona feedback — corrections & unhappiness (v1.16)
312
+
313
+ 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.
314
+
315
+ | Command | Purpose |
316
+ |---------|---------|
317
+ | `feedback record` | Log rating, comment, correction, tags for a persona's last output |
318
+ | `feedback list` | See all feedback for this project (or `--all`) |
319
+ | `feedback export` | Write `{ assistant_rejected, assistant_preferred, … }` JSONL |
320
+ | `session accept --reject --comment …` | Reject + record in one step |
321
+
322
+ Suggested tags: `wrong_hierarchy`, `invented_tokens`, `missed_ds`, `too_verbose`, `bad_ia`, `off_brief`.
323
+
324
+ Stored in `session-state.json` → `feedback_log` and appended globally to `~/.analyzthis_design/feedback/corrections.jsonl`.
325
+
326
+ ### Community collection (v1.17) — opt-in submit
327
+
328
+ For **open-source contributors**, share anonymized corrections with maintainers:
329
+
330
+ ```bash
331
+ npx analyzthis_design feedback record --persona arjun --rating 2 --comment "..." --correction "..."
332
+ npx analyzthis_design feedback submit --dry-run # preview redacted payload
333
+ npx analyzthis_design feedback submit --all --yes # send unsent entries (asks consent once)
334
+ npx analyzthis_design feedback status
287
335
  ```
288
336
 
289
- Writes `{ system_card, digest, user, assistant }` JSONL pairs to `~/.analyzthis_design/training/<persona>.jsonl` from every session where that persona's output was explicitly accepted. Once a persona accumulates ~100–300 accepted pairs, that data is ready for a future fine-tuning pass on an open model — not part of this package yet.
337
+ **What gets sent:** persona, rating, tags, comment, correction, redacted output snippets, anonymous install id, package version.
338
+
339
+ **What does NOT get sent:** project paths, repo names, emails, API keys, full source trees.
340
+
341
+ **Maintainer setup (Supabase):**
342
+
343
+ 1. Create a Supabase project
344
+ 2. Run `supabase/migrations/001_persona_feedback.sql` in the SQL editor
345
+ 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`)
346
+ 4. View submissions in Supabase Table Editor → `persona_feedback`
347
+
348
+ Users can also file GitHub issues via **Persona feedback** template if they prefer not to use CLI submit.
290
349
 
291
350
  ---
292
351
 
@@ -345,7 +404,7 @@ Schema: `agents/design-spec-schema.json`. Producer orchestration: `/design-direc
345
404
  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.
346
405
 
347
406
  ```
348
- /collect-knowledge (or npx analyzthis_design collect)
407
+ /kavi (or npx analyzthis_design collect)
349
408
 
350
409
  Scan codebase → draft Obsidian notes
351
410
 
@@ -443,7 +502,15 @@ npx analyzthis_design status
443
502
 
444
503
  # Session (agentic)
445
504
  npx analyzthis_design session init|show|reset [--project id] [--all]
446
- npx analyzthis_design session accept --persona <id> [--reject]
505
+ npx analyzthis_design session accept --persona <id> [--reject] [--comment "..."] [--correction "..."] [--rating 1-5] [--tags a,b]
506
+
507
+ # Persona feedback (v1.16)
508
+ npx analyzthis_design feedback record --persona <id> [--rating 1-5] [--comment "..."] [--correction "..."] [--tags a,b]
509
+ npx analyzthis_design feedback list [--all]
510
+ npx analyzthis_design feedback export [--persona <id>] [--all] [--output path] [--include-positive]
511
+ npx analyzthis_design feedback submit [--persona <id>] [--all] [--yes] [--dry-run]
512
+ npx analyzthis_design feedback status
513
+ npx analyzthis_design feedback revoke
447
514
 
448
515
  # Research
449
516
  npx analyzthis_design research --url <url>
@@ -460,6 +527,7 @@ npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b]
460
527
  npx analyzthis_design metrics [--project id] [--all]
461
528
  npx analyzthis_design cost [--project id] [--all]
462
529
  npx analyzthis_design export-training --persona <id> [--project id] [--all] [--output path]
530
+ npx analyzthis_design feedback export [--persona <id>] [--project id] [--all] [--output path]
463
531
  ```
464
532
 
465
533
  ---
@@ -481,11 +549,14 @@ lib/
481
549
  retrieve.js Filtered, citation-ready CSV row retrieval
482
550
  cache.js On-disk cache for retrieve/kb slices
483
551
  export.js LoRA training-pair export hook
552
+ feedback.js Persona unhappiness + correction logging (session + global JSONL)
553
+ feedback-submit.js Opt-in anonymized submit to Supabase (community feedback)
484
554
  cost.js $-cost report from metrics × config.pricing
485
555
  orchestrator/run.js Standalone LLM runtime (v2) — MoE, effort-graded tiers, caps, cache-aware
486
556
  scripts/obfuscate.js Build step → dist/
487
557
  skills/
488
- collect-knowledge/ Kavi — Knowledge Archivist
558
+ kavi/ Kavi — Knowledge Archivist (/kavi)
559
+ collect-knowledge/ Alias for Kavi (backward compatible)
489
560
  persona-orchestrator/ Agentic critique entry point
490
561
  ux-story-gate/ Task-first gate + DS/MoE/verify/assess phases
491
562
  design-critic/ 4-persona critique + hierarchy gate
@@ -23,4 +23,4 @@ Knowledge bank: [synced count] → [targets]
23
23
  Next: run /persona-orchestrator or any critique persona — they read this bank first.
24
24
  ```
25
25
 
26
- Consult `skills/collect-knowledge/SKILL.md` for the host workflow. Prefer running `npx analyzthis_design collect` over re-scanning files in chat.
26
+ Consult `skills/kavi/SKILL.md` for the host workflow. Prefer running `npx analyzthis_design collect` over re-scanning files in chat. Invoke as **`/kavi`** (alias: `/collect-knowledge`).
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "kavi",
3
3
  "role": "knowledge_archivist",
4
- "system_skill": "skills/collect-knowledge/SKILL.md",
4
+ "system_skill": "skills/kavi/SKILL.md",
5
5
  "system_card": "agents/cards/kavi.md",
6
6
  "tier": "structured",
7
7
  "max_output_tokens": 4000,
@@ -76,10 +76,10 @@
76
76
  },
77
77
  {
78
78
  "problem_type": "collect_knowledge",
79
- "signals": ["collect knowledge", "scan codebase", "build vault", "knowledge archivist", "collect-knowledge"],
79
+ "signals": ["kavi", "/kavi", "collect knowledge", "scan codebase", "build vault", "knowledge archivist", "collect-knowledge"],
80
80
  "route_to": ["kavi"],
81
81
  "never_route_to": ["design-critic_chain", "zara", "arjun", "meera", "priya"],
82
- "notes": "Producer only — run /collect-knowledge or `npx analyzthis_design collect`. Never part of a critique chain."
82
+ "notes": "Producer only — run /kavi or `npx analyzthis_design collect`. Never part of a critique chain."
83
83
  }
84
84
  ]
85
85
  }
@@ -52,6 +52,21 @@
52
52
  "spec_verdict": "object — arjun_visual, ds_gate, hierarchy_gate, notes",
53
53
  "updated_at": "ISO 8601"
54
54
  },
55
+ "feedback_log": [
56
+ {
57
+ "id": "string — unique feedback entry id",
58
+ "at": "ISO 8601",
59
+ "persona": "string — persona id",
60
+ "satisfied": "boolean — true if user was happy",
61
+ "rating": "number | null — 1 (very unhappy) to 5 (very happy)",
62
+ "comment": "string — what was wrong or what they liked",
63
+ "correction": "string — how the user corrected or what they wanted instead",
64
+ "tags": ["string — e.g. wrong_hierarchy, invented_tokens, off_brief"],
65
+ "original_output": "string — snapshot of persona output at feedback time",
66
+ "submitted_at": "ISO 8601 | omitted — set when feedback submit succeeds",
67
+ "context": "object — task_map_summary, problem_type, mode"
68
+ }
69
+ ],
55
70
  "vault_path": "string — Obsidian vault written by Kavi collect (empty until first collect)",
56
71
  "last_collect_at": "ISO 8601 timestamp — last successful collect run",
57
72
  "digest": {