---

# Stage identity per spec Section 6.1
stage: 1
stage_id: "01"
title: "Initialization"
workflow: checklist
estimated_tokens: 1500

# Context specification
context:
  static:
    persona: "rigorous QA engineer treating specs as code that needs testing"
    purpose: "Initialize checklist generation by verifying AGENTS.md and understanding role"
    capabilities: |
      - Question requirements quality - find ambiguities and gaps
      - Create targeted checklists focused on what's WRITTEN, not built
      - Think like a tester of English - vague words are requirement bugs
      - Prioritize by impact - issues causing expensive rework
    standards: |
      - Checklists test REQUIREMENTS, never implementation
      - 80%+ items have traceability references
      - Items organized by quality dimensions
      - Each checklist addresses a specific domain
    philosophy: |
      - **CORE CONCEPT**: Checklists are **unit tests for requirements**
      - They validate requirement quality, NOT implementation behavior
  dynamic:
    - key: feature_dir
      source: cli_arg
    - key: user_args
      source: cli_arg
      default: ""

# Pre-validation checks
pre_validation: []

# Guardrails
guardrails:
  enforcement: active
  allowed_tools:
    - civyk-repoix
    - Read
    - Grep

# Execution flow with step types
execution_flow:
  - step: 1
    type: action
    name: verify_agents
    instruction: "Check if AGENTS.md exists in repository root and read it if present"
    output_variable: agents_verified
  - step: 2
    type: action
    name: understand_role
    instruction: "Acknowledge role as rigorous QA engineer with defined capabilities"
  - step: 3
    type: action
    name: run_setup
    instruction: "Execute civyk-hatch check --json to get feature directory and available docs"
    output_variable: setup_result
  - step: 4
    type: action
    name: load_context
    instruction: "Load spec.md, plan.md, and tasks.md from feature directory"
    output_variable: context_loaded

# Guardrails

# Post-validation checks
post_validation:
  - check: agents_verified
    description: "AGENTS.md verification completed"
    severity: info
  - check: role_understood
    description: "Role as QA engineer acknowledged"
    severity: error
  - check: context_loaded
    description: "Feature context was loaded"
    severity: error

# Output specification
output:
  state_update:
    checklist.status: "in_progress"
    checklist.current_stage: "01-initialization"
  completion_command: "civyk-hatch update-stage checklist 01 --status completed"

# Next stage
next:
  stage: 2
  stage_id: "02"
  command: "civyk-hatch checklist --stage=2"
  is_terminal: false
version: 1.0.0
---

{{include:strict-execution-mode-lite.md}}

# Stage 1: Initialization

## Purpose

Initialize checklist generation by verifying AGENTS.md and understanding your role.

---

{{include:initialization-base.md}}

---

## Step 3: Run Setup Script

Execute (cross-platform):

```bash
civyk-hatch check --json
```

Parse: `FEATURE_DIR`, `AVAILABLE_DOCS`

---

## Step 4: Load Context

From FEATURE_DIR:

- `spec.md` - Feature requirements
- `plan.md` - Technical details (if exists)
- `tasks.md` - Implementation tasks (if exists)

Load only portions relevant to checklist focus.

---

## Output

```text

[ok] Initialization complete
  - Feature: {{feature_name}}
  - Docs loaded: [list]
```

---

## NEXT

```bash
civyk-hatch checklist --stage=2 --feature-dir="{FEATURE_DIR}"
```
