# Extensions configuration template - docs/extensions.yaml
kind: extensions
version: "1"
updated_at: "{{ today }}"

# Domain Extensions
{% if extensions.extensions %}
extensions:
{% for ext_domain, ext in extensions.extensions.items() %}
  {{ ext_domain }}:
    name: "{{ ext_domain.upper() }}"
    {% if ext.hooks %}hooks:
{% for hook in ext.hooks %}
      - trigger: "{{ hook.trigger }}"
        action: "{{ hook.action }}"
        condition: "{{ hook.condition | default('') }}"
        context_id: "{{ hook.context_id }}"
{% endfor %}{% endif %}
    {% if ext.contexts %}contexts:
{% for ctx_id, ctx in ext.contexts.items() %}
      {{ ctx_id }}:
        type: "{{ ctx.type }}"
        description: "{{ ctx.description | default('') }}"
        {% if ctx.source %}source: "{{ ctx.source }}"{% endif %}
        {% if ctx.pattern %}pattern: "{{ ctx.pattern }}"{% endif %}
{% endfor %}{% endif %}
    {% if ext.additional_files %}additional_files:
{% for af in ext.additional_files %}
      - path: "{{ af.path }}"
        purpose: "{{ af.purpose }}"
{% endfor %}{% endif %}
{% endfor %}
{% else %}
extensions: {}
# Example extension structure:
# web:
#   name: "WEB"
#   hooks:
#     - trigger: "on_build"
#       action: "validate_routes"
#       condition: "has_routing"
#       context_id: "routing_context"
#   contexts:
#     routing_context:
#       type: "file"
#       description: "Web routing configuration"
#       source: "src/routes.yaml"
#   additional_files:
#     - path: "docs/API.md"
#       purpose: "API documentation"
{% endif %}

# Extension Configuration Principles
extension_principles:
  - "Extensions add domain-specific workflow hooks"
  - "Hooks are triggered at specific workflow points"
  - "Contexts provide injectable domain knowledge"
  - "Extensions are optional and composable"
