Makefile Generation Skill
Generate a Makefile with standard development targets for Python, Rust, or TypeScript projects.
When To Use
- Need a Makefile for a project without one
- Want to update Makefile with new targets
- Standardizing build automation across projects
- Setting up development workflow commands
- Creating language-specific build targets
When NOT To Use
- Makefile already exists and is current
- Project uses alternative build system exclusively (e.g., npm scripts only)
- Complex custom build process that doesn't fit standard patterns
- Use
/attune:upgrade-projectinstead for updating existing Makefiles
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
bash# 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
pythonfrom 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
pythonmetadata = { "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
pythonfrom 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
bashmake help
Verification: Run make --dry-run to verify build configuration.
Customization
Users can add custom targets after the generated ones:
makefile# ============================================================================ # 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 initialization/abstract:make-dogfoodcommand - Makefile testing and validation
Exit Criteria
- A
Makefileis created at the project root containing at minimum ahelptarget and all standard targets for the detected language (Python: install/lint/format/typecheck/test; Rust: fmt/lint/check/test/build; TypeScript: install/lint/format/typecheck/test/build). -
make helpruns without error and lists all generated targets with descriptions. -
make --dry-run <target>exits 0 for each standard target, confirming recipe syntax is valid. - If no language is detected (no
pyproject.toml,Cargo.toml, orpackage.json), the skill reports the detection failure and stops rather than generating a blank Makefile.


