Skip to content

fix(state): support plain format STATE.md fields in phase/milestone complete#924

Open
j2h4u wants to merge 1 commit intogsd-build:mainfrom
j2h4u:fix/state-md-plain-format
Open

fix(state): support plain format STATE.md fields in phase/milestone complete#924
j2h4u wants to merge 1 commit intogsd-build:mainfrom
j2h4u:fix/state-md-plain-format

Conversation

@j2h4u
Copy link
Contributor

@j2h4u j2h4u commented Mar 3, 2026

What

cmdPhaseComplete and cmdMilestoneComplete now use stateReplaceField/stateExtractField from state.cjs with fallback field names to update STATE.md, handling both **Bold:** and plain Field: formats.

Why

The STATE.md template generates plain-format fields (Phase: 1 of 3, Status: In progress), but the code only matched bold-format fields (**Current Phase:**). This caused phase complete and milestone complete to silently skip all STATE.md updates on projects initialized with the current template.

Also preserves the compound Phase: X of Y (Name) format by parsing the existing value structure before writing.

Testing

  • Tested on Linux
  • Tested on macOS
  • Tested on Windows

Checklist

  • Follows GSD style (no enterprise patterns, no filler)
  • Updates CHANGELOG.md for user-facing changes
  • No unnecessary dependencies added
  • Works on Windows (no path-sensitive changes)

Breaking Changes

None

…omplete

`cmdPhaseComplete` and `cmdMilestoneComplete` used hardcoded bold-format
regexes like `**Current Phase:**` to update STATE.md, but the template
generates plain `Phase:` fields. Switched to `stateReplaceField` with
fallback field names to handle both formats.

Also preserves compound `Phase: X of Y (Name)` format by parsing
the existing value structure before writing updates.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j2h4u j2h4u requested a review from glittercowboy as a code owner March 3, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant