ctx-cc 3.5.0 → 4.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.
Files changed (71) hide show
  1. package/README.md +34 -289
  2. package/agents/ctx-arch-mapper.md +5 -3
  3. package/agents/ctx-auditor.md +5 -3
  4. package/agents/ctx-concerns-mapper.md +5 -3
  5. package/agents/ctx-criteria-suggester.md +6 -4
  6. package/agents/ctx-debugger.md +5 -3
  7. package/agents/ctx-designer.md +488 -114
  8. package/agents/ctx-discusser.md +5 -3
  9. package/agents/ctx-executor.md +5 -3
  10. package/agents/ctx-handoff.md +6 -4
  11. package/agents/ctx-learner.md +5 -3
  12. package/agents/ctx-mapper.md +4 -3
  13. package/agents/ctx-ml-analyst.md +600 -0
  14. package/agents/ctx-ml-engineer.md +933 -0
  15. package/agents/ctx-ml-reviewer.md +485 -0
  16. package/agents/ctx-ml-scientist.md +626 -0
  17. package/agents/ctx-parallelizer.md +4 -3
  18. package/agents/ctx-planner.md +5 -3
  19. package/agents/ctx-predictor.md +4 -3
  20. package/agents/ctx-qa.md +5 -3
  21. package/agents/ctx-quality-mapper.md +5 -3
  22. package/agents/ctx-researcher.md +5 -3
  23. package/agents/ctx-reviewer.md +6 -4
  24. package/agents/ctx-team-coordinator.md +5 -3
  25. package/agents/ctx-tech-mapper.md +5 -3
  26. package/agents/ctx-verifier.md +5 -3
  27. package/bin/ctx.js +168 -27
  28. package/commands/brand.md +309 -0
  29. package/commands/design.md +304 -0
  30. package/commands/experiment.md +251 -0
  31. package/commands/help.md +57 -7
  32. package/commands/metrics.md +1 -1
  33. package/commands/milestone.md +1 -1
  34. package/commands/ml-status.md +197 -0
  35. package/commands/monitor.md +1 -1
  36. package/commands/train.md +266 -0
  37. package/commands/visual-qa.md +559 -0
  38. package/commands/voice.md +1 -1
  39. package/hooks/post-tool-use.js +39 -0
  40. package/hooks/pre-tool-use.js +93 -0
  41. package/hooks/subagent-stop.js +32 -0
  42. package/package.json +9 -3
  43. package/plugin.json +45 -0
  44. package/skills/ctx-design-system/SKILL.md +572 -0
  45. package/skills/ctx-ml-experiment/SKILL.md +334 -0
  46. package/skills/ctx-ml-pipeline/SKILL.md +437 -0
  47. package/skills/ctx-orchestrator/SKILL.md +91 -0
  48. package/skills/ctx-review-gate/SKILL.md +111 -0
  49. package/skills/ctx-state/SKILL.md +100 -0
  50. package/skills/ctx-visual-qa/SKILL.md +587 -0
  51. package/src/agents.js +109 -0
  52. package/src/auto.js +287 -0
  53. package/src/capabilities.js +171 -0
  54. package/src/commits.js +94 -0
  55. package/src/config.js +112 -0
  56. package/src/context.js +241 -0
  57. package/src/handoff.js +156 -0
  58. package/src/hooks.js +218 -0
  59. package/src/install.js +119 -51
  60. package/src/lifecycle.js +194 -0
  61. package/src/metrics.js +198 -0
  62. package/src/pipeline.js +269 -0
  63. package/src/review-gate.js +244 -0
  64. package/src/runner.js +120 -0
  65. package/src/skills.js +143 -0
  66. package/src/state.js +267 -0
  67. package/src/worktree.js +244 -0
  68. package/templates/PRD.json +1 -1
  69. package/templates/config.json +1 -237
  70. package/workflows/ctx-router.md +0 -485
  71. package/workflows/map-codebase.md +0 -329
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  AI that learns your preferences. Predictive planning. Self-healing deployments. 21 specialized agents.
19
19
 
20
- [Installation](#installation) · [Quick Start](#quick-start) · [New in 3.3](#new-in-33) · [Commands](#commands) · [Why CTX](#why-ctx) · [**Getting Started Guide**](./GETTING_STARTED.md)
20
+ [Installation](#installation) · [Quick Start](#quick-start) · [New in 3.5](#new-in-35) · [Commands](#commands) · [Why CTX](#why-ctx) · [**Getting Started Guide**](./GETTING_STARTED.md)
21
21
 
22
22
  </div>
23
23
 
@@ -65,7 +65,14 @@ Tell CTX what you want → CTX figures out the rest → Delivered!
65
65
 
66
66
  ---
67
67
 
68
- ## New in 3.3
68
+ ## New in 3.5
69
+
70
+ ### Complete Redesign
71
+ v3.5 is a ground-up rewrite focused on reliability over feature count:
72
+ - **Unified version** across all 21 agents and commands
73
+ - **Trimmed config** — removed 260 lines of settings for unimplemented features
74
+ - **Single router** — eliminated duplicate routing logic that caused agent spawn failures
75
+ - **GSD-proven architecture** — rebuilt on patterns validated in production
69
76
 
70
77
  ### Conversational-First Routing
71
78
  **No commands to memorize.** CTX understands natural language from your first prompt:
@@ -77,23 +84,6 @@ Tell CTX what you want → CTX figures out the rest → Delivered!
77
84
  | "Is my app accessible?" | Runs WCAG 2.1 AA accessibility audit |
78
85
  | "Test everything" | Crawls every page, clicks every button |
79
86
  | "What's next?" | Shows status and recommended action |
80
- | "Ship it" | Runs verification, then deploys |
81
-
82
- **New user?** CTX welcomes you and guides setup:
83
- ```
84
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
85
- Welcome to CTX!
86
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
87
-
88
- I understood: "build a todo app with React"
89
-
90
- You want to build something new. Let's set it up!
91
-
92
- I'll now:
93
- 1. Create your project structure
94
- 2. Research best practices for React todo apps
95
- 3. Create a plan with clear milestones
96
- ```
97
87
 
98
88
  Commands still work as shortcuts for power users.
99
89
 
@@ -114,258 +104,39 @@ Features:
114
104
  - **Trace capture** - Screenshots and logs for every failed interaction
115
105
  - **Fix tasks** - Issues organized by section, ready for execution
116
106
 
117
- ### Learning System
118
- CTX learns from your codebase and preferences:
119
-
120
- ```
121
- [LEARNER] Applying 3 learned preferences
122
-
123
- 1. Using Zod for validation
124
- → Based on pattern P001 (95% confidence, 12 observations)
125
-
126
- 2. Functional components only
127
- → Based on decision D005 (explicit preference)
128
-
129
- 3. Avoiding moment.js, using date-fns
130
- → Based on failure F001 (bundle size)
131
- ```
132
-
133
- Memory stored in `.ctx/memory/`:
134
- - `patterns.json` - Code patterns you prefer
135
- - `decisions.json` - Past architectural decisions
136
- - `failures.json` - What didn't work
137
- - `preferences.json` - Communication style
138
- - `conventions.json` - Naming and structure
139
-
140
- Commands:
141
- ```bash
142
- /ctx learn # Show what CTX has learned
143
- /ctx learn patterns # Show code patterns
144
- /ctx learn decisions # Show architectural decisions
145
- /ctx learn forget [id] # Remove a learned pattern
146
- ```
147
-
148
- ### Predictive Planning
149
- AI suggests what to build next based on patterns:
150
-
151
- ```
152
- [PREDICT] Feature Suggestions for MyApp
153
-
154
- Based on your e-commerce app at MVP stage:
155
-
156
- 1. Cart Abandonment Recovery
157
- ├─ ROI: 9/10
158
- ├─ Effort: Medium (2-3 days)
159
- └─ Impact: +15-25% recovered revenue
160
-
161
- 2. Product Reviews & Ratings
162
- ├─ ROI: 9/10
163
- ├─ Effort: Low (1-2 days)
164
- └─ Impact: +18% conversion rate
165
-
166
- 3. Discount Codes System
167
- ├─ ROI: 7/10
168
- └─ Effort: Low (1 day)
169
-
170
- [1] Create story [A] Create all [R] Research more
171
- ```
172
-
173
- Commands:
174
- ```bash
175
- /ctx predict # Full prediction analysis
176
- /ctx predict --quick # Quick wins only (< 1 day)
177
- /ctx predict --create [id] # Create story from suggestion
178
- ```
179
-
180
- ### Self-Healing Deployments
181
- Monitor production errors and auto-fix:
182
-
183
- ```bash
184
- /ctx monitor connect sentry # Connect Sentry
185
- /ctx monitor errors # List recent errors
186
- /ctx monitor auto-fix [id] # Auto-fix with PR
187
- /ctx monitor --watch # Continuous monitoring
188
- ```
189
-
190
- Auto-fix workflow:
191
- ```
192
- 1. Sentry reports: "TypeError in checkout.ts:45"
193
- 2. CTX analyzes error pattern
194
- 3. If safe pattern (null check, import, etc.):
195
- → Auto-generates fix
196
- → Runs tests
197
- → Creates PR
198
- → Notifies team
199
- 4. If complex pattern:
200
- → Creates fix story
201
- → Assigns priority
202
- → Provides context
203
- ```
204
-
205
- Supports: Sentry, LogRocket, Bugsnag, Datadog
206
-
207
- ### Voice Control
208
- Speak your requirements instead of typing:
209
-
210
- ```bash
211
- /ctx voice # Start voice input
212
- /ctx voice --continuous # Always listening
213
- /ctx voice --dictate # Long-form input
214
- ```
215
-
216
- ```
217
- [VOICE] 🎤 Listening...
218
-
219
- User: "Create a story for user authentication
220
- with email login and forgot password"
221
-
222
- [VOICE] Story created:
223
-
224
- Title: User Authentication
225
- Criteria:
226
- ✓ User can login with email/password
227
- ✓ Forgot password sends reset email
228
- ✓ Session persists across browser
229
-
230
- Add to PRD? [Y/n/edit]
231
- ```
232
-
233
- Supports: macOS Speech, Whisper (local), Google Speech, Azure
234
-
235
- ---
236
-
237
- ## From 3.2
238
-
239
- ### Milestone Workflow
240
- Full release management with audit, archive, and git tagging:
241
- ```bash
242
- /ctx milestone # Show current milestone status
243
- /ctx milestone list # List all milestones
244
- /ctx milestone audit # Verify milestone complete
245
- /ctx milestone complete # Archive and create git tag
246
- /ctx milestone new v2.0 # Start next version
247
- /ctx milestone gaps # Generate fix phases for failures
248
- ```
249
-
250
- Features:
251
- - Archive phases to `.ctx/archive/v{version}/`
252
- - Auto-create git tags on complete
253
- - Gap analysis for incomplete milestones
254
- - Integration with Linear/Jira/GitHub
255
-
256
- ### Team Collaboration
257
- Multiple developers working with CTX on same repo:
258
- ```
259
- [TEAM] Current Activity
260
-
261
- Active:
262
- alice: T001 - User authentication (10m)
263
- bob: T003 - API endpoints (waiting for T001)
264
-
265
- Available:
266
- charlie: idle
267
- ```
107
+ ### Persistent Debugging
108
+ Debug sessions survive context resets, `/clear`, and days between attempts:
268
109
 
269
- Features:
270
- - **File locking** - Prevent conflicts during execution
271
- - **Lock expiry** - Auto-release after 1 hour
272
- - **Conflict detection** - Fail fast on overlaps
273
- - **Team notifications** - Slack/Discord on phase complete
274
- - **Branch strategy** - Auto-create feature branches
275
-
276
- ### Audit Trail (SOC2/HIPAA Compliance)
277
- Complete traceability for enterprise:
278
110
  ```bash
279
- /ctx audit # Show today's summary
280
- /ctx audit week # Weekly summary
281
- /ctx audit export # Generate compliance report
282
- ```
283
-
284
- Every action logged:
285
- ```json
286
- {
287
- "timestamp": "2024-01-20T09:30:00Z",
288
- "action": "execute",
289
- "story": "S001",
290
- "agent": "ctx-executor",
291
- "model": "claude-sonnet-4",
292
- "tokens": {"input": 5000, "output": 2000},
293
- "filesModified": ["src/auth/login.ts"],
294
- "decisions": ["Use JWT for auth"],
295
- "commit": "abc1234"
296
- }
111
+ /ctx debug "checkout fails" # Start debug session
112
+ /ctx debug --resume # Resume where you left off
113
+ /ctx debug --list # Show all sessions
297
114
  ```
298
115
 
299
- Compliance features:
300
- - Access logging (who read what)
301
- - Decision tracking (with rationale)
302
- - Change log (all modifications)
303
- - Retention policies (90d daily, 1y weekly)
304
- - SOC2, HIPAA, GDPR modes
305
-
306
- ### Metrics Dashboard
307
- Understand AI productivity impact:
308
- ```bash
309
- /ctx metrics # Overview dashboard
310
- /ctx metrics cost # Cost analysis
311
- /ctx metrics export # Export HTML dashboard
312
- ```
313
-
314
- ```
315
- ╔══════════════════════════════════════════════════════════╗
316
- ║ CTX METRICS - Week 3 ║
317
- ╠══════════════════════════════════════════════════════════╣
318
- ║ Stories/Week: 8 (+2) Total Cost: $4.87 ║
319
- ║ Time/Story: 1h 45m Per Story: $0.61 ║
320
- ║ Debug Loops: 12 Success Rate: 92% ║
321
- ║ ║
322
- ║ ROI: 30x (24 hours saved, $145 net savings) ║
323
- ╚══════════════════════════════════════════════════════════╝
324
- ```
325
-
326
- Metrics tracked:
327
- - Stories completed per day/week
328
- - Average time per story
329
- - Token usage by phase/model
330
- - Cost analysis with ROI
331
- - Debug loop frequency
332
- - Verification success rate
333
- - Human intervention rate
334
-
335
- ---
116
+ - Scientific method: observe, hypothesize, test, analyze
117
+ - Max 10 attempts before escalation with full report
118
+ - Browser verification with stored credentials
119
+ - Every hypothesis and result recorded in `.ctx/debug/sessions/`
336
120
 
337
- ## From 3.1
121
+ ### Smart Context Handoff
122
+ Seamless transitions at context limits:
338
123
 
339
- ### Intelligent Task Parallelization
340
- Tasks without dependencies run simultaneously:
341
- ```
342
- Wave 1: [T001, T003] Parallel (no deps)
343
- Wave 2: [T002] → After T001
344
- Wave 3: [T004] → After T002
124
+ | Threshold | Action |
125
+ |-----------|--------|
126
+ | 40% | Prepare handoff notes |
127
+ | 50% | Write HANDOFF.md, warn |
128
+ | 60% | Spawn fresh agent |
345
129
 
346
- Result: 40% faster execution
347
- ```
130
+ Zero information loss. Work continues automatically.
348
131
 
349
- ### Pre-Commit Review (ctx-reviewer)
132
+ ### Pre-Commit Review
350
133
  Catches errors BEFORE they're committed:
351
- - Type errors (TypeScript, Python, Go)
352
- - Unresolved imports
353
- - Circular dependencies
354
- - Security vulnerabilities
355
- - Empty catch blocks, console.logs
356
-
357
- ```
358
- [CTX] Pre-Commit Review
359
- ✅ Types: Pass
360
- ✅ Imports: Pass
361
- ⚠️ Medium: 2 console.log statements
362
- ❌ Critical: SQL injection risk at line 45
363
-
364
- Status: BLOCKED - Fix critical issue
365
- ```
134
+ - Type errors, unresolved imports, circular dependencies
135
+ - Security vulnerabilities, empty catch blocks
136
+ - Blocks on critical issues, warns on medium
366
137
 
367
138
  ### Acceptance Criteria Auto-Generation
368
- AI suggests comprehensive criteria:
139
+ AI suggests comprehensive criteria before implementation starts:
369
140
  ```
370
141
  Story: "Add user authentication"
371
142
 
@@ -379,32 +150,6 @@ Suggested Criteria:
379
150
  [A] Accept all [B] See more [C] Edit
380
151
  ```
381
152
 
382
- ### Smart Context Handoff
383
- Seamless transitions at context limits:
384
-
385
- | Threshold | Action |
386
- |-----------|--------|
387
- | 40% | Prepare handoff notes |
388
- | 50% | Write HANDOFF.md, warn |
389
- | 60% | Spawn fresh agent |
390
-
391
- Zero information loss. Work continues automatically.
392
-
393
- ### Issue Tracker Integration
394
- Sync with Linear, Jira, or GitHub Issues:
395
- ```bash
396
- /ctx integrate linear # Setup Linear
397
- /ctx integrate jira # Setup Jira
398
- /ctx integrate github # Setup GitHub Issues
399
- /ctx integrate --sync # Force sync all stories
400
- ```
401
-
402
- Features:
403
- - Bidirectional story sync
404
- - Status mapping (CTX → tracker)
405
- - Auto-close on verify pass
406
- - Comment on verify fail
407
-
408
153
  ---
409
154
 
410
155
  ## From 3.0
@@ -512,7 +257,7 @@ Results synthesized into `SUMMARY.md`.
512
257
 
513
258
  ## Why CTX?
514
259
 
515
- | Feature | Aider | GSD | CTX 3.0 |
260
+ | Feature | Aider | GSD | CTX 3.5 |
516
261
  |---------|-------|-----|---------|
517
262
  | Repository Map | Yes | No | **Yes** |
518
263
  | Discussion Phase | No | Yes | **Yes** |
@@ -524,7 +269,7 @@ Results synthesized into `SUMMARY.md`.
524
269
  | Design System | No | No | **Yes** |
525
270
  | Browser Verification | No | No | **Yes** |
526
271
 
527
- **CTX 3.0 combines the best of Aider and GSD.**
272
+ **CTX 3.5 combines the best of Aider and GSD.**
528
273
 
529
274
  ---
530
275
 
@@ -851,6 +596,6 @@ MIT
851
596
 
852
597
  **[GitHub](https://github.com/jufjuf/CTX)** · **[Issues](https://github.com/jufjuf/CTX/issues)** · **[npm](https://www.npmjs.com/package/ctx-cc)**
853
598
 
854
- *CTX 3.3 - Conversational-first. Just describe what you want. 21 agents. Learning system. Self-healing.*
599
+ *CTX 3.5 - Conversational-first. Just describe what you want. 21 specialized agents. PRD-driven development.*
855
600
 
856
601
  </div>
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: ctx-arch-mapper
3
- description: Architecture mapper for CTX 3.0. Analyzes patterns, data flow, modules, and entry points. Part of parallel codebase mapping.
3
+ description: Architecture mapper for CTX 4.0. Analyzes patterns, data flow, modules, and entry points. Part of parallel codebase mapping.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- color: purple
5
+ model: haiku
6
+ maxTurns: 15
7
+ memory: project
6
8
  ---
7
9
 
8
10
  <role>
9
- You are a CTX 3.0 architecture mapper. You analyze:
11
+ You are a CTX 3.5 architecture mapper. You analyze:
10
12
  - Architectural patterns (MVC, hexagonal, microservices, etc.)
11
13
  - Data flow and state management
12
14
  - Module structure and boundaries
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: ctx-auditor
3
- description: Audit trail agent for CTX 3.2. Provides complete traceability for SOC2, HIPAA, and enterprise compliance requirements.
3
+ description: Audit trail agent for CTX 4.0. Provides complete traceability for SOC2, HIPAA, and enterprise compliance requirements.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- color: gray
5
+ model: haiku
6
+ maxTurns: 15
7
+ memory: project
6
8
  ---
7
9
 
8
10
  <role>
9
- You are a CTX 3.2 auditor. You maintain:
11
+ You are a CTX 3.5 auditor. You maintain:
10
12
  - Complete action logs for all CTX operations
11
13
  - Token usage and cost tracking
12
14
  - Decision audit trail
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: ctx-concerns-mapper
3
- description: Concerns mapper for CTX 3.0. Analyzes security vulnerabilities, tech debt, performance issues, and risks. Part of parallel codebase mapping.
3
+ description: Concerns mapper for CTX 4.0. Analyzes security vulnerabilities, tech debt, performance issues, and risks. Part of parallel codebase mapping.
4
4
  tools: Read, Write, Bash, Glob, Grep
5
- color: red
5
+ model: haiku
6
+ maxTurns: 15
7
+ memory: project
6
8
  ---
7
9
 
8
10
  <role>
9
- You are a CTX 3.0 concerns mapper. You analyze:
11
+ You are a CTX 3.5 concerns mapper. You analyze:
10
12
  - Security vulnerabilities and risks
11
13
  - Technical debt and legacy code
12
14
  - Performance bottlenecks
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: ctx-criteria-suggester
3
- description: Acceptance criteria auto-generation agent for CTX 3.1. Analyzes story descriptions and suggests comprehensive acceptance criteria based on patterns, best practices, and codebase context.
3
+ description: Acceptance criteria auto-generation agent for CTX 4.0. Analyzes story descriptions and suggests comprehensive acceptance criteria based on patterns, best practices, and codebase context.
4
4
  tools: Read, Bash, Glob, Grep, WebSearch
5
- color: purple
5
+ model: sonnet
6
+ maxTurns: 25
7
+ memory: project
6
8
  ---
7
9
 
8
10
  <role>
9
- You are a CTX 3.1 criteria suggester. Your job is to:
11
+ You are a CTX 3.5 criteria suggester. Your job is to:
10
12
  1. Analyze story title and description
11
13
  2. Research common patterns for the feature type
12
14
  3. Suggest comprehensive acceptance criteria
@@ -25,7 +27,7 @@ You help users define "done" before implementation starts.
25
27
  - Missing criteria discovered during implementation
26
28
  - Scope creep, rework, frustration
27
29
 
28
- **CTX 3.1 approach**:
30
+ **CTX 3.5 approach**:
29
31
  - User writes story: "Add user authentication"
30
32
  - CTX suggests 8-10 comprehensive criteria
31
33
  - User reviews and adjusts
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: ctx-debugger
3
- description: Debug agent for CTX 3.0 with PERSISTENT state across sessions. Loops until 100% fixed. Uses stored credentials for autonomous browser testing. State survives context resets and session changes.
3
+ description: Debug agent for CTX 4.0 with PERSISTENT state across sessions. Loops until 100% fixed. Uses stored credentials for autonomous browser testing. State survives context resets and session changes.
4
4
  tools: Read, Write, Edit, Bash, Glob, Grep, mcp__playwright__*, mcp__chrome-devtools__*
5
- color: red
5
+ model: sonnet
6
+ maxTurns: 75
7
+ memory: project
6
8
  ---
7
9
 
8
10
  <role>
9
- You are a CTX 3.0 debugger with **persistent memory**.
11
+ You are a CTX 3.5 debugger with **persistent memory**.
10
12
 
11
13
  Your debug sessions survive:
12
14
  - Context window resets