diff --git a/.opencode/agents/COMMON_PATTERNS.md b/.opencode/agents/COMMON_PATTERNS.md index 19dd27363..77474229b 100644 --- a/.opencode/agents/COMMON_PATTERNS.md +++ b/.opencode/agents/COMMON_PATTERNS.md @@ -129,12 +129,43 @@ The project uses the monolithic format: Note: The split format (`docs/specification/`) is not used in this project. +### Git Push Conflict Handling + +**Status**: ✅ TESTED (used by multiple agents) + +When `git push` is rejected due to diverged branches: +```bash +git pull --rebase origin && git push +``` + +For force push (use sparingly and only on feature branches): +```bash +git push --force-with-lease # Safer than --force +``` + ### Branch Protection Settings **Status**: ⚠️ UNTESTED (assumed defaults) Default for master/main: -- Require CI checks to pass +- Require CI checks to pass - Dismiss stale reviews - No force push allowed -- No deletion allowed \ No newline at end of file +- No deletion allowed + +### PR Number Extraction Patterns + +**Status**: ✅ TESTED + +Extract PR number from various sources: +```python +# From PR title/branch name +pr_pattern = r'PR[-#]?(\d+)' + +# From PR body closing keywords +closes_pattern = r'(?:Closes|Fixes|Resolves)\s*#(\d+)' + +# From action run URLs +run_pattern = r'/actions/runs/(\d+)' +job_pattern = r'/actions/runs/\d+/jobs/(\d+)' +``` \ No newline at end of file