ctx-cc 4.1.0 → 4.1.1

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.
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: ctx:cross-review
3
+ description: On-demand cross-model code review via OpenAI Codex. Works in any project.
4
+ argument-hint: [commit-range] [--focus=area]
5
+ ---
6
+
7
+ <objective>
8
+ Dispatch the current diff to OpenAI Codex (GPT-5.x) via MCP for adversarial cross-model review. Catches bugs Claude's same-model review tends to miss — different training data, different blind spots.
9
+
10
+ Wraps the `ctx-codex-reviewer` agent with the same skip logic and threadId carryforward used by Stage 3 of the CTX review gate, but invocable on demand from any Claude Code project (not just CTX-managed ones).
11
+ </objective>
12
+
13
+ <usage>
14
+ ```
15
+ /ctx:cross-review # review staged + unstaged diff
16
+ /ctx:cross-review HEAD~3..HEAD # review last 3 commits
17
+ /ctx:cross-review --focus=security # review with focus area hint
18
+ /ctx:cross-review HEAD~1 --focus=concurrency
19
+ ```
20
+
21
+ Argument parsing (lenient — any order):
22
+ - A git revision range (e.g. `HEAD~3..HEAD`, `main..HEAD`, `<sha1>..<sha2>`) selects what to review. If absent, defaults to `git diff` (working tree).
23
+ - `--focus=<area>` hints Codex to weight specific concerns (security, perf, concurrency, error-handling, contract).
24
+ - Bare positional after a range is treated as commentary appended to the prompt.
25
+ </usage>
26
+
27
+ <prerequisites>
28
+ This command is a no-op without the Codex MCP. If `mcp__codex__codex` is not registered, the agent will return `VERDICT: SKIP` and tell the user how to set it up:
29
+
30
+ ```bash
31
+ # One-time setup:
32
+ codex login # ChatGPT Plus auth
33
+ claude mcp add codex -- codex mcp-server # register MCP
34
+ ```
35
+
36
+ Do NOT block the command on missing MCP — surface the SKIP reason and suggest the install commands.
37
+ </prerequisites>
38
+
39
+ <workflow>
40
+
41
+ ## Step 1: Resolve scope
42
+
43
+ Parse `$ARGUMENTS`:
44
+ - Extract any token matching `<rev>..<rev>` or `<sha>~N` as the range.
45
+ - Extract `--focus=<area>` as a hint string.
46
+ - Treat remaining text as freeform commentary.
47
+
48
+ If no range, default: `git diff` (staged + unstaged).
49
+ If range given, the agent will use `git diff <range>`.
50
+
51
+ ## Step 2: Detect CTX context (optional)
52
+
53
+ ```bash
54
+ [ -f .ctx/STATE.json ] && jq -r '.activeStory // "none"' .ctx/STATE.json
55
+ ```
56
+
57
+ If a CTX story is active, include it in the prompt so the agent can pull acceptance criteria from `.ctx/PRD.json`. If not, skip — review still works against raw diff.
58
+
59
+ ## Step 3: Spawn the cross-reviewer agent
60
+
61
+ ```
62
+ Task:
63
+ subagent_type: "ctx-codex-reviewer"
64
+ prompt: |
65
+ On-demand cross-model review (not part of an automated review gate).
66
+
67
+ Scope: {{range or "working tree (staged + unstaged)"}}
68
+ Focus: {{--focus value or "general — bugs, security, contracts"}}
69
+ Story: {{.activeStory or "n/a — not a CTX project"}}
70
+ Notes: {{freeform commentary or empty}}
71
+
72
+ Run your standard playbook:
73
+ 1. Gather the diff for the scope above.
74
+ 2. Apply skip short-circuits (docs-only, test-only, <20 LOC).
75
+ 3. Dispatch via mcp__codex__codex.
76
+ 4. Parse verdict.
77
+
78
+ Output format (final line MUST be one of):
79
+ VERDICT: PASS
80
+ VERDICT: FAIL
81
+ VERDICT: SKIP
82
+
83
+ Append `THREAD: <id>` if a Codex thread was opened.
84
+ description: "Cross-model review"
85
+ ```
86
+
87
+ ## Step 4: Render the verdict to the user
88
+
89
+ After the agent returns:
90
+
91
+ ```
92
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
93
+ CTX ► CROSS-REVIEW
94
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
95
+ ```
96
+
97
+ For each verdict:
98
+
99
+ - `PASS`: green checkmark, "Codex found no issues in {{scope}}."
100
+ - `FAIL`: red X, list the issues by `file:line — description`. Group by severity if Codex provided it.
101
+ - `SKIP`: muted ○, surface the skip reason verbatim. If reason is "MCP unavailable" or "auth expired", include the install commands from `<prerequisites>`.
102
+
103
+ If the agent emitted `THREAD: <id>`, mention it for follow-ups:
104
+ ```
105
+ Follow up with: ask Codex to expand on issue 2 in thread <id>
106
+ ```
107
+
108
+ ## Step 5: Optionally persist (CTX projects only)
109
+
110
+ If `.ctx/` exists, write the result alongside Stage 3 reviews:
111
+
112
+ ```
113
+ .ctx/reviews/cross-review-{{ISO-timestamp}}.json
114
+ {
115
+ "command": "/ctx:cross-review",
116
+ "scope": "{{range or working-tree}}",
117
+ "focus": "{{focus or null}}",
118
+ "verdict": "PASS|FAIL|SKIP",
119
+ "issues": [...],
120
+ "threadId": "..."
121
+ }
122
+ ```
123
+
124
+ If not in a CTX project, just print and exit — no file output.
125
+
126
+ </workflow>
127
+
128
+ <guardrails>
129
+ - Never fail on infra problems. Codex MCP missing, auth expired, or rate-limited → SKIP with actionable message, not error.
130
+ - Never call Codex on docs-only, test-only, or sub-20-LOC diffs (the agent enforces this; do not override).
131
+ - Rate-limit aware: the user's ChatGPT Plus quota is shared with everything else they use Codex for. One invocation = one message against the 5h window. Do not retry on transient failures.
132
+ - Read-only sandbox: the agent uses `sandbox: read-only` when calling Codex. Do not pass arguments that would change this.
133
+ </guardrails>
134
+
135
+ <comparison>
136
+ | When to use what | Tool |
137
+ |---|---|
138
+ | On-demand cross-review of current changes (any project) | `/ctx:cross-review` (this command) |
139
+ | Story-scoped review inside CTX gate (auto, every story) | Stage 3 of `runReviewGate` (no command — fires on its own) |
140
+ | Direct same-model review without Codex | `/ctx:verify` or `/ctx:quick` |
141
+ | Just want to send a single prompt to Codex (not review) | `/codex` (if installed) |
142
+ </comparison>
package/commands/help.md CHANGED
@@ -115,6 +115,7 @@ Or use commands directly:
115
115
  | `/ctx plan [goal]` | Force research + planning |
116
116
  | `/ctx verify` | Force three-level verification |
117
117
  | `/ctx quick "task"` | Quick task bypass |
118
+ | `/ctx cross-review [range] [--focus=area]` | On-demand Codex cross-model review (any project) |
118
119
 
119
120
  ### Debug
120
121
  | Command | Purpose |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ctx-cc",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "CTX 4.0 — Intelligent workflow orchestration for Claude Code. 26 subagents, 7 skills, deterministic hooks. Phase-based lifecycle with autonomous execution.",
5
5
  "keywords": [
6
6
  "claude",