tuya/tuyaopen-dev-skills/debug-helper

Claude Code and agent skill by tuya/tuyaopen-dev-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Agent-friendly non-blocking serial log capture for TuyaOpen devices. Runs tos.py monitor in the background, writes logs to file, and lets the agent tail or stop it at any time. Use when the agent needs to capture device logs without blocking, run a debug session, or monitor UART output during a build-flash-analyze loop. 后台串口日志、非阻塞监控、设备日志捕获、agent日志分析。

Install

npx vskill@latest install tuya/tuyaopen-dev-skills/debug-helper

SKILL.md

TuyaOpen Debug Helper

Provides non-blocking serial log capture for agents using tos.py monitor -l. The monitor runs as a background subprocess; the agent reads log output from a file and stops the process when done.

Script location

.agents/skills/tuyaopen/debug-helper/scripts/monitor_helper.py

No extra dependencies — uses Python stdlib only.

Quick usage

bash
# Start background monitor (logs to <project_dir>/.target_logging/YYYYMMDD_HHMMSS.log)
$OPEN_SDK_PYTHON .agents/skills/tuyaopen/debug-helper/scripts/monitor_helper.py start -p /dev/ttyACM1
# Read last 200 lines (JSON output for agent parsing)
$OPEN_SDK_PYTHON .agents/skills/tuyaopen/debug-helper/scripts/monitor_helper.py --json tail -n 200
# Stop monitor (releases serial port)
$OPEN_SDK_PYTHON .agents/skills/tuyaopen/debug-helper/scripts/monitor_helper.py stop

Commands

CommandPurpose
start -p <port> [-l <logfile>]Launch tos.py monitor -l in background; auto-names log file if -l omitted
tail [-n N]Read last N lines from log file (default 200)
stopTerminate the monitor process; release serial port
statusCheck whether monitor is running

Add --json before the command for machine-readable output.

Log file location

All logs and session state are written to `<project_dir>/.target_logging/`, where <project_dir> is the directory containing app_default.config (the TuyaOpen project root). The script finds this automatically by searching upward from the current working directory.

This location keeps logs with the project they belong to. The TuyaOpen SDK .gitignore contains .target_logging as an unanchored rule — it matches at any depth in the repository, so logs are always gitignored regardless of where the project lives under the SDK.

<project_dir>/ e.g. apps/tuya_cloud/switch_demo/
└── .target_logging/ gitignored by SDK .gitignore
├── session.json active monitor session (PID + log path)
└── YYYYMMDD_HHMMSS.log auto-named log file per session

Session file

Session state (PID + log file path) is stored in <project_dir>/.target_logging/session.json. Only one monitor session runs at a time — starting a new one automatically stops the previous.

Port selection for T5 dual-UART boards

T5 / T5AI boards expose two serial ports (WCH dual-serial, VID 0x1a86 PID 0x55d2):

  • Linux typical: ttyACM0 = flash, ttyACM1 = monitor/log
  • Windows typical: lower COM = flash, higher COM = monitor/log

These are common cases, not guarantees. If log output is absent or garbled after start, try the other port.

List available ports:

bash
# Linux / macOS
ls /dev/ttyACM* /dev/ttyUSB* 2>/dev/null
# Windows PowerShell
[System.IO.Ports.SerialPort]::GetPortNames()

Typical agent workflow

bash
# 1. Start background monitor
$OPEN_SDK_PYTHON .agents/skills/tuyaopen/debug-helper/scripts/monitor_helper.py \
--json start -p /dev/ttyACM1
# 2. Flash firmware (monitor keeps logging while flash runs on other port)
tos.py flash -p /dev/ttyACM0
# 3. Wait for boot, then read log
$OPEN_SDK_PYTHON .agents/skills/tuyaopen/debug-helper/scripts/monitor_helper.py \
--json tail -n 200
# 4. Analyze: look for [ty E], OPRT_ errors, "feed watchdog", "mqtt connected"
# 5. Stop when done
$OPEN_SDK_PYTHON .agents/skills/tuyaopen/debug-helper/scripts/monitor_helper.py stop

Log analysis patterns

PatternMeaningAction
[... ty E]Error-level logAnalyze message and source location
[... ty W]WarningUsually non-fatal; investigate if repeated
feed watchdogHeartbeat (~10s)Normal — device is alive
OPRT_ + negative numberSDK operation failedLook up in references/ERROR_CODES.md in tuyaopen/dev-loop
mqtt connectedCloud connectedSuccess
No output after startWrong port or wrong baudSwap ports; check baud rate

Related skills

  • tuyaopen/dev-loop — full build→flash→monitor→analyze loop (calls this skill)
  • tuyaopen/device-auth — serial port needed before writing auth credentials

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
16
Repository forks
3
7-day trend score
0

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/tuya/tuyaopen-dev-skills/debug-helper/badge)](https://verified-skill.com/skills/tuya/tuyaopen-dev-skills/debug-helper)

Something wrong with this skill or its page? Tell us.