skills-experimental/clarification-handler/SKILL.md
Handle user clarification requests gracefully. Use when the agent needs to ask the user for clarification before proceeding - missing info, ambiguous requirements, approach choices, or risk confirmations. Implements DeerFlow's ClarificationMiddleware pattern.
npx skillsauth add bianhaifeng789-hue/openclaw-config clarification-handlerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
优雅处理用户澄清请求,在 Agent 需要用户确认时中断执行。
| 类型 | 图标 | 说明 | |------|------|------| | missing_info | ❓ | 缺少必要信息 | | ambiguous_requirement | 🤔 | 需求不明确 | | approach_choice | 🔀 | 多种方案选择 | | risk_confirmation | ⚠️ | 需要风险确认 | | suggestion | 💡 | 建议/提示 |
function formatClarificationMessage(args) {
const { question, clarification_type, context, options } = args;
const icons = {
missing_info: '❓',
ambiguous_requirement: '🤔',
approach_choice: '🔀',
risk_confirmation: '⚠️',
suggestion: '💡'
};
const icon = icons[clarification_type] || '❓';
let messageParts = [];
// 上下文优先
if (context) {
messageParts.push(`${icon} ${context}`);
messageParts.push(`\n${question}`);
} else {
messageParts.push(`${icon} ${question}`);
}
// 选项列表
if (options && options.length > 0) {
messageParts.push('');
for (let i = 0; i < options.length; i++) {
messageParts.push(` ${i + 1}. ${options[i]}`);
}
}
return messageParts.join('\n');
}
❓ 我需要知道目标数据库的类型才能生成正确的连接代码。
1. MySQL
2. PostgreSQL
3. MongoDB
4. SQLite
🔀 你提到的报表有几种实现方式:
1. 使用 Pandas 直接生成 Excel
2. 使用 openpyxl 生成带格式的 Excel
3. 使用 ReportLab 生成 PDF 报表
你倾向于哪种?
⚠️ 这个操作会删除所有测试数据,约 1000 条记录。确认继续吗?
// 工具定义
const askClarificationTool = {
name: 'ask_clarification',
description: 'Ask user for clarification before proceeding',
parameters: {
type: 'object',
properties: {
question: {
type: 'string',
description: 'The clarification question'
},
clarification_type: {
type: 'string',
enum: ['missing_info', 'ambiguous_requirement', 'approach_choice', 'risk_confirmation', 'suggestion'],
description: 'Type of clarification needed'
},
context: {
type: 'string',
description: 'Optional background context'
},
options: {
type: 'array',
items: { type: 'string' },
description: 'Optional list of options for user to choose'
}
},
required: ['question', 'clarification_type']
}
};
// 拦截 ask_clarification 工具调用
function wrapToolCall(request, handler) {
if (request.tool_call.name !== 'ask_clarification') {
return handler(request); // 正常执行其他工具
}
// 格式化澄清消息
const formattedMessage = formatClarificationMessage(request.tool_call.args);
// 创建 ToolMessage
const toolMessage = {
type: 'tool',
content: formattedMessage,
tool_call_id: request.tool_call.id,
name: 'ask_clarification'
};
// 返回中断命令
return {
update: { messages: [toolMessage] },
goto: '__end__' // 中断,等待用户回复
};
}
function isChinese(text) {
return /[\u4e00-\u9fff]/.test(text);
}
// 根据语言调整格式
if (isChinese(question)) {
// 使用中文格式:"请确认..." 而非 "Please confirm..."
}
来源: DeerFlow clarification_middleware.py (155 行)
移植时间: 2026-04-15
business
IAA 日报飞书输出能力。 支持把固定 CSV 模板一键转换成: - 中文运营结论 - 飞书卡片 JSON - 飞书发送载荷 Use when: - 需要把 IAA 日报直接发到飞书 - 需要从 CSV 一键生成运营日报
data-ai
IAA日报分析模型 功能: - 渠道日报自动分析 - 小时级+日级ROI联动判断 - 按地区输出加量/降量/停投建议 - 按产品类型输出阈值 - 自动识别利润区/观察区/止损区 Use when: - 分析每天投放数据 - 生成运营日报结论 - 判断是否加量/降量/停投 - 对比美加澳/日韩表现 Keywords: - 日报模型, 投放日报, 加量, 降量, 停投, ROI日报, 分地区分析
data-ai
IAA固定日报分析模板 功能: - 固定字段模板(可直接贴每天数据) - 自动输出总盘结论 - 自动输出美加澳/日韩结论 - 自动给出加量/降量/停投建议 - 适配文件修复/清理两类产品 Use when: - 需要固定日报格式 - 每天复盘渠道表现 - 给运营团队出统一结论 Keywords: - 固定模板, 日报模板, ROI模板, IAA日报, 运营模板
development
# HyperlinkPool Pattern Skill HyperlinkPool Pattern - HyperlinkPool class + strings array + stringMap + Index 0 no hyperlink + intern(hyperlink) + get(id) + undefined handling + 5-minute reset + OSC8 hyperlink interning。 ## 功能概述 从Claude Code的ink/screen.ts提取的HyperlinkPool模式,用于OpenClaw的OSC8超链接池管理。 ## 核心机制 ### HyperlinkPool Class ```typescript export class HyperlinkPool { private strings: string[] = [''] // Index 0 = no hyperlink private stringMap = new Map<string, number>() // strings