Skip to content

Commit 7875f2b

Browse files
GiggleLiuclaude
andcommitted
Fix remaining skill gaps: variant docs, branch guards, prerequisites
- add-model: Document variant_params! macro usage for variant() implementation - issue-to-pr: Add pre-flight checks (clean tree, existing branch) before branch creation; add retry/dirty-tree to Common Mistakes - write-model-in-paper: Fix wrong make rust-export → use make paper (which auto-runs export_graph + export_schemas) - write-rule-in-paper: Fix wrong make rust-export → correct export commands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e02efb3 commit 7875f2b

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ Key decisions:
8484
- **Weight management:** use inherent methods (`weights()`, `set_weights()`, `is_weighted()`), NOT traits
8585
- **`dims()`:** returns the configuration space dimensions (e.g., `vec![2; n]` for binary variables)
8686
- **`evaluate()`:** must check feasibility first, then compute objective
87+
- **`variant()`:** use the `variant_params!` macro — e.g., `crate::variant_params![G, W]` for `Problem<G, W>`, or `crate::variant_params![]` for problems with no type parameters. Each type parameter must implement `VariantParam` (already done for standard types like `SimpleGraph`, `i32`, `One`). See `src/variant.rs`.
8788

8889
## Step 2.5: Register variant complexity
8990

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ Include the concrete details from the issue (problem definition, reduction algor
8181

8282
Create a pull request with only the plan file.
8383

84+
**Pre-flight checks** (before creating the branch):
85+
1. Verify clean working tree: `git status --porcelain` must be empty. If not, STOP and ask user to stash or commit.
86+
2. Check if branch already exists: `git rev-parse --verify issue-<number>-<slug> 2>/dev/null`. If it exists, switch to it with `git checkout` (no `-b`) instead of creating a new one.
87+
8488
```bash
85-
# Create branch
89+
# Create branch (from main)
90+
git checkout main
8691
git checkout -b issue-<number>-<slug>
8792

8893
# Stage the plan file
@@ -131,3 +136,5 @@ Created PR #45: Fix #42: Add IndependentSet -> QUBO reduction
131136
| Generic plan | Use specifics from the issue, mapped to add-model/add-rule steps |
132137
| Skipping CLI registration in plan | add-model requires CLI dispatch updates -- include in plan |
133138
| Not verifying facts from issue | Use WebSearch/WebFetch to cross-check claims |
139+
| Branch already exists on retry | Check with `git rev-parse --verify` before `git checkout -b` |
140+
| Dirty working tree | Verify `git status --porcelain` is empty before branching |

.claude/skills/write-model-in-paper/SKILL.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Full authoring guide for writing a `problem-def` entry in `docs/paper/reductions
1212
Before using this skill, ensure:
1313
- The problem model is implemented (`src/models/<category>/<name>.rs`)
1414
- The problem is registered with schema and variant metadata
15-
- JSON exports are up to date (`make rust-export && make export-schemas`)
15+
- JSON exports are up to date (`cargo run --example export_graph && cargo run --example export_schemas`)
1616

1717
## Reference Example
1818

@@ -161,10 +161,7 @@ This can be woven into the example text (as MIS does: "$w(S) = sum_(v in S) w(v)
161161
## Step 4: Build and Verify
162162

163163
```bash
164-
# Regenerate exports (if not already done)
165-
make rust-export && make export-schemas
166-
167-
# Build the paper
164+
# Build the paper (auto-runs export_graph + export_schemas)
168165
make paper
169166
```
170167

.claude/skills/write-rule-in-paper/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Before using this skill, ensure:
1717
- The reduction is implemented and tested (`src/rules/<source>_<target>.rs`)
1818
- An example program exists (`examples/reduction_<source>_to_<target>.rs`)
1919
- Example JSON is generated (`make examples`)
20-
- The reduction graph is up to date (`make rust-export`)
20+
- The reduction graph and schemas are up to date (`cargo run --example export_graph && cargo run --example export_schemas`)
2121

2222
## Step 1: Load Example Data
2323

0 commit comments

Comments
 (0)