Skip to content

Commit f1a6b72

Browse files
GiggleLiuclaude
andcommitted
Add trait_consistency to add-model skill, structural reviewer, and final-review
The trait_consistency entry was a blind spot: not mentioned in any skill, causing every automated PR to arrive in review missing this registration. Adds Step 5.5 to add-model, check #17 to structural reviewer, and a completeness item to final-review. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b0c5834 commit f1a6b72

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,15 @@ Required tests:
152152

153153
Link the test file via `#[cfg(test)] #[path = "..."] mod tests;` at the bottom of the model file.
154154

155+
## Step 5.5: Add trait_consistency entry
156+
157+
Add the new problem to `src/unit_tests/trait_consistency.rs`:
158+
159+
1. **`test_all_problems_implement_trait_correctly`** — add a `check_problem_trait(...)` call with a small instance
160+
2. **`test_direction`** (optimization problems only) — add an `assert_eq!(...direction(), Direction::Minimize/Maximize)` entry
161+
162+
This is **required** for every new model — it ensures the Problem trait implementation is well-formed.
163+
155164
## Step 6: Document in paper
156165

157166
Invoke the `/write-model-in-paper` skill to write the problem-def entry in `docs/paper/reductions.typ`. That skill covers the full authoring process: formal definition, background, example with visualization, algorithm list, and verification checklist.
@@ -187,3 +196,4 @@ If running standalone (not inside `make run-plan`), invoke [review-implementatio
187196
| Forgetting CLI create | Must add creation handler in `commands/create.rs` and flags in `cli.rs` |
188197
| Missing from CLI help table | Must add entry to "Flags by problem type" table in `cli.rs` `after_help` |
189198
| Schema lists derived fields | Schema should list constructor params, not internal fields (e.g., `matrix, k` not `matrix, m, n, k`) |
199+
| Forgetting trait_consistency | Must add entry in `test_all_problems_implement_trait_correctly` (and `test_direction` for optimization) in `src/unit_tests/trait_consistency.rs` |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Verify the PR includes all required components. Check:
112112
- [ ] `declare_variants!` macro with complexity
113113
- [ ] Paper section in `docs/paper/reductions.typ` (`problem-def` entry)
114114
- [ ] `display-name` entry in paper
115+
- [ ] `trait_consistency.rs` entry in `test_all_problems_implement_trait_correctly` (+ `test_direction` for optimization)
115116

116117
**For [Rule] PRs:**
117118
- [ ] Reduction implementation (`src/rules/...`)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Given: problem name `P` = `{PROBLEM_NAME}`, category `C` = `{CATEGORY}`, file st
4242
| 14 | CLI `resolve_alias` entry | `Grep("{P}", "problemreductions-cli/src/problem_name.rs")` |
4343
| 15 | Paper `display-name` entry | `Grep('"{P}"', "docs/paper/reductions.typ")` |
4444
| 16 | Paper `problem-def` block | `Grep('problem-def.*"{P}"', "docs/paper/reductions.typ")` |
45+
| 17 | `trait_consistency` entry | `Grep("{P}", "src/unit_tests/trait_consistency.rs")` |
4546

4647
## Rule Checklist
4748

0 commit comments

Comments
 (0)