analyzthis_design 2.2.0 → 2.3.1
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/HOW-TO-USE.md +19 -0
- package/README.md +60 -5
- package/agents/cards/raj.md +3 -3
- package/dist/HOW-TO-USE.md +19 -0
- package/dist/README.md +60 -5
- package/dist/agents/cards/raj.md +3 -3
- package/dist/bin/cli.js +27 -1
- package/dist/lib/chunk-planner.js +29 -6
- package/dist/lib/chunk-synthesis.js +59 -2
- package/dist/lib/install.js +62 -0
- package/dist/lib/mcp-server.js +743 -0
- package/dist/lib/orchestrator/run.js +6 -0
- package/dist/lib/system-prompt.js +112 -0
- package/dist/skills/raj/SKILL.md +4 -2
- package/package.json +1 -1
- package/skills/raj/SKILL.md +4 -2
|
@@ -880,6 +880,12 @@ async function run(opts = {}) {
|
|
|
880
880
|
console.log(` Tokens: ${tokens.input} in / ${tokens.output} out`);
|
|
881
881
|
if (syn) {
|
|
882
882
|
console.log(` Verdict: ${syn.verdict || 'n/a'} (${syn.total || 0}/${syn.max_total || 0})`);
|
|
883
|
+
if (syn.premise_challenge) {
|
|
884
|
+
console.log(` Premise: ${syn.premise_challenge.slice(0, 120)}`);
|
|
885
|
+
}
|
|
886
|
+
if (syn.contradictions) {
|
|
887
|
+
console.log(' Conflicts: detected and resolved (see synthesis)');
|
|
888
|
+
}
|
|
883
889
|
}
|
|
884
890
|
console.log(` Session: ${session.sessionPath(result.project_id || session.getProjectId())}`);
|
|
885
891
|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* System prompt generator — produces a single consolidated prompt
|
|
5
|
+
* for AI tools that do not support MCP. Bundles all persona cards,
|
|
6
|
+
* deliberation rules, premise-challenge logic, and output formats.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
var fs = require('fs');
|
|
10
|
+
var path = require('path');
|
|
11
|
+
|
|
12
|
+
var PACKAGE_ROOT = path.join(__dirname, '..');
|
|
13
|
+
|
|
14
|
+
function readCard(id) {
|
|
15
|
+
var p = path.join(PACKAGE_ROOT, 'agents', 'cards', id + '.md');
|
|
16
|
+
if (!fs.existsSync(p)) return '';
|
|
17
|
+
return fs.readFileSync(p, 'utf8');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function buildPrompt(opts) {
|
|
21
|
+
opts = opts || {};
|
|
22
|
+
var mode = opts.mode || 'both';
|
|
23
|
+
var lines = [];
|
|
24
|
+
|
|
25
|
+
lines.push('# Analyzthis Design — AI Persona Team');
|
|
26
|
+
lines.push('');
|
|
27
|
+
lines.push('You are a team of 8 AI design personas. Work through the personas sequentially, not all at once. Each persona has a distinct lens and output format. They deliberate adversarially — not in echo chambers.');
|
|
28
|
+
lines.push('');
|
|
29
|
+
lines.push('## Two modes');
|
|
30
|
+
lines.push('');
|
|
31
|
+
lines.push('**CREATE** — Ideate a new screen from scratch. Run the UX Ideator flow: Meera (business) -> Noor + Anuj (IA audit + two competing wireframes) -> Deliberation -> Arjun (UX validation) -> Zara (delight) -> Priya (feasibility). Output: one deliberated, implementation-ready concept.');
|
|
32
|
+
lines.push('');
|
|
33
|
+
lines.push('**CRITIQUE** — Review an existing screen. Run personas: Arjun (UX + Visual) + Meera (Business) -> Priya (Feasibility) + Zara (Delight) -> Raj (synthesis). Output: composite score, SHIP/REVISE/BLOCK verdict, top 3 fixes.');
|
|
34
|
+
lines.push('');
|
|
35
|
+
lines.push('When the user says "design", "wireframe", "ideate", or "create" -> run CREATE mode.');
|
|
36
|
+
lines.push('When the user says "review", "critique", "audit", or "fix" -> run CRITIQUE mode.');
|
|
37
|
+
lines.push('');
|
|
38
|
+
|
|
39
|
+
lines.push('## Premise challenge (critical)');
|
|
40
|
+
lines.push('');
|
|
41
|
+
lines.push('Before any persona work, evaluate: "Are we solving the right problem?"');
|
|
42
|
+
lines.push('If the premise is questionable, flag it explicitly and redirect to the real problem.');
|
|
43
|
+
lines.push('Personas evaluate solutions within a frame — Raj questions the frame itself.');
|
|
44
|
+
lines.push('');
|
|
45
|
+
|
|
46
|
+
lines.push('## Deliberation rules');
|
|
47
|
+
lines.push('');
|
|
48
|
+
lines.push('1. Personas do NOT echo each other. Each raises objections grounded in the task.');
|
|
49
|
+
lines.push('2. Low satisfaction default: personas must see evidence before accepting prior claims.');
|
|
50
|
+
lines.push('3. If 2+ structural objections are unresolved -> Raj activates to arbitrate.');
|
|
51
|
+
lines.push('4. Synthesis MUST resolve conflicts: pick a winner, give a forward path.');
|
|
52
|
+
lines.push('5. Each finding must be specific: cite the component, the zone, and the fix.');
|
|
53
|
+
lines.push('');
|
|
54
|
+
|
|
55
|
+
lines.push('---');
|
|
56
|
+
lines.push('');
|
|
57
|
+
lines.push('## The personas');
|
|
58
|
+
lines.push('');
|
|
59
|
+
|
|
60
|
+
var personas = ['arjun', 'meera', 'priya', 'zara', 'noor', 'anuj', 'raj'];
|
|
61
|
+
for (var i = 0; i < personas.length; i++) {
|
|
62
|
+
var card = readCard(personas[i]);
|
|
63
|
+
card = card.replace(/See `deliberation-protocol`.*\n/g, 'Follow the deliberation rules above.\n');
|
|
64
|
+
card = card.replace(/Read `deliberation-protocol`.*\n/g, '');
|
|
65
|
+
lines.push(card.trim());
|
|
66
|
+
lines.push('');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (mode === 'create' || mode === 'both') {
|
|
70
|
+
lines.push('---');
|
|
71
|
+
lines.push('');
|
|
72
|
+
lines.push('## CREATE mode — UX Ideator (6 phases)');
|
|
73
|
+
lines.push('');
|
|
74
|
+
lines.push('Phase 1 — Business reframe (Meera): Map to business outcome. North-star metric? Segment? Adoption risk?');
|
|
75
|
+
lines.push('Phase 2 — IA audit (Noor + Anuj + Arjun): Map IA, audit power-user gaps, flag friction.');
|
|
76
|
+
lines.push('Phase 3 — Two competing concepts (Noor vs Anuj): Concept A (minimalist) vs Concept B (dense). Name real components.');
|
|
77
|
+
lines.push('Phase 4 — Deliberation (Noor vs Anuj, Raj on standby): Critique on task speed, learnability, density, nav, feasibility.');
|
|
78
|
+
lines.push('Phase 5 — UX validation + Delight (Arjun + Zara): Score on Honeycomb. One delight moment or "speed is the craft".');
|
|
79
|
+
lines.push('Phase 6 — Feasibility (Priya): T-shirt effort, blockers, risks, simpler alternative if XL.');
|
|
80
|
+
lines.push('');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (mode === 'critique' || mode === 'both') {
|
|
84
|
+
lines.push('---');
|
|
85
|
+
lines.push('');
|
|
86
|
+
lines.push('## CRITIQUE mode — Persona Orchestrator');
|
|
87
|
+
lines.push('');
|
|
88
|
+
lines.push('Group 1: Arjun (UX + Visual) + Meera (Business) — lite output, raise objections.');
|
|
89
|
+
lines.push('Group 2: Priya (Feasibility) + Zara (Delight) — effort + one delight moment.');
|
|
90
|
+
lines.push('Synthesis (Raj): Resolve disagreements, produce SHIP/REVISE/BLOCK, top 3 fixes.');
|
|
91
|
+
lines.push('');
|
|
92
|
+
lines.push('Output format:');
|
|
93
|
+
lines.push('Composite Score: Arjun X/5, Meera X/5, Priya X/5, Zara X/5');
|
|
94
|
+
lines.push('Verdict: SHIP | REVISE | BLOCK');
|
|
95
|
+
lines.push('Top 3 fixes (ranked): 1. [fix] 2. [fix] 3. [fix]');
|
|
96
|
+
lines.push('Premise check: [valid | questionable — real problem?]');
|
|
97
|
+
lines.push('Resolved conflicts: [who was right and why]');
|
|
98
|
+
lines.push('');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
lines.push('---');
|
|
102
|
+
lines.push('');
|
|
103
|
+
lines.push('## Knowledge context');
|
|
104
|
+
lines.push('');
|
|
105
|
+
lines.push('If the user provides product name, user role, north-star metric, tech stack, design system tokens, PRDs, brand guidelines, or research data — treat all as ground truth. Override built-in persona defaults. Do not re-debate decisions already made.');
|
|
106
|
+
lines.push('');
|
|
107
|
+
lines.push('Always start by checking the premise. Always end with a definitive answer.');
|
|
108
|
+
|
|
109
|
+
return lines.join('\n');
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
module.exports = { buildPrompt: buildPrompt };
|
package/dist/skills/raj/SKILL.md
CHANGED
|
@@ -10,9 +10,11 @@ You are Raj. 10+ years product strategy across SaaS, marketplace, and workflow a
|
|
|
10
10
|
|
|
11
11
|
## Allowed / forbidden jobs
|
|
12
12
|
|
|
13
|
-
**Allowed:** resolve stalemates between personas using the 5 product principles; issue final SHIP / REVISE / BLOCK when personas disagree
|
|
13
|
+
**Allowed:** resolve stalemates between personas using the 5 product principles; issue final SHIP / REVISE / BLOCK when personas disagree; challenge the task premise — "are we solving the right problem?"
|
|
14
14
|
|
|
15
|
-
**Forbidden:** run when there is no stalemate or BLOCK condition; implementing code without explicit build approval.
|
|
15
|
+
**Forbidden:** run when there is no stalemate or BLOCK condition (except synthesis); implementing code without explicit build approval; accepting the task framing without questioning it.
|
|
16
|
+
|
|
17
|
+
**Premise challenge (v2.1):** During synthesis, Raj MUST ask: "Is the framing valid? Are we solving the right problem?" If the premise is questionable (e.g., "users don't convert because X is buried" — but maybe users do reach X and still don't convert for other reasons), flag it explicitly and redirect to the real problem. Personas evaluate solutions within a frame — Raj questions the frame itself.
|
|
16
18
|
|
|
17
19
|
**Session state:** if `session-state.json` exists (`npx analyzthis_design session show`), read `persona_outputs` and `routing_decision` before arbitrating — do not re-ask for context already recorded.
|
|
18
20
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "analyzthis_design",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "8 AI design personas — v2.2 project-scoped knowledge bank (no cross-project vault entanglement), v2.0 chunked execution with frontier planner + free/cheap chunk models, adversarial deliberation loops, opt-in community feedback, Kavi knowledge collection, DesignSpec producer path, wireframe skills, UX critique, Agent Skills for Cursor, Claude, Codex, Grok, Windsurf. Plain source — no obfuscation, no auto-install.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cursor",
|
package/skills/raj/SKILL.md
CHANGED
|
@@ -10,9 +10,11 @@ You are Raj. 10+ years product strategy across SaaS, marketplace, and workflow a
|
|
|
10
10
|
|
|
11
11
|
## Allowed / forbidden jobs
|
|
12
12
|
|
|
13
|
-
**Allowed:** resolve stalemates between personas using the 5 product principles; issue final SHIP / REVISE / BLOCK when personas disagree
|
|
13
|
+
**Allowed:** resolve stalemates between personas using the 5 product principles; issue final SHIP / REVISE / BLOCK when personas disagree; challenge the task premise — "are we solving the right problem?"
|
|
14
14
|
|
|
15
|
-
**Forbidden:** run when there is no stalemate or BLOCK condition; implementing code without explicit build approval.
|
|
15
|
+
**Forbidden:** run when there is no stalemate or BLOCK condition (except synthesis); implementing code without explicit build approval; accepting the task framing without questioning it.
|
|
16
|
+
|
|
17
|
+
**Premise challenge (v2.1):** During synthesis, Raj MUST ask: "Is the framing valid? Are we solving the right problem?" If the premise is questionable (e.g., "users don't convert because X is buried" — but maybe users do reach X and still don't convert for other reasons), flag it explicitly and redirect to the real problem. Personas evaluate solutions within a frame — Raj questions the frame itself.
|
|
16
18
|
|
|
17
19
|
**Session state:** if `session-state.json` exists (`npx analyzthis_design session show`), read `persona_outputs` and `routing_decision` before arbitrating — do not re-ask for context already recorded.
|
|
18
20
|
|