ctx-cc 2.0.0 → 2.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 CHANGED
@@ -1,6 +1,6 @@
1
- # CTX 2.0 - Continuous Task eXecution
1
+ # CTX 2.1 - Continuous Task eXecution
2
2
 
3
- > Smart workflow orchestration for Claude Code. 4 commands. Debug loop until 100% fixed.
3
+ > Smart workflow orchestration for Claude Code. 8 commands. Smart routing. Debug loop until 100% fixed.
4
4
 
5
5
  ## Installation
6
6
 
@@ -15,11 +15,11 @@ 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.0?
18
+ ## Why CTX 2.1?
19
19
 
20
- | Feature | Before | CTX 2.0 |
20
+ | Feature | Before | CTX 2.1 |
21
21
  |---------|--------|---------|
22
- | Commands | 12-27 | **4** |
22
+ | Commands | 12-27 | **8** (organized) |
23
23
  | Router | Manual | **Smart (auto-routing)** |
24
24
  | Debug | Manual | **Loop until 100% fixed** |
25
25
  | Browser Verify | No | **Playwright/DevTools** |
@@ -36,15 +36,39 @@ npx ctx-cc --force # Overwrite existing installation
36
36
 
37
37
  That's it. `/ctx` reads STATE.md and knows what to do next.
38
38
 
39
- ## The 4 Commands
39
+ ## The 8 Commands
40
40
 
41
+ ### Smart (Auto-routing)
41
42
  | Command | Purpose |
42
43
  |---------|---------|
43
- | `/ctx` | Smart router - reads STATE.md, does the right thing |
44
+ | `/ctx` | **Smart router** - reads STATE.md, does the right thing |
44
45
  | `/ctx init` | Initialize project with STATE.md |
45
- | `/ctx quick "task"` | Quick task bypass (skip workflow) |
46
+
47
+ ### Inspect (Read-only)
48
+ | Command | Purpose |
49
+ |---------|---------|
50
+ | `/ctx status` | See current state without triggering action |
51
+
52
+ ### Control (Override)
53
+ | Command | Purpose |
54
+ |---------|---------|
55
+ | `/ctx plan [goal]` | Force research + planning |
56
+ | `/ctx verify` | Force three-level verification |
57
+ | `/ctx quick "task"` | Quick task bypass |
58
+
59
+ ### Session
60
+ | Command | Purpose |
61
+ |---------|---------|
46
62
  | `/ctx pause` | Checkpoint for session resume |
47
63
 
64
+ ### Phase Management
65
+ | Command | Purpose |
66
+ |---------|---------|
67
+ | `/ctx phase list` | Show all phases |
68
+ | `/ctx phase add "goal"` | Add new phase |
69
+ | `/ctx phase next` | Complete current, move to next |
70
+ | `/ctx phase skip` | Skip current phase |
71
+
48
72
  ### Smart Router States
49
73
 
50
74
  | State | What `/ctx` does |
package/bin/ctx.js CHANGED
@@ -19,9 +19,9 @@ if (options.help) {
19
19
  ╚██████╗ ██║ ██╔╝ ██╗
20
20
  ╚═════╝ ╚═╝ ╚═╝ ╚═╝\x1b[0m
21
21
 
22
- \x1b[1mCTX 2.0 - Continuous Task eXecution\x1b[0m
22
+ \x1b[1mCTX 2.1 - Continuous Task eXecution\x1b[0m
23
23
  Smart workflow orchestration for Claude Code.
24
- 4 commands. Debug loop. 100% verified.
24
+ 8 commands. Smart routing. Debug loop.
25
25
 
26
26
  \x1b[1mUsage:\x1b[0m
27
27
  npx ctx-cc [options]
package/commands/help.md CHANGED
@@ -4,58 +4,79 @@ description: Show CTX commands and usage guide
4
4
  ---
5
5
 
6
6
  <objective>
7
- Display the CTX 2.0 command reference.
7
+ Display the CTX 2.1 command reference.
8
8
 
9
9
  Output ONLY the reference content below. Do NOT add project-specific analysis.
10
10
  </objective>
11
11
 
12
12
  <reference>
13
- # CTX 2.0 Command Reference
13
+ # CTX 2.1 Command Reference
14
14
 
15
15
  **CTX** (Continuous Task eXecution) - Smart workflow orchestration for Claude Code.
16
- 4 commands. One smart router. Debug loop until 100% fixed.
16
+ 8 commands. Smart routing. Debug loop until 100% fixed.
17
17
 
18
18
  ## Quick Start
19
19
 
20
20
  ```
21
- 1. /ctx init Initialize project with STATE.md
22
- 2. /ctx Smart router - does the right thing
23
- 3. (repeat until done)
21
+ 1. /ctx init Initialize project
22
+ 2. /ctx Smart router does the right thing
23
+ 3. /ctx status Check progress (read-only)
24
24
  4. /ctx pause Checkpoint when needed
25
25
  ```
26
26
 
27
- That's it. `/ctx` reads STATE.md and knows what to do next.
27
+ ## The 8 Commands
28
28
 
29
- ## The 4 Commands
29
+ ### Smart (Auto-routing)
30
30
 
31
- ### `/ctx`
32
- **The smart router.** Reads STATE.md, does the right action:
31
+ | Command | Purpose |
32
+ |---------|---------|
33
+ | `/ctx` | **Smart router** - reads STATE.md, does the right thing |
34
+ | `/ctx init` | Initialize project with STATE.md |
35
+
36
+ ### Inspect (Read-only)
37
+
38
+ | Command | Purpose |
39
+ |---------|---------|
40
+ | `/ctx status` | See current state without triggering action |
41
+
42
+ ### Control (Override smart router)
43
+
44
+ | Command | Purpose |
45
+ |---------|---------|
46
+ | `/ctx plan [goal]` | Force research + planning |
47
+ | `/ctx verify` | Force three-level verification |
48
+ | `/ctx quick "task"` | Quick task bypass (skip workflow) |
49
+
50
+ ### Session
51
+
52
+ | Command | Purpose |
53
+ |---------|---------|
54
+ | `/ctx pause` | Checkpoint for session resume |
55
+
56
+ ### Phase Management
57
+
58
+ | Command | Purpose |
59
+ |---------|---------|
60
+ | `/ctx phase list` | Show all phases with status |
61
+ | `/ctx phase add "goal"` | Add new phase to roadmap |
62
+ | `/ctx phase next` | Complete current, move to next |
63
+ | `/ctx phase skip` | Skip current phase |
64
+
65
+ ---
66
+
67
+ ## Smart Router States
68
+
69
+ When you run `/ctx`, it reads STATE.md and auto-routes:
33
70
 
34
71
  | State | What happens |
35
72
  |-------|--------------|
36
73
  | initializing | Research + Plan (ArguSeek + ChunkHound) |
37
74
  | executing | Execute current task |
38
- | debugging | Debug loop until 100% fixed |
75
+ | debugging | **Debug loop until 100% fixed** |
39
76
  | verifying | Three-level verification |
40
77
  | paused | Resume from checkpoint |
41
78
 
42
- Just run `/ctx` and it figures out what's needed.
43
-
44
- ### `/ctx init`
45
- Initialize a new project. Creates `.ctx/STATE.md`.
46
-
47
- ### `/ctx quick "task"`
48
- Quick task bypass. Skip the workflow for small fixes.
49
- ```
50
- /ctx quick "fix the button color"
51
- /ctx quick "add console.log for debugging"
52
- ```
53
-
54
- ### `/ctx pause`
55
- Create checkpoint. Safe to close session.
56
- Resume later with `/ctx` - auto-restores in ~2.5k tokens.
57
-
58
- ## Debug Loop (New in 2.0)
79
+ ## Debug Loop
59
80
 
60
81
  When something breaks, CTX enters debug mode:
61
82
 
@@ -65,63 +86,23 @@ Loop (max 5 attempts):
65
86
  2. Form hypothesis
66
87
  3. Apply fix
67
88
  4. Verify (build + tests + browser)
68
- 5. If fixed: done
69
- If not: new hypothesis, try again
89
+ 5. If fixed done
90
+ If not new hypothesis, try again
70
91
  ```
71
92
 
72
93
  **Browser verification for UI:**
73
- - Navigates to affected page
74
- - Checks elements exist
75
- - Takes screenshot proof
76
- - Saves to `.ctx/debug/`
77
-
78
- ## Architecture
79
-
80
- ### STATE.md - Single Source of Truth
81
- ~100 lines. Always accurate. Always read first.
82
-
83
- ```markdown
84
- ## Project
85
- - Name, Stack, Status
86
-
87
- ## Current Phase
88
- - Goal, Progress
89
-
90
- ## Active Task
91
- - What, Status, Attempts
92
-
93
- ## Debug Session (if active)
94
- - Issue, Hypothesis, Attempt count
95
-
96
- ## Context Budget
97
- - Usage %, Quality level
98
- ```
99
-
100
- ### 5 Specialized Agents
94
+ - Playwright or Chrome DevTools
95
+ - Screenshots saved to `.ctx/debug/`
101
96
 
102
- | Agent | When spawned |
103
- |-------|--------------|
104
- | ctx-researcher | status = initializing |
105
- | ctx-planner | after research |
106
- | ctx-executor | status = executing |
107
- | ctx-debugger | status = debugging |
108
- | ctx-verifier | status = verifying |
97
+ ## Three-Level Verification
109
98
 
110
- ### Directory Structure
111
-
112
- ```
113
- .ctx/
114
- ├── STATE.md # Living digest - ALWAYS read first
115
- ├── phases/{id}/ # Phase data
116
- │ ├── RESEARCH.md # ArguSeek + ChunkHound results
117
- │ ├── PLAN.md # 2-3 tasks (atomic)
118
- │ └── VERIFY.md # Three-level verification
119
- ├── checkpoints/ # Auto-checkpoints
120
- ├── debug/ # Debug screenshots
121
- └── memory/ # Decision memory
122
- ```
99
+ | Level | Question | Check |
100
+ |-------|----------|-------|
101
+ | Exists | File on disk? | Glob |
102
+ | Substantive | Real code, not stub? | No TODOs, no placeholders |
103
+ | Wired | Imported and used? | Trace imports |
123
104
 
124
- ## Key Features
105
+ ## Key Design Principles
125
106
 
126
107
  ### Atomic Planning (2-3 Tasks Max)
127
108
  Prevents context degradation. Big work = multiple phases.
@@ -134,11 +115,6 @@ Prevents context degradation. Big work = multiple phases.
134
115
  | Blocking issue | Auto-fix |
135
116
  | Architecture decision | Ask user |
136
117
 
137
- ### Three-Level Verification
138
- 1. **Exists** - File on disk?
139
- 2. **Substantive** - Real code, not stub?
140
- 3. **Wired** - Imported and used?
141
-
142
118
  ### Context Budget
143
119
  | Usage | Quality | Action |
144
120
  |-------|---------|--------|
@@ -146,27 +122,35 @@ Prevents context degradation. Big work = multiple phases.
146
122
  | 30-50% | Good | Continue |
147
123
  | 50%+ | Degrading | Auto-checkpoint |
148
124
 
149
- ## Integrations
125
+ ## 5 Specialized Agents
150
126
 
151
- ### ArguSeek (Web Research)
152
- Auto-runs during planning:
153
- - Best practices
154
- - Security considerations
155
- - Performance patterns
127
+ | Agent | When spawned |
128
+ |-------|--------------|
129
+ | ctx-researcher | During planning (ArguSeek + ChunkHound) |
130
+ | ctx-planner | After research |
131
+ | ctx-executor | During execution |
132
+ | ctx-debugger | When debugging |
133
+ | ctx-verifier | During verification |
134
+
135
+ ## Integrations
156
136
 
157
- ### ChunkHound (Semantic Search)
158
- Auto-runs during planning:
159
- - Find relevant code
160
- - Detect patterns
161
- - Map entry points
137
+ - **ArguSeek**: Web research during planning
138
+ - **ChunkHound**: Semantic code search (`uv tool install chunkhound`)
139
+ - **Playwright/DevTools**: Browser verification for UI
162
140
 
163
- Install: `uv tool install chunkhound`
141
+ ## Directory Structure
164
142
 
165
- ### Browser Verification (Playwright/Chrome DevTools)
166
- Auto-runs during debugging and verification:
167
- - Navigate to pages
168
- - Check elements
169
- - Screenshot proof
143
+ ```
144
+ .ctx/
145
+ ├── STATE.md # Living digest - ALWAYS read first
146
+ ├── phases/{id}/ # Phase data
147
+ │ ├── RESEARCH.md # ArguSeek + ChunkHound results
148
+ │ ├── PLAN.md # 2-3 tasks (atomic)
149
+ │ └── VERIFY.md # Verification report
150
+ ├── checkpoints/ # Auto-checkpoints
151
+ ├── debug/ # Debug screenshots
152
+ └── verify/ # Verification screenshots
153
+ ```
170
154
 
171
155
  ## Updating CTX
172
156
 
@@ -175,5 +159,5 @@ npx ctx-cc --force
175
159
  ```
176
160
 
177
161
  ---
178
- *CTX 2.0 - 4 commands, debug loop, 100% verified*
162
+ *CTX 2.1 - 8 commands, smart routing, debug loop, 100% verified*
179
163
  </reference>
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: ctx:phase
3
+ description: Phase management - list, add, next, skip
4
+ args: subcommand (list|add|next|skip)
5
+ ---
6
+
7
+ <objective>
8
+ Manage project phases explicitly. CRUD operations for the phase roadmap.
9
+ </objective>
10
+
11
+ <usage>
12
+ ```
13
+ /ctx phase list # Show all phases with status
14
+ /ctx phase add "goal" # Add new phase to roadmap
15
+ /ctx phase next # Mark current complete, move to next
16
+ /ctx phase skip # Skip current phase (mark skipped)
17
+ ```
18
+ </usage>
19
+
20
+ <subcommands>
21
+
22
+ ## /ctx phase list
23
+
24
+ Show all phases with their status.
25
+
26
+ **Output:**
27
+ ```
28
+ [CTX Phases]
29
+
30
+ # Status Goal
31
+ ─────────────────────────────────────────
32
+ 1 ✓ complete Set up project structure
33
+ 2 ● current Add user authentication
34
+ 3 ○ pending Implement dashboard
35
+ 4 ○ pending Add API endpoints
36
+
37
+ Current: Phase 2 - Add user authentication
38
+ Progress: 1/3 tasks complete
39
+ ```
40
+
41
+ **Status indicators:**
42
+ - `✓` complete - Phase verified and done
43
+ - `●` current - Currently active phase
44
+ - `○` pending - Not yet started
45
+ - `⊘` skipped - Explicitly skipped
46
+
47
+ ---
48
+
49
+ ## /ctx phase add "goal"
50
+
51
+ Add a new phase to the end of the roadmap.
52
+
53
+ **Process:**
54
+ 1. Generate phase ID (increment)
55
+ 2. Create `.ctx/phases/{id}/` directory
56
+ 3. Update STATE.md with new phase in roadmap
57
+ 4. Do NOT start planning yet (user runs `/ctx plan` when ready)
58
+
59
+ **Output:**
60
+ ```
61
+ [CTX Phase] Added phase {id}
62
+
63
+ Goal: {goal}
64
+ Status: pending
65
+
66
+ Roadmap now has {n} phases.
67
+ Run /ctx plan "{goal}" when ready to plan this phase.
68
+ ```
69
+
70
+ ---
71
+
72
+ ## /ctx phase next
73
+
74
+ Mark current phase complete and move to the next.
75
+
76
+ **Process:**
77
+ 1. Verify current phase is complete (all tasks done)
78
+ 2. If not complete, warn user
79
+ 3. Mark current phase as "complete"
80
+ 4. Set next pending phase as "current"
81
+ 5. Update STATE.md
82
+
83
+ **Output (success):**
84
+ ```
85
+ [CTX Phase] Completed phase {id}: {goal}
86
+
87
+ Moving to phase {next_id}: {next_goal}
88
+ Run /ctx to start planning.
89
+ ```
90
+
91
+ **Output (not ready):**
92
+ ```
93
+ [CTX Phase] Cannot complete phase {id}
94
+
95
+ Remaining tasks:
96
+ - {task_1}
97
+ - {task_2}
98
+
99
+ Run /ctx to continue, or /ctx phase skip to skip.
100
+ ```
101
+
102
+ ---
103
+
104
+ ## /ctx phase skip
105
+
106
+ Skip the current phase without completing it.
107
+
108
+ **Process:**
109
+ 1. Mark current phase as "skipped"
110
+ 2. Log reason (optional prompt)
111
+ 3. Move to next phase
112
+ 4. Update STATE.md
113
+
114
+ **Output:**
115
+ ```
116
+ [CTX Phase] Skipped phase {id}: {goal}
117
+
118
+ Moving to phase {next_id}: {next_goal}
119
+ Run /ctx to start planning.
120
+ ```
121
+
122
+ </subcommands>
123
+
124
+ <state_management>
125
+ Phases are tracked in STATE.md:
126
+
127
+ ```markdown
128
+ ## Phases
129
+ | ID | Status | Goal |
130
+ |----|--------|------|
131
+ | 1 | complete | Set up project structure |
132
+ | 2 | current | Add user authentication |
133
+ | 3 | pending | Implement dashboard |
134
+ ```
135
+
136
+ And in individual directories:
137
+ ```
138
+ .ctx/phases/
139
+ ├── 1/
140
+ │ ├── RESEARCH.md
141
+ │ ├── PLAN.md
142
+ │ └── VERIFY.md
143
+ ├── 2/
144
+ │ ├── RESEARCH.md
145
+ │ └── PLAN.md
146
+ └── 3/
147
+ (empty until planned)
148
+ ```
149
+ </state_management>
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: ctx:plan
3
+ description: Force research + planning phase regardless of current state
4
+ args: goal (optional - new goal to plan for)
5
+ ---
6
+
7
+ <objective>
8
+ Force enter planning mode. Runs research (ArguSeek + ChunkHound) and creates atomic plan.
9
+ Use when you want to explicitly plan rather than let smart router decide.
10
+ </objective>
11
+
12
+ <usage>
13
+ ```
14
+ /ctx plan # Re-plan current phase goal
15
+ /ctx plan "add user auth" # Plan for new goal
16
+ ```
17
+ </usage>
18
+
19
+ <workflow>
20
+ ## Step 1: Validate Project
21
+ If `.ctx/STATE.md` doesn't exist:
22
+ - Error: "No project found. Run /ctx init first."
23
+
24
+ ## Step 2: Determine Goal
25
+ If goal argument provided:
26
+ - Use provided goal
27
+ - Create new phase if needed
28
+
29
+ If no goal argument:
30
+ - Use current phase goal from STATE.md
31
+ - If no current phase, ask user for goal
32
+
33
+ ## Step 3: Research Phase
34
+ Spawn **ctx-researcher** agent:
35
+
36
+ 1. **ArguSeek Research**
37
+ - Best practices for goal
38
+ - Security considerations
39
+ - Common pitfalls
40
+ - Performance patterns
41
+
42
+ 2. **ChunkHound Analysis** (if available)
43
+ - Semantic search for related code
44
+ - Pattern detection
45
+ - Entry point mapping
46
+
47
+ 3. **Output**: `.ctx/phases/{id}/RESEARCH.md`
48
+
49
+ ## Step 4: Planning Phase
50
+ Spawn **ctx-planner** agent:
51
+
52
+ 1. Read RESEARCH.md
53
+ 2. Define verification criteria
54
+ 3. Break into **2-3 atomic tasks** (strict limit)
55
+ 4. Assign execution order
56
+
57
+ Output: `.ctx/phases/{id}/PLAN.md`
58
+
59
+ ## Step 5: Update State
60
+ Update STATE.md:
61
+ - Status: "executing"
62
+ - Current phase: {id}
63
+ - Phase goal: {goal}
64
+ - Total tasks: {count}
65
+ - Completed: 0
66
+ </workflow>
67
+
68
+ <output_format>
69
+ ```
70
+ [CTX Plan] Goal: {goal}
71
+
72
+ Research:
73
+ ArguSeek: {n} findings
74
+ ChunkHound: {n} relevant files
75
+
76
+ Plan Created:
77
+ Tasks: {count} (atomic)
78
+ Files: .ctx/phases/{id}/PLAN.md
79
+
80
+ Tasks:
81
+ 1. {task_1_title}
82
+ 2. {task_2_title}
83
+ 3. {task_3_title} (if exists)
84
+
85
+ Ready to execute. Run /ctx to start.
86
+ ```
87
+ </output_format>
88
+
89
+ <guardrails>
90
+ - Plans are ALWAYS atomic: 2-3 tasks maximum
91
+ - If goal requires more, split into multiple phases
92
+ - Research runs even if ChunkHound unavailable (ArguSeek only)
93
+ </guardrails>
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: ctx:status
3
+ description: Read-only status check - see state without triggering action
4
+ ---
5
+
6
+ <objective>
7
+ Display current project status without triggering any workflow action.
8
+ Pure inspection - read STATE.md and report.
9
+ </objective>
10
+
11
+ <workflow>
12
+ ## Step 1: Check Project Exists
13
+ If `.ctx/STATE.md` doesn't exist:
14
+ ```
15
+ [CTX] No project found. Run /ctx init to start.
16
+ ```
17
+
18
+ ## Step 2: Read State
19
+ Load `.ctx/STATE.md` and extract:
20
+ - Project name and tech stack
21
+ - Current status (initializing/executing/debugging/verifying/paused)
22
+ - Current phase and goal
23
+ - Task progress
24
+ - Debug session info (if active)
25
+ - Context budget usage
26
+
27
+ ## Step 3: Read Phase Data
28
+ If phase exists, also load:
29
+ - `.ctx/phases/{id}/PLAN.md` - task list
30
+ - `.ctx/phases/{id}/RESEARCH.md` - research summary (if exists)
31
+ - `.ctx/phases/{id}/VERIFY.md` - verification results (if exists)
32
+
33
+ ## Step 4: Calculate Metrics
34
+ - Tasks completed vs total
35
+ - Context usage percentage
36
+ - Time since last checkpoint
37
+ </workflow>
38
+
39
+ <output_format>
40
+ ```
41
+ ┌─────────────────────────────────────────┐
42
+ │ CTX Status │
43
+ ├─────────────────────────────────────────┤
44
+ │ Project: {name} │
45
+ │ Stack: {tech_stack} │
46
+ │ Status: {status} │
47
+ └─────────────────────────────────────────┘
48
+
49
+ Phase: {phase_id} - {phase_goal}
50
+ Progress: {completed}/{total} tasks [{progress_bar}]
51
+
52
+ Current Task: {task_name}
53
+ Task Status: {pending|in_progress|blocked|debugging}
54
+
55
+ {If debugging:}
56
+ Debug Session:
57
+ Issue: {debug_issue}
58
+ Attempt: {n}/5
59
+ Last Error: {error_summary}
60
+
61
+ Context Budget:
62
+ Used: {percent}% ({quality_level})
63
+ Action: {continue|checkpoint-soon|checkpoint-now}
64
+
65
+ Last Checkpoint: {timestamp or "none"}
66
+
67
+ Next Action: Run /ctx to {recommended_action}
68
+ ```
69
+ </output_format>
70
+
71
+ <key_principle>
72
+ This command is READ-ONLY. It never:
73
+ - Modifies STATE.md
74
+ - Triggers any agent
75
+ - Starts any workflow action
76
+
77
+ It only inspects and reports.
78
+ </key_principle>
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: ctx:verify
3
+ description: Force three-level verification regardless of current state
4
+ ---
5
+
6
+ <objective>
7
+ Force verification of current phase. Runs three-level check + anti-pattern scan + browser verification.
8
+ Use when you want to verify work before smart router would normally trigger it.
9
+ </objective>
10
+
11
+ <usage>
12
+ ```
13
+ /ctx verify # Verify current phase
14
+ /ctx verify --browser # Force browser verification even for non-UI
15
+ ```
16
+ </usage>
17
+
18
+ <workflow>
19
+ ## Step 1: Validate Project
20
+ If `.ctx/STATE.md` doesn't exist:
21
+ - Error: "No project found. Run /ctx init first."
22
+
23
+ If no current phase:
24
+ - Error: "No phase to verify. Run /ctx plan first."
25
+
26
+ ## Step 2: Load Context
27
+ Read:
28
+ - `.ctx/STATE.md` - current state
29
+ - `.ctx/phases/{id}/PLAN.md` - verification criteria
30
+ - Original phase goal
31
+
32
+ ## Step 3: Three-Level Verification
33
+ Spawn **ctx-verifier** agent:
34
+
35
+ ### Level 1: EXISTS
36
+ For each artifact in plan:
37
+ ```bash
38
+ ls {file_path}
39
+ ```
40
+ - Pass: File found
41
+ - Fail: File missing
42
+
43
+ ### Level 2: SUBSTANTIVE
44
+ Check for stubs/placeholders:
45
+ ```bash
46
+ grep -n "TODO" {file}
47
+ grep -n "not implemented" {file}
48
+ ```
49
+ - Pass: Real, complete code
50
+ - Fail: Stub detected
51
+
52
+ ### Level 3: WIRED
53
+ Trace imports from entry point:
54
+ ```bash
55
+ grep -r "import.*{module}" --include="*.ts"
56
+ ```
57
+ - Pass: Code is imported and used
58
+ - Fail: Orphan code (exists but unused)
59
+
60
+ ## Step 4: Anti-Pattern Scan
61
+ Search for common issues:
62
+ | Pattern | Severity |
63
+ |---------|----------|
64
+ | `// TODO` | Warning |
65
+ | Empty catch blocks | Error |
66
+ | `console.log` (debug) | Warning |
67
+ | Placeholder returns | Error |
68
+
69
+ ## Step 5: Browser Verification (if UI)
70
+ If phase involves UI or `--browser` flag:
71
+
72
+ 1. Navigate to affected page
73
+ 2. Take snapshot
74
+ 3. Check expected elements
75
+ 4. Take screenshot proof
76
+ 5. Save to `.ctx/verify/phase-{id}.png`
77
+
78
+ ## Step 6: Generate Report
79
+ Write `.ctx/phases/{id}/VERIFY.md`
80
+
81
+ ## Step 7: Update State
82
+ Based on results:
83
+ - **PASS**: Log success, ready for next phase
84
+ - **FAIL**: Create fix tasks, set status = "executing"
85
+ </workflow>
86
+
87
+ <output_format>
88
+ ```
89
+ [CTX Verify] Phase: {id} - {goal}
90
+
91
+ Three-Level Check:
92
+ ✓ Exists: {pass}/{total}
93
+ ✓ Substantive: {pass}/{total}
94
+ ✓ Wired: {pass}/{total}
95
+
96
+ Anti-Pattern Scan:
97
+ Warnings: {count}
98
+ Errors: {count}
99
+
100
+ {If browser:}
101
+ Browser Verification:
102
+ URL: {url}
103
+ Status: PASS/FAIL
104
+ Screenshot: .ctx/verify/phase-{id}.png
105
+
106
+ Overall: {PASS / FAIL}
107
+
108
+ {If FAIL:}
109
+ Fixes Required:
110
+ 1. {fix_1}
111
+ 2. {fix_2}
112
+
113
+ {If PASS:}
114
+ Phase verified. Run /ctx to continue.
115
+ ```
116
+ </output_format>
117
+
118
+ <key_principle>
119
+ Verification is STRICT. Better to catch issues now than in production.
120
+ A failing verification saves debugging time later.
121
+ </key_principle>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctx-cc",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "CTX 2.0 (Continuous Task eXecution) - Smart workflow orchestration for Claude Code. 4 commands, debug loop, 100% verified.",
5
5
  "keywords": [
6
6
  "claude",
package/src/install.js CHANGED
@@ -28,9 +28,9 @@ function printBanner() {
28
28
  ╚██████╗ ██║ ██╔╝ ██╗
29
29
  ╚═════╝ ╚═╝ ╚═╝ ╚═╝
30
30
  `));
31
- console.log(` ${bold('CTX 2.0')} ${dim(`v${VERSION}`)}`);
31
+ console.log(` ${bold('CTX 2.1')} ${dim(`v${VERSION}`)}`);
32
32
  console.log(' Continuous Task eXecution for Claude Code.');
33
- console.log(' 4 commands. Debug loop. 100% verified.\n');
33
+ console.log(' 8 commands. Smart routing. Debug loop.\n');
34
34
  }
35
35
 
36
36
  function copyDir(src, dest) {