# {{ skill_name }} Skill

## Purpose

{{ description }}

## When to Use

This skill is triggered by phrases like:
{% for trigger in intent_triggers %}
- "{{ trigger }}"
{% endfor %}

## Instructions for View Renderer

{% if internal_tools %}
### 1. Call Internal Tools

**IMPORTANT**: All tools use the `params: Dict[str, Any]` pattern. Pass parameters as a dictionary:

{% for tool in internal_tools %}
```python
# Call {{ tool }} with required parameters
{{ tool }}_result = {{ tool }}({
    # Add required parameters here as key-value pairs
    # Example: "param_name": value
})
```
{% endfor %}

### 2. Prepare View Parameters

Extract data from tool results and build the view params object:

{% else %}
### 1. Prepare View Parameters

This skill has no internal tools. Build the view params directly:

{% endif %}
{% if view_props %}
```python
view_params = {
{% for prop_name, prop_info in view_props.items() %}
{% set prop_type = prop_info.get('type', 'string') if prop_info is mapping else prop_info %}
{% if internal_tools %}
    "{{ prop_name }}": {{ internal_tools[0] }}_result.get("{{ prop_name }}"),  # {{ prop_type }}
{% else %}
    "{{ prop_name }}": ...,  # {{ prop_type }}{% if prop_info is mapping and prop_info.get('description') %} - {{ prop_info.get('description') }}{% endif %}

{% endif %}
{% endfor %}
}
```

### View Props Reference

| Property | Type | Description |
|----------|------|-------------|
{% for prop_name, prop_info in view_props.items() %}
| `{{ prop_name }}` | {{ prop_info.get('type', 'any') if prop_info is mapping else prop_info }} | {{ prop_info.get('description', '-') if prop_info is mapping else '-' }} |
{% endfor %}
{% else %}
```python
view_params = {
    # Define view parameters based on tool results
}
```
{% endif %}

## Example Implementation

```python
{% if internal_tools %}
# Step 1: Call the required tools with params dict pattern
{% for tool in internal_tools %}
{{ tool }}_data = {{ tool }}({
    # Add your parameters here
})
{% endfor %}

# Step 2: Extract data and build view_params
{% endif %}
view_params = {
{% for prop_name, prop_info in view_props.items() %}
{% set prop_type = prop_info.get('type', 'string') if prop_info is mapping else prop_info %}
{% if prop_type == 'string' %}
    "{{ prop_name }}": "Sample {{ prop_name }}",
{% elif prop_type == 'number' or prop_type == 'integer' %}
    "{{ prop_name }}": 0,
{% elif prop_type == 'boolean' %}
    "{{ prop_name }}": False,
{% elif prop_type == 'array' %}
    "{{ prop_name }}": [],
{% elif prop_type == 'object' %}
    "{{ prop_name }}": {},
{% else %}
    "{{ prop_name }}": None,
{% endif %}
{% endfor %}
}
```

## Parameter Extraction Rules

When extracting parameters from the user's message:

| User Intent | Parameters to Extract |
|-------------|----------------------|
{% for trigger in intent_triggers[:3] %}
| "{{ trigger }}" | Analyze message for relevant values |
{% endfor %}

## Important Notes

- **Output view:** `{{ output_view }}`
{% if requires_auth %}- **Authentication:** Required - ensure user is authenticated{% else %}- **Authentication:** Not required{% endif %}
{% if internal_tools %}- **Tool dependencies:** {{ internal_tools | join(', ') }}{% endif %}
- **Tool calling pattern:** Always use `tool_name({"param": value})` format
- **Error handling:** Check tool results for `status: "success"` before using data
