Quacktionable:让你的 Bug 受审,使用橡胶鸭审判庭 🦆⚖️
发布: (2026年2月15日 GMT+8 04:40)
5 分钟阅读
原文: Dev.to
Source: Dev.to
概述
quacktionable 是一个 Node.js CLI,将橡皮鸭调试会话转变为有趣的“橡皮鸭审判”。
它使用 GitHub Copilot CLI 作为推理引擎,同时添加本地防护措施(输入验证、回退处理、确定性投票聚合),以确保用户体验的可靠性。
Features
- 交互式错误收集 (
quack report) – 带有表情符号的引导提示。 - Copilot CLI 健康检查 (
quack doctor)。 - 多评审分析 (
quack analyze) – 多个鸭子角色交叉审查错误、日志和代码。 - 投票根本原因判决,附置信度分数和异议说明。
- 机器可读输出 (
--json) 用于自动化。 - 仅提供建议 – 永不自动执行修复。
安装
npm install -g quacktionable
- 代码仓库:
- npm 包:
演示流程
# Check Copilot CLI connectivity
quack doctor
# Start the interactive bug‑report intake
quack report
# Run a built‑in example analysis
quack analyze --example
# Analyze a real bug with optional files and JSON output
quack analyze \
--bug-file examples/bug.txt \
--log examples/logs.txt \
--json
示例会话
quack doctor
quack doctor 🩺🦆
- cliAvailable: true
- promptRoundTripOk: true
- details: Copilot CLI is online and beak-to-beak communication is healthy.
quack report (interactive console)
┌───────────────────────────────────────────────────────────────┐
│ 🦆 Rubber Duck Tribunal · Interactive Intake Console │
│ Explain the bug. The duck bench handles the drama. │
└───────────────────────────────────────────────────────────────┘
⚖️ Court mode: ENABLED
🔍 Evidence mode: TRACKING
🎭 Vibes: dramatic, but factual
1) 📝 Describe the bug in plain language:
2) 📜 Optional log path or raw log line (enter to skip):
3) 📂 Optional code paths (comma‑separated, enter to skip):
4) 🔁 Cross‑exam rounds per duck [2]:
5) 🧾 Output JSON only? [y/N]:
🚀 Launching tribunal proceedings...
quack analyze --example
⠋ Gathering bug clues...
⠸ Asking Copilot for spicy cross‑exam ammo...
⠧ 🦆 Detective Quackson is cross‑examining your theory...
⠇ 🦆 Captain Crashbeard is cross‑examining your theory...
⠏ 🦆 Null Pointer Patty is cross‑examining your theory...
✅ Tribunal complete. Verdict delivered.
🦆⚖️ Rubber Duck Tribunal (Court is now in session)
🎭 Opening statement: no bug survives cross‑examination.
🆔 Session: 5a077c56-b0fe-4f18-a26e-1a7408d56273
🤖 Engine: gpt-5
📝 Bug Tale
- 🐛 Users intermittently get a 500 error when opening profile right after login...
🚨 Suspicious Signals
- 📍 ERROR TypeError: Cannot read properties of undefined (reading 'name')
🗳️ Judge Duck Votes
- 🦆 Detective Quackson: … (92%)
- 🦆 Captain Crashbeard: … (92%)
- 🦆 Null Pointer Patty: … (92%)
🏛️ Final Quackdict
- 🎯 root cause: null‑safety violation around profile access
- 🔥 confidence: 100%
- 🙋 dissent: alternate race‑condition wording
- 🧾 summary: The duck bench quacks in favor of …
架构与集成
- 核心推理:GitHub Copilot CLI(用于交叉考试生成和多鸭子角色判断)。
- 健康检查包装器:
quack doctor在每次运行前验证 Copilot CLI 的可用性。 - 并行提示运行:每个鸭子角色都是一次独立的 Copilot CLI 调用,从而实现并行投票。
- 确定性聚合:对投票进行归一化并合并,生成包含置信度和异议字段的单一判决。
- 透明运行时报告:从 Copilot CLI 配置中提取模型标签,并在最终报告中显示。
经验教训
- Copilot CLI 显著加快了将嘈杂的错误叙述和日志转化为结构化根因假设的速度。
- 在提示中使用严格的 JSON 约束可提升 across duck votes 的一致性。
- 交互式用户体验(包含丰富表情的提示、动画进度指示器、简洁的判决格式)使 AI 输出能够在真实的终端工作流中使用。
- 仅提供工具推荐可避免意外的代码更改,同时仍提供有价值的洞察。
探索项目
- GitHub:
- npm: