Skip to content

Commit 9085ba5

Browse files
zazabapclaude
andauthored
fix: address 5 skill workflow issues from #191 (#195)
1. check-issue: add Step 3 to offer auto-fixing issues + anti-hallucination guard 2. add-model: restrict short aliases to well-established literature abbreviations only 3. issue-to-pr: add Step 7c to delete plan files before final push 4. issue-to-pr: add Step 3.5 to check for related open PRs and avoid redundant work 5. check-issue: add "don't hallucinate issue references" to common mistakes Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5fbde0e commit 9085ba5

3 files changed

Lines changed: 49 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Update the CLI dispatch table so `pred` can load, solve, and serialize the new p
122122

123123
2. **`problemreductions-cli/src/problem_name.rs`:**
124124
- Add a lowercase alias mapping in `resolve_alias()` (e.g., `"newproblem" => "NewProblem".to_string()`)
125-
- Optionally add short aliases to `ALIASES` array (e.g., `("NP", "NewProblem")`)
125+
- Only add short aliases to the `ALIASES` array if the abbreviation is **well-established in the literature** (e.g., MIS, MVC, SAT, TSP, CVP are standard; "KS" for Knapsack or "BP" for BinPacking are NOT — do not invent new abbreviations)
126126

127127
## Step 4.5: Add CLI creation support
128128

@@ -183,5 +183,6 @@ If running standalone (not inside `make run-plan`), invoke [review-implementatio
183183
| Forgetting `declare_variants!` | Required for variant complexity metadata used by the paper's auto-generated table |
184184
| Forgetting CLI dispatch | Must add match arms in `dispatch.rs` (`load_problem` + `serialize_any_problem`) |
185185
| Forgetting CLI alias | Must add lowercase entry in `problem_name.rs` `resolve_alias()` |
186+
| Inventing short aliases | Only use well-established literature abbreviations (MIS, SAT, TSP); do NOT invent new ones |
186187
| Forgetting CLI create | Must add creation handler in `commands/create.rs` and flags in `cli.rs` |
187188
| Schema lists derived fields | Schema should list constructor params, not internal fields (e.g., `matrix, k` not `matrix, m, n, k`) |

.claude/skills/check-issue/SKILL.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,32 @@ If an MCP tool is not available, skip to the next in the chain. All checks shoul
423423

424424
---
425425

426+
## Step 3: Offer to Fix (optional)
427+
428+
After posting the report, if there are **fixable failures** (not just warnings), ask the user:
429+
430+
> "Would you like me to help fix the issues found? I can update the issue body to address: [list fixable items]"
431+
432+
**Auto-fixable items** (if the user agrees):
433+
- Missing or placeholder sections → fill with templates from the issue template
434+
- Incorrect DOI format → reformat to standard `https://doi.org/...` form
435+
- Inconsistent notation → standardize symbols across sections
436+
- Missing symbol definitions → add definitions based on context
437+
438+
**NOT auto-fixable** (require the contributor's input):
439+
- Missing reduction algorithm or proof details
440+
- Incorrect mathematical claims
441+
- Missing references (need the contributor to provide them)
442+
443+
If the user agrees, edit the issue body with `gh issue edit <NUMBER> --body "..."` and re-run the checks to verify the fixes.
444+
445+
---
446+
426447
## Common Mistakes
427448

428449
- **Don't fail on warnings.** Only add labels for definitive failures. Ambiguous cases get warnings.
429450
- **Don't close issues.** This skill labels and comments only.
430451
- **Don't hallucinate paper content.** If you can't find a paper, say "not found" — don't guess what it might contain.
452+
- **Don't hallucinate issue references.** Do NOT reference other GitHub issues unless you have fetched them with `gh issue view` and verified their content. Do NOT reference file paths unless you have verified they exist.
431453
- **Match problem names carefully.** Issues may use aliases (MIS, MVC, SAT) that need resolution via `pred show`.
432454
- **Check the right template.** `[Rule]` and `[Model]` issues have different sections — don't check for "Reduction Algorithm" on a Model issue.

.claude/skills/issue-to-pr/SKILL.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,17 @@ LABELS=$(gh issue view <number> --json labels --jq '[.labels[].name] | join(",")
5454
- If `Good` is NOT in the labels → **STOP**: "Issue #N has not passed check-issue. Please run `/check-issue <N>` first."
5555
- If `Good` is present → continue to step 4.
5656

57+
### 3.5. Check for Related Open PRs
58+
59+
When creating a `[Rule]` PR, check if there's already an open `[Model]` PR for the source or target problem:
60+
61+
```bash
62+
gh pr list --state open --search "[Model]" --json title,number,headRefName
63+
```
64+
65+
- If an open Model PR exists for the source/target problem, the Rule PR should **base its branch on that Model branch** (not `main`), to avoid duplicating CLI registration, export regeneration, etc.
66+
- If both a `[Model]` and `[Rule]` issue exist for the same problem, prefer implementing them in the **same PR** to avoid redundant work. Base the branch on `main`, implement the model first, then the rule.
67+
5768
### 4. Research References
5869

5970
Use `WebSearch` and `WebFetch` to look up the reference URL provided in the issue. This helps:
@@ -157,7 +168,16 @@ git add -A
157168
git commit -m "Implement #<number>: <title>"
158169
```
159170

160-
#### 7c. Push, Post Summary, and Request Copilot Review
171+
#### 7c. Clean Up Plan File
172+
173+
Delete the plan file from the branch — it served its purpose during implementation and should not be merged into main:
174+
175+
```bash
176+
git rm docs/plans/<plan-file>.md
177+
git commit -m "chore: remove plan file after implementation"
178+
```
179+
180+
#### 7d. Push, Post Summary, and Request Copilot Review
161181

162182
Post an implementation summary comment on the PR **before** pushing. This comment should:
163183
- Summarize what was implemented (files added/changed)
@@ -183,7 +203,7 @@ git push
183203
make copilot-review
184204
```
185205

186-
#### 7d. Fix Loop (max 3 retries)
206+
#### 7e. Fix Loop (max 3 retries)
187207

188208
```bash
189209
REPO=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
@@ -231,7 +251,7 @@ For each retry:
231251

232252
**After 3 failed retries:** leave PR open, report to user.
233253

234-
#### 7e. Done
254+
#### 7f. Done
235255

236256
Report final status:
237257
- PR URL
@@ -283,3 +303,5 @@ PR #45: CI green, ready for merge.
283303
| Not verifying facts from issue | Use WebSearch/WebFetch to cross-check claims |
284304
| Branch already exists on retry | Check with `git rev-parse --verify` before `git checkout -b` |
285305
| Dirty working tree | Verify `git status --porcelain` is empty before branching |
306+
| Redundant Model+Rule PRs | Check for related open PRs (Step 3.5); combine or base on existing branch |
307+
| Plan files left in PR | Delete plan files before final push (Step 7c) |

0 commit comments

Comments
 (0)