Skip to content

Commit 4e05e98

Browse files
committed
docs(skills): derive example specs from canonical data
1 parent 5ecba36 commit 4e05e98

4 files changed

Lines changed: 18 additions & 8 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ The body goes AFTER auto-generated sections (complexity table, reductions, schem
247247

248248
**Evaluation:** Show the objective/verifier computed on the example solution (can be woven into example text).
249249

250-
**Reproducibility:** The example section must include a `pred-commands()` call showing the create/solve/evaluate pipeline. See `write-model-in-paper` skill for the full pattern.
250+
**Reproducibility:** The example section must include a `pred-commands()` call showing the create/solve/evaluate pipeline. The `pred create --example ...` spec must be derived from the loaded canonical example data via the helper pattern in `write-model-in-paper`; do not hand-write a bare alias and assume the default variant matches.
251251

252252
### 6d. Build and verify
253253

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Step-by-step walkthrough with concrete numbers from JSON data. Required steps:
159159

160160
Use `graph-colors`, `g-node()`, `g-edge()` for graph visualization — see reference examples.
161161

162-
**Reproducibility:** The `extra:` block must start with a `pred-commands()` call showing the create/reduce/solve/evaluate pipeline. See `write-rule-in-paper` skill for the full pattern.
162+
**Reproducibility:** The `extra:` block must start with a `pred-commands()` call showing the create/reduce/solve/evaluate pipeline. The source-side `pred create --example ...` spec must be derived from the loaded canonical example data via the helper pattern in `write-rule-in-paper`; do not hand-write a bare alias and assume the default variant matches.
163163

164164
### 5d. Build and verify
165165

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,22 @@ caption: [Caption describing the figure with key parameters],
159159

160160
#### Reproducibility Commands
161161

162-
Add a `pred-commands()` block after the `*Example.*` paragraph and before the `#figure`. Commands are constructed dynamically from loaded example data:
162+
Add a `pred-commands()` block after the `*Example.*` paragraph and before the `#figure`. The `pred create --example ...` spec must be derived from the loaded example data, not handwritten:
163163

164164
```typst
165+
#let problem-spec(data) = {
166+
if data.variant.len() == 0 { data.problem }
167+
else { data.problem + "/" + data.variant.values().join("/") }
168+
}
169+
165170
#pred-commands(
166-
"pred create --example <ALIAS> -o <name>.json",
171+
"pred create --example " + problem-spec(x) + " -o <name>.json",
167172
"pred solve <name>.json",
168173
"pred evaluate <name>.json --config " + x.optimal_config.map(str).join(","),
169174
)
170175
```
171176

172-
Where `<ALIAS>` is the shortest alias for the problem (e.g., `MIS`, `MVC`, `SAT`). Use the bare alias when the default variant matches the loaded example; use the full variant path (e.g., `MIS/SimpleGraph/i32`) when a non-default variant is needed. Check `pred list` for available aliases.
177+
If `docs/paper/reductions.typ` already defines a shared `problem-spec()` helper, reuse it instead of reintroducing it locally. Do **not** guess whether the default variant matches the canonical example; canonical fixtures may live on non-default variants, and handwritten bare aliases can silently produce broken commands.
173178

174179
For satisfaction problems, replace `pred solve` with `pred solve <name>.json --solver brute-force` if the problem has no ILP reduction path.
175180

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,23 @@ Detailed by default. Only use a brief example for trivially obvious reductions (
172172

173173
### 4a2. Reproducibility Commands
174174

175-
Add a `pred-commands()` block at the top of the `extra:` content, before any data display or visualization. Commands are constructed dynamically from loaded example data:
175+
Add a `pred-commands()` block at the top of the `extra:` content, before any data display or visualization. The source-side `pred create --example ...` spec must be derived from the loaded example data, not handwritten:
176176

177177
```typst
178+
#let problem-spec(data) = {
179+
if data.variant.len() == 0 { data.problem }
180+
else { data.problem + "/" + data.variant.values().join("/") }
181+
}
182+
178183
#pred-commands(
179-
"pred create --example <SOURCE_ALIAS> -o <source>.json",
184+
"pred create --example " + problem-spec(src_tgt.source) + " -o <source>.json",
180185
"pred reduce <source>.json --to " + target-spec(src_tgt) + " -o bundle.json",
181186
"pred solve bundle.json",
182187
"pred evaluate <source>.json --config " + src_tgt_sol.source_config.map(str).join(","),
183188
)
184189
```
185190

186-
Where `<SOURCE_ALIAS>` is the shortest alias for the source problem (e.g., `MVC`, `MIS`, `SAT`). Use the bare alias when the default variant matches; use the full variant path (e.g., `MIS/SimpleGraph/i32`) when a non-default variant is needed. Check `pred list` for available aliases.
191+
If `docs/paper/reductions.typ` already defines a shared `problem-spec()` helper, reuse it instead of duplicating it. Do **not** guess whether the default variant matches the canonical example; canonical rule fixtures can point at non-default source variants, and handwritten bare aliases can silently break the reproducibility block.
187192

188193
The `target-spec()` helper handles empty variant dicts automatically. The `--config` is composed from `src_tgt_sol.source_config`.
189194

0 commit comments

Comments
 (0)