unxed/f4 / .agents/skills/aif-build-automation
aif-build-automation
VerifiedAnalyze project and generate or enhance build automation file (Makefile, Taskfile.yml, Justfile, Magefile.go). If a build file already exists, improves it by adding missing targets and best practices. Use when user says "generate makefile", "create taskfile", "add justfile", "setup mage", or "build automation".
templates/justfile-node
View on GitHub# --- Justfile for Node.js Projects ---
# Usage: just [recipe]
# Install: https://just.systems/man/en/
set shell := ["bash", "-euo", "pipefail", "-c"]
set dotenv-load
set export
set positional-arguments
# --- Variables ---
project := `node -p "require('./package.json').name" 2>/dev/null || basename $(pwd)`
version := `git describe --tags --always --dirty 2>/dev/null || echo "dev"`
commit := `git rev-parse --short HEAD 2>/dev/null || echo "unknown"`
# Package manager detection
pm := if path_exists("bun.lockb") == "true" { "bun" } else if path_exists("pnpm-lock.yaml") == "true" { "pnpm" } else if path_exists("yarn.lock") == "true" { "yarn" } else { "npm" }
pmx := if pm == "bun" { "bunx" } else if pm == "pnpm" { "pnpm exec" } else if pm == "yarn" { "yarn" } else { "npx" }
# Docker
docker_registry := env("DOCKER_REGISTRY", "ghcr.io")
docker_image := docker_registry + "/" + project
docker_tag := version
# Default recipe - show help
[doc("Show available recipes")]
default:
@just --list --unsorted
# --- Development ---
[group("development")]
[doc("Install dependencies")]
install:
{{ pm }} install
[group("development")]
[doc("Start development server")]
dev: install
{{ pm }} run dev
[group("development")]
[doc("Build for production")]
build: install
NODE_ENV=production {{ pm }} run build
[group("development")]
[doc("Start production server")]
start:
NODE_ENV=production {{ pm }} run start
[group("development")]
[doc("Run code generation")]
generate:
{{ pm }} run generate
# --- Testing ---
[group("testing")]
[doc("Run tests")]
test *args:
{{ pm }} run test {{ args }}
[group("testing")]
[doc("Run tests in watch mode")]
test-watch:
{{ pm }} run test -- --watch
[group("testing")]
[doc("Run tests with coverage")]
test-cover:
{{ pm }} run test -- --coverage
[group("testing")]
[doc("Run end-to-end tests")]
e2e:
{{ pm }} run test:e2e
# --- Code Quality ---
[group("quality")]
[doc("Run linter")]
lint:
{{ pm }} run lint
[group("quality")]
[doc("Run linter with auto-fix")]
lint-fix:
{{ pm }} run lint -- --fix
[group("quality")]
[doc("Format code with Prettier")]
fmt:
{{ pmx }} prettier --write .
[group("quality")]
[doc("Check code formatting")]
fmt-check:
{{ pmx }} prettier --check .
[group("quality")]
[doc("Run TypeScript type checking")]
typecheck:
{{ pmx }} tsc --noEmit
[group("quality")]
[doc("Run all checks")]
check: lint typecheck test
# --- Docker ---
[group("docker")]
[doc("Build Docker image")]
docker-build:
docker build \
--build-arg VERSION={{ version }} \
--build-arg COMMIT={{ commit }} \
-t {{ docker_image }}:{{ docker_tag }} \
-t {{ docker_image }}:latest \
.
[group("docker")]
[doc("Push Docker image")]
docker-push:
docker push {{ docker_image }}:{{ docker_tag }}
docker push {{ docker_image }}:latest
[group("docker")]
[doc("Run Docker container locally")]
docker-run:
docker run --rm -p 3000:3000 --env-file .env {{ docker_image }}:{{ docker_tag }}
# --- Database ---
[group("database")]
[doc("Run database migrations")]
db-migrate:
{{ pm }} run db:migrate
[group("database")]
[doc("Seed the database")]
db-seed:
{{ pm }} run db:seed
[group("database")]
[doc("Reset database")]
db-reset:
{{ pm }} run db:reset
# --- CI ---
[group("ci")]
[doc("Run full CI pipeline")]
ci: install lint typecheck test build
# --- Cleanup ---
[confirm("Remove all build artifacts and caches?")]
[group("maintenance")]
[doc("Remove build artifacts and caches")]
clean:
rm -rf dist/ build/ .next/ out/ coverage/ .turbo/ node_modules/.cache
[confirm("Remove everything including node_modules?")]
[group("maintenance")]
[doc("Remove everything including node_modules")]
clean-all: clean
rm -rf node_modules/
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |