Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/create-handoff/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=".chalk/reviews/${session_name}"
HANDOFF_PATH="$SESSION_DIR/handoff.md"
mkdir -p "$SESSION_DIR"
```
Expand Down
48 changes: 24 additions & 24 deletions skills/create-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ Bootstrap the review pipeline and generate a paste-ready review prompt for any A
**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
1. If `.chalk/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:
Check if `.chalk/reviews/scripts/pack.sh` exists. If not, bootstrap the full pipeline:

```sh
mkdir -p .reviews/scripts .reviews/templates .reviews/sessions
mkdir -p .chalk/reviews/scripts .chalk/reviews/templates .chalk/reviews/sessions
```

### Create `.reviews/scripts/pack.sh`
### Create `.chalk/reviews/scripts/pack.sh`

This script generates a review context pack from git state:

Expand All @@ -41,7 +41,7 @@ set -euo pipefail

BASE_REF="${1:-origin/main}"
SESSION="${2:-adhoc}"
OUTPUT_PATH="${3:-.reviews/sessions/${SESSION}/pack.md}"
OUTPUT_PATH="${3:-.chalk/reviews/sessions/${SESSION}/pack.md}"

# Resolve base ref
if ! git rev-parse --verify "$BASE_REF" >/dev/null 2>&1; then
Expand Down Expand Up @@ -96,7 +96,7 @@ mkdir -p "$(dirname "$OUTPUT_PATH")"
echo "PACK_PATH=$OUTPUT_PATH"
```

### Create `.reviews/scripts/render-prompt.sh`
### Create `.chalk/reviews/scripts/render-prompt.sh`

This script combines pack + handoff + reviewer template into a prompt:

Expand Down Expand Up @@ -162,7 +162,7 @@ mkdir -p "$(dirname "$OUTPUT_PATH")"
echo "PROMPT_PATH=$OUTPUT_PATH"
```

### Create `.reviews/scripts/copy-prompt.sh`
### Create `.chalk/reviews/scripts/copy-prompt.sh`

```sh
#!/usr/bin/env bash
Expand Down Expand Up @@ -194,7 +194,7 @@ if [ "$COPIED" -eq 0 ]; then
fi
```

### Create `.reviews/templates/generic-review.template.md`
### Create `.chalk/reviews/templates/generic-review.template.md`

Only create if it does not already exist (preserve user customizations):

Expand Down Expand Up @@ -222,7 +222,7 @@ Rules:
- If no blocking issues exist, explicitly state: `No blocking findings`.
```

### Create `.reviews/templates/codex-review.template.md`
### Create `.chalk/reviews/templates/codex-review.template.md`

Only create if it does not already exist:

Expand Down Expand Up @@ -252,7 +252,7 @@ Rules:
- Keep recommendations patch-oriented and specific.
```

### Create `.reviews/templates/gemini-review.template.md`
### Create `.chalk/reviews/templates/gemini-review.template.md`

Only create if it does not already exist:

Expand Down Expand Up @@ -286,10 +286,10 @@ Rules:
### Make scripts executable

```sh
chmod +x .reviews/scripts/pack.sh .reviews/scripts/render-prompt.sh .reviews/scripts/copy-prompt.sh
chmod +x .chalk/reviews/scripts/pack.sh .chalk/reviews/scripts/render-prompt.sh .chalk/reviews/scripts/copy-prompt.sh
```

### Create `.reviews/PIPELINE.md`
### Create `.chalk/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.

Expand All @@ -301,31 +301,31 @@ Write a brief usage guide explaining the pipeline, available scripts, and how to

## 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.
Look for `.chalk/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"
bash .chalk/reviews/scripts/pack.sh "{base}" "{session}" ".chalk/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" \
bash .chalk/reviews/scripts/render-prompt.sh "{reviewer}" \
".chalk/reviews/sessions/{session}/pack.md" \
".chalk/reviews/sessions/{session}/handoff.md" \
".chalk/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" \
bash .chalk/reviews/scripts/copy-prompt.sh "{reviewer}" \
".chalk/reviews/sessions/{session}/pack.md" \
".chalk/reviews/sessions/{session}/handoff.md" \
".chalk/reviews/sessions/{session}/{reviewer}.prompt.md" \
"{session}"
```

Expand All @@ -338,12 +338,12 @@ Show:
- 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 add a custom reviewer, create `.chalk/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.
Write the session name to `.chalk/reviews/.current-session` so subsequent runs can pick it up.

## Rules

Expand Down
156 changes: 156 additions & 0 deletions skills/fix-findings/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
name: fix-findings
description: Fix findings from the active review session — reads reviewer findings files, applies fixes by priority, and updates the resolution log. Use after pasting reviewer output into findings files.
owner: chalk
version: "1.0.0"
metadata-version: "1"
allowed-tools: Bash, Read, Edit, Grep, Glob, Write
Comment thread
breadoncee marked this conversation as resolved.
argument-hint: "[reviewer-name|all] e.g. codex, gemini, gpt4, or omit for all"
---

# Fix Review Session Findings

Read findings from the active review session and apply fixes to the codebase, then update the resolution log.

## Step 1: Resolve the active session

Look for the current session:

1. Check `.chalk/reviews/.current-session`
2. If not found, check for the most recent session directory under `.chalk/reviews/sessions/`
3. If nothing found, stop and tell the user to run `/create-review` first to start a session

Store the session ID as `{session}`.

## Step 2: Determine which findings to load

Based on `$ARGUMENTS`:

- If a reviewer name is provided (e.g. `codex`, `gemini`, `gpt4`, `claude`), sanitize it to kebab-case and load only `.chalk/reviews/sessions/{session}/{reviewer}.findings.md`
- If `all` or no argument → load all `*.findings.md` files in the session directory

Discover available findings dynamically using the Glob tool:

```
.chalk/reviews/sessions/{session}/*.findings.md
```

Do NOT use shell `ls` for discovery — use the Glob tool to avoid command injection and handle special characters safely.

If a findings file doesn't exist or contains only template placeholder text, skip it and note that no findings are available from that reviewer.

If no findings are available from any reviewer, stop and tell the user to paste reviewer output into the findings files first. Show the expected path: `.chalk/reviews/sessions/{session}/{reviewer-name}.findings.md`

## Step 3: Parse findings

From each findings file, extract the findings table. Each row typically has:

- **ID** — finding identifier (e.g. `F-001`, `G-001`, or any prefix)
- **Severity** — `P0`, `P1`, `P2`, `P3`
- **File:Line** — source location (e.g. `src/main/auth.ts:172`)
- **Issue** — description of the problem
- **Failure mode** or **Impact** — what goes wrong
- **Recommended fix** or **Suggested fix** — how to fix it
- **Confidence** — reviewer confidence score (if present)

Sort all findings across all reviewers by severity: P0 > P1 > P2 > P3.

Deduplicate findings that target the same file and line (or overlapping line range) across reviewers. Two findings are duplicates if they reference the same file path AND the same line number (or lines within 5 of each other) AND describe a similar category of issue. When deduplicating, keep all IDs, use the more detailed description, and note both reviewers as sources.

## Step 4: Present findings and get confirmation

Before applying any fixes, present the user with a prioritized summary:

| Priority | ID(s) | Source | File:Line | Issue (1-line) | Action |
|----------|--------|--------|-----------|----------------|--------|
| P0 | G-001 | gemini | src/main/auth.ts:31 | Plaintext token storage | Fix |
| P1 | F-001 | codex | src/main/index.ts:182 | Stale auth target | Fix |
| ... | ... | ... | ... | ... | ... |

Ask the user which findings to fix. Options:
- **All** — fix everything P0-P2 (skip P3 unless trivial)
- **Blocking only** — fix P0 and P1 only
- **Let me choose** — user picks specific finding IDs

## Step 5: Apply fixes

For each finding to fix (in priority order):

1. **Validate the file path** — confirm the path is relative and within the repository root. Reject any absolute paths or paths containing `..` that escape the repo
2. **Read the file** at the specified path and line — read at least 30 lines of surrounding context (15 above, 15 below) to understand the code structure
3. **Design the fix** using the reviewer's suggested fix as guidance, but verify it makes sense in context
4. **Show the proposed fix to the user and ask for explicit confirmation before applying it**
5. **Apply the fix** using Edit tool
6. **Verify** the fix doesn't break surrounding code or introduce new issues

Rules:
- Do NOT blindly copy suggested fixes — they're guidance, not exact patches
- If a fix requires changes across multiple files, make all related changes together
- If a fix is unclear or would require significant refactoring beyond the finding's scope, skip it and mark as `deferred` in the resolution log
- For P3 findings: only fix if the change is a single-line or obvious one-liner (e.g. rename, add a null check, fix a typo). Otherwise skip
- After fixing deduplicated findings, note all IDs as resolved

## Step 6: Update the resolution log

Write or update `.chalk/reviews/sessions/{session}/resolution.md`.

If the file already exists, preserve any metadata comments at the top. Fill in:

```markdown
# Finding Resolution Log

## Summary
- Session: {session}
- Item: {inferred from session name}
- Reviewers: {list of reviewer sources found — e.g. codex, gemini}
- Decision owner:

## Findings

| ID | Severity | Source | File:Line | Decision | Notes |
|---|---|---|---|---|---|
| G-001 | P0 | gemini | src/main/auth.ts:31 | fixed | Wrapped token persistence with safeStorage |
| F-001 | P1 | codex | src/main/index.ts:182 | fixed | Rebind auth target in createWindow |

Decision values:
- fixed
- accepted-risk
- deferred
- not-repro

## Follow-up Tasks
- {deferred work, test gaps, items needing manual verification}

## Final Gate
- Build:
- Tests:
- Ready to merge: yes/no
```

## Step 7: Summary

After all fixes are applied, show:

1. A results table:

| ID(s) | Severity | Source | Status | What was done |
|--------|----------|--------|--------|---------------|
| G-001 | P0 | gemini | Fixed | Wrapped token persistence with safeStorage |
| F-001 | P1 | codex | Fixed | Rebind auth target in createWindow |
| G-004 | P3 | gemini | Skipped | Trivial but not blocking |

2. The resolution log path
3. Suggest next steps:
- Run build/tests to verify nothing broke
- Run `/commit` to commit the fixes
- If all blocking findings are resolved, create or update the PR

## Rules

- ALWAYS validate that file paths from findings are relative and within the repository root — reject absolute paths or paths with `..` escaping the repo
- ALWAYS read the file with surrounding context before applying any fix
- Do NOT modify files that aren't referenced in findings
- Do NOT fix things that aren't in the findings — stay scoped
- If multiple reviewers suggest conflicting fixes for the same issue, present both suggestions to the user and let them choose which approach to take
- Keep fixes minimal — address the finding, don't refactor surrounding code
- If build or typecheck breaks after a fix, attempt to resolve but note it in the resolution log
Comment thread
breadoncee marked this conversation as resolved.
4 changes: 4 additions & 0 deletions skills/skills-index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ skills:
path: skills/create-review/SKILL.md
owner: chalk
version: "1.0.0"
- name: fix-findings
path: skills/fix-findings/SKILL.md
owner: chalk
version: "1.0.0"
- name: fix-review
path: skills/fix-review/SKILL.md
owner: chalk
Expand Down