agentleFS
CaesiumYCaesiumY/dding-dong/CLAUDE.md

dding-dong

CLAUDE.md2 starsChanged 9 months agoMITView on GitHub

Claude Code notification plugin. Plays sounds and sends OS notifications on task completion, errors, and input requests. Zero npm dependencies — uses only Node.js built-in modules.

  • Reads credentials
  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

9 rules. About 0 are common, 1 is distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    ESM only: All scripts use .mjs extension with import/export syntax.

    line 47
  2. Very specific:

    No npm dependencies: Only Node.js built-in modules (node:fs, node:path, node:child_process, node:os, node:url).

    line 48
  3. Very specific:

    Only the stop hook requires {} response (Claude awaits it).

    line 54
  4. Very specific:

    NEVER generate TTS files in parallel: Always run generate-tts.py sequentially, one event at a time.

    line 75
  5. Very specific:

    Tailwind v4 opacity: Use integer presets (text-hobak/7), never decimal brackets (text-hobak/[0.07]).

    line 89
  6. Very specific:

    Post-change verification required: After any website code change, always run cd website && pnpm build and cd website && pnpm lint to verify …

    line 91
  7. Very specific:

    Commit order: feature/fix commit first → version bump as a separate chore: commit

    line 102
  8. Distinctive:

    No automated test suite exists yet.

    line 109
  9. Very specific:

    Test runner: node:test (maintains zero-dependency policy)

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

dding-dong

Claude Code notification plugin. Plays sounds and sends OS notifications on task completion, errors, and input requests. Zero npm dependencies — uses only Node.js built-in modules.

Development Commands

# Test notifications (cycles through all event types)
node scripts/notify.mjs test

# Regenerate default sound pack WAV files
node scripts/generate-sounds.mjs

# Detect platform, audio player, and notifier
node scripts/setup-wizard.mjs detect

# Validate config files (JSON parsing, required keys, sound pack existence)
node scripts/setup-wizard.mjs validate

# Sound pack management (discover, validate, create, clone, apply)
node scripts/pack-wizard.mjs discover

# Version sync (plugin.json → marketplace.json)
node scripts/sync-version.mjs sync
node scripts/sync-version.mjs verify
node scripts/sync-version.mjs bump patch   # or minor, major

# Release (creates git tag + pushes → GitHub Actions creates release)
node scripts/release.mjs            # Create git tag and push
node scripts/release.mjs --dry-run  # Preview without creating tag

# Website (pnpm required — do NOT use npm/yarn)
cd website && pnpm install    # Install dependencies
cd website && pnpm dev        # Dev server (auto-copies sound files)
cd website && pnpm build      # Production build

Design Rules

  • Simplicity First: Make every change as simple as possible. Impact minimal code.
  • Root cause fixes: Find root causes. No temporary fixes. Senior developer standards.
  • Minimal impact: Changes should only touch what's necessary. Avoid introducing bugs.
  • Stop hook MUST respond: stop.mjs must write {} (empty JSON object) to stdout. Missing this halts Claude execution.
  • Always exit(0) on error: Notification failure must never block Claude. All hook catch blocks call process.exit(0).
  • detached + unref: Audio processes use spawn(..., { detached: true, stdio: 'ignore' }).unref() to complete within the 5-second hook timeout.
  • ESM only: All scripts use .mjs extension with import/export syntax.
  • No npm dependencies: Only Node.js built-in modules (node:fs, node:path, node:child_process, node:os, node:url).

Gotchas & Landmines

Hook Timing

  • hooks.json 5s timeout → internal safety timer 4s → stdin read 2s → only ~2s left for notify()
  • Only the stop hook requires {} response (Claude awaits it). All other hooks need no response
  • uncaughtException/unhandledRejection handlers guarantee response then exit(0) — last-resort safety net

Config

  • 5-stage merge (later wins): Default ← Global ← Project ← Local ← env vars
  • _meta: extracted before deepMerge, re-attached after. Global-only. Cannot be polluted by project config
  • null in deepMerge = key deletion. { "sound": null } → removes the sound key entirely. To disable, use { "sound": { "enabled": false } }
  • Project/Local scopes store diff-only overrides (not full snapshots)
  • saveConfig runs round-trip JSON.parse validation. On failure, auto-restores from backup
  • Backups: max 3 per config file, oldest auto-deleted

Platform

  • WSL detection: checks /proc/version for "microsoft" (case-insensitive). process.platform returns "linux" even on WSL
  • Linux audio priority: pw-play > paplay > ffplay > mpv > aplay
  • WSL notification priority: wsl-notify-send > WinRT PowerShell Toast > terminal bell

Sound Packs

  • Resolution order: Project (.dding-dong/packs/) → User (~/.config/dding-dong/packs/) → Built-in (sounds/)
  • Rotation: "random" = random pick from files[]. "sequential" or unset = always files[0] (no cycling)

TTS Generation

  • NEVER generate TTS files in parallel. Always run generate-tts.py sequentially, one event at a time. Parallel GPU inference causes resource conflicts and unpredictable output quality

Cooldown

  • Global (not per-event). Single lastNotifiedAt timestamp. A session.start within 3s of task.complete is suppressed

Events

  • task.error: defined in config/messages but has no triggering hook. Only testable via CLI test mode. Reserved for future Claude Code error hook support

Website

  • pnpm only: website/ uses pnpm. Do NOT use npm install or yarn — breaks pnpm-lock.yaml
  • Tailwind v4 — no config file: tailwind.config.js does not exist. Theme is defined in src/styles/global.css via @theme block
  • Sound copy dependency: pnpm dev/build runs copy-sounds.mjs which requires ../sounds/ to exist. public/sounds/ is gitignored and ephemeral
  • Base URL /dding-dong/: For GitHub Pages. All internal links must use localePath() or import.meta.env.BASE_URL. Missing base URL → works locally, 404 on deploy
  • Korean color names: Theme variables in global.css use Korean names (hanji, meok, onggi, etc.). This is intentional — do not rename to English
  • Tailwind v4 opacity: Use integer presets (text-hobak/7), never decimal brackets (text-hobak/[0.07]). Arbitrary values are only allowed when no preset exists (e.g., calc() or custom grids)
  • i18n manual routing: Pages at pages/ko/index.astro must be created manually. Astro i18n does not auto-generate locale pages
  • Post-change verification required: After any website code change, always run cd website && pnpm build and cd website && pnpm lint to verify no errors before considering the task complete

SKILL.md Conventions

  • Description format: "<English description>. <Korean summary>. Use when the user says '<triggers>'."
  • disable-model-invocation: true → mechanical skill (run script + report result). Omit → needs model reasoning
  • context: fork → only used by dd-doctor. For independent diagnostic analysis requiring a subagent

Version Management

  • plugin.json is the single source of truth. semver: feat: → minor, fix: → patch
  • Commit order: feature/fix commit first → version bump as a separate chore: commit
  • node scripts/sync-version.mjs bump patch|minor|major
  • node scripts/sync-version.mjs verify (exits 1 on mismatch)
  • Release flow: version bump commit → node scripts/release.mjs → GitHub Actions creates release

Testing

No automated test suite exists yet. When adding tests:

  • Test runner: node:test (maintains zero-dependency policy)
  • Priority: config.mjs (5-stage merge), platform.mjs (detection), notify.mjs (dispatch flow)
  • Hook tests: stop.mjs must always output {}, all hooks must exit(0) on error
  • Sound pack tests: manifest validation, resolution order (project > user > built-in)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.