AI Rules Configuration
đ¤ Purpose: Configure AI assistants with project-specific rules for consistent guidance
Quick Setup
Section titled âQuick Setupâ1. Copy Base Rules
Section titled â1. Copy Base RulesâThe template includes a comprehensive AI rules file at the project root:
# Copy and rename for your AI toolcp airules.example .windsurfrules # For Windsurfcp airules.example .cursorrules # For Cursorcp airules.example .clinerules # For Cline2. Customize Project Context
Section titled â2. Customize Project ContextâEdit your chosen rules file to match your specific project:
# [Your Project Name]
Every time you choose to apply a rule(s), explicitly state the rule(s) in the output.
## Project Context[Replace with your specific project description]- Target audience: [your audience]- Primary goals: [your goals]- Key constraints: [your constraints]3. Configure AI Tool
Section titled â3. Configure AI ToolâFor Windsurf:
- Rules file:
.windsurfrules - Auto-detected at project root
- No additional configuration needed
For Cursor:
- Rules file:
.cursorrules - Auto-detected at project root
- Additional context in workspace settings
For Cline:
- Rules file:
.clinerules - May need manual configuration in extension settings
Astro-Specific Rules Included
Section titled âAstro-Specific Rules IncludedâThe template includes pre-configured rules for:
Performance Standards
Section titled âPerformance Standardsâ- Lighthouse 97+ targets
- JavaScript budget: <160KB
- CSS budget: <50KB
- Image optimization requirements
Technical Patterns
Section titled âTechnical Patternsâ- Astro 5.x best practices
- Islands architecture guidance
- TypeScript strict mode
- Component hierarchy (atomic design)
Content Strategy
Section titled âContent Strategyâ- Content Collections with Zod schemas
- MDX component patterns
- SEO optimization
- Accessibility (WCAG AA)
Customization Examples
Section titled âCustomization ExamplesâB2B SaaS Website
Section titled âB2B SaaS Websiteâ## Project ContextLead generation website for enterprise SaaS product- Target: VPs and Directors at 200+ person companies- Goal: 50 qualified leads per month- Constraints: Must integrate with Salesforce CRMPortfolio/Agency Site
Section titled âPortfolio/Agency Siteâ## Project ContextCreative portfolio showcasing design work- Target: Startup founders and marketing directors- Goal: 5 premium project inquiries monthly- Constraints: Heavy visual content, mobile-firstE-commerce Store
Section titled âE-commerce Storeâ## Project ContextPerformance-optimized e-commerce experience- Target: Mobile-first shoppers, conversion focus- Goal: <2s page load, >3% conversion rate- Constraints: Large product catalog, international shippingAdvanced Configuration
Section titled âAdvanced ConfigurationâIDE Integration
Section titled âIDE IntegrationâVS Code with GitHub Copilot:
{ "github.copilot.advanced": { "contextFiles": [ ".windsurfrules", "docs/ai-context/INDEX.md", "docs/PRD-*.md" ] }}Continue.dev:
{ "contextProviders": [ { "name": "docs", "params": { "folders": ["docs/ai-context/"] } } ]}Multiple AI Tools
Section titled âMultiple AI ToolsâIf using multiple AI assistants, maintain consistency:
# Keep rules synchronizedcp .windsurfrules .cursorrulescp .windsurfrules .clinerules
# Or use symbolic links (Unix/Mac)ln -s .windsurfrules .cursorrulesln -s .windsurfrules .clinerulesTesting Your Configuration
Section titled âTesting Your ConfigurationâValidation Prompts
Section titled âValidation PromptsâTest your rules with these prompts:
"Based on our project rules, create a new component called ProductCard"Should reference:
- Design tokens usage
- TypeScript interfaces
- Accessibility requirements
- Performance considerations
"Optimize the homepage for our target audience"Should reference:
- Project-specific audience
- Conversion goals
- Performance budgets
- Brand guidelines
Rule Enforcement Check
Section titled âRule Enforcement CheckâLook for these patterns in AI responses:
- Rule References: âFollowing the [rule name] patternâŚâ
- Project Context: Mentions your specific audience/goals
- Constraint Awareness: Respects budgets and limitations
- Pattern Consistency: Uses established conventions
Maintenance
Section titled âMaintenanceâWhen to Update Rules
Section titled âWhen to Update Rulesâ- Project Evolution: Goals or audience change
- New Patterns: Discovered better approaches
- Tool Updates: AI assistant capabilities change
- Team Feedback: Rules arenât working effectively
Update Process
Section titled âUpdate Processâ# 1. Test changes in separate file firstcp .windsurfrules test-rules.txt
# 2. Make incremental changes# Edit test-rules.txt
# 3. Validate with AI assistant# Test key prompts
# 4. Deploy if successfulcp test-rules.txt .windsurfrulesVersion Control
Section titled âVersion Controlâ# Add rules to git (recommended)git add .windsurfrules .cursorrules .clinerules
# Or keep private (add to .gitignore)echo ".windsurfrules" >> .gitignoreecho ".cursorrules" >> .gitignoreecho ".clinerules" >> .gitignoreTroubleshooting
Section titled âTroubleshootingâRules Not Applied
Section titled âRules Not Appliedâ- Check File Location: Must be at project root
- Verify File Name: Exact spelling required
- Restart AI Tool: May need to reload workspace
- Test with Explicit Reference: âFollowing our project rulesâŚâ
Inconsistent Responses
Section titled âInconsistent Responsesâ- Review Rule Clarity: Avoid ambiguous language
- Add Specific Examples: Show desired patterns
- Remove Contradictions: Ensure rules donât conflict
- Prioritize Rules: Most important rules first
Performance Issues
Section titled âPerformance Issuesâ- Rule File Size: Keep under 2000 lines
- Complex Logic: Simplify decision trees
- Context Overload: Focus on essential guidance only
Remember: AI rules are most effective when theyâre specific, actionable, and aligned with your actual development workflow.