ctx-cc 3.3.3 → 3.3.5
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 +10 -1
- package/agents/ctx-qa.md +955 -0
- package/commands/ctx.md +240 -22
- package/commands/help.md +24 -1
- package/commands/qa.md +625 -0
- package/package.json +1 -1
package/commands/ctx.md
CHANGED
|
@@ -1,16 +1,137 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ctx
|
|
3
|
-
description: Smart router -
|
|
3
|
+
description: Smart router - understands natural language, detects intent, and guides users from first prompt. No commands to memorize.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<objective>
|
|
7
|
-
CTX
|
|
7
|
+
CTX Smart Router - Conversational-first workflow orchestration.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Users don't need to know commands.** They just describe what they want, and CTX routes to the right workflow automatically.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
User: "I want to build a todo app" → Routes to init
|
|
13
|
+
User: "Fix the login bug" → Routes to debug
|
|
14
|
+
User: "Is my app accessible?" → Routes to QA
|
|
15
|
+
User: "What should I do next?" → Shows status + recommendation
|
|
16
|
+
```
|
|
10
17
|
</objective>
|
|
11
18
|
|
|
12
19
|
<workflow>
|
|
13
|
-
|
|
20
|
+
|
|
21
|
+
## Step 0: Intent Detection (ALWAYS RUNS FIRST)
|
|
22
|
+
|
|
23
|
+
Before checking state, parse the user's natural language request.
|
|
24
|
+
|
|
25
|
+
### Intent Patterns
|
|
26
|
+
|
|
27
|
+
| User Says | Detected Intent | Route To |
|
|
28
|
+
|-----------|-----------------|----------|
|
|
29
|
+
| "build", "create", "make", "start new", "I want to..." | `new-project` | /ctx:init |
|
|
30
|
+
| "fix", "bug", "broken", "not working", "error" | `debug` | /ctx:debug |
|
|
31
|
+
| "test", "QA", "check", "accessible", "works?" | `qa` | /ctx:qa |
|
|
32
|
+
| "review", "audit", "security", "ready?" | `review` | /ctx:verify |
|
|
33
|
+
| "deploy", "ship", "publish", "release" | `ship` | /ctx:verify → ship |
|
|
34
|
+
| "status", "progress", "where", "what's next" | `status` | /ctx:status |
|
|
35
|
+
| "help", "how", "what can", "commands" | `help` | /ctx:help |
|
|
36
|
+
| "plan", "design", "architect" | `plan` | /ctx:plan |
|
|
37
|
+
| "continue", "next", "go", "do it" | `continue` | (read STATE.md) |
|
|
38
|
+
|
|
39
|
+
### Intent Detection Logic
|
|
40
|
+
|
|
41
|
+
```javascript
|
|
42
|
+
function detectIntent(userMessage) {
|
|
43
|
+
const msg = userMessage.toLowerCase();
|
|
44
|
+
|
|
45
|
+
// New project signals
|
|
46
|
+
if (msg.match(/\b(build|create|make|start|new|want to)\b.*\b(app|project|feature|site|api)\b/)) {
|
|
47
|
+
return 'new-project';
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Debug signals
|
|
51
|
+
if (msg.match(/\b(fix|bug|broken|error|crash|not working|fails?|issue)\b/)) {
|
|
52
|
+
return 'debug';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// QA signals
|
|
56
|
+
if (msg.match(/\b(test|qa|check|accessible|works|validate|verify all)\b/)) {
|
|
57
|
+
return 'qa';
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Review signals
|
|
61
|
+
if (msg.match(/\b(review|audit|security|ready|before deploy)\b/)) {
|
|
62
|
+
return 'review';
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Ship signals
|
|
66
|
+
if (msg.match(/\b(deploy|ship|publish|release|push|launch)\b/)) {
|
|
67
|
+
return 'ship';
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Status signals
|
|
71
|
+
if (msg.match(/\b(status|progress|where|what.?s next|current)\b/)) {
|
|
72
|
+
return 'status';
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Help signals
|
|
76
|
+
if (msg.match(/\b(help|how|what can|commands|guide)\b/)) {
|
|
77
|
+
return 'help';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Continue signals (or no clear intent)
|
|
81
|
+
return 'continue';
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Step 1: Check Project State
|
|
86
|
+
|
|
87
|
+
Check if `.ctx/` folder exists:
|
|
88
|
+
|
|
89
|
+
### If NO `.ctx/` folder (New User)
|
|
90
|
+
|
|
91
|
+
Based on detected intent:
|
|
92
|
+
|
|
93
|
+
| Intent | Action |
|
|
94
|
+
|--------|--------|
|
|
95
|
+
| `new-project` | "Let's set up your project!" → Run /ctx:init flow |
|
|
96
|
+
| `debug` | "Let me understand the codebase first." → Run /ctx:init --existing |
|
|
97
|
+
| `qa` | "I'll analyze the project first." → Run /ctx:map then /ctx:qa |
|
|
98
|
+
| `continue` | Guide user: "What would you like to build or work on?" |
|
|
99
|
+
| `help` | Show quick start guide |
|
|
100
|
+
|
|
101
|
+
**Output for new users:**
|
|
102
|
+
```
|
|
103
|
+
[CTX] Welcome! I see this is a new project.
|
|
104
|
+
|
|
105
|
+
Based on your request, I'll help you {{detected_action}}.
|
|
106
|
+
|
|
107
|
+
{{guided_next_step}}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### If `.ctx/` folder EXISTS
|
|
111
|
+
|
|
112
|
+
Load configuration and state:
|
|
113
|
+
- Read `.ctx/config.json` for profile settings
|
|
114
|
+
- Read `.ctx/STATE.md` for current status
|
|
115
|
+
- Check `.ctx/REPO-MAP.md` for codebase understanding
|
|
116
|
+
|
|
117
|
+
## Step 2: Route Based on Intent + State
|
|
118
|
+
|
|
119
|
+
Combine detected intent with current state:
|
|
120
|
+
|
|
121
|
+
| Intent | State | Action |
|
|
122
|
+
|--------|-------|--------|
|
|
123
|
+
| `new-project` | any | Warn if project exists, offer to add story |
|
|
124
|
+
| `debug` | any | Route to /ctx:debug |
|
|
125
|
+
| `qa` | any | Route to /ctx:qa |
|
|
126
|
+
| `status` | any | Show STATE.md summary |
|
|
127
|
+
| `continue` | initializing | Run research phase |
|
|
128
|
+
| `continue` | discussing | Run discussion phase |
|
|
129
|
+
| `continue` | executing | Execute current task |
|
|
130
|
+
| `continue` | debugging | Resume debug session |
|
|
131
|
+
| `continue` | verifying | Run verification |
|
|
132
|
+
| `continue` | paused | Resume from checkpoint |
|
|
133
|
+
|
|
134
|
+
## Step 3: Load Configuration
|
|
14
135
|
|
|
15
136
|
Read `.ctx/config.json` for:
|
|
16
137
|
- Active profile (quality/balanced/budget)
|
|
@@ -22,20 +143,9 @@ If config.json doesn't exist:
|
|
|
22
143
|
- Copy from templates/config.json
|
|
23
144
|
- Set balanced as default profile
|
|
24
145
|
|
|
25
|
-
## Step
|
|
26
|
-
|
|
27
|
-
Read `.ctx/STATE.md` to understand current situation.
|
|
28
|
-
|
|
29
|
-
If STATE.md doesn't exist:
|
|
30
|
-
- Output: "No CTX project found. Run `/ctx init` to start."
|
|
31
|
-
- Stop.
|
|
146
|
+
## Step 4: Execute Routed Action
|
|
32
147
|
|
|
33
|
-
|
|
34
|
-
- `.ctx/REPO-MAP.md` - Codebase understanding
|
|
35
|
-
- `.ctx/codebase/SUMMARY.md` - Deep codebase analysis
|
|
36
|
-
- `.ctx/phases/{story_id}/CONTEXT.md` - Locked decisions
|
|
37
|
-
|
|
38
|
-
## Step 2: Route Based on State
|
|
148
|
+
Based on routing decision from Step 2:
|
|
39
149
|
|
|
40
150
|
### If status = "initializing"
|
|
41
151
|
Route to: **Research Phase**
|
|
@@ -102,7 +212,7 @@ Route to: **Resume**
|
|
|
102
212
|
3. Set status to previous state
|
|
103
213
|
4. Continue workflow
|
|
104
214
|
|
|
105
|
-
## Step
|
|
215
|
+
## Step 5: Model Selection
|
|
106
216
|
|
|
107
217
|
Based on current action and active profile:
|
|
108
218
|
|
|
@@ -118,7 +228,7 @@ Based on current action and active profile:
|
|
|
118
228
|
|
|
119
229
|
Use Task tool with `model` parameter from routing table.
|
|
120
230
|
|
|
121
|
-
## Step
|
|
231
|
+
## Step 6: Context Budget Check
|
|
122
232
|
|
|
123
233
|
After every action:
|
|
124
234
|
- Calculate context usage
|
|
@@ -127,14 +237,14 @@ After every action:
|
|
|
127
237
|
- If > 60%: Create HANDOFF.md, spawn fresh agent
|
|
128
238
|
- If > 70%: Force checkpoint
|
|
129
239
|
|
|
130
|
-
## Step
|
|
240
|
+
## Step 7: Git-Native Commit
|
|
131
241
|
|
|
132
242
|
If task completed successfully AND config.git.autoCommit = true:
|
|
133
243
|
1. Stage modified files
|
|
134
244
|
2. Create commit with CTX format
|
|
135
245
|
3. Record commit hash in STATE.md
|
|
136
246
|
|
|
137
|
-
## Step
|
|
247
|
+
## Step 8: Update State
|
|
138
248
|
|
|
139
249
|
Always update STATE.md after any action:
|
|
140
250
|
- Current status
|
|
@@ -188,7 +298,33 @@ DELIVERY GUARANTEE LOOP:
|
|
|
188
298
|
</context_budget>
|
|
189
299
|
|
|
190
300
|
<output_format>
|
|
191
|
-
|
|
301
|
+
|
|
302
|
+
## For New Users (no .ctx/ folder)
|
|
303
|
+
|
|
304
|
+
```
|
|
305
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
306
|
+
Welcome to CTX!
|
|
307
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
308
|
+
|
|
309
|
+
I understood: "{{user_request}}"
|
|
310
|
+
|
|
311
|
+
{{intent_response}}
|
|
312
|
+
|
|
313
|
+
{{guided_action}}
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Intent Responses:**
|
|
317
|
+
|
|
318
|
+
| Intent | Response |
|
|
319
|
+
|--------|----------|
|
|
320
|
+
| new-project | "You want to build something new. Let's set it up!" |
|
|
321
|
+
| debug | "You need to fix something. Let me understand the codebase first." |
|
|
322
|
+
| qa | "You want to test the system. I'll analyze the project first." |
|
|
323
|
+
| status | "This is a new project. Would you like to start building?" |
|
|
324
|
+
| help | (Show quick start guide) |
|
|
325
|
+
|
|
326
|
+
## For Existing Projects
|
|
327
|
+
|
|
192
328
|
```
|
|
193
329
|
[CTX] Status: {{status}}
|
|
194
330
|
[CTX] Profile: {{profile}} ({{costTier}})
|
|
@@ -197,4 +333,86 @@ After routing, output:
|
|
|
197
333
|
[CTX] Next: {{next_action}}
|
|
198
334
|
[CTX] Context: {{percent}}% ({{quality}})
|
|
199
335
|
```
|
|
336
|
+
|
|
337
|
+
## Guided Prompts (When Intent Unclear)
|
|
338
|
+
|
|
339
|
+
If user's intent is ambiguous, ask:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
I'm not sure what you'd like to do. Here are your options:
|
|
343
|
+
|
|
344
|
+
"Build something new" → I'll help you start a project
|
|
345
|
+
"Fix a bug" → I'll debug the issue
|
|
346
|
+
"Test the app" → I'll run full QA
|
|
347
|
+
"Show status" → I'll show current progress
|
|
348
|
+
|
|
349
|
+
What would you like to do?
|
|
350
|
+
```
|
|
200
351
|
</output_format>
|
|
352
|
+
|
|
353
|
+
<examples>
|
|
354
|
+
|
|
355
|
+
## Example Conversations
|
|
356
|
+
|
|
357
|
+
### New User - Build Intent
|
|
358
|
+
```
|
|
359
|
+
User: "I want to build a todo app with React"
|
|
360
|
+
|
|
361
|
+
CTX: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
362
|
+
Welcome to CTX!
|
|
363
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
364
|
+
|
|
365
|
+
I understood: "build a todo app with React"
|
|
366
|
+
|
|
367
|
+
You want to build something new. Let's set it up!
|
|
368
|
+
|
|
369
|
+
I'll now:
|
|
370
|
+
1. Create your project structure
|
|
371
|
+
2. Research best practices for React todo apps
|
|
372
|
+
3. Create a plan with clear milestones
|
|
373
|
+
|
|
374
|
+
[Starting project setup...]
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### New User - Fix Intent
|
|
378
|
+
```
|
|
379
|
+
User: "The login is broken"
|
|
380
|
+
|
|
381
|
+
CTX: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
382
|
+
Welcome to CTX!
|
|
383
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
384
|
+
|
|
385
|
+
I understood: "login is broken"
|
|
386
|
+
|
|
387
|
+
You need to fix something. Let me understand the codebase first.
|
|
388
|
+
|
|
389
|
+
I'll now:
|
|
390
|
+
1. Map your codebase structure
|
|
391
|
+
2. Find the login-related code
|
|
392
|
+
3. Start debugging
|
|
393
|
+
|
|
394
|
+
[Analyzing codebase...]
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
### Existing Project - Continue
|
|
398
|
+
```
|
|
399
|
+
User: "continue"
|
|
400
|
+
|
|
401
|
+
CTX: [CTX] Status: executing
|
|
402
|
+
[CTX] Profile: balanced (1x cost)
|
|
403
|
+
[CTX] Story: S002 - User Authentication
|
|
404
|
+
[CTX] Task: 2/3 - Implement login form validation
|
|
405
|
+
[CTX] Action: Executing task...
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
### Existing Project - QA Intent
|
|
409
|
+
```
|
|
410
|
+
User: "is the app accessible?"
|
|
411
|
+
|
|
412
|
+
CTX: [CTX] Detected: QA request (accessibility)
|
|
413
|
+
[CTX] Routing to: /ctx:qa --a11y-only
|
|
414
|
+
|
|
415
|
+
Running WCAG 2.1 AA accessibility audit...
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
</examples>
|
package/commands/help.md
CHANGED
|
@@ -13,10 +13,22 @@ Output ONLY the reference content below. Do NOT add project-specific analysis.
|
|
|
13
13
|
# CTX 3.3 Command Reference
|
|
14
14
|
|
|
15
15
|
**CTX** (Continuous Task eXecution) - Intelligent workflow orchestration for Claude Code.
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
**Conversational-first.** Just describe what you want - no commands to memorize.
|
|
18
|
+
21 agents. Learning system. Predictive planning. Self-healing. Full system QA.
|
|
17
19
|
|
|
18
20
|
## Quick Start
|
|
19
21
|
|
|
22
|
+
**You don't need to memorize commands.** Just tell CTX what you want:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
"I want to build a todo app" → CTX sets up your project
|
|
26
|
+
"Fix the login bug" → CTX starts debugging
|
|
27
|
+
"Is my app accessible?" → CTX runs QA
|
|
28
|
+
"What's next?" → CTX shows status
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or use commands directly:
|
|
20
32
|
```
|
|
21
33
|
1. /ctx init Initialize project + generate PRD.json
|
|
22
34
|
2. /ctx map Build repository map
|
|
@@ -103,6 +115,17 @@ Output ONLY the reference content below. Do NOT add project-specific analysis.
|
|
|
103
115
|
| `/ctx debug --status` | Show current session status |
|
|
104
116
|
| `/ctx debug --abort` | Abort current session |
|
|
105
117
|
|
|
118
|
+
### QA (Full System Testing)
|
|
119
|
+
| Command | Purpose |
|
|
120
|
+
|---------|---------|
|
|
121
|
+
| `/ctx qa` | Full system QA - crawl all pages (WCAG 2.1 AA) |
|
|
122
|
+
| `/ctx qa --pages` | List discovered pages first |
|
|
123
|
+
| `/ctx qa --section "auth"` | QA specific section only |
|
|
124
|
+
| `/ctx qa --a11y-only` | Accessibility audit only |
|
|
125
|
+
| `/ctx qa --visual-only` | Visual regression (mobile/tablet/desktop) |
|
|
126
|
+
| `/ctx qa --resume` | Resume interrupted QA |
|
|
127
|
+
| `/ctx qa --report` | Show last QA report |
|
|
128
|
+
|
|
106
129
|
### Session
|
|
107
130
|
| Command | Purpose |
|
|
108
131
|
|---------|---------|
|