Get the FREE Ultimate OpenClaw Setup Guide →
npx machina-cli add skill athola/claude-night-market/makefile-generation --openclaw
Files (1)
SKILL.md
4.5 KB

Table of Contents

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-project instead for updating existing Makefiles

Standard Targets

Python Makefile

Common targets:

  • help - Show available targets
  • install - Install dependencies with uv
  • lint - Run ruff linting
  • format - Format code with ruff
  • typecheck - Run mypy type checking
  • test - Run pytest
  • test-coverage - Run tests with coverage report
  • check-all - Run all quality checks
  • clean - Remove generated files and caches
  • build - Build distribution packages
  • publish - Publish to PyPI

Rust Makefile

Common targets:

  • help - Show available targets
  • fmt - Format with rustfmt
  • lint - Run clippy
  • check - Cargo check
  • test - Run tests
  • build - Build release binary
  • clean - Clean build artifacts

TypeScript Makefile

Common targets:

  • help - Show available targets
  • install - Install npm dependencies
  • lint - Run ESLint
  • format - Format with Prettier
  • typecheck - Run tsc type checking
  • test - Run Jest tests
  • build - Build for production
  • dev - 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 initialization
  • Skill(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

  1. Step 1: Detect Language indicators (pyproject.toml, Cargo.toml, or package.json) to choose the right template.
  2. Step 2: Load the language Makefile.template and supply metadata like PROJECT_NAME and PROJECT_MODULE.
  3. 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

Add this skill to your agents

Related Skills

Sponsor this space

Reach thousands of developers