chati-dev 4.0.0 → 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 (57) hide show
  1. package/framework/agents/build/dev.md +23 -3
  2. package/framework/agents/plan/ux.md +395 -9
  3. package/framework/config.yaml +3 -3
  4. package/framework/constitution.md +10 -3
  5. package/framework/data/entity-registry.yaml +43 -3
  6. package/framework/domains/agents/architect.yaml +1 -3
  7. package/framework/domains/agents/brief.yaml +1 -1
  8. package/framework/domains/agents/brownfield-wu.yaml +2 -2
  9. package/framework/domains/agents/detail.yaml +1 -1
  10. package/framework/domains/agents/devops.yaml +2 -4
  11. package/framework/domains/agents/greenfield-wu.yaml +2 -2
  12. package/framework/domains/agents/phases.yaml +1 -1
  13. package/framework/domains/agents/qa-implementation.yaml +4 -6
  14. package/framework/domains/agents/qa-planning.yaml +7 -10
  15. package/framework/domains/agents/tasks.yaml +1 -1
  16. package/framework/domains/agents/ux.yaml +21 -3
  17. package/framework/domains/constitution.yaml +5 -5
  18. package/framework/domains/global.yaml +8 -4
  19. package/framework/domains/workflows/standard-flow.yaml +33 -0
  20. package/framework/i18n/en.yaml +11 -2
  21. package/framework/i18n/es.yaml +11 -2
  22. package/framework/i18n/fr.yaml +11 -2
  23. package/framework/i18n/pt.yaml +11 -2
  24. package/framework/intelligence/context-engine.md +1 -1
  25. package/framework/presets/nextjs.yaml +41 -0
  26. package/framework/presets/node-express.yaml +39 -0
  27. package/framework/presets/react-vite.yaml +37 -0
  28. package/framework/presets/supabase-fullstack.yaml +37 -0
  29. package/framework/templates/brandbook-tmpl.yaml +153 -0
  30. package/framework/templates/component-spec-tmpl.yaml +121 -0
  31. package/framework/templates/design-token-tmpl.yaml +55 -0
  32. package/framework/templates/icon-system-tmpl.yaml +95 -0
  33. package/package.json +1 -1
  34. package/scripts/bundle-framework.js +1 -1
  35. package/src/api/index.js +10 -19
  36. package/src/autonomy/build-loop.js +1 -1
  37. package/src/autonomy/cause-analyzer.js +1 -1
  38. package/src/autonomy/worktree-manager.js +7 -2
  39. package/src/config/agent-customizer.js +1 -5
  40. package/src/config/context-file-generator.js +1 -1
  41. package/src/context/bracket-tracker.js +2 -13
  42. package/src/decision/engine.js +4 -0
  43. package/src/health/auto-fix.js +1 -1
  44. package/src/installer/core.js +8 -1
  45. package/src/intelligence/context-status.js +2 -17
  46. package/src/intelligence/decision-engine.js +8 -5
  47. package/src/intelligence/timeline.js +1 -1
  48. package/src/merger/semantic-merger.js +1 -1
  49. package/src/orchestrator/pipeline-manager.js +33 -46
  50. package/src/quality/metrics-collector.js +0 -2
  51. package/src/telemetry/config.js +2 -2
  52. package/src/telemetry/schema.js +1 -1
  53. package/src/terminal/isolation.js +10 -1
  54. package/src/terminal/prompt-builder.js +77 -9
  55. package/src/utils/brackets.js +29 -0
  56. package/src/utils/event-bus.js +1 -1
  57. package/src/utils/provider-limits.js +13 -0
@@ -0,0 +1,153 @@
1
+ # Brandbook Template
2
+ # Used by: UX Agent (Phase 0: Brand Identity)
3
+ # Language: English (Constitution Article VII)
4
+
5
+ template:
6
+ name: Brandbook
7
+ version: "1.0.0"
8
+ description: >
9
+ Brand identity foundation document. Defines voice, visual language,
10
+ typography rationale, color philosophy, spacing rhythm, and iconography
11
+ style. Must be completed BEFORE design tokens.
12
+
13
+ output_path: chati.dev/artifacts/4-UX/brandbook.md
14
+
15
+ sections:
16
+ - brand_voice
17
+ - visual_language
18
+ - typography_rationale
19
+ - color_philosophy
20
+ - spacing_rhythm
21
+ - iconography_style
22
+ - motion_philosophy
23
+
24
+ brand_voice:
25
+ description: "Brand personality, tone, and communication style"
26
+ fields:
27
+ - name: personality_traits
28
+ type: array
29
+ description: "3-5 adjectives defining the brand personality"
30
+ - name: tone_spectrum
31
+ type: object
32
+ description: "Formal vs casual, technical vs approachable spectrum"
33
+ - name: writing_guidelines
34
+ type: array
35
+ description: "Dos and don'ts for brand voice"
36
+ - name: example_phrases
37
+ type: array
38
+ description: "Sample phrases demonstrating brand voice"
39
+
40
+ visual_language:
41
+ description: "Core visual principles and aesthetic direction"
42
+ fields:
43
+ - name: design_principles
44
+ type: array
45
+ description: "3-5 guiding principles for visual design"
46
+ - name: mood_keywords
47
+ type: array
48
+ description: "Keywords capturing the visual mood"
49
+ - name: inspiration_references
50
+ type: array
51
+ description: "Visual references and mood board elements"
52
+
53
+ typography_rationale:
54
+ description: "Font selection rationale and typographic hierarchy"
55
+ fields:
56
+ - name: primary_font
57
+ type: object
58
+ description: "Primary typeface and why it was chosen"
59
+ - name: secondary_font
60
+ type: object
61
+ description: "Secondary typeface for contrast"
62
+ - name: hierarchy_rules
63
+ type: array
64
+ description: "Heading, body, caption sizing rationale"
65
+
66
+ color_philosophy:
67
+ description: "Color palette rationale and emotional associations"
68
+ fields:
69
+ - name: industry_specific_reasoning
70
+ type: string
71
+ description: "Why these colors for THIS industry/sector — must reference Industry-Specific Palette Reasoning table from Directive 4"
72
+ - name: primary_palette
73
+ type: array
74
+ description: "Primary colors with emotional rationale"
75
+ - name: semantic_mapping
76
+ type: object
77
+ description: "Color-to-meaning mapping (success, warning, error)"
78
+ - name: accessibility_notes
79
+ type: string
80
+ description: "WCAG contrast compliance notes"
81
+ - name: bias_check
82
+ type: object
83
+ description: "Anti-bias validation: confirm primary color is NOT generic SaaS blue, saturation is intentional, neutral scale has 9+ steps"
84
+
85
+ spacing_rhythm:
86
+ description: "Spacing scale rationale and rhythm system"
87
+ fields:
88
+ - name: base_unit
89
+ type: number
90
+ description: "Base spacing unit in pixels"
91
+ - name: scale_rationale
92
+ type: string
93
+ description: "Why this scale was chosen (4px, 8px, etc.)"
94
+ - name: rhythm_rules
95
+ type: array
96
+ description: "Rules for consistent vertical and horizontal rhythm"
97
+
98
+ iconography_style:
99
+ description: "Icon style direction and usage philosophy"
100
+ fields:
101
+ - name: style_direction
102
+ type: string
103
+ description: "Outlined, filled, duotone, etc."
104
+ - name: stroke_weight
105
+ type: string
106
+ description: "Consistent stroke weight for icon set"
107
+ - name: metaphor_guidelines
108
+ type: array
109
+ description: "Guidelines for icon metaphor selection"
110
+
111
+ motion_philosophy:
112
+ description: "Animation personality and motion system definition (Directive 6)"
113
+ fields:
114
+ - name: scroll_personality
115
+ type: enum
116
+ values: [Energetic, Elegant, Minimal, Playful]
117
+ description: "Animation character aligned with brand visual direction"
118
+ - name: micro_animation_style
119
+ type: string
120
+ description: "Description of hover and interaction animation character"
121
+ - name: timing_defaults
122
+ type: object
123
+ description: "Default duration and easing tokens for this brand"
124
+ sub_fields:
125
+ - name: primary_duration
126
+ type: string
127
+ description: "Primary animation duration token (e.g. --motion-duration-normal)"
128
+ default: "--motion-duration-normal (350ms)"
129
+ - name: primary_easing
130
+ type: string
131
+ description: "Primary easing token (e.g. --motion-ease-standard)"
132
+ default: "--motion-ease-standard"
133
+ - name: library
134
+ type: string
135
+ description: "Animation library for this project's stack"
136
+ examples:
137
+ - "motion/react (React/Next.js)"
138
+ - "@vueuse/motion (Vue 3)"
139
+ - "CSS animations (plain HTML/CSS)"
140
+
141
+ rules:
142
+ - id: brand-before-tokens
143
+ text: "Brandbook MUST be completed before design tokens are defined."
144
+ priority: critical
145
+ - id: brand-consistency
146
+ text: "All visual decisions must trace back to brandbook principles."
147
+ priority: high
148
+ - id: brand-voice-artifacts
149
+ text: "All user-facing text in artifacts must follow brand voice guidelines."
150
+ priority: high
151
+ - id: brand-no-default-blue
152
+ text: "Primary color MUST NOT be generic SaaS blue (#3B82F6 or similar) unless the brand explicitly requires it with documented rationale."
153
+ priority: high
@@ -0,0 +1,121 @@
1
+ # Component Spec Template
2
+ # Used by: UX Agent (Phase 2: Component Specifications)
3
+ # Language: English (Constitution Article VII)
4
+
5
+ template:
6
+ name: Component Spec
7
+ version: "1.0.0"
8
+ description: >
9
+ UI component specification document. Defines variants, states,
10
+ anatomy, props, accessibility, and responsive behavior.
11
+
12
+ output_path: chati.dev/artifacts/4-UX/components/
13
+
14
+ fields:
15
+ - name: id
16
+ type: string
17
+ description: "Unique component identifier (kebab-case)"
18
+ required: true
19
+ - name: name
20
+ type: string
21
+ description: "Human-readable component name"
22
+ required: true
23
+ - name: category
24
+ type: enum
25
+ values: [primitive, composite, layout, feedback, navigation, data-display, form]
26
+ description: "Component category for organization"
27
+ required: true
28
+ - name: description
29
+ type: string
30
+ description: "One-sentence description of the component purpose"
31
+ required: true
32
+ - name: variants
33
+ type: array
34
+ description: "Visual variants (primary, secondary, ghost, destructive, etc.)"
35
+ required: true
36
+ - name: sizes
37
+ type: array
38
+ description: "Size variants (xs, sm, md, lg, xl)"
39
+ required: true
40
+ - name: states
41
+ type: object
42
+ description: "Component states organized by category"
43
+ required: true
44
+ sub_fields:
45
+ - name: interactive
46
+ type: array
47
+ description: "REQUIRED: default, hover, active, focus, disabled"
48
+ required: true
49
+ - name: input
50
+ type: array
51
+ description: "For input components: empty, filled, error, success, loading"
52
+ required: false
53
+ - name: data_view
54
+ type: array
55
+ description: "For data display components: populated, empty, loading, error, skeleton"
56
+ required: false
57
+ - name: animation
58
+ type: object
59
+ description: "Animation states using motion tokens from Design System Layer 5"
60
+ required: false
61
+ sub_fields:
62
+ - name: entrance
63
+ type: object
64
+ description: "How component enters the DOM (opacity + translateY default)"
65
+ example:
66
+ property: "opacity + translateY"
67
+ duration: "--motion-duration-normal"
68
+ easing: "--motion-ease-decelerate"
69
+ - name: hover
70
+ type: object
71
+ description: "Transform on hover — GPU properties only"
72
+ example:
73
+ property: "transform"
74
+ duration: "--motion-duration-fast"
75
+ easing: "--motion-ease-spring"
76
+ - name: exit
77
+ type: object
78
+ description: "How component exits the DOM"
79
+ example:
80
+ property: "opacity + scale"
81
+ duration: "--motion-duration-fast"
82
+ easing: "--motion-ease-accelerate"
83
+ - name: reduced_motion
84
+ type: object
85
+ description: "Fallback for prefers-reduced-motion"
86
+ example:
87
+ fallback: "opacity only, duration --motion-duration-fast"
88
+ - name: anatomy
89
+ type: object
90
+ description: "Component parts and their structure"
91
+ required: true
92
+ - name: props
93
+ type: array
94
+ description: "Component API (props with types, defaults, descriptions)"
95
+ required: true
96
+ - name: tokens_used
97
+ type: array
98
+ description: "Design tokens consumed by this component"
99
+ required: true
100
+ - name: accessibility
101
+ type: object
102
+ description: "ARIA roles, keyboard navigation, screen reader behavior"
103
+ required: true
104
+ - name: responsive_behavior
105
+ type: object
106
+ description: "How component adapts across breakpoints"
107
+ required: false
108
+
109
+ rules:
110
+ - id: tokens-required
111
+ text: "Every visual property MUST reference a design token. No hardcoded values."
112
+ priority: critical
113
+ - id: accessibility-required
114
+ text: "Every component MUST have ARIA roles and keyboard navigation defined."
115
+ priority: critical
116
+ - id: state-coverage
117
+ text: "All 5 interactive states (default, hover, active, focus, disabled) are mandatory. Data display components must also include populated, empty, loading, error, and skeleton."
118
+ priority: critical
119
+ - id: no-placeholder-content
120
+ text: "All example content in component specs must be domain-realistic. No lorem ipsum or generic names."
121
+ priority: high
@@ -0,0 +1,55 @@
1
+ # Design Token Template
2
+ # Used by: UX Agent (Phase 1: Design Tokens)
3
+ # Language: English (Constitution Article VII)
4
+
5
+ template:
6
+ name: Design Tokens
7
+ version: "1.0.0"
8
+ description: >
9
+ Structured design token system with 4 layers: primitive, semantic,
10
+ component, and utility. Derived from brandbook decisions.
11
+
12
+ output_path: chati.dev/artifacts/4-UX/design-tokens.md
13
+
14
+ layers:
15
+ - primitive
16
+ - semantic
17
+ - component
18
+ - utility
19
+
20
+ token_categories:
21
+ color:
22
+ primitive: "Raw color values (hex, hsl)"
23
+ semantic: "Mapped to meaning (primary, success, error)"
24
+ component: "Component-specific (button-bg, card-border)"
25
+ spacing:
26
+ primitive: "Base unit multiples (4, 8, 12, 16, 24, 32, 48, 64)"
27
+ semantic: "Mapped to usage (compact, default, relaxed)"
28
+ component: "Component-specific (card-padding, input-gap)"
29
+ typography:
30
+ primitive: "Font families, raw sizes, weights"
31
+ semantic: "Mapped to roles (heading, body, caption, label)"
32
+ component: "Component-specific (button-text, input-label)"
33
+ radius:
34
+ primitive: "Raw radius values (0, 2, 4, 8, 12, full)"
35
+ semantic: "Mapped to shape intent (sharp, soft, round, pill)"
36
+ shadow:
37
+ primitive: "Raw shadow definitions (offset, blur, spread, color)"
38
+ semantic: "Mapped to elevation (flat, raised, floating, overlay)"
39
+ motion:
40
+ primitive: "Duration and easing values"
41
+ semantic: "Mapped to intent (enter, exit, emphasis, feedback)"
42
+
43
+ rules:
44
+ - id: tokens-after-brandbook
45
+ text: "Design tokens MUST be derived from brandbook decisions."
46
+ priority: critical
47
+ - id: primitive-first
48
+ text: "Define primitive tokens before semantic. Semantic references primitive."
49
+ priority: high
50
+ - id: token-naming
51
+ text: "Use consistent naming: layer-category-variant (e.g., color-primary-500)."
52
+ priority: high
53
+ - id: accessibility-contrast
54
+ text: "All text color tokens must meet WCAG AA contrast ratio (4.5:1)."
55
+ priority: critical
@@ -0,0 +1,95 @@
1
+ # Icon System Template
2
+ # Used by: UX Agent (Phase 0: Brand Identity / Iconography)
3
+ # Language: English (Constitution Article VII)
4
+
5
+ template:
6
+ name: Icon System
7
+ version: "1.0.0"
8
+ description: >
9
+ Icon library selection, sizing scale, usage guidelines, and inventory.
10
+ Aligned with brandbook iconography style.
11
+
12
+ output_path: chati.dev/artifacts/4-UX/icon-system.md
13
+
14
+ sections:
15
+ library_selection:
16
+ description: "Chosen icon library and rationale"
17
+ fields:
18
+ - name: library_name
19
+ type: string
20
+ description: "Selected icon library (e.g., Lucide, Phosphor, Heroicons)"
21
+ - name: rationale
22
+ type: string
23
+ description: "Why this library was chosen"
24
+ - name: style
25
+ type: enum
26
+ values: [outlined, filled, duotone, solid]
27
+ description: "Icon style variant"
28
+ - name: license
29
+ type: string
30
+ description: "Icon library license (MIT, Apache, etc.)"
31
+
32
+ sizing_scale:
33
+ description: "Icon size scale aligned with spacing tokens"
34
+ fields:
35
+ - name: xs
36
+ type: number
37
+ description: "Extra small icon size (12-14px)"
38
+ - name: sm
39
+ type: number
40
+ description: "Small icon size (16px)"
41
+ - name: md
42
+ type: number
43
+ description: "Medium icon size (20-24px)"
44
+ - name: lg
45
+ type: number
46
+ description: "Large icon size (28-32px)"
47
+ - name: xl
48
+ type: number
49
+ description: "Extra large icon size (40-48px)"
50
+ - name: xxl
51
+ type: number
52
+ description: "Display icon size (56-64px)"
53
+
54
+ usage_guidelines:
55
+ description: "Rules for consistent icon usage"
56
+ fields:
57
+ - name: with_text
58
+ type: string
59
+ description: "When to pair icons with text labels"
60
+ - name: standalone
61
+ type: string
62
+ description: "When icons can stand alone (with aria-label)"
63
+ - name: color_rules
64
+ type: string
65
+ description: "How icons inherit or override color tokens"
66
+ - name: touch_target
67
+ type: string
68
+ description: "Minimum touch target size (44x44px for mobile)"
69
+
70
+ icon_inventory:
71
+ description: "Catalog of icons used in the project"
72
+ fields:
73
+ - name: navigation
74
+ type: array
75
+ description: "Icons used in navigation elements"
76
+ - name: actions
77
+ type: array
78
+ description: "Icons for user actions (add, edit, delete, etc.)"
79
+ - name: status
80
+ type: array
81
+ description: "Icons for status indicators (success, warning, error, info)"
82
+ - name: content
83
+ type: array
84
+ description: "Icons for content types (file, folder, image, etc.)"
85
+
86
+ rules:
87
+ - id: icon-library-consistency
88
+ text: "Use ONE icon library per project. Do not mix libraries."
89
+ priority: critical
90
+ - id: icon-accessibility
91
+ text: "Standalone icons MUST have aria-label. Decorative icons use aria-hidden."
92
+ priority: critical
93
+ - id: icon-sizing-alignment
94
+ text: "Icon sizes must align with the spacing token scale from design tokens."
95
+ priority: high
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chati-dev",
3
- "version": "4.0.0",
3
+ "version": "4.0.2",
4
4
  "description": "AI-Powered Multi-Agent Orchestration System — Structured vibe coding for Full Stack Development",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,7 @@ const dirs = [
37
37
  'schemas', 'frameworks', 'intelligence', 'patterns',
38
38
  'hooks', 'domains',
39
39
  'i18n', 'migrations', 'data',
40
- 'tasks', 'context',
40
+ 'tasks', 'context', 'presets',
41
41
  ];
42
42
 
43
43
  for (const dir of dirs) {
package/src/api/index.js CHANGED
@@ -37,27 +37,18 @@ export { selectAgent } from '../orchestrator/agent-selector.js';
37
37
  // Session Management
38
38
  // ---------------------------------------------------------------------------
39
39
 
40
- import {
41
- initSession as _initSession,
42
- loadSession as _loadSession,
43
- updateSession as _updateSession,
44
- validateSession as _validateSession,
45
- getSessionSummary as _getSessionSummary,
46
- claimSession as _claimSession,
47
- releaseSession as _releaseSession,
48
- getSessionOwner as _getSessionOwner,
49
- } from '../orchestrator/session-manager.js';
40
+ import { initSession as _initSession } from '../orchestrator/session-manager.js';
50
41
 
51
42
  export {
52
- _initSession as initSession,
53
- _loadSession as loadSession,
54
- _updateSession as updateSession,
55
- _validateSession as validateSession,
56
- _getSessionSummary as getSessionSummary,
57
- _claimSession as claimSession,
58
- _releaseSession as releaseSession,
59
- _getSessionOwner as getSessionOwner,
60
- };
43
+ initSession,
44
+ loadSession,
45
+ updateSession,
46
+ validateSession,
47
+ getSessionSummary,
48
+ claimSession,
49
+ releaseSession,
50
+ getSessionOwner,
51
+ } from '../orchestrator/session-manager.js';
61
52
 
62
53
  // ---------------------------------------------------------------------------
63
54
  // Autonomy
@@ -124,7 +124,7 @@ export async function runBuildLoop(config) {
124
124
 
125
125
  // --- Escalation check (before execution) ---
126
126
  const previousAttempts = attemptHistory.get(checkpoint.taskId) || [];
127
- let executorOptions = {};
127
+ const executorOptions = {};
128
128
 
129
129
  if (checkpoint.attempts > 0 && checkpoint.error) {
130
130
  // Analyze the cause of the previous failure
@@ -147,7 +147,7 @@ function extractRootCause(text, category) {
147
147
  * @param {string} rootCause
148
148
  * @returns {string}
149
149
  */
150
- function generateSuggestion(category, rootCause) {
150
+ function generateSuggestion(category, _rootCause) {
151
151
  const suggestions = {
152
152
  [FAILURE_CATEGORIES.SYNTAX_ERROR]: 'Check for missing brackets, semicolons, or malformed expressions. Review the exact line mentioned in the error.',
153
153
  [FAILURE_CATEGORIES.TEST_FAILURE]: 'Review the failing test assertions. Ensure the implementation matches the expected behavior described in the test.',
@@ -9,7 +9,7 @@
9
9
 
10
10
  /**
11
11
  * @deprecated Not currently imported by any production module.
12
- * Retained for potential future integration. Remove if still unused by v4.0.
12
+ * Retained for potential future integration. Review for removal or integration by v5.0.
13
13
  */
14
14
 
15
15
  import { execSync } from 'child_process';
@@ -32,12 +32,17 @@ const MAX_WORKTREE_AGE_MS = 24 * 60 * 60 * 1000;
32
32
 
33
33
  /**
34
34
  * Execute a git command in a given directory and return trimmed stdout.
35
+ * Sanitizes `cmd` to reject shell metacharacters (prevents injection).
35
36
  *
36
37
  * @param {string} cmd - Git command (without the `git` prefix)
37
38
  * @param {string} cwd - Working directory
38
39
  * @returns {string} Trimmed stdout
40
+ * @throws {Error} If cmd contains shell metacharacters
39
41
  */
40
42
  function git(cmd, cwd) {
43
+ if (/[`$;|&><(){}]/.test(cmd)) {
44
+ throw new Error(`Unsafe characters in git command: ${cmd}`);
45
+ }
41
46
  return execSync(`git ${cmd}`, {
42
47
  cwd,
43
48
  encoding: 'utf-8',
@@ -157,7 +162,7 @@ export function mergeWorktree(projectDir, worktreeBranch, mainBranch) {
157
162
  try {
158
163
  git(`merge "${worktreeBranch}" --no-edit`, absProject);
159
164
  return { success: true, conflicts: [] };
160
- } catch (err) {
165
+ } catch {
161
166
  // Parse conflicts from error output
162
167
  const conflicts = [];
163
168
  try {
@@ -103,11 +103,7 @@ export function applyCustomization(agentPrompt, customization) {
103
103
  if (customization.skip_sections && Array.isArray(customization.skip_sections)) {
104
104
  for (const sectionName of customization.skip_sections) {
105
105
  // Match section heading + all content until the next heading of same or higher level, or end of text
106
- const pattern = new RegExp(
107
- `^#{1,3}\\s+${escapeRegex(sectionName)}\\s*\\n[\\s\\S]*?(?=\\n#{1,3}\\s|\\Z)`,
108
- 'gm'
109
- );
110
- // \\Z is not JS — use two-pass: try lookahead for next heading, then fallback to end
106
+ // Two-pass approach: try lookahead for next heading, then fallback to end
111
107
  const headingPattern = new RegExp(
112
108
  `^(#{1,3})\\s+${escapeRegex(sectionName)}[^\\n]*\\n([\\s\\S]*?)(?=^#{1,3}\\s)`,
113
109
  'gm'
@@ -151,7 +151,7 @@ export function generateAgentsMd(content, contextFiles = null) {
151
151
  // Inline context files for full governance parity (Codex has no @import)
152
152
  if (contextFiles) {
153
153
  const sections = [];
154
- for (const [name, fileContent] of Object.entries(contextFiles)) {
154
+ for (const [, fileContent] of Object.entries(contextFiles)) {
155
155
  if (fileContent) {
156
156
  // Adapt context for Codex (replace Claude-specific refs)
157
157
  let adapted = fileContent;
@@ -18,19 +18,8 @@
18
18
  * CRITICAL = 5.0% → maximum reinforcement (last interactions before handoff)
19
19
  */
20
20
 
21
- /** Provider context window limits (tokens). */
22
- const PROVIDER_LIMITS = {
23
- claude: 200_000,
24
- gemini: 1_000_000,
25
- codex: 128_000,
26
- };
27
-
28
- const BRACKETS = {
29
- FRESH: { min: 60, max: 100, layers: ['L0', 'L1', 'L2', 'L3', 'L4', 'L5'], budgetRatio: 0.015 },
30
- MODERATE: { min: 40, max: 60, layers: ['L0', 'L1', 'L2', 'L3', 'L5'], budgetRatio: 0.025 },
31
- DEPLETED: { min: 25, max: 40, layers: ['L0', 'L1', 'L2'], budgetRatio: 0.040 },
32
- CRITICAL: { min: 0, max: 25, layers: ['L0', 'L1'], budgetRatio: 0.050 },
33
- };
21
+ import { PROVIDER_LIMITS } from '../utils/provider-limits.js';
22
+ import { BRACKETS } from '../utils/brackets.js';
34
23
 
35
24
  /**
36
25
  * Memory injection level per bracket.
@@ -2,6 +2,10 @@
2
2
  * Decision Engine - Core COMPASS module for chati.dev
3
3
  * Analyzes intent and recommends: REUSE (>=90%), ADAPT (60-89%), CREATE (<60%)
4
4
  *
5
+ * NOTE: This module handles entity-level routing (registry lookup).
6
+ * For intent-level similarity scoring (weighted keyword + purpose),
7
+ * see `intelligence/decision-engine.js` (calculateIntentSimilarity).
8
+ *
5
9
  * @module decision/engine
6
10
  */
7
11
 
@@ -45,7 +45,7 @@ const STALE_LOCK_AGE_MS = 30_000;
45
45
  * @param {object[]} [checkResults=[]] - Results from health checks (for targeted fixes)
46
46
  * @returns {AutoFixResult}
47
47
  */
48
- export function autoFix(projectDir, checkResults = []) {
48
+ export function autoFix(projectDir, _checkResults = []) {
49
49
  const actions = [];
50
50
 
51
51
  // Fix 1: Ensure required directories exist
@@ -177,6 +177,10 @@ function copyFrameworkFiles(destDir, provider = 'claude') {
177
177
  'templates/task-tmpl.yaml',
178
178
  'templates/qa-gate-tmpl.yaml',
179
179
  'templates/quick-brief-tmpl.yaml',
180
+ 'templates/brandbook-tmpl.yaml',
181
+ 'templates/design-token-tmpl.yaml',
182
+ 'templates/component-spec-tmpl.yaml',
183
+ 'templates/icon-system-tmpl.yaml',
180
184
  // Workflows
181
185
  'workflows/greenfield-fullstack.yaml',
182
186
  'workflows/brownfield-fullstack.yaml',
@@ -184,6 +188,7 @@ function copyFrameworkFiles(destDir, provider = 'claude') {
184
188
  'workflows/brownfield-service.yaml',
185
189
  'workflows/brownfield-ui.yaml',
186
190
  'workflows/quick-flow.yaml',
191
+ 'workflows/standard-flow.yaml',
187
192
  // Quality gates
188
193
  'quality-gates/planning-gate.md',
189
194
  'quality-gates/implementation-gate.md',
@@ -205,6 +210,7 @@ function copyFrameworkFiles(destDir, provider = 'claude') {
205
210
  'intelligence/decision-engine.md',
206
211
  // Patterns
207
212
  'patterns/elicitation.md',
213
+ 'patterns/elicitation-library.yaml',
208
214
  // Hooks
209
215
  'hooks/prism-engine.js',
210
216
  'hooks/mode-governance.js',
@@ -235,6 +241,7 @@ function copyFrameworkFiles(destDir, provider = 'claude') {
235
241
  'domains/workflows/brownfield-service.yaml',
236
242
  'domains/workflows/brownfield-ui.yaml',
237
243
  'domains/workflows/quick-flow.yaml',
244
+ 'domains/workflows/standard-flow.yaml',
238
245
  // i18n
239
246
  'i18n/en.yaml',
240
247
  'i18n/pt.yaml',
@@ -274,7 +281,7 @@ function copyFrameworkFiles(destDir, provider = 'claude') {
274
281
  * Configure a specific IDE
275
282
  */
276
283
  async function configureIDE(targetDir, ideKey, selectedMCPs, options = {}) {
277
- const { orchestratorPath, isSecondary } = options;
284
+ const { orchestratorPath } = options;
278
285
  const config = IDE_CONFIGS[ideKey];
279
286
  if (!config) return;
280
287
 
@@ -1,23 +1,8 @@
1
1
  import { existsSync, readFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
 
4
- /** Provider context window limits (tokens). */
5
- const PROVIDER_LIMITS = {
6
- claude: 200_000,
7
- gemini: 1_000_000,
8
- codex: 128_000,
9
- };
10
-
11
- const BRACKETS = [
12
- { name: 'FRESH', min: 60, max: 100, layers: ['L0', 'L1', 'L2', 'L3', 'L4', 'L5'], budgetRatio: 0.015 },
13
- { name: 'MODERATE', min: 40, max: 60, layers: ['L0', 'L1', 'L2', 'L3', 'L5'], budgetRatio: 0.025 },
14
- { name: 'DEPLETED', min: 25, max: 40, layers: ['L0', 'L1', 'L2'], budgetRatio: 0.040 },
15
- { name: 'CRITICAL', min: 0, max: 25, layers: ['L0', 'L1'], budgetRatio: 0.050 },
16
- ];
17
- // NOTE: This BRACKETS array is intentionally duplicated from src/context/bracket-tracker.js
18
- // for module isolation. bracket-tracker.js is the canonical source of truth.
19
- // Progressive Reinforcement Model (v4.0): budgets as ratio of provider context window.
20
- // If bracket ranges or ratios change, update BOTH files.
4
+ import { PROVIDER_LIMITS } from '../utils/provider-limits.js';
5
+ import { BRACKETS_LIST as BRACKETS } from '../utils/brackets.js';
21
6
 
22
7
  /**
23
8
  * Get context status based on session state