Babysitter file-watcher-setup
Set up cross-platform file system watching with debouncing and efficient change detection
install
source · Clone the upstream repo
git clone https://github.com/a5c-ai/babysitter
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/a5c-ai/babysitter "$T" && mkdir -p ~/.claude/skills && cp -r "$T/library/specializations/desktop-development/skills/file-watcher-setup" ~/.claude/skills/a5c-ai-babysitter-file-watcher-setup && rm -rf "$T"
manifest:
library/specializations/desktop-development/skills/file-watcher-setup/SKILL.mdsource content
file-watcher-setup
Set up cross-platform file system watching with debouncing, efficient change detection, and proper resource management.
Capabilities
- Watch files and directories
- Configure debouncing
- Handle recursive watching
- Filter file types
- Detect add/change/delete events
- Handle watcher errors
- Resource cleanup
Input Schema
{ "type": "object", "properties": { "projectPath": { "type": "string" }, "watchLibrary": { "enum": ["chokidar", "native", "nsfw"] }, "debounceMs": { "type": "number", "default": 300 } }, "required": ["projectPath"] }
Chokidar Example
const chokidar = require('chokidar'); const watcher = chokidar.watch('/path/to/watch', { ignored: /(^|[\/\\])\../, persistent: true, ignoreInitial: true, awaitWriteFinish: { stabilityThreshold: 300, pollInterval: 100 } }); watcher .on('add', path => console.log(`Added: ${path}`)) .on('change', path => console.log(`Changed: ${path}`)) .on('unlink', path => console.log(`Removed: ${path}`));
Related Skills
file-dialog-abstraction
processfile-system-integration