Files
msd-core/sdk/prompts/templates/state.md
TÂCHES 89f95c43ba feat: auto --init flag, headless prompts, and prompt sanitizer (#1417)
* fix: Created 10 headless prompt files (5 workflows + 5 agents) in sdk/p…

- "sdk/prompts/workflows/execute-plan.md"
- "sdk/prompts/workflows/research-phase.md"
- "sdk/prompts/workflows/plan-phase.md"
- "sdk/prompts/workflows/verify-phase.md"
- "sdk/prompts/workflows/discuss-phase.md"
- "sdk/prompts/agents/gsd-executor.md"
- "sdk/prompts/agents/gsd-phase-researcher.md"
- "sdk/prompts/agents/gsd-planner.md"

GSD-Task: S01/T02

* feat: Created prompt-sanitizer.ts, wired headless prompt loading into P…

- "sdk/src/prompt-sanitizer.ts"
- "sdk/src/phase-prompt.ts"
- "sdk/src/gsd-tools.ts"
- "sdk/src/gsd-tools.test.ts"
- "sdk/src/phase-runner-types.test.ts"

GSD-Task: S01/T01

* test: Added 111 unit tests covering sanitizePrompt(), headless prompt l…

- "sdk/src/prompt-sanitizer.test.ts"
- "sdk/src/headless-prompts.test.ts"
- "sdk/src/phase-prompt.test.ts"

GSD-Task: S01/T03

* feat: Wired sdkPromptsDir preference and sanitizePrompt into InitRunner…

- "sdk/src/init-runner.ts"
- "sdk/package.json"

GSD-Task: S02/T01

* feat: add --init flag to auto command for single-command PRD-to-execution

gsd-sdk auto --init @path/to/prd.md now bootstraps the project (init)
then immediately runs the autonomous phase execution loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* chore: add remaining headless prompt files and templates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* test: Extended init-runner.test.ts with 7 sdkPromptsDir preference and…

- "sdk/src/init-runner.test.ts"

GSD-Task: S02/T03

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 22:40:34 -06:00

4.3 KiB
Raw Blame History

State Template

Template for .planning/STATE.md — the project's living memory.


File Template

# Project State

## Project Reference

See: .planning/PROJECT.md (updated [date])

**Core value:** [One-liner from PROJECT.md Core Value section]
**Current focus:** [Current phase name]

## Current Position

Phase: [X] of [Y] ([Phase name])
Plan: [A] of [B] in current phase
Status: [Ready to plan / Planning / Ready to execute / In progress / Phase complete]
Last activity: [YYYY-MM-DD] — [What happened]

Progress: [░░░░░░░░░░] 0%

## Performance Metrics

**Velocity:**
- Total plans completed: [N]
- Average duration: [X] min
- Total execution time: [X.X] hours

**By Phase:**

| Phase | Plans | Total | Avg/Plan |
|-------|-------|-------|----------|
| - | - | - | - |

**Recent Trend:**
- Last 5 plans: [durations]
- Trend: [Improving / Stable / Degrading]

*Updated after each plan completion*

## Accumulated Context

### Decisions

Decisions are logged in PROJECT.md Key Decisions table.
Recent decisions affecting current work:

- [Phase X]: [Decision summary]
- [Phase Y]: [Decision summary]

### Pending Todos

[Pending ideas captured during sessions]

None yet.

### Blockers/Concerns

[Issues that affect future work]

None yet.

## Session Continuity

Last session: [YYYY-MM-DD HH:MM]
Stopped at: [Description of last completed action]
Resume file: [Path to .continue-here*.md if exists, otherwise "None"]

STATE.md is the project's short-term memory spanning all phases and sessions.

Problem it solves: Information is captured in summaries, issues, and decisions but not systematically consumed. Sessions start without context.

Solution: A single, small file that's:

  • Read first in every workflow
  • Updated after every significant action
  • Contains digest of accumulated context
  • Enables instant session restoration

Creation: After ROADMAP.md is created (during init)

  • Reference PROJECT.md (read it for current context)
  • Initialize empty accumulated context sections
  • Set position to "Phase 1 ready to plan"

Reading: First step of every workflow

  • progress: Present status to user
  • plan: Inform planning decisions
  • execute: Know current position
  • transition: Know what's complete

Writing: After every significant action

  • execute: After SUMMARY.md created
    • Update position (phase, plan, status)
    • Note new decisions (detail in PROJECT.md)
    • Add blockers/concerns
  • transition: After phase marked complete
    • Update progress bar
    • Clear resolved blockers
    • Refresh Project Reference date

Project Reference

Points to PROJECT.md for full context. Includes:

  • Core value (the ONE thing that matters)
  • Current focus (which phase)
  • Last update date (triggers re-read if stale)

Claude reads PROJECT.md directly for requirements, constraints, and decisions.

Current Position

Where we are right now:

  • Phase X of Y — which phase
  • Plan A of B — which plan within phase
  • Status — current state
  • Last activity — what happened most recently
  • Progress bar — visual indicator of overall completion

Progress calculation: (completed plans) / (total plans across all phases) × 100%

Performance Metrics

Track velocity to understand execution patterns:

  • Total plans completed
  • Average duration per plan
  • Per-phase breakdown
  • Recent trend (improving/stable/degrading)

Updated after each plan completion.

Accumulated Context

Decisions: Reference to PROJECT.md Key Decisions table, plus recent decisions summary for quick access. Full decision log lives in PROJECT.md.

Pending Todos: Ideas captured during sessions.

  • Count of pending todos
  • Brief list if few, count if many

Blockers/Concerns: From "Next Phase Readiness" sections

  • Issues that affect future work
  • Prefix with originating phase
  • Cleared when addressed

Session Continuity

Enables instant resumption:

  • When was last session
  • What was last completed
  • Is there a .continue-here file to resume from

<size_constraint>

Keep STATE.md under 100 lines.

It's a DIGEST, not an archive. If accumulated context grows too large:

  • Keep only 3-5 recent decisions in summary (full log in PROJECT.md)
  • Keep only active blockers, remove resolved ones

The goal is "read once, know where we are" — if it's too long, that fails.

</size_constraint>