forked from cleveragents/cleveragents-core
feat: add more tested common patterns to reduce agent discovery time
- Add Git push conflict handling patterns (tested) - Add PR number extraction patterns (tested) - Document these patterns agents frequently need - Keep branch protection as untested pattern These patterns save time for agents that work with git and PRs.
This commit is contained in:
@@ -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 <branch> && 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 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+)'
|
||||
```
|
||||
Reference in New Issue
Block a user