ctx-cc 2.1.0 → 2.3.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # CTX 2.1 - Continuous Task eXecution
1
+ # CTX 2.3 - Continuous Task eXecution
2
2
 
3
- > Smart workflow orchestration for Claude Code. 8 commands. Smart routing. Debug loop until 100% fixed.
3
+ > Smart workflow orchestration for Claude Code. PRD-driven. Design-first. 8 commands. Debug loop until 100% fixed.
4
4
 
5
5
  ## Installation
6
6
 
@@ -15,10 +15,15 @@ npx ctx-cc --project # Install to .claude in current directory
15
15
  npx ctx-cc --force # Overwrite existing installation
16
16
  ```
17
17
 
18
- ## Why CTX 2.1?
18
+ ## Why CTX 2.3?
19
19
 
20
- | Feature | Before | CTX 2.1 |
20
+ | Feature | Before | CTX 2.3 |
21
21
  |---------|--------|---------|
22
+ | Requirements | Ad-hoc goals | **PRD.json with stories** |
23
+ | Design | Manual workflow | **Full design system** |
24
+ | Accessibility | Manual checks | **WCAG 2.2 AA + EAA 2025** |
25
+ | Tokens | Custom formats | **W3C Design Tokens** |
26
+ | Verification | Task-based | **Acceptance criteria** |
22
27
  | Commands | 12-27 | **8** (organized) |
23
28
  | Router | Manual | **Smart (auto-routing)** |
24
29
  | Debug | Manual | **Loop until 100% fixed** |
@@ -29,12 +34,63 @@ npx ctx-cc --force # Overwrite existing installation
29
34
  ## Quick Start
30
35
 
31
36
  ```
32
- 1. /ctx init Initialize project
33
- 2. /ctx Smart router does the rest
37
+ 1. /ctx init Gather ALL info upfront (requirements + credentials)
38
+ 2. /ctx Autonomous execution with minimal interruption
34
39
  3. /ctx pause Checkpoint when needed
35
40
  ```
36
41
 
37
- That's it. `/ctx` reads STATE.md and knows what to do next.
42
+ **The Flow:**
43
+ ```
44
+ /ctx init → Gather everything → /ctx → Autonomous loop → Delivered!
45
+ ```
46
+
47
+ ## Front-Loaded Approach
48
+
49
+ CTX gathers EVERYTHING at initialization:
50
+ - **Requirements** → PRD.json stories
51
+ - **Acceptance criteria** → How to verify each story
52
+ - **Test credentials** → .ctx/.env (gitignored)
53
+ - **Constitution** → Rules for autonomous decisions
54
+ - **Design context** → Brand personality, inspirations, accessibility needs
55
+
56
+ Then executes autonomously:
57
+ - Only interrupts for architecture decisions (Rule 4)
58
+ - Only interrupts for design approvals at gates
59
+ - Uses stored credentials for browser testing
60
+ - Loops through stories until all pass
61
+
62
+ ## Design System (New in 2.3)
63
+
64
+ CTX handles visual work with dedicated agents and approval gates.
65
+
66
+ ### Story Types
67
+ | Type | Agent | Purpose |
68
+ |------|-------|---------|
69
+ | feature | ctx-executor | Standard implementation |
70
+ | brand | ctx-designer | BRAND_KIT.md + W3C tokens |
71
+ | design | ctx-designer | UI components/pages |
72
+
73
+ ### 3 Options Pattern
74
+ All design decisions present three options:
75
+ - **Option A**: Conservative (safe, proven)
76
+ - **Option B**: Balanced (recommended)
77
+ - **Option C**: Bold (distinctive)
78
+
79
+ ### Design Approval Gates
80
+ ```
81
+ Mood Board → Direction (A/B/C) → Prototype → Final
82
+ ```
83
+ Each gate requires user approval before proceeding.
84
+
85
+ ### WCAG 2.2 AA + EAA 2025
86
+ | Criterion | Requirement |
87
+ |-----------|-------------|
88
+ | 2.4.11 | Focus not obscured |
89
+ | 2.5.7 | Drag alternatives |
90
+ | 2.5.8 | 24x24px targets |
91
+ | 3.3.8 | Accessible auth |
92
+
93
+ EU markets require EAA 2025 compliance (enforcement: June 28, 2025).
38
94
 
39
95
  ## The 8 Commands
40
96
 
@@ -127,13 +183,14 @@ Big work = multiple phases, not bigger plans.
127
183
  ### STATE.md - Single Source of Truth
128
184
  ~100 lines. Always accurate. Always read first.
129
185
 
130
- ## 5 Specialized Agents
186
+ ## 6 Specialized Agents
131
187
 
132
188
  | Agent | Spawned when |
133
189
  |-------|--------------|
134
190
  | ctx-researcher | status = initializing |
135
191
  | ctx-planner | after research |
136
- | ctx-executor | status = executing |
192
+ | ctx-executor | status = executing (feature stories) |
193
+ | ctx-designer | status = executing (brand/design stories) |
137
194
  | ctx-debugger | status = debugging |
138
195
  | ctx-verifier | status = verifying |
139
196
 
@@ -159,20 +216,114 @@ Auto-runs during debugging and verification:
159
216
  - Check elements exist
160
217
  - Take screenshot proof
161
218
 
219
+ ### Figma MCP (Design Context)
220
+ Auto-runs during design stories:
221
+ - Extract design tokens
222
+ - Get component metadata
223
+ - Screenshot references
224
+
225
+ ### Gemini Design MCP (Visual Generation)
226
+ Auto-runs during design stories:
227
+ - Generate UI mockups
228
+ - Create UI code
229
+ - Analyze designs for accessibility
230
+
162
231
  ## Directory Structure
163
232
 
164
233
  ```
165
234
  .ctx/
166
- ├── STATE.md # Living digest - ALWAYS read first
167
- ├── phases/{id}/ # Phase data
235
+ ├── STATE.md # Living digest - execution state
236
+ ├── PRD.json # Requirements contract - stories + criteria
237
+ ├── phases/{story_id}/ # Per-story data
168
238
  │ ├── RESEARCH.md # ArguSeek + ChunkHound results
169
- │ ├── PLAN.md # 2-3 tasks (atomic)
170
- └── VERIFY.md # Three-level verification
239
+ │ ├── PLAN.md # Tasks mapped to acceptance criteria
240
+ ├── VERIFY.md # Verification report
241
+ │ ├── MOOD_BOARD.md # Design references (design stories)
242
+ │ └── DESIGN_BRIEF.md # Design decisions (design stories)
171
243
  ├── checkpoints/ # Auto-checkpoints
172
244
  ├── debug/ # Debug screenshots
173
245
  └── memory/ # Decision memory
246
+
247
+ project/
248
+ ├── BRAND_KIT.md # Visual foundation (brand stories)
249
+ └── tokens/ # W3C design tokens
250
+ ├── primitive.tokens.json
251
+ ├── semantic.tokens.json
252
+ └── component.tokens.json
174
253
  ```
175
254
 
255
+ ## PRD.json - Requirements Contract
256
+
257
+ ```json
258
+ {
259
+ "brand": {
260
+ "hasBrandKit": false,
261
+ "personality": ["professional", "modern"],
262
+ "euMarket": true
263
+ },
264
+ "design": {
265
+ "wcagLevel": "AA",
266
+ "eaaCompliance": true,
267
+ "tokenFormat": "w3c"
268
+ },
269
+ "stories": [
270
+ {
271
+ "id": "S001",
272
+ "type": "brand",
273
+ "title": "Establish brand kit",
274
+ "acceptanceCriteria": [
275
+ "BRAND_KIT.md exists",
276
+ "tokens/ directory populated"
277
+ ],
278
+ "passes": false
279
+ },
280
+ {
281
+ "id": "S002",
282
+ "type": "design",
283
+ "title": "Login page",
284
+ "acceptanceCriteria": [
285
+ "WCAG 2.2 AA compliant",
286
+ "All states implemented"
287
+ ],
288
+ "passes": false
289
+ }
290
+ ],
291
+ "metadata": {
292
+ "currentStory": "S001",
293
+ "passedStories": 0,
294
+ "totalStories": 2
295
+ }
296
+ }
297
+ ```
298
+
299
+ When a story passes verification, `passes` becomes `true`.
300
+ When all stories pass, project is complete.
301
+
302
+ ## Secure Credentials (.ctx/.env)
303
+
304
+ During `/ctx init`, you'll be asked for test credentials:
305
+
306
+ ```bash
307
+ # .ctx/.env (automatically gitignored)
308
+ APP_URL=http://localhost:3000
309
+ TEST_USER_EMAIL=test@example.com
310
+ TEST_USER_PASSWORD=testpass123
311
+ ADMIN_EMAIL=admin@example.com
312
+ ADMIN_PASSWORD=adminpass123
313
+ API_KEY=your-api-key
314
+ ```
315
+
316
+ **Why?**
317
+ - Enables autonomous browser verification
318
+ - No interruptions asking "what's the login?"
319
+ - Agents use credentials silently for testing
320
+ - NEVER echoed in logs or committed
321
+
322
+ **Security:**
323
+ - `.ctx/.gitignore` automatically protects `.env`
324
+ - Credentials used ONLY for test automation
325
+ - Never hardcoded, always read from .env
326
+
176
327
  ## Updating
177
328
 
178
329
  ```bash
@@ -190,4 +341,4 @@ MIT
190
341
 
191
342
  ---
192
343
 
193
- *CTX 2.0 - 4 commands, debug loop, 100% verified*
344
+ *CTX 2.3 - PRD-driven, design-first, story-verified, debug loop until 100% fixed*
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: ctx-debugger
3
- description: Debug agent with browser verification loop. Loops until 100% fixed with visual proof. Spawned when status = "debugging".
3
+ description: Debug agent with browser verification loop. Uses stored credentials for autonomous testing. Loops until 100% fixed. Spawned when status = "debugging".
4
4
  tools: Read, Write, Edit, Bash, Glob, Grep, mcp__playwright__*, mcp__chrome-devtools__*
5
5
  color: yellow
6
6
  ---
@@ -11,6 +11,9 @@ You are a CTX debugger. Your job is to fix issues until they are 100% verified w
11
11
  You NEVER give up after one attempt.
12
12
  You loop until the fix is proven working, with visual proof when applicable.
13
13
  Maximum 5 attempts before escalating to user.
14
+
15
+ **You use stored credentials from `.ctx/.env` for browser testing.**
16
+ This enables fully autonomous verification without asking user for login details.
14
17
  </role>
15
18
 
16
19
  <philosophy>
@@ -43,14 +46,24 @@ For any UI-related fix:
43
46
 
44
47
  <process>
45
48
 
46
- ## Step 1: Understand the Issue
49
+ ## Step 1: Load Context and Credentials
47
50
 
48
- Read from STATE.md:
51
+ **Load from STATE.md:**
49
52
  - `debug_issue`: What's broken
50
53
  - `last_error`: Error message or behavior
51
54
  - `attempt_count`: How many attempts so far
52
55
 
53
- Gather more context:
56
+ **Load from `.ctx/.env` (if browser testing needed):**
57
+ ```bash
58
+ # Parse .env file for credentials
59
+ APP_URL= # Where to navigate
60
+ TEST_USER_EMAIL= # For login flows
61
+ TEST_USER_PASSWORD=
62
+ ```
63
+
64
+ **SECURITY:** Never echo credentials in output. Use them only for browser actions.
65
+
66
+ **Gather more context:**
54
67
  - Error logs
55
68
  - Stack traces
56
69
  - Failing test output
@@ -133,25 +146,39 @@ while attempt <= 5:
133
146
 
134
147
  ## Step 4: Browser Verification (UI Issues)
135
148
 
136
- When the issue involves UI:
149
+ When the issue involves UI, use credentials from `.ctx/.env`:
137
150
 
138
151
  ### Using Playwright MCP
139
152
  ```
140
- 1. browser_navigate to affected page
153
+ 1. browser_navigate to APP_URL from .env
141
154
  2. browser_snapshot to get current state
142
- 3. browser_click / browser_type to interact
143
- 4. browser_snapshot again
144
- 5. browser_take_screenshot for proof
155
+ 3. If login required:
156
+ - browser_type TEST_USER_EMAIL into email field
157
+ - browser_type TEST_USER_PASSWORD into password field
158
+ - browser_click submit button
159
+ 4. Navigate to affected page
160
+ 5. browser_snapshot / browser_take_screenshot for proof
145
161
  ```
146
162
 
147
163
  ### Using Chrome DevTools MCP
148
164
  ```
149
- 1. navigate_page to affected URL
165
+ 1. navigate_page to APP_URL from .env
150
166
  2. take_snapshot for accessibility tree
151
- 3. click / fill to interact
152
- 4. take_screenshot for visual proof
167
+ 3. If login required:
168
+ - fill email field with TEST_USER_EMAIL
169
+ - fill password field with TEST_USER_PASSWORD
170
+ - click submit
171
+ 4. Navigate to affected page
172
+ 5. take_screenshot for visual proof
153
173
  ```
154
174
 
175
+ ### Credential Usage Rules
176
+ - Read credentials from `.ctx/.env` at start
177
+ - NEVER hardcode credentials in commands
178
+ - NEVER echo credentials in logs
179
+ - Use credentials ONLY for browser_type/fill actions
180
+ - Credentials enable AUTONOMOUS testing without user input
181
+
155
182
  ### Screenshot Naming
156
183
  Save screenshots to `.ctx/debug/`:
157
184
  ```