Example input
[
"project_type": web/mobile/enterprise/etc.,
"team_size": number of developers,
"deployment_frequency": continuous/weekly/monthly,
"current_challenges": describe current git-related issues]: Project Context: - Large-scale e-commerce platform built with microservices architecture - Development team of 45 engineers across 6 squads - Daily deployments to production - Current challenges include slow CI pipeline and frequent merge conflicts between squads
[
"branching_needs": feature/release/hotfix patterns,
"environment_count": dev/staging/prod/etc.,
"automation_level": CI/CD details,
"compliance_requirements": any specific regulations]: Workflow Requirements: - Need feature branching strategy for parallel development - Managing 4 environments: dev, staging, pre-prod, production - Using Jenkins for CI/CD with automated testing - SOC 2 compliance requirements for all code changes
[
"git_hosting": GitHub/GitLab/Bitbucket/etc.,
"integration_tools": Jenkins/Circle CI/etc.,
"access_control": permission requirements,
"repository_size": size and complexity details]: Technical Constraints: - GitHub Enterprise with self-hosted runners - Integration with Jira and Confluence - Role-based access control needed for different teams - Multiple repositories totaling 2.5M lines of code
[
"git_proficiency": beginner/intermediate/advanced,
"workflow_familiarity": current process knowledge,
"training_needs": areas requiring guidance
"collaboration_patterns": how teams work together]: Team Expertise: - Mixed experience levels, 60% senior developers - Teams familiar with basic Git flow - Need training on advanced conflict resolution - Cross-squad collaboration requires coordination
Example output
# Git Strategy Implementation Plan: E-commerce Platform
## Executive Summary
Based on the analysis of your large-scale e-commerce platform's requirements, we recommend implementing a modified trunk-based development approach with short-lived feature branches. This strategy will support your microservices architecture, accommodate the needs of your six squads, and maintain SOC 2 compliance while optimizing for daily deployments.
## Branching Strategy
### Model Selection & Rationale
We recommend adopting a trunk-based development model with the following modifications to support your scale:
- Main branch (`main`) serves as the single source of truth
- Short-lived feature branches (lifetime < 24 hours)
- Protected release branches for each environment
- Hotfix branches with expedited review process
### Branch Types & Purposes
1. Main Branch (`main`)
- Source of truth for all deployments
- Always deployable to production
- Protected from direct commits
2. Feature Branches (`feature/squad-name/JIRA-ID-description`)
- Created for each development task
- Merged within 24 hours
- Automatically deleted after merge
3. Environment Branches
- `release/dev`
- `release/staging`
- `release/pre-prod`
- `release/prod`
### Protection Rules
- All merges require approved pull requests
- Status checks must pass before merge
- Linear history enforced through rebase
- Branch protection patterns:
```
main
release/*
```
## Workflow Configuration
### Code Review Process
1. Automated code owners assignment based on squad ownership
2. Minimum two approvals required for merge
3. Squad lead approval mandatory for cross-squad changes
4. Automated assignment of reviewers based on code expertise
### Automation Rules
1. Pre-commit Hooks
- Lint checking
- Secret detection
- Conventional commit message enforcement
2. CI Pipeline Optimization
- Parallel test execution
- Incremental builds
- Caching of dependencies
- Squad-specific test segregation
### Quality Gates
1. Automated Checks
- Unit test coverage (minimum 80%)
- Integration test suite
- Security scanning
- SOC 2 compliance validation
2. Manual Checks
- Product owner sign-off for feature completion
- Security review for sensitive changes
- Architecture review for cross-service changes
## Security Implementation
### Access Control Matrix
- Squad Members
- Read/write access to their service repositories
- Read access to dependent services
- Squad Leads
- Admin access to squad repositories
- Write access to dependent services
- Platform Team
- Admin access across all repositories
- External Collaborators
- Read-only access with explicit approval
### Compliance Measures
1. Audit Trail Requirements
- Signed commits mandatory
- Detailed merge commit messages
- Automated changelog generation
- Retention of all CI/CD logs
2. SOC 2 Controls
- Automated security scanning
- Regular access review
- Change management documentation
- Incident response procedures
## Performance Optimization
### Repository Structure
1. Monorepo Strategy per Squad
- Separate repositories for each squad's services
- Shared libraries in dedicated repositories
- Automated dependency management
2. Large File Handling
- Git LFS for binary assets
- Exclude build artifacts
- Regular repository cleanup
### CI/CD Optimization
1. Jenkins Pipeline Improvements
- Parallel execution across squads
- Incremental testing
- Caching strategies
- Resource allocation per squad
## Training & Documentation
### Priority Training Areas
1. Advanced Git Operations
- Conflict resolution workshops
- Rebase vs. merge strategies
- Git hooks development
- Troubleshooting sessions
2. Squad Lead Training
- Code review best practices
- Branch management
- Security protocols
- Compliance requirements
### Documentation Requirements
1. Technical Guides
- Git workflow procedures
- CI/CD pipeline documentation
- Security protocols
- Troubleshooting guides
2. Process Documentation
- Code review guidelines
- Release procedures
- Emergency protocols
- Cross-squad collaboration
## Implementation Timeline
### Phase 1: Foundation (Weeks 1-2)
- Set up branch protection rules
- Configure CI/CD pipelines
- Implement basic automation
### Phase 2: Security & Compliance (Weeks 3-4)
- Deploy access control matrix
- Implement audit trails
- Configure compliance checks
### Phase 3: Training & Rollout (Weeks 5-6)
- Conduct training sessions
- Begin phased implementation
- Monitor and adjust
### Phase 4: Optimization (Weeks 7-8)
- Fine-tune CI/CD performance
- Optimize repository structure
- Implement advanced automation
## Risk Mitigation
### Identified Risks
1. Initial Productivity Impact
- Mitigation: Phased rollout and comprehensive training
2. CI/CD Pipeline Performance
- Mitigation: Incremental optimization and parallel execution
3. Cross-squad Coordination
- Mitigation: Clear documentation and communication channels
4. Compliance Adherence
- Mitigation: Automated compliance checks and regular audits
## Success Metrics
### Primary Metrics
1. Development Velocity
- Time to merge (target: <4 hours)
- Pipeline execution time (target: <20 minutes)
- Deployment frequency (target: 5+ per day)
2. Code Quality
- Reduction in merge conflicts (target: 50%)
- Test coverage (target: >80%)
- Successful deployment rate (target: >99%)
### Monitoring Plan
- Weekly metrics review
- Monthly strategy adjustment
- Quarterly compliance audit
- Continuous feedback collection
This strategy provides a robust foundation for scaling your development operations while maintaining security and compliance requirements. Regular reviews and adjustments will ensure continued effectiveness as your team grows and evolves.