From 75a5ab31ea8e32dbb8c58742673bf73feebe166c Mon Sep 17 00:00:00 2001 From: breadoncee Date: Tue, 10 Mar 2026 12:53:48 +0800 Subject: [PATCH 1/2] feat(skills): add project-agnostic review pipeline skills Add three new skills for AI code review workflows: - create-handoff: generates structured handoff docs with auto-detected build system checks (Node, Rust, Go, Python, Make) - create-review: bootstraps review pipeline scripts/templates and generates paste-ready prompts for any AI reviewer (Codex, Gemini, etc.) - fix-review: fetches GitHub PR review comments and applies fixes with severity-based prioritization Co-Authored-By: Claude Opus 4.6 --- skills/create-handoff/SKILL.md | 132 ++++++++++++ skills/create-review/SKILL.md | 354 +++++++++++++++++++++++++++++++++ skills/fix-review/SKILL.md | 112 +++++++++++ skills/skills-index.yaml | 12 ++ 4 files changed, 610 insertions(+) create mode 100644 skills/create-handoff/SKILL.md create mode 100644 skills/create-review/SKILL.md create mode 100644 skills/fix-review/SKILL.md diff --git a/skills/create-handoff/SKILL.md b/skills/create-handoff/SKILL.md new file mode 100644 index 0000000..d3ba3b6 --- /dev/null +++ b/skills/create-handoff/SKILL.md @@ -0,0 +1,132 @@ +--- +name: create-handoff +description: Generate a handoff document after implementation work is complete — summarizes changes, risks, and review focus areas for the review pipeline. Use when done coding and ready to hand off for review. +owner: chalk +version: "1.0.0" +metadata-version: "1" +allowed-tools: Bash, Read, Glob, Grep, Write +argument-hint: "[optional session name or issue reference]" +--- + +# Create Handoff + +Generate a structured handoff document summarizing implementation work for the review pipeline. + +## Step 1: Determine the session name + +Derive a session name from context: + +1. If the user provided `$ARGUMENTS`, sanitize it to a safe kebab-case string (lowercase, strip any characters that aren't alphanumeric or hyphens, collapse multiple hyphens) and use that as the item name +2. Otherwise, infer from the current branch name (e.g. `feature/issue-24-authentication` → `issue-24-authentication`) +3. If on `main`/`master`, ask the user what to name the session + +## Step 2: Create the review session + +Create the session directory and handoff file: + +```sh +SESSION_DIR=".reviews/${session-name}" +HANDOFF_PATH="$SESSION_DIR/handoff.md" +mkdir -p "$SESSION_DIR" +``` + +If the handoff file already exists with content beyond the template, ask the user whether to overwrite or create a new timestamped session. + +## Step 3: Determine the base branch + +Figure out what the current branch was based on: + +1. Check for a merge base with `main`: `git merge-base main HEAD` +2. If that fails, try `origin/main` +3. If that fails, try `master` / `origin/master` + +Store this as `{base}` for later steps. + +## Step 4: Gather context + +Run these to understand the scope of changes: + +```sh +git log --oneline {base}..HEAD +git diff --stat {base}..HEAD +git diff {base}..HEAD +``` + +## Step 5: Detect and run project checks + +Auto-detect the project's build/check tooling and run what's available. Check for these in order: + +**Node.js** — if `package.json` exists: +- Detect package manager: `yarn.lock` → yarn, `pnpm-lock.yaml` → pnpm, else npm +- Run build: `{pm} run build 2>&1 | tail -5` +- Run typecheck: `{pm} run typecheck 2>&1 | tail -5` OR `npx tsc --noEmit 2>&1 | tail -5` +- Run lint: `{pm} run lint 2>&1 | tail -5` +- Run test: `{pm} run test 2>&1 | tail -5` + +**Rust** — if `Cargo.toml` exists: +- `cargo check 2>&1 | tail -5` +- `cargo test --no-run 2>&1 | tail -5` +- `cargo clippy 2>&1 | tail -5` + +**Go** — if `go.mod` exists: +- `go build ./... 2>&1 | tail -5` +- `go vet ./... 2>&1 | tail -5` +- `go test ./... -short 2>&1 | tail -5` + +**Python** — if `pyproject.toml` or `requirements.txt` exists: +- `python -m py_compile` on changed `.py` files +- `python -m pytest --co -q 2>&1 | tail -5` (collect only, don't run) + +**Make** — if `Makefile` exists with `build`/`check`/`test` targets: +- `make build 2>&1 | tail -5` +- `make check 2>&1 | tail -5` +- `make test 2>&1 | tail -5` + +If no build system is detected, note "No build system detected — skipped automated checks". + +**Important:** If any check fails, note the failure — do NOT try to fix it. The handoff should report the current state honestly. + +## Step 6: Write the handoff + +Write to `HANDOFF_PATH`. Use this format: + +```markdown +# Handoff + +## Scope +- Item: {item reference — e.g. "#24 — Add authentication" or "Refactor IPC layer"} +- Goal: {1-sentence summary of what was accomplished} + +## What Changed +{bullet list of logical changes — describe WHAT each change does, not just file names} + +## Files Changed +{bullet list of every file modified/created, from git diff --stat} + +## Risk Areas +{bullet list of things that could break, have edge cases, or need careful review} + +## Commands Run +{bullet list of every command run and its pass/fail status} + +## Known Gaps +{bullet list of things NOT done — e.g. "no tests written", "error handling incomplete", "hardcoded values"} + +## Suggested Focus For Reviewers +{bullet list of what reviewers should look at most carefully — prioritize by risk} +``` + +## Step 7: Report to the user + +Show: +- The handoff file path +- A brief summary of what was captured +- Suggest next step: run `/create-review` to generate a review prompt for any AI reviewer + +## Rules + +- Do NOT modify any source code — this skill is read-only except for the handoff file +- Be honest about failures — if build/typecheck fail, report that clearly +- Keep descriptions concrete and actionable — avoid vague statements like "various improvements" +- List ALL files from `git diff --stat`, don't summarize or skip any +- If there are no commits ahead of base, warn the user that there's nothing to hand off diff --git a/skills/create-review/SKILL.md b/skills/create-review/SKILL.md new file mode 100644 index 0000000..32a0b2f --- /dev/null +++ b/skills/create-review/SKILL.md @@ -0,0 +1,354 @@ +--- +name: create-review +description: Bootstrap a local AI review pipeline and generate a paste-ready review prompt for any provider (Codex, Gemini, GPT, Claude, etc.). Use after creating a handoff or when ready to get an AI code review. +owner: chalk +version: "1.0.0" +metadata-version: "1" +allowed-tools: Bash, Read, Glob, Grep, Write +argument-hint: "[provider] e.g. codex, gemini, or omit for generic" +--- + +# Create Review + +Bootstrap the review pipeline and generate a paste-ready review prompt for any AI reviewer. + +## Step 1: Determine the reviewer and session + +**Reviewer:** If the user provided `$ARGUMENTS`, use the first argument as the reviewer name (e.g. `codex`, `gemini`, `gpt4`, `claude`). If no argument, use `generic`. + +**Session:** Detect from context: +1. If `.reviews/` exists, check for the most recent session directory +2. Otherwise, infer from the current branch name (kebab-case) +3. If on `main`/`master`, ask the user + +Store as `{reviewer}` and `{session}`. + +## Step 2: Bootstrap the review pipeline + +Check if `.reviews/scripts/pack.sh` exists. If not, bootstrap the full pipeline: + +```sh +mkdir -p .reviews/scripts .reviews/templates .reviews/sessions +``` + +### Create `.reviews/scripts/pack.sh` + +This script generates a review context pack from git state: + +```sh +#!/usr/bin/env bash +set -euo pipefail + +BASE_REF="${1:-origin/main}" +SESSION="${2:-adhoc}" +OUTPUT_PATH="${3:-.reviews/sessions/${SESSION}/pack.md}" + +# Resolve base ref +if ! git rev-parse --verify "$BASE_REF" >/dev/null 2>&1; then + for candidate in main origin/main master origin/master; do + if git rev-parse --verify "$candidate" >/dev/null 2>&1; then + BASE_REF="$candidate" + break + fi + done +fi + +MERGE_BASE="$(git merge-base HEAD "$BASE_REF" 2>/dev/null || echo "")" +if [ -z "$MERGE_BASE" ]; then + MERGE_BASE="$(git rev-list --max-parents=0 HEAD | tail -n 1)" +fi + +mkdir -p "$(dirname "$OUTPUT_PATH")" + +{ + echo "# Review Pack" + echo + echo "- Session: \`$SESSION\`" + echo "- Generated: $(date -u +"%Y-%m-%d %H:%M:%S UTC")" + echo "- Base ref: \`$BASE_REF\`" + echo "- Merge base: \`${MERGE_BASE:0:12}\`" + echo "- Head: \`$(git rev-parse --short HEAD)\`" + echo + echo "## Diff Stat" + echo '```' + git diff --stat "$MERGE_BASE"...HEAD 2>/dev/null || echo "(no committed diff)" + echo '```' + echo + echo "## Changed Files" + CHANGED="$(git diff --name-only "$MERGE_BASE"...HEAD 2>/dev/null || true)" + if [ -n "$CHANGED" ]; then + echo "$CHANGED" | while IFS= read -r f; do [ -n "$f" ] && echo "- $f"; done + else + echo "- (none)" + fi + echo + echo "## Commit Log" + echo '```' + git log --oneline "$MERGE_BASE"..HEAD 2>/dev/null || echo "(no commits ahead of base)" + echo '```' + echo + echo "## Working Tree Status" + echo '```' + git status --short + echo '```' +} > "$OUTPUT_PATH" + +echo "PACK_PATH=$OUTPUT_PATH" +``` + +### Create `.reviews/scripts/render-prompt.sh` + +This script combines pack + handoff + reviewer template into a prompt: + +```sh +#!/usr/bin/env bash +set -euo pipefail + +REVIEWER="${1:?Usage: render-prompt.sh [pack-path] [handoff-path] [output-path]}" +PACK_PATH="${2:-}" +HANDOFF_PATH="${3:-}" +OUTPUT_PATH="${4:-}" +SESSION="${5:-}" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +ROOT_DIR="$(dirname "$SCRIPT_DIR")" + +REVIEWER_TITLE="$(echo "$REVIEWER" | awk '{print toupper(substr($0,1,1)) substr($0,2)}')" + +if [ -z "$SESSION" ] && [ -f "$ROOT_DIR/.current-session" ]; then + SESSION="$(cat "$ROOT_DIR/.current-session")" +fi +SESSION="${SESSION:-adhoc}" + +[ -z "$PACK_PATH" ] && PACK_PATH="$ROOT_DIR/sessions/$SESSION/pack.md" +[ -z "$HANDOFF_PATH" ] && HANDOFF_PATH="$ROOT_DIR/sessions/$SESSION/handoff.md" +[ -z "$OUTPUT_PATH" ] && OUTPUT_PATH="$ROOT_DIR/sessions/$SESSION/${REVIEWER}.prompt.md" + +if [ ! -f "$PACK_PATH" ]; then + echo "Pack not found at $PACK_PATH. Run pack.sh first." >&2 + exit 1 +fi + +mkdir -p "$(dirname "$OUTPUT_PATH")" + +{ + echo "# $REVIEWER_TITLE Review Request" + echo + + # Use provider-specific template if available, else generic + TEMPLATE="$ROOT_DIR/templates/${REVIEWER}-review.template.md" + if [ ! -f "$TEMPLATE" ]; then + TEMPLATE="$ROOT_DIR/templates/generic-review.template.md" + fi + + if [ -f "$TEMPLATE" ]; then + cat "$TEMPLATE" + fi + + echo + echo "---" + echo + echo "## Review Pack" + cat "$PACK_PATH" + + if [ -f "$HANDOFF_PATH" ]; then + echo + echo "---" + echo + echo "## Handoff" + cat "$HANDOFF_PATH" + fi +} > "$OUTPUT_PATH" + +echo "PROMPT_PATH=$OUTPUT_PATH" +``` + +### Create `.reviews/scripts/copy-prompt.sh` + +```sh +#!/usr/bin/env bash +set -euo pipefail + +REVIEWER="${1:?Usage: copy-prompt.sh [pack] [handoff] [output] [session]}" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +OUTPUT="$(bash "$SCRIPT_DIR/render-prompt.sh" "$@")" +echo "$OUTPUT" + +PROMPT_PATH="$(echo "$OUTPUT" | sed -n 's/^PROMPT_PATH=//p' | head -1)" +if [ -z "$PROMPT_PATH" ] || [ ! -f "$PROMPT_PATH" ]; then + echo "Could not resolve prompt path." >&2 + exit 1 +fi + +COPIED=0 +if command -v pbcopy >/dev/null 2>&1; then + pbcopy < "$PROMPT_PATH" && COPIED=1 && echo "CLIPBOARD=pbcopy" +elif command -v xclip >/dev/null 2>&1; then + xclip -selection clipboard < "$PROMPT_PATH" && COPIED=1 && echo "CLIPBOARD=xclip" +elif command -v wl-copy >/dev/null 2>&1; then + wl-copy < "$PROMPT_PATH" && COPIED=1 && echo "CLIPBOARD=wl-copy" +fi + +if [ "$COPIED" -eq 0 ]; then + echo "CLIPBOARD=none (copy manually from $PROMPT_PATH)" +fi +``` + +### Create `.reviews/templates/generic-review.template.md` + +Only create if it does not already exist (preserve user customizations): + +```markdown +You are acting as an independent code reviewer. + +Task: +- Review the diff only. +- Report defects and risks, not style preferences. + +Output format: +1. Findings (highest severity first) +2. Open questions/assumptions +3. Residual risks/testing gaps + +Finding schema: +- Severity: P0 (critical) | P1 (high) | P2 (medium) | P3 (low) +- File: : +- Issue: concise summary +- Failure mode: what breaks and when +- Suggested fix: actionable next step + +Rules: +- Do not suggest broad refactors unless required for correctness. +- If no blocking issues exist, explicitly state: `No blocking findings`. +``` + +### Create `.reviews/templates/codex-review.template.md` + +Only create if it does not already exist: + +```markdown +You are Codex performing an independent PR review. + +Primary objective: +- Find real defects and risks in changed lines only. +- Prioritize actionable, high-signal output over style commentary. + +Output format (required): +1. `## Verdict` + - `Block merge: yes|no` + - `Blocking findings: P0=, P1=` + - If no P0/P1 findings, include exact text: `No blocking findings`. +2. `## Findings` + - Markdown table: `ID | Severity | File:Line | Issue | Failure mode | Recommended fix | Confidence` + - IDs: F-001, F-002, ... +3. `## Testing Gaps` + - Missing tests that could hide regressions. +4. `## Open Questions` + - Only unresolved assumptions that affect correctness. + +Rules: +- Focus on correctness, security, reliability, and regression risk. +- Do not comment on formatting/import ordering/trivial naming. +- Keep recommendations patch-oriented and specific. +``` + +### Create `.reviews/templates/gemini-review.template.md` + +Only create if it does not already exist: + +```markdown +You are Gemini performing an independent PR review. + +Primary objective: +- Provide a rigorous risk assessment on changed code. +- Emphasize user impact and merge risk. + +Output format (required): +1. `## Executive Summary` + - 2-4 sentences on overall risk. + - `Merge recommendation: approve|changes-requested` + - If no P0/P1 findings, include exact text: `No blocking findings`. +2. `## Findings` + - Markdown table: `ID | Severity | Category | File:Line | Issue | Impact | Suggested fix | Confidence` + - IDs: G-001, G-002, ... + - Categories: Security | Correctness | Performance | Reliability | Testing +3. `## Regression & Testing Gaps` + - Missing test coverage and risky edge cases. +4. `## Assumptions` + - Only assumptions that materially affect conclusions. + +Rules: +- Review changed lines only. +- No style-only feedback. +- Suggested fixes must be concrete and immediately actionable. +``` + +### Make scripts executable + +```sh +chmod +x .reviews/scripts/pack.sh .reviews/scripts/render-prompt.sh .reviews/scripts/copy-prompt.sh +``` + +### Create `.reviews/PIPELINE.md` + +Write a brief usage guide explaining the pipeline, available scripts, and how to add custom reviewer templates. Refresh this on every run. + +## Step 3: Resolve the base branch + +1. `git merge-base main HEAD` → if it works, use it +2. Try `origin/main`, then `master`, `origin/master` +3. Store as `{base}` + +## Step 4: Check for a handoff + +Look for `.reviews/sessions/{session}/handoff.md`. If it exists, it will be included in the prompt. If not, warn the user that no handoff was found and suggest running `/create-handoff` first, but continue anyway. + +## Step 5: Generate the review pack + +```sh +bash .reviews/scripts/pack.sh "{base}" "{session}" ".reviews/sessions/{session}/pack.md" +``` + +## Step 6: Generate the review prompt + +```sh +bash .reviews/scripts/render-prompt.sh "{reviewer}" \ + ".reviews/sessions/{session}/pack.md" \ + ".reviews/sessions/{session}/handoff.md" \ + ".reviews/sessions/{session}/{reviewer}.prompt.md" \ + "{session}" +``` + +## Step 7: Copy to clipboard + +```sh +bash .reviews/scripts/copy-prompt.sh "{reviewer}" \ + ".reviews/sessions/{session}/pack.md" \ + ".reviews/sessions/{session}/handoff.md" \ + ".reviews/sessions/{session}/{reviewer}.prompt.md" \ + "{session}" +``` + +## Step 8: Report to the user + +Show: +- The prompt file path +- Whether it was copied to clipboard +- The reviewer template used (provider-specific or generic) +- Suggest: paste the prompt into the target model, or run with a different provider (e.g. `/create-review gemini`) + +Also mention: +- To add a custom reviewer, create `.reviews/templates/{name}-review.template.md` +- To review with multiple providers: run the skill again with a different argument + +## Step 9: Save current session + +Write the session name to `.reviews/.current-session` so subsequent runs can pick it up. + +## Rules + +- Only create template files if they don't already exist — preserve user customizations +- Always refresh scripts (pack.sh, render-prompt.sh, copy-prompt.sh) to latest version +- Always refresh PIPELINE.md to latest version +- Do NOT modify any source code +- If no git changes exist ahead of base, warn the user but still generate (they may have local uncommitted work) diff --git a/skills/fix-review/SKILL.md b/skills/fix-review/SKILL.md new file mode 100644 index 0000000..59dac67 --- /dev/null +++ b/skills/fix-review/SKILL.md @@ -0,0 +1,112 @@ +--- +name: fix-review +description: When the user asks to fix, address, or work on PR review comments — fetch review comments from a GitHub pull request and apply fixes to the local codebase. Requires gh CLI. +owner: chalk +version: "1.0.0" +metadata-version: "1" +allowed-tools: Bash, Read, Edit, Grep, Glob, Write +argument-hint: "[pr-number]" +--- + +# Fix PR Review Comments + +Fetch review comments from a GitHub PR and apply fixes to the local codebase. + +## Current PR context + +!`gh pr view --json number,url,headRefName 2>/dev/null || echo "NO_PR_FOUND"` + +## Step 1: Identify the PR + +If the user provided a PR number as `$ARGUMENTS`, use that instead of the auto-detected PR above. + +If no PR is found (output shows NO_PR_FOUND and no argument was given), stop and tell the user: +- There is no open PR for the current branch +- They need to either push and create a PR first, or provide a PR number + +## Step 2: Verify gh CLI is available + +```sh +gh --version 2>/dev/null || echo "GH_NOT_FOUND" +``` + +If `gh` is not installed, stop and tell the user to install it: https://cli.github.com + +## Step 3: Fetch review comments + +Fetch all inline review comments on the PR: + +```sh +gh api repos/{owner}/{repo}/pulls/{number}/comments --paginate +``` + +Each comment object has these relevant fields: +- `path` — file path +- `line` (or `original_line`) — line number in the new file +- `body` — the comment text +- `diff_hunk` — surrounding diff context +- `user.login` — who posted it + +## Step 4: Parse and classify comments + +### Bot review comments (structured severity markers) + +Look for severity markers in the comment `body`: +- `**🔴 Critical**` — Must fix. Production crash, security, data loss. +- `**🟠 High**` — Must fix. Significant bugs, logical flaws. +- `**🟡 Medium**` — Should fix. Tech debt, best practice deviation. +- `**🟢 Low**` — Optional. Nitpick, stylistic. +- `**✨ Praise**` — Skip. Positive feedback. + +Also extract from the body: +- **Category** (e.g. `**✅ Correctness**`, `**🛡️ Security**`) — appears after severity on the first line +- **Comment text** — the main feedback paragraph +- **Why it matters** — appears in a blockquote starting with `💡 **Why it matters:**` +- **Code suggestion** — appears in a ` ```suggestion ` fenced block (GitHub's suggested change format) + +### Human review comments (no severity markers) + +If a comment has no structured severity markers, classify it as a **human comment**. Do NOT auto-fix these — list them separately for the user to address manually. + +### Fallback: no bot comments found + +If there are zero comments with severity markers, treat ALL comments as potentially actionable: +- Show them to the user in a summary table +- Ask which ones to address +- Only proceed with explicit user confirmation + +## Step 5: Apply fixes + +Sort bot comments by severity: Critical > High > Medium > Low. + +For each comment (Critical, High, and Medium severity): +1. Read the file at `path` +2. Understand the issue described in the comment +3. If a `suggestion` block exists, use it as a strong hint — but verify it makes sense in context before applying blindly +4. Apply the fix. Make sure the fix is correct and doesn't break surrounding code +5. If a comment is unclear or the fix would require broader refactoring beyond the scope, note it and skip + +For Low severity: skip unless trivially fixable (one-line change). + +For Praise: skip entirely. + +## Step 6: Summary + +After applying fixes, provide a summary table: + +| Severity | File | Line | Status | Notes | +|----------|------|------|--------|-------| +| 🔴 Critical | path/to/file.ts | 42 | ✅ Fixed | Brief description | +| 🟠 High | path/to/other.ts | 17 | ⏭️ Skipped | Requires broader refactor | + +Then list: +- **Skipped comments** with reasoning +- **Human feedback** (non-bot comments) that the user should address manually + +## Rules + +- Do NOT blindly apply suggestions without reading the surrounding code +- Do NOT modify files that weren't mentioned in review comments +- If there are no review comments on the PR, tell the user and stop +- Human review comments should be shown to the user but not auto-fixed — list them separately as "Human feedback to address" +- If `gh` CLI is not authenticated, tell the user to run `gh auth login` diff --git a/skills/skills-index.yaml b/skills/skills-index.yaml index cbe8dab..d7dc3f9 100644 --- a/skills/skills-index.yaml +++ b/skills/skills-index.yaml @@ -4,10 +4,22 @@ skills: path: skills/create-doc/SKILL.md owner: chalk version: "1.0.0" + - name: create-handoff + path: skills/create-handoff/SKILL.md + owner: chalk + version: "1.0.0" - name: create-plan path: skills/create-plan/SKILL.md owner: chalk version: "1.0.0" + - name: create-review + path: skills/create-review/SKILL.md + owner: chalk + version: "1.0.0" + - name: fix-review + path: skills/fix-review/SKILL.md + owner: chalk + version: "1.0.0" - name: product-context-docs path: skills/product-context-docs/SKILL.md owner: chalk From 995204d3250f7a7c56226c6f7ee252d50c08dd5a Mon Sep 17 00:00:00 2001 From: breadoncee Date: Tue, 10 Mar 2026 12:59:07 +0800 Subject: [PATCH 2/2] fix(skills): address PR review feedback from Gemini MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix-review: require user confirmation before applying bot fixes (security) - create-review: sanitize reviewer argument to prevent path traversal (security) - create-handoff: fix shell variable placeholder syntax (session-name → session_name) - create-review: use two-dot git diff range for consistency --- skills/create-handoff/SKILL.md | 2 +- skills/create-review/SKILL.md | 6 +++--- skills/fix-review/SKILL.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/skills/create-handoff/SKILL.md b/skills/create-handoff/SKILL.md index d3ba3b6..383971c 100644 --- a/skills/create-handoff/SKILL.md +++ b/skills/create-handoff/SKILL.md @@ -25,7 +25,7 @@ Derive a session name from context: Create the session directory and handoff file: ```sh -SESSION_DIR=".reviews/${session-name}" +SESSION_DIR=".reviews/${session_name}" HANDOFF_PATH="$SESSION_DIR/handoff.md" mkdir -p "$SESSION_DIR" ``` diff --git a/skills/create-review/SKILL.md b/skills/create-review/SKILL.md index 32a0b2f..06a6e30 100644 --- a/skills/create-review/SKILL.md +++ b/skills/create-review/SKILL.md @@ -14,7 +14,7 @@ Bootstrap the review pipeline and generate a paste-ready review prompt for any A ## Step 1: Determine the reviewer and session -**Reviewer:** If the user provided `$ARGUMENTS`, use the first argument as the reviewer name (e.g. `codex`, `gemini`, `gpt4`, `claude`). If no argument, use `generic`. +**Reviewer:** If the user provided `$ARGUMENTS`, sanitize it to a safe kebab-case string (lowercase, strip any characters that aren't alphanumeric or hyphens, collapse multiple hyphens) and use that as the reviewer name (e.g. `codex`, `gemini`, `gpt4`, `claude`). If no argument, use `generic`. **Session:** Detect from context: 1. If `.reviews/` exists, check for the most recent session directory @@ -71,11 +71,11 @@ mkdir -p "$(dirname "$OUTPUT_PATH")" echo echo "## Diff Stat" echo '```' - git diff --stat "$MERGE_BASE"...HEAD 2>/dev/null || echo "(no committed diff)" + git diff --stat "$MERGE_BASE"..HEAD 2>/dev/null || echo "(no committed diff)" echo '```' echo echo "## Changed Files" - CHANGED="$(git diff --name-only "$MERGE_BASE"...HEAD 2>/dev/null || true)" + CHANGED="$(git diff --name-only "$MERGE_BASE"..HEAD 2>/dev/null || true)" if [ -n "$CHANGED" ]; then echo "$CHANGED" | while IFS= read -r f; do [ -n "$f" ] && echo "- $f"; done else diff --git a/skills/fix-review/SKILL.md b/skills/fix-review/SKILL.md index 59dac67..3f29508 100644 --- a/skills/fix-review/SKILL.md +++ b/skills/fix-review/SKILL.md @@ -83,7 +83,7 @@ For each comment (Critical, High, and Medium severity): 1. Read the file at `path` 2. Understand the issue described in the comment 3. If a `suggestion` block exists, use it as a strong hint — but verify it makes sense in context before applying blindly -4. Apply the fix. Make sure the fix is correct and doesn't break surrounding code +4. Show the proposed fix to the user and ask for explicit confirmation before applying it. 5. If a comment is unclear or the fix would require broader refactoring beyond the scope, note it and skip For Low severity: skip unless trivially fixable (one-line change).