From 078bf9f4187269eb63669e080d6f8e3759d9a5f0 Mon Sep 17 00:00:00 2001 From: Reza Rezvani Date: Wed, 12 Nov 2025 12:59:58 +0100 Subject: [PATCH 1/7] fix(ci): add missing PR template enhancements - Add CI/CD workflow change type - Expand checklist with quality gates sections - Add Conventional Commits and branch naming reminders - Better organize code quality, docs, testing, CI/CD sections This file was modified in Phase 2 but accidentally not staged. --- .github/PULL_REQUEST_TEMPLATE.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 51409cb..87cfa7f 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -13,10 +13,14 @@ Provide a clear and concise description of your changes. - [ ] Code refactoring - [ ] Performance improvement - [ ] Test addition/improvement +- [ ] CI/CD workflow change ## Related Issues -Fixes #(issue_number) + + +Closes #(issue_number) + ## Changes Made @@ -45,13 +49,31 @@ Add screenshots to help explain your changes. ## Checklist +### Code Quality - [ ] My code follows the project's style guidelines +- [ ] Python syntax is valid (if applicable) +- [ ] Bash scripts have valid syntax (if applicable) +- [ ] Markdown files are properly formatted +- [ ] No hardcoded secrets or sensitive data - [ ] I have commented my code where necessary + +### Documentation - [ ] I have updated the documentation (if needed) -- [ ] I have updated CHANGELOG.md with my changes -- [ ] My changes generate no new warnings +- [ ] I have updated CHANGELOG.md with my changes (for releases) +- [ ] README.md is updated if user-facing changes + +### Testing - [ ] I have tested my changes thoroughly -- [ ] All existing tests still pass +- [ ] Tested installation (./install.sh or install.ps1) +- [ ] Tested slash command (/enhance-claude-md) if applicable +- [ ] Tested guardian agent if applicable +- [ ] Tested on target environment (macOS/Linux/Windows) + +### CI/CD +- [ ] PR title follows Conventional Commits format (e.g., `feat(installer): add feature`) +- [ ] Branch name follows convention (feature/, fix/, hotfix/, etc.) +- [ ] All quality gates passing +- [ ] No merge conflicts with target branch ## Additional Notes From 60f8926bfe3df0a4e4956cb82aa719c75153a678 Mon Sep 17 00:00:00 2001 From: Reza Rezvani Date: Wed, 12 Nov 2025 13:04:23 +0100 Subject: [PATCH 2/7] docs: add comprehensive CI/CD and branching documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 3: Documentation & Branch Setup Created Documentation (1200+ lines): - GITHUB_WORKFLOWS.md: Complete reference for all 5 workflows and 4 composite actions - Detailed explanations of bootstrap, pr-into-dev, dev-to-main, release workflows - Quality gates documentation (Python, Markdown, Bash, secrets) - Troubleshooting guide for common workflow issues - Configuration examples and customization options - BRANCHING_STRATEGY.md: Standard branching model documentation - feature/* → dev → main flow explained - Branch protection configuration guide - Conventional Commits format with examples - Git commands cheat sheet - Common scenarios and best practices - Merge strategy (squash merges) Updated README.md: - Added CI/CD and Quality Gates badges - Added links to new workflow and branching docs - Better documentation table organization Branch Setup: - Created and pushed dev branch - Ready for branch protection configuration Next: Phase 4 (Claude Code slash commands for GitHub workflows) --- README.md | 4 + docs/BRANCHING_STRATEGY.md | 742 +++++++++++++++++++++++++++++++++++++ docs/GITHUB_WORKFLOWS.md | 628 +++++++++++++++++++++++++++++++ 3 files changed, 1374 insertions(+) create mode 100644 docs/BRANCHING_STRATEGY.md create mode 100644 docs/GITHUB_WORKFLOWS.md diff --git a/README.md b/README.md index 2b9cc82..c18f32d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/alirezarezvani/ClaudeForge/releases) [![Claude Code](https://img.shields.io/badge/Claude_Code-2.0%2B-purple.svg)](https://claude.com/claude-code) +[![CI/CD](https://img.shields.io/badge/CI/CD-GitHub_Actions-2088FF.svg)](https://github.com/alirezarezvani/ClaudeForge/actions) +[![Quality Gates](https://img.shields.io/badge/Quality_Gates-Automated-success.svg)](docs/GITHUB_WORKFLOWS.md) ClaudeForge is a comprehensive toolkit that eliminates the tedious process of manually creating and maintaining CLAUDE.md files. With intelligent analysis, automated generation, and background maintenance, your CLAUDE.md files stay perfectly synchronized with your codebase. @@ -148,6 +150,8 @@ That's it! The command will: | [Quick Start Guide](docs/QUICK_START.md) | 5-minute tutorial to get started | | [Installation Guide](docs/INSTALLATION.md) | Detailed installation instructions and troubleshooting | | [Architecture Overview](docs/ARCHITECTURE.md) | How components work together | +| [GitHub Workflows](docs/GITHUB_WORKFLOWS.md) | CI/CD automation and quality gates | +| [Branching Strategy](docs/BRANCHING_STRATEGY.md) | Branch flow and protection rules | | [Troubleshooting](docs/TROUBLESHOOTING.md) | Common issues and solutions | | [Contributing Guide](docs/CONTRIBUTING.md) | How to contribute to ClaudeForge | diff --git a/docs/BRANCHING_STRATEGY.md b/docs/BRANCHING_STRATEGY.md new file mode 100644 index 0000000..c381457 --- /dev/null +++ b/docs/BRANCHING_STRATEGY.md @@ -0,0 +1,742 @@ +# Branching Strategy + +ClaudeForge uses a **Standard Branching Strategy** with protected branches and automated quality gates. + +## Overview + +``` +feature/*, fix/*, hotfix/* → dev → main + ↓ ↓ ↓ + Development Testing Production +``` + +**Three permanent branches:** +- `main` - Production-ready code, always deployable +- `dev` - Integration branch for features +- *(temporary)* - Feature, fix, and hotfix branches + +**Branch protection:** +- ✅ No direct commits to main or dev +- ✅ All changes via pull requests +- ✅ Automated quality gates required +- ✅ Conventional Commits enforced +- ✅ Linear history (squash merges) + +--- + +## Branch Types + +### Main Branch + +**Purpose:** Production-ready releases only + +**Protection Rules:** +- ✅ Require pull request before merging +- ✅ Require status checks to pass: `quality-gates`, `production-build` +- ✅ Require linear history (squash merges only) +- ✅ No force pushes +- ✅ No deletions +- ✅ Require review from CODEOWNERS + +**Who can merge:** +- Only `dev`, `release/*`, or `dependabot/*` branches +- After passing dev-to-main.yml workflow + +**Triggers:** +- dev-to-main.yml workflow on PR +- release.yml workflow for GitHub releases + +**Typical state:** +- Always matches latest GitHub release +- Only updated when releasing new version +- Every commit corresponds to a version tag (v1.0.0, v1.1.0, etc.) + +--- + +### Dev Branch + +**Purpose:** Integration branch for all features + +**Protection Rules:** +- ✅ Require pull request before merging +- ✅ Require status checks to pass: `quality-gates`, `validate-pr` +- ✅ Require linear history (squash merges only) +- ✅ No force pushes +- ✅ No deletions + +**Who can merge:** +- Feature branches (`feature/*`) +- Fix branches (`fix/*`) +- Hotfix branches (`hotfix/*`) +- Test branches (`test/*`) +- Refactor branches (`refactor/*`) +- Docs branches (`docs/*`) + +**Triggers:** +- pr-into-dev.yml workflow on PR + +**Typical state:** +- Contains completed features awaiting release +- Ahead of main by several commits +- Reset to main only after release (via merge) + +--- + +### Feature Branches + +**Naming Convention:** `feature/` + +**Purpose:** New features or enhancements + +**Examples:** +- `feature/add-rust-templates` +- `feature/vscode-extension` +- `feature/ai-suggestions` + +**Lifecycle:** +1. Create from latest `dev`: `git checkout dev && git pull && git checkout -b feature/my-feature` +2. Make changes, commit with Conventional Commits +3. Push to origin: `git push -u origin feature/my-feature` +4. Create PR to `dev` +5. Pass quality gates and code review +6. Squash merge to `dev` +7. Delete feature branch + +**PR Requirements:** +- ✅ Title must follow Conventional Commits: `feat(scope): description` +- ✅ At least one linked issue (recommended) +- ✅ All quality gates pass +- ✅ Code review approved (if CODEOWNERS configured) + +--- + +### Fix Branches + +**Naming Convention:** `fix/` + +**Purpose:** Bug fixes + +**Examples:** +- `fix/installer-windows-path` +- `fix/python-syntax-validation` +- `fix/broken-markdown-links` + +**Lifecycle:** +Same as feature branches, but: +- PR title prefix: `fix(scope): description` +- Link to bug issue with `Fixes #123` or `Closes #123` + +**PR Requirements:** +- ✅ Title: `fix(scope): description` +- ✅ Linked to bug issue +- ✅ Quality gates pass +- ✅ Test fix if applicable + +--- + +### Hotfix Branches + +**Naming Convention:** `hotfix/` + +**Purpose:** Urgent fixes for production issues + +**Examples:** +- `hotfix/critical-installer-bug` +- `hotfix/security-patch` + +**Lifecycle:** +1. Create from `dev`: `git checkout dev && git pull && git checkout -b hotfix/issue-name` +2. Make minimal fix +3. Create PR to `dev` +4. After merge to dev, immediately create PR dev → main +5. Fast-track review and merge + +**PR Requirements:** +- ✅ Title: `fix(scope): description` or `hotfix(scope): description` +- ✅ Link to critical issue +- ✅ Quality gates pass (can be expedited) +- ✅ Fast-track review + +**Special considerations:** +- Prioritize speed over perfection +- Minimal changes only +- Document reason for hotfix in PR description + +--- + +### Test Branches + +**Naming Convention:** `test/` + +**Purpose:** Testing experiments or validations + +**Examples:** +- `test/new-quality-gate` +- `test/workflow-validation` + +**Lifecycle:** +- Same as feature branches +- PR title: `test(scope): description` +- May not require linked issue + +--- + +### Refactor Branches + +**Naming Convention:** `refactor/` + +**Purpose:** Code improvements without changing functionality + +**Examples:** +- `refactor/simplify-analyzer` +- `refactor/improve-error-handling` + +**Lifecycle:** +- Same as feature branches +- PR title: `refactor(scope): description` +- Should not change external behavior + +--- + +### Docs Branches + +**Naming Convention:** `docs/` + +**Purpose:** Documentation-only changes + +**Examples:** +- `docs/update-installation-guide` +- `docs/add-troubleshooting-section` + +**Lifecycle:** +- Same as feature branches +- PR title: `docs: description` or `docs(scope): description` +- Can skip some quality gates (Python, Bash) + +--- + +## Workflow Diagrams + +### Standard Feature Flow + +``` +Developer's machine: +git checkout dev +git pull origin dev +git checkout -b feature/add-templates +# Make changes +git add . +git commit -m "feat(skill): add Rust template support" +git push -u origin feature/add-templates + +GitHub: +Create PR: feature/add-templates → dev +↓ +pr-into-dev.yml runs: +├─ Branch name validation ✅ +├─ PR title validation ✅ +├─ Linked issue check ⚠️ +├─ Quality gates ✅ +└─ Ready for review + +Code review + approval +↓ +Squash and merge to dev +↓ +Delete feature branch +``` + +### Release Flow + +``` +Dev branch ready for release: +├─ All features merged +├─ CHANGELOG.md updated +└─ Version bumped + +GitHub: +Create PR: dev → main +↓ +dev-to-main.yml runs: +├─ Source branch validation ✅ (dev allowed) +├─ CHANGELOG.md check ✅ +├─ Version consistency ✅ +├─ Quality gates ✅ +├─ Production build validation ✅ +└─ Ready for production + +Approval + merge to main +↓ +Run release.yml workflow: +├─ Input version: 1.1.0 +├─ Validate version format ✅ +├─ Extract CHANGELOG notes ✅ +├─ Create GitHub release ✅ +└─ Tag created: v1.1.0 + +Result: +├─ main branch updated +├─ GitHub release published +├─ Installable via one-line command +└─ Ready for announcements +``` + +### Hotfix Flow + +``` +Critical production bug discovered: + +Developer's machine: +git checkout dev +git pull origin dev +git checkout -b hotfix/critical-installer-bug +# Make minimal fix +git commit -m "fix(installer): resolve critical Windows path issue" +git push -u origin hotfix/critical-installer-bug + +GitHub: +Create PR: hotfix/critical-installer-bug → dev +↓ +pr-into-dev.yml runs (expedited review) +↓ +Merge to dev +↓ +Immediately create PR: dev → main +↓ +dev-to-main.yml runs (fast-track) +↓ +Merge to main +↓ +Create hotfix release: v1.0.1 +``` + +--- + +## Branch Protection Configuration + +### Configure Main Branch Protection + +1. Go to Settings → Branches → Add rule +2. Branch name pattern: `main` +3. Enable: + - ✅ Require a pull request before merging + - ✅ Require approvals: 1 (if team) + - ✅ Dismiss stale reviews + - ✅ Require review from Code Owners + - ✅ Require status checks to pass before merging + - ✅ Require branches to be up to date + - Add required checks: + - `quality-gates` + - `production-build` + - `validate-release-pr` + - ✅ Require conversation resolution before merging + - ✅ Require linear history + - ✅ Do not allow bypassing the above settings +4. Under "Rules applied to everyone including administrators": + - ✅ Restrict deletions + - ✅ Block force pushes +5. Save changes + +### Configure Dev Branch Protection + +1. Go to Settings → Branches → Add rule +2. Branch name pattern: `dev` +3. Enable: + - ✅ Require a pull request before merging + - Require approvals: 0 (can be 1 if team) + - ✅ Require status checks to pass before merging + - Add required checks: + - `quality-gates` + - `validate-pr` + - ✅ Require linear history + - ✅ Do not allow bypassing the above settings +4. Under "Rules applied to everyone including administrators": + - ✅ Restrict deletions + - ✅ Block force pushes +5. Save changes + +--- + +## Commit Message Guidelines + +ClaudeForge uses **Conventional Commits** format. + +### Format + +``` +(): + + + +