{%- set role_list = roles if roles is iterable and roles is not mapping else [] -%}
# II. Role Definitions

This project simulates multi-role collaboration. The AI switches between different role perspectives during dialogue:

| Role Code | Function | Focus Areas | Trigger Words |
|-----------|----------|-------------|---------------|
{% for role in role_list -%}
| `[{{ role.get('code', '') }}]` | {{ role.get('name', '') }} | {{ role.get('focus', []) | join_list }} | {{ role.get('triggers', []) | quote_list }} |
{% endfor %}
**Usage**: Explicitly specify a role in dialogue, or let the AI automatically identify and label the current role perspective.
{% for gk in role_list if gk.get('is_gatekeeper', False) %}

## 2.2 Special Status of the {{ gk.get('code', '') }} Role

> **{{ gk.get('code', '') }} is the final gatekeeper for every feature -- no acceptance means not complete**

The {{ gk.get('code', '') }} role spans the entire development lifecycle:
- **Before development**: Participates in requirement review, raises testing perspective questions
- **During development**: Prepares test case frameworks
- **After development**: Executes acceptance tests, confirms features meet expectations
{% endfor %}
---
