# Intent Gate

> Fork Overlay：ce:work 意图分类门控。在执行前识别任务意图（实现/修复/重构/探索），设定对应的执行策略。使用时机：ce:work Phase 0（环境扫描）之后、Phase 1（Quick Start）之前。

- **Type:** Skill
- **Install:** `agentstack add skill-jerrylalala-compound-engineering-intent-gate`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Jerrylalala](https://agentstack.voostack.com/s/jerrylalala)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Jerrylalala](https://github.com/Jerrylalala)
- **Source:** https://github.com/Jerrylalala/compound-engineering/tree/main/plugins/compound-engineering/skills-custom/intent-gate

## Install

```sh
agentstack add skill-jerrylalala-compound-engineering-intent-gate
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Intent Gate — 意图分类门控

> **参考**：oh-my-openagent 的 Intent Classification 思路，适配本仓库 ce:work 流程。
>
> **目的**：避免 ce:work 对所有任务一刀切处理；不同意图需要不同的执行策略。

---

## 意图分类

| 意图 | 英文 | 触发信号 | 执行策略 |
|------|------|----------|----------|
| **实现新功能** | implement | "新增"、"添加"、"实现"、"create"、"add"、"implement" | TDD 优先，先写测试再实现 |
| **修复问题** | fix | "修复"、"修复 bug"、"fix"、"broken"、"error" | 先定位根因（systematic-debugging），再修复 |
| **重构** | refactor | "重构"、"优化"、"清理"、"refactor"、"cleanup" | 确保有测试覆盖，小步骤重构 |
| **探索/分析** | explore | "分析"、"研究"、"了解"、"explore"、"investigate" | 只读模式，不改代码，生成报告 |
| **配置/文档** | configure | "配置"、"文档"、"设置"、"config"、"docs" | 轻量执行，无需 TDD |
| **混合** | mixed | 多种意图混合 | 拆分为独立子任务，逐一处理 |

---

## 门控检测流程

在 ce:work Phase 0 完成后，执行意图分类：

### Step 1: 自动分类

分析输入文档（plan 或 bare prompt）中的关键词，得出初始分类：

```
输入分析 → 关键词匹配 → 初始意图
```

### Step 2: 置信度评估

| 置信度 | 行为 |
|--------|------|
| ≥ 0.80 | 直接设定执行策略，不询问 |
| 0.60-0.79 | 展示分类结果，询问确认（单问） |
|  **注意**：不使用分数相命名（如 Phase 0.5），以避免与 ce:work 原有整数相编号冲突。

**不修改 ce:work SKILL.md**。在调用 ce:work 前先加载 intent-gate skill，按其指导调整执行方式。

---

## 意图门控日志

在 state.md 中记录意图分类结果（如有 Task Bundle）：

```yaml
# state.md 新增字段
intent:
  detected: fix
  confidence: 0.85
  strategy: "systematic-debugging → write reproduction test → fix → verify"
  intent_gate_at: "2026-04-08T10:00:00+08:00"
```

---

## 防误用说明

| 场景 | 正确处理 |
|------|----------|
| 用户说"修复这个 bug"但实际是新功能 | Intent Gate 检测为 implement，提示用户确认 |
| 混合意图（既修复又重构） | 拆分为两个子任务，分别处理 |
| 用户明确说"直接实现，不要 TDD" | 尊重用户意图，跳过 TDD 要求 |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Jerrylalala](https://github.com/Jerrylalala)
- **Source:** [Jerrylalala/compound-engineering](https://github.com/Jerrylalala/compound-engineering)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-jerrylalala-compound-engineering-intent-gate
- Seller: https://agentstack.voostack.com/s/jerrylalala
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
