- Create comprehensive meta-rule for evaluating changes between branches - Implement systematic breaking change detection for API contracts, data structures, and behavior - Add risk assessment framework with LOW/MEDIUM/HIGH/CRITICAL classification - Include change pattern recognition and dependency impact assessment - Provide structured output format for change evaluation reports - Apply markdown core standards for consistent formatting and readability Problem: Need systematic approach to catch problematic model behavior by analyzing changes before they cause issues. Solution: Create meta-rule that evaluates changes between branches, detects breaking changes, assesses risk levels, and provides actionable recommendations. Files changed: - .cursor/rules/meta_change_evaluation.mdc: New meta-rule with comprehensive change evaluation capabilities Testing: Rule provides structured approach for analyzing changes, detecting breaking changes, and generating risk assessment reports.
.cursor Rules Organization
This directory contains all the rules and guidelines for AI assistants working with the TimeSafari project.
Directory Structure
core/ - Core Principles and Context
Core rules that apply to all AI interactions and provide fundamental context.
base_context.mdc- Human competence first principles and interaction guidelinesharbor_pilot_universal.mdc- Technical guide creation and investigation rulesless_complex.mdc- Minimalist solution principle and complexity guidelines
development/ - Development Practices and Standards
Rules for software development, coding standards, and development workflows.
software_development.mdc- Core development principles and evidence requirementstype_safety_guide.mdc- TypeScript type safety guidelines and best practicesdevelopment_guide.mdc- Development environment setup and standardslogging_standards.mdc- Logging implementation standards and ruleslogging_migration.mdc- Migration from console.* to structured loggingtime.mdc- Time handling principles and UTC standardstime_examples.mdc- Practical time implementation examplestime_implementation.mdc- Detailed time implementation guidelinesrealistic_time_estimation.mdc- Time estimation framework and principlesplanning_examples.mdc- Planning examples and best practicescomplexity_assessment.mdc- Complexity evaluation and assessmentdependency_management.mdc- Dependency management and version controlasset_configuration.mdc- Asset configuration and build integrationresearch_diagnostic.mdc- Research and investigation workflowsinvestigation_report_example.mdc- Investigation report templates and exampleshistorical_comment_management.mdc- Historical comment transformation ruleshistorical_comment_patterns.mdc- Comment transformation patterns and examples
architecture/ - Architecture and Design Patterns
Rules for architectural decisions, patterns, and system design.
build_architecture_guard.mdc- Build system protection and change levelsbuild_validation.mdc- Build validation procedures and testingbuild_testing.mdc- Build testing requirements and feedback collection
app/ - Application-Specific Rules
Rules specific to the TimeSafari application and its architecture.
timesafari.mdc- Core application context and principlestimesafari_platforms.mdc- Platform-specific implementation guidelinestimesafari_development.mdc- TimeSafari development workflowarchitectural_decision_record.mdc- ADR creation and managementarchitectural_implementation.mdc- Architecture implementation guidelinesarchitectural_patterns.mdc- Architectural patterns and examplesarchitectural_examples.mdc- Architecture examples and testing
database/ - Database and Data Management
Rules for database operations, migrations, and data handling.
absurd-sql.mdc- Absurd SQL implementation and worker thread setuplegacy_dexie.mdc- Legacy Dexie migration guidelines
workflow/ - Process and Workflow Management
Rules for development workflows, version control, and process management.
version_control.mdc- Version control principles and commit guidelinesversion_sync.mdc- Version synchronization and changelog managementcommit_messages.mdc- Commit message format and conventions
`features/ - Feature-Specific Implementations
Rules for implementing specific features across platforms.
camera-implementation.mdc- Camera feature implementation overviewcamera_technical.mdc- Technical camera implementation detailscamera_platforms.mdc- Platform-specific camera implementation
docs/ - Documentation Standards
Rules for creating and maintaining documentation.
markdown_core.mdc- Core markdown formatting standardsmarkdown_templates.mdc- Document templates and examplesmarkdown_workflow.mdc- Markdown validation and workflowdocumentation.mdc- Documentation generation principlesmeta_rule_usage_guide.md- How to use meta-rules in practice
templates/ - Templates and Examples
Template files and examples for various documentation types.
adr_template.mdc- Architectural Decision Record template
Meta-Rules - Workflow Bundling
High-level meta-rules that bundle related sub-rules for specific workflows.
meta_core_always_on.mdc- Core rules that apply to every single promptmeta_documentation.mdc- Documentation writing and education workflowmeta_feature_planning.mdc- Feature planning workflow bundlingmeta_bug_diagnosis.mdc- Bug investigation workflow bundlingmeta_bug_fixing.mdc- Bug fix implementation workflow bundlingmeta_feature_implementation.mdc- Feature implementation workflow bundlingmeta_research.mdc- Investigation and research workflow bundling
Workflow State Management
The project uses a sophisticated workflow state management system to ensure systematic development processes and maintain code quality across all phases of development.
Workflow State System
The workflow state is managed through .cursor/rules/.workflow_state.json and enforces different modes with specific constraints. The system automatically tracks workflow progression and maintains a complete history of mode transitions.
Available Modes:
diagnosis- Investigation and analysis phase (read-only)fixing- Implementation and bug fixing phase (full access)planning- Design and architecture phase (design only)research- Investigation and research phase (investigation only)documentation- Documentation writing phase (writing only)
Mode Constraints:
{
"diagnosis": {
"mode": "read_only",
"forbidden": ["modify", "create", "build", "commit"],
"allowed": ["read", "search", "analyze", "document"]
},
"fixing": {
"mode": "implementation",
"forbidden": [],
"allowed": ["modify", "create", "build", "commit", "test"]
}
}
Workflow History Tracking:
The system automatically maintains a workflowHistory array that records all mode transitions and meta-rule invocations:
{
"workflowHistory": [
{
"mode": "research",
"invoked": "meta_core_always_on.mdc",
"timestamp": "2025-08-25T02:14:37Z"
},
{
"mode": "diagnosis",
"invoked": "meta_bug_diagnosis.mdc",
"timestamp": "2025-08-25T02:14:37Z"
}
]
}
History Entry Format:
mode: The workflow mode that was activatedinvoked: The specific meta-rule that triggered the mode changetimestamp: UTC timestamp when the mode transition occurred
History Purpose:
- Workflow Continuity: Track progression through development phases
- Meta-Rule Usage: Monitor which rules are invoked and when
- Temporal Context: Maintain chronological order of workflow changes
- State Persistence: Preserve workflow history across development sessions
- Debugging Support: Help diagnose workflow state issues
- Process Analysis: Understand development patterns and meta-rule effectiveness
Commit Override System
The workflow includes a flexible commit override mechanism that allows commits on demand while maintaining workflow integrity:
{
"overrides": {
"commit": {
"allowed": true,
"requires_override": true,
"override_reason": "user_requested"
}
}
}
Override Benefits:
- ✅ Investigation Commits: Document findings during diagnosis phases
- ✅ Work-in-Progress: Commit partial solutions during complex investigations
- ✅ Emergency Fixes: Commit critical fixes without mode transitions
- ✅ Flexible Workflow: Maintain systematic approach while accommodating real needs
Override Limitations:
- ❌ Does NOT bypass: Version control rules, commit message standards, or security requirements
- ❌ Does NOT bypass: Code quality standards, testing requirements, or documentation requirements
Workflow Enforcement
The system automatically enforces workflow constraints through the core always-on rules:
Before Every Interaction:
- Read current workflow state from
.cursor/rules/.workflow_state.json - Identify current mode and its constraints
- Validate user request against current mode constraints
- Enforce constraints before generating response
- Guide model behavior based on current mode
Mode-Specific Enforcement:
- Diagnosis Mode: Blocks modification, creation, building, and commits
- Fixing Mode: Allows full implementation and testing capabilities
- Planning Mode: Focuses on design and architecture, blocks implementation
- Research Mode: Enables investigation and analysis, blocks modification
- Documentation Mode: Allows writing and editing, blocks implementation
Workflow Transitions
To change workflow modes, invoke the appropriate meta-rule:
# Switch to bug fixing mode
@meta_bug_fixing.mdc
# Switch to feature planning mode
@meta_feature_planning.mdc
# Switch to documentation mode
@meta_documentation.mdc
Transition Requirements:
- Mode Changes: Require explicit meta-rule invocation
- State Updates: Automatically update workflow state file
- Constraint Enforcement: Immediately apply new mode constraints
- History Tracking: Automatically maintained in
workflowHistoryarray - Timestamp Recording: Each transition recorded with UTC timestamp
Integration with Development Process
The workflow system integrates seamlessly with existing development practices:
Version Control:
- All commits must follow TimeSafari commit message standards
- Security audit checklists are enforced regardless of workflow mode
- Documentation updates are required for substantial changes
Quality Assurance:
- Code quality standards (PEP8, TypeScript, etc.) are always enforced
- Testing requirements apply to all implementation work
- Documentation standards are maintained across all phases
Build System:
- Build Architecture Guard protects critical build files
- Platform-specific build processes respect workflow constraints
- Asset generation follows established patterns
Migration Context:
- Database migration work respects investigation vs. implementation phases
- Component migration progress is tracked through workflow states
Usage Guidelines
- Always-On Rules: Start with
meta_core_always_on.mdcfor every single prompt - Core Rules: Always apply rules from
core/directory - Context-Specific: Use rules from appropriate subdirectories based on your task
- Meta-Rules: Use workflow-specific meta-rules for specialized tasks
- Documentation: Use
meta_documentation.mdcfor all documentation work - Getting Started: See
docs/meta_rule_usage_guide.mdfor comprehensive usage instructions
- Documentation: Use
- Cross-References: All files contain updated cross-references to reflect the new structure
- Validation: All files pass markdown validation and maintain consistent formatting
Benefits of New Organization
- Logical grouping - Related rules are now co-located
- Easier navigation - Developers can quickly find relevant rules
- Better maintainability - Clear separation of concerns
- Scalable structure - Easy to add new rules in appropriate categories
- Consistent cross-references - All file links updated and working
- Workflow bundling - Meta-rules provide high-level workflow guidance
- Feedback integration - Built-in feedback mechanisms for continuous improvement
- Educational focus - Documentation emphasizes human competence over technical description
File Naming Convention
- Lowercase with underscores:
file_name.mdc - Descriptive names: Names clearly indicate the rule's purpose
- Consistent extensions: All files use
.mdcextension
Maintenance
- Cross-references: Update when moving files between directories
- Markdown validation: Run
npm run markdown:checkafter any changes - Organization: Keep related rules in appropriate subdirectories
- Documentation: Update this README when adding new rules or directories
Status: Active organization structure Last Updated: 2025-08-21 Maintainer: Development team