safe-agentic-workflow / rules
Cursor rule419 starsChanged 4 months agoMITView on GitHub
Git branch naming, commit message format, rebase-first workflow, and PR process for SAFe development. Apply to ALL git operations.
- Deletes or force-pushes
- Commits and pushes
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository60 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/00-core-principles.mdcCursor rule
- .cursor/rules/02-pattern-discovery.mdcCursor rule
- .cursor/rules/03-safe-ai-dlc.mdcCursor rule
- .cursor/rules/04-knowledge-vault.mdcCursor rule
- .cursor/rules/10-backend-python.mdcCursor rule
- .cursor/rules/11-frontend-react.mdcCursor rule
- .cursor/rules/12-database-sql.mdcCursor rule
- .cursor/rules/13-testing.mdcCursor rule
- .cursor/rules/14-spec-creation.mdcCursor rule
- .cursor/rules/15-deployment.mdcCursor rule
- .cursor/rules/16-stripe-payments.mdcCursor rule
- .cursor/rules/20-agent-architect.mdcCursor rule
- .cursor/rules/21-agent-backend.mdcCursor rule
- .cursor/rules/22-agent-qas.mdcCursor rule
- .cursor/rules/23-agent-security.mdcCursor rule
- .cursor/rules/30-background-agents.mdcCursor rule
- .cursor/rules/31-mcp-integration.mdcCursor rule
- .cursor/rules/README.mdCursor rule
- agent-coordinationSkill
- api-patternsSkill
- confluence-docsSkill
- deployment-sopSkill
- frontend-patternsSkill
- git-advancedSkill
- linear-sopSkill
- migration-patternsSkill
- orchestration-patternsSkill
- pattern-discoverySkill
- release-patternsSkill
- rls-patternsSkill
- safe-ai-dlcSkill
- safe-workflowSkill
- security-auditSkill
- spec-creationSkill
- stripe-patternsSkill
- team-coordinationSkill
- testing-patternsSkill
- vault-syncSkill
- agent-coordinationSkill
- api-patternsSkill
- confluence-docsSkill
- deployment-sopSkill
- frontend-patternsSkill
- git-advancedSkill
- linear-sopSkill
- migration-patternsSkill
- orchestration-patternsSkill
- pattern-discoverySkill
- release-patternsSkill
- rls-patternsSkill
- safe-ai-dlcSkill
- safe-workflowSkill
- security-auditSkill
- spec-creationSkill
- stripe-patternsSkill
- team-coordinationSkill
- testing-patternsSkill
- vault-syncSkill
The file
We split this 01-git-workflow.mdc into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 19
MUST start with {{TICKET_PREFIX}}-{number}
- Distinctive: line 20
Use lowercase letters and hyphens only
- Distinctive: line 21
Keep total length under 50 characters
- Distinctive: line 22
Never include personal names or dates
- Distinctive: line 82
Rebase-first: Never create merge commits.
- Very specific: line 83
Force-with-lease: Use --force-with-lease after rebase, never --force.
- Very specific: line 86
PR template: Always use .github/pull_request_template.md and fill ALL sections.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "Git branch naming, commit message format, rebase-first workflow, and PR process for SAFe development. Apply to ALL git operations."
alwaysApply: true
---
# Git Workflow
This project enforces a **rebase-first workflow** validated by CI/CD automation. See `CONTRIBUTING.md` for the full guide.
## Branch Naming
**Required format:** `{{TICKET_PREFIX}}-{number}-{short-description}`
Examples:
- `{{TICKET_PREFIX}}-42-add-user-authentication`
- `{{TICKET_PREFIX}}-57-fix-profile-image-upload`
Rules:
- MUST start with `{{TICKET_PREFIX}}-{number}`
- Use lowercase letters and hyphens only
- Keep total length under 50 characters
- Never include personal names or dates
- CI will reject branches that do not follow this format
## Commit Message Format
**Required format:** `type(scope): description [{{TICKET_PREFIX}}-XXX]`
### Types
- `feat` -- New feature
- `fix` -- Bug fix
- `docs` -- Documentation changes
- `style` -- Code formatting (no logic changes)
- `refactor` -- Code restructuring
- `test` -- Adding or updating tests
- `chore` -- Maintenance tasks, dependencies
- `ci` -- CI/CD pipeline changes
### Scopes (optional)
- `payments`, `auth`, `ui`, `api`, `db`, `scheduler`, `security`, `cursor`
### Examples
```
feat(payments): add Stripe checkout integration [{{TICKET_PREFIX}}-42]
fix(auth): resolve login redirect issue [{{TICKET_PREFIX}}-57]
docs: update API documentation [{{TICKET_PREFIX}}-123]
```
CI will reject commits that do not include a ticket reference.
## Workflow Steps
```bash
# 1. Start from latest base branch
git checkout {{MAIN_BRANCH}}
git pull origin {{MAIN_BRANCH}}
git checkout -b {{TICKET_PREFIX}}-{number}-{description}
# 2. Make changes and commit
git add <files>
git commit -m "feat(scope): description [{{TICKET_PREFIX}}-XXX]"
# 3. Keep branch updated (rebase, NEVER merge)
git fetch origin
git rebase origin/{{MAIN_BRANCH}}
# 4. Validate before pushing
# Run: {{CI_VALIDATE_COMMAND}}
# 5. Push
git push --force-with-lease origin {{TICKET_PREFIX}}-{number}-{description}
# 6. Create PR using .github/pull_request_template.md
# 7. Merge using "Rebase and merge" ONLY (never squash or merge commit)
```
## Rules
- **Rebase-first**: Never create merge commits. Always rebase onto the base branch.
- **Force-with-lease**: Use `--force-with-lease` after rebase, never `--force`.
- **Linear history**: The project requires a clean linear commit history.
- **One ticket per branch**: Each branch maps to exactly one project management ticket.
- **PR template**: Always use `.github/pull_request_template.md` and fill ALL sections.
## Role Collapsing
- **RTE** role is collapsible (PR creation can be done by implementer)
- **QAS** role is NOT collapsible (independence gate)
- **SecEng** role is NOT collapsible (security audit requires independence)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

