# Canonical manifest template for /feature command.
# Source of truth for manifest schema — do not duplicate elsewhere.
# Placeholders: {name}, {description}, {date}
# Written to: .forge/work/feature/{name}/manifest.yaml
#
# v6 adds phase_plan: the planned status of each workflow step. The preflight
# step (/feature Step 0c) confirms the plan with the user. Allowed values:
# active / active-light / active-commit-only / skipped / as-discovered /
# complete-inline. See templates/manifests/v6/SCHEMA.md §3.
#
# *** LIGHTWEIGHT IS THE DEFAULT ***
# The defaults below mirror the lightweight feature flow: build -> tests ->
# review -> PR. Extended phases (concept / wireframe / prototype / iterate /
# codify, plus plan-design-system / discover-codebase / uiux-review) are
# `skipped` by default; the /feature Step 0c preflight asks the user whether
# any of those phases is justified by risk / ambiguity / user-visible
# behavior, and flips the selected ones to `active`. Trivial fast-path
# (typo / copy / single-line) collapses Step 0c into a single confirmation.

schema_version: "6"
name: {name}
type: feature
description: "{description}"
status: in-progress  # in-progress | paused | completed | escalated
created: "{date}"
command: feature
complexity: standard  # trivial | standard | major
escalated_from: null
successor_path: null

# Plan-status per workflow milestone. Set during preflight; stable through
# execution. Allowed values: active | active-light | active-commit-only |
# skipped | as-discovered | complete-inline.
phase_plan:
  discover-codebase: skipped     # extended — flip to `active` at preflight when the codebase is unfamiliar
  concept: skipped               # extended — flip to `active` for multi-screen new flows
  wireframe: skipped             # extended — flip to `active` for UX iteration that benefits from a wireframe
  plan-design-system: skipped    # extended — frontend features that touch the design system flip to `active`
  prototype: skipped             # extended — flip to `active` for interactive exploration before commit
  iterate: skipped               # extended — auto-active when prototype is active
  codify: skipped                # extended — flip to `active` for architecture changes that need ADRs / oracles
  worktree: active               # feature-only key — creates an isolated branch on the existing repo before production-build. Greenfield uses `scaffold:` instead (initial project scaffold; no separate worktree because the repo itself is new). See templates/manifests/v6/SCHEMA.md §3.2 for the per-work-type allow-list.
  production-build: active       # baseline — implement + tests
  test-plan: active              # baseline — test coverage planning
  uiux-review: skipped           # extended — flip to `active` for UI changes that need design-system / accessibility review
  code-review-final: active      # baseline — final code review before PR
  deliver: active                # baseline — open PR
  onboarding: skipped            # extended — flip to `active` for user-visible features that need docs
  gotchas: as-discovered         # baseline — capture as found

# Gate state per phase. Skills update these as they run; gate-passed: true
# requires a matching Skill tool invocation (gate-enforcer.sh enforces).
# slice_graph is added at codify phase, when work is decomposed into slices.
phases:
  discover:
    codebase-analysis: { status: pending, gate-passed: false }
  plan:
    brainstorm: { status: pending, gate-passed: false }
    design-system: { status: pending, gate-passed: false }
    architecture: { status: pending, gate-passed: false }
    task-decompose: { status: pending, gate-passed: false }
  quality:
    code-review-final: { status: pending, gate-passed: false }
    test-plan: { status: pending, gate-passed: false }
    test-execution: { status: pending, gate-passed: false }
    uiux-review: { status: pending, gate-passed: false }
  deliver:
    pr-created: false
    deployed: false
    onboarding: false
  support:
    gotchas-recorded: false
