xiaohongshu
xiaohongshu
git-ci-cd-manager
Automate Git workflow with conventional commits, setup GitHub Actions CI/CD, configure Husky hooks, manage PR automation, and handle semantic releases
Full skill instructions
Expert skill for automating Git workflows, setting up CI/CD pipelines, managing conventional commits, and implementing release automation. Specializes in GitHub Actions, Husky hooks, semantic versioning, and PR management.
Configure Git
Install Tools
Create Templates
Create Workflows
Configure Secrets
Set Up Environments
Configure Hooks
Set Up PR Automation
Release Automation
<type>(<scope>): <subject>
<body>
<footer>
| Type | Description | Version Bump |
|---|---|---|
feat | New feature | Minor (0.x.0) |
fix | Bug fix | Patch (0.0.x) |
docs | Documentation only | None |
style | Code style (formatting, etc.) | None |
refactor | Code refactoring | None |
perf | Performance improvement | Patch |
test | Add or update tests | None |
chore | Maintenance tasks | None |
ci | CI/CD changes | None |
build | Build system changes | None |
revert | Revert previous commit | Depends |
# Feature with scope
feat(button): add loading state
Adds isLoading prop to Button component
Shows spinner when loading is true
Closes #123
# Breaking change
feat(forms)!: change validation API
BREAKING CHANGE: The validateForm function now returns a Promise
instead of synchronous validation result.
Migration guide available at docs/migration/v2.md
# Bug fix
fix(input): prevent double onChange call
Fixed issue where onChange was called twice on blur
Fixes #456
# Multiple changes
feat(components): add new Card variants
- Add 'elevated' variant with shadow
- Add 'outlined' variant with border
- Update Storybook stories
# Simple fix
fix: typo in README
# Run commitizen
npm run commit
# Interactive prompts:
? Select the type of change: feat
? What is the scope?: button
? Write a short description: add loading state
? Provide a longer description: (press enter to skip)
? Are there any breaking changes? No
? Does this change affect any open issues? Yes
? Add issue references: Closes #123
# Generated commit:
feat(button): add loading state
Closes #123
# .github/workflows/test.yml
name: Test
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
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
if: matrix.node-version == '20.x'
with:
file: ./coverage/lcov.info
fail_ci_if_error: true
build:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Check bundle size
run: npm run size-check
# .github/workflows/release.yml
name: Release
on:
push:
branches: [main]
permissions:
contents: write
issues: write
pull-requests: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
# .github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
inputs:
environment:
description: 'Environment to deploy to'
required: true
type: choice
options:
- staging
- production
jobs:
deploy-staging:
if: github.event_name == 'push' || github.event.inputs.environment == 'staging'
runs-on: ubuntu-latest
environment:
name: staging
url: https://staging.example.com
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
NODE_ENV: production
VITE_API_URL: ${{ secrets.STAGING_API_URL }}
- name: Deploy to Staging
run: npm run deploy:staging
env:
DEPLOY_TOKEN: ${{ secrets.STAGING_DEPLOY_TOKEN }}
deploy-production:
if: github.event.inputs.environment == 'production'
runs-on: ubuntu-latest
environment:
name: production
url: https://example.com
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
NODE_ENV: production
VITE_API_URL: ${{ secrets.PRODUCTION_API_URL }}
- name: Deploy to Production
run: npm run deploy:production
env:
DEPLOY_TOKEN: ${{ secrets.PRODUCTION_DEPLOY_TOKEN }}
- name: Notify Slack
if: success()
uses: slackapi/slack-github-action@v1
with:
payload: |
{
"text": "🚀 Production deployment successful!"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
# .github/workflows/pr-automation.yml
name: PR Automation
on:
pull_request:
types: [opened, edited, synchronize]
permissions:
contents: read
pull-requests: write
jobs:
auto-label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Label based on size
uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/xs'
xs_max_size: '10'
s_label: 'size/s'
s_max_size: '100'
m_label: 'size/m'
m_max_size: '500'
l_label: 'size/l'
l_max_size: '1000'
xl_label: 'size/xl'
- name: Label based on files
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
auto-assign:
runs-on: ubuntu-latest
steps:
- name: Auto-assign reviewers
uses: kentaro-m/auto-assign-action@v1
with:
configuration-path: .github/auto-assign.yml
# Install Husky
npm install --save-dev husky
# Initialize Husky
npx husky init
# Creates .husky/ directory with pre-commit hook
# .husky/pre-commit
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Run lint-staged
npx lint-staged
# Run type check (optional, can be slow)
# npm run type-check
# .husky/commit-msg
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Validate commit message with commitlint
npx --no -- commitlint --edit $1
# .husky/pre-push
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Run tests before push
npm test
# Check if build succeeds
npm run build
# .husky/post-merge
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# Check if package.json changed
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
if echo "$changed_files" | grep --quiet "package.json"; then
echo "📦 package.json changed, running npm install..."
npm install
fi
// commitlint.config.js
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat', // New feature
'fix', // Bug fix
'docs', // Documentation
'style', // Formatting
'refactor', // Code refactoring
'perf', // Performance
'test', // Tests
'chore', // Maintenance
'ci', // CI/CD
'build', // Build system
'revert', // Revert commit
],
],
'scope-enum': [
2,
'always',
[
'button',
'input',
'modal',
'form',
'layout',
'theme',
'deps',
'config',
// Add your component scopes
],
],
'subject-case': [2, 'always', 'lower-case'],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'body-leading-blank': [2, 'always'],
'footer-leading-blank': [2, 'always'],
'header-max-length': [2, 'always', 100],
},
}
// lint-staged.config.js
module.exports = {
'*.{ts,tsx}': [
'eslint --fix',
'prettier --write',
// Type check only staged files (faster than full type check)
() => 'tsc --noEmit',
],
'*.{js,jsx}': ['eslint --fix', 'prettier --write'],
'*.{json,md,yml,yaml}': ['prettier --write'],
'*.{css,scss}': ['stylelint --fix', 'prettier --write'],
// Run tests for changed files
'*.{ts,tsx,js,jsx}': ['npm test -- --findRelatedTests --passWithNoTests'],
}
// release.config.js
module.exports = {
branches: ['main'],
plugins: [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/changelog',
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
assets: ['package.json', 'CHANGELOG.md'],
message:
'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}',
},
],
],
}
# .github/labeler.yml
'type: feature':
- 'src/**/*.{ts,tsx}'
'type: fix':
- 'src/**/*.{ts,tsx}'
'type: docs':
- '*.md'
- 'docs/**/*'
'type: tests':
- '**/*.test.{ts,tsx}'
- '**/*.spec.{ts,tsx}'
'type: ci':
- '.github/**/*'
'area: components':
- 'src/components/**/*'
'area: utils':
- 'src/utils/**/*'
'area: styles':
- 'src/styles/**/*'
- '**/*.css'
- '**/*.scss'
# .github/auto-assign.yml
addReviewers: true
addAssignees: false
reviewers:
- reviewer1
- reviewer2
- reviewer3
numberOfReviewers: 2
# Assign based on file patterns
filePathAssignments:
- patterns:
- 'src/components/**'
reviewers:
- component-expert
- patterns:
- '**/*.test.ts'
reviewers:
- testing-expert
{
"scripts": {
"commit": "cz",
"prepare": "husky",
"lint": "eslint src --ext .ts,.tsx",
"lint:fix": "eslint src --ext .ts,.tsx --fix",
"type-check": "tsc --noEmit",
"test": "vitest",
"test:ci": "vitest run --coverage",
"build": "tsup",
"build:check": "npm run build && npm run size-check",
"size-check": "size-limit",
"release": "semantic-release",
"release:dry": "semantic-release --dry-run"
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
}
}
<!-- .github/pull_request_template.md -->
## Description
<!-- Describe your changes in detail -->
## Type of Change
<!-- Mark with an 'x' -->
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] 📝 Documentation update
- [ ] 🎨 Style update (formatting, renaming)
- [ ] ♻️ Code refactoring (no functional changes)
- [ ] ⚡ Performance improvement
- [ ] ✅ Test update
- [ ] 🔧 Chore (updating build tasks, package manager configs, etc)
## Related Issues
<!-- Link related issues here -->
Closes #
Related to #
## Checklist
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published
## Screenshots (if applicable)
<!-- Add screenshots here -->
## Additional Notes
<!-- Any additional information -->
# Recommended settings for main branch:
Required status checks:
- Test (Node 18.x)
- Test (Node 20.x)
- Build
- Lint
Require branches to be up to date before merging: ✓
Require pull request reviews:
- Required approving reviews: 1
- Dismiss stale reviews: ✓
- Require review from Code Owners: ✓
Require signed commits: ✓ (optional)
Include administrators: ✓
Restrict who can push: Admins only
feature/add-button-component, fix/modal-close-bug, docs/update-readme# Reinstall Husky
rm -rf .husky
npx husky init
# Re-add hooks
npm run prepare
# Check Git hooks directory
ls -la .git/hooks/
# Test commit message
echo "feat: add new feature" | npx commitlint
# Check configuration
npx commitlint --print-config
# Common issues:
# - Wrong type (use feat, fix, docs, etc.)
# - Missing scope when required
# - Subject in wrong case
# - Subject ends with period
# Test workflow locally
npm install -g act
act -l # List workflows
act # Run workflows
# Common issues:
# - Missing secrets
# - Wrong Node version
# - Dependencies not cached
# - Environment variables not set
# Dry run to see what would be released
npm run release:dry
# Common issues:
# - No conventional commits since last release
# - NPM_TOKEN not set
# - Wrong branch (must be main/master)
# - No permissions to publish
Activate this skill when you need to:
When setting up Git automation, provide:
Always create production-ready, well-documented Git automation that follows industry best practices and security guidelines.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience