Skip to content
Open
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d52a3a4
feat: add maintenance skills — deps-audit, bench-check, test-health, …
carlos-alm Mar 21, 2026
b187fe1
Merge branch 'main' into feat/maintenance-skills
carlos-alm Mar 21, 2026
a562b52
fix(bench-check): capture stderr, guard division-by-zero, commit base…
carlos-alm Mar 21, 2026
4fc994d
fix(deps-audit): run npm ci after revert, document tokenizer skip reason
carlos-alm Mar 21, 2026
89aef6b
fix(housekeep): guard Phase 5 in source repo, fix stale-worktree crit…
carlos-alm Mar 21, 2026
3e892d1
Merge remote-tracking branch 'origin/feat/maintenance-skills' into fe…
carlos-alm Mar 21, 2026
ce5d811
fix: address Round 3 Greptile review feedback
carlos-alm Mar 22, 2026
01b5110
fix: move deps-audit stash to Phase 0, before npm commands modify man…
carlos-alm Mar 22, 2026
3b0e293
fix: capture flaky-detection loop output to per-run files for comparison
carlos-alm Mar 22, 2026
52de495
fix: always require confirmation for stale worktree removal
carlos-alm Mar 22, 2026
8be5cec
fix: use parsed threshold in baseline.json, guard --compare-only on f…
carlos-alm Mar 22, 2026
0691ffc
Merge branch 'main' into feat/maintenance-skills
carlos-alm Mar 22, 2026
87d9213
fix(deps-audit): track stash creation to avoid operating on wrong entry
carlos-alm Mar 22, 2026
65d9836
fix(test-health): use mktemp for flaky-run directory to avoid concurr…
carlos-alm Mar 22, 2026
eef2c03
fix(bench-check): add save-baseline verdict path, fix em-dash, use ex…
carlos-alm Mar 22, 2026
19b14e9
docs(roadmap): update Phase 5 TypeScript migration with accurate prog…
carlos-alm Mar 22, 2026
5bda6ba
fix: deps-audit success path should keep npm changes, not revert (#565)
carlos-alm Mar 22, 2026
bd0ba1a
fix: bench-check use git add + diff --cached to detect new files (#565)
carlos-alm Mar 22, 2026
7b91e3c
fix: housekeep require confirmation before branch deletion (#565)
carlos-alm Mar 22, 2026
7fcdd93
Merge branch 'main' into feat/maintenance-skills
carlos-alm Mar 23, 2026
5462d32
fix: scope git diff --cached to bench-check files only (#565)
carlos-alm Mar 23, 2026
457e6b9
fix: use json-summary reporter to match coverage-summary.json output …
carlos-alm Mar 23, 2026
852003d
fix: capture stash ref by name to avoid position-based targeting (#565)
carlos-alm Mar 23, 2026
eea2954
fix: remove unreachable Phase 5 subphases since source-repo guard alw…
carlos-alm Mar 23, 2026
baf6797
Merge remote-tracking branch 'origin/feat/maintenance-skills' into fi…
carlos-alm Mar 23, 2026
9b4869c
fix: use dynamic threshold variable in bench-check Phase 6 report tem…
carlos-alm Mar 23, 2026
8d92c99
fix: address open review items in maintenance skills (#565)
carlos-alm Mar 23, 2026
9ad37ea
fix: add COVERAGE_ONLY guards to Phase 2 and Phase 4 in test-health
carlos-alm Mar 23, 2026
30ab30e
fix: add regression skip guard to bench-check Phase 5, expand deps-au…
carlos-alm Mar 23, 2026
a8631d2
fix: add empty-string guard for stat size check in housekeep (#565)
carlos-alm Mar 23, 2026
8fd7430
fix: add BASELINE SAVED verdict path and clarify if/else-if in bench-…
carlos-alm Mar 23, 2026
23f2f76
docs(roadmap): mark Phase 4 complete, update Phase 5 progress (5 of 7)
carlos-alm Mar 23, 2026
2616c78
docs(roadmap): correct Phase 5 progress — 5.3/5.4/5.5 still in progress
carlos-alm Mar 23, 2026
9d2b7ff
fix(skill): ban untracked deferrals in /review skill
carlos-alm Mar 23, 2026
dbe4a73
fix(skill): add --repo flag, multi-endpoint reply for deferrals, and …
carlos-alm Mar 23, 2026
ca1d369
fix(skill): guard follow-up label creation before gh issue create (#568)
carlos-alm Mar 23, 2026
39a8bbe
Merge branch 'main' into fix/review-skill-untracked-deferrals
carlos-alm Mar 23, 2026
424980e
feat(skill): parallelize /review with one subagent per PR
carlos-alm Mar 23, 2026
84acbc7
fix: correct heredoc terminator indentation in review skill (#568)
carlos-alm Mar 23, 2026
a898e4a
Merge branch 'main' into fix/review-skill-untracked-deferrals
carlos-alm Mar 23, 2026
0d18b8f
fix: resolve merge conflicts with main and fix issue body URL anchors…
carlos-alm Mar 23, 2026
7643a79
fix(skill): capture gh issue create output before referencing issue n…
carlos-alm Mar 23, 2026
f4978aa
fix(skill): surface follow-up issues in review result format and summ…
carlos-alm Mar 24, 2026
e671711
fix(skill): require verbatim rule propagation to subagents
carlos-alm Mar 24, 2026
6577f91
fix(skill): align Issues field name between 2i result and Step 3 tabl…
carlos-alm Mar 24, 2026
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
94 changes: 65 additions & 29 deletions .claude/skills/review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,30 @@ Record each PR's number, branch, base, merge status, and CI state.

---

## Step 2: Process Each PR
## Step 2: Launch Parallel Subagents

For **each** open PR, perform the following steps in order. Process PRs one at a time to avoid cross-contamination.
Each PR is independent work — **launch one Agent subagent per PR, all in parallel.** Use `isolation: "worktree"` so each agent gets its own copy of the repo with no cross-PR contamination.

### 2a. Switch to the PR branch
Pass each agent the full PR processing instructions (Steps 2a–2i below) along with the PR number, branch, base, and current state from Step 1. The agent prompt must include **all** the rules from the Rules section at the bottom of this skill — copy them **verbatim**, do not paraphrase or summarize.

Ensure the working tree is clean before switching to avoid cross-PR contamination:

```bash
if [ -n "$(git status --porcelain)" ]; then
git stash push -m "pre-checkout stash"
fi
```
For each PR, launch an Agent with:
- description: "Review PR #<number>"
- isolation: "worktree"
- prompt: <the full PR processing instructions below, with PR details filled in>
```

Launch **all** PR agents in a single message (one tool call per PR) so they run concurrently. Do NOT wait for one to finish before starting the next.

Each agent will return a result summary. Collect all results for the final summary table in Step 3.

---

## PR Processing Instructions (for each subagent)

The following steps are executed by each subagent for its assigned PR.

Then check out the PR branch:
### 2a. Check out the PR branch

```bash
gh pr checkout <number>
Expand Down Expand Up @@ -120,27 +129,36 @@ For **each** review comment — including minor suggestions, nits, style feedbac
2. **Read the relevant code** at the file and line referenced.
3. **Make the change.** Even if the comment is marked as "nit" or "suggestion" or "minor" — address it. The goal is zero outstanding comments.
4. **If you disagree** with a suggestion (e.g., it would introduce a bug or contradicts project conventions), do NOT silently ignore it. Reply to the comment explaining why you chose a different approach.
5. **If the fix is genuinely out of scope** for this PR (e.g., it affects a different module not touched by this PR, or requires a design decision beyond the PR's purpose), you MUST create a GitHub issue to track it before replying. Never reply with "acknowledged as follow-up" or "noted for later" without a tracked issue — untracked deferrals get lost and nobody will ever revisit them.
5. **If the fix is genuinely out of scope** for this PR, you MUST create a GitHub issue to track it before replying. Never reply with "acknowledged as follow-up" or "noted for later" without a tracked issue — untracked deferrals get lost and nobody will ever revisit them. "Genuinely out of scope" means the fix touches a different module not in the PR's diff, requires an architectural decision beyond the PR's mandate, or would introduce unrelated risk. Fixing a variable name, adding a null check, or adjusting a string in a file already in the diff is NOT out of scope — just do it.

```bash
# Create a tracking issue for the deferred item
gh issue create \
# Ensure the follow-up label exists (safe to re-run)
gh label create "follow-up" --color "0e8a16" --description "Deferred from PR review" --repo optave/codegraph 2>/dev/null || true

# Create a tracking issue for the deferred item and capture the issue number
issue_url=$(gh issue create \
--repo optave/codegraph \
--title "follow-up: <concise description of what needs to be done>" \
--body "$(cat <<'EOF'
Deferred from PR #<number> review.
--body "$(cat <<-'EOF'
Deferred from PR #<number> review.

**Original reviewer comment:** https://github.com/optave/codegraph/pull/<number>#discussion_r<comment-id>
**Original reviewer comment:** <use the correct permalink format for the comment type: inline review comment → `https://github.com/optave/codegraph/pull/<number>#discussion_r<comment-id>`, top-level review body → `https://github.com/optave/codegraph/pull/<number>#pullrequestreview-<review-id>`, issue-style comment → `https://github.com/optave/codegraph/issues/<number>#issuecomment-<comment-id>`>

**Context:** <why this is out of scope for the current PR and what the fix entails>
EOF
**Context:** <why this is out of scope for the current PR and what the fix entails>
EOF
)" \
--label "follow-up"
--label "follow-up")
issue_number=$(echo "$issue_url" | grep -oE '[0-9]+$')
```

Then reply to the reviewer comment referencing the issue:
Then reply to the reviewer comment referencing the issue (using `$issue_number` captured above). Use the same reply mechanism as step 6 below — inline PR review comments use `/pulls/<number>/comments/<comment-id>/replies`, top-level review bodies and issue-style comments use `/issues/<number>/comments`:
```bash
# For inline PR review comments:
gh api repos/optave/codegraph/pulls/<number>/comments/<comment-id>/replies \
-f body="Out of scope for this PR — tracked in #<issue-number>"
-f body="Out of scope for this PR — tracked in #$issue_number"
# For top-level review bodies or issue-style comments:
gh api repos/optave/codegraph/issues/<number>/comments \
-f body="Out of scope for this PR — tracked in #$issue_number"
```
6. **Reply to each comment** explaining what you did. The reply mechanism depends on where the comment lives:

Expand Down Expand Up @@ -183,7 +201,7 @@ After addressing all comments for a PR:

### 2g. Re-trigger reviewers

**Greptile:** Before re-triggering, check if your last reply to Greptile already has a positive emoji reaction (👍, ✅, 🎉, etc.) from `greptileai`. A positive reaction means Greptile is satisfied with your fix — do NOT re-trigger in that case, move on. Only re-trigger if there is no positive reaction on your last comment:
**Greptile:** Before re-triggering, check if your last reply to Greptile already has a positive emoji reaction (thumbs up, check, party, etc.) from `greptileai`. A positive reaction means Greptile is satisfied with your fix — do NOT re-trigger in that case, move on. Only re-trigger if there is no positive reaction on your last comment:

```bash
# Check reactions on your most recent comment to see if Greptile already approved
Expand Down Expand Up @@ -211,21 +229,39 @@ After re-triggering:
1. Wait for the new reviews to come in (check after a reasonable interval).
2. Fetch new comments again (repeat Step 2d).
3. If there are **new** comments from Greptile or Claude, go back to Step 2e and address them.
4. **Repeat this loop for a maximum of 3 rounds.** If after 3 rounds there are still actionable comments, mark the PR as "needs human review" in the summary table and move to the next PR.
4. **Repeat this loop for a maximum of 3 rounds.** If after 3 rounds there are still actionable comments, mark the PR as "needs human review" in the result.
5. Verify CI is still green after all changes.

### 2i. Return result

At the end of processing, the subagent MUST return a structured result with these fields so the main agent can build the summary table:

```
PR: #<number>
Branch: <branch-name>
Conflicts: resolved | none
CI: green | red | pending
Comments Addressed: <count>
Issues: <comma-separated list of #<n> follow-up issues, or "none">
Reviewers Re-triggered: <list>
Status: ready | needs-work | needs-human-review | skipped
Notes: <any issues encountered>
```

---

## Step 3: Summary
## Step 3: Collect Results and Summarize

After processing all PRs, output a summary table:
After **all** subagents complete, collect their results and output a summary table:

```
| PR | Branch | Conflicts | CI | Comments Addressed | Reviewers Re-triggered | Status |
|----|--------|-----------|----|--------------------|----------------------|--------|
| #N | branch | resolved/none | green/red | N comments | greptile, claude | ready/needs-work |
| PR | Branch | Conflicts | CI | Comments Addressed | Issues | Reviewers Re-triggered | Status |
|----|--------|-----------|----|--------------------|--------|----------------------|--------|
| #N | branch | resolved/none | green/red | N comments | #X, #Y or none | greptile, claude | ready/needs-work |
```

If any subagent failed or returned an error, note it in the Status column as `agent-error` with the failure reason.

---

## Rules
Expand All @@ -234,7 +270,7 @@ After processing all PRs, output a summary table:
- **Never force-push** unless fixing a commit message that fails commitlint. Amend + force-push is the only way to fix a pushed commit title (messages are part of the SHA). This is safe on feature branches. For all other problems, fix with a new commit.
- **Address ALL comments from ALL reviewers** (Claude, Greptile, and humans), even minor/nit/optional ones. Leave zero unaddressed. Do not only respond to one reviewer and skip another.
- **Always reply to comments** explaining what was done. Don't just fix silently. Every reviewer must see a reply on their feedback.
- **Don't re-trigger Greptile if already approved.** If your last reply to a Greptile comment has a positive emoji reaction (👍, ✅, 🎉) from `greptileai`, it's already satisfied — skip re-triggering.
- **Don't re-trigger Greptile if already approved.** If your last reply to a Greptile comment has a positive emoji reaction from `greptileai`, it's already satisfied — skip re-triggering.
- **Only re-trigger Claude** if you addressed Claude's feedback specifically.
- **No co-author lines** in commit messages.
- **No Claude Code references** in commit messages or comments.
Expand Down
Loading