Skip to content

Template generation should use project history context #58

@snipcodeit

Description

@snipcodeit

Problem

When generating new milestones for an existing project, the AI template generator has no context about what was already built. This can lead to:

  • Suggesting features that already exist (e.g., "Add user authentication" when auth was built in v1.0)
  • Missing that certain systems/modules are already in place
  • Not building on top of existing architecture decisions

Expected Behavior

In extend mode, /mgw:project should provide the template generator with:

  1. Completed milestones summary — names, phase titles, issue titles from previous milestones
  2. Current codebase state — key modules/systems that exist (from CLAUDE.md or codebase scan)
  3. GSD history — if .planning/milestones/ contains archived roadmaps, include a digest

This context goes into the AI prompt so generated milestones build on what exists rather than starting from scratch.

Implementation

Before the generate_template step, assemble history context:

# Previous milestones from project.json
HISTORY=$(python3 -c "
import json
p = json.load(open('${MGW_DIR}/project.json'))
for m in p['milestones']:
    print(f\"Milestone: {m['name']}\")
    for i in m['issues']:
        print(f\"  - {i['title']} ({i['pipeline_stage']})\")
")

# GSD artifacts if available
GSD_DIGEST=$(node ~/.claude/get-shit-done/bin/gsd-tools.cjs history-digest 2>/dev/null || echo "")

Include in the generation prompt as <project_history> context.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions