{{!--
  GATE Template - Validation Checklists

  Purpose: Generate reusable quality and completion checks.

  Use Cases:
  - Art mandatory elements
  - Development completion gates
  - Research source verification
  - Deployment checklists
  - Security reviews

  Input Data Structure:
  ```yaml
  gate:
    name: string
    category: string
    description: string
    action_on_fail: string
    mandatory:
      - name: string
        description: string
    recommended:
      - name: string
        description: string
  ```

  Usage:
  bun run RenderTemplate.ts -t Primitives/Gate.hbs -d Data/ValidationGates.yaml -o Compiled/Gates.md
--}}

{{#if gates}}
# Validation Gates

{{#if version}}
**Version:** {{version}}
{{/if}}

---

{{#each gates}}
## {{name}}

{{#if category}}
**Category:** `{{category}}`
{{/if}}
{{#if description}}
**Description:** {{description}}
{{/if}}
{{#if action_on_fail}}
**On Failure:** {{action_on_fail}}
{{/if}}

{{#if mandatory}}
### 🚨 MANDATORY

{{#if action_on_fail}}
*If ANY item below fails → **{{action_on_fail}}***
{{/if}}

{{#each mandatory}}
- [ ] **{{name}}** — {{description}}
{{/each}}
{{/if}}

{{#if recommended}}
### ✅ RECOMMENDED

{{#each recommended}}
- [ ] {{name}} — {{description}}
{{/each}}
{{/if}}

---

{{/each}}

{{else}}
{{!-- Single gate mode --}}
## {{gate.name}} Checklist

{{#if gate.category}}
**Category:** `{{gate.category}}`
{{/if}}
{{#if gate.description}}
{{gate.description}}
{{/if}}

{{#if gate.mandatory}}
### 🚨 MANDATORY

{{#if gate.action_on_fail}}
*If ANY item below fails → **{{gate.action_on_fail}}***
{{/if}}

{{#each gate.mandatory}}
- [ ] **{{name}}** — {{description}}
{{/each}}
{{/if}}

{{#if gate.recommended}}
### ✅ RECOMMENDED

{{#each gate.recommended}}
- [ ] {{name}} — {{description}}
{{/each}}
{{/if}}

{{/if}}

{{#if categories}}
---

## Categories

| Category | Description |
|----------|-------------|
{{#each categories}}
| `{{this}}` | Gates related to {{this}} |
{{/each}}
{{/if}}
