---
phase: 01.8-add-workflows-templated-artifacts
plan: 02
type: execute
wave: 2
depends_on: ["01.8-01"]
files_modified:
  - src/gsd_lite/template/workflows/map-codebase.md
  - src/gsd_lite/template/workflows/new-project.md
autonomous: true

must_haves:
  truths:
    - "Agent can map any codebase following map-codebase.md workflow"
    - "Agent can initialize a new project following new-project.md workflow"
    - "Both workflows follow GSD-lite patterns (coaching philosophy, sticky notes, first-turn protocol)"
    - "Workflows are standalone utilities (not part of moodboard/whiteboard/execution core loop)"
  artifacts:
    - path: "src/gsd_lite/template/workflows/map-codebase.md"
      provides: "Codebase mapping workflow for single-agent"
      contains: "## Coaching Philosophy"
    - path: "src/gsd_lite/template/workflows/new-project.md"
      provides: "Project initialization workflow for single-agent"
      contains: "## Coaching Philosophy"
  key_links:
    - from: "map-codebase.md"
      to: "ARCHITECTURE.md"
      via: "Workflow produces ARCHITECTURE.md output"
      pattern: "ARCHITECTURE\\.md"
    - from: "new-project.md"
      to: "PROJECT.md"
      via: "Workflow produces PROJECT.md output"
      pattern: "PROJECT\\.md"
---

<objective>
Create map-codebase.md and new-project.md workflows adapted from OG GSD for single-agent, grep-friendly GSD-lite use.

Purpose: These workflows guide the agent through codebase mapping and project initialization, producing the ARCHITECTURE.md and PROJECT.md templates from Plan 01.

Output: Two workflow files in `src/gsd_lite/template/workflows/` following GSD-lite conventions.
</objective>

<context>
@.planning/phases/01.8-add-workflows-templated-artifact-for-codebase-mapper-and-new-project-inspired-from-gsd-upstream-workflows/01.8-CONTEXT.md
@.planning/phases/01.8-add-workflows-templated-artifact-for-codebase-mapper-and-new-project-inspired-from-gsd-upstream-workflows/01.8-01-SUMMARY.md

OG GSD patterns to adapt (NOT copy):
@.claude/get-shit-done/workflows/map-codebase.md
@.claude/get-shit-done/workflows/discovery-phase.md

GSD-lite workflow pattern to follow:
@src/gsd_lite/template/workflows/moodboard.md
@src/gsd_lite/template/PROTOCOL.md
</context>

<tasks>

<task type="auto">
  <name>Task 1: Create map-codebase.md workflow</name>
  <files>src/gsd_lite/template/workflows/map-codebase.md</files>
  <action>
Create `src/gsd_lite/template/workflows/map-codebase.md` - a single-agent workflow for mapping existing codebases.

**Adapt from OG GSD map-codebase.md but convert to single-agent:**
- OG spawns 4 parallel agents (tech, arch, quality, concerns) - GSD-lite does this sequentially in ONE agent
- OG produces 7 files - GSD-lite produces 1 file (ARCHITECTURE.md)
- OG has model profiles - GSD-lite doesn't (single agent context)

**Required structure (follow moodboard.md pattern):**

```markdown
# Map Codebase Workflow

[SYSTEM: MAP-CODEBASE MODE - Codebase Discovery]

## Initialization Check
[Check if ARCHITECTURE.md exists - read and update vs create fresh]

## Entry Conditions
- User requests codebase mapping
- Agent suggests mapping (ARCHITECTURE.md missing AND codebase exists)

## Exit Conditions
- ARCHITECTURE.md written to gsd-lite/ARCHITECTURE.md
- User confirms output is accurate

---

## Coaching Philosophy
[Copy from moodboard.md - user + agent = thinking partners]

---

## First Turn Protocol
[Same as moodboard.md - talk before writing]

---

## Mapping Process

### Step 1: Discover Project Structure
[Grep/ls to understand directory layout]
[Build table of directories -> semantic meaning]

### Step 2: Identify Tech Stack
[Read package.json, requirements.txt, Cargo.toml, etc.]
[Extract runtime, language, 2-5 key dependencies]

### Step 3: Trace Data Flow
[Read entry points, follow imports]
[Create mermaid OR text description]

### Step 4: Document Entry Points
[Identify "start reading here" files]

### Step 5: Write ARCHITECTURE.md
[Use template from src/gsd_lite/template/ARCHITECTURE.md]
[Write to gsd-lite/ARCHITECTURE.md]

---

## Sticky Note Protocol
[Same as moodboard.md - status block at end of every turn]

---

*Workflow Version: 1.0*
```

**Key adaptations from OG GSD:**
- NO subagent spawning (single agent does all work)
- NO model profiles (single agent context)
- NO 7 separate files (single ARCHITECTURE.md output)
- YES coaching philosophy section
- YES first-turn protocol
- YES sticky note protocol
- Output location: `gsd-lite/ARCHITECTURE.md` (user's working directory, not template)
  </action>
  <verify>File exists at `src/gsd_lite/template/workflows/map-codebase.md` with Coaching Philosophy, First Turn Protocol, and Sticky Note Protocol sections</verify>
  <done>map-codebase.md workflow follows GSD-lite patterns and produces single ARCHITECTURE.md output</done>
</task>

<task type="auto">
  <name>Task 2: Create new-project.md workflow</name>
  <files>src/gsd_lite/template/workflows/new-project.md</files>
  <action>
Create `src/gsd_lite/template/workflows/new-project.md` - a single-agent workflow for initializing new projects.

**Adapt from OG GSD discovery-phase.md but convert to single-agent:**
- OG has elaborate process with Context7 MCP, WebSearch, etc. - GSD-lite uses simpler questioning
- OG produces complex PROJECT.md with lifecycle tracking - GSD-lite produces lightweight PROJECT.md
- OG has validation checkpoints - GSD-lite uses coaching conversation

**Required structure (follow moodboard.md pattern):**

```markdown
# New Project Workflow

[SYSTEM: NEW-PROJECT MODE - Project Initialization]

## Initialization Check
[Check if PROJECT.md exists - read and update vs create fresh]

## Entry Conditions
- User starts new project
- User states vision and no PROJECT.md exists

## Exit Conditions
- PROJECT.md written to gsd-lite/PROJECT.md
- User confirms it captures their vision

---

## Coaching Philosophy
[Copy from moodboard.md - user + agent = thinking partners]

---

## First Turn Protocol
[Same as moodboard.md - talk before writing]

---

## Questioning Protocol

### What User Knows
[Same as moodboard.md - vision, feel, essentials, behaviors]

### What Agent Discovers
[Through conversation, not technical probing]

### Question Types
[Motivation, Concreteness, Clarification, Success - from moodboard.md]

### Vision Reflection
[Same as moodboard.md - reflect back understanding]

---

## Project Initialization Process

### Step 1: Extract Vision
[Ask about what they're building and why]
[Use moodboard questioning patterns]

### Step 2: Identify Core Value
[What's the ONE thing that must work?]

### Step 3: Define Success Criteria
[What does "done" look like?]
[Create checkbox list of observable outcomes]

### Step 4: Gather Context
[Background, environment, prior work]

### Step 5: Identify Constraints
[Hard limits with rationale]

### Step 6: Write PROJECT.md
[Use template from src/gsd_lite/template/PROJECT.md]
[Write to gsd-lite/PROJECT.md]

---

## Transition to Moodboard

After PROJECT.md is written:
- "PROJECT.md captures your vision. Ready to plan the first phase?"
- If yes: transition to moodboard.md workflow
- If no: user may want to refine PROJECT.md first

---

## Sticky Note Protocol
[Same as moodboard.md - status block at end of every turn]

---

*Workflow Version: 1.0*
```

**Key adaptations from OG GSD:**
- NO Context7 MCP or WebSearch (simpler questioning)
- NO elaborate validation gates (coaching conversation instead)
- NO lifecycle tracking (Validated/Active/Out of Scope)
- YES coaching philosophy section
- YES first-turn protocol
- YES sticky note protocol
- YES vision reflection (from moodboard.md)
- Output location: `gsd-lite/PROJECT.md` (user's working directory, not template)
  </action>
  <verify>File exists at `src/gsd_lite/template/workflows/new-project.md` with Coaching Philosophy, First Turn Protocol, Questioning Protocol, and Sticky Note Protocol sections</verify>
  <done>new-project.md workflow follows GSD-lite patterns and produces lightweight PROJECT.md output</done>
</task>

</tasks>

<verification>
After both tasks complete:
1. `ls src/gsd_lite/template/workflows/` shows map-codebase.md and new-project.md exist
2. `grep "Coaching Philosophy" src/gsd_lite/template/workflows/map-codebase.md` returns match
3. `grep "Coaching Philosophy" src/gsd_lite/template/workflows/new-project.md` returns match
4. `grep "First Turn Protocol" src/gsd_lite/template/workflows/*.md` returns matches in both files
5. Neither workflow contains OG GSD patterns like "spawn_agents", "Task tool", "subagent_type"
</verification>

<success_criteria>
- map-codebase.md workflow exists with single-agent codebase mapping process
- new-project.md workflow exists with conversational project initialization
- Both workflows include Coaching Philosophy section
- Both workflows include First Turn Protocol section
- Both workflows include Sticky Note Protocol section
- Neither workflow references multi-agent patterns (spawning, Task tool, etc.)
- Both workflows reference their respective output templates (ARCHITECTURE.md, PROJECT.md)
</success_criteria>

<output>
After completion, create `.planning/phases/01.8-add-workflows-templated-artifact-for-codebase-mapper-and-new-project-inspired-from-gsd-upstream-workflows/01.8-02-SUMMARY.md`
</output>
