ctx-cc 2.2.0 → 3.0.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ctx-cc",
3
- "version": "2.2.0",
4
- "description": "CTX 2.2 (Continuous Task eXecution) - PRD-driven workflow orchestration for Claude Code. Story-verified, debug loop until 100% fixed.",
3
+ "version": "3.0.0",
4
+ "description": "CTX 3.0 (Continuous Task eXecution) - Production-grade workflow orchestration for Claude Code. Repository mapping, discussion phase, model profiles, git-native commits, persistent debug, parallel codebase analysis.",
5
5
  "keywords": [
6
6
  "claude",
7
7
  "claude-code",
@@ -0,0 +1,265 @@
1
+ # Brand Kit - {{project_name}}
2
+
3
+ **Created:** {{timestamp}}
4
+ **Approved:** {{approval_date}}
5
+ **Version:** 1.0
6
+ **Token Format:** W3C Design Tokens (DTCG)
7
+
8
+ ---
9
+
10
+ ## Brand Essence
11
+
12
+ ### Mission
13
+ {{mission_statement}}
14
+
15
+ ### Personality
16
+ {{personality_adjectives}}
17
+
18
+ ### Target Audience
19
+ {{target_audience}}
20
+
21
+ ### Visual Mood
22
+ {{visual_mood_description}}
23
+
24
+ ---
25
+
26
+ ## Token Architecture
27
+
28
+ ### Three-Tier Structure
29
+ ```
30
+ tokens/
31
+ ├── primitive.tokens.json # Raw values (colors, sizes)
32
+ ├── semantic.tokens.json # Purpose-based aliases + modes
33
+ └── component.tokens.json # Component-specific tokens
34
+ ```
35
+
36
+ ### Mode Support
37
+ - Light mode (default)
38
+ - Dark mode
39
+ {{additional_modes}}
40
+
41
+ ---
42
+
43
+ ## Color System
44
+
45
+ ### Primitive Colors
46
+ | Token | Light Mode | Dark Mode |
47
+ |-------|------------|-----------|
48
+ | gray-50 | #FAFAFA | #171717 |
49
+ | gray-100 | #F4F4F5 | #27272A |
50
+ | gray-200 | #E4E4E7 | #3F3F46 |
51
+ | gray-300 | #D4D4D8 | #52525B |
52
+ | gray-400 | #A1A1AA | #71717A |
53
+ | gray-500 | #71717A | #A1A1AA |
54
+ | gray-600 | #52525B | #D4D4D8 |
55
+ | gray-700 | #3F3F46 | #E4E4E7 |
56
+ | gray-800 | #27272A | #F4F4F5 |
57
+ | gray-900 | #18181B | #FAFAFA |
58
+ | {{primary_color_name}} | {{primary_light}} | {{primary_dark}} |
59
+
60
+ ### Semantic Colors
61
+ | Token | References | Usage |
62
+ |-------|------------|-------|
63
+ | background-primary | {gray-50} | Page backgrounds |
64
+ | background-surface | {gray-100} | Cards, modals |
65
+ | text-primary | {gray-900} | Body text |
66
+ | text-secondary | {gray-600} | Captions, hints |
67
+ | interactive | {{{primary_color}}} | CTAs, links |
68
+ | interactive-hover | {{{primary_hover}}} | Hover states |
69
+
70
+ ### State Colors
71
+ | State | Color | Hex |
72
+ |-------|-------|-----|
73
+ | success | green-500 | #22C55E |
74
+ | warning | amber-500 | #F59E0B |
75
+ | error | red-500 | #EF4444 |
76
+ | info | blue-500 | #3B82F6 |
77
+
78
+ ### Accessibility Compliance
79
+ | Combination | Ratio | WCAG 2.2 |
80
+ |-------------|-------|----------|
81
+ | text-primary on background | {{ratio_1}} | AA Pass |
82
+ | text-secondary on background | {{ratio_2}} | AA Pass |
83
+ | interactive on background | {{ratio_3}} | AA Pass |
84
+
85
+ ---
86
+
87
+ ## Typography
88
+
89
+ ### Font Stack
90
+ | Role | Font Family | Fallback |
91
+ |------|-------------|----------|
92
+ | Heading | {{heading_font}} | system-ui, sans-serif |
93
+ | Body | {{body_font}} | system-ui, sans-serif |
94
+ | Mono | {{mono_font}} | ui-monospace, monospace |
95
+
96
+ ### Type Scale (Desktop)
97
+ | Level | Size | Line Height | Weight | Letter Spacing |
98
+ |-------|------|-------------|--------|----------------|
99
+ | display | 48px | 1.1 | 700 | -0.02em |
100
+ | h1 | 36px | 1.2 | 600 | -0.01em |
101
+ | h2 | 28px | 1.3 | 600 | 0 |
102
+ | h3 | 22px | 1.4 | 500 | 0 |
103
+ | body-lg | 18px | 1.6 | 400 | 0 |
104
+ | body | 16px | 1.5 | 400 | 0 |
105
+ | body-sm | 14px | 1.5 | 400 | 0 |
106
+ | caption | 12px | 1.4 | 400 | 0.01em |
107
+
108
+ ### Responsive Scale
109
+ | Level | Mobile | Tablet | Desktop |
110
+ |-------|--------|--------|---------|
111
+ | display | 32px | 40px | 48px |
112
+ | h1 | 28px | 32px | 36px |
113
+ | h2 | 22px | 24px | 28px |
114
+
115
+ ---
116
+
117
+ ## Spacing & Layout
118
+
119
+ ### Base Scale (4px grid)
120
+ | Token | Value | Usage |
121
+ |-------|-------|-------|
122
+ | space-0 | 0px | Reset |
123
+ | space-1 | 4px | Tight inline |
124
+ | space-2 | 8px | Related elements |
125
+ | space-3 | 12px | Form gaps |
126
+ | space-4 | 16px | Default gap |
127
+ | space-6 | 24px | Section padding |
128
+ | space-8 | 32px | Card padding |
129
+ | space-12 | 48px | Section gaps |
130
+ | space-16 | 64px | Page sections |
131
+ | space-24 | 96px | Hero spacing |
132
+
133
+ ### Border Radius
134
+ | Token | Value | Usage |
135
+ |-------|-------|-------|
136
+ | radius-sm | 4px | Small elements |
137
+ | radius-md | 8px | Default |
138
+ | radius-lg | 12px | Cards |
139
+ | radius-full | 9999px | Pills, avatars |
140
+
141
+ ### Breakpoints
142
+ | Token | Value | Target |
143
+ |-------|-------|--------|
144
+ | breakpoint-sm | 640px | Mobile landscape |
145
+ | breakpoint-md | 768px | Tablet |
146
+ | breakpoint-lg | 1024px | Desktop |
147
+ | breakpoint-xl | 1280px | Large desktop |
148
+
149
+ ---
150
+
151
+ ## Motion
152
+
153
+ ### Duration
154
+ | Token | Value | Usage |
155
+ |-------|-------|-------|
156
+ | duration-instant | 0ms | No animation |
157
+ | duration-fast | 100ms | Micro-interactions |
158
+ | duration-normal | 200ms | Standard transitions |
159
+ | duration-slow | 300ms | Emphasis |
160
+ | duration-slower | 500ms | Page transitions |
161
+
162
+ ### Easing
163
+ | Token | Value | Usage |
164
+ |-------|-------|-------|
165
+ | ease-linear | linear | Progress bars |
166
+ | ease-in | cubic-bezier(0.4, 0, 1, 1) | Exit animations |
167
+ | ease-out | cubic-bezier(0, 0, 0.2, 1) | Enter animations |
168
+ | ease-in-out | cubic-bezier(0.4, 0, 0.2, 1) | Standard |
169
+ | ease-bounce | cubic-bezier(0.34, 1.56, 0.64, 1) | Playful |
170
+
171
+ ### Common Animations
172
+ | Token | Duration | Easing | Usage |
173
+ |-------|----------|--------|-------|
174
+ | transition-colors | 150ms | ease-out | Hover states |
175
+ | transition-transform | 200ms | ease-out | Scale/move |
176
+ | transition-opacity | 200ms | ease-in-out | Fade |
177
+ | transition-all | 200ms | ease-in-out | Complex |
178
+
179
+ ---
180
+
181
+ ## Accessibility Requirements
182
+
183
+ ### WCAG 2.2 Level AA (Required)
184
+ - [x] 1.4.3 Contrast (Minimum) - 4.5:1 text
185
+ - [x] 1.4.11 Non-text Contrast - 3:1 UI components
186
+ - [x] 2.4.11 Focus Not Obscured (Minimum)
187
+ - [x] 2.5.7 Dragging Movements - alternatives provided
188
+ - [x] 2.5.8 Target Size (Minimum) - 24x24px minimum
189
+ - [x] 3.3.8 Accessible Authentication (Minimum)
190
+
191
+ ### EAA 2025 Compliance (EU Markets)
192
+ European Accessibility Act enforcement: June 28, 2025
193
+ - All WCAG 2.2 AA criteria
194
+ - EN 301 549 v3.2.1 alignment
195
+
196
+ ---
197
+
198
+ ## Visual Guidelines
199
+
200
+ ### Do's
201
+ - Use semantic tokens, not primitives, in components
202
+ - Maintain 4px grid alignment
203
+ - Test all color combinations for contrast
204
+ - Provide alternatives to dragging interactions
205
+ - Ensure 24x24px minimum touch targets
206
+ - Use focus-visible for keyboard focus states
207
+
208
+ ### Don'ts
209
+ - Don't use color alone to convey information
210
+ - Don't use hardcoded values (use tokens)
211
+ - Don't skip focus states
212
+ - Don't obscure focused elements with overlays
213
+ - Don't require cognitive function tests for auth
214
+ - Don't disable paste in password fields
215
+
216
+ ---
217
+
218
+ ## Asset Locations
219
+
220
+ ```
221
+ project/
222
+ ├── BRAND_KIT.md # This document
223
+ ├── tokens/
224
+ │ ├── primitive.tokens.json # Raw values
225
+ │ ├── semantic.tokens.json # Semantic + modes
226
+ │ └── component.tokens.json # Component tokens
227
+ ├── brand-assets/
228
+ │ ├── tokens.css # CSS custom properties
229
+ │ ├── tokens.scss # SCSS variables
230
+ │ ├── tokens.js # JS constants
231
+ │ ├── tailwind.config.js # Tailwind theme
232
+ │ └── style-dictionary.config.json
233
+ ├── design-references/
234
+ │ └── [screenshots]
235
+ └── logo/
236
+ ├── logo-primary.svg
237
+ ├── logo-light.svg
238
+ └── logo-dark.svg
239
+ ```
240
+
241
+ ---
242
+
243
+ ## Export Commands
244
+
245
+ ```bash
246
+ # Using Style Dictionary
247
+ npx style-dictionary build --config style-dictionary.config.json
248
+
249
+ # Or run /ctx with design token update
250
+ ```
251
+
252
+ ---
253
+
254
+ ## Approval History
255
+
256
+ | Date | Approved By | Notes |
257
+ |------|-------------|-------|
258
+ | {{mood_board_date}} | {{user}} | Mood board approved |
259
+ | {{direction_date}} | {{user}} | Direction selected: Option {{option}} |
260
+ | {{final_date}} | {{user}} | Final brand kit approved |
261
+
262
+ ---
263
+
264
+ **This document is the source of truth for all visual decisions.**
265
+ **All design work MUST reference this kit.**
@@ -0,0 +1,163 @@
1
+ # Design Brief - {{component_name}}
2
+
3
+ ## Component: {{component_name}}
4
+ **Story:** {{story_id}}
5
+ **Created:** {{timestamp}}
6
+ **Approved:** {{approval_date}}
7
+ **WCAG Level:** 2.2 AA
8
+ **EAA 2025:** {{eaa_compliant}}
9
+
10
+ ---
11
+
12
+ ## Visual Direction
13
+
14
+ ### Brand Reference
15
+ - Brand Kit: BRAND_KIT.md v{{brand_version}}
16
+ - Mood board: .ctx/phases/{{story_id}}/MOOD_BOARD.md
17
+ - Selected: Option {{selected_option}} {{modifications}}
18
+
19
+ ### Design Constraints
20
+ | Constraint | Value |
21
+ |------------|-------|
22
+ | Primary Colors | {{color_palette}} |
23
+ | Typography | {{typography}} |
24
+ | Spacing | {{spacing_tokens}} |
25
+ | Border Radius | {{radius_tokens}} |
26
+
27
+ ---
28
+
29
+ ## Design Decisions
30
+
31
+ | Decision | Choice | Rationale |
32
+ |----------|--------|-----------|
33
+ | Layout | {{layout_choice}} | {{layout_why}} |
34
+ | Colors | {{color_choice}} | {{color_why}} |
35
+ | Typography | {{type_choice}} | {{type_why}} |
36
+ | Spacing | {{spacing_choice}} | {{spacing_why}} |
37
+ | Motion | {{motion_choice}} | {{motion_why}} |
38
+
39
+ ---
40
+
41
+ ## Component States
42
+
43
+ | State | Description | Visual Treatment |
44
+ |-------|-------------|------------------|
45
+ | Default | Normal state | {{default_treatment}} |
46
+ | Hover | Mouse over | {{hover_treatment}} |
47
+ | Focus | Keyboard focus | {{focus_treatment}} |
48
+ | Active | Being pressed | {{active_treatment}} |
49
+ | Disabled | Not interactive | {{disabled_treatment}} |
50
+ | Loading | Async operation | {{loading_treatment}} |
51
+ | Error | Invalid state | {{error_treatment}} |
52
+
53
+ ---
54
+
55
+ ## Responsive Behavior
56
+
57
+ | Breakpoint | Width | Behavior |
58
+ |------------|-------|----------|
59
+ | Mobile | < 768px | {{mobile_behavior}} |
60
+ | Tablet | 768-1024px | {{tablet_behavior}} |
61
+ | Desktop | > 1024px | {{desktop_behavior}} |
62
+
63
+ ---
64
+
65
+ ## Accessibility Implementation
66
+
67
+ ### WCAG 2.2 Compliance
68
+
69
+ | Criterion | Requirement | Implementation |
70
+ |-----------|-------------|----------------|
71
+ | 2.4.7 Focus Visible | Focus indicator visible | {{focus_impl}} |
72
+ | 2.4.11 Focus Not Obscured | Focused element visible | {{obscured_impl}} |
73
+ | 2.5.7 Dragging | Click alternative | {{drag_impl}} |
74
+ | 2.5.8 Target Size | 24x24px minimum | {{target_impl}} |
75
+ | 3.3.8 Authentication | No cognitive tests | {{auth_impl}} |
76
+
77
+ ### Keyboard Navigation
78
+
79
+ | Key | Action |
80
+ |-----|--------|
81
+ | Tab | {{tab_action}} |
82
+ | Enter | {{enter_action}} |
83
+ | Space | {{space_action}} |
84
+ | Escape | {{escape_action}} |
85
+ | Arrow Keys | {{arrow_action}} |
86
+
87
+ ### Screen Reader
88
+
89
+ | Element | ARIA | Announcement |
90
+ |---------|------|--------------|
91
+ | {{element_1}} | {{aria_1}} | {{announce_1}} |
92
+ | {{element_2}} | {{aria_2}} | {{announce_2}} |
93
+
94
+ ---
95
+
96
+ ## Approval History
97
+
98
+ | Stage | Date | Approved | Notes |
99
+ |-------|------|----------|-------|
100
+ | Mood board | {{mood_date}} | {{mood_approved}} | {{mood_notes}} |
101
+ | Direction (A/B/C) | {{dir_date}} | Option {{dir_choice}} | {{dir_notes}} |
102
+ | Prototype | {{proto_date}} | {{proto_approved}} | {{proto_notes}} |
103
+ | Final | {{final_date}} | {{final_approved}} | {{final_notes}} |
104
+
105
+ ---
106
+
107
+ ## Implementation Files
108
+
109
+ | Artifact | Path |
110
+ |----------|------|
111
+ | Component | {{component_path}} |
112
+ | Styles | {{styles_path}} |
113
+ | Story | {{story_path}} |
114
+ | Tests | {{tests_path}} |
115
+
116
+ ---
117
+
118
+ ## Figma Reference
119
+
120
+ {{#if figma_link}}
121
+ - File: {{figma_link}}
122
+ - Node: {{figma_node}}
123
+ {{else}}
124
+ No Figma file linked.
125
+ {{/if}}
126
+
127
+ ---
128
+
129
+ ## Screenshots
130
+
131
+ | Viewport | Screenshot |
132
+ |----------|------------|
133
+ | Mobile | .ctx/phases/{{story_id}}/mobile.png |
134
+ | Tablet | .ctx/phases/{{story_id}}/tablet.png |
135
+ | Desktop | .ctx/phases/{{story_id}}/desktop.png |
136
+
137
+ ---
138
+
139
+ ## Verification Checklist
140
+
141
+ ### Visual
142
+ - [ ] Matches approved prototype
143
+ - [ ] All states implemented
144
+ - [ ] Responsive at all breakpoints
145
+ - [ ] Uses brand tokens (no hardcoded values)
146
+
147
+ ### Accessibility
148
+ - [ ] Focus visible (2px ring, 3:1 contrast)
149
+ - [ ] Target size >= 24x24px
150
+ - [ ] Keyboard navigable
151
+ - [ ] Screen reader tested
152
+ - [ ] No color-only information
153
+
154
+ ### Technical
155
+ - [ ] No console errors
156
+ - [ ] Tests pass
157
+ - [ ] Storybook story created
158
+ - [ ] No TODO comments
159
+
160
+ ---
161
+
162
+ **This brief documents all design decisions for {{component_name}}.**
163
+ **Any deviations require approval update.**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "https://ctx.dev/schemas/prd.json",
3
- "version": "2.0",
3
+ "version": "2.1",
4
4
  "project": {
5
5
  "name": "{{project_name}}",
6
6
  "description": "{{project_description}}",
@@ -22,6 +22,28 @@
22
22
  "{{risk_1}}"
23
23
  ]
24
24
  },
25
+ "brand": {
26
+ "hasBrandKit": false,
27
+ "personality": [],
28
+ "visualMood": "",
29
+ "inspirations": [],
30
+ "antiInspirations": [],
31
+ "existingAssets": [],
32
+ "darkModeRequired": false,
33
+ "euMarket": false
34
+ },
35
+ "design": {
36
+ "wcagLevel": "AA",
37
+ "eaaCompliance": false,
38
+ "tokenFormat": "w3c",
39
+ "figmaFileKey": null,
40
+ "designSystem": null,
41
+ "breakpoints": {
42
+ "mobile": 375,
43
+ "tablet": 768,
44
+ "desktop": 1440
45
+ }
46
+ },
25
47
  "constitution": {
26
48
  "principles": [
27
49
  "Code quality over speed",
@@ -51,9 +73,17 @@
51
73
  "requiresAPI": false,
52
74
  "notes": "{{testing_notes}}"
53
75
  },
76
+ "storyTypes": {
77
+ "feature": "Standard implementation story",
78
+ "brand": "Brand kit establishment (BRAND_KIT.md + tokens)",
79
+ "design": "UI component/page design with approval gates",
80
+ "fix": "Bug fix or correction",
81
+ "refactor": "Code improvement without behavior change"
82
+ },
54
83
  "stories": [
55
84
  {
56
85
  "id": "S001",
86
+ "type": "feature",
57
87
  "title": "{{story_title}}",
58
88
  "description": "{{story_description}}",
59
89
  "acceptanceCriteria": [
@@ -65,7 +95,8 @@
65
95
  "phase": 1,
66
96
  "passes": false,
67
97
  "verifiedAt": null,
68
- "notes": ""
98
+ "notes": "",
99
+ "design": null
69
100
  }
70
101
  ],
71
102
  "metadata": {
@@ -0,0 +1,124 @@
1
+ {
2
+ "$schema": "https://ctx.dev/schemas/config.json",
3
+ "version": "3.0",
4
+
5
+ "models": {
6
+ "architect": {
7
+ "id": "claude-opus-4",
8
+ "description": "Best reasoning, use for critical decisions",
9
+ "costTier": "high"
10
+ },
11
+ "default": {
12
+ "id": "claude-sonnet-4",
13
+ "description": "Balanced performance and cost",
14
+ "costTier": "medium"
15
+ },
16
+ "fast": {
17
+ "id": "claude-haiku-4",
18
+ "description": "Quick tasks, lower cost",
19
+ "costTier": "low"
20
+ }
21
+ },
22
+
23
+ "routing": {
24
+ "research": "architect",
25
+ "discussion": "default",
26
+ "planning": "architect",
27
+ "execution": "default",
28
+ "debugging": "default",
29
+ "verification": "fast",
30
+ "mapping": "fast",
31
+ "quick": "fast"
32
+ },
33
+
34
+ "profiles": {
35
+ "quality": {
36
+ "description": "Best results, higher cost",
37
+ "routing": {
38
+ "research": "architect",
39
+ "discussion": "architect",
40
+ "planning": "architect",
41
+ "execution": "architect",
42
+ "debugging": "architect",
43
+ "verification": "default",
44
+ "mapping": "default",
45
+ "quick": "default"
46
+ }
47
+ },
48
+ "balanced": {
49
+ "description": "Good results, moderate cost (default)",
50
+ "routing": {
51
+ "research": "architect",
52
+ "discussion": "default",
53
+ "planning": "architect",
54
+ "execution": "default",
55
+ "debugging": "default",
56
+ "verification": "fast",
57
+ "mapping": "fast",
58
+ "quick": "fast"
59
+ }
60
+ },
61
+ "budget": {
62
+ "description": "Acceptable results, lowest cost",
63
+ "routing": {
64
+ "research": "default",
65
+ "discussion": "default",
66
+ "planning": "default",
67
+ "execution": "default",
68
+ "debugging": "default",
69
+ "verification": "fast",
70
+ "mapping": "fast",
71
+ "quick": "fast"
72
+ }
73
+ }
74
+ },
75
+
76
+ "activeProfile": "balanced",
77
+
78
+ "git": {
79
+ "autoCommit": true,
80
+ "commitPerTask": true,
81
+ "commitMessageFormat": "[CTX] {title}\n\nStory: {storyId} - {storyTitle}\nCriterion: {criterion}\n\nCo-Authored-By: Claude <noreply@anthropic.com>",
82
+ "signOff": false,
83
+ "gpgSign": false
84
+ },
85
+
86
+ "context": {
87
+ "mapTokenBudget": 2000,
88
+ "mapTokenBudgetExpanded": 8000,
89
+ "checkpointThreshold": 0.5,
90
+ "forceCheckpointThreshold": 0.7,
91
+ "handoffThreshold": 0.4
92
+ },
93
+
94
+ "debug": {
95
+ "maxAttempts": 5,
96
+ "persistSessions": true,
97
+ "screenshotOnFailure": true
98
+ },
99
+
100
+ "integrations": {
101
+ "linear": {
102
+ "enabled": false,
103
+ "apiKey": "env:LINEAR_API_KEY",
104
+ "teamId": null,
105
+ "syncStories": true
106
+ },
107
+ "github": {
108
+ "enabled": false,
109
+ "syncIssues": false,
110
+ "createPROnComplete": false
111
+ },
112
+ "slack": {
113
+ "enabled": false,
114
+ "webhookUrl": "env:SLACK_WEBHOOK_URL",
115
+ "notifyOnPhaseComplete": false
116
+ }
117
+ },
118
+
119
+ "ui": {
120
+ "showTokenUsage": true,
121
+ "showModelInfo": true,
122
+ "verboseOutput": false
123
+ }
124
+ }