analyzthis_design 2.0.0 → 2.1.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 (69) hide show
  1. package/HOW-TO-USE.md +436 -0
  2. package/README.md +29 -13
  3. package/agents/cards/evolve-check.md +38 -0
  4. package/agents/manifests/evolve-check.json +16 -0
  5. package/dist/HOW-TO-USE.md +15 -3
  6. package/dist/README.md +29 -13
  7. package/dist/agents/cards/evolve-check.md +38 -0
  8. package/dist/agents/manifests/evolve-check.json +16 -0
  9. package/dist/bin/cli.js +1225 -1
  10. package/dist/lib/cache.js +111 -1
  11. package/dist/lib/chunk-executor.js +219 -1
  12. package/dist/lib/chunk-models.js +228 -1
  13. package/dist/lib/chunk-planner.js +328 -1
  14. package/dist/lib/chunk-router.js +66 -1
  15. package/dist/lib/chunk-run.js +199 -1
  16. package/dist/lib/chunk-synthesis.js +176 -1
  17. package/dist/lib/chunk-telemetry.js +88 -1
  18. package/dist/lib/collect.js +858 -1
  19. package/dist/lib/cost.js +119 -1
  20. package/dist/lib/dedup.js +167 -1
  21. package/dist/lib/deliberation.js +721 -1
  22. package/dist/lib/design-spec.js +236 -1
  23. package/dist/lib/evolution-metrics.js +197 -0
  24. package/dist/lib/evolve.js +361 -1
  25. package/dist/lib/export.js +77 -1
  26. package/dist/lib/feedback-submit.js +324 -1
  27. package/dist/lib/feedback.js +182 -1
  28. package/dist/lib/host-llm.js +251 -1
  29. package/dist/lib/install.js +301 -1
  30. package/dist/lib/knowledge.js +384 -1
  31. package/dist/lib/lessons.js +217 -1
  32. package/dist/lib/moodboard.js +563 -1
  33. package/dist/lib/orchestrator/run.js +935 -1
  34. package/dist/lib/outcome.js +193 -1
  35. package/dist/lib/platforms.js +166 -1
  36. package/dist/lib/provider.js +57 -1
  37. package/dist/lib/query-expander.js +83 -1
  38. package/dist/lib/ranker.js +105 -1
  39. package/dist/lib/reference-pack.js +221 -0
  40. package/dist/lib/research.js +143 -1
  41. package/dist/lib/retrieve.js +131 -1
  42. package/dist/lib/session.js +185 -1
  43. package/dist/lib/source-discovery.js +486 -1
  44. package/dist/lib/synthesis.js +155 -1
  45. package/dist/lib/token-gate.js +46 -1
  46. package/dist/skills/design-reference/google-fonts.csv +1924 -1924
  47. package/dist/skills/design-reference/products.csv +162 -162
  48. package/dist/skills/design-reference/schema.json +159 -0
  49. package/dist/skills/design-reference/stacks/angular.csv +1 -1
  50. package/dist/skills/design-reference/stacks/astro.csv +1 -1
  51. package/dist/skills/design-reference/stacks/laravel.csv +2 -2
  52. package/dist/skills/design-reference/stacks/threejs.csv +54 -54
  53. package/dist/skills/design-reference/styles.csv +85 -85
  54. package/dist/skills/design-reference/typography.csv +75 -74
  55. package/dist/skills/design-reference/ui-reasoning.csv +1 -1
  56. package/dist/skills/evolve-check/SKILL.md +106 -0
  57. package/package.json +8 -8
  58. package/scripts/validate-csvs.js +197 -0
  59. package/skills/design-reference/google-fonts.csv +1924 -1924
  60. package/skills/design-reference/products.csv +162 -162
  61. package/skills/design-reference/schema.json +159 -0
  62. package/skills/design-reference/stacks/angular.csv +1 -1
  63. package/skills/design-reference/stacks/astro.csv +1 -1
  64. package/skills/design-reference/stacks/laravel.csv +2 -2
  65. package/skills/design-reference/stacks/threejs.csv +54 -54
  66. package/skills/design-reference/styles.csv +85 -85
  67. package/skills/design-reference/typography.csv +75 -74
  68. package/skills/design-reference/ui-reasoning.csv +1 -1
  69. package/skills/evolve-check/SKILL.md +106 -0
package/dist/README.md CHANGED
@@ -15,23 +15,28 @@ Install once. Run structured UX critiques, multi-phase ideation, and task-ground
15
15
 
16
16
  Use `npx analyzthis_design run-unchunked` for the legacy single-pass orchestrator.
17
17
 
18
- **npm:** [analyzthis_design](https://www.npmjs.com/package/analyzthis_design) · **Current version:** 2.0.0 · **Step-by-step guide:** [HOW-TO-USE.md](./HOW-TO-USE.md)
18
+ **npm:** [analyzthis_design](https://www.npmjs.com/package/analyzthis_design) · **Current version:** 2.1.0 · **Step-by-step guide:** [HOW-TO-USE.md](./HOW-TO-USE.md)
19
19
 
20
20
  ---
21
21
 
22
22
  ## Quick start
23
23
 
24
24
  ```bash
25
- # 1. Install slash commands (Cursor/Claude/Codex/Grok/Windsurf)
26
- npx analyzthis_design
25
+ # 1. Install the npm package (no auto-install, no obfuscation)
26
+ npm install -g analyzthis_design
27
+
28
+ # 2. Install slash commands into your IDE (explicit, consent-based)
29
+ npx analyzthis_design --target all
27
30
 
28
- # 2. Run a task in v2.0 chunked mode (free/cheap models)
31
+ # 3. Run a task in v2.0 chunked mode (free/cheap models)
29
32
  npx analyzthis_design run --task "Review invoice approval screen"
30
33
 
31
- # 3. Or use legacy single-pass orchestrator
34
+ # 4. Or use legacy single-pass orchestrator
32
35
  npx analyzthis_design run-unchunked --task "Review invoice approval screen" --provider host
33
36
  ```
34
37
 
38
+ > **Security:** This package publishes **plain source** — no obfuscation, no minification, no dynamic require. Every file in `dist/` is readable and auditable. The `postinstall` script only prints a welcome message; it does **not** write to any AI-agent directories. Skill installation requires an explicit `npx analyzthis_design --target <ide>` command.
39
+
35
40
  ### Install by target IDE
36
41
 
37
42
  ```bash
@@ -379,6 +384,9 @@ Ask → session digest → MoE router (1–2 experts, not 4) → persona cards (
379
384
  | **Persona cards** | `agents/cards/<persona>.md` (~500 tokens) are the default system prompt; the full `skills/<persona>/SKILL.md` is only opened for a C-or-below rubric lookup or an explicit deep/full request. |
380
385
  | **Lite output schema** | Grades + Top 2 fixes + score, by default. Deep/full schema is opt-in. |
381
386
  | **Retrieve-on-demand** | `npx analyzthis_design retrieve --file colors.csv --column "Product Type" --keywords saas` returns only matching rows, pre-formatted for citation — never the whole CSV. |
387
+ | **Multi-file reference packs** | Each persona retrieves from 3-5 CSV files (not 1), pooled into a single ranker call. Arjun gets styles + ux-guidelines + ui-reasoning + charts; Zara gets colors + typography + styles + landing + icons. Same LLM cost as single-file, 3-5x coverage. |
388
+ | **Best For Tags** | `styles.csv` and `typography.csv` have a `Best For Tags` column (semicolon-delimited product-type tokens) for reliable keyword filtering. Previously `Best For` was free-text and 31/84 styles were unfilterable. |
389
+ | **CSV schema + validation** | `skills/design-reference/schema.json` defines all 28 CSV files' headers, filter columns, and cross-file joins. `npm run validate` checks integrity before publish. |
382
390
  | **Model tiers** | `structured` steps can run on a cheaper model (e.g. `gpt-4o-mini`); `critique`/`arbitrate` steps use a stronger model. Configurable per tier in `~/.analyzthis_design/config.json`. |
383
391
  | **Caching** | `lib/cache.js` caches retrieve results (invalidated automatically when the source CSV changes) and knowledge-bank slices (invalidated on `sync` / `session reset`). |
384
392
  | **Cost metrics** | Every `run` records `metrics` (llm_calls, experts_run, estimated tokens, cache_hits) into session state. |
@@ -458,12 +466,12 @@ evolve --extract → proposes:
458
466
  - reference-data rows (new product-type patterns)
459
467
  - router patches (task_type → best-performing expert)
460
468
 
461
- evolve --apply <patchId> (human review) → skill/CSV/router updated
462
-
469
+ evolve --apply <patchId> (human review) → skill/CSV/router updated
470
+
463
471
  Next run retrieves:
464
472
  - per-persona knowledge slices (priority + fallback)
465
473
  - past lessons for similar tasks
466
- - query-expanded + ranked reference rows
474
+ - query-expanded + ranked reference rows from 3-5 CSV files per persona
467
475
  ```
468
476
 
469
477
  ### Retrieval stack
@@ -709,12 +717,14 @@ npx analyzthis_design research --query <text>
709
717
  # Reference data (retrieve-on-demand)
710
718
  npx analyzthis_design retrieve --file <csv> --column <col> --keywords a,b [--limit N]
711
719
 
712
- # Standalone orchestrator
713
- npx analyzthis_design run --task "..." [--figma URL] [--provider host|anthropic|openai|google|zai] [--dry-run] [--output path]
714
- npx analyzthis_design run --task "..." [--lite | --full] [--experts a,b]
715
- npx analyzthis_design run --task "..." [--deliberate | --no-deliberate] [--max-rounds N] [--satisfaction 0.4]
720
+ # Standalone orchestrator (v2.0 chunked by default)
721
+ npx analyzthis_design run --task "..." [--budget free|cheap|auto] [--sequential|--parallel] [--max-chunks N] [--dry-run]
722
+ npx analyzthis_design run-unchunked --task "..." [--lite|--full] [--experts a,b] [--dry-run] [--deliberate|--no-deliberate]
716
723
  npx analyzthis_design run --continue --task "..." # resume host-mode run after /devi
717
724
 
725
+ # CSV validation
726
+ npx analyzthis_design validate # validate all 28 CSV files against schema.json
727
+
718
728
  # Self-evolving team (v1.21)
719
729
  npx analyzthis_design evolve --extract [--window N] [--dry-run]
720
730
  npx analyzthis_design evolve --apply <patchId> [--dry-run]
@@ -764,6 +774,7 @@ lib/
764
774
  chunk-synthesis.js Merge chunk outputs into final verdict
765
775
  chunk-telemetry.js Per-chunk model quality tracking
766
776
  chunk-run.js Top-level chunked execution coordinator
777
+ reference-pack.js Shared multi-file CSV + vault retrieval (buildReferencePack)
767
778
  moodboard.js Mood-board engine: collect web/DS references, tag, deliberate
768
779
  dedup.js Cross-persona redundancy detection
769
780
  lessons.js Self-evolving lessons store (extract/retrieve/inject)
@@ -785,6 +796,7 @@ scripts/
785
796
  quality-check.js Validate persona outputs vs skill + deliberation protocol
786
797
  demo-fictional-deliberation.js Dry-run walkthrough for FlowPay scenario
787
798
  scripts/obfuscate.js Build step → dist/
799
+ scripts/validate-csvs.js CSV integrity validation against schema.json
788
800
  skills/
789
801
  devi/ Host LLM runtime — voices personas from pending prompts
790
802
  kavi/ Kavi — Knowledge Archivist (/kavi)
@@ -804,7 +816,7 @@ skills/
804
816
 
805
817
  - Node.js 16+
806
818
  - Any Agent Skills–compatible host: [Cursor](https://cursor.com), [Claude Code](https://code.claude.com), Codex CLI, [Grok Build](https://x.ai), or Windsurf Cascade
807
- - **CLI `run`:** works without API keys via **`/devi`** host mode (default). Optional keys for automated API runs: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `ZAI_API_KEY`
819
+ - **CLI `run`:** works without API keys via **`/devi`** host mode (default). Optional keys for automated API runs: `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `ZAI_API_KEY`, `GROQ_API_KEY`, `TOGETHER_API_KEY`, `OPENROUTER_API_KEY`, `DEEPSEEK_API_KEY`. Local Ollama auto-detected at `localhost:11434`.
808
820
  - **Kavi `collect` enrichment:** optional — same keys as above; without keys, draft vault + sync still run
809
821
 
810
822
  ---
@@ -818,6 +830,10 @@ skills/
818
830
  | **Chunk telemetry** | Tracks per-model success rate so router improves over time |
819
831
  | **Legacy mode preserved** | `npx analyzthis_design run-unchunked` for the original single-pass orchestrator |
820
832
  | **Planner never cheap** | Planner always uses frontier/host; chunk models are cost-optimized |
833
+ | **Multi-file reference retrieval** | Each persona retrieves from 3-5 CSV files (not 1) via a shared ranker — same LLM cost, 3-5x coverage |
834
+ | **All 16 stacks detected** | `detectStack()` covers all 16 stack CSVs (flutter, swiftui, laravel, threejs, etc.) — was 8 |
835
+ | **CSV schema + validation** | `npm run validate` checks all 28 CSV files against `schema.json` before publish |
836
+ | **Best For Tags** | styles.csv + typography.csv have normalized tag columns for reliable keyword filtering |
821
837
 
822
838
  ## What's new in v1.22
823
839
 
@@ -0,0 +1,38 @@
1
+ # Evolve Check
2
+
3
+ **Devi skill** — After a successful critique run, check if the team has enough data to evolve and offer to run the evolution cycle.
4
+
5
+ ---
6
+
7
+ ## When to invoke
8
+
9
+ After a completed `run` or `run-unchunked` where:
10
+ - Personas produced outputs
11
+ - User accepted at least some outputs
12
+ - Outcomes were confirmed (shipped/revised/blocked/missed)
13
+
14
+ ---
15
+
16
+ ## What to do
17
+
18
+ 1. Run: `npx analyzthis_design evolve --ready --project <project>`
19
+ 2. If ready → summarize pending patches and ask: "The team has enough data to evolve. Apply proposed patches?"
20
+ 3. If user says yes → run `npx analyzthis_design evolve --apply <patchId>` for each patch
21
+ 4. If not ready → tell user what's needed: "Need X more lessons / Y more outcomes"
22
+
23
+ ---
24
+
25
+ ## Example response
26
+
27
+ > ��� **Devi here!** The critique run completed successfully. I checked the team's evolution status — we have **2 lessons** and **0 confirmed outcomes**. Need **3 more lessons** or **10 outcomes** to trigger evolution.
28
+ >
29
+ > Want me to run a critique on another screen to build up the data?
30
+
31
+ ---
32
+
33
+ ## Commands reference
34
+
35
+ - `npx analyzthis_design evolve --ready --project <id>` — check readiness
36
+ - `npx analyzthis_design evolve --metrics --project <id>` — show evolution dashboard
37
+ - `npx analyzthis_design evolve --extract --dry-run` — preview patches
38
+ - `npx analyzthis_design evolve --apply <id>` — apply a patch
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evolve-check",
3
+ "name": "Evolve Check",
4
+ "type": "utility",
5
+ "tier": "structured",
6
+ "system_card": "agents/cards/evolve-check.md",
7
+ "system_skill": "skills/evolve-check/SKILL.md",
8
+ "allowed_jobs": ["evolve_check", "metrics_report"],
9
+ "forbidden_jobs": ["critique", "wireframe", "synthesize"],
10
+ "knowledge_categories": [],
11
+ "max_output_tokens": 600,
12
+ "effort_overrides": {
13
+ "trivial": { "provider": "host", "model": "devi", "max_output_tokens": 400 },
14
+ "standard": { "provider": "host", "model": "devi", "max_output_tokens": 600 }
15
+ }
16
+ }