safe-agentic-workflow / rules
Cursor rule419 starsChanged 4 months agoMITView on GitHub
Frontend development rules for React 18, Electron, ShadCN UI, and Tailwind CSS.
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/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 11-frontend-react.mdc into the rules it gives an agent
12 rules. About 0 are common, 12 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
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 21
Use functional components with hooks (no class components)
- Distinctive: line 22
Use TypeScript interfaces for all props
- Distinctive: line 23
Follow ShadCN UI component patterns for consistency
- Distinctive: line 24
Use Tailwind utility classes for styling (avoid custom CSS)
- Distinctive: line 40
Use React hooks for local state
- Distinctive: line 41
Use context for shared state within feature boundaries
- Distinctive: line 42
Avoid prop drilling beyond 2 levels
- Distinctive: line 46
All API calls must handle loading, error, and success states
- Distinctive: line 47
Use proper error boundaries so analytics/API failures do not crash the app
- Distinctive: line 52
All interactive elements must be keyboard-navigable
- Distinctive: line 53
Use semantic HTML elements
- Distinctive: line 55
Follow ShadCN UI's built-in accessibility patterns
≈ “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: "Frontend development rules for React 18, Electron, ShadCN UI, and Tailwind CSS."
globs: "sdk/**/*.tsx,sdk/**/*.ts,sdk/**/*.jsx,sdk/**/*.js"
alwaysApply: false
---
# Frontend React Rules
These rules apply when working on frontend code in `sdk/`.
## Technology Stack
- **Framework**: React 18
- **Desktop**: Electron
- **UI Library**: ShadCN UI components
- **Styling**: Tailwind CSS
- **Type Safety**: TypeScript (strict mode)
## Component Patterns
- Use functional components with hooks (no class components)
- Use TypeScript interfaces for all props
- Follow ShadCN UI component patterns for consistency
- Use Tailwind utility classes for styling (avoid custom CSS)
### Authenticated Pages
For pages requiring authentication, see `patterns_library/ui/authenticated-page.md`.
### Forms
For forms with validation, see `patterns_library/ui/form-with-validation.md` (React Hook Form + Zod).
### Data Tables
For paginated data tables, see `patterns_library/ui/data-table.md`.
## State Management
- Use React hooks for local state
- Use context for shared state within feature boundaries
- Avoid prop drilling beyond 2 levels
## API Integration
- All API calls must handle loading, error, and success states
- Use proper error boundaries so analytics/API failures do not crash the app
- Handle authentication token refresh transparently
## Accessibility
- All interactive elements must be keyboard-navigable
- Use semantic HTML elements
- Include ARIA labels where needed
- Follow ShadCN UI's built-in accessibility patterns
## Validation Commands
```bash
# TypeScript validation
{{TYPE_CHECK_COMMAND}}
# Linting
{{LINT_COMMAND}}
# Build verification
{{BUILD_COMMAND}}
```
## Key References
- See `patterns_library/ui/` for UI component patterns
- See `docs/security/SECURITY_FIRST_ARCHITECTURE.md` for client-side security
- See `CONTRIBUTING.md` for full workflow details
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.

