ctx-cc 1.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/commands/plan.md CHANGED
@@ -1,139 +1,93 @@
1
1
  ---
2
2
  name: ctx:plan
3
- description: Research + Plan a phase automatically with ArguSeek and ChunkHound
4
- args: "<goal>"
3
+ description: Force research + planning phase regardless of current state
4
+ args: goal (optional - new goal to plan for)
5
5
  ---
6
6
 
7
7
  <objective>
8
- Research and plan a phase for the given goal. Automatically uses ArguSeek for web research and ChunkHound for semantic code search.
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.
9
10
  </objective>
10
11
 
11
- <process>
12
-
13
- <step name="validate_init">
14
- Check `.ctx/` exists. If not:
15
- ```
16
- CTX not initialized. Run `/ctx:init` first.
12
+ <usage>
17
13
  ```
18
- </step>
19
-
20
- <step name="create_phase">
21
- Create phase directory:
14
+ /ctx plan # Re-plan current phase goal
15
+ /ctx plan "add user auth" # Plan for new goal
22
16
  ```
23
- .ctx/phases/{phase-id}/
24
- ├── RESEARCH.md
25
- ├── PLAN.md
26
- ├── PROGRESS.md
27
- └── VERIFY.md
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>
28
69
  ```
70
+ [CTX Plan] Goal: {goal}
29
71
 
30
- Generate phase-id from goal (slugified, e.g., "add-user-auth").
31
- </step>
32
-
33
- <step name="research_arguseek">
34
- Generate ArguSeek research queries based on goal and tech stack:
35
-
36
- 1. Best practices for {goal} in {techStack}
37
- 2. Security considerations for {goal}
38
- 3. Common pitfalls when implementing {goal}
39
- 4. Performance optimization for {goal}
40
-
41
- Execute via MCP:
42
- ```
43
- Use mcp__arguseek__research_iteratively with each query
44
- ```
72
+ Research:
73
+ ArguSeek: {n} findings
74
+ ChunkHound: {n} relevant files
45
75
 
46
- Format results into RESEARCH.md.
47
- </step>
76
+ Plan Created:
77
+ Tasks: {count} (atomic)
78
+ Files: .ctx/phases/{id}/PLAN.md
48
79
 
49
- <step name="research_chunkhound">
50
- If ChunkHound is available, search for relevant existing code:
80
+ Tasks:
81
+ 1. {task_1_title}
82
+ 2. {task_2_title}
83
+ 3. {task_3_title} (if exists)
51
84
 
52
- ```bash
53
- chunkhound search "{goal keywords}"
85
+ Ready to execute. Run /ctx to start.
54
86
  ```
87
+ </output_format>
55
88
 
56
- Find:
57
- - Existing implementations to reuse
58
- - Related code patterns
59
- - Entry points to modify
60
- - Files that will be affected
61
-
62
- Add to RESEARCH.md under "## Codebase Analysis".
63
- </step>
64
-
65
- <step name="generate_plan">
66
- Based on research, create PLAN.md:
67
-
68
- ```markdown
69
- # Phase: {goal}
70
-
71
- ## Research Summary
72
- {key findings from ArguSeek + ChunkHound}
73
-
74
- ## Tasks
75
-
76
- ### Task 1: {title}
77
- - **Files:** {files to create/modify}
78
- - **Context estimate:** {small/medium/large}
79
- - **Dependencies:** {other tasks}
80
-
81
- ### Task 2: {title}
82
- ...
83
-
84
- ## Verification Criteria
85
- - [ ] {criterion 1}
86
- - [ ] {criterion 2}
87
-
88
- ## Context Budget
89
- - Estimated total: {percentage}%
90
- - Split point: After Task {n} if needed
91
- ```
92
- </step>
93
-
94
- <step name="verify_plan">
95
- Goal-backward verification:
96
- - "Will these tasks achieve the goal?"
97
- - Check for missing steps
98
- - Validate dependencies
99
- - Ensure verification criteria are testable
100
- </step>
101
-
102
- <step name="present_plan">
103
- Show the plan to user:
104
-
105
- ```
106
- ## Phase Plan: {goal}
107
-
108
- **Tasks:** {count}
109
- **Context estimate:** {percentage}%
110
- **Split recommended:** {yes/no, after task N}
111
-
112
- ### Tasks:
113
- 1. {task 1} ({small/medium/large})
114
- 2. {task 2} ({small/medium/large})
115
- ...
116
-
117
- ### Verification:
118
- - {criterion 1}
119
- - {criterion 2}
120
-
121
- Proceed with `/ctx:do` to execute.
122
- ```
123
- </step>
124
-
125
- </process>
126
-
127
- <output>
128
- Summary of research findings and generated plan with task breakdown.
129
- </output>
130
-
131
- <success_criteria>
132
- - [ ] Phase directory created
133
- - [ ] ArguSeek research executed (if available)
134
- - [ ] ChunkHound search executed (if available)
135
- - [ ] RESEARCH.md written with findings
136
- - [ ] PLAN.md written with tasks
137
- - [ ] Context budget estimated
138
- - [ ] Verification criteria defined
139
- </success_criteria>
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,68 @@
1
+ ---
2
+ name: ctx:quick
3
+ description: Quick task bypass - execute without full workflow
4
+ ---
5
+
6
+ <objective>
7
+ Execute a quick task without the full CTX workflow.
8
+ Use for small fixes, one-off tasks, or urgent work that doesn't need planning.
9
+ </objective>
10
+
11
+ <usage>
12
+ ```
13
+ /ctx:quick "fix the login button styling"
14
+ /ctx:quick "add console.log for debugging"
15
+ /ctx:quick "update the README"
16
+ ```
17
+ </usage>
18
+
19
+ <workflow>
20
+ ## Step 1: Validate Task Size
21
+ Quick tasks should be:
22
+ - Single file or 2-3 files max
23
+ - No architectural decisions
24
+ - < 30 minutes of work
25
+ - Clear, specific outcome
26
+
27
+ If task seems large, suggest: "This looks like a bigger task. Consider `/ctx init` + `/ctx` for proper planning."
28
+
29
+ ## Step 2: Execute Directly
30
+ 1. Understand the task
31
+ 2. Find relevant files
32
+ 3. Make changes
33
+ 4. Verify (build + tests if applicable)
34
+
35
+ ## Step 3: Verify Success
36
+ Run appropriate verification:
37
+ - Build: `npm run build` / `go build` / etc.
38
+ - Tests: Run affected tests
39
+ - Lint: Check for errors
40
+
41
+ If verification fails:
42
+ - Auto-fix if simple (typo, import)
43
+ - Otherwise report issue
44
+
45
+ ## Step 4: Update STATE.md (if exists)
46
+ If `.ctx/STATE.md` exists, log the quick task:
47
+ ```
48
+ ## Quick Tasks Log
49
+ - [timestamp] {{task_description}} - {{status}}
50
+ ```
51
+
52
+ ## Step 5: Output
53
+ Report what was done:
54
+ ```
55
+ [CTX Quick] {{task_description}}
56
+ [CTX Quick] Changed: {{files}}
57
+ [CTX Quick] Verified: {{build/tests status}}
58
+ [CTX Quick] Done.
59
+ ```
60
+ </workflow>
61
+
62
+ <guardrails>
63
+ - Max 3 files changed
64
+ - No database schema changes
65
+ - No API contract changes
66
+ - No new dependencies without asking
67
+ - No refactoring (use full workflow for that)
68
+ </guardrails>
@@ -1,95 +1,78 @@
1
1
  ---
2
2
  name: ctx:status
3
- description: Full status report
3
+ description: Read-only status check - see state without triggering action
4
4
  ---
5
5
 
6
6
  <objective>
7
- Display comprehensive project status including phase, progress, context usage, and todos.
7
+ Display current project status without triggering any workflow action.
8
+ Pure inspection - read STATE.md and report.
8
9
  </objective>
9
10
 
10
- <process>
11
-
12
- <step name="gather_status">
13
- Collect status from all CTX components:
14
-
15
- 1. **Project** - Name, tech stack
16
- 2. **Phase** - Current phase, progress
17
- 3. **Context** - Usage percentage
18
- 4. **Memory** - Fact counts
19
- 5. **Todos** - Pending count
20
- 6. **Integrations** - ArguSeek, ChunkHound status
21
- </step>
22
-
23
- <step name="display">
11
+ <workflow>
12
+ ## Step 1: Check Project Exists
13
+ If `.ctx/STATE.md` doesn't exist:
24
14
  ```
25
- ## CTX Status
26
-
27
- ### Project
28
- **Name:** {project name}
29
- **Tech:** {language} + {framework}
30
- **Initialized:** {date}
31
-
32
- ### Current Phase
33
- **Phase:** {phase name} ({phase number}/{total})
34
- **Goal:** {goal}
35
- **Progress:** {percentage}% ({completed}/{total} tasks)
36
- **Status:** {pending/in_progress/complete}
37
-
38
- ### Context Budget
39
- **Current:** {percentage}%
40
- **Quality:** {Peak/Good/Degrading/Poor}
41
- **Recommendation:** {Continue/Consider checkpoint/Checkpoint now}
42
-
15
+ [CTX] No project found. Run /ctx init to start.
43
16
  ```
44
- {context bar visualization}
45
- [████████████░░░░░░░░] 45%
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>
46
40
  ```
41
+ ┌─────────────────────────────────────────┐
42
+ │ CTX Status │
43
+ ├─────────────────────────────────────────┤
44
+ │ Project: {name} │
45
+ │ Stack: {tech_stack} │
46
+ │ Status: {status} │
47
+ └─────────────────────────────────────────┘
47
48
 
48
- ### Memory
49
- | Tier | Facts |
50
- |------|-------|
51
- | Working | {count} |
52
- | Episodic | {count} |
53
- | Semantic | {count} |
49
+ Phase: {phase_id} - {phase_goal}
50
+ Progress: {completed}/{total} tasks [{progress_bar}]
54
51
 
55
- ### Todos
56
- **Pending:** {count}
57
- **In Progress:** {count}
58
- **Completed:** {count}
52
+ Current Task: {task_name}
53
+ Task Status: {pending|in_progress|blocked|debugging}
59
54
 
60
- ### Integrations
61
- | Tool | Status |
62
- |------|--------|
63
- | ArguSeek | {available/unavailable} |
64
- | ChunkHound | {indexed/not indexed/unavailable} |
55
+ {If debugging:}
56
+ Debug Session:
57
+ Issue: {debug_issue}
58
+ Attempt: {n}/5
59
+ Last Error: {error_summary}
65
60
 
66
- ### Last Checkpoint
67
- **ID:** {id or "None"}
68
- **Created:** {timestamp or "N/A"}
61
+ Context Budget:
62
+ Used: {percent}% ({quality_level})
63
+ Action: {continue|checkpoint-soon|checkpoint-now}
69
64
 
70
- ---
65
+ Last Checkpoint: {timestamp or "none"}
71
66
 
72
- **Quick Actions:**
73
- - Continue work: `/ctx:do`
74
- - Verify phase: `/ctx:verify`
75
- - Save state: `/ctx:pause`
76
- - View phases: `/ctx:phase list`
67
+ Next Action: Run /ctx to {recommended_action}
77
68
  ```
78
- </step>
79
-
80
- </process>
69
+ </output_format>
81
70
 
82
- <context_quality>
83
- | Usage | Quality | Action |
84
- |-------|---------|--------|
85
- | 0-30% | Peak | Continue |
86
- | 30-50% | Good | Continue |
87
- | 50-70% | Degrading | Consider checkpoint |
88
- | 70%+ | Poor | Checkpoint now |
89
- </context_quality>
71
+ <key_principle>
72
+ This command is READ-ONLY. It never:
73
+ - Modifies STATE.md
74
+ - Triggers any agent
75
+ - Starts any workflow action
90
76
 
91
- <success_criteria>
92
- - [ ] All status components displayed
93
- - [ ] Context budget clearly shown
94
- - [ ] Next actions suggested
95
- </success_criteria>
77
+ It only inspects and reports.
78
+ </key_principle>
@@ -1,151 +1,121 @@
1
1
  ---
2
2
  name: ctx:verify
3
- description: Three-level verification of current phase
3
+ description: Force three-level verification regardless of current state
4
4
  ---
5
5
 
6
6
  <objective>
7
- Verify the current phase implementation using three-level verification plus anti-pattern scanning.
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.
8
9
  </objective>
9
10
 
10
- <process>
11
-
12
- <step name="load_phase">
13
- Load current phase from `.ctx/ROADMAP.md`.
14
- Load verification criteria from `.ctx/phases/{phase-id}/PLAN.md`.
15
-
16
- If no phase:
11
+ <usage>
17
12
  ```
18
- No phase to verify. Run `/ctx:plan <goal>` first.
13
+ /ctx verify # Verify current phase
14
+ /ctx verify --browser # Force browser verification even for non-UI
19
15
  ```
20
- </step>
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."
21
25
 
22
- <step name="three_level_verification">
23
- For each artifact in the phase:
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:
24
34
 
25
35
  ### Level 1: EXISTS
36
+ For each artifact in plan:
37
+ ```bash
38
+ ls {file_path}
26
39
  ```
27
- Question: Is the file on disk?
28
- Check: Glob for the file path
29
- Pass: File exists
30
- Fail: File missing
31
- ```
40
+ - Pass: File found
41
+ - Fail: File missing
32
42
 
33
43
  ### Level 2: SUBSTANTIVE
44
+ Check for stubs/placeholders:
45
+ ```bash
46
+ grep -n "TODO" {file}
47
+ grep -n "not implemented" {file}
34
48
  ```
35
- Question: Is it real code, not a stub?
36
- Check:
37
- - No "// TODO" comments in new code
38
- - No empty function bodies
39
- - No placeholder returns (return null, return {})
40
- - No "not implemented" comments
41
- Pass: Real, complete implementation
42
- Fail: Stub or placeholder detected
43
- ```
49
+ - Pass: Real, complete code
50
+ - Fail: Stub detected
44
51
 
45
52
  ### Level 3: WIRED
53
+ Trace imports from entry point:
54
+ ```bash
55
+ grep -r "import.*{module}" --include="*.ts"
46
56
  ```
47
- Question: Is it imported and used?
48
- Check:
49
- - Grep for imports of the file
50
- - Trace call paths from entry points
51
- - Verify the code is reachable
52
- Pass: Connected to the application
53
- Fail: Orphan code (exists but unused)
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>
54
88
  ```
55
- </step>
56
-
57
- <step name="anti_pattern_scan">
58
- Scan for common anti-patterns:
59
-
60
- | Pattern | Search | Severity |
61
- |---------|--------|----------|
62
- | TODO comments | `// TODO`, `# TODO` | Warning |
63
- | Empty catch | `catch.*\{\s*\}` | Error |
64
- | Console-only errors | `console.error` without throw | Warning |
65
- | Placeholder returns | `return null`, `return {}` | Error |
66
- | Hardcoded secrets | API keys, passwords | Critical |
67
- | Debug code | `console.log`, `debugger` | Warning |
68
- </step>
69
-
70
- <step name="goal_gap_analysis">
71
- Check if phase goal is achieved:
72
-
73
- 1. Re-read the original goal
74
- 2. Compare against what was built
75
- 3. Identify any gaps
76
-
77
- ```
78
- Goal: {original goal}
79
- Built: {what was implemented}
80
- Gaps: {missing pieces, if any}
81
- ```
82
- </step>
83
-
84
- <step name="generate_report">
85
- Write `.ctx/phases/{phase-id}/VERIFY.md`:
89
+ [CTX Verify] Phase: {id} - {goal}
86
90
 
87
- ```markdown
88
- # Verification Report
91
+ Three-Level Check:
92
+ Exists: {pass}/{total}
93
+ ✓ Substantive: {pass}/{total}
94
+ ✓ Wired: {pass}/{total}
89
95
 
90
- ## Phase: {name}
91
- ## Date: {timestamp}
96
+ Anti-Pattern Scan:
97
+ Warnings: {count}
98
+ Errors: {count}
92
99
 
93
- ## Three-Level Results
100
+ {If browser:}
101
+ Browser Verification:
102
+ URL: {url}
103
+ Status: PASS/FAIL
104
+ Screenshot: .ctx/verify/phase-{id}.png
94
105
 
95
- | Artifact | Exists | Substantive | Wired | Status |
96
- |----------|--------|-------------|-------|--------|
97
- | {file1} | ✓ | ✓ | ✓ | PASS |
98
- | {file2} | ✓ | ✓ | ✗ | FAIL |
99
-
100
- ## Anti-Pattern Scan
101
-
102
- | Pattern | Count | Files | Severity |
103
- |---------|-------|-------|----------|
104
- | TODO | 2 | auth.ts, login.ts | Warning |
105
-
106
- ## Goal Gap Analysis
107
-
108
- **Goal:** {goal}
109
- **Status:** {Achieved / Partially Achieved / Not Achieved}
110
- **Gaps:** {list or "None"}
111
-
112
- ## Overall: {PASS / FAIL}
113
-
114
- {If FAIL: List what needs to be fixed}
115
- ```
116
- </step>
117
-
118
- <step name="output_summary">
119
- Display verification summary:
120
-
121
- ```
122
- ## Verification: {phase name}
123
-
124
- **Three-Level Check:**
125
- - Exists: {pass/fail count}
126
- - Substantive: {pass/fail count}
127
- - Wired: {pass/fail count}
128
-
129
- **Anti-Patterns:** {count} found
130
- **Goal Gaps:** {count or "None"}
131
-
132
- **Overall:** {PASS ✓ / FAIL ✗}
106
+ Overall: {PASS / FAIL}
133
107
 
134
108
  {If FAIL:}
135
- **Action Required:**
136
- - {list of fixes needed}
109
+ Fixes Required:
110
+ 1. {fix_1}
111
+ 2. {fix_2}
137
112
 
138
113
  {If PASS:}
139
- **Next:** Run `/ctx:phase next` or `/ctx:ship`
114
+ Phase verified. Run /ctx to continue.
140
115
  ```
141
- </step>
142
-
143
- </process>
116
+ </output_format>
144
117
 
145
- <success_criteria>
146
- - [ ] All artifacts checked at three levels
147
- - [ ] Anti-pattern scan completed
148
- - [ ] Goal gap analysis done
149
- - [ ] VERIFY.md written
150
- - [ ] Clear pass/fail determination
151
- </success_criteria>
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,7 +1,7 @@
1
1
  {
2
2
  "name": "ctx-cc",
3
- "version": "1.0.0",
4
- "description": "CTX - Smart Context Management for Claude Code. The GSD Killer.",
3
+ "version": "2.1.0",
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",
7
7
  "claude-code",