makefile-generation
Generate language-specific Makefile with common development targets
When & Why to Use This Skill
The Makefile Generation skill automates the creation of standardized, language-specific Makefiles for Python, Rust, and TypeScript projects. By detecting the project environment and applying best-practice templates, it provides a consistent interface for common development tasks like linting, testing, and building, significantly reducing manual configuration time and improving workflow consistency.
Use Cases
- New Project Bootstrapping: Automatically generate a comprehensive Makefile immediately after project initialization to establish a professional build and test environment.
- Workflow Standardization: Implement uniform command structures across multiple repositories, allowing team members to use familiar commands like 'make test' or 'make build' regardless of the underlying programming language.
- Legacy Project Modernization: Quickly add modern development targets (such as 'uv' for Python or 'clippy' for Rust) to existing projects that lack a structured build automation system.
- CI/CD Pipeline Integration: Use the generated Makefiles as a stable entry point for CI/CD scripts, ensuring that local development commands match the automated build environment.
| name | makefile-generation |
|---|---|
| description | Generate language-specific Makefile with common development targets |
| Triggers | language-specific, makefile, development, targets, generation |
| model | claude-sonnet-4 |
| tools | [Read, Write, Bash] |
Table of Contents
- Use When
- Standard Targets
- Python Makefile
- Rust Makefile
- TypeScript Makefile
- Workflow
- 1. Detect Language
- 2. Load Template
- 3. Collect Project Info
- 4. Render Template
- 5. Verify
- Customization
- Related Skills
Makefile Generation Skill
Generate a Makefile with standard development targets for Python, Rust, or TypeScript projects.
Use When
- Need a Makefile for a project without one
- Want to update Makefile with new targets
- Standardizing build automation across projects
Standard Targets
Python Makefile
Common targets:
help- Show available targetsinstall- Install dependencies with uvlint- Run ruff lintingformat- Format code with rufftypecheck- Run mypy type checkingtest- Run pytesttest-coverage- Run tests with coverage reportcheck-all- Run all quality checksclean- Remove generated files and cachesbuild- Build distribution packagespublish- Publish to PyPI
Rust Makefile
Common targets:
help- Show available targetsfmt- Format with rustfmtlint- Run clippycheck- Cargo checktest- Run testsbuild- Build release binaryclean- Clean build artifacts
TypeScript Makefile
Common targets:
help- Show available targetsinstall- Install npm dependencieslint- Run ESLintformat- Format with Prettiertypecheck- Run tsc type checkingtest- Run Jest testsbuild- Build for productiondev- Start development server
Workflow
1. Detect Language
# Check for language indicators
if [ -f "pyproject.toml" ]; then
LANGUAGE="python"
elif [ -f "Cargo.toml" ]; then
LANGUAGE="rust"
elif [ -f "package.json" ]; then
LANGUAGE="typescript"
fi
Verification: Run the command with --help flag to verify availability.
2. Load Template
from pathlib import Path
template_path = Path("plugins/attune/templates") / language / "Makefile.template"
Verification: Run the command with --help flag to verify availability.
3. Collect Project Info
metadata = {
"PROJECT_NAME": "my-project",
"PROJECT_MODULE": "my_project",
"PYTHON_VERSION": "3.10",
}
Verification: Run the command with --help flag to verify availability.
4. Render Template
from template_engine import TemplateEngine
engine = TemplateEngine(metadata)
engine.render_file(template_path, Path("Makefile"))
Verification: Run the command with --help flag to verify availability.
5. Verify
make help
Verification: Run make --dry-run to verify build configuration.
Customization
Users can add custom targets after the generated ones:
# ============================================================================
# CUSTOM TARGETS
# ============================================================================
deploy: build ## Deploy to production
./scripts/deploy.sh
Verification: Run the command with --help flag to verify availability.
Related Skills
Skill(attune:project-init)- Full project initializationSkill(abstract:makefile-dogfooder)- Makefile testing and validation
Troubleshooting
Common Issues
Command not found Ensure all dependencies are installed and in PATH
Permission errors Check file permissions and run with appropriate privileges
Unexpected behavior
Enable verbose logging with --verbose flag