analyzthis_design 1.18.0 → 1.19.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.
Files changed (43) hide show
  1. package/README.md +38 -6
  2. package/agents/cards/anuj.md +6 -0
  3. package/agents/cards/arjun.md +6 -0
  4. package/agents/cards/meera.md +6 -0
  5. package/agents/cards/noor.md +6 -0
  6. package/agents/cards/priya.md +6 -0
  7. package/agents/cards/raj.md +6 -0
  8. package/agents/cards/zara.md +6 -0
  9. package/agents/chain.json +8 -2
  10. package/agents/deliberation-schema.json +44 -0
  11. package/agents/session-schema.json +15 -1
  12. package/dist/bin/cli.js +1 -1
  13. package/dist/lib/cache.js +1 -1
  14. package/dist/lib/collect.js +1 -1
  15. package/dist/lib/cost.js +1 -1
  16. package/dist/lib/deliberation.js +1 -0
  17. package/dist/lib/design-spec.js +1 -1
  18. package/dist/lib/export.js +1 -1
  19. package/dist/lib/feedback-submit.js +1 -1
  20. package/dist/lib/feedback.js +1 -1
  21. package/dist/lib/install.js +1 -1
  22. package/dist/lib/knowledge.js +1 -1
  23. package/dist/lib/orchestrator/run.js +1 -1
  24. package/dist/lib/platforms.js +1 -1
  25. package/dist/lib/research.js +1 -1
  26. package/dist/lib/retrieve.js +1 -1
  27. package/dist/lib/session.js +1 -1
  28. package/dist/lib/source-discovery.js +1 -1
  29. package/package.json +2 -2
  30. package/skills/anuj/SKILL.md +2 -0
  31. package/skills/arjun/SKILL.md +2 -0
  32. package/skills/deliberation-protocol/SKILL.md +124 -0
  33. package/skills/design-critic/SKILL.md +19 -6
  34. package/skills/design-director/SKILL.md +13 -1
  35. package/skills/getting-started/SKILL.md +7 -0
  36. package/skills/meera/SKILL.md +2 -0
  37. package/skills/noor/SKILL.md +2 -0
  38. package/skills/persona-orchestrator/SKILL.md +22 -13
  39. package/skills/priya/SKILL.md +2 -0
  40. package/skills/raj/SKILL.md +2 -0
  41. package/skills/ux-ideator/SKILL.md +11 -5
  42. package/skills/zara/SKILL.md +2 -0
  43. package/supabase/deliberation-config.example.json +10 -0
package/README.md CHANGED
@@ -92,7 +92,7 @@ Invoke critique personas for targeted, already-grounded questions. For **wirefra
92
92
 
93
93
  ---
94
94
 
95
- ## Agentic system (v1.15)
95
+ ## Agentic system (v1.19)
96
96
 
97
97
  ```
98
98
  User ask / Figma URL
@@ -101,14 +101,43 @@ User ask / Figma URL
101
101
 
102
102
  ux-story-gate Phases 0–1.5 (PRD + DS/Figma + MoE router)
103
103
 
104
- MoE subset (default, 1–2 experts) OR design-critic / ideation chain (explicit "full")
104
+ Adversarial deliberation (parallel objection rounds, low satisfaction default)
105
105
 
106
- Hard gates: DS tokens Information Hierarchy → Browser verify (skipped if assess_only + no URL)
106
+ MoE subset (default) OR full chain (explicit "full")
107
107
 
108
- Session state + cost metrics persisted → SHIP / REVISE / BLOCK
108
+ Raj on stalemate (2+ blocking objections)
109
+
110
+ Hard gates: DS → Hierarchy → Verify
111
+
112
+ SHIP / REVISE / BLOCK
109
113
  ```
110
114
 
111
- **Shared session state** lives at `~/.analyzthis_design/sessions/{project-id}/session-state.json` so Ask→Agent turns do not re-derive the task map, DS checklist, or routing decision.
115
+ ### Adversarial deliberation (v1.19)
116
+
117
+ Personas **debate** grounded in real task_map, PRD, and UI context — they do not pass generic handoff documents.
118
+
119
+ | Knob | Default | Meaning |
120
+ |------|---------|---------|
121
+ | `satisfaction_threshold` | 0.4 | Personas hard to please — must see evidence before `accepts_prior: true` |
122
+ | `max_rounds` | 3 | Cap on objection rounds (token-bounded) |
123
+ | `parallel_pairs` | Noor∥Anuj, Meera∥Priya | Adversarial critique in parallel |
124
+
125
+ ```bash
126
+ npx analyzthis_design run --task "Review onboarding" --full --dry-run # see deliberation groups
127
+ npx analyzthis_design run --task "..." --satisfaction 0.3 # even harder to satisfy
128
+ npx analyzthis_design run --task "..." --no-deliberate # legacy sequential mode
129
+ npx analyzthis_design metrics # deliberation_rounds, objections
130
+ ```
131
+
132
+ Config: `~/.analyzthis_design/config.json` → `deliberation` block (see `supabase/deliberation-config.example.json`).
133
+
134
+ Skill: `/deliberation-protocol` | Schema: `agents/deliberation-schema.json`
135
+
136
+ **Low satisfaction ≠ unlimited tokens.** Objection rounds use lite schema + 600-token cap; synthesis and Raj use full models.
137
+
138
+ ---
139
+
140
+ **Shared session state** lives at `~/.analyzthis_design/sessions/{project-id}/session-state.json` (includes `deliberation.round_log` after adversarial runs).
112
141
 
113
142
  ```bash
114
143
  npx analyzthis_design session init
@@ -139,6 +168,7 @@ npx analyzthis_design run --task "Review this screen" --figma https://figma.com/
139
168
  # Force the full design-critic chain, or bypass the router entirely
140
169
  npx analyzthis_design run --task "Full critique of onboarding" --full
141
170
  npx analyzthis_design run --task "Just check spacing" --experts arjun
171
+ npx analyzthis_design run --task "..." --max-rounds 2 --satisfaction 0.5 --no-deliberate
142
172
  ```
143
173
 
144
174
  Provider defaults live in `~/.analyzthis_design/config.json`:
@@ -521,7 +551,7 @@ npx analyzthis_design retrieve --file <csv> --column <col> --keywords a,b [--lim
521
551
 
522
552
  # Standalone orchestrator
523
553
  npx analyzthis_design run --task "..." [--figma URL] [--provider anthropic|openai|google|zai] [--dry-run] [--output path]
524
- npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b]
554
+ npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b] [--deliberate | --no-deliberate] [--max-rounds N] [--satisfaction 0.4]
525
555
 
526
556
  # Efficiency / cost
527
557
  npx analyzthis_design metrics [--project id] [--all]
@@ -551,6 +581,7 @@ lib/
551
581
  export.js LoRA training-pair export hook
552
582
  feedback.js Persona unhappiness + correction logging (session + global JSONL)
553
583
  feedback-submit.js Opt-in anonymized submit to Supabase (community feedback)
584
+ deliberation.js Adversarial satisfaction loops, context pack, Raj escalation
554
585
  cost.js $-cost report from metrics × config.pricing
555
586
  orchestrator/run.js Standalone LLM runtime (v2) — MoE, effort-graded tiers, caps, cache-aware
556
587
  scripts/obfuscate.js Build step → dist/
@@ -558,6 +589,7 @@ skills/
558
589
  kavi/ Kavi — Knowledge Archivist (/kavi)
559
590
  collect-knowledge/ Alias for Kavi (backward compatible)
560
591
  persona-orchestrator/ Agentic critique entry point
592
+ deliberation-protocol/ Adversarial review rules (v1.19)
561
593
  ux-story-gate/ Task-first gate + DS/MoE/verify/assess phases
562
594
  design-critic/ 4-persona critique + hierarchy gate
563
595
  ux-ideator/ 6-phase ideation
@@ -20,3 +20,9 @@ Top fix: [one line]
20
20
  Full Concept B text wireframe (hierarchy check, primary action, nav level, visible-on-load at full density, keyboard shortcuts, progressive disclosure, rationale) — see `skills/anuj/SKILL.md` "Output — Concept B". Use deep mode for ideation runs or full/deep critiques.
21
21
 
22
22
  **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[ux-guidelines.csv, row 22: "..."]`. Only run this persona when task Frequency = daily/weekly.
23
+
24
+ ## Deliberation modes (v1.19)
25
+
26
+ **Review mode (rounds 0–N-1):** Critique prior output with grounded objections. Default `accepts_prior: false`. Include deliberation JSON block.
27
+
28
+ **Produce mode (final round):** Full output schema after consensus or Raj. See `skills/deliberation-protocol/SKILL.md`.
@@ -21,3 +21,9 @@ Combined score: [X/5]
21
21
  Full UX Critique + Visual Design Audit blocks with per-dimension reasons — see `skills/arjun/SKILL.md` "Output format". Use deep mode when the user asks for a full/deep critique, any dimension scores C or below and needs the full rubric quoted, or `default_chain` is running.
22
22
 
23
23
  **Citation:** `[filename, row N: "exact quoted value"]`. Consult `skills/arjun/SKILL.md` Grade Rubric tables when scoring C or below and rubric detail is needed.
24
+
25
+ ## Deliberation modes (v1.19)
26
+
27
+ **Review mode (rounds 0–N-1):** Critique prior output with grounded objections. Default `accepts_prior: false`. Include deliberation JSON block.
28
+
29
+ **Produce mode (final round):** Full output schema after consensus or Raj. See `skills/deliberation-protocol/SKILL.md`.
@@ -19,3 +19,9 @@ Score: [1-5]
19
19
  Full Business Impact block (metric impact, hierarchy check, segment, GTM lever, retention hook, adoption risk, verdict) — see `skills/meera/SKILL.md` "Output format". Use deep mode for full/deep critiques or when `default_chain` is running.
20
20
 
21
21
  **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[products.csv, row 6: "..."]`. Consult `skills/meera/SKILL.md` for the full reference-data table when a specific product-type match is needed.
22
+
23
+ ## Deliberation modes (v1.19)
24
+
25
+ **Review mode (rounds 0–N-1):** Critique prior output with grounded objections. Default `accepts_prior: false`. Include deliberation JSON block.
26
+
27
+ **Produce mode (final round):** Full output schema after consensus or Raj. See `skills/deliberation-protocol/SKILL.md`.
@@ -20,3 +20,9 @@ Rationale: [one line, Hick's Law / progressive disclosure]
20
20
  Full Concept A text wireframe (hierarchy, primary action, nav level, visible-on-load, progressive disclosure, nav path, rationale) — see `skills/noor/SKILL.md` "Output — Concept A". Use deep mode for ideation runs or full/deep critiques.
21
21
 
22
22
  **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[stacks/shadcn.csv, row 8: "..."]`. Consult `skills/noor/SKILL.md` when naming specific components.
23
+
24
+ ## Deliberation modes (v1.19)
25
+
26
+ **Review mode (rounds 0–N-1):** Critique prior output with grounded objections. Default `accepts_prior: false`. Include deliberation JSON block.
27
+
28
+ **Produce mode (final round):** Full output schema after consensus or Raj. See `skills/deliberation-protocol/SKILL.md`.
@@ -19,3 +19,9 @@ Score: [1-5]
19
19
  Full Feasibility Analysis block (score, blockers, ranked risks, effort, simpler alternative) — see `skills/priya/SKILL.md` "Output format". Use deep mode for full/deep critiques or when `default_chain` is running.
20
20
 
21
21
  **Citation:** `[filename, row N: "exact quoted value"]` — e.g. `[stacks/nextjs.csv, row 12: "..."]`. Consult `skills/priya/SKILL.md` for the stack-file table matching the session's tech stack.
22
+
23
+ ## Deliberation modes (v1.19)
24
+
25
+ **Review mode (rounds 0–N-1):** Critique prior output with grounded objections. Default `accepts_prior: false`. Include deliberation JSON block.
26
+
27
+ **Produce mode (final round):** Full output schema after consensus or Raj. See `skills/deliberation-protocol/SKILL.md`.
@@ -21,3 +21,9 @@ What [losing agent] gives up: [named]
21
21
  ```
22
22
 
23
23
  **Citation:** `[filename, row N: "exact quoted value"]`. Consult `skills/raj/SKILL.md` for the ranked product-principles list (Owner governs, Data honesty, Intentionality over automation, Persona density split, PRD scope boundary) and their worked examples before deciding.
24
+
25
+ ## Deliberation modes (v1.19)
26
+
27
+ **Review mode (rounds 0–N-1):** Critique prior output with grounded objections. Default `accepts_prior: false`. Include deliberation JSON block.
28
+
29
+ **Produce mode (final round):** Full output schema after consensus or Raj. See `skills/deliberation-protocol/SKILL.md`.
@@ -22,3 +22,9 @@ If high-frequency working surface: output only "no delight needed here — speed
22
22
  Full Delight Pass block (surface, moment, type, specific addition, why-this-one, cost, design-system pointer) — see `skills/zara/SKILL.md` "Output format". Use deep mode for full/deep critiques or when `default_chain` is running.
23
23
 
24
24
  **Citation:** `[filename, row N: "exact quoted value"]`. Apply the `styles.csv` 5-step filter in `skills/zara/SKILL.md` before citing — never read the full file.
25
+
26
+ ## Deliberation modes (v1.19)
27
+
28
+ **Review mode (rounds 0–N-1):** Critique prior output with grounded objections. Default `accepts_prior: false`. Include deliberation JSON block.
29
+
30
+ **Produce mode (final round):** Full output schema after consensus or Raj. See `skills/deliberation-protocol/SKILL.md`.
package/agents/chain.json CHANGED
@@ -1,20 +1,26 @@
1
1
  {
2
2
  "description": "Default sequential graph for a full multi-persona critique (design-critic). The MoE router in router.json selects a smaller subset of this chain by default; only run this full chain for an explicit full-screen review.",
3
3
  "default_expert_budget": 2,
4
+ "deliberation_mode": "adversarial",
5
+ "objection_token_cap": 600,
4
6
  "default_chain": [
5
7
  { "step": 1, "persona": "arjun", "handoff_from": null, "handoff_to": "meera", "parallel_safe_with": [] },
6
8
  { "step": 2, "persona": "meera", "handoff_from": "arjun", "handoff_to": "priya", "parallel_safe_with": ["priya"] },
7
9
  { "step": 3, "persona": "priya", "handoff_from": "meera", "handoff_to": "zara", "parallel_safe_with": ["meera"] },
8
10
  { "step": 4, "persona": "zara", "handoff_from": "priya", "handoff_to": null, "parallel_safe_with": [] }
9
11
  ],
12
+ "deliberation_groups": {
13
+ "critique": [["arjun"], ["meera", "priya"], ["zara"]],
14
+ "ideation": [["meera"], ["noor", "anuj"], ["arjun"], ["zara", "priya"]],
15
+ "lite": [["arjun"], ["meera"]]
16
+ },
10
17
  "ideation_chain": [
11
18
  { "step": 1, "persona": "meera", "handoff_to": ["noor", "anuj"], "parallel_safe_with": [] },
12
19
  { "step": 2, "persona": "noor", "handoff_from": "meera", "handoff_to": "arjun", "parallel_safe_with": ["anuj"] },
13
20
  { "step": 2, "persona": "anuj", "handoff_from": "meera", "handoff_to": "arjun", "parallel_safe_with": ["noor"] },
14
21
  { "step": 3, "persona": "arjun", "handoff_from": ["noor", "anuj"], "handoff_to": "zara", "parallel_safe_with": [] },
15
22
  { "step": 4, "persona": "zara", "handoff_from": "arjun", "handoff_to": "priya", "parallel_safe_with": [] },
16
- { "step": 5, "persona": "priya", "handoff_from": "zara", "handoff_to": "raj", "parallel_safe_with": [] },
17
- { "step": 6, "persona": "raj", "handoff_from": "priya", "handoff_to": null, "parallel_safe_with": [] }
23
+ { "step": 5, "persona": "priya", "handoff_from": "zara", "handoff_to": null, "parallel_safe_with": [] }
18
24
  ],
19
25
  "tiers": {
20
26
  "router": null,
@@ -0,0 +1,44 @@
1
+ {
2
+ "description": "Structured output every persona emits during adversarial deliberation rounds (v1.19).",
3
+ "persona_output_block": {
4
+ "grounding": [
5
+ {
6
+ "type": "task_map | prd | ui_region | ds_token | figma",
7
+ "ref": "string — e.g. task_map[0], PRD line, header/CTA, --color-primary",
8
+ "note": "string — why this citation matters"
9
+ }
10
+ ],
11
+ "satisfaction_with_prior": "number 0.0–1.0 — how satisfied with prior persona output",
12
+ "accepts_prior": "boolean — true only if satisfaction >= threshold",
13
+ "objections": [
14
+ {
15
+ "target_persona": "string — persona id being challenged",
16
+ "claim": "string — specific claim being contested",
17
+ "evidence_required": "string — what would resolve this",
18
+ "blocking": "boolean — must resolve before synthesis",
19
+ "grounded_in": "string — citation to task/PRD/UI"
20
+ }
21
+ ],
22
+ "questions": ["string — contextual questions about UI, PRD, task, JTBD"],
23
+ "revisions": ["string — concrete changes required in prior output"],
24
+ "verdict": "SHIP | REVISE | BLOCK | CONTEST | ACCEPT",
25
+ "synthesis": "string — optional; full produce-mode output on final round only"
26
+ },
27
+ "session_deliberation": {
28
+ "round": "number — current round index",
29
+ "max_rounds": "number",
30
+ "satisfaction_threshold": "number 0.0–1.0",
31
+ "open_objections": ["object — unresolved objections from round_log"],
32
+ "round_log": [
33
+ {
34
+ "round": "number",
35
+ "persona": "string",
36
+ "parsed": "object — parsed deliberation block",
37
+ "raw_length": "number"
38
+ }
39
+ ],
40
+ "consensus_reached": "boolean",
41
+ "raj_escalated": "boolean",
42
+ "mode": "adversarial | legacy"
43
+ }
44
+ }
@@ -69,6 +69,16 @@
69
69
  ],
70
70
  "vault_path": "string — Obsidian vault written by Kavi collect (empty until first collect)",
71
71
  "last_collect_at": "ISO 8601 timestamp — last successful collect run",
72
+ "deliberation": {
73
+ "round": "number — current deliberation round",
74
+ "max_rounds": "number",
75
+ "satisfaction_threshold": "number 0.0–1.0",
76
+ "open_objections": ["object — unresolved blocking objections"],
77
+ "round_log": ["object — per-persona per-round parsed output"],
78
+ "consensus_reached": "boolean",
79
+ "raj_escalated": "boolean",
80
+ "mode": "adversarial | legacy"
81
+ },
72
82
  "digest": {
73
83
  "task_map_summary": "string — short summary passed to persona calls instead of the full task_map/persona_outputs history",
74
84
  "hierarchy_top3": ["string — top 3 ranked hierarchy items, if declared"],
@@ -86,7 +96,11 @@
86
96
  "cache_hits": "number — retrieve/cache hits during the last run",
87
97
  "mode": "lite | full",
88
98
  "effort_log": [{ "persona": "string", "effort": "trivial|standard|hard", "model": "string|null", "scoped_mode": "string|null" }],
89
- "cost_usd": "number — estimated $ cost of the run from config.pricing (0 when pricing missing)"
99
+ "cost_usd": "number — estimated $ cost of the run from config.pricing (0 when pricing missing)",
100
+ "deliberation_rounds": "number — adversarial rounds executed in last run",
101
+ "objections_raised": "number",
102
+ "objections_resolved": "number",
103
+ "raj_escalations": "number"
90
104
  }
91
105
  }
92
106
  }