Interactive Section-level Intent approval tool.
Core Concepts
Intent documents are approved at the Section granularity, with three states:
| State | Marker | Meaning | Agent Behavior |
|---|---|---|---|
| LOCKED | ::: locked |
Core architecture, modifications require explicit human consent | Pause, request confirmation |
| REVIEWED | ::: reviewed |
Reviewed, modifications allowed but require notification | Allowed, notify afterward |
| DRAFT | ::: draft |
Draft, freely iterable | Freely modify |
Workflow
/intent-review [path]
↓
┌───────────────────┐
│ 解析 Intent 文件 │
│ 识别所有 Section │
└─────────┬─────────┘
↓
┌───────────────────┐
│ 展示状态概览 │
│ N locked │
│ M reviewed │
│ K draft/unmarked │
└─────────┬─────────┘
↓
┌───────────────────────────────────────┐
│ 逐个未标记 Section 询问 │
│ │
│ AskUserQuestion: │
│ "Section: [标题]" │
│ 选项: │
│ - Lock (核心架构) │
│ - Review (确认接受) │
│ - Skip (保持 draft) │
└─────────┬─────────────────────────────┘
↓
┌───────────────────┐
│ 更新文件 │
│ 添加标记和属性 │
└───────────────────┘
Usage
Approve a specified file
/intent-review src/core/intent/INTENT.md
Approve the current module
cd src/chambers/terminal
/intent-review
Automatically find intent/INTENT.md
Batch approval
/intent-review --all
Scan all intent files in the project
Execution Steps
1. Locate Intent files
// 优先级:
// 1. 用户指定路径
// 2. 当前目录下 intent/INTENT.md
// 3. 当前目录下 INTENT.md
2. Parse Sections
Identify two types of Sections:
Marked:
::: locked
## 模块边界
...
:::
Unmarked(ordinary markdown headings):
## API 设计
...
3. Display overview
Intent Review: src/core/intent/INTENT.md
状态概览:
├── 🔒 LOCKED: 2 sections
│ ├── 模块边界规则
│ └── 数据结构
├── ✓ REVIEWED: 3 sections
│ ├── API 签名 (by robert, 2026-01-19)
│ ├── 配置格式
│ └── 错误处理
└── 📝 UNMARKED: 4 sections
├── 实现建议
├── 性能考虑
├── 示例代码
└── 变更记录
是否开始审批未标记的 sections?
4. Approve one by one
Use AskUserQuestion for each unmarked Section:
使用 AskUserQuestion:
- question: "Section: API 签名\n\n内容预览:定义了 create(), delete(), list() 三个函数..."
- header: "审批状态"
- options:
- label: "Lock (核心架构)"
description: "锁定此 section,修改需要 human 明确同意"
- label: "Review (确认接受)"
description: "标记为已审阅,Agent 可修改但需通知"
- label: "Skip (保持 draft)"
description: "暂不审批,保持草稿状态"
5. Update the file
Based on the user's choice, add markers in the markdown:
Lock choice:
::: locked {reason="核心架构"}
## API 签名
...
:::
Review choice:
::: reviewed {by=<username> date=<today>}
## API 签名
...
:::
Skip choice: Do not modify, or add:
::: draft
## 实现建议
...
:::
Special Scenarios
Detect LOCKED Section modifications
When the file has uncommitted modifications:
⚠️ 检测到 LOCKED section 被修改:
- Section: 模块边界规则
- 修改内容: [diff preview]
此修改需要 human 明确同意。是否接受?
View approval history
/intent-review --history src/core/intent/INTENT.md
Output:
Section: API 签名
├── 2026-01-19 robert: reviewed
├── 2026-01-15 robert: draft → reviewed
└── 2026-01-10 created
Section: 模块边界
├── 2026-01-18 robert: locked (reason: 核心架构)
└── 2026-01-12 created
Cooperation with Other Tools
intent-interview → 创建 Intent (默认全是 draft)
↓
/intent-review → 审批关键 sections
↓
aine-dev-flow → 开发实现 (遵守 locked/reviewed 规则)
↓
intent-sync → 检查一致性
Configuration
The default reviewer can be configured in ~/.claude/settings.json :
{
"idd": {
"reviewer": "robert",
"autoLockPatterns": ["模块边界", "数据结构", "安全约束"]
}
}