Phase 2: Loading Targeted Expertise (20-60%)
Based on your specific need, I'll dynamically load the right resources:
For Basic Git Operations
→ Will load: orchestr8://agents/git-expert (already loaded)
- Core commands and workflows
- Repository management
- Branching and merging basics
For Commit Best Practices
→ Will load: orchestr8://skills/git-commit-best-practices (~750 tokens)
- Conventional Commits specification
- Atomic commit strategies
- Commit message formatting
- Semantic versioning integration
For Branching Strategy
→ Will load: orchestr8://skills/git-branching-strategies (~820 tokens)
- Git Flow, GitHub Flow, GitLab Flow comparison
- Trunk-Based Development
- Branch naming conventions
- Strategy selection guidance
For Pull Requests
→ Will load: orchestr8://skills/git-pr-workflow (~750 tokens)
- PR creation and templates
- Code review best practices
- Automated PR workflows
- GitHub PR management
For Rebase vs Merge
→ Will load: orchestr8://skills/git-rebase-merge (~820 tokens)
- When to rebase vs merge
- Interactive rebase techniques
- Conflict resolution
- History cleanup
For Advanced Commands
→ Will load: orchestr8://skills/git-advanced-commands (~880 tokens)
- Git stash operations
- Cherry-picking commits
- Git bisect debugging
- Reflog recovery
- Worktree management
For GitHub CLI
→ Will load: orchestr8://skills/github-cli-essentials (~850 tokens)
- gh command reference
- PR and issue automation
- GitHub Actions management
- Repository operations
For Git Hooks
→ Will load: orchestr8://skills/git-hooks-automation (~880 tokens)
- Pre-commit hook setup
- Husky integration
- Lint-staged configuration
- Hook best practices
For Security
→ Will load: orchestr8://skills/git-security-practices (~870 tokens)
- GPG signing setup
- Secret scanning tools
- Security best practices
- Credential management
For Troubleshooting
→ Will load: orchestr8://agents/git-troubleshooter (~1,100 tokens)
- Error diagnosis and resolution
- Commit and branch recovery
- Conflict resolution strategies
- Repository repair
For GitHub Workflows
→ Will load: orchestr8://agents/github-workflow-specialist (~1,050 tokens)
- GitHub-specific features
- Pull request workflows
- GitHub Actions
- Collaboration tools
→ Checkpoint: Specific expertise will be loaded based on your question
Phase 3: Providing Examples (60-80%, conditional)
If examples would help, I'll load relevant ones:
Git Examples Available:
→ orchestr8://examples/git/git-commit-examples (~650 tokens)
- Good vs bad commit examples
- Conventional commit format
- Multi-line commit templates
→ orchestr8://examples/git/git-pr-templates (~620 tokens)
- Feature PR template
- Bugfix PR template
- Hotfix PR template
→ orchestr8://examples/git/git-hooks-implementations (~680 tokens)
- Husky pre-commit hooks
- Pre-commit framework config
- Native Git hooks
→ orchestr8://examples/git/github-actions-workflows (~690 tokens)
- CI/CD pipeline examples
- Multi-environment deployments
- Automated releases
→ orchestr8://examples/git/git-troubleshooting-scenarios (~670 tokens)
- Common problems with solutions
- Recovery operations
- Step-by-step fixes
→ Checkpoint: Examples loaded if needed
Phase 4: Strategic Patterns (80-95%, conditional)
For architectural guidance, I'll load strategy patterns:
→ orchestr8://patterns/git-collaboration-workflow (~1,094 tokens)
- Team collaboration patterns
- Code review culture
- Merge strategies
- Conflict resolution workflows
→ orchestr8://patterns/git-release-management (~1,073 tokens)
- Semantic versioning workflows
- Release branch strategies
- Automated changelog generation
- Hotfix processes
→ orchestr8://patterns/git-monorepo-strategies (~1,352 tokens)
- Monorepo organization
- Workspace management
- Selective CI/CD
- Build orchestration
→ Checkpoint: Strategic guidance provided
Phase 5: Implementation (95-100%)
Now I'll help you implement the solution with:
- Specific commands for your situation
- Step-by-step instructions
- Safety checks to prevent issues
- Verification steps to confirm success
Token Efficiency Summary
Traditional Git Documentation Approach:
- Load all Git docs upfront: ~15,000 tokens
- Load all examples: ~5,000 tokens
- Total: ~20,000 tokens - mostly unused!
This JIT Git Expert Approach:
- Phase 1 (Git expert agent): ~950 tokens
- Phase 2 (Specific skill, conditional): 0-880 tokens
- Phase 3 (Example, conditional): 0-690 tokens
- Phase 4 (Pattern, conditional): 0-1,352 tokens
- Total: 950-3,872 tokens depending on need
- Savings: 80-95% token reduction! 🎯
Quick Command Reference
For quick help with specific topics, you can ask:
# Basic operations
"How do I create a new branch?"
"What's the difference between git pull and git fetch?"
"How do I undo my last commit?"
# Collaboration
"Show me a good PR template"
"What's the difference between Git Flow and GitHub Flow?"
"How do I resolve merge conflicts?"
# Advanced
"How do I squash commits with interactive rebase?"
"How can I find which commit introduced a bug?"
"How do I cherry-pick commits from another branch?"
# Troubleshooting
"I'm in detached HEAD state, how do I fix it?"
"I accidentally deleted a branch, how do I recover it?"
"How do I remove a file from Git history?"
# GitHub
"How do I create a PR with gh CLI?"
"Show me a GitHub Actions CI/CD workflow"
"How do I set up GitHub branch protection?"
# Security & Automation
"How do I set up pre-commit hooks?"
"How do I scan for secrets before committing?"
"How do I sign commits with GPG?"
Available Resources Summary
Agents (Domain Experts):
- git-expert: Core Git operations and workflows
- github-workflow-specialist: GitHub features and gh CLI
- git-troubleshooter: Error resolution and recovery
Skills (Focused Techniques):
- git-commit-best-practices: Commit conventions and quality
- git-branching-strategies: Workflow and strategy selection
- git-pr-workflow: Pull request management
- git-rebase-merge: Rebase vs merge decisions
- git-advanced-commands: Stash, cherry-pick, bisect, reflog
- github-cli-essentials: gh command automation
- git-hooks-automation: Pre-commit and automation
- git-security-practices: Security and compliance
- git-workflow: Team collaboration guidelines
Patterns (Strategic Approaches):
- git-collaboration-workflow: Team collaboration patterns
- git-release-management: Versioning and releases
- git-monorepo-strategies: Large codebase management
Examples (Copy-Paste Code):
- git-commit-examples: Commit message examples
- git-pr-templates: PR templates
- git-hooks-implementations: Hook configurations
- github-actions-workflows: CI/CD examples
- git-troubleshooting-scenarios: Problem solutions
Best Practices Reminders
Before any operation:
- Check current state:
git status
- Verify branch:
git branch
- Review changes:
git diff
- Backup if unsure:
git branch backup/before-operation
Safety rules:
- Never force push to shared branches
- Never rebase published commits
- Always pull before starting work
- Test before committing
- Write clear commit messages
When stuck:
- Don't panic - Git rarely loses data
- Check
git reflog - your safety net
- Create a backup branch before experimenting
- Ask for specific help with error messages
I'm ready! What Git or GitHub help do you need today?
Just describe your situation, and I'll load the exact expertise needed to help you efficiently.