
File Watcher
Monitor directories and auto-run Claude prompts on file changes
What You Can Do
Set up continuous monitoring of specific directories or file types, then automatically trigger Claude prompts whenever files change. Perfect for real-time code validation, design-to-code synchronization, test generation, or configuration updates. Each changed file is processed through your custom prompt with full access to its contents.
Features
Watch directories recursively with Chokidar, detecting adds and changes instantly
Batch rapid saves with configurable debounce delays (default 500ms) to prevent duplicate runs
Target specific file types (e.g., *.tsx, *.css) to avoid processing unwanted files
Use {{file}} placeholder in prompts to inject the changed file path automatically
Execute via npm/bun scripts with flexible arguments for path, prompt, and options
Each file change triggers an immediate Claude analysis with results logged to stdout
Handle multiple file changes efficiently without blocking or missing events
Example Output
Code Review Scenario:
Watching src/ for TypeScript changes. When src/api.ts is modified:
✓ Analyzing src/api.ts for issues
• Line 42: Missing error handling in async function
• Consider adding try-catch wrapper
• Type annotation missing on params
Design Sync Scenario:
Watching designs/ for Figma exports. When designs/button.json changes:
✓ Design file detected: designs/button.json
Updated React component:
- Button padding: 12px → 16px
- Hover state color: #0066cc → #0052a3
- Added focus ring: 2px solid #0066cc
What's Included
- SKILL.md: Complete setup instructions and CLI reference
- watch-files.mjs: Chokidar-based watcher script with debouncing and glob filtering
- CLI argument guide: Reference for path, prompt, glob patterns, and debounce options
- Example prompts library: Pre-written prompts for code review, type checking, design sync, and test generation
- npm/bun integration: Package.json script templates for common workflows
Who It's For
- Full-stack developers — Auto-validate code changes against coding standards in real-time
- Frontend engineers — Keep React components synchronized with design file updates
- QA engineers — Automatically test modified files for compliance and regressions
- DevOps/Platform teams — Monitor config files and regenerate dependent artifacts on change
- Technical leads — Enforce architectural patterns by reviewing every committed file change
Best For
- Continuous code review — Flag issues in modified files immediately after save
- Design-to-code workflows — Auto-update components when design tokens or assets change
- Test generation — Generate or update unit tests whenever source files are modified
- Type and linting validation — Real-time TypeScript or ESLint-style analysis without build overhead
- Configuration sync — Regenerate config-dependent files (env schemas, type definitions, docs) on change







