Automated summary
Provides copy-paste templates for npm scripts, a Makefile, Husky/lint-staged Git hooks, and shell setup and deploy scripts to automate repetitive tasks in a JavaScript/TypeScript project.
Strengths
- Complete, immediately reusable templates: package.json scripts, Makefile, pre-commit hook, and bash scripts.
- The Makefile ships a self-documenting help target and a ci target that replays lint, tests, and build locally.
- The pre-commit hook chains lint-staged, type checking, and tests scoped to changed files.
- dev-setup.sh checks prerequisites (Node, Docker), copies .env, starts services, and runs migrations.
Limitations
- Heavily Node/TypeScript-oriented: examples assume npm, jest, eslint, prettier, and husky.
- The deploy.sh sample is truncated in the document and cannot be used as-is.
- GitHub Actions workflows are advertised in the description but no YAML is actually provided.
- Shell commands assume a macOS/Linux environment.
Use it when you need to standardize build, test, and deploy commands across a JS/TS project team.
Avoid it for non-Node stacks or when you need full CI pipeline definitions such as GitHub Actions or GitLab CI files.
Security analysis
CautionThe skill provides templates for build automation and CI/CD, which legitimately require powerful tools like shell, docker, and ssh. While there are destructive rm -rf and remote command examples, they are scoped and standard practice, not inherently malicious. No exfiltration or obfuscation detected.
- •Example scripts include rm -rf commands (scoped to build artifacts like dist, node_modules, coverage) which are destructive but common in clean tasks.
- •Includes SSH deployment commands that run remote shell commands (ssh production 'cd /app && git pull && npm install && npm run build && pm2 restart all').
- •Includes docker build/run commands that may execute containers with network access.
Examples
Create a set of npm scripts and a self-documenting Makefile for my TypeScript project with dev, build, test, lint, format, type-check, clean, and a 'make ci' target that runs lint, test and build.Set up Husky and lint-staged so my pre-commit hook runs eslint --fix and prettier on staged TS files, then type-checks and runs only the tests affected by the changed files.Write a scripts/dev-setup.sh that checks for Node and Docker, installs dependencies, copies .env.example to .env, starts docker-compose services, waits for Postgres on 5432, and runs migrations.name: workflow-automation description: Automate repetitive development tasks and workflows. Use when creating build scripts, automating deployments, or setting up development workflows. Handles npm scripts, Makefile, GitHub Actions workflows, and task automation. tags: [automation, scripts, workflow, npm-scripts, Makefile, task-runner] platforms: [Claude, ChatGPT, Gemini]
Workflow Automation
When to use this skill
- 반복 작업: 매번 같은 명령어 실행
- 복잡한 빌드: 여러 단계 빌드 프로세스
- 팀 온보딩: 일관된 개발 환경
Instructions
Step 1: npm scripts
package.json:
{
"scripts": {
"dev": "nodemon src/index.ts",
"build": "tsc && vite build",
"test": "jest --coverage",
"test:watch": "jest --watch",
"lint": "eslint src --ext .ts,.tsx",
"lint:fix": "eslint src --ext .ts,.tsx --fix",
"format": "prettier --write \"src/**/*.{ts,tsx,json}\"",
"type-check": "tsc --noEmit",
"pre-commit": "lint-staged",
"prepare": "husky install",
"clean": "rm -rf dist node_modules",
"reset": "npm run clean && npm install",
"docker:build": "docker build -t myapp .",
"docker:run": "docker run -p 3000:3000 myapp"
}
}
Step 2: Makefile
Makefile:
.PHONY: help install dev build test clean docker
.DEFAULT_GOAL := help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install dependencies
npm install
dev: ## Start development server
npm run dev
build: ## Build for production
npm run build
test: ## Run all tests
npm test
lint: ## Run linter
npm run lint
lint-fix: ## Fix linting issues
npm run lint:fix
clean: ## Clean build artifacts
rm -rf dist coverage
docker-build: ## Build Docker image
docker build -t myapp:latest .
docker-run: ## Run Docker container
docker run -d -p 3000:3000 --name myapp myapp:latest
deploy: build ## Deploy to production
@echo "Deploying to production..."
./scripts/deploy.sh production
ci: lint test build ## Run CI pipeline locally
@echo "✅ CI pipeline passed!"
사용:
make help # Show all commands
make dev # Start development
make ci # Run full CI locally
Step 3: Husky + lint-staged (Git Hooks)
package.json:
{
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix",
"prettier --write"
],
"*.{json,md}": [
"prettier --write"
]
}
}
.husky/pre-commit:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
echo "Running pre-commit checks..."
# Lint staged files
npx lint-staged
# Type check
npm run type-check
# Run tests related to changed files
npm test -- --onlyChanged
echo "✅ Pre-commit checks passed!"
Step 4: Task Runner 스크립트
scripts/dev-setup.sh:
#!/bin/bash
set -e
echo "🚀 Setting up development environment..."
# Check prerequisites
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed"
exit 1
fi
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed"
exit 1
fi
# Install dependencies
echo "📦 Installing dependencies..."
npm install
# Copy environment file
if [ ! -f .env ]; then
echo "📄 Creating .env file..."
cp .env.example .env
echo "⚠️ Please update .env with your configuration"
fi
# Start Docker services
echo "🐳 Starting Docker services..."
docker-compose up -d
# Wait for database
echo "⏳ Waiting for database..."
./scripts/wait-for-it.sh localhost:5432 --timeout=30
# Run migrations
echo "🗄️ Running database migrations..."
npm run migrate
# Seed data (optional)
read -p "Seed database with sample data? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
npm run seed
fi
echo "✅ Development environment ready!"
echo "Run 'make dev' to start the development server"
scripts/deploy.sh:
#!/bin/bash
set -e
ENV=$1
if [ -z "$ENV" ]; then
echo "Usage: ./deploy.sh [staging|production]"
exit 1
fi
echo "🚀 Deploying to $ENV..."
# Build
echo "📦 Building application..."
npm run build
# Run tests
echo "🧪 Running tests..."
npm test
# Deploy based on environment
if [ "$ENV" == "production" ]; then
echo "🌍 Deploying to production..."
# Production deployment logic
ssh production "cd /app && git pull && npm install && npm run build && pm2 restart all"
elif [ "$ENV" == "staging" ]; then
echo "🧪 Deploying to staging..."
# Staging deployment logic
ssh staging "cd /app && git pull && npm install && npm run build && pm2 restart all"
fi
echo "✅ Deployment to $ENV completed!"
Step 5: GitHub Actions Workflow 자동화
.github/workflows/ci.yml:
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Type check
run: npm run type-check
- name: Run tests
run: npm test -- --coverage
- name: Upload coverage
uses: codecov/codecov-action@v3
Output format
project/
├── scripts/
│ ├── dev-setup.sh
│ ├── deploy.sh
│ ├── test.sh
│ └── cleanup.sh
├── Makefile
├── package.json
└── .husky/
├── pre-commit
└── pre-push
Constraints
필수 규칙 (MUST)
- 멱등성: 스크립트 여러 번 실행해도 안전
- 에러 처리: 실패 시 명확한 메시지
- 문서화: 스크립트 사용법 주석
금지 사항 (MUST NOT)
- 하드코딩된 비밀: 스크립트에 비밀번호, API 키 포함 금지
- 파괴적 명령: 확인 없이 rm -rf 실행 금지
Best practices
- Make 사용: 플랫폼 무관 인터페이스
- Git Hooks: 자동 품질 검사
- CI/CD: GitHub Actions로 자동화
References
Metadata
버전
- 현재 버전: 1.0.0
- 최종 업데이트: 2025-01-01
- 호환 플랫폼: Claude, ChatGPT, Gemini
태그
#automation #scripts #workflow #npm-scripts #Makefile #utilities
Examples
Example 1: Basic usage
<!-- Add example content here -->Example 2: Advanced usage
<!-- Add advanced example content here -->From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/workflow-automation-mryiqhzy/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/workflow-automation-mryiqhzy' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/workflow-automation-mryiqhzy/download' --output '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md.part' && mv '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md.part' '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md' && test -s '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/workflow-automation' && cp -R '.skill-downloads/workflow-automation-mryiqhzy' '.claude/skills/workflow-automation'Cursor
test -f '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md' && test -s '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/workflow-automation' && cp -R '.skill-downloads/workflow-automation-mryiqhzy' '.cursor/skills/workflow-automation'Codex
test -f '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md' && test -s '.skill-downloads/workflow-automation-mryiqhzy/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/workflow-automation' && cp -R '.skill-downloads/workflow-automation-mryiqhzy' '.agents/skills/workflow-automation'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/workflow-automation-mryiqhzy'openskills read 'workflow-automation-mryiqhzy'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/workflow-automation-mryiqhzy/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
Configure a Chat Channel with SecretRefs
DevOps
Set up chat channels using non-interactive commands, with secrets only as SecretRefs. Covers gather, mutate, repair, and prove steps for reliable delivery.
Investigate ClickHouse CI Failures
DevOps
Investigate a ClickHouse CI failure end-to-end from a PR or S3 report URL. Fetches failed tests, classifies flaky vs real regression, and checks for existing issues/fixes.
Ansible PR Review
DevOps
Reviews an Ansible PR following the project's standardized process, including changelog checks, test coverage validation, and feedback tracking.