用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/diegosouzapw/awesome-omni-skill --skill automation-scripts命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | automation-scripts |
| description | Build automation, task runners, and scripting tools |
| domain | tools-integrations |
| version | 1.0.0 |
| tags | ["make","npm-scripts","bash","automation","turbo","nx"] |
Build automation, task runners, and scripting patterns for development workflows.
{
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint . --ext .ts,.tsx",
"lint:fix": "eslint . --ext .ts,.tsx --fix",
"type-check": "tsc --noEmit",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest --coverage",
"test:e2e": "playwright test",
"format": "prettier --write .",
"format:check": "prettier --check .",
"db:migrate": "prisma migrate deploy",
"db:generate": "prisma generate",
"db:seed": "tsx prisma/seed.ts",
"db:studio": "prisma studio",
"prepare": "husky install",
"precommit": "lint-staged",
"validate": "npm run type-check && npm run lint && npm run test",
"clean": "rm -rf .next node_modules/.cache",
"analyze": "ANALYZE=true next build"
}
}
{
"scripts": {
"check:all": "npm-run-all --parallel lint type-check test:unit",
"build:all": "npm-run-all clean build test:e2e",
"ci": "npm-run-all --serial lint type-check test build",
"prerelease": "npm run validate",
"release": "standard-version",
"postrelease": "git push --follow-tags"
}
}
# Makefile
.PHONY: dev build test lint clean deploy help
# Default target
.DEFAULT_GOAL := help
# Variables
NODE_ENV ?= development
DOCKER_TAG ?= latest
PROJECT_NAME := myapp
# Development
dev: ## Start development server
npm run dev
install: ## Install dependencies
npm ci
# Build
build: ## Build for production
npm run build
build-docker: ## Build Docker image
docker build -t $(PROJECT_NAME):$(DOCKER_TAG) .
# Testing
test: ## Run all tests
npm run test
test-watch: ## Run tests in watch mode
npm run test:watch
test-coverage: ## Run tests with coverage
npm run test:coverage
test-e2e: ## Run E2E tests
npm run test:e2e
# Linting & Formatting
lint: ## Run linter
npm run lint
lint-fix: ## Fix linting issues
npm run lint:fix
format: ## Format code
npm run format
type-check: ## Run type checking
npm run type-check
# Database
db-migrate: ## Run database migrations
npm run db:migrate
db-seed: ## Seed database
npm run db:seed
db-reset: ## Reset database
npm run db:reset
# Docker
docker-up: ## Start Docker services
docker-compose up -d
docker-down: ## Stop Docker services
docker-compose down
docker-logs: ## Show Docker logs
docker-compose logs -f
# Deployment
deploy-staging: ## Deploy to staging
./scripts/deploy.sh staging
deploy-prod: ## Deploy to production
./scripts/deploy.sh production
# Cleanup
clean: ## Clean build artifacts
rm -rf dist .next coverage node_modules/.cache
npm run clean
rm -rf node_modules
@echo
@echo
@echo
@grep -E '^[a-zA-Z_-]+:.*?
#!/bin/bash
# scripts/build.sh
set -e # Exit on error
set -o pipefail # Exit on pipe failure
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Logging functions
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $1"; }
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
# Configuration
BUILD_DIR="dist"
NODE_ENV="${NODE_ENV:-production}"
# Functions
clean() {
log_info "Cleaning build directory..."
rm -rf "$BUILD_DIR"
}
install_deps() {
log_info "Installing dependencies..."
npm ci
}
lint() {
log_info "Running linter..."
npm run lint
}
type_check() {
log_info
npm run type-check
}
() {
log_info
npm run -- --run
}
() {
log_info
NODE_ENV= npm run build
}
() {
start_time=$( +%s)
log_info
clean
install_deps
lint
type_check
build
end_time=$( +%s)
duration=$((end_time - start_time))
log_info
}
main
#!/bin/bash
# scripts/deploy.sh
set -e
ENVIRONMENT="${1:-staging}"
VERSION="${2:-$(git rev-parse --short HEAD)}"
log() { echo "[$(date +'%Y-%m-%d %H:%M:%S')] $1"; }
validate_environment() {
case "$ENVIRONMENT" in
staging|production)
log "Deploying to $ENVIRONMENT"
;;
*)
log "Error: Invalid environment '$ENVIRONMENT'"
log "Usage: $0 [staging|production] [version]"
exit 1
;;
esac
}
confirm_production() {
if [ "$ENVIRONMENT" = "production" ]; then
read -p "Are you sure you want to deploy to production? (yes/no) " -r
if [ "$REPLY" != "yes" ]; then
log "Deployment cancelled"
exit 0
fi
fi
}
build_image() {
docker build -t .
docker tag
}
() {
docker push
}
() {
kubectl image deployment/myapp \
myapp= \
-n
kubectl rollout status deployment/myapp -n --=5m
}
() {
url
staging) url= ;;
production) url= ;;
curl -sf > /dev/null;
1
}
() {
status=
webhook_url=
curl -X POST -H \
--data \
}
() {
validate_environment
confirm_production
build_image
push_image
deploy_kubernetes
run_smoke_tests
notify_slack
}
ERR
main
// turbo.json
{
"$schema": "https://turbo.build/schema.json",
"globalDependencies": ["**/.env.*local"],
"pipeline": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"lint": {
"outputs": []
},
"test": {
"dependsOn": ["build"],
"outputs": ["coverage/**"]
},
# Run build in all packages
turbo build
# Run dev in specific packages
turbo dev --filter=web --filter=api
# Run with caching
turbo build --cache-dir=.turbo
# Dry run to see what would execute
turbo build --dry-run
// nx.json
{
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"test": {
"inputs": ["default", "^production"]
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*"],
"production": [
"default",
"!{projectRoot}/**/*.spec.ts",
"!{projectRoot}/tsconfig.spec.json"
]
}
}
# Run affected tests
nx affected:test
# Build specific project
nx build my-app
# Run task graph
nx graph
# Generate new library
nx generate @nx/js:library shared-utils
// gulpfile.js
const gulp = require('gulp');
const sass = require('gulp-sass')(require('sass'));
const autoprefixer = require('gulp-autoprefixer');
const cleanCSS = require('gulp-clean-css');
const terser = require('gulp-terser');
const imagemin = require('gulp-imagemin');
const del = require('del');
// Clean
gulp.task('clean', () => del(['dist']));
// Styles
gulp.task('styles', () =>
gulp.src('src/styles/**/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(autoprefixer())
.pipe(cleanCSS())
.pipe(gulp.dest('dist/css'))
);
// Scripts
gulp.task('scripts',
gulp.()
.(())
.(gulp.())
);
gulp.(,
gulp.()
.(())
.(gulp.())
);
gulp.(, {
gulp.(, gulp.());
gulp.(, gulp.());
gulp.(, gulp.());
});
gulp.(, gulp.(
,
gulp.(, , )
));
gulp.(, gulp.(, ));
// lint-staged.config.js
module.exports = {
'*.{js,jsx,ts,tsx}': [
'eslint --fix',
'prettier --write',
'vitest related --run',
],
'*.{json,md,yml,yaml}': [
'prettier --write',
],
'*.css': [
'stylelint --fix',
'prettier --write',
],
};
# .github/workflows/ci.yml
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type check
run: npm run type-check
- name: Test
run: npm run