safe-agentic-workflow / rules
Cursor rule419 starsChanged 4 months agoMITView on GitHub
Spec-driven development: spec templates, acceptance criteria, definition of done, pattern references, and demo scripts.
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/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 14-spec-creation.mdc into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 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.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Every spec MUST include:
- Distinctive: line 20
If any of these are missing, the spec is not ready for implementation.
- Distinctive: line 24
Use this structure for all implementation specs:
- Distinctive: line 95
Before submitting a spec:
≈ “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: "Spec-driven development: spec templates, acceptance criteria, definition of done, pattern references, and demo scripts."
globs: "specs/**/*.md,specs_templates/**/*.md"
alwaysApply: false
---
# Spec Creation Rules
These rules apply when creating or editing implementation specs. Every spec drives implementation -- incomplete specs block all downstream work.
## Stop-the-Line: Spec Quality Gate
Every spec MUST include:
1. **Acceptance Criteria** -- Testable pass/fail conditions
2. **Pattern References** -- Pointers to `patterns_library/` for execution agents
3. **Success Validation Command** -- A runnable command to verify the feature works
4. **Demo Script** -- Step-by-step reproduction for QAS
If any of these are missing, the spec is not ready for implementation.
## Spec Template
Use this structure for all implementation specs:
```markdown
# SPEC-{{TICKET_PREFIX}}-{number}: {Feature Name}
## Summary
{One paragraph describing the feature}
## User Story
As a [user type], I want [goal] so that [benefit].
## Acceptance Criteria
- [ ] {Testable criterion 1}
- [ ] {Testable criterion 2}
- [ ] {Testable criterion 3}
## Pattern References
- **API**: `patterns_library/api/{pattern}.md`
- **Database**: `patterns_library/database/{pattern}.md`
- **Security**: `docs/database/RLS_IMPLEMENTATION_GUIDE.md`
## Success Validation Command
{runnable command to verify the feature}
## Demo Script
1. Navigate to {page}
2. Perform {action}
3. Observe {expected behavior}
4. Verify {success indicator}
## Logical Commits
1. `feat(scope): implement data model [{{TICKET_PREFIX}}-{number}]`
2. `feat(scope): add API endpoint [{{TICKET_PREFIX}}-{number}]`
3. `test(scope): add tests [{{TICKET_PREFIX}}-{number}]`
```
## Acceptance Criteria Patterns
### User Action Criteria
```markdown
- [ ] User can {action} -> {result}
- [ ] When user {triggers}, system {responds}
- [ ] User receives {feedback} after {action}
```
### Data Criteria
```markdown
- [ ] Data persists after {action}
- [ ] User can only see their own {data type}
- [ ] {field} validates {constraint}
```
### Error Criteria
```markdown
- [ ] Invalid input shows {error message}
- [ ] Network failure shows retry option
- [ ] Unauthorized access returns 401
```
## FORBIDDEN Patterns
- Specs without testable acceptance criteria
- Specs without pattern references (execution agents need pointers)
- Specs with "looks good to reviewer" as done criteria (not testable)
- Specs that skip the success validation command
## Quality Checklist
Before submitting a spec:
- [ ] All acceptance criteria are testable (verifiable pass/fail)
- [ ] Pattern references point to existing patterns in `patterns_library/`
- [ ] Success validation command is runnable
- [ ] Demo script is step-by-step reproducible
- [ ] Logical commits follow SAFe format
- [ ] Linear ticket referenced
## Key References
- **Spec templates**: `specs_templates/`
- **Pattern library**: `patterns_library/README.md`
- **SAFe workflow**: `CONTRIBUTING.md`
- **Full skill docs**: `.claude/skills/spec-creation/SKILL.md`
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.

