How Rules Work
Choose a Rule Template or Write Your Own
Browse the templates below for ready-to-use directive descriptions, or write a custom rule from scratch.
Create the Rule on the Platform
Create a new rule from the prompting section of your project, or from Settings > Rules. Enter the rule’s name and paste its description. See the Rules guide for detailed steps.
When to Use Rules
- Quality Enforcement
- Security & Performance
- Completeness & Documentation
- Test coverage - ensure tests import and invoke real production code
- Code style - enforce existing architectural patterns and conventions
- Backward compatibility - prevent breaking changes to public APIs and interfaces
Rule Templates
Require Test Coverage
Enforce tests that import and invoke real production code
Enforce Code Style Patterns
Ensure generated code matches existing codebase conventions and architecture
Document Code Explainability
Add docstrings and inline comments explaining implementation decisions
Preserve Backward Compatibility
Prevent breaking changes to existing APIs and interfaces
Prevent Security Vulnerabilities
Block common vulnerability patterns like injection, hardcoded secrets, and broken auth
Annotate Performance Impact
Require complexity annotations, efficient patterns, and documented trade-offs
Assess Change Risks
Require inline risk documentation for changes to public contracts and schemas
Preserve User Journey Completeness
Ensure complete workflows with entry points, error handling, and exit paths
Document API Consumer Paths
Document consumer contracts, data flow, and side effects inline on every endpoint
Prevent Workflow Gaps
Block incomplete flows, swallowed errors, and undocumented behavior