You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: use Claude Code's native AskUserQuestion for /clarify and /checklist
Replace Markdown-table question rendering with Claude Code's native
AskUserQuestion structured picker in speckit-clarify and speckit-checklist
skills, while preserving the original table behavior for all other agents.
- Add HTML-comment fence markers (speckit:question-render:begin/end) around
the question-rendering blocks in clarify.md and checklist.md templates
- Extend ClaudeIntegration.setup() to post-process fenced blocks at skill
generation time, replacing them with AskUserQuestion instructions
- Map Option|Description (clarify) and Option|Candidate|Why It Matters
(checklist) to AskUserQuestion's {label, description} shape
- Place recommended option first with "Recommended — <reasoning>" prefix
- Preserve free-form escape hatch as a final synthetic option
- All downstream behavior unchanged: question caps, validation, spec writes
- Non-Claude integrations output is completely unaffected
Closes#2181
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- `options[]`: an array of `{label, description}` objects. Place the **recommended option first** and prefix its `description` with `Recommended — <reasoning>.`
49
+
Build each option as: `{label: "<A|B|C|...>", description: "<option description>"}`.
50
+
- Append a final option: `{label: "Short", description: "Provide my own short answer (≤5 words)"}` to preserve the free-form escape hatch.
51
+
- `multiSelect`: `false`
52
+
- If the user selects the "Short" option, ask a follow-up free-text question constrained to ≤5 words.
53
+
- For short‑answer style (no meaningful discrete options):
54
+
- Determine your **suggested answer** based on best practices and context.
- `options[]`: `[{label: "Accept suggestion", description: "Use the suggested answer above"}, {label: "Custom", description: "Provide my own short answer (≤5 words)"}]`
58
+
- `multiSelect`: `false`
59
+
- If the user selects "Custom", ask a follow-up free-text question constrained to ≤5 words."""
60
+
61
+
# Replacement block for /checklist. Maps the `Option | Candidate | Why It
62
+
# Matters` table schema to AskUserQuestion's `{label, description}` shape:
63
+
# - "Candidate" becomes the option `label`
64
+
# - "Why It Matters" becomes the option `description`
65
+
_CHECKLIST_ASK_USER="""\
66
+
Question formatting rules:
67
+
- If presenting options, use the `AskUserQuestion` tool to present a native structured picker:
68
+
- `question`: the clarification question text
69
+
- `options[]`: an array of `{label, description}` objects. For each candidate option: `{label: "<Candidate value>", description: "<Why It Matters value>"}`.
70
+
- Append a final option: `{label: "Custom", description: "Provide my own short answer (≤5 words)"}` to preserve the free-form escape hatch.
71
+
- `multiSelect`: `false`
72
+
- If the user selects the "Custom" option, ask a follow-up free-text question.
73
+
- Omit the picker if a free-form answer is clearer (use `AskUserQuestion` with only a `question` and no `options[]` in that case).
74
+
- Never ask the user to restate what they already said.
75
+
- Avoid speculative categories (no hallucination). If uncertain, ask explicitly: "Confirm whether X belongs in scope.\""""
76
+
77
+
# Map of skill stem → replacement content for the question-rendering fence.
78
+
_QUESTION_RENDER_REPLACEMENTS: dict[str, str] = {
79
+
"clarify": _CLARIFY_ASK_USER,
80
+
"checklist": _CHECKLIST_ASK_USER,
81
+
}
82
+
27
83
28
84
classClaudeIntegration(SkillsIntegration):
29
85
"""Integration for Claude Code skills."""
@@ -44,6 +100,21 @@ class ClaudeIntegration(SkillsIntegration):
0 commit comments