# v5 manifest template for /feature command.
# Spec: ../SCHEMA.md (validation rules, DAG invariants, migration mapping).
# Additive over v4 — v4 manifests still parse and are treated as single-slice
# by the v5 reader (see src/manifest.ts).
#
# Placeholders: {name}, {description}, {date}, {skeleton_variant}
# Written to: .forge/work/feature/{name}/manifest.yaml

schema_version: "5"
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

# Pre-build phases (unchanged from v4)
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 }
  # NOTE: v4's `phases.build.tasks: []` is replaced by `slice_graph` below.
  # `phases.build` is intentionally absent in v5; the v5 reader treats v4
  # manifests (with `phases.build.tasks`) as a single-slice graph.
  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

# v5 NEW — slice graph replaces flat task list.
# DAG: each slice declares its dependencies. No edges list (per-node
# depends_on is the source of truth). Verifier (see SCHEMA.md) rejects:
# unresolved deps, self-deps, cycles, gate-name collisions with manifest-level
# gates, and non-skeleton slices that don't transitively depend on the
# skeleton (when a skeleton slice is present).
#
# Skeleton is OPTIONAL. /greenfield and /feature use a skeleton slice;
# /bugfix and /hotfix omit it (small touches don't earn fake structure).
# At most one slice may have type: skeleton. If present, it is the root.
slice_graph:
  current_slice: skeleton     # which slice the agent is working on now
  slices:
    skeleton:
      type: skeleton          # skeleton | feature-slice | refactor-slice
      variant: {skeleton_variant}   # backend-server | frontend-spa | cli-tool | library | mobile-app — set during stack selection
      depends_on: []
      status: pending         # pending | in-progress | gated | complete
      gates:
        skeleton-runs:    { status: pending, gate-passed: false }
        wiki-lint:        { status: pending, gate-passed: false }
        runtime-reach:    { status: pending, gate-passed: false }

    # Example slice — replace/extend during /feature flow.
    # Slices are added by plan-task-decompose and confirmed by user.
    example-slice:
      type: feature-slice
      depends_on: [skeleton]
      status: pending
      gates:
        build-tdd:        { status: pending, gate-passed: false }
        wiki-lint:        { status: pending, gate-passed: false }
        runtime-reach:    { status: pending, gate-passed: false }
        code-review:      { status: pending, gate-passed: false }
