--- name: git-ci-cd-manager description: Automate Git workflow with conventional commits, setup GitHub Actions CI/CD, configure Husky hooks, manage PR automation, and handle semantic releases allowed-tools: - Read - Write - Edit - Bash - Glob - Grep - Task --- # Git & CI/CD Manager 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. ## Core Capabilities ### 1. Conventional Commits - **Commitizen**: Interactive commit message generation - **Commitlint**: Enforce commit message conventions - **Semantic Commit Types**: feat, fix, docs, style, refactor, test, chore - **Scopes**: Component-based scopes (@scope/package) - **Breaking Changes**: BREAKING CHANGE footer - **Auto-linking**: Link to issues and PRs ### 2. GitHub Actions CI/CD - **Test Pipeline**: Run tests on PR and push - **Build Pipeline**: Build and verify artifacts - **Deploy Pipeline**: Automated deployment (staging, production) - **Release Pipeline**: Automated semantic releases - **PR Automation**: Auto-label, auto-assign, auto-review - **Scheduled Jobs**: Dependency updates, security scans - **Matrix Builds**: Test across multiple Node versions, OS ### 3. Git Hooks (Husky) - **Pre-commit**: Lint staged files, run type check - **Commit-msg**: Validate commit message format - **Pre-push**: Run tests before push - **Post-merge**: Install dependencies if package.json changed - **Post-checkout**: Clean build artifacts - **Custom Hooks**: Project-specific automation ### 4. Lint-Staged - **ESLint**: Auto-fix linting errors - **Prettier**: Auto-format code - **TypeScript**: Type check only changed files - **Tests**: Run tests for changed files only - **Custom Commands**: Project-specific linting ### 5. Release Management - **Semantic Release**: Automated versioning based on commits - **Changelog Generation**: Auto-generate from commits - **Git Tags**: Create and push version tags - **NPM Publishing**: Automated package publishing - **GitHub Releases**: Create release notes - **Version Bumping**: Update package.json, lockfiles ### 6. Branch Management - **Gitflow**: Main, develop, feature, hotfix branches - **PR Templates**: Standardized PR descriptions - **Branch Protection**: Required reviews, status checks - **Auto-merge**: Merge when checks pass - **Conflict Detection**: Early conflict warnings ### 7. PR Automation - **Auto-labeling**: Based on changed files or PR title - **Auto-assignment**: Assign reviewers by code ownership - **Size Labeling**: Small, medium, large, xlarge - **Status Checks**: Required checks before merge - **Comment Templates**: Review guidelines ## Workflow ### Phase 1: Initial Setup 1. **Configure Git** - Set up user info - Configure line endings - Set up .gitignore - Configure Git aliases 2. **Install Tools** - Husky for Git hooks - Commitizen for commit messages - Commitlint for validation - Lint-staged for pre-commit - Semantic Release for automation 3. **Create Templates** - GitHub Actions workflows - PR templates - Issue templates - Contributing guidelines ### Phase 2: GitHub Actions Setup 1. **Create Workflows** - Test workflow (on PR, push) - Build workflow - Deploy workflow (staging, production) - Release workflow - Scheduled workflows 2. **Configure Secrets** - NPM_TOKEN for publishing - DEPLOY_TOKEN for deployments - Other service credentials 3. **Set Up Environments** - Staging environment - Production environment - Environment protection rules ### Phase 3: Automation 1. **Configure Hooks** - Pre-commit: lint + type check - Commit-msg: validate format - Pre-push: run tests 2. **Set Up PR Automation** - Auto-labeling workflow - Auto-assignment - Size labeling - Stale PR management 3. **Release Automation** - Semantic release configuration - Changelog generation - NPM publishing - GitHub release creation ## Conventional Commits Guide ### Commit Message Format ``` ():