arifos-workflow-gitforge
Analyze git branch entropy and hot zones using arifOS Trinity forge. Use when the user types /gitforge, asks for branch entropy/hot zones/risk score, or wants a pre-change risk/ΔS assessment.
When & Why to Use This Skill
This Claude skill leverages the arifOS Trinity forge system to perform advanced Git branch analysis and predictive risk assessment. By calculating Entropy Delta (ΔS) and identifying codebase 'hot zones,' it provides developers with quantitative insights into the impact of their changes, ensuring high-risk commits are flagged for cooling or decomposition before they affect the main branch.
Use Cases
- Pre-merge Risk Assessment: Evaluate the complexity and potential instability of a feature branch before opening a Pull Request to prevent regressions and maintain code quality.
- Identifying Technical Debt: Automatically detect 'hot zones'—files with high churn rates—to pinpoint areas of the codebase that may require refactoring or architectural review.
- Automated Governance & Safety: Implement a 'fail-closed' workflow that halts high-entropy changes (ΔS ≥ 5.0), forcing a cooling protocol to decompose large, risky commits into smaller, manageable updates.
- Change Impact Prediction: Use the /gitforge command to get an immediate ΔS score and risk rating, helping developers decide whether to proceed with a change or seek additional human review.
| name | arifos-workflow-gitforge |
|---|---|
| master-version | "1.0.0" |
| master-source | .agent/workflows/gitforge.md |
| description | Analyze git branch entropy and hot zones using arifOS Trinity forge. Use when the user types /gitforge, asks for branch entropy/hot zones/risk score, or wants a pre-change risk/ΔS assessment. |
| - Bash(git | *) |
| - Bash(python | *) |
/gitforge — State Mapper & Entropy Predictor (arifOS)
Codex Integration
This skill uses the Trinity forge system to analyze git history and predict change impact.
Multi-Workspace Support
Works from any subfolder - automatically detects repo root.
/gitforge - State Mapper & Entropy Predictor
This workflow uses the Trinity forge.py system to analyze git history, identify hot zones, and predict entropy impact of proposed changes.
Steps
// turbo-all
Get Current Branch
git branch --show-currentCheck Uncommitted Changes
git status --shortRun Forge Analysis via Python
python -c "from arifos_core.trinity.forge import analyze_branch; import sys; branch = sys.argv[1] if len(sys.argv) > 1 else 'HEAD'; report = analyze_branch(branch); print(f'Files Changed: {len(report.files_changed)}'); print(f'Hot Zones: {report.hot_zones}'); print(f'Entropy Delta (ΔS): {report.entropy_delta:.2f}'); print(f'Risk Score: {report.risk_score:.3f}'); [print(f' {note}') for note in report.notes]" $(git branch --show-current)Show Hot Zone Details
git log -30 --name-only --pretty=format:"" | sort | uniq -c | sort -rn | head -10Compare with Main
git diff --stat main...$(git branch --show-current)
Interpretation
Entropy Delta (ΔS)
- ΔS < 3.0: Low entropy - clean, focused change
- 3.0 ≤ ΔS < 5.0: Moderate entropy - acceptable with review
- ΔS ≥ 5.0: HIGH ENTROPY - ⚠️ SABAR-72 threshold exceeded, requires cooling
Risk Score
- 0.0 - 0.3: 🟢 LOW RISK - Fast track eligible
- 0.4 - 0.6: 🟡 MODERATE RISK - Standard review
- 0.7 - 1.0: 🔴 HIGH RISK - Full cooling + human review required
Hot Zones
Files that appear ≥3 times in last 30 commits. Touching hot zones increases risk significantly.
Fail-Closed Governance
If ΔS ≥ 5.0 OR Risk Score ≥ 0.7:
- HALT further changes
- Run cooling protocol (defer, decompose, or document)
- Seek human approval before proceeding
- Log entropy event to cooling_ledger/
Next Steps
- Review hot zones and consider decomposing changes
- If high risk, initiate cooling protocol
- If low risk, proceed with confidence
Codex-Specific Implementation
Loading Canonical Workflow
arifos-safe-read --path ".agent/workflows/gitforge.md" --root "$(git rev-parse --show-toplevel)"
Output Format
Return concise report:
Branch: feature/xyz
Status: dirty (3 uncommitted files)
ΔS: 4.2
Risk Score: 0.55 🟡
Hot Zones: 2 (apex_prime.py, genius_metrics.py)
Recommendation: PROCEED with standard review
Cooling Protocol
If ΔS ≥ 5.0 or Risk ≥ 0.7, output:
🔴 COOLING REQUIRED
Options:
1. DEFER - Pause and reconsider
2. DECOMPOSE - Split into smaller changes
3. DOCUMENT - Add comprehensive CHANGELOG entry
DO NOT PROCEED without human approval.