mcouthon/agents/makefile
Claude Code and agent skill by mcouthon/agents
- community
Checking that the SKILL.md file is still in the repository.
Use when creating Makefiles for process lifecycle management with PID tracking, logging, and status monitoring. Triggers on: 'use makefile mode', 'makefile', 'create makefile', 'process management', 'background jobs', 'start/stop services'. Full access mode - can create/modify Makefiles.
Install
npx vskill@latest install mcouthon/agents/makefileSKILL.md
Makefile Mode
Create and manage Makefiles optimized for AI agent interaction and process lifecycle management.
Core Philosophy
"Start clean. Stop clean. Log everything. Know your state."
Principles:
- AI-agent first: Outputs readable programmatically (no interactive prompts)
- Background by default: Services run detached; read logs, don't spawn terminals
- Comprehensive logging: All output to files at
.logs/- nothing lost - Process hygiene: Clean starts, clean stops, no orphan processes
- Adaptable patterns: Works for any service topology
Pre-Implementation Discovery
Before creating a Makefile, determine:
Service Topology
- [ ] What services exist? (backend, frontend, workers, etc.)
- [ ] Do any services depend on others? (start order)
- [ ] Are there external dependencies? (databases, emulators, etc.)
Startup Requirements
- [ ] What commands start each service?
- [ ] What environment variables are needed?
- [ ] What ports are used? (must be unique per-service)
- [ ] Any initialization steps? (migrations, seeds, etc.)
Testing & Quality
- [ ] What test commands exist? (unit, integration, e2e)
- [ ] What prerequisites for tests? (docker, emulators, etc.)
- [ ] What linting/formatting tools? (eslint, ruff, mypy, etc.)
Project Context
- [ ] Language/framework? (affects conventions)
- [ ] Development vs Production behavior?
- [ ] Team conventions? (existing practices to preserve)
Makefile Architecture
Standard structure (in order):
Core Patterns Library
A. Starting a Service (Background with PID Tracking)
B. Stopping a Service (Process Group Cleanup)
C. Status Checking
D. Log Tailing
E. Combined Operations
F. Testing with Prerequisites
G. Help Target (Self-Documenting)
Adaptation Patterns
| Scenario | Adaptation | |
|---|---|---|
| Multiple backends | Use suffix naming: run-api, run-worker, etc. | |
| Database migrations | Add migrate target, make run-backend depend on it | |
| Emulators | Treat like any other service with PID tracking | |
| Docker Compose | Wrap docker-compose commands, track container IDs | |
| Monorepo | Use subdirectory variables: cd $(API_DIR) && ... | |
| Multiple test types | Separate targets: test-unit, test-integration, test-e2e | |
| Watch modes | Use separate watch targets, don't mix with regular run |
Best Practices Checklist
Before completing a Makefile, verify:
- [ ] All targets are
.PHONY(or appropriately not) - [ ] Port numbers are configurable via variables
- [ ] Unique ports per service (no conflicts)
- [ ] All logs go to
.logs/directory - [ ] All PIDs go to
.pids/directory - [ ] Process group killing (handles child processes)
- [ ] Port conflict detection before start
- [ ] Human-readable output (colors/emojis)
- [ ]
helptarget is default (listed first or.DEFAULT_GOAL) - [ ] Variables use
:=(simple expansion) - [ ] Error messages are clear and actionable
- [ ] Status command shows actual state
- [ ] Clean shutdown on stop (SIGTERM first)
- [ ] Idempotent operations (safe to run twice)
Common Issues & Solutions
| Problem | Solution | |
|---|---|---|
| PID file exists but process dead | Check ps -p $PID before using PID file | |
| Child processes survive parent kill | Use kill -TERM -- -$PID (process group) | |
| Port already in use | Check with lsof -ti:$PORT before start | |
| Logs interleaved/unreadable | Separate log files per service | |
| Service starts but immediately exits | Redirect stderr: 2>&1, check .logs/ | |
| Make variables not evaluated | Use := not =, check $$ vs $ | |
| Colors don't show in logs | Use unbuffer or configure service for TTY | |
| Can't stop service (permission) | Run make with same user that started it |
Implementation Workflow
Creating a New Makefile
- Discovery: Ask questions (see Discovery section)
- Configuration: Set up variables (ports, commands, paths)
- Core services: Implement run/stop for each service
- Combined ops: Add run/stop/restart for all services
- Utilities: Add status, logs, help
- Testing: Add test targets with prerequisites
- Quality: Add lint/format targets
- Validation: Test each target, verify idempotency
- Documentation: Ensure help is complete and accurate
Amending an Existing Makefile
- Read current Makefile: Understand existing structure
- Identify gaps: Compare against best practices checklist
- Plan changes: Determine what to add/modify
- Preserve conventions: Keep existing naming/style
- Incremental changes: Add features one at a time
- Test each change: Verify nothing breaks
- Update help: Reflect new targets
Complete Template
A minimal working template for a full-stack app:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinggenerated/claude/skills/makefile/SKILL.md
Popularity
- Repository stars
- 79
- Repository forks
- 11
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mcouthon/agents/makefile)