# Template: Agent with Preloaded Skills

Use this template for agents that need skills injected at startup for domain knowledge.

## Generated agent file format:

```yaml
---
name: {{AGENT_NAME}}
description: {{DESCRIPTION}}
{{#if MODEL}}
model: {{MODEL}}
{{/if}}
{{#if TOOLS}}
tools: "{{TOOLS}}"
{{/if}}
{{#if PERMISSION_MODE}}
permissionMode: {{PERMISSION_MODE}}
{{/if}}
skills:
{{#each SKILLS}}
  - {{this}}
{{/each}}
{{#if COLOR}}
color: {{COLOR}}
{{/if}}
---

{{SYSTEM_PROMPT}}

## Preloaded Knowledge

This agent has the following skills preloaded for domain expertise:
{{#each SKILLS}}
- **{{this}}**: Provides knowledge about {{SKILL_PURPOSE}}
{{/each}}

## Workflow

1. **{{STEP_1_NAME}}**: {{STEP_1_DESC}}
2. **{{STEP_2_NAME}}**: {{STEP_2_DESC}}
3. **{{STEP_3_NAME}}**: {{STEP_3_DESC}}

## Execution Rules

- {{RULE_1}}
- {{RULE_2}}
- Always reference preloaded skill knowledge when applicable
- {{RULE_3}}

## Output Format

{{OUTPUT_FORMAT_DESCRIPTION}}
```

## How Skills Preloading Works:
- The `skills` field injects the FULL content of each listed skill into the agent's context at startup
- This gives the agent domain-specific knowledge without needing to search for it
- Increases initial context size but improves response quality
- Skills must exist in the same scope or a higher-priority scope

## When to Use:
- Agent needs deep domain knowledge (e.g., code reviewer needs review-code skill)
- Agent operates in a specific framework context
- Agent needs access to conventions and patterns
- Agent should follow specific workflows defined in skills

## Considerations:
- Each preloaded skill adds to context size
- Limit to 1-3 skills for optimal performance
- Prefer specific skills over broad ones
- Ensure skills are relevant to the agent's purpose

## Example:
```yaml
---
name: smartstack-reviewer
description: Code reviewer specialized in SmartStack conventions
model: sonnet
tools: "Read, Grep, Glob"
permissionMode: plan
skills:
  - review-code
  - validate
---

You are a SmartStack-aware code reviewer. Use the preloaded review-code
and validate skills to check code against SmartStack conventions.
```

## Notes:
- The code-reviewer agent in SmartStack uses this pattern (loads review-code skill)
- Keep the number of preloaded skills minimal (1-3)
- Agent description should mention the specialized knowledge area
