Skip to content

feat: inject project history context into extend-mode template generation#70

Merged
snipcodeit merged 2 commits intomainfrom
issue/58-template-generation-should-use-project-h
Mar 1, 2026
Merged

feat: inject project history context into extend-mode template generation#70
snipcodeit merged 2 commits intomainfrom
issue/58-template-generation-should-use-project-h

Conversation

@snipcodeit
Copy link
Copy Markdown
Owner

Summary

  • In extend mode, assembles HISTORY_CONTEXT from .mgw/project.json (milestone names, issue titles, pipeline stages) and gsd-tools history-digest
  • Injects context as <project_history> block in generate_template AI prompt with explicit instruction not to re-suggest already-built features
  • Syncs .claude/commands/mgw/project.md which was missing the entire extend-mode gather_inputs block

Closes #58

Changes

  • commands/project.mdgather_inputs extend-mode block: added HISTORY_CONTEXT assembly; generate_template: added <project_history> injection + anti-duplication instruction
  • .claude/commands/mgw/project.md — same edits + added missing extend-mode gather_inputs block (deployed copy was out of sync)

Test Plan

  • Run /mgw:project in extend mode on a project with completed milestones — verify generated template references previously-built features and doesn't re-suggest them
  • Run with no .mgw/project.jsonHISTORY_CONTEXT should fall back to "No prior history available."
  • Run where gsd-tools is unavailable — GSD_DIGEST should default to empty string without error

Stephen Miller and others added 2 commits February 28, 2026 22:11
…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)
@github-actions github-actions bot added the slash-commands Changes to slash command files label Mar 1, 2026
@snipcodeit
Copy link
Copy Markdown
Owner Author

Testing Procedures

The 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 items

Test 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.json

Test 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_BACKUP

Pass Criteria

  • Test 1: Template content avoids duplicating features from project history
  • Test 2: "No prior history available." appears in the AI prompt when project.json is absent
  • Test 3: Command completes successfully with gsd-tools absent; no unhandled errors

@snipcodeit snipcodeit merged commit 17f53ed into main Mar 1, 2026
1 check passed
@snipcodeit snipcodeit deleted the issue/58-template-generation-should-use-project-h branch March 1, 2026 04:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

slash-commands Changes to slash command files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Template generation should use project history context

1 participant