makefile-generation
Scannednpx machina-cli add skill athola/claude-night-market/makefile-generation --openclawTable of Contents
- When To Use
- 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.
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
# 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
Source
git clone https://github.com/athola/claude-night-market/blob/master/plugins/attune/skills/makefile-generation/SKILL.mdView on GitHub Overview
This skill creates standard Makefiles tailored to Python, Rust, or TypeScript projects, including testing, linting, and automation targets. It helps with project initialization and aligning development workflows across repos, while skipping generation if a Makefile already exists.
How This Skill Works
The tool detects the project language using indicators like pyproject.toml, Cargo.toml, or package.json, then loads a language-specific Makefile.template. It collects project metadata (e.g., PROJECT_NAME, PROJECT_MODULE) and renders the template into a Makefile, followed by verification via make help or a dry-run to ensure correctness.
When to Use It
- You’re starting a new Python, Rust, or TypeScript project and need a standard Makefile from day one.
- You want to standardize build automation and common targets across multiple repositories.
- You need to add or update targets like lint, format, typecheck, test, and publish.
- You’re setting up a project workflow and want language-aware Makefiles generated automatically.
- You want to avoid overwriting an existing Makefile and only generate when none exists.
Quick Start
- Step 1: Detect Language indicators (pyproject.toml, Cargo.toml, or package.json) to choose the right template.
- Step 2: Load the language Makefile.template and supply metadata like PROJECT_NAME and PROJECT_MODULE.
- Step 3: Render the Makefile and verify with make help or a dry-run to confirm targets.
Best Practices
- Always check for an existing Makefile before generation and skip if found to prevent data loss.
- Use the language-specific standard targets as a baseline and customize afterward as needed.
- Provide accurate project metadata (PROJECT_NAME, PROJECT_MODULE, versions) to ensure correct template rendering.
- Verify the generated Makefile with make help and consider a dry-run to validate targets.
- Version-control the Makefile templates and document any custom targets added after generation.
Example Use Cases
- Python project: make targets include install, lint, format, typecheck, test, test-coverage, check-all, clean, build, publish.
- Rust project: targets include fmt, lint, check, test, build, clean.
- TypeScript project: targets include install, lint, format, typecheck, test, build, dev.
- Multiple repos: a shared Makefile.template standardizes targets across several repos for consistency.
- Legacy repo upgrade: generate a new Makefile to replace ad hoc scripts; if updating an existing Makefile, consider /attune:upgrade-project.
Frequently Asked Questions
Related Skills
cron
chaterm/terminal-skills
定时任务管理
precommit-setup
athola/claude-night-market
Configure three-layer pre-commit system with linting, type checking, and testing hooks. Use for quality gate setup and code standards. Skip if pre-commit is optimally configured.
error-patterns
athola/claude-night-market
'Standardized error handling patterns with classification, recovery,
convex-cron-jobs
waynesutton/convexskills
Scheduled function patterns for background tasks including interval scheduling, cron expressions, job monitoring, retry strategies, and best practices for long-running tasks
risk-classification
athola/claude-night-market
'Inline risk classification for agent tasks using a 4-tier model. Hybrid
workflow-setup
athola/claude-night-market
Configure GitHub Actions CI/CD workflows for automated testing, linting, and deployment. Use for CI/CD setup and quality automation. Skip if CI/CD configured or using different platform.