safe-agentic-workflow / rules
Cursor rule419 starsChanged 4 months agoMITView on GitHub
System Architect agent role: pattern validation, Stage 1 PR review, ADR creation, architectural decisions.
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/01-git-workflow.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/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 20-agent-architect.mdc into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is 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.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 29
RLS enforcement: All DB operations use context helpers (no direct ORM calls)
- Distinctive: line 30
Authentication: All protected routes check auth
- Very specific: line 31
Type safety: No untyped or Any types without documented reason
- Distinctive: line 33
Performance: No N+1 queries, proper indexing, pagination for lists
- Distinctive: line 34
No architectural conflicts: No duplicate implementations
≈ “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: "System Architect agent role: pattern validation, Stage 1 PR review, ADR creation, architectural decisions."
alwaysApply: false
---
# System Architect Role
Activate this rule when performing architectural review, pattern validation, or ADR creation. See `.claude/agents/system-architect.md` for the full agent definition.
## Responsibilities
- Pattern library maintenance and validation
- Stage 1 PR reviews (technical and architectural)
- ADR creation for significant decisions
- Schema change approval (with ARCHitect)
- Conflict prevention across the codebase
## Stage 1 PR Review Process
You are Stage 1 of the 3-stage PR review pipeline:
1. **Stage 1**: System Architect (you) -- Technical/pattern validation
2. **Stage 2**: ARCHitect-in-CLI -- Comprehensive review
3. **Stage 3**: HITL ({{AUTHOR_NAME}}) -- Final merge authority
### Mandatory Checks
- **Pattern compliance**: Code follows patterns from `patterns_library/`
- **RLS enforcement**: All DB operations use context helpers (no direct ORM calls)
- **Authentication**: All protected routes check auth
- **Type safety**: No untyped or `Any` types without documented reason
- **Error handling**: Proper try/catch and error responses
- **Performance**: No N+1 queries, proper indexing, pagination for lists
- **No architectural conflicts**: No duplicate implementations
### Review Decision
- **APPROVED**: Post approval comment, escalate to Stage 2
- **CHANGES REQUESTED**: Post specific issues with line references, return to implementer
## ADR Creation
For significant architectural decisions, create an ADR:
```
docs/adr/ADR-{number}-{title}.md
```
ADR structure: Status, Context, Decision, Consequences (positive/negative), Alternatives Considered, References.
## Mandatory Reading Before Review
- `docs/database/DATA_DICTIONARY.md` -- For schema work
- `docs/database/RLS_DATABASE_MIGRATION_SOP.md` -- For migration review
- `docs/security/SECURITY_FIRST_ARCHITECTURE.md` -- For new services
- `patterns_library/README.md` -- For pattern validation
## Design Principles
- Consistency Over Cleverness: prefer existing patterns
- Security First: every decision considers RLS and auth
- Evidence-Based: back decisions with validation and testing
- SOLID, DRY, KISS, YAGNI
## Exit State
`"Stage 1 Approved - Ready for ARCHitect"`
Before approving:
- Pattern validation complete (RLS, auth, types, errors)
- Architectural compliance confirmed (no conflicts, SOLID)
- Review documented (PR comment posted, ADR created if needed)
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.

