feat: inject project history context into extend-mode template generation#70
Merged
snipcodeit merged 2 commits intomainfrom Mar 1, 2026
Merged
Conversation
…e generation Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…te generation - Add HISTORY_CONTEXT assembly in gather_inputs extend-mode block: reads milestone names + issue titles + pipeline stages from project.json, calls gsd-tools history-digest for GSD artifact context - Inject HISTORY_CONTEXT as <project_history> block in generate_template AI prompt - Add explicit instruction not to re-suggest already-built features in extend mode - Apply identical changes to commands/project.md (source) and .claude/commands/mgw/project.md (deployed) - Deployed file also gains full extend-mode metadata-loading block (was absent)
Owner
Author
Testing ProceduresThe following steps verify the three scenarios described in the test plan. Setup# From a project directory that uses MGW
cd <your-project-dir>Test 1: Extend mode with existing milestones# Ensure .mgw/project.json exists with at least one milestone
cat .mgw/project.json | jq '.milestones'
# Run project command in extend mode
# (choose "extend" when prompted for mode)
/mgw:project
# Expected: generated template references previously-built milestone features
# Expected: AI does NOT suggest re-implementing already-completed itemsTest 2: Fallback when no project.json exists# Temporarily rename or remove project.json
mv .mgw/project.json .mgw/project.json.bak
# Run project command in extend mode
/mgw:project
# Expected: HISTORY_CONTEXT defaults to "No prior history available."
# Expected: command completes without error
# Restore
mv .mgw/project.json.bak .mgw/project.jsonTest 3: Graceful fallback when gsd-tools is unavailable# Temporarily shadow gsd-tools with a broken path
PATH_BACKUP=$PATH
export PATH=$(echo "$PATH" | tr ':' '\n' | grep -v gsd-tools | tr '\n' ':')
# Run project command in extend mode
/mgw:project
# Expected: GSD_DIGEST defaults to empty string
# Expected: no error about missing gsd-tools; HISTORY_CONTEXT still assembled from project.json alone
# Restore PATH
export PATH=$PATH_BACKUPPass Criteria
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HISTORY_CONTEXTfrom.mgw/project.json(milestone names, issue titles, pipeline stages) andgsd-tools history-digest<project_history>block ingenerate_templateAI prompt with explicit instruction not to re-suggest already-built features.claude/commands/mgw/project.mdwhich was missing the entire extend-modegather_inputsblockCloses #58
Changes
commands/project.md—gather_inputsextend-mode block: addedHISTORY_CONTEXTassembly;generate_template: added<project_history>injection + anti-duplication instruction.claude/commands/mgw/project.md— same edits + added missing extend-modegather_inputsblock (deployed copy was out of sync)Test Plan
/mgw:projectin extend mode on a project with completed milestones — verify generated template references previously-built features and doesn't re-suggest them.mgw/project.json—HISTORY_CONTEXTshould fall back to"No prior history available."gsd-toolsis unavailable —GSD_DIGESTshould default to empty string without error