Skip to content

Commit e02efb3

Browse files
GiggleLiuclaude
andcommitted
Fix bugs in skills: wrong tool name, broken regex, missing steps
- review-implementation: "Task tool" → "Agent tool" (tool doesn't exist) - review-implementation: Remove narrow HEAD~1 detection, use main..HEAD only - review-implementation: Add run_in_background guidance for parallel dispatch - structural-reviewer-prompt: Fix grep-style \| to ripgrep | alternation - fix-pr: Add $REPO resolution, replace {owner}/{repo} placeholders - fix-pr: Clarify --jq warning scope (gh api only, not gh pr view) - add-rule: Add export_schemas to Step 6, fix section title - add-model: Add Step 2.5 for declare_variants! macro registration - add-model: Add declare_variants! to Common Mistakes table Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4be9c01 commit e02efb3

5 files changed

Lines changed: 37 additions & 18 deletions

File tree

.claude/skills/add-model/SKILL.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,22 @@ Key decisions:
8585
- **`dims()`:** returns the configuration space dimensions (e.g., `vec![2; n]` for binary variables)
8686
- **`evaluate()`:** must check feasibility first, then compute objective
8787

88+
## Step 2.5: Register variant complexity
89+
90+
Add `declare_variants!` at the bottom of the model file (after the trait impls, before the test link). Each line declares a concrete type instantiation with its best-known worst-case complexity:
91+
92+
```rust
93+
crate::declare_variants! {
94+
ProblemName<SimpleGraph, i32> => "1.1996^num_vertices",
95+
ProblemName<SimpleGraph, One> => "1.1996^num_vertices",
96+
}
97+
```
98+
99+
- The complexity string references the getter method names from Step 1.5 (e.g., `num_vertices`)
100+
- One entry per supported `(graph, weight)` combination
101+
- The string is parsed as an `Expr` AST — supports `+`, `*`, `^`, `exp()`, `log()`, `sqrt()`
102+
- See `src/models/graph/maximum_independent_set.rs` for the reference pattern
103+
88104
## Step 3: Register the model
89105

90106
Update these files to register the new problem type:
@@ -146,5 +162,6 @@ Then run the [review-implementation](../review-implementation/SKILL.md) skill to
146162
| Missing `#[path]` test link | Add `#[cfg(test)] #[path = "..."] mod tests;` at file bottom |
147163
| Wrong `dims()` | Must match the actual configuration space (e.g., `vec![2; n]` for binary) |
148164
| Not registering in `mod.rs` | Must update both `<category>/mod.rs` and `models/mod.rs` |
165+
| Forgetting `declare_variants!` | Required for variant complexity metadata used by the paper's auto-generated table |
149166
| Forgetting CLI dispatch | Must add match arms in `dispatch.rs` (`load_problem` + `serialize_any_problem`) |
150167
| Forgetting CLI alias | Must add lowercase entry in `problem_name.rs` `resolve_alias()` |

.claude/skills/add-rule/SKILL.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,12 @@ example_fn!(test_<source>_to_<target>, reduction_<source>_to_<target>);
131131

132132
Invoke the `/write-rule-in-paper` skill to write the reduction-rule entry in `docs/paper/reductions.typ`. That skill covers the full authoring process: complexity citation, self-contained proof, detailed worked example, and verification checklist.
133133

134-
## Step 6: Regenerate graph and verify
134+
## Step 6: Regenerate exports and verify
135135

136136
```bash
137-
cargo run --example export_graph # Update reduction_graph.json
138-
make test clippy # Must pass
137+
cargo run --example export_graph # Update reduction_graph.json
138+
cargo run --example export_schemas # Update problem schemas
139+
make test clippy # Must pass
139140
```
140141

141142
Then run the [review-implementation](../review-implementation/SKILL.md) skill to verify all structural and semantic checks pass.

.claude/skills/fix-pr/SKILL.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ Resolve PR review comments, fix CI failures, and address codecov coverage gaps f
1111

1212
**IMPORTANT:** Do NOT use `gh api --jq` for extracting data — it uses a built-in jq that
1313
chokes on response bodies containing backslashes (common in Copilot code suggestions).
14-
Always pipe to `python3 -c` instead.
14+
Always pipe to `python3 -c` instead. (`gh pr view --jq` is fine — only `gh api --jq` is affected.)
1515

1616
```bash
17+
# Get repo identifiers
18+
REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner) # e.g., "owner/repo"
19+
1720
# Get PR number
1821
PR=$(gh pr view --json number --jq .number)
1922

2023
# Get PR head SHA (on remote)
21-
HEAD_SHA=$(gh api repos/{owner}/{repo}/pulls/$PR | python3 -c "import sys,json; print(json.load(sys.stdin)['head']['sha'])")
24+
HEAD_SHA=$(gh api repos/$REPO/pulls/$PR | python3 -c "import sys,json; print(json.load(sys.stdin)['head']['sha'])")
2225
```
2326

2427
### 1a. Fetch Review Comments
@@ -27,23 +30,23 @@ Three sources of feedback to check:
2730

2831
```bash
2932
# Copilot and user inline review comments (on code lines)
30-
gh api repos/{owner}/{repo}/pulls/$PR/comments | python3 -c "
33+
gh api repos/$REPO/pulls/$PR/comments | python3 -c "
3134
import sys,json
3235
for c in json.load(sys.stdin):
3336
line = c.get('line') or c.get('original_line') or '?'
3437
print(f'[{c[\"user\"][\"login\"]}] {c[\"path\"]}:{line} — {c[\"body\"]}')
3538
"
3639

3740
# Review-level comments (top-level review body)
38-
gh api repos/{owner}/{repo}/pulls/$PR/reviews | python3 -c "
41+
gh api repos/$REPO/pulls/$PR/reviews | python3 -c "
3942
import sys,json
4043
for r in json.load(sys.stdin):
4144
if r.get('body'):
4245
print(f'[{r[\"user\"][\"login\"]}] {r[\"state\"]}: {r[\"body\"]}')
4346
"
4447

4548
# Issue-level comments (general discussion, excluding bots)
46-
gh api repos/{owner}/{repo}/issues/$PR/comments | python3 -c "
49+
gh api repos/$REPO/issues/$PR/comments | python3 -c "
4750
import sys,json
4851
for c in json.load(sys.stdin):
4952
login = c['user']['login']
@@ -56,7 +59,7 @@ for c in json.load(sys.stdin):
5659

5760
```bash
5861
# All check runs on the PR head
59-
gh api repos/{owner}/{repo}/commits/$HEAD_SHA/check-runs | python3 -c "
62+
gh api repos/$REPO/commits/$HEAD_SHA/check-runs | python3 -c "
6063
import sys,json
6164
for cr in json.load(sys.stdin)['check_runs']:
6265
print(f'{cr[\"name\"]}: {cr.get(\"conclusion\") or cr[\"status\"]}')
@@ -67,7 +70,7 @@ for cr in json.load(sys.stdin)['check_runs']:
6770

6871
```bash
6972
# Codecov bot comment with coverage diff
70-
gh api repos/{owner}/{repo}/issues/$PR/comments | python3 -c "
73+
gh api repos/$REPO/issues/$PR/comments | python3 -c "
7174
import sys,json
7275
for c in json.load(sys.stdin):
7376
if c['user']['login'] == 'codecov[bot]':
@@ -129,7 +132,7 @@ For detailed line-by-line coverage, use the Codecov API:
129132

130133
```bash
131134
# Get file-level coverage for the PR
132-
gh api repos/{owner}/{repo}/issues/$PR/comments | python3 -c "
135+
gh api repos/$REPO/issues/$PR/comments | python3 -c "
133136
import sys,json,re
134137
for c in json.load(sys.stdin):
135138
if c['user']['login'] == 'codecov[bot]':

.claude/skills/review-implementation/SKILL.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ Dispatches two parallel review subagents with fresh context (no implementation h
2121
Determine whether new model/rule files were added:
2222

2323
```bash
24-
# Check for NEW files (not just modifications)
25-
git diff --name-only --diff-filter=A HEAD~1..HEAD
26-
# Also check against main for branch-level changes
24+
# Check for NEW files across the entire branch
2725
git diff --name-only --diff-filter=A main..HEAD
2826
```
2927

@@ -77,7 +75,7 @@ If an issue is found, pass it as `{ISSUE_CONTEXT}` to both subagents. If not, se
7775

7876
### Structural Reviewer (if new model/rule detected)
7977

80-
Dispatch using `Task` tool with `subagent_type="superpowers:code-reviewer"`:
78+
Dispatch using `Agent` tool with `subagent_type="superpowers:code-reviewer"`:
8179

8280
- Read `structural-reviewer-prompt.md` from this skill directory
8381
- Fill placeholders:
@@ -90,7 +88,7 @@ Dispatch using `Task` tool with `subagent_type="superpowers:code-reviewer"`:
9088

9189
### Quality Reviewer (always)
9290

93-
Dispatch using `Task` tool with `subagent_type="superpowers:code-reviewer"`:
91+
Dispatch using `Agent` tool with `subagent_type="superpowers:code-reviewer"`:
9492

9593
- Read `quality-reviewer-prompt.md` from this skill directory
9694
- Fill placeholders:
@@ -101,7 +99,7 @@ Dispatch using `Task` tool with `subagent_type="superpowers:code-reviewer"`:
10199
- `{ISSUE_CONTEXT}` -> full issue title + body (or "No linked issue found.")
102100
- Prompt = filled template
103101

104-
**Both subagents must be dispatched in parallel** (single message, two Task tool calls).
102+
**Both subagents must be dispatched in parallel** (single message with two Agent tool calls — use `run_in_background: true` on one, foreground on the other, then read the background result with `TaskOutput`).
105103

106104
## Step 4: Collect and Address Findings
107105

.claude/skills/review-implementation/structural-reviewer-prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Given: problem name `P` = `{PROBLEM_NAME}`, category `C` = `{CATEGORY}`, file st
3030
| 2 | `inventory::submit!` present | `Grep("inventory::submit", file)` |
3131
| 3 | `#[derive(...Serialize, Deserialize)]` on struct | `Grep("Serialize.*Deserialize", file)` |
3232
| 4 | `Problem` trait impl | `Grep("impl.*Problem for.*{P}", file)` |
33-
| 5 | `OptimizationProblem` or `SatisfactionProblem` impl | `Grep("(OptimizationProblem\|SatisfactionProblem).*for.*{P}", file)` |
33+
| 5 | `OptimizationProblem` or `SatisfactionProblem` impl | `Grep("(OptimizationProblem|SatisfactionProblem).*for.*{P}", file)` |
3434
| 6 | `#[cfg(test)]` + `#[path = "..."]` test link | `Grep("#\\[path =", file)` |
3535
| 7 | Test file exists | `Glob("src/unit_tests/models/{C}/{F}.rs")` |
3636
| 8 | Test has creation test | `Grep("fn test_.*creation\|fn test_{F}.*basic", test_file)` |

0 commit comments

Comments
 (0)