home / skills / cacr92 / wereply / debugging
This skill helps you diagnose and resolve debugging issues efficiently across Rust, React, and database layers by guiding reproduction and validation.
npx playbooks add skill cacr92/wereply --skill debuggingReview the files below or copy the command above to add this skill to your agents.
---
name: debugging
description: 当用户要求排查Bug、定位问题、异常排查或性能瓶颈时使用。
---
# Debugging Skill
## 适用范围
- Rust/Tauri 后端问题排查
- React 前端状态与渲染异常
- 数据库/迁移问题
## 关键规则(Critical Rules)
- 先复现,再定位
- 优先缩小范围与影响面
- 记录关键输入与边界条件
## 系统化流程
1. 复现问题(最小输入)
2. 收集上下文(日志、参数、数据状态)
3. 提出假设并验证
4. 修复后回归验证
## 常见检查点
- Tauri 命令未注册:检查 `#[tauri::command]` 与 `#[specta::specta]`
- 类型不匹配:检查 DTO `specta::Type` 与 camelCase
- 数据库错误:确认迁移已执行、表名/字段名正确
- React 过度渲染:检查依赖与 `useMemo`/`useCallback`
## 工具建议
- Rust:使用 `tracing` 记录关键路径
- DB:使用 `EXPLAIN QUERY PLAN` 分析索引
- 前端:用 UI 提示展示关键状态,避免 `console.*`
## 检查清单
- [ ] 已复现并最小化输入
- [ ] 已验证关键假设
- [ ] 修复后回归验证通过This skill helps diagnose and resolve bugs, exceptions, and performance bottlenecks for a chat auto-reply assistant built with Rust/Tauri backend, React frontend, and relational databases. It focuses on reproducible investigation, targeted narrowing of scope, and validated fixes. The goal is fast root-cause identification and reliable regression verification.
Start by reproducing the issue with the smallest possible input and environment. Collect contextual data—logs, request/response parameters, DB state, and UI signals—then form testable hypotheses and validate them iteratively. Apply fixes, then run focused regression checks to confirm the problem is resolved without regressions.
What should I capture in logs to speed debugging?
Capture timestamps, request IDs, input parameters, user identifiers, decision points, and error stacks; structured logs make correlation across services straightforward.
How do I minimize false leads during investigation?
Use a minimal reproducible test, isolate components, and validate one hypothesis at a time. Revert any speculative changes if they don’t pass targeted tests.