debug

Implement debug logging with namespaces across Node.js, Electron, and client contexts.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/samiabid/lobehub-railway --skill debug-samiabid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug
Source: https://github.com/samiabid/lobehub-railway/tree/main/.agents/skills/debug
Command: npx skills add https://github.com/samiabid/lobehub-railway --skill debug-samiabid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Debug logging is essential for diagnosing issues across server, client, and desktop contexts. This Skill provides a structured guide to implement and use the debug library to observe runtime behavior without invasive changes.

Core Features & Use Cases

  • Standardized namespaces for server, client, and Electron logs.
  • Practical usage patterns for basic logging, message formatting, and conditional output.
  • Use Case: Quickly verify a feature by emitting scoped debug messages during development and troubleshooting.

Quick Start

Install the debug library in your project. Create a logger with a chosen namespace (for example, a module-specific one) and emit sample messages to verify output. Enable or disable debug output by configuring the environment or localStorage settings depending on your platform. Run your application and observe the formatted log messages in your console.

Frequently Asked Questions about debug

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

FAQPage Schema
How do I implement debug logging in Node.js and Electron projects?

Debug logging uses the debug npm package to emit scoped messages across Node.js, Electron, and client contexts. Install the package, create a logger with a namespace, emit messages, and toggle output via environment variables or localStorage to observe runtime behavior without code changes.

What are debug namespaces and how do I use them?

Debug namespaces are standardized naming conventions that organize logs by module or context—separate patterns for server, client, and Electron. Namespaces let you filter and enable specific loggers at runtime, making it easy to isolate output from particular parts of your application.

Can I use the debug library with both server and client code?

Yes, the debug library works across server, client, and Electron contexts with platform-specific activation. Use environment variables to control output on the server and localStorage settings on the client to enable or disable logging for your chosen namespaces.

How do I format and conditionally output debug messages?

Debug messages are formatted and output based on your namespace configuration and runtime settings. The library handles formatting automatically; control what logs appear by enabling namespaces through environment or localStorage, then emit messages to the active logger.

What's the best way to organize debug logs across a multi-context application?

Organize logs using standardized namespace conventions that reflect your module structure, with distinct patterns for server, client, and Electron layers. This structure lets you enable or disable logging per namespace without code changes, making troubleshooting faster across all contexts.