diff --git a/codex/SKILL.md b/codex/SKILL.md index 47dcce5e..50e26618 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -28,8 +28,10 @@ touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true _CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) +_PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") echo "BRANCH: $_BRANCH" +echo "PROACTIVE: $_PROACTIVE" _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no") echo "LAKE_INTRO: $_LAKE_SEEN" ``` @@ -204,7 +206,10 @@ Parse the user's input to determine which mode to run: B) Challenge the diff (adversarial — try to break it) C) Something else — I'll provide a prompt ``` - - If no diff, check for plan files: `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1` + - If no diff, check for plan files scoped to the current project: + `ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1` + If no project-scoped match, fall back to: `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1` + but warn the user: "Note: this plan may be from a different project." - If a plan file exists, offer to review it - Otherwise, ask: "What would you like to ask Codex?" 4. `/codex ` — **Consult mode** (Step 2C), where the remaining text is the prompt @@ -271,8 +276,8 @@ CROSS-MODEL ANALYSIS: ```bash eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) BRANCH_SLUG=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-') -mkdir -p ~/.gstack/projects/$SLUG -echo '{"skill":"codex-review","timestamp":"TIMESTAMP","status":"STATUS","gate":"GATE","findings":N}' >> ~/.gstack/projects/$SLUG/$BRANCH_SLUG-reviews.jsonl +mkdir -p ~/.gstack/projects/"$SLUG" +echo '{"skill":"codex-review","timestamp":"TIMESTAMP","status":"STATUS","gate":"GATE","findings":N}' >> ~/.gstack/projects/"$SLUG"/"$BRANCH_SLUG"-reviews.jsonl ``` Substitute: TIMESTAMP (ISO 8601), STATUS ("clean" if PASS, "issues_found" if FAIL), @@ -369,8 +374,10 @@ TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt) 3. **Plan review auto-detection:** If the user's prompt is about reviewing a plan, or if plan files exist and the user said `/codex` with no arguments: ```bash -ls -t ~/.claude/plans/*.md 2>/dev/null | head -1 +ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1 ``` +If no project-scoped match, fall back to `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1` +but warn: "Note: this plan may be from a different project — verify before sending to Codex." Read the plan file and prepend the persona to the user's prompt: "You are a brutally honest technical reviewer. Review this plan for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a @@ -384,7 +391,7 @@ THE PLAN: For a **new session:** ```bash -codex exec "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>/tmp/codex-consult-err.txt | python3 -c " +codex exec "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c " import sys, json for line in sys.stdin: line = line.strip() @@ -417,7 +424,7 @@ for line in sys.stdin: For a **resumed session** (user chose "Continue"): ```bash -codex exec resume "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>/tmp/codex-consult-err.txt | python3 -c " +codex exec resume "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c " " ``` diff --git a/codex/SKILL.md.tmpl b/codex/SKILL.md.tmpl index a716e615..6dd54902 100644 --- a/codex/SKILL.md.tmpl +++ b/codex/SKILL.md.tmpl @@ -58,7 +58,10 @@ Parse the user's input to determine which mode to run: B) Challenge the diff (adversarial — try to break it) C) Something else — I'll provide a prompt ``` - - If no diff, check for plan files: `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1` + - If no diff, check for plan files scoped to the current project: + `ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1` + If no project-scoped match, fall back to: `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1` + but warn the user: "Note: this plan may be from a different project." - If a plan file exists, offer to review it - Otherwise, ask: "What would you like to ask Codex?" 4. `/codex ` — **Consult mode** (Step 2C), where the remaining text is the prompt @@ -125,8 +128,8 @@ CROSS-MODEL ANALYSIS: ```bash eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) BRANCH_SLUG=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-') -mkdir -p ~/.gstack/projects/$SLUG -echo '{"skill":"codex-review","timestamp":"TIMESTAMP","status":"STATUS","gate":"GATE","findings":N}' >> ~/.gstack/projects/$SLUG/$BRANCH_SLUG-reviews.jsonl +mkdir -p ~/.gstack/projects/"$SLUG" +echo '{"skill":"codex-review","timestamp":"TIMESTAMP","status":"STATUS","gate":"GATE","findings":N}' >> ~/.gstack/projects/"$SLUG"/"$BRANCH_SLUG"-reviews.jsonl ``` Substitute: TIMESTAMP (ISO 8601), STATUS ("clean" if PASS, "issues_found" if FAIL), @@ -223,8 +226,10 @@ TMPERR=$(mktemp /tmp/codex-err-XXXXXX.txt) 3. **Plan review auto-detection:** If the user's prompt is about reviewing a plan, or if plan files exist and the user said `/codex` with no arguments: ```bash -ls -t ~/.claude/plans/*.md 2>/dev/null | head -1 +ls -t ~/.claude/plans/*.md 2>/dev/null | xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1 ``` +If no project-scoped match, fall back to `ls -t ~/.claude/plans/*.md 2>/dev/null | head -1` +but warn: "Note: this plan may be from a different project — verify before sending to Codex." Read the plan file and prepend the persona to the user's prompt: "You are a brutally honest technical reviewer. Review this plan for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a @@ -238,7 +243,7 @@ THE PLAN: For a **new session:** ```bash -codex exec "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>/tmp/codex-consult-err.txt | python3 -c " +codex exec "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c " import sys, json for line in sys.stdin: line = line.strip() @@ -271,7 +276,7 @@ for line in sys.stdin: For a **resumed session** (user chose "Continue"): ```bash -codex exec resume "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>/tmp/codex-consult-err.txt | python3 -c " +codex exec resume "" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached --json 2>"$TMPERR" | python3 -c " " ``` diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 8a1b2c05..b623d050 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -27,8 +27,10 @@ touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true _CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) +_PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") echo "BRANCH: $_BRANCH" +echo "PROACTIVE: $_PROACTIVE" _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no") echo "LAKE_INTRO: $_LAKE_SEEN" ``` @@ -222,16 +224,12 @@ A) Yes — let Codex critique the plan independently B) No — proceed with the Claude review only ``` -If the user chooses A: read the plan file content, then pass it into the Codex prompt so it has the actual plan to critique: +If the user chooses A: tell Codex to read the plan file itself (avoids ARG_MAX limits for large plans): ```bash -PLAN_CONTENT=$(cat ) -codex exec "You are a brutally honest technical reviewer. Review this plan for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a simpler approach?), feasibility risks (what could go wrong?), and missing dependencies or sequencing issues. Be direct. Be terse. No compliments. Just the problems. - -THE PLAN: -$PLAN_CONTENT" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached +codex exec "You are a brutally honest technical reviewer. Read the plan file at and review it for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a simpler approach?), feasibility risks (what could go wrong?), and missing dependencies or sequencing issues. Be direct. Be terse. No compliments. Just the problems." -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached ``` -Replace `` with the actual path to the plan file detected earlier. +Replace `` with the actual path to the plan file detected earlier. Codex has filesystem access in read-only mode and will read the file itself. Present the full output under a `CODEX SAYS (plan review):` header. Note any concerns that should inform the subsequent engineering review sections. diff --git a/plan-eng-review/SKILL.md.tmpl b/plan-eng-review/SKILL.md.tmpl index df5e775a..7713b856 100644 --- a/plan-eng-review/SKILL.md.tmpl +++ b/plan-eng-review/SKILL.md.tmpl @@ -93,16 +93,12 @@ A) Yes — let Codex critique the plan independently B) No — proceed with the Claude review only ``` -If the user chooses A: read the plan file content, then pass it into the Codex prompt so it has the actual plan to critique: +If the user chooses A: tell Codex to read the plan file itself (avoids ARG_MAX limits for large plans): ```bash -PLAN_CONTENT=$(cat ) -codex exec "You are a brutally honest technical reviewer. Review this plan for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a simpler approach?), feasibility risks (what could go wrong?), and missing dependencies or sequencing issues. Be direct. Be terse. No compliments. Just the problems. - -THE PLAN: -$PLAN_CONTENT" -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached +codex exec "You are a brutally honest technical reviewer. Read the plan file at and review it for: logical gaps and unstated assumptions, missing error handling or edge cases, overcomplexity (is there a simpler approach?), feasibility risks (what could go wrong?), and missing dependencies or sequencing issues. Be direct. Be terse. No compliments. Just the problems." -s read-only -c 'model_reasoning_effort="high"' --enable web_search_cached ``` -Replace `` with the actual path to the plan file detected earlier. +Replace `` with the actual path to the plan file detected earlier. Codex has filesystem access in read-only mode and will read the file itself. Present the full output under a `CODEX SAYS (plan review):` header. Note any concerns that should inform the subsequent engineering review sections. diff --git a/review/SKILL.md b/review/SKILL.md index 9bdb4ef3..b75c3376 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -27,8 +27,10 @@ touch ~/.gstack/sessions/"$PPID" _SESSIONS=$(find ~/.gstack/sessions -mmin -120 -type f 2>/dev/null | wc -l | tr -d ' ') find ~/.gstack/sessions -mmin +120 -type f -delete 2>/dev/null || true _CONTRIB=$(~/.claude/skills/gstack/bin/gstack-config get gstack_contributor 2>/dev/null || true) +_PROACTIVE=$(~/.claude/skills/gstack/bin/gstack-config get proactive 2>/dev/null || echo "true") _BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown") echo "BRANCH: $_BRANCH" +echo "PROACTIVE: $_PROACTIVE" _LAKE_SEEN=$([ -f ~/.gstack/.completeness-intro-seen ] && echo "yes" || echo "no") echo "LAKE_INTRO: $_LAKE_SEEN" ``` @@ -447,8 +449,8 @@ Present the full output verbatim under a `CODEX SAYS (adversarial challenge):` h ```bash eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) BRANCH_SLUG=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-') -mkdir -p ~/.gstack/projects/$SLUG -echo '{"skill":"codex-review","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'","status":"STATUS","gate":"GATE"}' >> ~/.gstack/projects/$SLUG/$BRANCH_SLUG-reviews.jsonl +mkdir -p ~/.gstack/projects/"$SLUG" +echo '{"skill":"codex-review","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'","status":"STATUS","gate":"GATE"}' >> ~/.gstack/projects/"$SLUG"/"$BRANCH_SLUG"-reviews.jsonl ``` Substitute: STATUS ("clean" if PASS, "issues_found" if FAIL), GATE ("pass" or "fail"). diff --git a/review/SKILL.md.tmpl b/review/SKILL.md.tmpl index d379bae3..4cdeb502 100644 --- a/review/SKILL.md.tmpl +++ b/review/SKILL.md.tmpl @@ -268,8 +268,8 @@ Present the full output verbatim under a `CODEX SAYS (adversarial challenge):` h ```bash eval $(~/.claude/skills/gstack/bin/gstack-slug 2>/dev/null) BRANCH_SLUG=$(git rev-parse --abbrev-ref HEAD 2>/dev/null | tr '/' '-') -mkdir -p ~/.gstack/projects/$SLUG -echo '{"skill":"codex-review","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'","status":"STATUS","gate":"GATE"}' >> ~/.gstack/projects/$SLUG/$BRANCH_SLUG-reviews.jsonl +mkdir -p ~/.gstack/projects/"$SLUG" +echo '{"skill":"codex-review","timestamp":"'"$(date -u +%Y-%m-%dT%H:%M:%SZ)"'","status":"STATUS","gate":"GATE"}' >> ~/.gstack/projects/"$SLUG"/"$BRANCH_SLUG"-reviews.jsonl ``` Substitute: STATUS ("clean" if PASS, "issues_found" if FAIL), GATE ("pass" or "fail").