From obsidian-pack
Set up comprehensive logging and monitoring for Obsidian plugins. Use when implementing debug logging, tracking plugin performance, or setting up error reporting for your Obsidian plugin. Trigger with phrases like "obsidian logging", "obsidian monitoring", "obsidian debug", "track obsidian plugin".
How this skill is triggered — by the user, by Claude, or both
Slash command
/obsidian-pack:obsidian-observabilityThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
Implement comprehensive logging, metrics collection, error tracking, and a debug panel for Obsidian plugins.
| Metric | Type | Purpose |
|---|---|---|
| Command execution time | Timer | Performance tracking |
| File operations count | Counter | Usage patterns |
| Error rate | Counter | Reliability |
| Cache hit ratio | Gauge | Efficiency |
| Memory usage | Gauge | Resource health |
Create a Logger class with levels (debug/info/warn/error), history buffer, formatted output, and timing helpers.
Build MetricsCollector with counters, gauges, and timers. Add timeAsync() wrapper for measuring function duration with percentile stats (p95).
Create ErrorTracker that deduplicates errors by name+message, counts occurrences, and provides wrapAsync() for safe error capture.
Register a sidebar view (dev mode only) that auto-refreshes every 5 seconds showing counters, timer stats, recent errors, and log history. Add export button for downloadable JSON debug bundle.
Initialize logger, metrics, and error tracker in onload(). Wrap commands with metrics timing. Track command usage with counters.
See detailed implementation for complete Logger, MetricsCollector, ErrorTracker, DebugView classes and CSS styles.
| Issue | Cause | Solution |
|---|---|---|
| Too much logging | Debug level in prod | Set level to 'error' in production |
| Memory growth | Unbounded history | Limit history to 100 entries |
| Performance impact | Sync logging | Use async patterns for file logging |
| Missing context | No error tracking | Wrap async calls with errorTracker |
const endTimer = logger.time('my-operation');
await doExpensiveWork();
endTimer(); // Logs: [plugin-id] my-operation (245.32ms)
For incident response, see obsidian-incident-runbook.
npx claudepluginhub aiminnovations/claude-code-plugins-plus --plugin obsidian-packGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
4plugins reuse this skill
First indexed Jul 11, 2026