tools-diagnostics
System diagnostics
Overview
Interactive skill for diagnosing system resource issues. Detects OS and applies appropriate diagnostic patterns. Focuses on real-world lessons from production incidents rather than generic command documentation.
Context
Expects a Unix-like system (Linux or macOS). User describes a resource problem (memory, disk, CPU, or general slowness).
Process
- Detect platform:
uname -s(Linux or Darwin) - Identify problem type: memory, disk, CPU, or I/O
- Run targeted diagnostics using platform-appropriate commands
- Apply cleanup patterns from references for Nix-aware environments
- Verify: confirm resource pressure reduced
References
- macos-disk-cleanup-learnings-2026-02-17.md: moondancer cleanup runbook, Determinate Nix GC behavior, safety tiers
- nix-gc-determinate-seasmoke-learnings-2026-02-17.md: Nix store root retention, profile generation pruning, container storage
- system-cleanup-report-20260117-reference.md: High-impact cleanup operations with space recovered
Guidelines
- Use
sudofor accurate disk usage on Linux (non-rootduunder-reports) - On macOS with Determinate Nix,
nix.gc.automaticis disabled by policy - use explicitnix-collect-garbage -d - Clean caches first (low risk, high value): trash, browser caches, package manager caches
- Prune Nix profile generations on all users, not just system
- Check container storage (
/var/lib/containers, rootless storage) as disk pressure source
Quick reference
Assess state:
df -h / /nix # disk usage
du -sh ~/.Trash ~/.cache ~/Library/Caches /nix/store 2>/dev/null # top consumers
Safe cleanup (macOS):
rm -rf ~/.Trash/*
rm -rf ~/Library/Caches/*
uv cache clean && brew cleanup --prune=all
nix-collect-garbage -d
Safe cleanup (Linux, as root):
sudo du -xhd 1 / | sort -hr | head -20 # find top consumers
sudo nix-collect-garbage -d
sudo nix-store --gc
sudo podman system prune --volumes -f # if containers present
Appendix
Determinate Nix GC behavior
When determinateNix.enable = true on macOS hosts, nix-darwin's nix.gc module is disabled. Determinate Nixd handles GC policy instead. Do not assume timer-based GC is running.
Reference: dragonix/modules/base/nix-settings/darwin.nix
Nix root retention patterns
Large Nix store after GC usually means:
- Old profile generations still rooted under
~/.local/state/nix/profiles/ - Running processes holding
/procroots - Solution: prune all user profiles, not just system
# Per-user profile pruning
nix-env -p ~/.local/state/nix/profiles/profile --delete-generations old
nix-env -p ~/.local/state/nix/profiles/home-manager --delete-generations old
Safety tiers
Low risk, high value: trash, caches, uv cache clean, brew cleanup
Medium risk with verification: nix-collect-garbage -d, playwright cache, mediaanalysisd
Do not delete: /System, /usr, /bin, /sbin, APFS system volumes, app databases
More from nikhilmaddirala/gtd-cc
tools-catppuccin
Agent skill for creating and validating Catppuccin theme ports
18obsidian-gtd
Obsidian vault management and GTD workflows. Use when integrating with Obsidian vaults, managing notes, organizing knowledge, or supporting Getting Things Done methodology through note-based workflows.
13web-search
General web search patterns and techniques including Gemini CLI coordination. Use this skill when you need to perform web searches, find current information, or research topics online. Covers both Gemini CLI and built-in WebSearch tool usage with precise instruction crafting.
11web-content-extraction
Extract documentation and content from websites. Supports Mintlify, Starlight/Astro, Docusaurus, GitBook, ReadTheDocs, Sphinx, and generic sites. Uses a tiered approach - try the simplest method first (direct curl, Jina AI Reader) before falling back to Crawl4AI for JS-heavy sites.
10docs-pdf
Parse PDF documents into repository-friendly markdown and text artifacts. Use when users need to extract text, tables, or structure from PDF files.
10productivity-todoist
Fetch and manage Todoist tasks. Use when the user asks about "todoist tasks", "show my tasks", "what's due", "overdue tasks", "triage tasks", or when another skill needs Todoist task context.
10