Skip to content

Commit d309549

Browse files
committed
update SKILLS
1 parent cc87cf0 commit d309549

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Rust library for NP-hard problem reductions. Implements computational problems with reduction rules for transforming between equivalent formulations.
55

66
## Skills
7-
- [issue-to-pr](skills/issue-to-pr/SKILL.md) -- Convert a GitHub issue into a PR with an implementation plan. Validates the issue against the appropriate checklist, then dispatches to `add-model` or `add-rule`.
7+
- [issue-to-pr](skills/issue-to-pr/SKILL.md) -- Convert a GitHub issue into a PR with an implementation plan. One item per PR: `[Rule]` issues require both models to exist on `main`; never bundle model + rule in the same PR.
88
- [add-model](skills/add-model/SKILL.md) -- Add a new problem model. Can be used standalone (brainstorms with user) or called from `issue-to-pr`.
99
- [add-rule](skills/add-rule/SKILL.md) -- Add a new reduction rule. Can be used standalone (brainstorms with user) or called from `issue-to-pr`.
1010
- [review-implementation](skills/review-implementation/SKILL.md) -- Review implementation completeness by dispatching parallel subagents (structural + quality) with fresh context. Auto-detects new models/rules from git diff. Called automatically at the end of `add-model`/`add-rule`, after each `executing-plans` batch, or standalone via `/review-implementation`.

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,19 @@ 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
57+
### 3.5. Model-Existence Guard (for `[Rule]` issues only)
5858

59-
When creating a `[Rule]` PR, check if there's already an open `[Model]` PR for the source or target problem:
59+
For `[Rule]` issues, parse the source and target problem names from the title (e.g., `[Rule] BinPacking to ILP`source=BinPacking, target=ILP). Verify that **both** models already exist in the codebase on `main`:
6060

6161
```bash
62-
gh pr list --state open --search "[Model]" --json title,number,headRefName
62+
grep -r "struct SourceName" src/models/
63+
grep -r "struct TargetName" src/models/
6364
```
6465

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.
66+
- If **both** models exist → continue to step 4.
67+
- If either model is missing → **STOP**. Comment on the issue: "Blocked: model `<name>` does not exist in main yet. Please implement it first (or file a `[Model]` issue)."
68+
69+
**One item per PR:** Do NOT implement a missing model as part of a `[Rule]` PR. Each PR should contain exactly one model or one rule, never both. This avoids bloated PRs and repeated implementation when the model is needed by multiple rules.
6770

6871
### 4. Research References
6972

@@ -254,5 +257,5 @@ Run /review-pipeline to process Copilot comments, fix CI, and run agentic tests.
254257
| Not verifying facts from issue | Use WebSearch/WebFetch to cross-check claims |
255258
| Branch already exists on retry | Check with `git rev-parse --verify` before `git checkout -b` |
256259
| Dirty working tree | Verify `git status --porcelain` is empty before branching |
257-
| Redundant Model+Rule PRs | Check for related open PRs (Step 3.5); combine or base on existing branch |
260+
| Bundling model + rule in one PR | Each PR must contain exactly one model or one rule — STOP and block if model is missing (Step 3.5) |
258261
| Plan files left in PR | Delete plan files before final push (Step 7c) |

.claude/skills/project-pipeline/SKILL.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,17 @@ Filter items where `status == "Ready"`. Partition into `[Model]` and `[Rule]` bu
4545

4646
#### 0b. Gather Context for Ranking
4747

48-
1. **Existing problems:** Call `list_problems` (MCP tool) to get all problems currently in the reduction graph.
48+
1. **Existing problems:** Grep for problem struct definitions in the codebase: `grep -r "^pub struct" src/models/ | sed 's/.*pub struct \([A-Za-z]*\).*/\1/'` to get all problem names currently implemented on `main`.
4949
2. **Pending rules:** From the full project board JSON, collect all `[Rule]` issues that are in "Ready" or "In Progress" status. Parse their source/target problem names (e.g., `[Rule] BinPacking to ILP` → source=BinPacking, target=ILP).
5050

5151
#### 0c. Check Eligibility
5252

53-
**Rule issues require both source and target models to exist.** For each `[Rule]` issue, parse the source and target problem names (e.g., `[Rule] BinPacking to ILP` → source=BinPacking, target=ILP). Check that both appear in the `list_problems` output (existing models) OR in a `[Model]` issue in the current Ready/In Progress columns.
53+
**Rule issues require both source and target models to exist on `main`.** For each `[Rule]` issue, parse the source and target problem names (e.g., `[Rule] BinPacking to ILP` → source=BinPacking, target=ILP). Check that both appear in the existing problems list (from Step 0b grep).
5454

55-
- If both models exist → **eligible**
56-
- If a missing model has a `[Model]` issue in Ready → eligible only in `--all` mode (the Model will be processed first); in single-issue mode, **skip this Rule** and mark it `[blocked]`
57-
- If a missing model has no `[Model]` issue at all → **ineligible**, mark it `[blocked]` with reason
55+
- If both models exist in the codebase → **eligible**
56+
- If either model is missing from the codebase → **ineligible**, mark it `[blocked]` with reason (e.g., "model X not yet implemented on main")
57+
58+
Do NOT consider pending `[Model]` issues as satisfying the dependency — only models already merged to `main` count. This prevents bundling model + rule in the same PR.
5859

5960
All `[Model]` issues are always eligible (no dependency check needed).
6061

@@ -96,7 +97,7 @@ Ready issues (ranked):
9697

9798
**If a specific issue number was provided:** verify it is in the Ready column. If it is blocked, STOP with a message explaining which model is missing.
9899

99-
**If `--all`:** proceed with all eligible issues in ranked order (highest score first). **Dependency ordering override:** if a `[Model]` issue and a `[Rule]` that depends on it are both eligible, the Model MUST be processed before that Rule regardless of score. Blocked rules are skipped.
100+
**If `--all`:** proceed with all eligible issues in ranked order (highest score first). Models before Rules at same score. Blocked rules are skipped. After each issue is processed, re-check eligibility for remaining rules (a just-merged Model may unblock them).
100101

101102
**Otherwise (no args):** pick the highest-scored eligible (non-blocked) issue and proceed immediately (no confirmation).
102103

@@ -207,10 +208,10 @@ Completed: 2/4 | In Review: 3 | Returned to Ready: 1
207208
| Mistake | Fix |
208209
|---------|-----|
209210
| Issue not in Ready column | Verify status before processing; STOP if not Ready |
210-
| Picking a Rule whose model doesn't exist | Hard constraint: both source and target models must exist in codebase or be in a Ready Model issue (for `--all` mode) |
211+
| Picking a Rule whose model doesn't exist | Hard constraint: both source and target models must exist on `main` — pending Model issues do NOT count |
211212
| Missing project scopes | Run `gh auth refresh -s read:project,project` |
212213
| Forgetting to move back to Ready on total failure | Only move to In Review if a PR exists |
213-
| Processing Rules before their Model dependencies | In `--all` mode, ensure Models that unblock pending rules come before those rules regardless of score |
214+
| Processing Rules before their Model dependencies | In `--all` mode, re-check eligibility after each issue — a just-merged Model may unblock rules |
214215
| Scoring a variant as "related" | Weighted/unweighted variants or graph-subtype specializations of existing problems score 0 on C2 |
215216
| Not syncing main between batch issues | Each issue gets a fresh worktree from `origin/main` |
216217
| Worktree left behind on failure | Always clean up with `git worktree remove` in Step 5 |

0 commit comments

Comments
 (0)