编程

btw command

试用

Ask non-blocking clarifying questions during agent workflows. Use when agents need user input without halting execution. Handles deployment decisions, code r...

它能做什么

**Local skill by Claw0x** — runs entirely in your OpenClaw agent.

技能文档

btw Command

Local skill by Claw0x — runs entirely in your OpenClaw agent.

Runs locally. No external API calls, no API key required. Complete privacy.

What It Does

The btw Command skill allows AI agents to ask clarifying questions without halting their main workflow. Questions are queued, users are notified via multiple channels, and if no answer is received within the timeout period, a default answer is used automatically.

Think of it as "by the way, I need to know..." — the agent continues working while waiting for your input.

Quick Reference

When This HappensDo ThisWhat You Get
Need deployment confirmationAsk "Deploy to staging or production?"Non-blocking answer with default
Code review decisionAsk "Refactor this complex function?"User choice without workflow halt
Data validationAsk "Found duplicates, merge or keep?"Timeout-safe decision
Security checkAsk "API key expiring, rotate now?"Priority-based notification

5-Minute Quickstart

Step 1: Install (30 seconds)

openclaw skill add btw

Step 2: Ask Your First Question (1 minute)

const result = await agent.run('btw', {
  question: 'Deploy to staging or production?',
  options: ['staging', 'production'],
  default: 'staging',
  timeout: 300,
  priority: 'urgent'
});

console.log(result.answer); // 'production' or 'staging' (default)

Step 3: Handle the Answer (instant)

if (result.timed_out) {
  console.log(`Used default: ${result.answer}`);
} else {
  console.log(`User chose: ${result.answer} in ${result.response_time_ms}ms`);
}

Real-World Use Cases

Scenario 1: Deployment Automation

Problem: Agent needs to deploy but unsure which environment Solution: Ask non-blocking question with timeout Example:

const { answer } = await btw({
  question: 'Tests passed! Deploy to which environment?',
  options: ['staging', 'production', 'skip'],
  default: 'staging',
  timeout: 600, // 10 minutes
  priority: 'urgent'
});

if (answer === 'production') {
  await deployToProduction();
} else if (answer === 'staging') {
  await deployToStaging();
}

Scenario 2: Code Review Decisions

Problem: Agent finds complex code, unsure if refactoring is needed Solution: Ask for human judgment without blocking Example:

const { answer } = await btw({
  question: 'Function `processData` has 150 lines. Refactor?',
  options: ['yes', 'no', 'later'],
  default: 'later',
  timeout: 300,
  priority: 'normal',
  context: {
    file: 'src/utils/data.ts',
    lines: 150,
    complexity: 'high'
  }
});

Scenario 3: Data Validation

Problem: Agent finds duplicate records, needs merge strategy Solution: Ask with context and smart default Example:

const { answer } = await btw({
  question: 'Found 5 duplicate users. How to handle?',
  options: ['merge', 'keep-all', 'keep-newest'],
  default: 'keep-newest',
  timeout: 180,
  priority: 'normal',
  context: {
    duplicates: 5,
    table: 'users',
    criteria: 'email'
  }
});

Scenario 4: Security Checks

Problem: API key expiring soon, needs rotation decision Solution: High-priority question with short timeout Example:

const { answer } = await btw({
  question: 'API key expires in 2 days. Rotate now?',
  options: ['yes', 'no', 'remind-tomorrow'],
  default: 'remind-tomorrow',
  timeout: 60,
  priority: 'urgent',
  context: {
    key_name: 'STRIPE_API_KEY',
    expires_at: '2026-03-29'
  }
});

Integration Recipes

OpenClaw Agent

agent.onTask(async (task) => {
  // Ask question without blocking
  const { answer } = await agent.run('btw', {
    question: 'Approve this change?',
    options: ['yes', 'no'],
    default: 'no',
    timeout: 300
  });
  
  if (answer === 'yes') {
    await task.execute();
  }
});

LangChain Agent

def ask_user(question, options, default, timeout=300):
    # Use btw skill locally
    result = agent.run('btw', {
        'question': question,
        'options': options,
        'default': default,
        'timeout': timeout
    })
    return result['answer']

# Use in agent
answer = ask_user(
    'Deploy to production?',
    ['yes', 'no'],
    'no',
    timeout=600
)

Custom Agent

// Local btw implementation
async function askBtw(question, options, defaultAnswer) {
  const result = await agent.run('btw', {
    question,
    options,
    default: defaultAnswer,
    timeout: 300
  });
  
  return result.answer;
}

Workflow Diagram

Agent Workflow
     │
     ├─ Main Task (continues)
     │
     └─ btw Question
          ├─ Queue Question
          ├─ Notify User (Web/Mobile/Slack)
          │
          ├─ User Answers → Return Answer
          │
          └─ Timeout → Return Default

Why Use Via Claw0x?

  • Zero configuration: No API keys, no setup
  • Complete privacy: Runs entirely locally
  • Offline capable: Works without internet
  • Unlimited usage: No rate limits or quotas
  • Open source: Transparent implementation
  • Agent-native: Built for autonomous workflows

Prerequisites

None. Just install and use.

Input Parameters

ParameterTypeRequiredDefaultDescription
questionstringYes-The question to ask
optionsstring[]No-Available answer options
defaultstringNoFirst optionDefault if timeout
timeoutnumberNo300Timeout in seconds
prioritystringNo"normal"Priority: urgent/normal/low
contextobjectNo{}Additional context

Output Schema

FieldTypeDescription
answerstringUser's answer or default
answered_atstringISO timestamp
timed_outbooleanWhether timeout occurred
response_time_msnumberTime to answer

Error Codes

CodeMeaningSolution
400Invalid inputCheck question is non-empty
500Internal errorRetry or check logs

Pricing

Free. No API key required, no usage limits.

  • Runs entirely locally in your agent
  • No external API calls
  • Complete privacy
  • Unlimited questions

Rate Limits

None. Unlimited questions.

About Claw0x

Claw0x is the native skills layer for AI agents — providing unified API access, atomic billing, and quality control.

Explore more skills: claw0x.com/skills

GitHub: github.com/kennyzir/btw

相关技能

以 AI 机器人身份加入视频会议,提供语音、虚拟形象与屏幕共享四种模式。

作者 johnpatternai21 次安装8 星标

在本地磁盘以分类纯 Markdown 文件保存需要长期留存的事实,与智能体内置记忆并存。

作者 Iván555 次安装18 星标

诊断生产力系统反复失效的根因,给出最小干预——容量测算、瓶颈定位、可靠的本地记录。

作者 Iván854 次安装69 星标

把自然语言描述转为结构化 JSON,并由 mcp-diagram-generator MCP 服务生成 Draw.io、Mermaid 或 Excalidraw 图表文件。

作者 nssa.io1.0k 次安装47 星标

按用户明确指令,在得到大脑(Get笔记)中保存、搜索并管理笔记与知识库。

作者 iswalle763 次安装66 星标

通过托管 OAuth 访问 Microsoft Graph Excel 接口,读写 OneDrive 中的工作簿、工作表、区域、表格与图表。

作者 byungkyu800 次安装42 星标

kennyzir 的更多技能

浏览全部技能

Meta-skill for AI agent self-improvement. Analyzes runtime logs to detect error patterns, regressions, and inefficiencies, then generates structured improvem...

作者 claw0x489 次安装33 星标

Local skill for capturing learnings, errors, corrections, and patterns to enable continuous agent improvement. Processes events locally in your OpenClaw agen...

作者 kennyzir62 次安装

Scan AI agent skills for security vulnerabilities, dangerous code patterns, and undeclared permissions. Three-layer analysis: dependency CVE scanning, static...

作者 kennyzir28 次安装

Teach your OpenClaw agent new tricks by creating custom skills. Use when you want your agent to do something it can't do yet — like "read my Google Calendar"...

作者 kennyzir18 次安装

Validate email addresses with format checking and risk scoring. Use when users need to verify email format, check disposable emails, or validate bulk email l...

作者 kennyzir16 次安装

Advanced web search with precise date filtering and content type selection. Use when you need academic papers, GitHub repositories, research content, or spec...

作者 kennyzir17 次安装