
Debug
Add namespaced `debug` package logging across Lobe Chat desktop, server, client, and router code with consistent format specifiers and enable instructions.
Overview
debug is an agent skill most often used in Build (also Ship testing, Operate monitoring prep) that standardizes the `debug` npm logger and `lobe-*` namespaces in Lobe Chat.
Install
npx skills add https://github.com/lobehub/lobe-chat --skill debugWhat is this skill?
- Standard `debug` import with `lobe-[scope]:[module]` namespace conventions
- Scopes: lobe-desktop, lobe-server, lobe-client, lobe-edge-router, and related router prefixes
- Format specifiers: `%O` (expanded object), `%o`, `%s`, `%d`
- Enable via `localStorage.debug`, `DEBUG=lobe-*` in Node, or `process.env.DEBUG` in Electron
- Concrete edge market router example with structured input logging
- Documents 4 format specifiers (`%O`, `%o`, `%s`, `%d`)
- Covers 4+ namespace families (desktop, server, client, routers)
Adoption & trust: 554 installs on skills.sh; 78.4k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are debugging Lobe Chat behavior but lack a shared pattern for namespaced, filterable debug logs across browser, server, and Electron targets.
Who is it for?
Solo or small-team Lobe Chat contributors adding temporary or persistent debug traces in TypeScript routers and services.
Skip if: Projects outside the Lobe Chat codebase, production APM replacement, or builders who need user-facing in-app debug UIs.
When should I use this skill?
Adding debug logging, understanding log namespaces, or implementing debugging features in Lobe Chat; triggers on debug logging requests or logging implementation.
What do I get? / Deliverables
New or updated modules emit `debug`-namespaced logs with correct enable flags so you can trace inputs like market router payloads during local dev.
- Namespaced debug logger instances in touched modules
- Operator notes for enabling `lobe-*` output per runtime
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build because the skill guides implementing logging while you touch Lobe Chat modules and routers. It integrates the `debug` npm package into existing Lobe Chat surfaces (edge routers, server routes, Electron)—integration work, not greenfield UI.
Where it fits
Instrument `lobe-edge-router:market` to log `getAgent` inputs while wiring a new API.
Turn on `DEBUG=lobe-*` during a failing integration test to see server-side object dumps.
Reproduce a reported chat bug locally with `localStorage.debug = 'lobe-*'` before adding formal error tracking.
How it compares
Repo-specific `debug` convention guide—not a generic log aggregation MCP or Sentry setup skill.
Common Questions / FAQ
Who is debug for?
Developers hacking on Lobe Chat who want the `debug` package with documented `lobe-*` namespaces for desktop, server, client, and router code.
When should I use debug?
Use it in Build when implementing logging in a Lobe module; in Ship when reproducing test failures with `DEBUG=lobe-*`; in Operate when correlating local behavior before promoting better monitoring.
Is debug safe to install?
The skill only documents logging patterns; review the Security Audits panel on this page before adding any third-party skill to your agent.
SKILL.md
READMESKILL.md - Debug
# Debug Package Usage Guide ## Basic Usage ```typescript import debug from 'debug'; // Format: lobe-[module]:[submodule] const log = debug('lobe-server:market'); log('Simple message'); log('With variable: %O', object); log('Formatted number: %d', number); ``` ## Namespace Conventions - Desktop: `lobe-desktop:[module]` - Server: `lobe-server:[module]` - Client: `lobe-client:[module]` - Router: `lobe-[type]-router:[module]` ## Format Specifiers - `%O` - Object expanded (recommended for complex objects) - `%o` - Object - `%s` - String - `%d` - Number ## Enable Debug Output ### Browser ```javascript localStorage.debug = 'lobe-*'; ``` ### Node.js ```bash DEBUG=lobe-* npm run dev DEBUG=lobe-* pnpm dev ``` ### Electron ```typescript process.env.DEBUG = 'lobe-*'; ``` ## Example ```typescript // src/server/routers/edge/market/index.ts import debug from 'debug'; const log = debug('lobe-edge-router:market'); log('getAgent input: %O', input); ```