Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/commands/clarify.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ Execution steps:

For each category with Partial or Missing status, add a candidate question opportunity unless:
- Clarification would not materially change implementation or validation strategy
- Information is better deferred to planning phase (note internally)
- The item is specifically about implementation method, tech-stack comparison, or task breakdown (note internally)

4. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
- Maximum of 5 total questions across the whole session.
Expand Down Expand Up @@ -279,7 +279,7 @@ Report completion (after questioning loop ends or early termination):
- Path to updated spec.
- Sections touched (list names).
- Spec quality checklist status (if `FEATURE_DIR/checklists/requirements.md` was re-validated): show before/after pass counts (e.g., "Spec Quality Checklist: 12/16 → 15/16 items passing") and list any items that changed state — both newly checked (unchecked → checked) and any regressions (checked → unchecked). If any items remain unchecked, list them as areas needing attention.
- Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
- Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota, or remaining item is specifically implementation method, tech-stack comparison, or task breakdown), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
- If any Outstanding or Deferred remain, recommend whether to proceed to `__SPECKIT_COMMAND_PLAN__` or run `__SPECKIT_COMMAND_CLARIFY__` again later post-plan.
- Suggested next command.

Expand Down
25 changes: 25 additions & 0 deletions tests/test_clarify_stage_gate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""The planning deferral in ``templates/commands/clarify.md`` must stay bounded (#1717).

The old catch-all ("Information is better deferred to planning phase") let
agents skip NFRs, acceptance criteria, and edge cases. Defer only
implementation method, tech-stack comparison, or task breakdown.
"""

from pathlib import Path

CLARIFY = Path(__file__).parent.parent / "templates" / "commands" / "clarify.md"


def test_clarify_planning_deferral_is_bounded() -> None:
text = CLARIFY.read_text(encoding="utf-8")
assert "- Information is better deferred to planning phase (note internally)" not in text
assert "better suited for planning" not in text
assert (
"implementation method, tech-stack comparison, or task breakdown"
in text
)
completion = text.split("## Completion Report", 1)[1]
assert (
"implementation method, tech-stack comparison, or task breakdown"
in completion
)