ctx-cc 2.3.0 → 3.1.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 +369 -223
- package/agents/ctx-arch-mapper.md +296 -0
- package/agents/ctx-concerns-mapper.md +359 -0
- package/agents/ctx-criteria-suggester.md +358 -0
- package/agents/ctx-debugger.md +428 -207
- package/agents/ctx-discusser.md +287 -0
- package/agents/ctx-executor.md +287 -75
- package/agents/ctx-handoff.md +379 -0
- package/agents/ctx-mapper.md +309 -0
- package/agents/ctx-parallelizer.md +351 -0
- package/agents/ctx-quality-mapper.md +356 -0
- package/agents/ctx-reviewer.md +366 -0
- package/agents/ctx-tech-mapper.md +163 -0
- package/commands/ctx.md +94 -19
- package/commands/discuss.md +101 -0
- package/commands/integrate.md +422 -0
- package/commands/map-codebase.md +169 -0
- package/commands/map.md +88 -0
- package/commands/profile.md +131 -0
- package/package.json +2 -2
- package/templates/config.json +210 -0
package/README.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# CTX
|
|
4
|
+
|
|
5
|
+
### Continuous Task eXecution
|
|
6
|
+
|
|
7
|
+
**Intelligent workflow orchestration for Claude Code.**
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/ctx-cc)
|
|
10
|
+
[](https://www.npmjs.com/package/ctx-cc)
|
|
11
|
+
[](https://opensource.org/licenses/MIT)
|
|
12
|
+
[](https://github.com/jufjuf/CTX/stargazers)
|
|
13
|
+
|
|
14
|
+
<img src="./assets/terminal.png" alt="CTX Terminal" width="700">
|
|
15
|
+
|
|
16
|
+
**Task parallelization. Pre-commit review. Criteria auto-generation. Smart handoff. Issue tracker sync.**
|
|
17
|
+
|
|
18
|
+
[Installation](#installation) · [Quick Start](#quick-start) · [New in 3.1](#new-in-31) · [Commands](#commands) · [Why CTX](#why-ctx)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
---
|
|
4
23
|
|
|
5
24
|
## Installation
|
|
6
25
|
|
|
@@ -8,97 +27,230 @@
|
|
|
8
27
|
npx ctx-cc
|
|
9
28
|
```
|
|
10
29
|
|
|
11
|
-
|
|
30
|
+
That's it. CTX installs itself to your Claude Code environment.
|
|
31
|
+
|
|
12
32
|
```bash
|
|
33
|
+
# Options
|
|
13
34
|
npx ctx-cc --global # Install to ~/.claude (default)
|
|
14
35
|
npx ctx-cc --project # Install to .claude in current directory
|
|
15
36
|
npx ctx-cc --force # Overwrite existing installation
|
|
16
37
|
```
|
|
17
38
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
| Feature | Before | CTX 2.3 |
|
|
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** |
|
|
27
|
-
| Commands | 12-27 | **8** (organized) |
|
|
28
|
-
| Router | Manual | **Smart (auto-routing)** |
|
|
29
|
-
| Debug | Manual | **Loop until 100% fixed** |
|
|
30
|
-
| Browser Verify | No | **Playwright/DevTools** |
|
|
31
|
-
| Planning | Any size | **Atomic (2-3 tasks max)** |
|
|
32
|
-
| Resume cost | ~50k tokens | **~2.5k tokens** |
|
|
39
|
+
---
|
|
33
40
|
|
|
34
41
|
## Quick Start
|
|
35
42
|
|
|
36
43
|
```
|
|
37
|
-
1. /ctx init Gather
|
|
38
|
-
2. /ctx
|
|
39
|
-
3. /ctx
|
|
44
|
+
1. /ctx init Gather requirements + credentials + design context
|
|
45
|
+
2. /ctx map Build repository map (existing codebases)
|
|
46
|
+
3. /ctx Autonomous execution with minimal interruption
|
|
40
47
|
```
|
|
41
48
|
|
|
42
49
|
**The Flow:**
|
|
43
50
|
```
|
|
44
|
-
/ctx init →
|
|
51
|
+
/ctx init → /ctx map → /ctx → Autonomous loop → Delivered!
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## New in 3.1
|
|
57
|
+
|
|
58
|
+
### Intelligent Task Parallelization
|
|
59
|
+
Tasks without dependencies run simultaneously:
|
|
60
|
+
```
|
|
61
|
+
Wave 1: [T001, T003] → Parallel (no deps)
|
|
62
|
+
Wave 2: [T002] → After T001
|
|
63
|
+
Wave 3: [T004] → After T002
|
|
64
|
+
|
|
65
|
+
Result: 40% faster execution
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Pre-Commit Review (ctx-reviewer)
|
|
69
|
+
Catches errors BEFORE they're committed:
|
|
70
|
+
- Type errors (TypeScript, Python, Go)
|
|
71
|
+
- Unresolved imports
|
|
72
|
+
- Circular dependencies
|
|
73
|
+
- Security vulnerabilities
|
|
74
|
+
- Empty catch blocks, console.logs
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
[CTX] Pre-Commit Review
|
|
78
|
+
✅ Types: Pass
|
|
79
|
+
✅ Imports: Pass
|
|
80
|
+
⚠️ Medium: 2 console.log statements
|
|
81
|
+
❌ Critical: SQL injection risk at line 45
|
|
82
|
+
|
|
83
|
+
Status: BLOCKED - Fix critical issue
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Acceptance Criteria Auto-Generation
|
|
87
|
+
AI suggests comprehensive criteria:
|
|
88
|
+
```
|
|
89
|
+
Story: "Add user authentication"
|
|
90
|
+
|
|
91
|
+
Suggested Criteria:
|
|
92
|
+
✓ User can register with email/password
|
|
93
|
+
✓ Invalid credentials show error
|
|
94
|
+
✓ Passwords hashed with bcrypt
|
|
95
|
+
✓ Session expires after 24h
|
|
96
|
+
✓ Brute force protection enabled
|
|
97
|
+
|
|
98
|
+
[A] Accept all [B] See more [C] Edit
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Smart Context Handoff
|
|
102
|
+
Seamless transitions at context limits:
|
|
103
|
+
|
|
104
|
+
| Threshold | Action |
|
|
105
|
+
|-----------|--------|
|
|
106
|
+
| 40% | Prepare handoff notes |
|
|
107
|
+
| 50% | Write HANDOFF.md, warn |
|
|
108
|
+
| 60% | Spawn fresh agent |
|
|
109
|
+
|
|
110
|
+
Zero information loss. Work continues automatically.
|
|
111
|
+
|
|
112
|
+
### Issue Tracker Integration
|
|
113
|
+
Sync with Linear, Jira, or GitHub Issues:
|
|
114
|
+
```bash
|
|
115
|
+
/ctx integrate linear # Setup Linear
|
|
116
|
+
/ctx integrate jira # Setup Jira
|
|
117
|
+
/ctx integrate github # Setup GitHub Issues
|
|
118
|
+
/ctx integrate --sync # Force sync all stories
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Features:
|
|
122
|
+
- Bidirectional story sync
|
|
123
|
+
- Status mapping (CTX → tracker)
|
|
124
|
+
- Auto-close on verify pass
|
|
125
|
+
- Comment on verify fail
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## From 3.0
|
|
130
|
+
|
|
131
|
+
### Repository Mapping (like Aider)
|
|
132
|
+
```bash
|
|
133
|
+
/ctx map # Build token-optimized codebase map
|
|
134
|
+
/ctx map --expand # Include call graph (8k tokens)
|
|
135
|
+
/ctx map --refresh # Force full rebuild
|
|
45
136
|
```
|
|
46
137
|
|
|
47
|
-
|
|
138
|
+
Creates `REPO-MAP.md` with symbols, dependencies, and navigation hints.
|
|
48
139
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- **Design context** → Brand personality, inspirations, accessibility needs
|
|
140
|
+
### Discussion Phase (like GSD)
|
|
141
|
+
```bash
|
|
142
|
+
/ctx discuss S001 # Capture decisions BEFORE planning
|
|
143
|
+
/ctx discuss --review # Review locked decisions
|
|
144
|
+
```
|
|
55
145
|
|
|
56
|
-
|
|
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
|
|
146
|
+
Prevents mid-implementation questions by locking decisions in `CONTEXT.md`.
|
|
61
147
|
|
|
62
|
-
|
|
148
|
+
### Model Profiles (Cost Optimization)
|
|
149
|
+
```bash
|
|
150
|
+
/ctx profile # Show current profile
|
|
151
|
+
/ctx profile quality # Best models (Opus everywhere)
|
|
152
|
+
/ctx profile balanced # Smart mix (default)
|
|
153
|
+
/ctx profile budget # Fast models (60% savings)
|
|
154
|
+
```
|
|
63
155
|
|
|
64
|
-
|
|
156
|
+
| Profile | Research | Execute | Verify | Cost |
|
|
157
|
+
|---------|----------|---------|--------|------|
|
|
158
|
+
| quality | Opus | Opus | Sonnet | 3x |
|
|
159
|
+
| balanced | Opus | Sonnet | Haiku | 1x |
|
|
160
|
+
| budget | Sonnet | Sonnet | Haiku | 0.4x |
|
|
65
161
|
|
|
66
|
-
###
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
| brand | ctx-designer | BRAND_KIT.md + W3C tokens |
|
|
71
|
-
| design | ctx-designer | UI components/pages |
|
|
162
|
+
### Git-Native Workflow
|
|
163
|
+
Every completed task auto-commits:
|
|
164
|
+
```
|
|
165
|
+
[CTX] Implement user login endpoint
|
|
72
166
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
- **Option B**: Balanced (recommended)
|
|
77
|
-
- **Option C**: Bold (distinctive)
|
|
167
|
+
Story: S001 - User Authentication
|
|
168
|
+
Criteria: User can log in with credentials
|
|
169
|
+
Files: src/auth/login.ts, src/routes/auth.ts
|
|
78
170
|
|
|
79
|
-
|
|
171
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
80
172
|
```
|
|
81
|
-
|
|
173
|
+
|
|
174
|
+
Configure in `.ctx/config.json`:
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"git": {
|
|
178
|
+
"autoCommit": true,
|
|
179
|
+
"commitPerTask": true
|
|
180
|
+
}
|
|
181
|
+
}
|
|
82
182
|
```
|
|
83
|
-
Each gate requires user approval before proceeding.
|
|
84
183
|
|
|
85
|
-
###
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
| 2.5.8 | 24x24px targets |
|
|
91
|
-
| 3.3.8 | Accessible auth |
|
|
184
|
+
### Persistent Debug State
|
|
185
|
+
Debug sessions survive context resets:
|
|
186
|
+
```bash
|
|
187
|
+
/ctx debug --resume # Continue previous session
|
|
188
|
+
```
|
|
92
189
|
|
|
93
|
-
|
|
190
|
+
State stored in `.ctx/debug/sessions/`:
|
|
191
|
+
- `STATE.json` - Machine-readable progress
|
|
192
|
+
- `TRACE.md` - Human-readable log
|
|
193
|
+
- `hypotheses.json` - All theories tested
|
|
194
|
+
- `screenshots/` - Visual evidence
|
|
94
195
|
|
|
95
|
-
|
|
196
|
+
### Parallel Codebase Analysis
|
|
197
|
+
```bash
|
|
198
|
+
/ctx map-codebase # Full analysis with 4 parallel agents
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Spawns 4 agents simultaneously:
|
|
202
|
+
| Agent | Output | Analyzes |
|
|
203
|
+
|-------|--------|----------|
|
|
204
|
+
| TECH | TECH.md | Languages, frameworks, dependencies |
|
|
205
|
+
| ARCH | ARCH.md | Patterns, data flow, modules |
|
|
206
|
+
| QUALITY | QUALITY.md | Test coverage, lint, type safety |
|
|
207
|
+
| CONCERNS | CONCERNS.md | Security, tech debt, performance |
|
|
208
|
+
|
|
209
|
+
Results synthesized into `SUMMARY.md`.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Why CTX?
|
|
214
|
+
|
|
215
|
+
| Feature | Aider | GSD | CTX 3.0 |
|
|
216
|
+
|---------|-------|-----|---------|
|
|
217
|
+
| Repository Map | Yes | No | **Yes** |
|
|
218
|
+
| Discussion Phase | No | Yes | **Yes** |
|
|
219
|
+
| Model Profiles | Yes | Partial | **Yes** |
|
|
220
|
+
| Git-Native Commits | Yes | No | **Yes** |
|
|
221
|
+
| Persistent Debug | No | Partial | **Yes** |
|
|
222
|
+
| Parallel Analysis | No | Yes | **Yes** |
|
|
223
|
+
| PRD-Driven | No | Yes | **Yes** |
|
|
224
|
+
| Design System | No | No | **Yes** |
|
|
225
|
+
| Browser Verification | No | No | **Yes** |
|
|
226
|
+
|
|
227
|
+
**CTX 3.0 combines the best of Aider and GSD.**
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
## Commands
|
|
96
232
|
|
|
97
233
|
### Smart (Auto-routing)
|
|
98
234
|
| Command | Purpose |
|
|
99
235
|
|---------|---------|
|
|
100
236
|
| `/ctx` | **Smart router** - reads STATE.md, does the right thing |
|
|
101
|
-
| `/ctx init` | Initialize project with STATE.md |
|
|
237
|
+
| `/ctx init` | Initialize project with STATE.md + PRD.json |
|
|
238
|
+
|
|
239
|
+
### Mapping
|
|
240
|
+
| Command | Purpose |
|
|
241
|
+
|---------|---------|
|
|
242
|
+
| `/ctx map` | Build repository map (REPO-MAP.md) |
|
|
243
|
+
| `/ctx map-codebase` | Deep analysis (4 parallel agents) |
|
|
244
|
+
|
|
245
|
+
### Discussion
|
|
246
|
+
| Command | Purpose |
|
|
247
|
+
|---------|---------|
|
|
248
|
+
| `/ctx discuss [story]` | Capture decisions before planning |
|
|
249
|
+
|
|
250
|
+
### Configuration
|
|
251
|
+
| Command | Purpose |
|
|
252
|
+
|---------|---------|
|
|
253
|
+
| `/ctx profile [name]` | Switch model profile (quality/balanced/budget) |
|
|
102
254
|
|
|
103
255
|
### Inspect (Read-only)
|
|
104
256
|
| Command | Purpose |
|
|
@@ -123,206 +275,197 @@ EU markets require EAA 2025 compliance (enforcement: June 28, 2025).
|
|
|
123
275
|
| `/ctx phase list` | Show all phases |
|
|
124
276
|
| `/ctx phase add "goal"` | Add new phase |
|
|
125
277
|
| `/ctx phase next` | Complete current, move to next |
|
|
126
|
-
| `/ctx phase skip` | Skip current phase |
|
|
127
|
-
|
|
128
|
-
### Smart Router States
|
|
129
278
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
279
|
+
### Integration
|
|
280
|
+
| Command | Purpose |
|
|
281
|
+
|---------|---------|
|
|
282
|
+
| `/ctx integrate` | Show integration status |
|
|
283
|
+
| `/ctx integrate linear` | Setup Linear |
|
|
284
|
+
| `/ctx integrate jira` | Setup Jira |
|
|
285
|
+
| `/ctx integrate github` | Setup GitHub Issues |
|
|
286
|
+
| `/ctx integrate --sync` | Sync all stories |
|
|
137
287
|
|
|
138
|
-
|
|
288
|
+
---
|
|
139
289
|
|
|
140
|
-
|
|
290
|
+
## State Machine
|
|
141
291
|
|
|
142
292
|
```
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
3. Apply fix
|
|
147
|
-
4. Verify (build + tests + browser)
|
|
148
|
-
5. If fixed → done
|
|
149
|
-
If not → new hypothesis, try again
|
|
293
|
+
initializing → discussing → executing → verifying → COMPLETE
|
|
294
|
+
↑ ↓
|
|
295
|
+
└── debugging ──┘
|
|
150
296
|
```
|
|
151
297
|
|
|
152
|
-
|
|
153
|
-
- Navigates to affected page
|
|
154
|
-
- Checks elements exist
|
|
155
|
-
- Takes screenshot proof
|
|
156
|
-
- Saves to `.ctx/debug/`
|
|
157
|
-
|
|
158
|
-
## Key Design Principles
|
|
159
|
-
|
|
160
|
-
### Atomic Planning (2-3 Tasks Max)
|
|
161
|
-
Why? Context degradation is real:
|
|
162
|
-
| Context | Quality |
|
|
163
|
-
|---------|---------|
|
|
164
|
-
| 0-30% | Peak |
|
|
165
|
-
| 30-50% | Good |
|
|
166
|
-
| 50%+ | Degrading |
|
|
167
|
-
|
|
168
|
-
Big work = multiple phases, not bigger plans.
|
|
169
|
-
|
|
170
|
-
### 95% Auto-Deviation Handling
|
|
171
|
-
| Trigger | Action |
|
|
172
|
-
|---------|--------|
|
|
173
|
-
| Bug in existing code | Auto-fix |
|
|
174
|
-
| Missing validation | Auto-add |
|
|
175
|
-
| Blocking issue | Auto-fix |
|
|
176
|
-
| Architecture decision | Ask user |
|
|
177
|
-
|
|
178
|
-
### Three-Level Verification
|
|
179
|
-
1. **Exists** - File on disk?
|
|
180
|
-
2. **Substantive** - Real code, not stub?
|
|
181
|
-
3. **Wired** - Imported and used?
|
|
182
|
-
|
|
183
|
-
### STATE.md - Single Source of Truth
|
|
184
|
-
~100 lines. Always accurate. Always read first.
|
|
185
|
-
|
|
186
|
-
## 6 Specialized Agents
|
|
187
|
-
|
|
188
|
-
| Agent | Spawned when |
|
|
298
|
+
| State | What happens |
|
|
189
299
|
|-------|--------------|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
300
|
+
| initializing | Research + Map + Plan |
|
|
301
|
+
| discussing | Capture decisions in CONTEXT.md |
|
|
302
|
+
| executing | Execute with git-native commits |
|
|
303
|
+
| debugging | Persistent debug loop (max 10 attempts) |
|
|
304
|
+
| verifying | Three-level verification |
|
|
305
|
+
| paused | Resume from checkpoint |
|
|
196
306
|
|
|
197
|
-
|
|
307
|
+
---
|
|
198
308
|
|
|
199
|
-
|
|
200
|
-
Auto-runs during planning:
|
|
201
|
-
- Best practices for the goal
|
|
202
|
-
- Security considerations
|
|
203
|
-
- Performance patterns
|
|
309
|
+
## Context Management
|
|
204
310
|
|
|
205
|
-
|
|
206
|
-
Auto-runs during planning:
|
|
207
|
-
- Semantic search for relevant code
|
|
208
|
-
- Pattern detection
|
|
209
|
-
- Entry point mapping
|
|
311
|
+
CTX actively manages context budget:
|
|
210
312
|
|
|
211
|
-
|
|
313
|
+
| Usage | Quality | Action |
|
|
314
|
+
|-------|---------|--------|
|
|
315
|
+
| 0-30% | Peak | Continue |
|
|
316
|
+
| 30-40% | Good | Continue |
|
|
317
|
+
| 40-50% | Good | Prepare handoff notes |
|
|
318
|
+
| 50-60% | Degrading | Auto-checkpoint |
|
|
319
|
+
| 60-70% | Degrading | Create HANDOFF.md |
|
|
320
|
+
| 70%+ | Poor | Force checkpoint |
|
|
212
321
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
-
|
|
216
|
-
-
|
|
217
|
-
-
|
|
322
|
+
Smart handoff creates `HANDOFF.md` with:
|
|
323
|
+
- Completed tasks with commit hashes
|
|
324
|
+
- Current task progress
|
|
325
|
+
- Key decisions made
|
|
326
|
+
- Files modified
|
|
327
|
+
- Next steps
|
|
218
328
|
|
|
219
|
-
|
|
220
|
-
Auto-runs during design stories:
|
|
221
|
-
- Extract design tokens
|
|
222
|
-
- Get component metadata
|
|
223
|
-
- Screenshot references
|
|
329
|
+
---
|
|
224
330
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
-
|
|
331
|
+
## 14 Specialized Agents
|
|
332
|
+
|
|
333
|
+
| Agent | Spawned when | Model (balanced) |
|
|
334
|
+
|-------|--------------|------------------|
|
|
335
|
+
| ctx-mapper | /ctx map | haiku |
|
|
336
|
+
| ctx-tech-mapper | /ctx map-codebase | haiku |
|
|
337
|
+
| ctx-arch-mapper | /ctx map-codebase | haiku |
|
|
338
|
+
| ctx-quality-mapper | /ctx map-codebase | haiku |
|
|
339
|
+
| ctx-concerns-mapper | /ctx map-codebase | haiku |
|
|
340
|
+
| ctx-discusser | status = discussing | sonnet |
|
|
341
|
+
| ctx-researcher | status = initializing | opus |
|
|
342
|
+
| ctx-planner | after research | opus |
|
|
343
|
+
| ctx-executor | status = executing | sonnet |
|
|
344
|
+
| ctx-designer | design stories | sonnet |
|
|
345
|
+
| ctx-debugger | status = debugging | sonnet |
|
|
346
|
+
| ctx-verifier | status = verifying | haiku |
|
|
347
|
+
| ctx-parallelizer | before execution | haiku |
|
|
348
|
+
| ctx-reviewer | before commit | sonnet |
|
|
349
|
+
| ctx-criteria-suggester | during init/discuss | sonnet |
|
|
350
|
+
| ctx-handoff | at context thresholds | haiku |
|
|
351
|
+
|
|
352
|
+
---
|
|
230
353
|
|
|
231
354
|
## Directory Structure
|
|
232
355
|
|
|
233
356
|
```
|
|
234
357
|
.ctx/
|
|
358
|
+
├── config.json # Model profiles, git settings
|
|
235
359
|
├── STATE.md # Living digest - execution state
|
|
236
|
-
├── PRD.json # Requirements contract
|
|
237
|
-
├──
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
│ ├──
|
|
242
|
-
│
|
|
360
|
+
├── PRD.json # Requirements contract
|
|
361
|
+
├── REPO-MAP.md # Token-optimized codebase map
|
|
362
|
+
├── REPO-MAP.json # Structured map data
|
|
363
|
+
├── .env # Test credentials (GITIGNORED)
|
|
364
|
+
├── codebase/ # Deep analysis results
|
|
365
|
+
│ ├── TECH.md
|
|
366
|
+
│ ├── ARCH.md
|
|
367
|
+
│ ├── QUALITY.md
|
|
368
|
+
│ ├── CONCERNS.md
|
|
369
|
+
│ └── SUMMARY.md
|
|
370
|
+
├── phases/{story_id}/
|
|
371
|
+
│ ├── CONTEXT.md # Locked decisions (discussion phase)
|
|
372
|
+
│ ├── RESEARCH.md # ArguSeek results
|
|
373
|
+
│ ├── PLAN.md # Tasks mapped to criteria
|
|
374
|
+
│ └── VERIFY.md # Verification report
|
|
375
|
+
├── debug/
|
|
376
|
+
│ ├── sessions/ # Persistent debug state
|
|
377
|
+
│ └── screenshots/ # Visual proof
|
|
243
378
|
├── checkpoints/ # Auto-checkpoints
|
|
244
|
-
├── debug/ # Debug screenshots
|
|
245
379
|
└── 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
|
|
253
380
|
```
|
|
254
381
|
|
|
255
|
-
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Configuration
|
|
256
385
|
|
|
386
|
+
`.ctx/config.json`:
|
|
257
387
|
```json
|
|
258
388
|
{
|
|
259
|
-
"
|
|
260
|
-
|
|
261
|
-
"
|
|
262
|
-
"
|
|
389
|
+
"activeProfile": "balanced",
|
|
390
|
+
"models": {
|
|
391
|
+
"architect": { "id": "claude-opus-4", "costTier": "high" },
|
|
392
|
+
"default": { "id": "claude-sonnet-4", "costTier": "medium" },
|
|
393
|
+
"fast": { "id": "claude-haiku-4", "costTier": "low" }
|
|
263
394
|
},
|
|
264
|
-
"
|
|
265
|
-
"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
"
|
|
273
|
-
"
|
|
274
|
-
"
|
|
275
|
-
|
|
276
|
-
"tokens/ directory populated"
|
|
277
|
-
],
|
|
278
|
-
"passes": false
|
|
395
|
+
"profiles": {
|
|
396
|
+
"quality": {
|
|
397
|
+
"research": "architect",
|
|
398
|
+
"discussion": "architect",
|
|
399
|
+
"planning": "architect",
|
|
400
|
+
"execution": "architect"
|
|
401
|
+
},
|
|
402
|
+
"balanced": {
|
|
403
|
+
"research": "architect",
|
|
404
|
+
"discussion": "default",
|
|
405
|
+
"planning": "architect",
|
|
406
|
+
"execution": "default"
|
|
279
407
|
},
|
|
280
|
-
{
|
|
281
|
-
"
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
"acceptanceCriteria": [
|
|
285
|
-
"WCAG 2.2 AA compliant",
|
|
286
|
-
"All states implemented"
|
|
287
|
-
],
|
|
288
|
-
"passes": false
|
|
408
|
+
"budget": {
|
|
409
|
+
"research": "default",
|
|
410
|
+
"planning": "default",
|
|
411
|
+
"execution": "default"
|
|
289
412
|
}
|
|
290
|
-
|
|
291
|
-
"
|
|
292
|
-
"
|
|
293
|
-
"
|
|
294
|
-
"totalStories": 2
|
|
413
|
+
},
|
|
414
|
+
"git": {
|
|
415
|
+
"autoCommit": true,
|
|
416
|
+
"commitPerTask": true
|
|
295
417
|
}
|
|
296
418
|
}
|
|
297
419
|
```
|
|
298
420
|
|
|
299
|
-
|
|
300
|
-
When all stories pass, project is complete.
|
|
421
|
+
---
|
|
301
422
|
|
|
302
|
-
##
|
|
423
|
+
## Integrations
|
|
303
424
|
|
|
304
|
-
|
|
425
|
+
### ArguSeek (Web Research)
|
|
426
|
+
Auto-runs during planning for best practices, security, and patterns.
|
|
305
427
|
|
|
428
|
+
### ChunkHound (Semantic Code Search)
|
|
429
|
+
Auto-runs during planning for semantic search and pattern detection.
|
|
306
430
|
```bash
|
|
307
|
-
|
|
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
|
|
431
|
+
uv tool install chunkhound
|
|
314
432
|
```
|
|
315
433
|
|
|
316
|
-
|
|
317
|
-
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
-
|
|
434
|
+
### Browser Verification (Playwright/Chrome DevTools)
|
|
435
|
+
Auto-runs during debugging and verification for visual proof.
|
|
436
|
+
|
|
437
|
+
### Figma MCP (Design Context)
|
|
438
|
+
Auto-runs during design stories for tokens and component metadata.
|
|
439
|
+
|
|
440
|
+
### Gemini Design MCP (Visual Generation)
|
|
441
|
+
Auto-runs during design stories for mockups and UI code.
|
|
442
|
+
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
## Key Principles
|
|
446
|
+
|
|
447
|
+
### 95% Auto-Deviation Handling
|
|
448
|
+
|
|
449
|
+
| Trigger | Action |
|
|
450
|
+
|---------|--------|
|
|
451
|
+
| Bug in existing code | Auto-fix, document in commit |
|
|
452
|
+
| Missing validation | Auto-add, document |
|
|
453
|
+
| Blocking issue | Auto-fix, document |
|
|
454
|
+
| Architecture decision | **Ask user** |
|
|
455
|
+
|
|
456
|
+
### Three-Level Verification
|
|
457
|
+
|
|
458
|
+
| Level | Question | Check |
|
|
459
|
+
|-------|----------|-------|
|
|
460
|
+
| Exists | File on disk? | Glob |
|
|
461
|
+
| Substantive | Real code, not stub? | No TODOs, no placeholders |
|
|
462
|
+
| Wired | Imported and used? | Trace imports |
|
|
321
463
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
-
|
|
325
|
-
|
|
464
|
+
### Atomic Planning
|
|
465
|
+
|
|
466
|
+
Plans limited to 2-3 tasks to prevent context degradation.
|
|
467
|
+
|
|
468
|
+
---
|
|
326
469
|
|
|
327
470
|
## Updating
|
|
328
471
|
|
|
@@ -330,15 +473,18 @@ API_KEY=your-api-key
|
|
|
330
473
|
npx ctx-cc --force
|
|
331
474
|
```
|
|
332
475
|
|
|
476
|
+
---
|
|
477
|
+
|
|
333
478
|
## License
|
|
334
479
|
|
|
335
480
|
MIT
|
|
336
481
|
|
|
337
|
-
|
|
482
|
+
---
|
|
483
|
+
|
|
484
|
+
<div align="center">
|
|
338
485
|
|
|
339
|
-
|
|
340
|
-
- [Issues](https://github.com/jufjuf/CTX/issues)
|
|
486
|
+
**[GitHub](https://github.com/jufjuf/CTX)** · **[Issues](https://github.com/jufjuf/CTX/issues)** · **[npm](https://www.npmjs.com/package/ctx-cc)**
|
|
341
487
|
|
|
342
|
-
|
|
488
|
+
*CTX 3.1 - Task parallelization. Pre-commit review. Smart handoff. Issue tracker sync.*
|
|
343
489
|
|
|
344
|
-
|
|
490
|
+
</div>
|