debug-package

Configures debug() logging with lobe-* namespaces and format specifiers.

Updated Jan 27, 2026
One-click install
npx skills add https://github.com/SmallAi-API/smaihub --skill debug-package-smallai-api
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-package
Source: https://github.com/SmallAi-API/smaihub/tree/main/.agents/skills/debug-package
Command: npx skills add https://github.com/SmallAi-API/smaihub --skill debug-package-smallai-api

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires debug.

What problem does it solve? Developers working across lobe-desktop, lobe-server, and lobe-client codebases need consistent debug logging conventions, but often struggle with namespace naming, format specifier selection, and enabling debug output across browser, Node.js, and Electron environments. ## Core Features & Use Cases - Namespace Conventions: Standardizes debug namespaces as lobe-[module]:[submodule] for desktop, server, client, and router packages. - Format Specifier Guidance: Documents %O, %o, %s, and %d specifiers for logging objects, strings, and numbers. - Environment Activation: Shows how to enable output via localStorage.debug in browsers, DEBUG environment variables in Node.js, and process.env.DEBUG in Electron. - Use Case: When adding logging to a new edge router like apps/server/src/routers/edge/market, follow the guide to create debug('lobe-edge-router:market') and log inputs with %O formatting. ## Quick Start Ask the AI to add debug logging to a specific lobe module following the lobe-* namespace conventions and enable output with the DEBUG environment variable.

Frequently Asked Questions about debug-package

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use the debug package in Node.js?

Import debug from 'debug', create a logger with a namespace like debug('lobe-server:market'), then call it with messages and format specifiers. Enable output by setting the DEBUG environment variable, for example DEBUG=lobe-* pnpm dev.

How to enable debug logging in the browser?

Set localStorage.debug to your desired namespace pattern, such as localStorage.debug = 'lobe-*', then reload the page. The debug package reads this value to filter which namespaces produce console output.

What format specifiers does the debug package support?

The debug package supports %O for expanded objects (recommended for complex objects), %o for objects, %s for strings, and %d for numbers. Use %O when logging inputs or structured data for better readability.

Does debug logging work in Electron applications?

Yes, set process.env.DEBUG = 'lobe-*' in your Electron main process code to enable debug output. This mirrors the Node.js environment variable approach since Electron runs on Node.js.

Why is my debug output not showing in the console?

Debug output is hidden unless the namespace matches the DEBUG filter. Verify your DEBUG environment variable or localStorage.debug value matches your namespace pattern, such as lobe-* for all lobe modules.