chati-dev 4.0.1 → 4.0.2

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 (44) hide show
  1. package/framework/agents/build/dev.md +23 -3
  2. package/framework/agents/plan/ux.md +354 -8
  3. package/framework/config.yaml +3 -3
  4. package/framework/constitution.md +4 -3
  5. package/framework/domains/agents/architect.yaml +1 -3
  6. package/framework/domains/agents/brief.yaml +1 -1
  7. package/framework/domains/agents/brownfield-wu.yaml +2 -2
  8. package/framework/domains/agents/detail.yaml +1 -1
  9. package/framework/domains/agents/devops.yaml +2 -4
  10. package/framework/domains/agents/greenfield-wu.yaml +2 -2
  11. package/framework/domains/agents/phases.yaml +1 -1
  12. package/framework/domains/agents/qa-implementation.yaml +4 -6
  13. package/framework/domains/agents/qa-planning.yaml +7 -10
  14. package/framework/domains/agents/tasks.yaml +1 -1
  15. package/framework/domains/agents/ux.yaml +21 -3
  16. package/framework/domains/constitution.yaml +4 -4
  17. package/framework/domains/global.yaml +1 -1
  18. package/framework/intelligence/context-engine.md +1 -1
  19. package/framework/templates/brandbook-tmpl.yaml +40 -0
  20. package/framework/templates/component-spec-tmpl.yaml +50 -3
  21. package/package.json +1 -1
  22. package/src/api/index.js +10 -19
  23. package/src/autonomy/build-loop.js +1 -1
  24. package/src/autonomy/cause-analyzer.js +1 -1
  25. package/src/autonomy/worktree-manager.js +7 -2
  26. package/src/config/agent-customizer.js +1 -5
  27. package/src/config/context-file-generator.js +1 -1
  28. package/src/context/bracket-tracker.js +2 -13
  29. package/src/decision/engine.js +4 -0
  30. package/src/health/auto-fix.js +1 -1
  31. package/src/installer/core.js +8 -1
  32. package/src/intelligence/context-status.js +2 -17
  33. package/src/intelligence/decision-engine.js +5 -2
  34. package/src/intelligence/timeline.js +1 -1
  35. package/src/merger/semantic-merger.js +1 -1
  36. package/src/orchestrator/pipeline-manager.js +33 -46
  37. package/src/quality/metrics-collector.js +0 -2
  38. package/src/telemetry/config.js +2 -2
  39. package/src/telemetry/schema.js +1 -1
  40. package/src/terminal/isolation.js +10 -1
  41. package/src/terminal/prompt-builder.js +77 -9
  42. package/src/utils/brackets.js +29 -0
  43. package/src/utils/event-bus.js +1 -1
  44. package/src/utils/provider-limits.js +13 -0
@@ -185,6 +185,25 @@ Penalty: Any hardcoded visual value reduces task score by 5%
185
185
  Exception: Values not covered by Design System tokens are allowed with documentation
186
186
  ```
187
187
 
188
+ ### Component State Coverage Enforcement
189
+
190
+ ```
191
+ MANDATORY: Implement ALL states specified in UX specification
192
+
193
+ Every interactive component MUST implement:
194
+ - default, hover, active, focus, disabled states
195
+ - Loading state with skeleton or spinner as specified
196
+ - Error state with recovery action
197
+ - Empty state with guidance CTA
198
+
199
+ DO NOT:
200
+ - Implement only the "default" state and leave others for later
201
+ - Use generic "Something went wrong" for error states
202
+ - Show blank/white space for empty states
203
+
204
+ Penalty: Missing state implementation reduces task score by 5% per missing state category
205
+ ```
206
+
188
207
  ---
189
208
 
190
209
  ## Blocker Taxonomy
@@ -234,9 +253,10 @@ Criteria:
234
253
  2. All Given-When-Then acceptance criteria pass
235
254
  3. Tests written and passing
236
255
  4. Design System tokens used (no hardcoded visual values)
237
- 5. No lint errors
238
- 6. Self-critique (5.5 + 6.5) completed
239
- 7. No blockers remaining
256
+ 5. All component states from UX specification implemented (no happy-path-only)
257
+ 6. No lint errors
258
+ 7. Self-critique (5.5 + 6.5) completed
259
+ 8. No blockers remaining
240
260
 
241
261
  Score = criteria met / total criteria
242
262
  Threshold: >= 95% per task
@@ -193,7 +193,28 @@ Layer 4 — Component Patterns (Atomic Design):
193
193
  Templates:
194
194
  Page layouts with placeholder regions
195
195
 
196
- Layer 5 — Tokenization Audit:
196
+ Layer 5 — Motion System Tokens:
197
+ Duration scale:
198
+ --motion-duration-instant: 100ms (micro-feedback, button press)
199
+ --motion-duration-fast: 200ms (hover, focus ring transitions)
200
+ --motion-duration-normal: 350ms (section reveals, card entrance)
201
+ --motion-duration-slow: 600ms (page transitions, modal open)
202
+ --motion-duration-scenic: 1200ms (hero animations, ambient effects)
203
+
204
+ Easing presets:
205
+ --motion-ease-standard: cubic-bezier(0.4, 0.0, 0.2, 1) (default — most transitions)
206
+ --motion-ease-decelerate: cubic-bezier(0.0, 0.0, 0.2, 1) (entering elements)
207
+ --motion-ease-accelerate: cubic-bezier(0.4, 0.0, 1, 1) (exiting elements)
208
+ --motion-ease-spring: spring(stiffness: 400, damping: 28) (interactive, snappy)
209
+ --motion-ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1) (playful UI)
210
+
211
+ Animation personality (inherits from Directive 4 visual direction):
212
+ Energetic: fast durations, spring easing, stagger 0.05s
213
+ Elegant: slow durations, decelerate easing, no bounce
214
+ Minimal: instant/fast only, opacity-only reveals
215
+ Playful: bounce easing, stagger 0.08s, scale transforms
216
+
217
+ Layer 6 — Tokenization Audit:
197
218
  Run Directive 2 tokenization completeness check
198
219
  Report coverage percentages
199
220
  Zero hardcoded values is the target
@@ -245,9 +266,15 @@ Criteria (binary pass/fail):
245
266
  12. Tokenization coverage >= 95% — no hardcoded visual values (Directive 2)
246
267
  13. Reference benchmarking completed OR explicitly waived by user (Directive 3)
247
268
  14. Visual direction is unique — font pairing, color palette, and layout archetype differ from permanent references and recent projects (Directive 4)
269
+ 15. Layout diversity verified — no two consecutive sections share the same grid structure, minimum 2 layout archetypes per page (Directive 5A/5D)
270
+ 16. All interactive components specify full state coverage (interactive + input + data view states as applicable) (Directive 5E)
271
+ 17. Zero banned placeholder content — no lorem ipsum, no "John Doe", domain-realistic sample data used (Directive 5F)
272
+ 18. All animations use GPU-only properties (transform/opacity) with reduced-motion alternatives (Directive 5G)
273
+ 19. Motion System defined: library specified by stack, animation tokens in Design System Layer 5, scroll animations + micro-interactions catalogued, reduced-motion alternatives provided (Directive 6)
274
+ 20. Component discovery completed for all Molecules and Organisms via 21st.dev: each component shows evidence of discovery (adapted from source OR documented "not found" rationale) (Directive 7)
248
275
 
249
276
  Score = criteria met / total criteria
250
- Threshold: >= 93% (13/14 minimum)
277
+ Threshold: >= 90% (standard agent tier, 18/20 target)
251
278
  ```
252
279
 
253
280
  ---
@@ -354,7 +381,7 @@ agents:
354
381
  ux:
355
382
  status: completed
356
383
  score: {calculated}
357
- criteria_count: 14
384
+ criteria_count: 20
358
385
  completed_at: "{timestamp}"
359
386
  current_agent: phases
360
387
  ```
@@ -420,10 +447,11 @@ Rules:
420
447
  | `wireframe` | Wireframe | Create text-based wireframes for all key screens identified in the Brief and PRD | Auto on activation |
421
448
  | `user-flow` | User Flow Mapping | Map primary and secondary user journeys for each persona, including happy and error paths | After wireframe |
422
449
  | `ref-benchmark` | Reference Benchmarking | Analyze user-provided reference URLs for visual quality patterns, produce reference-analysis.md (Directive 3) | Before component-map |
423
- | `component-map` | Component Mapping | Identify reusable UI components using Atomic Design hierarchy (atoms, molecules, organisms), map to Design System, prioritize reuse | After user-flow + ref-benchmark |
450
+ | `ref-component-discovery` | Component Discovery | Search 21st.dev for existing component patterns for all Molecules and Organisms identified in user flows (Directive 7) | After user-flow, before component-map |
451
+ | `component-map` | Component Mapping | Identify reusable UI components using Atomic Design hierarchy (atoms, molecules, organisms), map to Design System, prioritize reuse | After user-flow + ref-benchmark + ref-component-discovery |
424
452
  | `a11y-check` | Accessibility Check | Validate all flows and components against WCAG 2.1 AA requirements, keyboard navigation, screen reader support | After component-map |
425
453
  | `token-audit` | Tokenization Audit | Verify 100% tokenization coverage — zero hardcoded values, all icons from approved libraries (Directives 1 & 2) | After a11y-check |
426
- | `ux-consolidate` | Consolidate UX Spec | Compile all UX artifacts into the final specification document and run self-validation (14 criteria) | After all above |
454
+ | `ux-consolidate` | Consolidate UX Spec | Compile all UX artifacts into the final specification document and run self-validation (20 criteria) | After all above |
427
455
 
428
456
  ---
429
457
 
@@ -633,6 +661,52 @@ The 5 permanent references define the **quality floor**, not the **visual identi
633
661
  | **Animation personality** | Motion character | Energetic (Lando: fast reveals, marquees), Elegant (ERTQA: slow blur transitions), Minimal (Magic5: restraint-first), Playful (bouncy easings, staggered entries) |
634
662
  | **Visual depth strategy** | How depth is conveyed | Glassmorphism (blur+transparency), Neumorphism (soft shadows), Flat+elevation (material), Layered gradients, Cutout/mask-driven |
635
663
  | **Spacing rhythm** | Vertical flow pattern | Dense (SaaS dashboards), Generous (luxury brands), Asymmetric (editorial), Modular (grid-locked) |
664
+ | **UI Style** | Named visual archetype | See catalogue below |
665
+
666
+ #### UI Style Catalogue (20 named archetypes)
667
+
668
+ Each project MUST select a named style from this catalogue as part of the 3 visual direction options:
669
+
670
+ | # | Style | Character | Best for |
671
+ |---|-------|-----------|---------|
672
+ | 1 | **Glass Morphism** | Frosted glass layers, backdrop-filter blur, semi-transparent cards | Dark-mode SaaS, AI tools, dashboards |
673
+ | 2 | **Neumorphism** | Soft shadow extrusions, pastel backgrounds, tactile feel | Fintech apps, control panels |
674
+ | 3 | **Brutalism** | Raw grid, heavy borders, high contrast, monospace accents | Creative agencies, portfolios, editorial |
675
+ | 4 | **Claymorphism** | 3D soft shapes, pastel fills, inner shadows, rounded | EdTech, consumer apps, playful brands |
676
+ | 5 | **Bento Grid** | Magazine-style card layout, varied cell sizes, contained sections | SaaS marketing, portfolios, landing pages |
677
+ | 6 | **AI-Native UI** | Terminal aesthetics, monospace type, data-forward, ambient glow | AI products, dev tools, technical SaaS |
678
+ | 7 | **Aurora** | Animated gradient backgrounds, color shift, depth through light | Web3, creative studios, entertainment |
679
+ | 8 | **Minimal Edge** | Extreme whitespace, hairline borders, micro-typography, restraint | Luxury brands, high-end products |
680
+ | 9 | **Dark Luxury** | Deep backgrounds, gold/copper accents, layered shadows | Premium services, financial products |
681
+ | 10 | **Corporate Trust** | Blue+grey palette, conservative layout, credential signals | B2B, legal, enterprise, professional services |
682
+ | 11 | **Editorial** | Newspaper-inspired, serif display dominance, ink aesthetics | Media, publishing, content-first products |
683
+ | 12 | **Retro Futurism** | VHS grid overlays, neon accents, CRT effects, 80s nostalgia | Gaming, entertainment, cult brands |
684
+ | 13 | **Organic Flow** | Rounded shapes, nature-inspired palette, fluid curves | Wellness, food, sustainability brands |
685
+ | 14 | **Dashboard Pro** | Dense information, compact spacing, utility-first, tabular data | Analytics, operations, monitoring tools |
686
+ | 15 | **Scrollytelling** | Full-bleed sections, narrative progression, cinematic | Product launches, brand stories, case studies |
687
+ | 16 | **Split Panel** | 50/50 layouts, strong contrast between halves, dual narrative | SaaS comparisons, onboarding, feature demos |
688
+ | 17 | **Gradient Mesh** | CSS mesh gradient backgrounds, vibrant depth, glowing elements | Crypto, Web3, modern SaaS |
689
+ | 18 | **Code & Docs** | Monospace dominant, code-first aesthetic, technical precision | Developer tools, documentation sites |
690
+ | 19 | **Motion-First** | Animation as primary design element, kinetic typography | Agencies, interactive portfolios |
691
+ | 20 | **Accessible First** | High contrast, dyslexia-friendly fonts, maximum clarity | Healthcare, government, inclusive products |
692
+
693
+ #### Industry-Specific Palette Reasoning
694
+
695
+ Before proposing color options, identify the project's industry from the Brief and apply the
696
+ corresponding palette logic. Primary color must be justified against this reasoning.
697
+
698
+ | Industry | Palette Logic | Primary Range | Accent | Avoid |
699
+ |---------|--------------|---------------|--------|-------|
700
+ | FinTech / Banking | Trust-first, restraint, authority | Navy (#1e3a5f), Deep Blue (#0d2137), Slate (#334155) | Gold (#d4af37), Copper (#b87333) | Neons, oversaturation |
701
+ | Healthcare / MedTech | Clinical precision, calm, approachable | Clean White (#f8fafc), Teal (#0d9488), Sage (#6b7c6e) | Warm Green (#10b981) | Red primary (medical emergency connotation) |
702
+ | E-commerce / Retail | Action-forward, warm, aspirational | Warm Neutral (#f5f0eb), Brand-specific | High-contrast CTA accent | Cool blues as only palette (retail = warmth) |
703
+ | SaaS B2B | Capability, reliability, professional | Cool Blue (#3b82f6 ok WITH justification), Purple (#7c3aed) | Neutral grey | Playful pastels without brand rationale |
704
+ | Creative Agency | Experimental, unique per project | No defaults — derive from project personality | Unexpected accents | Safe/generic choices |
705
+ | Gaming / Entertainment | Energy, immersion, excitement | Dark backgrounds (#0a0a0a, #0f172a) + saturated primaries | Neon accents (justified) | Muted, low-energy palettes |
706
+ | EdTech | Friendly, encouraging, accessible | Warm whites, friendly blue or green | Warm accent (orange, yellow) | Cold corporate blues without warmth |
707
+ | Legal / Enterprise | Conservative, credibility, permanence | Navy, charcoal (#1f2937), warm grey | Restrained gold or teal | Trendy styles without conservative justification |
708
+ | Wellness / Health | Calm, natural, healing | Sage (#6b7280), Warm white, Soft green | Earth tones | Harsh contrast, neons |
709
+ | Web3 / Crypto | Futurism, technical, community | Dark (#0f0f23), Purple (#7c3aed), Teal | Electric accents | Corporate blue, conventional palettes |
636
710
 
637
711
  - **Variance enforcement process**:
638
712
  1. Before starting Phase 4, the agent reads the **Brief** to extract: project type, industry, target audience, brand personality, and competitive landscape
@@ -664,12 +738,284 @@ The 5 permanent references define the **quality floor**, not the **visual identi
664
738
 
665
739
  - **Font pool** — curated premium fonts for rotation (not exhaustive, agent may suggest others):
666
740
 
667
- **Display fonts**: Satoshi, Brier, Cabinet Grotesk, Clash Display, Space Grotesk, Sora, Outfit, Plus Jakarta Sans, General Sans, Switzer, Erode, Zodiak, Gambetta, Author
668
-
669
- **Body fonts**: Inter, Mona, DM Sans, General Sans, Switzer, Outfit, Plus Jakarta Sans, Geist, Geist Mono (code), JetBrains Mono (code), Source Serif 4 (editorial)
741
+ **Display fonts** (25 options rotation pool for projects):
742
+ Satoshi, Brier, Cabinet Grotesk, Clash Display, Space Grotesk, Sora, Outfit, Plus Jakarta Sans,
743
+ General Sans, Switzer, Erode, Zodiak, Gambetta, Author, Neue Montreal, Mabry Pro, Agrandir,
744
+ Neue World, Tobias, Freight Display, Cardinal Fruit, GT Walsheim, Founders Grotesk,
745
+ Instrument Serif, Literata Display
746
+
747
+ **Body fonts** (18 options — rotation pool):
748
+ Inter, Mona, DM Sans, General Sans, Switzer, Outfit, Plus Jakarta Sans, Geist, Geist Mono (code),
749
+ JetBrains Mono (code), Source Serif 4 (editorial), IBM Plex Sans, Figtree, Manrope,
750
+ Libre Franklin, Public Sans, Instrument Sans, Spectral (editorial)
751
+
752
+ **Font x Industry pairing guidance**:
753
+ - FinTech: Neue Montreal + IBM Plex Sans
754
+ - Healthcare: Plus Jakarta Sans + Instrument Sans
755
+ - Creative Agency: Clash Display + General Sans (or Erode + Mona)
756
+ - EdTech: Sora + Figtree
757
+ - Enterprise SaaS: Cabinet Grotesk + Inter
758
+ - Editorial/Media: Literata Display + Source Serif 4
759
+ - AI Tools: Space Grotesk + Geist Mono
760
+ - E-commerce: Outfit + Manrope
670
761
 
671
762
  All fonts must be available via Google Fonts, Fontshare, or self-hostable with open/free license. Never specify a font the project cannot legally use.
672
763
 
764
+ ### Directive 5: Anti-Bias Protocol — Counteracting Default AI Design Tendencies
765
+
766
+ LLMs have documented biases when generating visual designs. This directive explicitly counteracts each known bias category. Every rule is binary (pass/fail) and checked during self-validation.
767
+
768
+ #### 5A. Layout Bias Correction
769
+
770
+ **BANNED patterns**:
771
+ - Centered single-column layouts for entire pages
772
+ - Identical card grids as the default composition for every section
773
+ - Symmetrical hero sections with centered headline + centered CTA
774
+ - Uniform section heights across all page sections
775
+
776
+ **REQUIRED instead**:
777
+ - At least 2 distinct layout structures per page (e.g., sidebar + content, asymmetric grid, split-screen, dashboard panels)
778
+ - No two consecutive sections on the same page may use the same grid structure
779
+ - Each page must declare its layout archetype in the UX specification (scrollytelling, editorial, dashboard, split-panel, etc.)
780
+
781
+ #### 5B. Color Bias Correction
782
+
783
+ **BANNED palettes**:
784
+ - Oversaturated primaries (#0066FF electric blue, #00CC00 neon green, #FF0000 pure red)
785
+ - Generic SaaS blue (#3B82F6 / Tailwind blue-500) as primary without brandbook justification
786
+ - Neon accent colors without luminance balancing
787
+ - Palettes with fewer than 5 neutral steps
788
+
789
+ **REQUIRED instead**:
790
+ - Primary color must be justified in the brandbook with emotional/functional rationale
791
+ - Neutral scale must have minimum 9 steps (50-900)
792
+ - No primary color with HSL saturation > 80% unless explicitly documented as brand requirement
793
+ - All accent colors must pass WCAG AA contrast against their intended background
794
+
795
+ #### 5C. Typography Bias Correction
796
+
797
+ **BANNED as sole/default choice**:
798
+ - Inter, Roboto, Open Sans, or Lato as the ONLY font without brandbook rationale
799
+ - Same font family for both display and body text
800
+ - Only sans-serif fonts considered (serif and display fonts must be evaluated)
801
+
802
+ **REQUIRED instead**:
803
+ - Font pairing must include at least 2 distinct typefaces (display + body)
804
+ - Serif, slab-serif, and display options must be evaluated before defaulting to sans-serif
805
+ - Font selection rationale must appear in the brandbook (Phase 0)
806
+ - Reference the curated font pool from Directive 4 before selecting
807
+
808
+ #### 5D. Component Bias Correction
809
+
810
+ **BANNED repetitive patterns**:
811
+ - Identical 3-column card grids as the only data display pattern
812
+ - Uniform component density across all page regions
813
+ - Single interaction pattern for all data collections (e.g., always a card, never a table or list)
814
+
815
+ **REQUIRED instead**:
816
+ - Each data collection must evaluate 3 display options (cards, tables, lists, timelines, kanban) and justify the choice
817
+ - Component density must vary by context: compact for data-heavy areas, spacious for marketing/hero sections
818
+ - At least one unconventional layout pattern per project (masonry, staggered, bento grid, magazine)
819
+
820
+ #### 5E. States Coverage Enforcement
821
+
822
+ Every interactive component specification MUST include ALL applicable states:
823
+
824
+ | State Category | Required States | Applies To |
825
+ |---------------|----------------|------------|
826
+ | **Interactive** | default, hover, active, focus, disabled | Buttons, links, inputs, selects, checkboxes, toggles |
827
+ | **Input** | empty, filled, error, success, loading | Text fields, textareas, search bars, file uploads |
828
+ | **Data View** | populated, empty, loading, error, skeleton | Lists, tables, cards, dashboards, feeds |
829
+ | **Page** | loading, loaded, error, offline | Full pages, main content areas |
830
+
831
+ - "Happy path only" is a validation failure. Missing any required state category blocks self-validation.
832
+ - Empty states must include: illustration/icon, explanatory text, and a primary action CTA
833
+ - Error states must include: what went wrong, how to fix it, and a retry/alternative action
834
+ - Skeleton states must match the actual content layout (not generic pulsing rectangles)
835
+
836
+ #### 5F. Content Bias Correction (Anti-Slop)
837
+
838
+ **BANNED placeholder content**:
839
+ - "Lorem ipsum" or any Latin placeholder text
840
+ - "John Doe", "Jane Smith", "Acme Corp", "Example Inc" as sample data
841
+ - `https://example.com` or `placeholder.com` URLs
842
+ - Generic stock photo descriptions ("smiling business person", "team meeting")
843
+
844
+ **REQUIRED instead**:
845
+ - All wireframes and component examples must use domain-realistic content
846
+ - Sample data must match the project's actual domain (e.g., a medical app uses patient-like names, a finance app uses realistic transaction data)
847
+ - Photo/image placeholders must describe the specific subject and mood: "close-up of engineer inspecting circuit board, warm lighting, shallow depth of field"
848
+ - User avatars must show diversity in representation
849
+
850
+ #### 5G. Animation Performance Guardrails
851
+
852
+ - Maximum animation duration: 750ms for transitions, 1500ms for page-level animations
853
+ - **GPU-only properties**: animate ONLY `transform` and `opacity`. NEVER animate `width`, `height`, `top`, `left`, `margin`, `padding` (these trigger layout reflow)
854
+ - Always specify `will-change` for animated elements
855
+ - Provide `prefers-reduced-motion` alternative for every animation (either disable or reduce to opacity-only)
856
+ - No animation on elements smaller than 32x32px (imperceptible motion)
857
+ - Easing: always cubic-bezier or spring. NEVER `linear` for UI transitions (linear looks mechanical)
858
+
859
+ ### Directive 6: Motion System — Professional Animation by Default
860
+
861
+ Every project must have a Motion System. Static UIs without animation feel unfinished. This
862
+ directive specifies the library, tokens, mandatory patterns, and performance rules.
863
+
864
+ #### 6A. Motion Library Selection (by tech stack)
865
+
866
+ | Stack | Library | Import |
867
+ |-------|---------|--------|
868
+ | React / Next.js | `motion` (formerly framer-motion) | `import { motion, AnimatePresence, useScroll, useTransform } from 'motion/react'` |
869
+ | Vue 3 | `@vueuse/motion` | `import { useMotion } from '@vueuse/motion'` |
870
+ | Svelte | Native `svelte/transition` + CSS | `import { fade, fly, scale } from 'svelte/transition'` |
871
+ | Plain HTML/CSS | CSS animations + Scroll Timeline | `@keyframes`, `animation`, `scroll-timeline` |
872
+ | React Native | `react-native-reanimated` | `import Animated from 'react-native-reanimated'` |
873
+
874
+ **RULE**: Always specify the motion library in the Design System section. The Dev agent must use
875
+ the library specified here — not a different one.
876
+
877
+ #### 6B. Animation Token Layer (Design System Layer 5)
878
+
879
+ Every animation value in the Design System MUST use named tokens from the motion token layer.
880
+ Zero hardcoded durations, zero hardcoded easing strings in component specifications.
881
+
882
+ Token layer defined in Phase 4 Layer 5.
883
+
884
+ #### 6C. Mandatory Micro-Interactions
885
+
886
+ Every project MUST specify these micro-interactions in the component definitions:
887
+
888
+ | Component | Animation | Token |
889
+ |-----------|-----------|-------|
890
+ | Button (primary) | `scale(1.02)` on hover, `scale(0.98)` on press | `--motion-duration-fast`, `--motion-ease-spring` |
891
+ | Card / List item | `translateY(-4px)` + shadow elevation increase on hover | `--motion-duration-normal`, `--motion-ease-decelerate` |
892
+ | Link / Nav item | opacity shift + underline `scaleX(0->1)` on hover | `--motion-duration-fast`, `--motion-ease-standard` |
893
+ | Form input focus | border-color transition + `scale(1.01)` focus ring | `--motion-duration-fast`, `--motion-ease-standard` |
894
+ | Toggle / Checkbox | `translateX` (toggle knob), `scale` (checkbox fill) | `--motion-duration-fast`, `--motion-ease-spring` |
895
+ | Modal / Drawer open | `opacity(0->1)` + `scale(0.95->1)` or `translateX` | `--motion-duration-normal`, `--motion-ease-decelerate` |
896
+ | Modal / Drawer close | `opacity(1->0)` + `scale(1->0.95)` | `--motion-duration-fast`, `--motion-ease-accelerate` |
897
+ | Notification / Toast | `translateY(-16px)` entrance + `opacity` exit | `--motion-duration-normal`, `--motion-ease-spring` |
898
+
899
+ For React/Next.js, implement with `motion` + `AnimatePresence`:
900
+ ```jsx
901
+ // Example: Button
902
+ <motion.button
903
+ whileHover={{ scale: 1.02 }}
904
+ whileTap={{ scale: 0.98 }}
905
+ transition={{ duration: 0.2, ease: [0.34, 1.56, 0.64, 1] }}
906
+ />
907
+ ```
908
+
909
+ #### 6D. Mandatory Scroll Animations
910
+
911
+ Every project with 2+ page sections MUST specify scroll-triggered animations:
912
+
913
+ | Pattern | Implementation | When to use |
914
+ |---------|---------------|-------------|
915
+ | Section reveal | `whileInView={{ opacity: 1, y: 0 }}` from `{ opacity: 0, y: 40 }` | Every above-fold section |
916
+ | Staggered list | `staggerChildren: 0.08` on parent `variants` | Lists, card grids, feature rows |
917
+ | Scroll progress bar | `scaleX` driven by `useScroll()` | Long-form pages, articles |
918
+ | Parallax hero element | `translateY` at 0.3x scroll speed | Hero sections, decorative elements |
919
+ | Counter/number reveal | Count up animation on `whileInView` | Stat sections |
920
+
921
+ **viewport config**: Always use `{ once: true, amount: 0.2 }` on `whileInView` for performance.
922
+
923
+ #### 6E. GPU Properties — Mandatory Enforcement
924
+
925
+ **ONLY these CSS properties may be animated** (no layout reflow):
926
+ - `transform` (translate, scale, rotate, skew — all GPU-composited)
927
+ - `opacity`
928
+ - `filter` and `backdrop-filter`
929
+ - `clip-path` (for reveal effects)
930
+
931
+ **NEVER animate**: `width`, `height`, `top`, `left`, `margin`, `padding`, `border-width`
932
+ (these trigger layout reflow and cause jank)
933
+
934
+ **Required for every animated element**:
935
+ ```css
936
+ will-change: transform; /* declare intent to browser */
937
+ ```
938
+
939
+ #### 6F. Reduced Motion
940
+
941
+ Every animation specification MUST include a reduced-motion alternative:
942
+ - Use `prefers-reduced-motion: reduce` media query in CSS
943
+ - In `motion/react`: use `useReducedMotion()` hook
944
+ - Fallback: disable all transforms, keep only opacity transitions at 150ms max
945
+
946
+ ```javascript
947
+ // React pattern
948
+ const shouldReduce = useReducedMotion();
949
+ const animationProps = shouldReduce
950
+ ? { opacity: 1 }
951
+ : { opacity: 1, y: 0 };
952
+ ```
953
+
954
+ **Animation personality** must be documented in the UX specification aligned with Directive 4's
955
+ visual direction selection:
956
+ - Energetic: fast + spring easing
957
+ - Elegant: slow + decelerate easing
958
+ - Minimal: opacity-only, no transforms beyond scale
959
+ - Playful: bounce easing, stagger, scale transforms
960
+
961
+ ### Directive 7: Component Discovery — 21st.dev First
962
+
963
+ Before designing any Molecule or Organism component from scratch, the UX agent MUST search
964
+ 21st.dev for an existing production-ready component that can be adapted.
965
+
966
+ **21st.dev** is an open-source registry of premium shadcn/ui-based React components (React 18+,
967
+ Tailwind CSS, Radix UI, MIT license). Quality bar: production-ready with TypeScript, dark mode,
968
+ accessibility, interactive demos, and Figma files.
969
+
970
+ #### 7A. Discovery Workflow (mandatory for Molecules and Organisms)
971
+
972
+ ```
973
+ For each Molecule or Organism in the component map:
974
+ 1. SEARCH 21st.dev for similar component (keywords: component name, category)
975
+ 2. IF found:
976
+ - Document: component name, URL, patterns observed
977
+ - ADAPT to match project Design System tokens (colors, spacing, typography)
978
+ - Document all adaptations made
979
+ - Mark component as: "Adapted from 21st.dev: {component-name}"
980
+ 3. IF NOT found:
981
+ - Design from scratch
982
+ - Document rationale: "Not found on 21st.dev — designed custom because: {reason}"
983
+ 4. NEVER copy code directly — the UX spec describes patterns, not implementation
984
+ ```
985
+
986
+ #### 7B. Priority Search Categories
987
+
988
+ Search these categories on 21st.dev FIRST (highest reuse potential):
989
+
990
+ | Category | Examples | Priority |
991
+ |----------|---------|----------|
992
+ | Navigation | Navbars, sidebars, breadcrumbs, tabs, command palettes | Critical |
993
+ | Data Display | Tables, lists, cards, kanban, timelines, calendars | Critical |
994
+ | Forms & Inputs | Multi-step forms, comboboxes, date pickers, file uploads | High |
995
+ | Feedback | Toasts, alerts, progress bars, skeletons, spinners | High |
996
+ | Overlays | Modals, drawers, popovers, tooltips, dropdowns | High |
997
+ | Marketing | Hero sections, pricing tables, testimonials, feature grids | Medium |
998
+
999
+ #### 7C. Reuse Decision Framework
1000
+
1001
+ | Situation | Decision | Action |
1002
+ |-----------|---------|--------|
1003
+ | Component found, 80%+ match | ADOPT + Adapt | Adapt tokens, document source |
1004
+ | Component found, 50-80% match | ADAPT | Use as pattern reference, customize layout |
1005
+ | Component found, <50% match | REVIEW | Check if decomposing works better |
1006
+ | Component not found | CREATE | Design from scratch, document rationale |
1007
+
1008
+ #### 7D. When 21st.dev is unavailable
1009
+
1010
+ If 21st.dev is unreachable (offline, network issue):
1011
+ - Proceed with component design from scratch
1012
+ - Note in handoff: "21st.dev lookup skipped — {reason}"
1013
+ - Agent MUST NOT block pipeline due to external resource unavailability
1014
+
1015
+ **RULE**: The goal is quality, not compliance. Adapting a premium component is better than
1016
+ designing a mediocre custom component. The minimum bar is: every Organism must show evidence
1017
+ of discovery (either found and adapted, or not found with documented rationale).
1018
+
673
1019
  ---
674
1020
 
675
1021
  ## Autonomous Behavior
@@ -1,8 +1,8 @@
1
1
  # chati.dev Configuration
2
- version: "4.0.1"
2
+ version: "4.0.2"
3
3
  installed_at: "2026-02-07T10:00:00Z"
4
- updated_at: "2026-03-18T00:00:00Z"
5
- installer_version: "4.0.1"
4
+ updated_at: "2026-03-21T00:00:00Z"
5
+ installer_version: "4.0.2"
6
6
  project_type: greenfield
7
7
  language: en
8
8
  ides: [claude-code]
@@ -62,14 +62,14 @@ Every agent in Chati.dev:
62
62
 
63
63
  ## Article II: Quality Standards
64
64
 
65
- 1. Every agent must achieve >= 95% on its self-defined success criteria before presenting results
65
+ 1. Every agent must achieve its tier-specific self-validation threshold before presenting results. Thresholds: QA agents >= 95%, standard agents >= 90%, discovery agents >= 85% (see Article XVII for gate-level thresholds)
66
66
  2. Quality is measured against concrete, binary (pass/fail) criteria — not subjective assessment
67
67
  3. QA-Planning validates planning artifact traceability AND the rigor of each agent's criteria
68
68
  4. QA-Implementation validates code quality, test coverage (>= 80%), and security (0 critical/high)
69
69
  5. Silent correction loops are invisible to the user except for brief status messages
70
70
  6. Maximum 3 correction loops per agent before escalating to user
71
71
 
72
- **Enforcement: BLOCK** — Results below 95% are never presented as final.
72
+ **Enforcement: BLOCK** — Results below the agent's tier threshold are never presented as final.
73
73
 
74
74
  ---
75
75
 
@@ -134,6 +134,7 @@ Every agent in Chati.dev:
134
134
  4. Accessibility (WCAG 2.1 AA) is a requirement, not a suggestion
135
135
  5. Design system audit is embedded in the UX agent's workflow
136
136
  6. Dev agent must consume design tokens — never hardcode visual values
137
+ 7. Component specifications must include full interactive and data view state coverage — happy-path-only specifications are incomplete
137
138
 
138
139
  **Enforcement: WARN** — Violations generate warnings in QA-Implementation.
139
140
 
@@ -480,5 +481,5 @@ When multiple CLI providers are enabled, the system SHALL coordinate agent execu
480
481
 
481
482
  ---
482
483
 
483
- *Chati.dev Constitution v4.0.0 — 19 Articles + Preamble*
484
+ *Chati.dev Constitution v4.0.1 — 19 Articles + Preamble*
484
485
  *All agents are bound by this Constitution. Violations are enforced per article.*
@@ -25,9 +25,7 @@ authority:
25
25
  redirectMessage: "Architecture is complete. Redirecting to dev agent for implementation."
26
26
 
27
27
  outputs:
28
- - architecture.yaml
29
- - api-spec.yaml
30
- - db-schema.yaml
28
+ - architecture.md
31
29
 
32
30
  rules:
33
31
  - id: ar-01
@@ -23,7 +23,7 @@ authority:
23
23
  redirectMessage: "Requirements are complete. Redirecting to detail agent for PRD expansion."
24
24
 
25
25
  outputs:
26
- - brief.yaml
26
+ - brief-report.md
27
27
 
28
28
  rules:
29
29
  - id: br-01
@@ -25,7 +25,7 @@ authority:
25
25
  redirectMessage: "This appears to be an empty or new project. Redirecting to greenfield-wu for scaffolding analysis."
26
26
 
27
27
  outputs:
28
- - wu-report.yaml
28
+ - wu-full-report.md
29
29
 
30
30
  rules:
31
31
  - id: bf-01
@@ -45,7 +45,7 @@ rules:
45
45
  priority: critical
46
46
 
47
47
  - id: bf-05
48
- text: "MUST assess technical debt and provide risk scores in wu-report.yaml"
48
+ text: "MUST assess technical debt and provide risk scores in wu-full-report.md"
49
49
  priority: normal
50
50
 
51
51
  # Provider Preference (v3.0.0)
@@ -23,7 +23,7 @@ authority:
23
23
  redirectMessage: "Requirements are incomplete or ambiguous. Redirecting to brief agent for requirement extraction."
24
24
 
25
25
  outputs:
26
- - prd.yaml
26
+ - prd.md
27
27
 
28
28
  rules:
29
29
  - id: dt-01
@@ -21,13 +21,11 @@ authority:
21
21
  redirectMessage: "DevOps handles deployment. Dev agent handles code changes."
22
22
 
23
23
  outputs:
24
- - ci-config.yaml
25
- - deploy-config.yaml
26
- - release-notes.md
24
+ - deploy-report.md
27
25
 
28
26
  rules:
29
27
  - id: ops-qa-first
30
- text: "Never deploy without QA Implementation approval (PASS or WAIVED verdict)."
28
+ text: "Never deploy without QA Implementation approval (APPROVED verdict)."
31
29
  priority: critical
32
30
 
33
31
  - id: ops-rollback
@@ -23,7 +23,7 @@ authority:
23
23
  redirectMessage: "This appears to be an existing project with code. Redirecting to brownfield-wu for deep discovery analysis."
24
24
 
25
25
  outputs:
26
- - wu-report.yaml
26
+ - wu-operational-report.md
27
27
 
28
28
  rules:
29
29
  - id: gf-01
@@ -43,5 +43,5 @@ rules:
43
43
  priority: critical
44
44
 
45
45
  - id: gf-05
46
- text: "MUST include scaffolding recommendations in wu-report.yaml based on detected tech stack"
46
+ text: "MUST include scaffolding recommendations in wu-operational-report.md based on detected tech stack"
47
47
  priority: normal
@@ -23,7 +23,7 @@ authority:
23
23
  redirectMessage: "Phase breakdown is complete. Redirecting to tasks agent for task decomposition."
24
24
 
25
25
  outputs:
26
- - phases.yaml
26
+ - phases.md
27
27
 
28
28
  rules:
29
29
  - id: ph-01
@@ -21,13 +21,11 @@ authority:
21
21
  redirectMessage: "QA Implementation executes tests. Dev agent fixes issues found."
22
22
 
23
23
  outputs:
24
- - qa-report.yaml
25
- - test-results.yaml
26
- - sast-report.yaml
24
+ - qa-implementation-report.md
27
25
 
28
26
  rules:
29
27
  - id: qai-verdict
30
- text: "Verdict must be one of: PASS, CONCERNS, FAIL, or WAIVED."
28
+ text: "Verdict must be one of: APPROVED, NEEDS_REVISION, or BLOCKED."
31
29
  priority: critical
32
30
 
33
31
  - id: qai-sast
@@ -35,7 +33,7 @@ rules:
35
33
  priority: critical
36
34
 
37
35
  - id: qai-regression
38
- text: "All existing tests must pass (no regressions) before PASS verdict."
36
+ text: "All existing tests must pass (no regressions) before APPROVED verdict."
39
37
  priority: high
40
38
 
41
39
  - id: qai-backward
@@ -44,7 +42,7 @@ rules:
44
42
 
45
43
  - id: qai-adversarial
46
44
  text: >
47
- ADVERSARIAL REVIEW: Every QA pass MUST identify minimum 3 findings
45
+ ADVERSARIAL REVIEW: Every QA pass MUST identify minimum 5 findings
48
46
  (improvements, warnings, or suggestions). Zero findings is suspiciously
49
47
  clean — trigger mandatory re-review with deeper analysis. This prevents
50
48
  rubber-stamping. Findings can be any severity (low/info counts).