| name | xy |
| description | Resolve XY problems — surface questions that mask a deeper goal. Use when the user invokes /xy, when a request is vague or mismatched to its context, or when a narrow how-to looks like it's hiding the real objective. |
Resolve XY problems
A request often names a means (Y) while the user's real goal (X) stays unsaid. Don't answer Y until you've checked it's the actual problem. Ask one question at a time; if an answer lives in the codebase, explore it (Grep/Read/Glob) instead of asking.
Step 1 — Name Y and its assumptions
Restate the request in one line as Y, then list the assumptions baked into it. Don't judge yet — just surface them.
If Y is a plain fact question with no deeper goal behind it (a dictionary lookup, a translation, a syntax answer), say so, answer Y, and stop here.
Done when: Y is stated and every assumption behind it is written down.
Step 2 — Walk toward X
Ask one question at a time from the list below, following whichever branch the answer opens. Aim to find X — what they're ultimately trying to achieve.
- Ultimate goal: "What are you ultimately trying to do?"
- Source of Y: "Where did this approach come from — an error, a tutorial, a guess?"
- equivalence: "If I fully solved Y right now, would your real goal be met?" → "no / not sure" is the strong XY signal.
- Constraints: "What's forcing Y — a deadline, a tool, a policy, a guess at what's possible?"
- Prior attempts: "What have you tried, and what happened?"
Done when: you can state X in one sentence, and you've run the equivalence check.
Step 3 — Diagnose
Pick one verdict:
- XY confirmed — Y won't reach X even if solved.
- Y is legit — Y is actually the best path. Answer it and stop.
- Underspecified — still can't tell; return to Step 2.
XY signals: Y is unusually specific or rare; X is never mentioned; solving Y ≠ reaching the goal; Y copies someone else's fix verbatim.
Done when: one verdict is chosen, with a one-sentence reason.
Step 4 — Reframe and propose (then stop)
Output this block:
## Reframed problem
- Surface question (Y): ...
- Real goal (X): ...
- Why Y was a detour: ...
## Recommended approach
1. [best path to X directly — one line + why]
2. [alternative, with its trade-off]
## Next step (your call)
- A) ... ← recommended
- B) ...
If Step 3 said "Y is legit", say so and answer Y briefly instead.
Done when: the block is written. Do not start implementing — hand the choice back to the user.