Skip to content

Commit cd96c8a

Browse files
committed
polish skill
1 parent e1052f0 commit cd96c8a

1 file changed

Lines changed: 73 additions & 17 deletions

File tree

.claude/skills/propose/SKILL.md

Lines changed: 73 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ Work through these topics in order, using `AskUserQuestion` where multiple-choic
195195
description: "I'll describe the domain"
196196
```
197197

198-
2. **Definition** — Use `AskUserQuestion` to clarify problem type, then free text for formal definition:
198+
2. **Definition** — Use `AskUserQuestion` to clarify problem type, then free text for formal definition. Infer the recommendation from the user's problem description (e.g., "find the largest..." → maximize, "find the smallest..." → minimize, "does there exist..." → satisfaction). Mark the inferred option as "(Recommended)":
199199
```
200200
AskUserQuestion:
201201
question: "What kind of problem is this?"
@@ -210,7 +210,7 @@ Work through these topics in order, using `AskUserQuestion` where multiple-choic
210210
```
211211
Then ask: "Can you state the problem formally? What's the input, constraints, and objective?"
212212

213-
3. **Variables**Use `AskUserQuestion`:
213+
3. **Variables**Infer the recommendation from the problem structure (e.g., vertex/edge selection → binary, coloring → k-valued, routing → permutation). Mark the inferred option as "(Recommended)":
214214
```
215215
AskUserQuestion:
216216
question: "How would you represent a solution? What are the decision variables?"
@@ -226,12 +226,54 @@ Work through these topics in order, using `AskUserQuestion` where multiple-choic
226226
description: "I'll describe the variable structure"
227227
```
228228

229-
4. **Complexity** — Ask as free text:
230-
> "What's the best known exact algorithm? Is the problem NP-hard, and if so, is there a reference?"
231-
- Help them find references if unsure (use WebSearch)
232-
- Ask for a concrete complexity expression in terms of problem parameters (e.g., O(2^n), O(1.1996^n))
229+
4. **Complexity & Reference** — Before asking, use WebSearch to research the best known exact algorithms and canonical references for this problem. Then present 3 candidates via `AskUserQuestion`, each combining the complexity bound with its source:
233230

234-
5. **Example** — Generate 3 candidate examples yourself (varying in size and structure), then present via `AskUserQuestion`:
231+
```
232+
AskUserQuestion:
233+
question: "What is the best known exact algorithm for this problem?"
234+
header: "Complexity"
235+
options:
236+
- label: "O(<expression>) — <algorithm/author>"
237+
description: "<paper title, year> — <URL>"
238+
- label: "O(<expression>) — <algorithm/author>"
239+
description: "<paper title, year> — <URL>"
240+
- label: "O(<expression>) — <algorithm/author>"
241+
description: "<paper title, year> — <URL>"
242+
- label: "I know a different bound"
243+
description: "I'll provide the complexity, reference, and link"
244+
```
245+
246+
Requirements:
247+
- Use concrete numeric exponents (e.g., `1.1996^n`, not `(2-ε)^n`)
248+
- Every option must include a link to the paper or resource
249+
- After the user picks one, fetch the BibTeX entry for the chosen reference (from the paper's page, DOI resolver, or Google Scholar) and record it — the BibTeX will be included in the filed issue
250+
251+
5. **Solving strategy** — Before presenting options, analyze the problem to determine the best recommendation based on:
252+
- If the problem has linear constraints and a linear objective → recommend ILP
253+
- If the problem has binary variables and quadratic interactions → recommend QUBO
254+
- If the problem is on a small configuration space or has no natural ILP/QUBO formulation → recommend brute-force
255+
- If a well-known specialized algorithm exists (e.g., polynomial-time for matching, 2-SAT) → recommend that
256+
257+
Mark the recommended option with "(Recommended)" in the label:
258+
```
259+
AskUserQuestion:
260+
question: "How can this problem be solved computationally?"
261+
header: "Solving strategy"
262+
options:
263+
- label: "<option> (Recommended)"
264+
description: "<why this is the best fit for this problem>"
265+
- label: "<option>"
266+
description: "<description>"
267+
- label: "<option>"
268+
description: "<description>"
269+
- label: "Specialized algorithm"
270+
description: "A problem-specific algorithm exists — I'll describe it"
271+
```
272+
This determines the "How to solve" section in the issue. At least one option is required — check-issue rejects issues without a solver path.
273+
274+
**Important:** If the user chooses "Reduce to ILP" or "Reduce to QUBO", remind them that this requires a reduction rule issue. Either cross-reference an existing rule issue, or plan to file one as a companion rule (which will be proposed in Step 3b Topology Analysis). The model issue's "How to solve" section must reference the rule issue number.
275+
276+
6. **Example** — Generate 3 candidate examples yourself (varying in size and structure), then present via `AskUserQuestion`:
235277

236278
```
237279
AskUserQuestion:
@@ -250,7 +292,7 @@ Work through these topics in order, using `AskUserQuestion` where multiple-choic
250292
- Must exercise the problem's core structure
251293
- Must be small enough to verify by hand
252294

253-
6. **Data representation**Use `AskUserQuestion`:
295+
7. **Data representation**Infer the recommendation from the problem definition (e.g., "vertices and edges" → graph, "rows and columns" → matrix, "universe and subsets" → set system). Mark the inferred option as "(Recommended)":
254296
```
255297
AskUserQuestion:
256298
question: "What data defines an instance of this problem?"
@@ -266,9 +308,9 @@ Work through these topics in order, using `AskUserQuestion` where multiple-choic
266308
description: "I'll describe the input structure"
267309
```
268310

269-
7. **Variants** — Based on the data representation answer, ask about applicable variants using `AskUserQuestion`. Only show options that are viable for the problem's input structure. Skip this question entirely if no variants apply (e.g., the problem has a fixed unique input structure like Knapsack, Factoring, SubsetSum).
311+
8. **Variants** — Based on the data representation answer, ask about applicable variants using `AskUserQuestion`. Only show options that are viable for the problem's input structure. Skip this question entirely if no variants apply (e.g., the problem has a fixed unique input structure like Knapsack, Factoring, SubsetSum).
270312

271-
**If the input is a graph** (from step 6), ask about graph topology:
313+
**If the input is a graph** (from step 7), ask about graph topology:
272314
```
273315
AskUserQuestion:
274316
question: "Which graph topologies should this problem support?"
@@ -451,7 +493,7 @@ AskUserQuestion:
451493
- label: "<Source> → <Target>"
452494
description: "<why valuable>"
453495
- label: "I'll file rules separately"
454-
description: "Skip companion rules for now (model may be flagged as orphan)"
496+
description: "⚠ WARNING: A model with no reduction rules is an orphan node and WILL be rejected during review"
455497
```
456498

457499
**Ranking criteria** (in order of priority):
@@ -468,9 +510,20 @@ If the user picks one or more rules from Step 3b (or proposes their own):
468510

469511
For **each** selected rule, run through the rule brainstorming flow (algorithm, correctness, overhead, example, reference) — but keep it lighter since the model context is already established.
470512

471-
If the user declines ("I'll file rule issues separately later"):
472-
- Accept this, but include a placeholder in the model's "Reduction Rule Crossref" section noting which rules are planned
473-
- Warn: "Note: the model issue will reference planned rules. If no rule issue is filed, the model may be flagged as an orphan during review."
513+
If the user declines ("I'll file rules separately later"):
514+
- **Strongly warn** via `AskUserQuestion`:
515+
```
516+
AskUserQuestion:
517+
question: "A problem with no reduction rules is an orphan node — it will be isolated in the graph and REJECTED during review. Are you sure you want to skip?"
518+
header: "⚠ Orphan Warning"
519+
options:
520+
- label: "Let me propose a rule now"
521+
description: "I'll define at least one reduction rule to connect this problem to the graph"
522+
- label: "Skip anyway — I'll file rule issues separately"
523+
description: "I understand the risk. I will file companion rule issues before review."
524+
```
525+
- If the user chooses "Let me propose a rule now", go back to Step 3b and let them pick a rule, then brainstorm it.
526+
- If the user still declines, include a placeholder in the model's "Reduction Rule Crossref" section noting which rules are planned, and add a visible warning in the draft: "⚠ No companion rule filed — this model will be an orphan node until a rule issue is created."
474527

475528
---
476529

@@ -493,18 +546,20 @@ If proposing a model + rules, present all drafts together:
493546
- Definition (Name, Reference, formal definition)
494547
- Variables (Count, Per-variable domain, Meaning)
495548
- Schema (Type name, Variants, Field table — use mathematical types, not programming types)
496-
- Complexity (expression + citation)
549+
- Complexity (expression + citation + BibTeX)
497550
- Extra Remark (if applicable)
498551
- Reduction Rule Crossref (linking to companion rule issues or noting planned rules)
499-
- How to solve (brute-force, ILP, or other)
552+
- How to solve (brute-force, ILP, or other — if ILP/QUBO, must cross-reference rule issue)
500553
- Example Instance
554+
- BibTeX (include the BibTeX entry for the complexity/definition reference at the end of the issue)
501555

502556
**For rules**, the draft must include:
503-
- Source, Target, Motivation, Reference
557+
- Source, Target, Motivation, Reference (with BibTeX)
504558
- Reduction Algorithm (numbered steps, all symbols defined)
505559
- Size Overhead (table with target metrics and formulas)
506560
- Validation Method
507561
- Example (fully worked)
562+
- BibTeX (include the BibTeX entry for the reference at the end of the issue)
508563

509564
---
510565

@@ -592,6 +647,7 @@ Print all issue URLs when done.
592647
- **One question at a time** — don't overwhelm; each `AskUserQuestion` call has one focused question
593648
- **Mathematical language only** — never mention Rust types, traits, macros, or code patterns to the user
594649
- **Help find references** — use WebSearch to help locate papers, verify claims
650+
- **Always provide a recommendation** — for every `AskUserQuestion` with multiple choices, analyze the problem context and mark one option as "(Recommended)" with a brief reason. Domain experts benefit from an informed default they can override. Base recommendations on the problem description, existing graph topology, and literature conventions.
595651
- **Suggest, don't prescribe** — if the user is unsure about complexity or reductions, propose candidates and let them choose
596652
- **Topology-driven suggestions** — run topology analysis first, then populate `AskUserQuestion` options with the most needed reductions ranked by value
597653
- **Self-check before filing** — catch problems before they reach review

0 commit comments

Comments
 (0)