"Proceed to step 7", but it's already in step 7
Bug Description
Nothing went wrong, but reading through the agent and caught a minor typo bug that may cause inconsistent behavior. The AI seems to cope with this instruction inconsistency for now, but perhaps better to clean up.
in the speckit.agent.specify.md file on line 186, it says "proceed to step 7", but it's already in step 7 and should say "proceed to step 8".
Steps to Reproduce
Open "speckit.agent.specify.md" Go to line 186 See "proceed to step 7", but it's already in step 7 and should say "proceed to step 8".
Expected Behavior
The AI seems to cope with this instruction inconsistency for now, but perhaps better to clean up. This bug report is purely semantic of OCD, no broken final behavior observed.
Actual Behavior
The AI seems to cope with this instruction inconsistency for now, but perhaps better to clean up. This bug report is purely semantic of OCD, no broken final behavior observed.
Specify CLI Version
0.7.3
AI Agent
Claude Code
Operating System
Windows 11
Python Version
Python 3.14.3
Error Logs
Additional Context
No response
Please add a title to your issue
Bug assessment โ specify-step-self-reference: Valid ยท severity low
Bug Assessment: Wrong Step Number in Specify Validation Flow
- Slug:
specify-step-self-reference - Created: 2026-07-21
- Source: issue #2407
- Verdict: valid
- Severity: low
Report (summarized)
Reported by @BigBandaid2 against Specify CLI v0.7.3 / Claude Code / Windows 11.
In speckit.agent.specify.md (the Copilot-generated command file), line 186 contained the instruction "proceed to step 7" inside what is already numbered as step 7 (the Specification Quality Validation step). The reporter correctly identified this as a self-referencing step number โ the instruction should direct the agent to move on from step 7, not back into it. No broken output was observed; current AI models resolved the contradiction implicitly.
Symptom
The specify command template instructed the AI to "proceed to step 7" while already executing step 7 (Specification Quality Validation), creating a logically circular forward reference. The expected behavior was for the instruction to reference step 8 (the Mandatory Post-Execution Hooks section) to signal completion of the validation phase.
Reproduction
- Install Specify CLI v0.7.3 with the Copilot integration.
- Open the generated
.github/copilot-instructions.mdor the.agent.mdcommand file (e.g.,speckit.agent.specify.md). - Navigate to the validation result handling block (approximately line 186 in the generated file).
- Observe:
"If all items pass: Mark checklist complete and proceed to step 7"โ but this line is itself inside the section labeled7. Specification Quality Validation.
Suspected Code Paths
templates/commands/specify.md:186(at the time of filing) โ the validation result handler"If all items pass: ... proceed to step 7"was a self-reference. Confirmed viagit diff bb8fd50^..bb8fd50.templates/commands/specify.md:117and:142โ both lines carry the top-level ordinal6.(duplicate numbering), which is the underlying structural cause of the off-by-one in step references. This residual issue still exists in HEAD.
Root Cause Hypothesis
Confidence: high.
The top-level numbered list in templates/commands/specify.md contains two consecutive items both labeled 6.:
- Line 117:
6. Follow this execution flow:(the internal parse/fill sub-flow) - Line 142:
6. Write the specification to SPEC_FILE ...(the actual write step)
Because two items share ordinal 6, the next item is rendered as 7. Specification Quality Validation when it should structurally be 8.. Any forward reference to the section that follows it (the Mandatory Post-Execution Hooks) used the visible label 7, which happened to be the current step, producing the self-reference. The fix addressed the symptom (the "proceed to step 7" text) but not the root cause (the duplicate 6.).
Proposed Remediation
Preferred (symptom fix โ already shipped): PR #2152 / commit bb8fd50 on 2026-05-01 corrected "proceed to step 7" โ "proceed to step 8". A subsequent commit 7a7843b (PR #2713) later improved this further by replacing the numeric reference entirely with "proceed to the Mandatory Post-Execution Hooks section", making the instruction immune to future renumbering.
Residual / root-cause fix (not yet applied): The duplicate 6. at lines 117 and 142 of templates/commands/specify.md should be corrected so the list reads 1 โ 2 โ 3 โ 4 โ 5 โ 6 โ 7 โ 8 without a gap:
- Line 117: keep as
6. - Line 142: change to
7. - Line 144: change to
8.
This eliminates the structural mismatch that caused the original bug and prevents similar issues if new forward references are ever added.
Files likely to change:
templates/commands/specify.mdโ renumber the duplicate6.on line 142 โ7.and7.on line 144 โ8.- Any preset snapshots that embed the full specify command (e.g.,
presets/lean/commands/speckit.specify.md,presets/scaffold/commands/speckit.specify.md) if they include the numbered steps.
Tests to add or update:
- A test (or lint rule) that parses the top-level numbered list in
specify.mdand asserts no duplicate ordinals exist. - Snapshot/integration test verifying the generated Copilot command file contains no self-referencing step numbers.
Risks & Considerations
- Low blast radius โ the fix only changes tutorial numbering; no runtime logic is affected.
- AI resilience โ modern models tolerate this inconsistency, so user-visible impact has historically been zero; severity remains low.
- Preset propagation โ if preset files embed the numbered list, they need the same renumbering, otherwise freshly initialized projects from those presets will still see the old ordinals.
Open Questions
- The preset files (
presets/lean/,presets/scaffold/) are very short (โค23 lines) and appear to be stubs rather than full embeds โ confirm whether any preset ships the full numbered list before applying the renumbering fix there.
Posted on behalf of @BenBtg by GitHub Copilot (model: claude-sonnet-4.6, autonomous)
Generated by ๐ Assess Bug from Labeled Issue for issue #2407 ยท 421.7 AIC ยท โ 11.1 AIC ยท โ 31.8K ยท โท
Pull request created: #3618
Generated by Fix Bug from Labeled Issue ยท 513.5 AIC ยท โ 15.1 AIC ยท โ 34K
Fix proposed โ specify-step-self-reference: A draft PR has been opened applying the root-cause remediation from the bug assessment.
What changed: templates/commands/specify.md โ the duplicate 6. on the "Write the specification" step (line 142) was renumbered to 7., and the "Specification Quality Validation" section was renumbered from 7. to 8.. This makes the main execution list sequential (1 โ 2 โ ... โ 8) and eliminates the structural mismatch that caused the original self-referencing step number. A regression test (tests/test_specify_template_numbering.py) was added to catch any recurrence.
A maintainer can review the draft PR and, when satisfied, merge it. If this repository has the bug-test stage (stage 3 of assess โ fix โ test) configured, that workflow can be triggered next to validate the fix.
fix-proposed label added below.
Generated by ๐ ๏ธ Fix Bug from Labeled Issue for issue #2407 ยท 513.5 AIC ยท โ 15.1 AIC ยท โ 34K ยท โท