---
name: skill-prompt-template
description: Use when designing or reviewing the content structure of Agent Skill prompts (Goal/Constraints/Workflow modules).
allowed-tools: Read, Write, Edit, Glob, Grep
---

# Skill Prompt Template

定义 Agent Skill 提示词的**内容结构模板**。

## 与 generate-skill-prompt 的区别

| Skill | 关注点 |
|-------|--------|
| `generate-skill-prompt` | 文件结构、代码格式、常量引用、中英翻译注释 |
| `skill-prompt-template`（本 Skill） | **内容结构模板**：Goal/Constraints/Workflow 等模块 |

## 内容结构模板

```markdown
## [Skill Name]

### Goal（目标）
一句话说明这个 Skill 要达成什么。

### Constraints（约束）
- NEVER do X
- ALWAYS ensure Y
- DO NOT assume Z

### Available Tools（可用工具）
| Tool | Purpose |
|------|---------|
| `toolA` | Does X |

### Workflow（工作流）
1. **Step 1**: Description
2. **Step 2**: Description

### Rules（规则）- 可选
业务规则、映射关系。

### Output（输出）- 可选
完成后应该输出什么。

### Communication（沟通规范）
NEVER expose internal tool names.
```

## 模块说明

| 模块 | 必需 | 说明 |
|------|------|------|
| **Goal** | ✅ | 一句话目标，LLM 据此判断是否完成 |
| **Constraints** | ✅ | 边界和禁止事项，防止越界 |
| **Available Tools** | ✅ | 可用工具列表 |
| **Workflow** | ✅ | 分步骤执行流程 |
| **Rules** | 可选 | 业务规则、映射关系 |
| **Output** | 可选 | 完成后输出什么 |
| **Communication** | 推荐 | 沟通规范，禁止暴露内部名称 |

## 模块详细说明

### Goal

一句话说明 Skill 的核心目标，LLM 据此判断任务是否完成。

```markdown
### Goal
Calculate accurate loan pricing by extracting parameters from conversation and calling product-specific pricing tools.
```

**要点**：
- 简洁明了，一句话概括
- 动词开头（Calculate, Extract, Generate...）
- 包含核心输出（pricing, report, analysis...）

### Constraints

列出边界和禁止事项，防止 LLM 越界：

```markdown
### Constraints
- All fields are optional but have NO default values
- Missing fields → related adjustments are SKIPPED (not applied with assumed values)
- Always pass all known fields explicitly, even boolean fields like `isForeignNational: false`
- Only `lockDays: 30` and `extensionDays: 0` have defaults
```

**要点**：
- 使用 NEVER / ALWAYS / DO NOT 等强调词
- 说明默认值行为（有/无）
- 列出边界条件

### Available Tools

表格列出可用工具及其用途：

```markdown
### Available Tools
| Tool | Purpose |
|------|---------|
| `priceUniverse` | Calculate Universe product pricing |
| `priceOcean` | Calculate Ocean product pricing |
```

**要点**：
- 使用 Markdown 表格
- 每个工具一行
- Purpose 简洁明了

### Workflow

分步骤描述执行流程：

```markdown
### Workflow
1. **Extract**: Extract known values from conversation history
2. **Call**: Call pricing tool(s) for eligible products (parallel if multiple)
3. **Report**: Tell user which fields were extracted vs omitted
4. **Update**: On "Change X to Y", re-call with updated value, keep others
```

**要点**：
- 有序列表
- 每步骤加粗标题
- 描述具体动作

### Rules（可选）

业务规则、映射关系：

```markdown
### Rules
- Explicit: "FICO 720" → `ficoScore: 720`
- Inferred: "Cash-out refi" → `loanPurpose: "cashOut"`
- Unknown: omit the field (engine skips related adjustments)
```

**要点**：
- 使用示例说明
- 箭头表示映射关系
- 说明未知情况的处理

### Output（可选）

完成后应该输出什么：

```markdown
### Output
After pricing, tell user:
- Which values came from their input
- Which fields were omitted (related adjustments skipped)
- Which fields used defaults (lockDays, extensionDays)
```

**要点**：
- 明确列出输出内容
- 说明输出条件

### Communication

沟通规范，防止暴露内部实现：

```markdown
### Communication
NEVER expose tool names to users.
- ❌ "Let me run priceUniverse"
- ✅ "Let me calculate the pricing"
```

**要点**：
- 正反示例对比
- 使用 ❌/✅ 标记

## 使用示例

### 重构现有 Prompt

将现有 Prompt 的各部分映射到模板模块：

| 现有模块 | 映射到 |
|----------|--------|
| (无明确目标) | **Goal** - 新增 |
| Critical Field Dependencies | **Constraints** |
| Available Tools | **Available Tools** |
| Core Behavior + After Pricing | **Workflow** + **Output** |
| Extraction Rules | **Rules** |
| Communication | **Communication** |

### 创建新 Prompt

1. 从 Goal 开始，明确核心目标
2. 列出 Constraints，防止越界
3. 填写 Available Tools 表格
4. 设计 Workflow 步骤
5. 根据需要添加 Rules、Output
6. 最后添加 Communication 规范

## 检查清单

| 检查项 | 验证方法 |
|--------|----------|
| Goal 存在 | 有明确的一句话目标 |
| Constraints 完整 | 列出所有边界和禁止事项 |
| Tools 表格化 | 使用 Markdown 表格 |
| Workflow 有序 | 使用有序列表，步骤清晰 |
| Communication 有示例 | 正反对比，❌/✅ 标记 |
