workflow-automation by akillness/oh-my-skills
npx skills add https://github.com/akillness/oh-my-skills --skill workflow-automationpackage.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"
}
}
Makefile:
.PHONY: help install dev build test clean docker
.DEFAULT_GOAL := help
help: ## 显示此帮助信息
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## 安装依赖
npm install
dev: ## 启动开发服务器
npm run dev
build: ## 构建生产版本
npm run build
test: ## 运行所有测试
npm test
lint: ## 运行代码检查
npm run lint
lint-fix: ## 修复代码检查问题
npm run lint:fix
clean: ## 清理构建产物
rm -rf dist coverage
docker-build: ## 构建 Docker 镜像
docker build -t myapp:latest .
docker-run: ## 运行 Docker 容器
docker run -d -p 3000:3000 --name myapp myapp:latest
deploy: build ## 部署到生产环境
@echo "Deploying to production..."
./scripts/deploy.sh production
ci: lint test build ## 本地运行 CI 流水线
@echo "✅ CI pipeline passed!"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
用法:
make help # 显示所有命令
make dev # 启动开发
make ci # 本地运行完整 CI
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..."
# 检查暂存文件
npx lint-staged
# 类型检查
npm run type-check
# 运行与更改文件相关的测试
npm test -- --onlyChanged
echo "✅ Pre-commit checks passed!"
scripts/dev-setup.sh:
#!/bin/bash
set -e
echo "🚀 Setting up development environment..."
# 检查先决条件
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
# 安装依赖
echo "📦 Installing dependencies..."
npm install
# 复制环境文件
if [ ! -f .env ]; then
echo "📄 Creating .env file..."
cp .env.example .env
echo "⚠️ Please update .env with your configuration"
fi
# 启动 Docker 服务
echo "🐳 Starting Docker services..."
docker-compose up -d
# 等待数据库
echo "⏳ Waiting for database..."
./scripts/wait-for-it.sh localhost:5432 --timeout=30
# 运行数据库迁移
echo "🗄️ Running database migrations..."
npm run migrate
# 填充数据(可选)
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..."
# 构建
echo "📦 Building application..."
npm run build
# 运行测试
echo "🧪 Running tests..."
npm test
# 根据环境部署
if [ "$ENV" == "production" ]; then
echo "🌍 Deploying to production..."
# 生产环境部署逻辑
ssh production "cd /app && git pull && npm install && npm run build && pm2 restart all"
elif [ "$ENV" == "staging" ]; then
echo "🧪 Deploying to staging..."
# 预发布环境部署逻辑
ssh staging "cd /app && git pull && npm install && npm run build && pm2 restart all"
fi
echo "✅ Deployment to $ENV completed!"
.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
project/
├── scripts/
│ ├── dev-setup.sh
│ ├── deploy.sh
│ ├── test.sh
│ └── cleanup.sh
├── Makefile
├── package.json
└── .husky/
├── pre-commit
└── pre-push
-- 当前版本:1.0.0 -- 最后更新:2025-01-01 -- 兼容平台:Claude, ChatGPT, Gemini
#automation #scripts #workflow #npm-scripts #Makefile #utilities
每周安装数
1
代码仓库
GitHub 星标数
3
首次出现
1 天前
安全审计
安装于
mcpjam1
claude-code1
junie1
windsurf1
zencoder1
crush1
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"
}
}
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!"
Usage :
make help # Show all commands
make dev # Start development
make ci # Run full CI locally
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!"
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!"
.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
project/
├── scripts/
│ ├── dev-setup.sh
│ ├── deploy.sh
│ ├── test.sh
│ └── cleanup.sh
├── Makefile
├── package.json
└── .husky/
├── pre-commit
└── pre-push
-- Current version : 1.0.0 -- Last updated : 2025-01-01 -- Compatible platforms : Claude, ChatGPT, Gemini
#automation #scripts #workflow #npm-scripts #Makefile #utilities
Weekly Installs
1
Repository
GitHub Stars
3
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
mcpjam1
claude-code1
junie1
windsurf1
zencoder1
crush1
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
150,000 周安装