@runchr/gstack-antigravity 0.1.0 → 0.1.2
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.
Potentially problematic release.
This version of @runchr/gstack-antigravity might be problematic. Click here for more details.
- package/.agents/skills/gstack/.agents/skills/gstack/SKILL.md +651 -0
- package/.agents/skills/gstack/.agents/skills/gstack-autoplan/SKILL.md +678 -0
- package/.agents/skills/gstack/.agents/skills/gstack-benchmark/SKILL.md +482 -0
- package/.agents/skills/gstack/.agents/skills/gstack-browse/SKILL.md +511 -0
- package/.agents/skills/gstack/.agents/skills/gstack-canary/SKILL.md +486 -0
- package/.agents/skills/gstack/.agents/skills/gstack-careful/SKILL.md +50 -0
- package/.agents/skills/gstack/.agents/skills/gstack-cso/SKILL.md +607 -0
- package/.agents/skills/gstack/.agents/skills/gstack-design-consultation/SKILL.md +615 -0
- package/.agents/skills/gstack/.agents/skills/gstack-design-review/SKILL.md +988 -0
- package/.agents/skills/gstack/.agents/skills/gstack-document-release/SKILL.md +604 -0
- package/.agents/skills/gstack/.agents/skills/gstack-freeze/SKILL.md +67 -0
- package/.agents/skills/gstack/.agents/skills/gstack-guard/SKILL.md +62 -0
- package/.agents/skills/gstack/.agents/skills/gstack-investigate/SKILL.md +415 -0
- package/.agents/skills/gstack/.agents/skills/gstack-land-and-deploy/SKILL.md +873 -0
- package/.agents/skills/gstack/.agents/skills/gstack-office-hours/SKILL.md +986 -0
- package/.agents/skills/gstack/.agents/skills/gstack-plan-ceo-review/SKILL.md +1268 -0
- package/.agents/skills/gstack/.agents/skills/gstack-plan-design-review/SKILL.md +668 -0
- package/.agents/skills/gstack/.agents/skills/gstack-plan-eng-review/SKILL.md +826 -0
- package/.agents/skills/gstack/.agents/skills/gstack-qa/SKILL.md +1006 -0
- package/.agents/skills/gstack/.agents/skills/gstack-qa-only/SKILL.md +626 -0
- package/.agents/skills/gstack/.agents/skills/gstack-retro/SKILL.md +1065 -0
- package/.agents/skills/gstack/.agents/skills/gstack-review/SKILL.md +704 -0
- package/.agents/skills/gstack/.agents/skills/gstack-setup-browser-cookies/SKILL.md +325 -0
- package/.agents/skills/gstack/.agents/skills/gstack-setup-deploy/SKILL.md +450 -0
- package/.agents/skills/gstack/.agents/skills/gstack-ship/SKILL.md +1312 -0
- package/.agents/skills/gstack/.agents/skills/gstack-unfreeze/SKILL.md +36 -0
- package/.agents/skills/gstack/.agents/skills/gstack-upgrade/SKILL.md +220 -0
- package/.agents/skills/gstack/.env.example +5 -0
- package/.agents/skills/gstack/.github/workflows/skill-docs.yml +17 -0
- package/.agents/skills/gstack/AGENTS.md +49 -0
- package/.agents/skills/gstack/ARCHITECTURE.md +359 -0
- package/.agents/skills/gstack/BROWSER.md +271 -0
- package/.agents/skills/gstack/CHANGELOG.md +800 -0
- package/.agents/skills/gstack/CLAUDE.md +284 -0
- package/.agents/skills/gstack/CONTRIBUTING.md +370 -0
- package/.agents/skills/gstack/ETHOS.md +129 -0
- package/.agents/skills/gstack/LICENSE +21 -0
- package/.agents/skills/gstack/README.md +228 -0
- package/.agents/skills/gstack/SKILL.md +657 -0
- package/.agents/skills/gstack/SKILL.md.tmpl +281 -0
- package/.agents/skills/gstack/TODOS.md +564 -0
- package/.agents/skills/gstack/VERSION +1 -0
- package/.agents/skills/gstack/autoplan/SKILL.md +689 -0
- package/.agents/skills/gstack/autoplan/SKILL.md.tmpl +416 -0
- package/.agents/skills/gstack/benchmark/SKILL.md +489 -0
- package/.agents/skills/gstack/benchmark/SKILL.md.tmpl +233 -0
- package/.agents/skills/gstack/bin/dev-setup +68 -0
- package/.agents/skills/gstack/bin/dev-teardown +56 -0
- package/.agents/skills/gstack/bin/gstack-analytics +191 -0
- package/.agents/skills/gstack/bin/gstack-community-dashboard +113 -0
- package/.agents/skills/gstack/bin/gstack-config +38 -0
- package/.agents/skills/gstack/bin/gstack-diff-scope +71 -0
- package/.agents/skills/gstack/bin/gstack-global-discover.ts +591 -0
- package/.agents/skills/gstack/bin/gstack-repo-mode +93 -0
- package/.agents/skills/gstack/bin/gstack-review-log +9 -0
- package/.agents/skills/gstack/bin/gstack-review-read +12 -0
- package/.agents/skills/gstack/bin/gstack-slug +15 -0
- package/.agents/skills/gstack/bin/gstack-telemetry-log +158 -0
- package/.agents/skills/gstack/bin/gstack-telemetry-sync +127 -0
- package/.agents/skills/gstack/bin/gstack-update-check +196 -0
- package/.agents/skills/gstack/browse/SKILL.md +517 -0
- package/.agents/skills/gstack/browse/SKILL.md.tmpl +141 -0
- package/.agents/skills/gstack/browse/bin/find-browse +21 -0
- package/.agents/skills/gstack/browse/bin/remote-slug +14 -0
- package/.agents/skills/gstack/browse/scripts/build-node-server.sh +48 -0
- package/.agents/skills/gstack/browse/src/browser-manager.ts +634 -0
- package/.agents/skills/gstack/browse/src/buffers.ts +137 -0
- package/.agents/skills/gstack/browse/src/bun-polyfill.cjs +109 -0
- package/.agents/skills/gstack/browse/src/cli.ts +420 -0
- package/.agents/skills/gstack/browse/src/commands.ts +111 -0
- package/.agents/skills/gstack/browse/src/config.ts +150 -0
- package/.agents/skills/gstack/browse/src/cookie-import-browser.ts +417 -0
- package/.agents/skills/gstack/browse/src/cookie-picker-routes.ts +207 -0
- package/.agents/skills/gstack/browse/src/cookie-picker-ui.ts +541 -0
- package/.agents/skills/gstack/browse/src/find-browse.ts +61 -0
- package/.agents/skills/gstack/browse/src/meta-commands.ts +269 -0
- package/.agents/skills/gstack/browse/src/platform.ts +17 -0
- package/.agents/skills/gstack/browse/src/read-commands.ts +335 -0
- package/.agents/skills/gstack/browse/src/server.ts +369 -0
- package/.agents/skills/gstack/browse/src/snapshot.ts +398 -0
- package/.agents/skills/gstack/browse/src/url-validation.ts +91 -0
- package/.agents/skills/gstack/browse/src/write-commands.ts +352 -0
- package/.agents/skills/gstack/browse/test/bun-polyfill.test.ts +72 -0
- package/.agents/skills/gstack/browse/test/commands.test.ts +1836 -0
- package/.agents/skills/gstack/browse/test/config.test.ts +250 -0
- package/.agents/skills/gstack/browse/test/cookie-import-browser.test.ts +397 -0
- package/.agents/skills/gstack/browse/test/cookie-picker-routes.test.ts +205 -0
- package/.agents/skills/gstack/browse/test/find-browse.test.ts +50 -0
- package/.agents/skills/gstack/browse/test/fixtures/basic.html +33 -0
- package/.agents/skills/gstack/browse/test/fixtures/cursor-interactive.html +22 -0
- package/.agents/skills/gstack/browse/test/fixtures/dialog.html +15 -0
- package/.agents/skills/gstack/browse/test/fixtures/empty.html +2 -0
- package/.agents/skills/gstack/browse/test/fixtures/forms.html +55 -0
- package/.agents/skills/gstack/browse/test/fixtures/qa-eval-checkout.html +108 -0
- package/.agents/skills/gstack/browse/test/fixtures/qa-eval-spa.html +98 -0
- package/.agents/skills/gstack/browse/test/fixtures/qa-eval.html +51 -0
- package/.agents/skills/gstack/browse/test/fixtures/responsive.html +49 -0
- package/.agents/skills/gstack/browse/test/fixtures/snapshot.html +55 -0
- package/.agents/skills/gstack/browse/test/fixtures/spa.html +24 -0
- package/.agents/skills/gstack/browse/test/fixtures/states.html +17 -0
- package/.agents/skills/gstack/browse/test/fixtures/upload.html +25 -0
- package/.agents/skills/gstack/browse/test/gstack-config.test.ts +125 -0
- package/.agents/skills/gstack/browse/test/gstack-update-check.test.ts +467 -0
- package/.agents/skills/gstack/browse/test/handoff.test.ts +235 -0
- package/.agents/skills/gstack/browse/test/path-validation.test.ts +63 -0
- package/.agents/skills/gstack/browse/test/platform.test.ts +37 -0
- package/.agents/skills/gstack/browse/test/snapshot.test.ts +467 -0
- package/.agents/skills/gstack/browse/test/test-server.ts +57 -0
- package/.agents/skills/gstack/browse/test/url-validation.test.ts +72 -0
- package/.agents/skills/gstack/canary/SKILL.md +493 -0
- package/.agents/skills/gstack/canary/SKILL.md.tmpl +220 -0
- package/.agents/skills/gstack/careful/SKILL.md +59 -0
- package/.agents/skills/gstack/careful/SKILL.md.tmpl +57 -0
- package/.agents/skills/gstack/careful/bin/check-careful.sh +112 -0
- package/.agents/skills/gstack/codex/SKILL.md +677 -0
- package/.agents/skills/gstack/codex/SKILL.md.tmpl +356 -0
- package/.agents/skills/gstack/conductor.json +6 -0
- package/.agents/skills/gstack/cso/SKILL.md +615 -0
- package/.agents/skills/gstack/cso/SKILL.md.tmpl +376 -0
- package/.agents/skills/gstack/design-consultation/SKILL.md +625 -0
- package/.agents/skills/gstack/design-consultation/SKILL.md.tmpl +369 -0
- package/.agents/skills/gstack/design-review/SKILL.md +998 -0
- package/.agents/skills/gstack/design-review/SKILL.md.tmpl +262 -0
- package/.agents/skills/gstack/docs/images/github-2013.png +0 -0
- package/.agents/skills/gstack/docs/images/github-2026.png +0 -0
- package/.agents/skills/gstack/docs/skills.md +877 -0
- package/.agents/skills/gstack/document-release/SKILL.md +613 -0
- package/.agents/skills/gstack/document-release/SKILL.md.tmpl +357 -0
- package/.agents/skills/gstack/freeze/SKILL.md +82 -0
- package/.agents/skills/gstack/freeze/SKILL.md.tmpl +80 -0
- package/.agents/skills/gstack/freeze/bin/check-freeze.sh +68 -0
- package/.agents/skills/gstack/gstack-upgrade/SKILL.md +226 -0
- package/.agents/skills/gstack/gstack-upgrade/SKILL.md.tmpl +224 -0
- package/.agents/skills/gstack/guard/SKILL.md +82 -0
- package/.agents/skills/gstack/guard/SKILL.md.tmpl +80 -0
- package/.agents/skills/gstack/investigate/SKILL.md +435 -0
- package/.agents/skills/gstack/investigate/SKILL.md.tmpl +196 -0
- package/.agents/skills/gstack/land-and-deploy/SKILL.md +880 -0
- package/.agents/skills/gstack/land-and-deploy/SKILL.md.tmpl +575 -0
- package/.agents/skills/gstack/office-hours/SKILL.md +996 -0
- package/.agents/skills/gstack/office-hours/SKILL.md.tmpl +624 -0
- package/.agents/skills/gstack/package.json +55 -0
- package/.agents/skills/gstack/plan-ceo-review/SKILL.md +1277 -0
- package/.agents/skills/gstack/plan-ceo-review/SKILL.md.tmpl +838 -0
- package/.agents/skills/gstack/plan-design-review/SKILL.md +676 -0
- package/.agents/skills/gstack/plan-design-review/SKILL.md.tmpl +314 -0
- package/.agents/skills/gstack/plan-eng-review/SKILL.md +836 -0
- package/.agents/skills/gstack/plan-eng-review/SKILL.md.tmpl +279 -0
- package/.agents/skills/gstack/qa/SKILL.md +1016 -0
- package/.agents/skills/gstack/qa/SKILL.md.tmpl +316 -0
- package/.agents/skills/gstack/qa/references/issue-taxonomy.md +85 -0
- package/.agents/skills/gstack/qa/templates/qa-report-template.md +126 -0
- package/.agents/skills/gstack/qa-only/SKILL.md +633 -0
- package/.agents/skills/gstack/qa-only/SKILL.md.tmpl +101 -0
- package/.agents/skills/gstack/retro/SKILL.md +1072 -0
- package/.agents/skills/gstack/retro/SKILL.md.tmpl +833 -0
- package/.agents/skills/gstack/review/SKILL.md +849 -0
- package/.agents/skills/gstack/review/SKILL.md.tmpl +259 -0
- package/.agents/skills/gstack/review/TODOS-format.md +62 -0
- package/.agents/skills/gstack/review/checklist.md +190 -0
- package/.agents/skills/gstack/review/design-checklist.md +132 -0
- package/.agents/skills/gstack/review/greptile-triage.md +220 -0
- package/.agents/skills/gstack/scripts/analytics.ts +190 -0
- package/.agents/skills/gstack/scripts/dev-skill.ts +82 -0
- package/.agents/skills/gstack/scripts/eval-compare.ts +96 -0
- package/.agents/skills/gstack/scripts/eval-list.ts +116 -0
- package/.agents/skills/gstack/scripts/eval-select.ts +86 -0
- package/.agents/skills/gstack/scripts/eval-summary.ts +187 -0
- package/.agents/skills/gstack/scripts/eval-watch.ts +172 -0
- package/.agents/skills/gstack/scripts/gen-skill-docs.ts +2414 -0
- package/.agents/skills/gstack/scripts/skill-check.ts +167 -0
- package/.agents/skills/gstack/setup +269 -0
- package/.agents/skills/gstack/setup-browser-cookies/SKILL.md +330 -0
- package/.agents/skills/gstack/setup-browser-cookies/SKILL.md.tmpl +74 -0
- package/.agents/skills/gstack/setup-deploy/SKILL.md +459 -0
- package/.agents/skills/gstack/setup-deploy/SKILL.md.tmpl +220 -0
- package/.agents/skills/gstack/ship/SKILL.md +1457 -0
- package/.agents/skills/gstack/ship/SKILL.md.tmpl +528 -0
- package/.agents/skills/gstack/supabase/config.sh +10 -0
- package/.agents/skills/gstack/supabase/functions/community-pulse/index.ts +59 -0
- package/.agents/skills/gstack/supabase/functions/telemetry-ingest/index.ts +135 -0
- package/.agents/skills/gstack/supabase/functions/update-check/index.ts +37 -0
- package/.agents/skills/gstack/supabase/migrations/001_telemetry.sql +89 -0
- package/.agents/skills/gstack/test/analytics.test.ts +277 -0
- package/.agents/skills/gstack/test/codex-e2e.test.ts +197 -0
- package/.agents/skills/gstack/test/fixtures/coverage-audit-fixture.ts +76 -0
- package/.agents/skills/gstack/test/fixtures/eval-baselines.json +7 -0
- package/.agents/skills/gstack/test/fixtures/qa-eval-checkout-ground-truth.json +43 -0
- package/.agents/skills/gstack/test/fixtures/qa-eval-ground-truth.json +43 -0
- package/.agents/skills/gstack/test/fixtures/qa-eval-spa-ground-truth.json +43 -0
- package/.agents/skills/gstack/test/fixtures/review-eval-design-slop.css +86 -0
- package/.agents/skills/gstack/test/fixtures/review-eval-design-slop.html +41 -0
- package/.agents/skills/gstack/test/fixtures/review-eval-enum-diff.rb +30 -0
- package/.agents/skills/gstack/test/fixtures/review-eval-enum.rb +27 -0
- package/.agents/skills/gstack/test/fixtures/review-eval-vuln.rb +14 -0
- package/.agents/skills/gstack/test/gemini-e2e.test.ts +173 -0
- package/.agents/skills/gstack/test/gen-skill-docs.test.ts +1049 -0
- package/.agents/skills/gstack/test/global-discover.test.ts +187 -0
- package/.agents/skills/gstack/test/helpers/codex-session-runner.ts +282 -0
- package/.agents/skills/gstack/test/helpers/e2e-helpers.ts +239 -0
- package/.agents/skills/gstack/test/helpers/eval-store.test.ts +548 -0
- package/.agents/skills/gstack/test/helpers/eval-store.ts +689 -0
- package/.agents/skills/gstack/test/helpers/gemini-session-runner.test.ts +104 -0
- package/.agents/skills/gstack/test/helpers/gemini-session-runner.ts +201 -0
- package/.agents/skills/gstack/test/helpers/llm-judge.ts +130 -0
- package/.agents/skills/gstack/test/helpers/observability.test.ts +283 -0
- package/.agents/skills/gstack/test/helpers/session-runner.test.ts +96 -0
- package/.agents/skills/gstack/test/helpers/session-runner.ts +357 -0
- package/.agents/skills/gstack/test/helpers/skill-parser.ts +206 -0
- package/.agents/skills/gstack/test/helpers/touchfiles.ts +260 -0
- package/.agents/skills/gstack/test/hook-scripts.test.ts +373 -0
- package/.agents/skills/gstack/test/skill-e2e-browse.test.ts +293 -0
- package/.agents/skills/gstack/test/skill-e2e-deploy.test.ts +279 -0
- package/.agents/skills/gstack/test/skill-e2e-design.test.ts +614 -0
- package/.agents/skills/gstack/test/skill-e2e-plan.test.ts +538 -0
- package/.agents/skills/gstack/test/skill-e2e-qa-bugs.test.ts +194 -0
- package/.agents/skills/gstack/test/skill-e2e-qa-workflow.test.ts +412 -0
- package/.agents/skills/gstack/test/skill-e2e-review.test.ts +535 -0
- package/.agents/skills/gstack/test/skill-e2e-workflow.test.ts +586 -0
- package/.agents/skills/gstack/test/skill-e2e.test.ts +3325 -0
- package/.agents/skills/gstack/test/skill-llm-eval.test.ts +787 -0
- package/.agents/skills/gstack/test/skill-parser.test.ts +179 -0
- package/.agents/skills/gstack/test/skill-routing-e2e.test.ts +605 -0
- package/.agents/skills/gstack/test/skill-validation.test.ts +1520 -0
- package/.agents/skills/gstack/test/telemetry.test.ts +278 -0
- package/.agents/skills/gstack/test/touchfiles.test.ts +262 -0
- package/.agents/skills/gstack/unfreeze/SKILL.md +40 -0
- package/.agents/skills/gstack/unfreeze/SKILL.md.tmpl +38 -0
- package/README.md +12 -7
- package/README_KO.md +12 -6
- package/package.json +3 -2
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: |
|
|
5
|
+
OpenAI Codex CLI wrapper — three modes. Code review: independent diff review via
|
|
6
|
+
codex review with pass/fail gate. Challenge: adversarial mode that tries to break
|
|
7
|
+
your code. Consult: ask codex anything with session continuity for follow-ups.
|
|
8
|
+
The "200 IQ autistic developer" second opinion. Use when asked to "codex review",
|
|
9
|
+
"codex challenge", "ask codex", "second opinion", or "consult codex".
|
|
10
|
+
allowed-tools:
|
|
11
|
+
- Bash
|
|
12
|
+
- Read
|
|
13
|
+
- Write
|
|
14
|
+
- Glob
|
|
15
|
+
- Grep
|
|
16
|
+
- AskUserQuestion
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
{{PREAMBLE}}
|
|
20
|
+
|
|
21
|
+
{{BASE_BRANCH_DETECT}}
|
|
22
|
+
|
|
23
|
+
# /codex — Multi-AI Second Opinion
|
|
24
|
+
|
|
25
|
+
You are running the `/codex` skill. This wraps the OpenAI Codex CLI to get an independent,
|
|
26
|
+
brutally honest second opinion from a different AI system.
|
|
27
|
+
|
|
28
|
+
Codex is the "200 IQ autistic developer" — direct, terse, technically precise, challenges
|
|
29
|
+
assumptions, catches things you might miss. Present its output faithfully, not summarized.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Step 0: Check codex binary
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
CODEX_BIN=$(which codex 2>/dev/null || echo "")
|
|
37
|
+
[ -z "$CODEX_BIN" ] && echo "NOT_FOUND" || echo "FOUND: $CODEX_BIN"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
If `NOT_FOUND`: stop and tell the user:
|
|
41
|
+
"Codex CLI not found. Install it: `npm install -g @openai/codex` or see https://github.com/openai/codex"
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Step 1: Detect mode
|
|
46
|
+
|
|
47
|
+
Parse the user's input to determine which mode to run:
|
|
48
|
+
|
|
49
|
+
1. `/codex review` or `/codex review <instructions>` — **Review mode** (Step 2A)
|
|
50
|
+
2. `/codex challenge` or `/codex challenge <focus>` — **Challenge mode** (Step 2B)
|
|
51
|
+
3. `/codex` with no arguments — **Auto-detect:**
|
|
52
|
+
- Check for a diff (with fallback if origin isn't available):
|
|
53
|
+
`git diff origin/<base> --stat 2>/dev/null | tail -1 || git diff <base> --stat 2>/dev/null | tail -1`
|
|
54
|
+
- If a diff exists, use AskUserQuestion:
|
|
55
|
+
```
|
|
56
|
+
Codex detected changes against the base branch. What should it do?
|
|
57
|
+
A) Review the diff (code review with pass/fail gate)
|
|
58
|
+
B) Challenge the diff (adversarial — try to break it)
|
|
59
|
+
C) Something else — I'll provide a prompt
|
|
60
|
+
```
|
|
61
|
+
- If no diff, check for plan files scoped to the current project:
|
|
62
|
+
`ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1`
|
|
63
|
+
If no project-scoped match, fall back to: `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1`
|
|
64
|
+
but warn the user: "Note: this plan may be from a different project."
|
|
65
|
+
- If a plan file exists, offer to review it
|
|
66
|
+
- Otherwise, ask: "What would you like to ask Codex?"
|
|
67
|
+
4. `/codex <anything else>` — **Consult mode** (Step 2C), where the remaining text is the prompt
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Step 2A: Review Mode
|
|
72
|
+
|
|
73
|
+
Run Codex code review against the current branch diff.
|
|
74
|
+
|
|
75
|
+
1. Create temp files for output capture:
|
|
76
|
+
```bash
|
|
77
|
+
TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt)
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
2. Run the review (5-minute timeout):
|
|
81
|
+
```bash
|
|
82
|
+
codex review --base <base> -c 'model_reasoning_effort="xhigh"' --enable web_search_cached 2>"$TMPERR"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Use `timeout: 300000` on the Bash call. If the user provided custom instructions
|
|
86
|
+
(e.g., `/codex review focus on security`), pass them as the prompt argument:
|
|
87
|
+
```bash
|
|
88
|
+
codex review "focus on security" --base <base> -c 'model_reasoning_effort="xhigh"' --enable web_search_cached 2>"$TMPERR"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
3. Capture the output. Then parse cost from stderr:
|
|
92
|
+
```bash
|
|
93
|
+
grep "tokens used" "$TMPERR" 2>/dev/null || echo "tokens: unknown"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
4. Determine gate verdict by checking the review output for critical findings.
|
|
97
|
+
If the output contains `[P1]` — the gate is **FAIL**.
|
|
98
|
+
If no `[P1]` markers are found (only `[P2]` or no findings) — the gate is **PASS**.
|
|
99
|
+
|
|
100
|
+
5. Present the output:
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
CODEX SAYS (code review):
|
|
104
|
+
════════════════════════════════════════════════════════════
|
|
105
|
+
<full codex output, verbatim — do not truncate or summarize>
|
|
106
|
+
════════════════════════════════════════════════════════════
|
|
107
|
+
GATE: PASS Tokens: 14,331 | Est. cost: ~$0.12
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
or
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
GATE: FAIL (N critical findings)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
6. **Cross-model comparison:** If `/review` (Claude's own review) was already run
|
|
117
|
+
earlier in this conversation, compare the two sets of findings:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
CROSS-MODEL ANALYSIS:
|
|
121
|
+
Both found: [findings that overlap between Claude and Codex]
|
|
122
|
+
Only Codex found: [findings unique to Codex]
|
|
123
|
+
Only Claude found: [findings unique to Claude's /review]
|
|
124
|
+
Agreement rate: X% (N/M total unique findings overlap)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
7. Persist the review result:
|
|
128
|
+
```bash
|
|
129
|
+
~/.claude/skills/gstack/bin/gstack-review-log '{"skill":"codex-review","timestamp":"TIMESTAMP","status":"STATUS","gate":"GATE","findings":N,"findings_fixed":N}'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Substitute: TIMESTAMP (ISO 8601), STATUS ("clean" if PASS, "issues_found" if FAIL),
|
|
133
|
+
GATE ("pass" or "fail"), findings (count of [P1] + [P2] markers),
|
|
134
|
+
findings_fixed (count of findings that were addressed/fixed before shipping).
|
|
135
|
+
|
|
136
|
+
8. Clean up temp files:
|
|
137
|
+
```bash
|
|
138
|
+
rm -f "$TMPERR"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
{{PLAN_FILE_REVIEW_REPORT}}
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Step 2B: Challenge (Adversarial) Mode
|
|
146
|
+
|
|
147
|
+
Codex tries to break your code — finding edge cases, race conditions, security holes,
|
|
148
|
+
and failure modes that a normal review would miss.
|
|
149
|
+
|
|
150
|
+
1. Construct the adversarial prompt. If the user provided a focus area
|
|
151
|
+
(e.g., `/codex challenge security`), include it:
|
|
152
|
+
|
|
153
|
+
Default prompt (no focus):
|
|
154
|
+
"Review the changes on this branch against the base branch. Run `git diff origin/<base>` to see the diff. Your job is to find ways this code will fail in production. Think like an attacker and a chaos engineer. Find edge cases, race conditions, security holes, resource leaks, failure modes, and silent data corruption paths. Be adversarial. Be thorough. No compliments — just the problems."
|
|
155
|
+
|
|
156
|
+
With focus (e.g., "security"):
|
|
157
|
+
"Review the changes on this branch against the base branch. Run `git diff origin/<base>` to see the diff. Focus specifically on SECURITY. Your job is to find every way an attacker could exploit this code. Think about injection vectors, auth bypasses, privilege escalation, data exposure, and timing attacks. Be adversarial."
|
|
158
|
+
|
|
159
|
+
2. Run codex exec with **JSONL output** to capture reasoning traces and tool calls (5-minute timeout):
|
|
160
|
+
```bash
|
|
161
|
+
codex exec "<prompt>" -s read-only -c 'model_reasoning_effort="xhigh"' --enable web_search_cached --json 2>/dev/null | python3 -c "
|
|
162
|
+
import sys, json
|
|
163
|
+
for line in sys.stdin:
|
|
164
|
+
line = line.strip()
|
|
165
|
+
if not line: continue
|
|
166
|
+
try:
|
|
167
|
+
obj = json.loads(line)
|
|
168
|
+
t = obj.get('type','')
|
|
169
|
+
if t == 'item.completed' and 'item' in obj:
|
|
170
|
+
item = obj['item']
|
|
171
|
+
itype = item.get('type','')
|
|
172
|
+
text = item.get('text','')
|
|
173
|
+
if itype == 'reasoning' and text:
|
|
174
|
+
print(f'[codex thinking] {text}')
|
|
175
|
+
print()
|
|
176
|
+
elif itype == 'agent_message' and text:
|
|
177
|
+
print(text)
|
|
178
|
+
elif itype == 'command_execution':
|
|
179
|
+
cmd = item.get('command','')
|
|
180
|
+
if cmd: print(f'[codex ran] {cmd}')
|
|
181
|
+
elif t == 'turn.completed':
|
|
182
|
+
usage = obj.get('usage',{})
|
|
183
|
+
tokens = usage.get('input_tokens',0) + usage.get('output_tokens',0)
|
|
184
|
+
if tokens: print(f'\ntokens used: {tokens}')
|
|
185
|
+
except: pass
|
|
186
|
+
"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
This parses codex's JSONL events to extract reasoning traces, tool calls, and the final
|
|
190
|
+
response. The `[codex thinking]` lines show what codex reasoned through before its answer.
|
|
191
|
+
|
|
192
|
+
3. Present the full streamed output:
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
CODEX SAYS (adversarial challenge):
|
|
196
|
+
════════════════════════════════════════════════════════════
|
|
197
|
+
<full output from above, verbatim>
|
|
198
|
+
════════════════════════════════════════════════════════════
|
|
199
|
+
Tokens: N | Est. cost: ~$X.XX
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Step 2C: Consult Mode
|
|
205
|
+
|
|
206
|
+
Ask Codex anything about the codebase. Supports session continuity for follow-ups.
|
|
207
|
+
|
|
208
|
+
1. **Check for existing session:**
|
|
209
|
+
```bash
|
|
210
|
+
cat .context/codex-session-id 2>/dev/null || echo "NO_SESSION"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
If a session file exists (not `NO_SESSION`), use AskUserQuestion:
|
|
214
|
+
```
|
|
215
|
+
You have an active Codex conversation from earlier. Continue it or start fresh?
|
|
216
|
+
A) Continue the conversation (Codex remembers the prior context)
|
|
217
|
+
B) Start a new conversation
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
2. Create temp files:
|
|
221
|
+
```bash
|
|
222
|
+
TMPRESP=$(mktemp /tmp/codex-resp-XXXXXX.txt)
|
|
223
|
+
TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
3. **Plan review auto-detection:** If the user's prompt is about reviewing a plan,
|
|
227
|
+
or if plan files exist and the user said `/codex` with no arguments:
|
|
228
|
+
```bash
|
|
229
|
+
ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1
|
|
230
|
+
```
|
|
231
|
+
If no project-scoped match, fall back to `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1`
|
|
232
|
+
but warn: "Note: this plan may be from a different project — verify before sending to Codex."
|
|
233
|
+
Read the plan file and prepend the persona to the user's prompt:
|
|
234
|
+
"You are a brutally honest technical reviewer. Review this plan for: logical gaps and
|
|
235
|
+
unstated assumptions, missing error handling or edge cases, overcomplexity (is there a
|
|
236
|
+
simpler approach?), feasibility risks (what could go wrong?), and missing dependencies
|
|
237
|
+
or sequencing issues. Be direct. Be terse. No compliments. Just the problems.
|
|
238
|
+
|
|
239
|
+
THE PLAN:
|
|
240
|
+
<plan content>"
|
|
241
|
+
|
|
242
|
+
4. Run codex exec with **JSONL output** to capture reasoning traces (5-minute timeout):
|
|
243
|
+
|
|
244
|
+
For a **new session:**
|
|
245
|
+
```bash
|
|
246
|
+
codex exec "<prompt>" -s read-only -c 'model_reasoning_effort="xhigh"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c "
|
|
247
|
+
import sys, json
|
|
248
|
+
for line in sys.stdin:
|
|
249
|
+
line = line.strip()
|
|
250
|
+
if not line: continue
|
|
251
|
+
try:
|
|
252
|
+
obj = json.loads(line)
|
|
253
|
+
t = obj.get('type','')
|
|
254
|
+
if t == 'thread.started':
|
|
255
|
+
tid = obj.get('thread_id','')
|
|
256
|
+
if tid: print(f'SESSION_ID:{tid}')
|
|
257
|
+
elif t == 'item.completed' and 'item' in obj:
|
|
258
|
+
item = obj['item']
|
|
259
|
+
itype = item.get('type','')
|
|
260
|
+
text = item.get('text','')
|
|
261
|
+
if itype == 'reasoning' and text:
|
|
262
|
+
print(f'[codex thinking] {text}')
|
|
263
|
+
print()
|
|
264
|
+
elif itype == 'agent_message' and text:
|
|
265
|
+
print(text)
|
|
266
|
+
elif itype == 'command_execution':
|
|
267
|
+
cmd = item.get('command','')
|
|
268
|
+
if cmd: print(f'[codex ran] {cmd}')
|
|
269
|
+
elif t == 'turn.completed':
|
|
270
|
+
usage = obj.get('usage',{})
|
|
271
|
+
tokens = usage.get('input_tokens',0) + usage.get('output_tokens',0)
|
|
272
|
+
if tokens: print(f'\ntokens used: {tokens}')
|
|
273
|
+
except: pass
|
|
274
|
+
"
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
For a **resumed session** (user chose "Continue"):
|
|
278
|
+
```bash
|
|
279
|
+
codex exec resume <session-id> "<prompt>" -s read-only -c 'model_reasoning_effort="xhigh"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c "
|
|
280
|
+
<same python streaming parser as above>
|
|
281
|
+
"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
5. Capture session ID from the streamed output. The parser prints `SESSION_ID:<id>`
|
|
285
|
+
from the `thread.started` event. Save it for follow-ups:
|
|
286
|
+
```bash
|
|
287
|
+
mkdir -p .context
|
|
288
|
+
```
|
|
289
|
+
Save the session ID printed by the parser (the line starting with `SESSION_ID:`)
|
|
290
|
+
to `.context/codex-session-id`.
|
|
291
|
+
|
|
292
|
+
6. Present the full streamed output:
|
|
293
|
+
|
|
294
|
+
```
|
|
295
|
+
CODEX SAYS (consult):
|
|
296
|
+
════════════════════════════════════════════════════════════
|
|
297
|
+
<full output, verbatim — includes [codex thinking] traces>
|
|
298
|
+
════════════════════════════════════════════════════════════
|
|
299
|
+
Tokens: N | Est. cost: ~$X.XX
|
|
300
|
+
Session saved — run /codex again to continue this conversation.
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
7. After presenting, note any points where Codex's analysis differs from your own
|
|
304
|
+
understanding. If there is a disagreement, flag it:
|
|
305
|
+
"Note: Claude Code disagrees on X because Y."
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Model & Reasoning
|
|
310
|
+
|
|
311
|
+
**Model:** No model is hardcoded — codex uses whatever its current default is (the frontier
|
|
312
|
+
agentic coding model). This means as OpenAI ships newer models, /codex automatically
|
|
313
|
+
uses them. If the user wants a specific model, pass `-m` through to codex.
|
|
314
|
+
|
|
315
|
+
**Reasoning effort:** All modes use `xhigh` — maximum reasoning power. When reviewing code, breaking code, or consulting on architecture, you want the model thinking as hard as possible.
|
|
316
|
+
|
|
317
|
+
**Web search:** All codex commands use `--enable web_search_cached` so Codex can look up
|
|
318
|
+
docs and APIs during review. This is OpenAI's cached index — fast, no extra cost.
|
|
319
|
+
|
|
320
|
+
If the user specifies a model (e.g., `/codex review -m gpt-5.1-codex-max`
|
|
321
|
+
or `/codex challenge -m gpt-5.2`), pass the `-m` flag through to codex.
|
|
322
|
+
|
|
323
|
+
---
|
|
324
|
+
|
|
325
|
+
## Cost Estimation
|
|
326
|
+
|
|
327
|
+
Parse token count from stderr. Codex prints `tokens used\nN` to stderr.
|
|
328
|
+
|
|
329
|
+
Display as: `Tokens: N`
|
|
330
|
+
|
|
331
|
+
If token count is not available, display: `Tokens: unknown`
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Error Handling
|
|
336
|
+
|
|
337
|
+
- **Binary not found:** Detected in Step 0. Stop with install instructions.
|
|
338
|
+
- **Auth error:** Codex prints an auth error to stderr. Surface the error:
|
|
339
|
+
"Codex authentication failed. Run `codex login` in your terminal to authenticate via ChatGPT."
|
|
340
|
+
- **Timeout:** If the Bash call times out (5 min), tell the user:
|
|
341
|
+
"Codex timed out after 5 minutes. The diff may be too large or the API may be slow. Try again or use a smaller scope."
|
|
342
|
+
- **Empty response:** If `$TMPRESP` is empty or doesn't exist, tell the user:
|
|
343
|
+
"Codex returned no response. Check stderr for errors."
|
|
344
|
+
- **Session resume failure:** If resume fails, delete the session file and start fresh.
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Important Rules
|
|
349
|
+
|
|
350
|
+
- **Never modify files.** This skill is read-only. Codex runs in read-only sandbox mode.
|
|
351
|
+
- **Present output verbatim.** Do not truncate, summarize, or editorialize Codex's output
|
|
352
|
+
before showing it. Show it in full inside the CODEX SAYS block.
|
|
353
|
+
- **Add synthesis after, not instead of.** Any Claude commentary comes after the full output.
|
|
354
|
+
- **5-minute timeout** on all Bash calls to codex (`timeout: 300000`).
|
|
355
|
+
- **No double-reviewing.** If the user already ran `/review`, Codex provides a second
|
|
356
|
+
independent opinion. Do not re-run Claude Code's own review.
|