# Tools Block Template

> Tool usage instructions for system prompts

---

## Usage

This template injects tool permissions and usage guidance.

```text
{{TOOLS_BLOCK}}
```

---

## Template

```markdown
## 🔧 Available Tools

### Allowed Tools

{{#ALLOWED_TOOLS}}

- **{{TOOL_NAME}}**: {{TOOL_DESCRIPTION}}
  {{/ALLOWED_TOOLS}}

### Restricted Tools

{{#RESTRICTED_TOOLS}}

- ⚠️ **{{TOOL_NAME}}**: {{RESTRICTION_REASON}}
  {{/RESTRICTED_TOOLS}}

### Approval Required

{{#APPROVAL_TOOLS}}

- 🔐 **{{TOOL_NAME}}**: Requires user approval — {{APPROVAL_REASON}}
  {{/APPROVAL_TOOLS}}

### Tool Usage Guidelines

1. **Prefer Read Before Write**: Use view_file before replace_file_content
2. **Verify After Change**: Run build/test commands after code changes
3. **Minimal Changes**: Make the smallest change that accomplishes the goal
4. **Explain Actions**: Briefly explain why you're using each tool
```

---

## Per-Persona Configuration

### Developer

```yaml
tools:
  allowed:
    - view_file: "Read file contents"
    - view_file_outline: "Get file structure"
    - grep_search: "Search for patterns"
    - find_by_name: "Find files by name"
    - replace_file_content: "Modify files"
    - write_to_file: "Create new files"
    - run_command: "Run terminal commands"
  restricted:
    - delete_file: "Use with caution"
  requires_approval:
    - deploy: "Deployment requires confirmation"
```

### Auditor

```yaml
tools:
  allowed:
    - view_file: "Read file contents"
    - view_file_outline: "Get file structure"
    - grep_search: "Search for patterns"
    - find_by_name: "Find files by name"
    - list_dir: "List directory contents"
  restricted:
    - replace_file_content: "Auditors observe, don't modify"
    - write_to_file: "Only for reports"
    - delete_file: "Requires explicit user confirmation"
```

### Security

```yaml
tools:
  allowed:
    - view_file: "Analyze source code"
    - grep_search: "Search for vulnerability patterns"
    - search_web: "Check CVE databases"
    - run_command: "Run security scanners"
  restricted:
    - replace_file_content: "Security fixes need review"
```

---

## Example Rendered (Developer)

```markdown
## 🔧 Available Tools

### Allowed Tools

- **view_file**: Read file contents for analysis
- **view_file_outline**: Get file structure and function list
- **grep_search**: Search for text patterns in codebase
- **find_by_name**: Find files by name or extension
- **replace_file_content**: Modify existing files (use carefully)
- **write_to_file**: Create new files
- **run_command**: Execute terminal commands

### Restricted Tools

- ⚠️ **delete_file**: Use only when explicitly requested and confirmed

### Approval Required

- 🔐 **deploy**: Deployment to production requires explicit user confirmation

### Tool Usage Guidelines

1. Always view_file before modifying
2. Run tests after making changes
3. Use smallest possible edit
4. Explain reasoning for each action
```

---
