Browse Source

docs(rules): apply markdown standards and streamline rulesets

- Apply markdown.mdc formatting to all ruleset files (80-char line length, proper spacing)
- Update timesafari.mdc to reflect completed migration (remove triple migration pattern references)
- Clean up corrupted logging_standards.mdc and restore proper content
- Streamline architectural_decision_record.mdc for better readability
- Update all file dates to 2025-08-19 for consistency
- Add proper document headers and metadata to all ruleset files
- Remove duplicate content and improve file organization
- Maintain alwaysApply settings and glob patterns appropriately

Files affected: 15 ruleset files across app/, database/, development/, features/, workflow/ directories
didview-invalid-did-handling
Matthew Raymer 3 days ago
parent
commit
1666e77aa5
  1. 4
      .cursor/rules/adr_template.mdc
  2. 246
      .cursor/rules/app/architectural_decision_record.mdc
  3. 411
      .cursor/rules/app/timesafari.mdc
  4. 43
      .cursor/rules/asset_configuration.mdc
  5. 198
      .cursor/rules/base_context.mdc
  6. 45
      .cursor/rules/database/absurd-sql.mdc
  7. 5
      .cursor/rules/database/legacy_dexie.mdc
  8. 53
      .cursor/rules/development/type_safety_guide.mdc
  9. 6
      .cursor/rules/features/camera-implementation.mdc
  10. 81
      .cursor/rules/investigation_report_example.mdc
  11. 13
      .cursor/rules/logging_standards.mdc
  12. 4
      .cursor/rules/research_diagnostic.mdc
  13. 148
      .cursor/rules/software_development.mdc
  14. 329
      .cursor/rules/time.mdc
  15. 324
      .cursor/rules/workflow/version_control.mdc

4
.cursor/rules/adr_template.mdc

@ -9,7 +9,9 @@
## Context ## Context
[Describe the forces at play, including technological, political, social, and project local. These forces are probably in tension, and should be called out as such. The language in this section is value-neutral. It is simply describing facts.] [Describe the forces at play, including technological, political, social, and
project local. These forces are probably in tension, and should be called out as
such. The language in this section is value-neutral. It is simply describing facts.]
## Decision ## Decision

246
.cursor/rules/app/architectural_decision_record.mdc

@ -1,10 +1,13 @@
--- ---
description: description: when you need to understand the system architecture or make changes that impact the system architecture
globs: alwaysApply: false
alwaysApply: true
--- ---
# TimeSafari Cross-Platform Architecture Guide # TimeSafari Cross-Platform Architecture Guide
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Architecture guidelines
## 1. Platform Support Matrix ## 1. Platform Support Matrix
| Feature | Web (PWA) | Capacitor (Mobile) | Electron (Desktop) | | Feature | Web (PWA) | Capacitor (Mobile) | Electron (Desktop) |
@ -15,11 +18,10 @@ alwaysApply: true
| Camera Access | MediaDevices API | Capacitor Camera | Not Implemented | | Camera Access | MediaDevices API | Capacitor Camera | Not Implemented |
| Platform Detection | Web APIs | Capacitor.isNativePlatform() | process.env checks | | Platform Detection | Web APIs | Capacitor.isNativePlatform() | process.env checks |
---
## 2. Project Structure ## 2. Project Structure
### Core Directories ### Core Directories
``` ```
src/ src/
├── components/ # Vue components ├── components/ # Vue components
@ -38,14 +40,13 @@ src/
``` ```
### Entry Points ### Entry Points
- `main.ts` → Base entry - `main.ts` → Base entry
- `main.common.ts` → Shared init - `main.common.ts` → Shared init
- `main.capacitor.ts` → Mobile entry - `main.capacitor.ts` → Mobile entry
- `main.electron.ts` → Electron entry - `main.electron.ts` → Electron entry
- `main.web.ts` → Web entry - `main.web.ts` → Web entry
---
## 3. Service Architecture ## 3. Service Architecture
### Service Organization ### Service Organization
@ -64,28 +65,30 @@ services/
``` ```
### Factory Pattern ### Factory Pattern
Use a **singleton factory** to select platform services via `process.env.VITE_PLATFORM`.
--- Use a **singleton factory** to select platform services via
`process.env.VITE_PLATFORM`.
## 4. Feature Guidelines ## 4. Feature Guidelines
### QR Code Scanning ### QR Code Scanning
- Define `QRScannerService` interface. - Define `QRScannerService` interface.
- Implement platform-specific classes (`WebInlineQRScanner`, Capacitor, etc). - Implement platform-specific classes (`WebInlineQRScanner`, Capacitor,
etc).
- Provide `addListener` and `onStream` hooks for composability. - Provide `addListener` and `onStream` hooks for composability.
### Deep Linking ### Deep Linking
- URL format: `timesafari://<route>[/<param>][?query=value]` - URL format: `timesafari://<route>[/<param>][?query=value]`
- Web: `router.beforeEach` → parse query - Web: `router.beforeEach` → parse query
- Capacitor: `App.addListener("appUrlOpen", …)` - Capacitor: `App.addListener("appUrlOpen", …)`
---
## 5. Build Process ## 5. Build Process
- `vite.config.common.mts` → shared config - `vite.config.common.mts` → shared config
- Platform configs: `vite.config.web.mts`, `.capacitor.mts`, `.electron.mts` - Platform configs: `vite.config.web.mts`, `.capacitor.mts`,
`.electron.mts`
- Use `process.env.VITE_PLATFORM` for conditional loading. - Use `process.env.VITE_PLATFORM` for conditional loading.
```bash ```bash
@ -94,8 +97,6 @@ npm run build:capacitor
npm run build:electron npm run build:electron
``` ```
---
## 6. Testing Strategy ## 6. Testing Strategy
- **Unit tests** for services. - **Unit tests** for services.
@ -108,64 +109,243 @@ npm run build:electron
test.skip(!process.env.MOBILE_TEST, "Mobile-only test"); test.skip(!process.env.MOBILE_TEST, "Mobile-only test");
``` ```
> 🔗 **Human Hook:** Before merging new tests, hold a short sync (≤15 min) with QA to align on coverage and flaky test risks. > 🔗 **Human Hook:** Before merging new tests, hold a short sync (≤15
> min) with QA to align on coverage and flaky test risks.
---
## 7. Error Handling ## 7. Error Handling
- Global Vue error handler → logs with component name. - Global Vue error handler → logs with component name.
- Platform-specific wrappers log API errors with platform prefix (`[Capacitor API Error]`, etc). - Platform-specific wrappers log API errors with platform prefix
(`[Capacitor API Error]`, etc).
- Use structured logging (not `console.log`). - Use structured logging (not `console.log`).
---
## 8. Best Practices ## 8. Best Practices
- Keep platform code **isolated** in `platforms/`. - Keep platform code **isolated** in `platforms/`.
- Always define a **shared interface** first. - Always define a **shared interface** first.
- Use feature detection, not platform detection, when possible. - Use feature detection, not platform detection, when possible.
- Dependency injection for services → improves testability. - Dependency injection for services → improves testability.
- Maintain **Competence Hooks** in PRs (2–3 prompts for dev discussion). - Maintain **Competence Hooks** in PRs (2–3 prompts for dev
discussion).
---
## 9. Dependency Management ## 9. Dependency Management
- Key deps: `@capacitor/core`, `electron`, `vue`. - Key deps: `@capacitor/core`, `electron`, `vue`.
- Use conditional `import()` for platform-specific libs. - Use conditional `import()` for platform-specific libs.
---
## 10. Security Considerations ## 10. Security Considerations
- **Permissions**: Always check + request gracefully. - **Permissions**: Always check + request gracefully.
- **Storage**: Secure storage for sensitive data; encrypt when possible. - **Storage**: Secure storage for sensitive data; encrypt when possible.
- **Audits**: Schedule quarterly security reviews. - **Audits**: Schedule quarterly security reviews.
---
## 11. ADR Process ## 11. ADR Process
- All major architecture choices → log in `doc/adr/`. - All major architecture choices → log in `doc/adr/`.
- Use ADR template with Context, Decision, Consequences, Status. - Use ADR template with Context, Decision, Consequences, Status.
- Link related ADRs in PR descriptions. - Link related ADRs in PR descriptions.
> 🔗 **Human Hook:** When proposing a new ADR, schedule a 30-min design sync for discussion, not just async review. > 🔗 **Human Hook:** When proposing a new ADR, schedule a 30-min
> design sync for discussion, not just async review.
## 12. Collaboration Hooks
- **QR features**: Sync with Security before merging → permissions &
privacy.
- **New platform builds**: Demo in team meeting → confirm UX
differences.
- **Critical ADRs**: Present in guild or architecture review.
## Self-Check
- [ ] Does this feature implement a shared interface?
- [ ] Are fallbacks + errors handled gracefully?
- [ ] Have relevant ADRs been updated/linked?
- [ ] Did I add competence hooks or prompts for the team?
- [ ] Was human interaction (sync/review/demo) scheduled?
--- ---
**Status**: Active architecture guidelines
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: Vue 3, Capacitor, Electron, Vite
**Stakeholders**: Development team, Architecture team
- [ ] Are fallbacks + errors handled gracefully?
- [ ] Have relevant ADRs been updated/linked?
- [ ] Did I add competence hooks or prompts for the team?
- [ ] Was human interaction (sync/review/demo) scheduled?
# TimeSafari Cross-Platform Architecture Guide
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Architecture guidelines
## 1. Platform Support Matrix
| Feature | Web (PWA) | Capacitor (Mobile) | Electron (Desktop) |
|---------|-----------|--------------------|-------------------|
| QR Code Scanning | WebInlineQRScanner | @capacitor-mlkit/barcode-scanning | Not Implemented |
| Deep Linking | URL Parameters | App URL Open Events | Not Implemented |
| File System | Limited (Browser API) | Capacitor Filesystem | Electron fs |
| Camera Access | MediaDevices API | Capacitor Camera | Not Implemented |
| Platform Detection | Web APIs | Capacitor.isNativePlatform() | process.env checks |
## 2. Project Structure
### Core Directories
```
src/
├── components/ # Vue components
├── services/ # Platform services and business logic
├── views/ # Page components
├── router/ # Vue router configuration
├── types/ # TypeScript type definitions
├── utils/ # Utility functions
├── lib/ # Core libraries
├── platforms/ # Platform-specific implementations
├── electron/ # Electron-specific code
├── constants/ # Application constants
├── db/ # Database related code
├── interfaces/ # TypeScript interfaces
└── assets/ # Static assets
```
### Entry Points
- `main.ts` → Base entry
- `main.common.ts` → Shared init
- `main.capacitor.ts` → Mobile entry
- `main.electron.ts` → Electron entry
- `main.web.ts` → Web entry
## 3. Service Architecture
### Service Organization
```tree
services/
├── QRScanner/
│ ├── WebInlineQRScanner.ts
│ └── interfaces.ts
├── platforms/
│ ├── WebPlatformService.ts
│ ├── CapacitorPlatformService.ts
│ └── ElectronPlatformService.ts
└── factory/
└── PlatformServiceFactory.ts
```
### Factory Pattern
Use a **singleton factory** to select platform services via
`process.env.VITE_PLATFORM`.
## 4. Feature Guidelines
### QR Code Scanning
- Define `QRScannerService` interface.
- Implement platform-specific classes (`WebInlineQRScanner`, Capacitor,
etc).
- Provide `addListener` and `onStream` hooks for composability.
### Deep Linking
- URL format: `timesafari://<route>[/<param>][?query=value]`
- Web: `router.beforeEach` → parse query
- Capacitor: `App.addListener("appUrlOpen", …)`
## 5. Build Process
- `vite.config.common.mts` → shared config
- Platform configs: `vite.config.web.mts`, `.capacitor.mts`,
`.electron.mts`
- Use `process.env.VITE_PLATFORM` for conditional loading.
```bash
npm run build:web
npm run build:capacitor
npm run build:electron
```
## 6. Testing Strategy
- **Unit tests** for services.
- **Playwright** for Web + Capacitor:
- `playwright.config-local.ts` includes web + Pixel 5.
- **Electron tests**: add `spectron` or Playwright-Electron.
- Mark tests with platform tags:
```ts
test.skip(!process.env.MOBILE_TEST, "Mobile-only test");
```
> 🔗 **Human Hook:** Before merging new tests, hold a short sync (≤15
> min) with QA to align on coverage and flaky test risks.
## 7. Error Handling
- Global Vue error handler → logs with component name.
- Platform-specific wrappers log API errors with platform prefix
(`[Capacitor API Error]`, etc).
- Use structured logging (not `console.log`).
## 8. Best Practices
- Keep platform code **isolated** in `platforms/`.
- Always define a **shared interface** first.
- Use feature detection, not platform detection, when possible.
- Dependency injection for services → improves testability.
- Maintain **Competence Hooks** in PRs (2–3 prompts for dev
discussion).
## 9. Dependency Management
- Key deps: `@capacitor/core`, `electron`, `vue`.
- Use conditional `import()` for platform-specific libs.
## 10. Security Considerations
- **Permissions**: Always check + request gracefully.
- **Storage**: Secure storage for sensitive data; encrypt when possible.
- **Audits**: Schedule quarterly security reviews.
## 11. ADR Process
- All major architecture choices → log in `doc/adr/`.
- Use ADR template with Context, Decision, Consequences, Status.
- Link related ADRs in PR descriptions.
> 🔗 **Human Hook:** When proposing a new ADR, schedule a 30-min
> design sync for discussion, not just async review.
## 12. Collaboration Hooks ## 12. Collaboration Hooks
- **QR features**: Sync with Security before merging → permissions & privacy. - **QR features**: Sync with Security before merging → permissions &
- **New platform builds**: Demo in team meeting → confirm UX differences. privacy.
- **New platform builds**: Demo in team meeting → confirm UX
differences.
- **Critical ADRs**: Present in guild or architecture review. - **Critical ADRs**: Present in guild or architecture review.
## Self-Check
- [ ] Does this feature implement a shared interface?
- [ ] Are fallbacks + errors handled gracefully?
- [ ] Have relevant ADRs been updated/linked?
- [ ] Did I add competence hooks or prompts for the team?
- [ ] Was human interaction (sync/review/demo) scheduled?
--- ---
# Self-Check **Status**: Active architecture guidelines
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: Vue 3, Capacitor, Electron, Vite
**Stakeholders**: Development team, Architecture team
- [ ] Does this feature implement a shared interface?
- [ ] Are fallbacks + errors handled gracefully? - [ ] Are fallbacks + errors handled gracefully?
- [ ] Have relevant ADRs been updated/linked? - [ ] Have relevant ADRs been updated/linked?
- [ ] Did I add competence hooks or prompts for the team? - [ ] Did I add competence hooks or prompts for the team?

411
.cursor/rules/app/timesafari.mdc

@ -1,316 +1,181 @@
---
description:
globs:
alwaysApply: true
---
# Time Safari Context # Time Safari Context
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Core application context
## Project Overview ## Project Overview
Time Safari is an application designed to foster community building through gifts, Time Safari is an application designed to foster community building through
gratitude, and collaborative projects. The app should make it extremely easy and gifts, gratitude, and collaborative projects. The app makes it easy and
intuitive for users of any age and capability to recognize contributions, build intuitive for users of any age and capability to recognize contributions,
trust networks, and organize collective action. It is built on services that build trust networks, and organize collective action. It is built on services
preserve privacy and data sovereignty. that preserve privacy and data sovereignty.
The ultimate goals of Time Safari are two-fold: ## Core Goals
1. **Connect** Make it easy, rewarding, and non-threatening for people to 1. **Connect**: Make it easy, rewarding, and non-threatening for people to
connect with others who have similar interests, and to initiate activities connect with others who have similar interests, and to initiate activities
together. This helps people accomplish and learn from other individuals in together.
less-structured environments; moreover, it helps them discover who they want
to continue to support and with whom they want to maintain relationships.
2. **Reveal** Widely advertise the great support and rewards that are being 2. **Reveal**: Widely advertise the great support and rewards that are being
given and accepted freely, especially non-monetary ones. Using visuals and text, given and accepted freely, especially non-monetary ones, showing the impact
display the kind of impact that gifts are making in the lives of others. Also gifts make in people's lives.
show useful and engaging reports of project statistics and personal accomplishments.
## Technical Foundation
## Core Approaches ### Architecture
Time Safari should help everyday users build meaningful connections and organize - **Privacy-preserving claims architecture** via endorser.ch
collective efforts by: - **Decentralized Identifiers (DIDs)**: User identities based on
public/private key pairs stored on devices
- **Cryptographic Verification**: All claims and confirmations are
cryptographically signed
- **User-Controlled Visibility**: Users explicitly control who can see their
identifiers and data
- **Cross-Platform**: Web (PWA), Mobile (Capacitor), Desktop (Electron)
1. **Recognizing Contributions**: Creating permanent, verifiable records of gifts ### Current Database State
and contributions people give to each other and their communities.
2. **Facilitating Collaboration**: Making it ridiculously easy for people to ask - **Database**: SQLite via Absurd SQL (browser) and native SQLite
for or propose help on projects and interests that matter to them. (mobile/desktop)
- **Legacy Support**: IndexedDB (Dexie) for backward compatibility
- **Status**: Modern database architecture fully implemented
3. **Building Trust Networks**: Enabling users to maintain their network and activity ### Core Technologies
visibility. Developing reputation through verified contributions and references,
which can be selectively shown to others outside the network.
4. **Preserving Privacy**: Ensuring personal identifiers are only shared with - **Frontend**: Vue 3 + TypeScript + vue-facing-decorator
explicitly authorized contacts, allowing private individuals including children - **Styling**: TailwindCSS
to participate safely. - **Build**: Vite with platform-specific configs
- **Testing**: Playwright E2E, Jest unit tests
- **Database**: SQLite (Absurd SQL in browser), IndexedDB (legacy)
- **State**: Pinia stores
- **Platform Services**: Abstracted behind interfaces with factory pattern
5. **Engaging Content**: Displaying people's records in compelling stories, and ## Development Principles
highlighting those projects that are lifting people's lives long-term, both in
physical support and in emotional-spiritual-creative thriving.
### Code Organization
## Technical Foundation - **Platform Services**: Abstract platform-specific code behind interfaces
- **Service Factory**: Use `PlatformServiceFactory` for platform selection
- **Type Safety**: Strict TypeScript, no `any` types, use type guards
- **Modern Architecture**: Use current platform service patterns
This application is built on a privacy-preserving claims architecture (via ### Architecture Patterns
endorser.ch) with these key characteristics:
- **Decentralized Identifiers (DIDs)**: User identities are based on public/private - **Dependency Injection**: Services injected via mixins and factory pattern
key pairs stored on their devices - **Interface Segregation**: Small, focused interfaces over large ones
- **Cryptographic Verification**: All claims and confirmations are - **Composition over Inheritance**: Prefer mixins and composition
cryptographically signed - **Single Responsibility**: Each component/service has one clear purpose
- **User-Controlled Visibility**: Users explicitly control who can see their
identifiers and data
- **Merkle-Chained Claims**: Claims are cryptographically chained for verification
and integrity
- **Native and Web App**: Works on Capacitor (iOS, Android), Desktop (Electron
and CEFPython), and web browsers
## User Journey ### Testing Strategy
The typical progression of usage follows these stages: - **E2E**: Playwright for critical user journeys
- **Unit**: Jest with F.I.R.S.T. principles
- **Platform Coverage**: Web + Capacitor (Pixel 5) in CI
- **Quality Assurance**: Comprehensive testing and validation
1. **Gratitude & Recognition**: Users begin by expressing and recording gratitude ## Current Development Focus
for gifts received, building a foundation of acknowledgment.
2. **Project Proposals**: Users propose projects and ideas, reaching out to connect ### Active Development
with others who share similar interests.
3. **Action Triggers**: Offers of help serve as triggers and motivations to execute - **Feature Development**: Build new functionality using modern platform
proposed projects, moving from ideas to action. services
- **Performance Optimization**: Improve app performance and user experience
- **Platform Enhancement**: Leverage platform-specific capabilities
- **Code Quality**: Maintain high standards and best practices
## Context for LLM Development ### Development Metrics
When developing new functionality for Time Safari, consider these design principles: - **Code Quality**: High standards maintained across all platforms
- **Performance**: Optimized for all target devices
- **Testing**: Comprehensive coverage maintained
- **User Experience**: Focus on intuitive, accessible interfaces
1. **Accessibility First**: Features should be usable by non-technical users with ## Platform-Specific Considerations
minimal learning curve.
2. **Privacy by Design**: All features must respect user privacy and data sovereignty. ### Web (PWA)
3. **Progressive Enhancement**: Core functionality should work across all devices, - **QR Scanning**: WebInlineQRScanner
with richer experiences where supported. - **Deep Linking**: URL parameters
- **File System**: Limited browser APIs
- **Build**: `npm run build:web` (development build)
4. **Voluntary Collaboration**: The system should enable but never coerce participation. ### Mobile (Capacitor)
5. **Trust Building**: Features should help build verifiable trust between users. - **QR Scanning**: @capacitor-mlkit/barcode-scanning
- **Deep Linking**: App URL open events
- **File System**: Capacitor Filesystem
- **Build**: `npm run build:capacitor`
6. **Network Effects**: Consider how features scale as more users join the platform. ### Desktop (Electron)
7. **Low Resource Requirements**: The system should be lightweight enough to run - **File System**: Node.js fs
on inexpensive devices users already own. - **Build**: `npm run build:electron`
- **Distribution**: AppImage, DEB, DMG packages
## Use Cases to Support ## Development Workflow
### Build Commands
```bash
# Web (development)
npm run build:web
# Mobile
npm run build:capacitor
npm run build:native
# Desktop
npm run build:electron
npm run build:electron:appimage
npm run build:electron:deb
npm run build:electron:dmg
```
### Testing Commands
LLM development should focus on enhancing these key use cases: ```bash
# Web E2E
npm run test:web
1. **Community Building**: Tools that help people find others with shared # Mobile
interests and values. npm run test:mobile
npm run test:android
npm run test:ios
2. **Project Coordination**: Features that make it easy to propose collaborative # Type checking
projects and to submit suggestions and offers to existing ones. npm run type-check
npm run lint-fix
```
3. **Reputation Building**: Methods for users to showcase their contributions ## Key Constraints
and reliability, in contexts where they explicitly reveal that information.
4. **Governance Experimentation**: Features that facilitate decision-making and 1. **Privacy First**: User identifiers remain private except when explicitly
collective governance. shared
2. **Platform Compatibility**: Features must work across all target platforms
3. **Performance**: Must remain performant on older/simpler devices
4. **Modern Architecture**: New features should use current platform services
5. **Offline Capability**: Key functionality should work offline when feasible
## Constraints ## Use Cases to Support
When developing new features, be mindful of these constraints: 1. **Community Building**: Tools for finding others with shared interests
2. **Project Coordination**: Easy proposal and collaboration on projects
3. **Reputation Building**: Showcasing contributions and reliability
4. **Governance**: Facilitating decision-making and collective governance
## Resources
- **Testing**: `docs/migration-testing/`
- **Architecture**: `docs/architecture-decisions.md`
- **Build Context**: `docs/build-modernization-context.md`
---
1. **Privacy Preservation**: User identifiers must remain private except when ## Status: Active application context
explicitly shared.
2. **Platform Limitations**: Features must work within the constraints of the target - **Priority**: Critical
app platforms, while aiming to leverage the best platform technology available. - **Estimated Effort**: Ongoing reference
- **Dependencies**: Vue 3, TypeScript, SQLite, Capacitor, Electron
3. **Endorser API Limitations**: Backend features are constrained by the endorser.ch - **Stakeholders**: Development team, Product team
API capabilities.
4. **Performance on Low-End Devices**: The application should remain performant
on older/simpler devices.
5. **Offline-First When Possible**: Key functionality should work offline when feasible.
## Project Technologies
- Typescript using ES6 classes using vue-facing-decorator
- TailwindCSS
- Vite Build Tool
- Playwright E2E testing
- IndexDB
- Camera, Image uploads, QR Code reader, ...
## Mobile Features
- Deep Linking
- Local Notifications via a custom Capacitor plugin
## Project Architecture
- The application must work on web browser, PWA (Progressive Web Application),
desktop via Electron, and mobile via Capacitor
- Building for each platform is managed via Vite
## Core Development Principles
### DRY development
- **Code Reuse**
- Extract common functionality into utility functions
- Create reusable components for UI patterns
- Implement service classes for shared business logic
- Use mixins for cross-cutting concerns
- Leverage TypeScript interfaces for shared type definitions
- **Component Patterns**
- Create base components for common UI elements
- Implement higher-order components for shared behavior
- Use slot patterns for flexible component composition
- Create composable services for business logic
- Implement factory patterns for component creation
- **State Management**
- Centralize state in Pinia stores
- Use computed properties for derived state
- Implement shared state selectors
- Create reusable state mutations
- Use action creators for common operations
- **Error Handling**
- Implement centralized error handling
- Create reusable error components
- Use error boundary components
- Implement consistent error logging
- Create error type definitions
- **Type Definitions**
- Create shared interfaces for common data structures
- Use type aliases for complex types
- Implement generic types for reusable components
- Create utility types for common patterns
- Use discriminated unions for state management
- **API Integration**
- Create reusable API client classes
- Implement request/response interceptors
- Use consistent error handling patterns
- Create type-safe API endpoints
- Implement caching strategies
- **Platform Services**
- Abstract platform-specific code behind interfaces
- Create platform-agnostic service layers
- Implement feature detection
- Use dependency injection for services
- Create service factories
- **Testing**
- Create reusable test utilities
- Implement test factories
- Use shared test configurations
- Create reusable test helpers
- Implement consistent test patterns
- F.I.R.S.T. (for Unit Tests)
F – Fast
I – Independent
R – Repeatable
S – Self-validating
T – Timely
### SOLID Principles
- **Single Responsibility**: Each class/component should have only one reason to
change
- Components should focus on one specific feature (e.g., QR scanning, DID management)
- Services should handle one type of functionality (e.g., platform services,
crypto services)
- Utilities should provide focused helper functions
- **Open/Closed**: Software entities should be open for extension but closed for
modification
- Use interfaces for service definitions
- Implement plugin architecture for platform-specific features
- Allow component behavior extension through props and events
- **Liskov Substitution**: Objects should be replaceable with their subtypes
- Platform services should work consistently across web/mobile
- Authentication providers should be interchangeable
- Storage implementations should be swappable
- **Interface Segregation**: Clients shouldn't depend on interfaces they don't use
- Break down large service interfaces into smaller, focused ones
- Component props should be minimal and purposeful
- Event emissions should be specific and targeted
- **Dependency Inversion**: High-level modules shouldn't depend on low-level modules
- Use dependency injection for services
- Abstract platform-specific code behind interfaces
- Implement factory patterns for component creation
### Law of Demeter
- Components should only communicate with immediate dependencies
- Avoid chaining method calls (e.g., `this.service.getUser().getProfile().getName()`)
- Use mediator patterns for complex component interactions
- Implement facade patterns for subsystem access
- Keep component communication through defined events and props
### Composition over Inheritance
- Prefer building components through composition
- Use mixins for shared functionality
- Implement feature toggles through props
- Create higher-order components for common patterns
- Use service composition for complex features
### Interface Segregation
- Define clear interfaces for services
- Keep component APIs minimal and focused
- Split large interfaces into smaller, specific ones
- Use TypeScript interfaces for type definitions
- Implement role-based interfaces for different use cases
### Fail Fast
- Validate inputs early in the process
- Use TypeScript strict mode
- Implement comprehensive error handling
- Add runtime checks for critical operations
- Use assertions for development-time validation
### Principle of Least Astonishment
- Follow Vue.js conventions consistently
- Use familiar naming patterns
- Implement predictable component behaviors
- Maintain consistent error handling
- Keep UI interactions intuitive
### Information Hiding
- Encapsulate implementation details
- Use private class members
- Implement proper access modifiers
- Hide complex logic behind simple interfaces
- Use TypeScript's access modifiers effectively
### Single Source of Truth
- Use Pinia for state management
- Maintain one source for user data
- Centralize configuration management
- Use computed properties for derived state
- Implement proper state synchronization
### Principle of Least Privilege
- Implement proper access control
- Use minimal required permissions
- Follow privacy-by-design principles
- Restrict component access to necessary data
- Implement proper authentication/authorization

43
.cursor/rules/asset_configuration.mdc

@ -1,32 +1,61 @@
--- ---
alwaysApply: true description: when doing anything with capacitor assets
alwaysApply: false
--- ---
# Asset Configuration Directive # Asset Configuration Directive
*Scope: Assets Only (icons, splashes, image pipelines) — not overall build orchestration*
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Asset management guidelines
*Scope: Assets Only (icons, splashes, image pipelines) — not overall build
orchestration*
## Intent ## Intent
- Version **asset configuration files** (optionally dev-time generated). - Version **asset configuration files** (optionally dev-time generated).
- **Do not** version platform asset outputs (Android/iOS/Electron); generate them **at build-time** with standard tools. - **Do not** version platform asset outputs (Android/iOS/Electron); generate
them **at build-time** with standard tools.
- Keep existing per-platform build scripts unchanged. - Keep existing per-platform build scripts unchanged.
## Source of Truth ## Source of Truth
- **Preferred (Capacitor default):** `resources/` as the single master source. - **Preferred (Capacitor default):** `resources/` as the single master source.
- **Alternative:** `assets/` is acceptable **only** if `capacitor-assets` is explicitly configured to read from it. - **Alternative:** `assets/` is acceptable **only** if `capacitor-assets` is
- **Never** maintain both `resources/` and `assets/` as parallel sources. Migrate and delete the redundant folder. explicitly configured to read from it.
- **Never** maintain both `resources/` and `assets/` as parallel sources.
Migrate and delete the redundant folder.
## Config Files ## Config Files
- Live under: `config/assets/` (committed). - Live under: `config/assets/` (committed).
- Examples: - Examples:
- `config/assets/capacitor-assets.config.json` (or the path the tool expects) - `config/assets/capacitor-assets.config.json` (or the path the tool
expects)
- `config/assets/android.assets.json` - `config/assets/android.assets.json`
- `config/assets/ios.assets.json` - `config/assets/ios.assets.json`
- `config/assets/common.assets.yaml` (optional shared layer) - `config/assets/common.assets.yaml` (optional shared layer)
- **Dev-time generation allowed** for these configs; **build-time generation is forbidden**. - **Dev-time generation allowed** for these configs; **build-time
generation is forbidden**.
## Build-Time Behavior ## Build-Time Behavior
- Build generates platform assets (not configs) using the standard chain: - Build generates platform assets (not configs) using the standard chain:
```bash ```bash
npm run build:capacitor # web build via Vite (.mts) npm run build:capacitor # web build via Vite (.mts)
npx cap sync npx cap sync
npx capacitor-assets generate # produces platform assets; not committed npx capacitor-assets generate # produces platform assets; not committed
# then platform-specific build steps # then platform-specific build steps
```
---
**Status**: Active asset management directive
**Priority**: Medium
**Estimated Effort**: Ongoing reference
**Dependencies**: capacitor-assets toolchain
**Stakeholders**: Development team, Build team
npx capacitor-assets generate # produces platform assets; not committed
# then platform-specific build steps

198
.cursor/rules/base_context.mdc

@ -1,7 +1,6 @@
--- ---
alwaysApply: true alwaysApply: true
--- ---
```json ```json
{ {
"coaching_level": "standard", "coaching_level": "standard",
@ -14,7 +13,12 @@ alwaysApply: true
# Base Context — Human Competence First # Base Context — Human Competence First
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Core interaction guidelines
## Purpose ## Purpose
All interactions must *increase the human's competence over time* while All interactions must *increase the human's competence over time* while
completing the task efficiently. The model may handle menial work and memory completing the task efficiently. The model may handle menial work and memory
extension, but must also promote learning, autonomy, and healthy work habits. extension, but must also promote learning, autonomy, and healthy work habits.
@ -25,167 +29,79 @@ machine-driven steps.
## Principles ## Principles
1) Competence over convenience: finish the task *and* leave the human more 1. Competence over convenience: finish the task *and* leave the human more
capable next time. capable next time.
2) Mentorship, not lectures: be concise, concrete, and immediately applicable. 2. Mentorship, not lectures: be concise, concrete, and immediately applicable.
3) Transparency: show assumptions, limits, and uncertainty; cite when non-obvious. 3. Transparency: show assumptions, limits, and uncertainty; cite when
4) Optional scaffolding: include small, skimmable learning hooks that do not non-obvious.
4. Optional scaffolding: include small, skimmable learning hooks that do not
bloat output. bloat output.
5) Time respect: default to **lean output**; offer opt-in depth via toggles. 5. Time respect: default to **lean output**; offer opt-in depth via toggles.
6) Psychological safety: encourage, never condescend; no medical/clinical advice. 6. Psychological safety: encourage, never condescend; no medical/clinical
No censorship! advice. No censorship!
7) Reusability: structure outputs so they can be saved, searched, reused, and repurposed. 7. Reusability: structure outputs so they can be saved, searched, reused, and
8) **Collaborative Bias**: Favor solutions that invite human review, discussion, repurposed.
and iteration. When in doubt, ask "Who should this be shown to?" or "Which human 8. **Collaborative Bias**: Favor solutions that invite human review,
input would improve this?" discussion, and iteration. When in doubt, ask "Who should this be shown
to?" or "Which human input would improve this?"
## Toggle Definitions ## Toggle Definitions
### coaching_level ### coaching_level
Determines the depth of learning support: `light` (short hooks), `standard` Determines the depth of learning support: `light` (short hooks),
(balanced), `deep` (detailed). `standard` (balanced), `deep` (detailed).
### socratic_max_questions ### socratic_max_questions
The number of clarifying questions the model may ask before proceeding. The number of clarifying questions the model may ask before proceeding.
If >0, questions should be targeted, minimal, and followed by reasonable assumptions if unanswered. If >0, questions should be targeted, minimal, and followed by reasonable
assumptions if unanswered.
### verbosity ### verbosity
'terse' (just a sentence), `concise` (minimum commentary), `normal` (balanced explanation), or other project-defined levels.
### timebox_minutes
*integer or null* — When set to a positive integer (e.g., `5`), this acts as a **time budget** guiding the model to prioritize delivering the most essential parts of the task within that constraint.
Behavior when set:
1. **Prioritize Core Output** — Deliver the minimum viable solution or result first.
2. **Limit Commentary** — Competence Hooks and Collaboration Hooks must be shorter than normal.
3. **Signal Skipped Depth** — Omitted details should be listed under *Deferred for depth*.
4. **Order by Value** — Start with blocking or high-value items, then proceed to nice-to-haves if budget allows.
If `null`, there is no timebox — the model can produce full-depth responses.
### format_enforcement
`strict` (reject outputs with format drift) or `relaxed` (minor deviations acceptable).
## Modes (select or combine)
- **Doer**: produce the artifact fast, minimal commentary.
- **Mentor**: add short "why/how" notes + next-step pointers.
- **Socratic**: ask up to N targeted questions when requirements are ambiguous.
- **Pair-Programmer/Pair-Writer**: explain tradeoffs as you implement.
- **Facilitator**: structure output to be reviewable, commentable, and ready for group discussion.
Default: Doer + short Mentor notes.
## Competence & Collaboration Levers (keep lightweight)
- "Why this works" (≤3 bullets)
- "Common pitfalls" (≤3 bullets)
- "Next skill unlock" (1 tiny action or reading)
- "Teach-back" (1 sentence prompt the human can answer to self-check)
- "Discussion prompts" (≤2 short questions for peers/stakeholders)
## Output Contract (apply to every deliverable)
- Clear **Objective** (1 line)
- **Result** (artifact/code/answer)
- **Use/Run** (how to apply/test)
- **Competence Hooks** (the 4 learning levers above, kept terse)
- **Collaboration Hooks** (discussion prompts or group review steps)
- **Assumptions & Limits**
- **References** (if used; links or titles)
## Do-Not
- No filler, hedging, or moralizing.
- No medical/mental-health advice; keep "healthy habits" to general work practices.
- No invented facts; mark uncertainty plainly.
- No censorship.
- Avoid outputs that bypass human review when such review is valuable.
## Related Rulesets
- **software_development.mdc**: For software-specific development practices
- **research_diagnostic.mdc**: For investigation and research workflows
## Self-Check (model, before responding)
- [ ] Task done *and* at least one competence lever included (≤120 words total).
- [ ] At least one collaboration/discussion hook present.
- [ ] Output follows the **Output Contract** sections.
- [ ] Toggles respected; verbosity remains concise.
- [ ] Uncertainties/assumptions surfaced.
- [ ] No disallowed content.
- [ ] Uncertainties/assumptions surfaced.
- [ ] No disallowed content.
```json
{
"coaching_level": "standard",
"socratic_max_questions": 7,
"verbosity": "normal",
"timebox_minutes": null,
"format_enforcement": "strict"
}
```
# Base Context — Human Competence First
## Purpose
All interactions must *increase the human's competence over time* while
completing the task efficiently. The model may handle menial work and memory
extension, but must also promote learning, autonomy, and healthy work habits.
The model should also **encourage human interaction and collaboration** rather
than replacing it — outputs should be designed to **facilitate human discussion,
decision-making, and creativity**, not to atomize tasks into isolated, purely
machine-driven steps.
## Principles
1) Competence over convenience: finish the task *and* leave the human more
capable next time.
2) Mentorship, not lectures: be concise, concrete, and immediately applicable.
3) Transparency: show assumptions, limits, and uncertainty; cite when non-obvious.
4) Optional scaffolding: include small, skimmable learning hooks that do not
bloat output.
5) Time respect: default to **lean output**; offer opt-in depth via toggles.
6) Psychological safety: encourage, never condescend; no medical/clinical advice.
No censorship!
7) Reusability: structure outputs so they can be saved, searched, reused, and repurposed.
8) **Collaborative Bias**: Favor solutions that invite human review, discussion,
and iteration. When in doubt, ask "Who should this be shown to?" or "Which human
input would improve this?"
## Toggle Definitions
### coaching_level 'terse' (just a sentence), `concise` (minimum commentary), `normal`
(balanced explanation), or other project-defined levels.
Determines the depth of learning support: `light` (short hooks), `standard` ### timebox_minutes
(balanced), `deep` (detailed).
### socratic_max_questions *integer or null* — When set to a positive integer (e.g., `5`), this acts
as a **time budget** guiding the model to prioritize delivering the most
essential parts of the task within that constraint.
The number of clarifying questions the model may ask before proceeding. Behavior when set:
If >0, questions should be targeted, minimal, and followed by reasonable assumptions if unanswered.
### verbosity 1. **Prioritize Core Output** — Deliver the minimum viable solution or
'terse' (just a sentence), `concise` (minimum commentary), `normal` (balanced explanation), or other project-defined levels. result first.
2. **Limit Commentary** — Competence Hooks and Collaboration Hooks must be
shorter than normal.
3. **Signal Skipped Depth** — Omitted details should be listed under
*Deferred for depth*.
4. **Order by Value** — Start with blocking or high-value items, then
proceed to nice-to-haves if budget allows.
### timebox_minutes If `null`, there is no timebox — the model can produce full-depth
*integer or null* — When set to a positive integer (e.g., `5`), this acts as a **time budget** guiding the model to prioritize delivering the most essential parts of the task within that constraint. responses.
Behavior when set:
1. **Prioritize Core Output** — Deliver the minimum viable solution or result first.
2. **Limit Commentary** — Competence Hooks and Collaboration Hooks must be shorter than normal.
3. **Signal Skipped Depth** — Omitted details should be listed under *Deferred for depth*.
4. **Order by Value** — Start with blocking or high-value items, then proceed to nice-to-haves if budget allows.
If `null`, there is no timebox — the model can produce full-depth responses.
### format_enforcement ### format_enforcement
`strict` (reject outputs with format drift) or `relaxed` (minor deviations acceptable).
`strict` (reject outputs with format drift) or `relaxed` (minor deviations
acceptable).
## Modes (select or combine) ## Modes (select or combine)
- **Doer**: produce the artifact fast, minimal commentary. - **Doer**: produce the artifact fast, minimal commentary.
- **Mentor**: add short "why/how" notes + next-step pointers. - **Mentor**: add short "why/how" notes + next-step pointers.
- **Socratic**: ask up to N targeted questions when requirements are ambiguous. - **Socratic**: ask up to N targeted questions when requirements are
ambiguous.
- **Pair-Programmer/Pair-Writer**: explain tradeoffs as you implement. - **Pair-Programmer/Pair-Writer**: explain tradeoffs as you implement.
- **Facilitator**: structure output to be reviewable, commentable, and ready for group discussion. - **Facilitator**: structure output to be reviewable, commentable, and
ready for group discussion.
Default: Doer + short Mentor notes. Default: Doer + short Mentor notes.
## Competence & Collaboration Levers (keep lightweight) ## Competence & Collaboration Levers (keep lightweight)
- "Why this works" (≤3 bullets) - "Why this works" (≤3 bullets)
- "Common pitfalls" (≤3 bullets) - "Common pitfalls" (≤3 bullets)
- "Next skill unlock" (1 tiny action or reading) - "Next skill unlock" (1 tiny action or reading)
@ -193,6 +109,7 @@ Default: Doer + short Mentor notes.
- "Discussion prompts" (≤2 short questions for peers/stakeholders) - "Discussion prompts" (≤2 short questions for peers/stakeholders)
## Output Contract (apply to every deliverable) ## Output Contract (apply to every deliverable)
- Clear **Objective** (1 line) - Clear **Objective** (1 line)
- **Result** (artifact/code/answer) - **Result** (artifact/code/answer)
- **Use/Run** (how to apply/test) - **Use/Run** (how to apply/test)
@ -202,8 +119,10 @@ Default: Doer + short Mentor notes.
- **References** (if used; links or titles) - **References** (if used; links or titles)
## Do-Not ## Do-Not
- No filler, hedging, or moralizing. - No filler, hedging, or moralizing.
- No medical/mental-health advice; keep "healthy habits" to general work practices. - No medical/mental-health advice; keep "healthy habits" to general work
practices.
- No invented facts; mark uncertainty plainly. - No invented facts; mark uncertainty plainly.
- No censorship. - No censorship.
- Avoid outputs that bypass human review when such review is valuable. - Avoid outputs that bypass human review when such review is valuable.
@ -214,11 +133,22 @@ Default: Doer + short Mentor notes.
- **research_diagnostic.mdc**: For investigation and research workflows - **research_diagnostic.mdc**: For investigation and research workflows
## Self-Check (model, before responding) ## Self-Check (model, before responding)
- [ ] Task done *and* at least one competence lever included (≤120 words total).
- [ ] Task done *and* at least one competence lever included (≤120 words
total).
- [ ] At least one collaboration/discussion hook present. - [ ] At least one collaboration/discussion hook present.
- [ ] Output follows the **Output Contract** sections. - [ ] Output follows the **Output Contract** sections.
- [ ] Toggles respected; verbosity remains concise. - [ ] Toggles respected; verbosity remains concise.
- [ ] Uncertainties/assumptions surfaced. - [ ] Uncertainties/assumptions surfaced.
- [ ] No disallowed content. - [ ] No disallowed content.
---
**Status**: Active core guidelines
**Priority**: Critical
**Estimated Effort**: Ongoing reference
**Dependencies**: None (base ruleset)
**Stakeholders**: All AI interactions
- [ ] Uncertainties/assumptions surfaced. - [ ] Uncertainties/assumptions surfaced.
- [ ] No disallowed content. - [ ] No disallowed content.

45
.cursor/rules/database/absurd-sql.mdc

@ -1,13 +1,23 @@
--- ---
globs: **/db/databaseUtil.ts, **/interfaces/absurd-sql.d.ts, **/src/registerSQLWorker.js, **/services/AbsurdSqlDatabaseService.ts globs: **/db/databaseUtil.ts, **/interfaces/absurd-sql.d.ts, **/src/registerSQLWorker.js, **/
services/AbsurdSqlDatabaseService.ts
alwaysApply: false alwaysApply: false
--- ---
# Absurd SQL - Cursor Development Guide # Absurd SQL - Cursor Development Guide
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Database development guidelines
## Project Overview ## Project Overview
Absurd SQL is a backend implementation for sql.js that enables persistent SQLite databases in the browser by using IndexedDB as a block storage system. This guide provides rules and best practices for developing with this project in Cursor.
Absurd SQL is a backend implementation for sql.js that enables persistent
SQLite databases in the browser by using IndexedDB as a block storage system.
This guide provides rules and best practices for developing with this project
in Cursor.
## Project Structure ## Project Structure
``` ```
absurd-sql/ absurd-sql/
├── src/ # Source code ├── src/ # Source code
@ -20,36 +30,45 @@ absurd-sql/
## Development Rules ## Development Rules
### 1. Worker Thread Requirements ### 1. Worker Thread Requirements
- All SQL operations MUST be performed in a worker thread - All SQL operations MUST be performed in a worker thread
- Main thread should only handle worker initialization and communication - Main thread should only handle worker initialization and communication
- Never block the main thread with database operations - Never block the main thread with database operations
### 2. Code Organization ### 2. Code Organization
- Keep worker code in separate files (e.g., `*.worker.js`) - Keep worker code in separate files (e.g., `*.worker.js`)
- Use ES modules for imports/exports - Use ES modules for imports/exports
- Follow the project's existing module structure - Follow the project's existing module structure
### 3. Required Headers ### 3. Required Headers
When developing locally or deploying, ensure these headers are set: When developing locally or deploying, ensure these headers are set:
``` ```
Cross-Origin-Opener-Policy: same-origin Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp Cross-Origin-Embedder-Policy: require-corp
``` ```
### 4. Browser Compatibility ### 4. Browser Compatibility
- Primary target: Modern browsers with SharedArrayBuffer support - Primary target: Modern browsers with SharedArrayBuffer support
- Fallback mode: Safari (with limitations) - Fallback mode: Safari (with limitations)
- Always test in both modes - Always test in both modes
### 5. Database Configuration ### 5. Database Configuration
Recommended database settings: Recommended database settings:
```sql ```sql
PRAGMA journal_mode=MEMORY; PRAGMA journal_mode=MEMORY;
PRAGMA page_size=8192; -- Optional, but recommended PRAGMA page_size=8192; -- Optional, but recommended
``` ```
### 6. Development Workflow ### 6. Development Workflow
1. Install dependencies: 1. Install dependencies:
```bash ```bash
yarn add @jlongster/sql.js absurd-sql yarn add @jlongster/sql.js absurd-sql
``` ```
@ -60,17 +79,20 @@ PRAGMA page_size=8192; -- Optional, but recommended
- `yarn serve` - Start development server - `yarn serve` - Start development server
### 7. Testing Guidelines ### 7. Testing Guidelines
- Write tests for both SharedArrayBuffer and fallback modes - Write tests for both SharedArrayBuffer and fallback modes
- Use Jest for testing - Use Jest for testing
- Include performance benchmarks for critical operations - Include performance benchmarks for critical operations
### 8. Performance Considerations ### 8. Performance Considerations
- Use bulk operations when possible - Use bulk operations when possible
- Monitor read/write performance - Monitor read/write performance
- Consider using transactions for multiple operations - Consider using transactions for multiple operations
- Avoid unnecessary database connections - Avoid unnecessary database connections
### 9. Error Handling ### 9. Error Handling
- Implement proper error handling for: - Implement proper error handling for:
- Worker initialization failures - Worker initialization failures
- Database connection issues - Database connection issues
@ -78,18 +100,21 @@ PRAGMA page_size=8192; -- Optional, but recommended
- Storage quota exceeded scenarios - Storage quota exceeded scenarios
### 10. Security Best Practices ### 10. Security Best Practices
- Never expose database operations directly to the client - Never expose database operations directly to the client
- Validate all SQL queries - Validate all SQL queries
- Implement proper access controls - Implement proper access controls
- Handle sensitive data appropriately - Handle sensitive data appropriately
### 11. Code Style ### 11. Code Style
- Follow ESLint configuration - Follow ESLint configuration
- Use async/await for asynchronous operations - Use async/await for asynchronous operations
- Document complex database operations - Document complex database operations
- Include comments for non-obvious optimizations - Include comments for non-obvious optimizations
### 12. Debugging ### 12. Debugging
- Use `jest-debug` for debugging tests - Use `jest-debug` for debugging tests
- Monitor IndexedDB usage in browser dev tools - Monitor IndexedDB usage in browser dev tools
- Check worker communication in console - Check worker communication in console
@ -98,6 +123,7 @@ PRAGMA page_size=8192; -- Optional, but recommended
## Common Patterns ## Common Patterns
### Worker Initialization ### Worker Initialization
```javascript ```javascript
// Main thread // Main thread
import { initBackend } from 'absurd-sql/dist/indexeddb-main-thread'; import { initBackend } from 'absurd-sql/dist/indexeddb-main-thread';
@ -109,6 +135,7 @@ function init() {
``` ```
### Database Setup ### Database Setup
```javascript ```javascript
// Worker thread // Worker thread
import initSqlJs from '@jlongster/sql.js'; import initSqlJs from '@jlongster/sql.js';
@ -130,6 +157,7 @@ async function setupDatabase() {
## Troubleshooting ## Troubleshooting
### Common Issues ### Common Issues
1. SharedArrayBuffer not available 1. SharedArrayBuffer not available
- Check COOP/COEP headers - Check COOP/COEP headers
- Verify browser support - Verify browser support
@ -146,6 +174,19 @@ async function setupDatabase() {
- Verify transaction usage - Verify transaction usage
## Resources ## Resources
- [Project Demo](https://priceless-keller-d097e5.netlify.app/)
- [Example Project](https://github.com/jlongster/absurd-example-project)
- [Blog Post](https://jlongster.com/future-sql-web)
- [SQL.js Documentation](https://github.com/sql-js/sql.js/)
---
**Status**: Active database development guidelines
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: Absurd SQL, SQL.js, IndexedDB
**Stakeholders**: Development team, Database team
- [Project Demo](https://priceless-keller-d097e5.netlify.app/) - [Project Demo](https://priceless-keller-d097e5.netlify.app/)
- [Example Project](https://github.com/jlongster/absurd-example-project) - [Example Project](https://github.com/jlongster/absurd-example-project)
- [Blog Post](https://jlongster.com/future-sql-web) - [Blog Post](https://jlongster.com/future-sql-web)

5
.cursor/rules/database/legacy_dexie.mdc

@ -2,4 +2,7 @@
globs: **/databaseUtil.ts,**/AccountViewView.vue,**/ContactsView.vue,**/DatabaseMigration.vue,**/NewIdentifierView.vue globs: **/databaseUtil.ts,**/AccountViewView.vue,**/ContactsView.vue,**/DatabaseMigration.vue,**/NewIdentifierView.vue
alwaysApply: false alwaysApply: false
--- ---
All references in the codebase to Dexie apply only to migration from IndexedDb to Sqlite and will be deprecated in future versions. # What to do with Dexie
All references in the codebase to Dexie apply only to migration from IndexedDb to
Sqlite and will be deprecated in future versions.

53
.cursor/rules/development/type_safety_guide.mdc

@ -1,5 +1,5 @@
--- ---
globs: **/src/**/*,**/scripts/**/*,**/electron/**/* description: when dealing with types and Typesript
alwaysApply: false alwaysApply: false
--- ---
```json ```json
@ -15,8 +15,8 @@ alwaysApply: false
# TypeScript Type Safety Guidelines # TypeScript Type Safety Guidelines
**Author**: Matthew Raymer **Author**: Matthew Raymer
**Date**: 2025-08-16 **Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** **Status**: 🎯 **ACTIVE** - Type safety enforcement
## Overview ## Overview
@ -28,7 +28,8 @@ Practical rules to keep TypeScript strict and predictable. Minimize exceptions.
- Use explicit types. If unknown, use `unknown` and **narrow** via guards. - Use explicit types. If unknown, use `unknown` and **narrow** via guards.
2. **Error handling uses guards** 2. **Error handling uses guards**
- Reuse guards from `src/interfaces/**` (e.g., `isDatabaseError`, `isApiError`). - Reuse guards from `src/interfaces/**` (e.g., `isDatabaseError`,
`isApiError`).
- Catch with `unknown`; never cast to `any`. - Catch with `unknown`; never cast to `any`.
3. **Dynamic property access is type‑safe** 3. **Dynamic property access is type‑safe**
@ -43,26 +44,36 @@ Practical rules to keep TypeScript strict and predictable. Minimize exceptions.
## Type Safety Enforcement ## Type Safety Enforcement
### Core Type Safety Rules ### Core Type Safety Rules
- **No `any` Types**: Use explicit types or `unknown` with proper type guards - **No `any` Types**: Use explicit types or `unknown` with proper type guards
- **Error Handling Uses Guards**: Implement and reuse type guards from `src/interfaces/**` - **Error Handling Uses Guards**: Implement and reuse type guards from
- **Dynamic Property Access**: Use `keyof` + `in` checks for type-safe property access `src/interfaces/**`
- **Dynamic Property Access**: Use `keyof` + `in` checks for type-safe
property access
### Type Guard Patterns ### Type Guard Patterns
- **API Errors**: Use `isApiError(error)` guards for API error handling - **API Errors**: Use `isApiError(error)` guards for API error handling
- **Database Errors**: Use `isDatabaseError(error)` guards for database operations - **Database Errors**: Use `isDatabaseError(error)` guards for database
- **Axios Errors**: Implement `isAxiosError(error)` guards for HTTP error handling operations
- **Axios Errors**: Implement `isAxiosError(error)` guards for HTTP error
handling
### Implementation Guidelines ### Implementation Guidelines
- **Avoid Type Assertions**: Replace `as any` with proper type guards and interfaces
- **Narrow Types Properly**: Use type guards to narrow `unknown` types safely - **Avoid Type Assertions**: Replace `as any` with proper type guards and
- **Document Type Decisions**: Explain complex type structures and their purpose interfaces
- **Narrow Types Properly**: Use type guards to narrow `unknown` types
safely
- **Document Type Decisions**: Explain complex type structures and their
purpose
## Minimal Special Cases (document in PR when used) ## Minimal Special Cases (document in PR when used)
- **Vue refs / instances**: Use `ComponentPublicInstance` or specific component - **Vue refs / instances**: Use `ComponentPublicInstance` or specific
types for dynamic refs. component types for dynamic refs.
- **3rd‑party libs without types**: Narrow immediately to a **known interface**; - **3rd‑party libs without types**: Narrow immediately to a **known
do not leave `any` hanging. interface**; do not leave `any` hanging.
## Patterns (short) ## Patterns (short)
@ -123,3 +134,15 @@ const keys = Object.keys(newSettings).filter(
- TS Handbook — https://www.typescriptlang.org/docs/ - TS Handbook — https://www.typescriptlang.org/docs/
- TS‑ESLint — https://typescript-eslint.io/rules/ - TS‑ESLint — https://typescript-eslint.io/rules/
- Vue 3 + TS — https://vuejs.org/guide/typescript/ - Vue 3 + TS — https://vuejs.org/guide/typescript/
---
**Status**: Active type safety guidelines
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: TypeScript, ESLint, Vue 3
**Stakeholders**: Development team
- TS Handbook — https://www.typescriptlang.org/docs/
- TS‑ESLint — https://typescript-eslint.io/rules/
- Vue 3 + TS — https://vuejs.org/guide/typescript/

6
.cursor/rules/features/camera-implementation.mdc

@ -1,13 +1,13 @@
--- ---
description: description: when dealing with cameras in the application
globs:
alwaysApply: false alwaysApply: false
--- ---
# Camera Implementation Documentation # Camera Implementation Documentation
## Overview ## Overview
This document describes how camera functionality is implemented across the TimeSafari application. The application uses cameras for two main purposes: This document describes how camera functionality is implemented across the
TimeSafari application. The application uses cameras for two main purposes:
1. QR Code scanning 1. QR Code scanning
2. Photo capture 2. Photo capture

81
.cursor/rules/investigation_report_example.mdc

@ -1,76 +1,117 @@
# Investigation Report Example # Investigation Report Example
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Investigation methodology example
## Investigation — Registration Dialog Test Flakiness ## Investigation — Registration Dialog Test Flakiness
## Objective ## Objective
Identify root cause of flaky tests related to registration dialogs in contact import scenarios.
Identify root cause of flaky tests related to registration dialogs in contact
import scenarios.
## System Map ## System Map
- User action → ContactInputForm → ContactsView.addContact() → handleRegistrationPrompt()
- User action → ContactInputForm → ContactsView.addContact() →
handleRegistrationPrompt()
- setTimeout(1000ms) → Modal dialog → User response → Registration API call - setTimeout(1000ms) → Modal dialog → User response → Registration API call
- Test execution → Wait for dialog → Assert dialog content → Click response button - Test execution → Wait for dialog → Assert dialog content → Click response
button
## Findings (Evidence) ## Findings (Evidence)
- **1-second timeout causes flakiness** — evidence: `src/views/ContactsView.vue:971-1000`; setTimeout(..., 1000) in handleRegistrationPrompt()
- **Import flow bypasses dialogs** — evidence: `src/views/ContactImportView.vue:500-520`; importContacts() calls $insertContact() directly, no handleRegistrationPrompt() - **1-second timeout causes flakiness** — evidence:
- **Dialog only appears in direct add flow** — evidence: `src/views/ContactsView.vue:774-800`; addContact() calls handleRegistrationPrompt() after database insert `src/views/ContactsView.vue:971-1000`; setTimeout(..., 1000) in
handleRegistrationPrompt()
- **Import flow bypasses dialogs** — evidence:
`src/views/ContactImportView.vue:500-520`; importContacts() calls
$insertContact() directly, no handleRegistrationPrompt()
- **Dialog only appears in direct add flow** — evidence:
`src/views/ContactsView.vue:774-800`; addContact() calls
handleRegistrationPrompt() after database insert
## Hypotheses & Failure Modes ## Hypotheses & Failure Modes
- H1: 1-second timeout makes dialog appearance unpredictable; would fail when tests run faster than 1000ms
- H2: Test environment timing differs from development; watch for CI vs local test differences - H1: 1-second timeout makes dialog appearance unpredictable; would fail when
tests run faster than 1000ms
- H2: Test environment timing differs from development; watch for CI vs local
test differences
## Corrections ## Corrections
- Updated: "Multiple dialogs interfere with imports" → "Import flow never triggers dialogs - they only appear in direct contact addition"
- Updated: "Complex batch registration needed" → "Simple timeout removal and test mode flag sufficient" - Updated: "Multiple dialogs interfere with imports" → "Import flow never
triggers dialogs - they only appear in direct contact addition"
- Updated: "Complex batch registration needed" → "Simple timeout removal and
test mode flag sufficient"
## Diagnostics (Next Checks) ## Diagnostics (Next Checks)
- [ ] Repro on CI environment vs local - [ ] Repro on CI environment vs local
- [ ] Measure actual dialog appearance timing - [ ] Measure actual dialog appearance timing
- [ ] Test with setTimeout removed - [ ] Test with setTimeout removed
- [ ] Verify import flow doesn't call handleRegistrationPrompt - [ ] Verify import flow doesn't call handleRegistrationPrompt
## Risks & Scope ## Risks & Scope
- Impacted: Contact addition tests, registration workflow tests; Data: None; Users: Test suite reliability
- Impacted: Contact addition tests, registration workflow tests; Data: None;
Users: Test suite reliability
## Decision / Next Steps ## Decision / Next Steps
- Owner: Development Team; By: 2025-01-28 - Owner: Development Team; By: 2025-01-28
- Action: Remove 1-second timeout + add test mode flag; Exit criteria: Tests pass consistently - Action: Remove 1-second timeout + add test mode flag; Exit criteria: Tests
pass consistently
## References ## References
- `src/views/ContactsView.vue:971-1000` - `src/views/ContactsView.vue:971-1000`
- `src/views/ContactImportView.vue:500-520` - `src/views/ContactImportView.vue:500-520`
- `src/views/ContactsView.vue:774-800` - `src/views/ContactsView.vue:774-800`
## Competence Hooks ## Competence Hooks
- Why this works: Code path tracing revealed separate execution flows, evidence disproved initial assumptions
- Common pitfalls: Assuming related functionality without tracing execution paths, over-engineering solutions to imaginary problems
- Next skill: Learn to trace code execution before proposing architectural changes
- Teach-back: "What evidence shows that contact imports bypass registration dialogs?"
--- - Why this works: Code path tracing revealed separate execution flows,
evidence disproved initial assumptions
- Common pitfalls: Assuming related functionality without tracing execution
paths, over-engineering solutions to imaginary problems
- Next skill: Learn to trace code execution before proposing architectural
changes
- Teach-back: "What evidence shows that contact imports bypass registration
dialogs?"
## Key Learning Points ## Key Learning Points
### Evidence-First Approach ### Evidence-First Approach
This investigation demonstrates the importance of: This investigation demonstrates the importance of:
1. **Tracing actual code execution** rather than making assumptions 1. **Tracing actual code execution** rather than making assumptions
2. **Citing specific evidence** with file:line references 2. **Citing specific evidence** with file:line references
3. **Validating problem scope** before proposing solutions 3. **Validating problem scope** before proposing solutions
4. **Considering simpler alternatives** before complex architectural changes 4. **Considering simpler alternatives** before complex architectural changes
### Code Path Tracing Value ### Code Path Tracing Value
By tracing the execution paths, we discovered: By tracing the execution paths, we discovered:
- Import flow and direct add flow are completely separate - Import flow and direct add flow are completely separate
- The "multiple dialog interference" problem didn't exist - The "multiple dialog interference" problem didn't exist
- A simple timeout removal would solve the actual issue - A simple timeout removal would solve the actual issue
### Prevention of Over-Engineering ### Prevention of Over-Engineering
The investigation prevented: The investigation prevented:
- Unnecessary database schema changes - Unnecessary database schema changes
- Complex batch registration systems - Complex batch registration systems
- Migration scripts for non-existent problems - Migration scripts for non-existent problems
- Architectural changes based on assumptions - Architectural changes based on assumptions
description:
globs:
alwaysApply: false
--- ---
**Status**: Active investigation methodology
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: software_development.mdc
**Stakeholders**: Development team, QA team

13
.cursor/rules/logging_standards.mdc

@ -1,11 +1,7 @@
---
globs: *.vue,*.ts,*.tsx
alwaysApply: false
---
# Agent Contract — TimeSafari Logging (Unified, MANDATORY) # Agent Contract — TimeSafari Logging (Unified, MANDATORY)
**Author**: Matthew Raymer **Author**: Matthew Raymer
**Date**: 2025-08-15 **Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Mandatory logging standards **Status**: 🎯 **ACTIVE** - Mandatory logging standards
## Overview ## Overview
@ -220,6 +216,7 @@ logger.debug('[FeedFilters] Filter toggled', this.hasVisibleDid);
--- ---
**Status**: Active and enforced **Status**: Active and enforced
**Last Updated**: 2025-08-15 08:11:46Z **Priority**: Critical
**Version**: 1.0 **Estimated Effort**: Ongoing reference
**Maintainer**: Matthew Raymer **Dependencies**: TimeSafari logger utility
**Stakeholders**: Development team, Code review team

4
.cursor/rules/research_diagnostic.mdc

@ -31,6 +31,7 @@ steps—**not** code changes.
## Enhanced with Software Development Ruleset ## Enhanced with Software Development Ruleset
When investigating software issues, also apply: When investigating software issues, also apply:
- **Code Path Tracing**: Required for technical investigations - **Code Path Tracing**: Required for technical investigations
- **Evidence Validation**: Ensure claims are code-backed - **Evidence Validation**: Ensure claims are code-backed
- **Solution Complexity Assessment**: Justify architectural changes - **Solution Complexity Assessment**: Justify architectural changes
@ -117,6 +118,7 @@ Copy/paste and fill:
## Code Path Tracing (Required for Software Investigations) ## Code Path Tracing (Required for Software Investigations)
Before proposing solutions, trace the actual execution path: Before proposing solutions, trace the actual execution path:
- [ ] **Entry Points**: Identify where the flow begins (user action, API call, etc.) - [ ] **Entry Points**: Identify where the flow begins (user action, API call, etc.)
- [ ] **Component Flow**: Map which components/methods are involved - [ ] **Component Flow**: Map which components/methods are involved
- [ ] **Data Path**: Track how data moves through the system - [ ] **Data Path**: Track how data moves through the system
@ -136,11 +138,13 @@ Before proposing solutions, trace the actual execution path:
## Integration with Other Rulesets ## Integration with Other Rulesets
### With software_development.mdc ### With software_development.mdc
- **Enhanced Evidence Validation**: Use code path tracing for technical investigations - **Enhanced Evidence Validation**: Use code path tracing for technical investigations
- **Architecture Assessment**: Apply complexity justification to proposed solutions - **Architecture Assessment**: Apply complexity justification to proposed solutions
- **Impact Analysis**: Assess effects on existing systems before recommendations - **Impact Analysis**: Assess effects on existing systems before recommendations
### With base_context.mdc ### With base_context.mdc
- **Competence Building**: Focus on technical investigation skills - **Competence Building**: Focus on technical investigation skills
- **Collaboration**: Structure outputs for team review and discussion - **Collaboration**: Structure outputs for team review and discussion

148
.cursor/rules/software_development.mdc

@ -1,66 +1,144 @@
# Software Development Ruleset # Software Development Ruleset
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Core development guidelines
## Purpose ## Purpose
Specialized guidelines for software development tasks including code review, debugging, architecture decisions, and testing.
Specialized guidelines for software development tasks including code review,
debugging, architecture decisions, and testing.
## Core Principles ## Core Principles
### 1. Evidence-First Development ### 1. Evidence-First Development
- **Code Citations Required**: Always cite specific file:line references when making claims
- **Execution Path Tracing**: Trace actual code execution before proposing architectural changes - **Code Citations Required**: Always cite specific file:line references when
making claims
- **Execution Path Tracing**: Trace actual code execution before proposing
architectural changes
- **Assumption Validation**: Flag assumptions as "assumed" vs "evidence-based" - **Assumption Validation**: Flag assumptions as "assumed" vs "evidence-based"
### 2. Code Review Standards ### 2. Code Review Standards
- **Trace Before Proposing**: Always trace execution paths before suggesting changes
- **Trace Before Proposing**: Always trace execution paths before suggesting
changes
- **Evidence Over Inference**: Prefer code citations over logical deductions - **Evidence Over Inference**: Prefer code citations over logical deductions
- **Scope Validation**: Confirm the actual scope of problems before proposing solutions - **Scope Validation**: Confirm the actual scope of problems before proposing
solutions
### 3. Problem-Solution Validation ### 3. Problem-Solution Validation
- **Problem Scope**: Does the solution address the actual problem? - **Problem Scope**: Does the solution address the actual problem?
- **Evidence Alignment**: Does the solution match the evidence? - **Evidence Alignment**: Does the solution match the evidence?
- **Complexity Justification**: Is added complexity justified by real needs? - **Complexity Justification**: Is added complexity justified by real needs?
- **Alternative Analysis**: What simpler solutions were considered? - **Alternative Analysis**: What simpler solutions were considered?
### 4. Dependency Management & Environment Validation
- **Pre-build Validation**: Always validate critical dependencies before executing
build scripts
- **Environment Consistency**: Ensure team members have identical development
environments
- **Dependency Verification**: Check that required packages are installed and
accessible
- **Path Resolution**: Use `npx` for local dependencies to avoid PATH issues
## Required Workflows ## Required Workflows
### Before Proposing Changes ### Before Proposing Changes
- [ ] **Code Path Tracing**: Map execution flow from entry to exit - [ ] **Code Path Tracing**: Map execution flow from entry to exit
- [ ] **Evidence Collection**: Gather specific code citations and logs - [ ] **Evidence Collection**: Gather specific code citations and logs
- [ ] **Assumption Surfacing**: Identify what's proven vs. inferred - [ ] **Assumption Surfacing**: Identify what's proven vs. inferred
- [ ] **Scope Validation**: Confirm the actual extent of the problem - [ ] **Scope Validation**: Confirm the actual extent of the problem
- [ ] **Dependency Validation**: Verify all required dependencies are available
and accessible
### During Solution Design ### During Solution Design
- [ ] **Evidence Alignment**: Ensure solution addresses proven problems - [ ] **Evidence Alignment**: Ensure solution addresses proven problems
- [ ] **Complexity Assessment**: Justify any added complexity - [ ] **Complexity Assessment**: Justify any added complexity
- [ ] **Alternative Evaluation**: Consider simpler approaches first - [ ] **Alternative Evaluation**: Consider simpler approaches first
- [ ] **Impact Analysis**: Assess effects on existing systems - [ ] **Impact Analysis**: Assess effects on existing systems
- [ ] **Environment Impact**: Assess how changes affect team member setups
## Software-Specific Competence Hooks ## Software-Specific Competence Hooks
### Evidence Validation ### Evidence Validation
- **"What code path proves this claim?"** - **"What code path proves this claim?"**
- **"How does data actually flow through the system?"** - **"How does data actually flow through the system?"**
- **"What am I assuming vs. what can I prove?"** - **"What am I assuming vs. what can I prove?"**
### Code Tracing ### Code Tracing
- **"What's the execution path from user action to system response?"** - **"What's the execution path from user action to system response?"**
- **"Which components actually interact in this scenario?"** - **"Which components actually interact in this scenario?"**
- **"Where does the data originate and where does it end up?"** - **"Where does the data originate and where does it end up?"**
### Architecture Decisions ### Architecture Decisions
- **"What evidence shows this change is necessary?"** - **"What evidence shows this change is necessary?"**
- **"What simpler solution could achieve the same goal?"** - **"What simpler solution could achieve the same goal?"**
- **"How does this change affect the existing system architecture?"** - **"How does this change affect the existing system architecture?"**
### Dependency & Environment Management
- **"What dependencies does this feature require and are they properly
declared?"**
- **"How will this change affect team member development environments?"**
- **"What validation can we add to catch dependency issues early?"**
## Dependency Management Best Practices
### Pre-build Validation
- **Check Critical Dependencies**: Validate essential tools before executing build
scripts
- **Use npx for Local Dependencies**: Prefer `npx tsx` over direct `tsx` to
avoid PATH issues
- **Environment Consistency**: Ensure all team members have identical dependency
versions
### Common Pitfalls
- **Missing npm install**: Team members cloning without running `npm install`
- **PATH Issues**: Direct command execution vs. npm script execution differences
- **Version Mismatches**: Different Node.js/npm versions across team members
### Validation Strategies
- **Dependency Check Scripts**: Implement pre-build validation for critical
dependencies
- **Environment Requirements**: Document and enforce minimum Node.js/npm versions
- **Onboarding Checklist**: Standardize team member setup procedures
### Error Messages and Guidance
- **Specific Error Context**: Provide clear guidance when dependency issues occur
- **Actionable Solutions**: Direct users to specific commands (`npm install`,
`npm run check:dependencies`)
- **Environment Diagnostics**: Implement comprehensive environment validation
tools
### Build Script Enhancements
- **Early Validation**: Check dependencies before starting build processes
- **Graceful Degradation**: Continue builds when possible but warn about issues
- **Helpful Tips**: Remind users about dependency management best practices
## Integration with Other Rulesets ## Integration with Other Rulesets
### With base_context.mdc ### With base_context.mdc
- Inherits generic competence principles - Inherits generic competence principles
- Adds software-specific evidence requirements - Adds software-specific evidence requirements
- Maintains collaboration and learning focus - Maintains collaboration and learning focus
### With research_diagnostic.mdc ### With research_diagnostic.mdc
- Enhances investigation with code path tracing - Enhances investigation with code path tracing
- Adds evidence validation to diagnostic workflow - Adds evidence validation to diagnostic workflow
- Strengthens problem identification accuracy - Strengthens problem identification accuracy
@ -68,6 +146,7 @@ Specialized guidelines for software development tasks including code review, deb
## Usage Guidelines ## Usage Guidelines
### When to Use This Ruleset ### When to Use This Ruleset
- Code reviews and architectural decisions - Code reviews and architectural decisions
- Bug investigation and debugging - Bug investigation and debugging
- Performance optimization - Performance optimization
@ -75,11 +154,13 @@ Specialized guidelines for software development tasks including code review, deb
- Testing strategy development - Testing strategy development
### When to Combine with Others ### When to Combine with Others
- **base_context + software_development**: General development tasks - **base_context + software_development**: General development tasks
- **research_diagnostic + software_development**: Technical investigations - **research_diagnostic + software_development**: Technical investigations
- **All three**: Complex architectural decisions or major refactoring - **All three**: Complex architectural decisions or major refactoring
## Self-Check (model, before responding) ## Self-Check (model, before responding)
- [ ] Code path traced and documented - [ ] Code path traced and documented
- [ ] Evidence cited with specific file:line references - [ ] Evidence cited with specific file:line references
- [ ] Assumptions clearly flagged as proven vs. inferred - [ ] Assumptions clearly flagged as proven vs. inferred
@ -90,55 +171,10 @@ Specialized guidelines for software development tasks including code review, deb
- [ ] Environment impact assessed for team members - [ ] Environment impact assessed for team members
- [ ] Pre-build validation implemented where appropriate - [ ] Pre-build validation implemented where appropriate
## Additional Core Principles ---
### 4. Dependency Management & Environment Validation
- **Pre-build Validation**: Always validate critical dependencies before executing build scripts
- **Environment Consistency**: Ensure team members have identical development environments
- **Dependency Verification**: Check that required packages are installed and accessible
- **Path Resolution**: Use `npx` for local dependencies to avoid PATH issues
## Additional Required Workflows
### Dependency Validation (Before Proposing Changes)
- [ ] **Dependency Validation**: Verify all required dependencies are available and accessible
### Environment Impact Assessment (During Solution Design)
- [ ] **Environment Impact**: Assess how changes affect team member setups
## Additional Competence Hooks
### Dependency & Environment Management
- **"What dependencies does this feature require and are they properly declared?"**
- **"How will this change affect team member development environments?"**
- **"What validation can we add to catch dependency issues early?"**
## Dependency Management Best Practices
### Pre-build Validation
- **Check Critical Dependencies**: Validate essential tools before executing build scripts
- **Use npx for Local Dependencies**: Prefer `npx tsx` over direct `tsx` to avoid PATH issues
- **Environment Consistency**: Ensure all team members have identical dependency versions
### Common Pitfalls
- **Missing npm install**: Team members cloning without running `npm install`
- **PATH Issues**: Direct command execution vs. npm script execution differences
- **Version Mismatches**: Different Node.js/npm versions across team members
### Validation Strategies
- **Dependency Check Scripts**: Implement pre-build validation for critical dependencies
- **Environment Requirements**: Document and enforce minimum Node.js/npm versions
- **Onboarding Checklist**: Standardize team member setup procedures
### Error Messages and Guidance
- **Specific Error Context**: Provide clear guidance when dependency issues occur
- **Actionable Solutions**: Direct users to specific commands (`npm install`, `npm run check:dependencies`)
- **Environment Diagnostics**: Implement comprehensive environment validation tools
### Build Script Enhancements
- **Early Validation**: Check dependencies before starting build processes
- **Graceful Degradation**: Continue builds when possible but warn about issues
- **Helpful Tips**: Remind users about dependency management best practices
- **Narrow Types Properly**: Use type guards to narrow `unknown` types safely **Status**: Active development guidelines
- **Document Type Decisions**: Explain complex type structures and their purpose **Priority**: High
**Estimated Effort**: Ongoing
**Dependencies**: base_context.mdc, research_diagnostic.mdc
**Stakeholders**: Development team

329
.cursor/rules/time.mdc

@ -0,0 +1,329 @@
---
alwaysApply: true
---
# Time Handling in Development Workflow
**Author**: Matthew Raymer
**Date**: 2025-08-17
**Status**: 🎯 **ACTIVE** - Production Ready
## Overview
This guide establishes **how time should be referenced and used** across the
development workflow. It is not tied to any one project, but applies to **all
feature development, issue investigations, ADRs, and documentation**.
## General Principles
- **Explicit over relative**: Always prefer absolute dates (`2025-08-17`) over
relative references like "last week."
- **ISO 8601 Standard**: Use `YYYY-MM-DD` format for all date references in
docs, issues, ADRs, and commits.
- **Time zones**: Default to **UTC** unless explicitly tied to user-facing
behavior.
- **Precision**: Only specify as much precision as needed (date vs. datetime vs.
timestamp).
- **Consistency**: Align time references across ADRs, commits, and investigation
reports.
## In Documentation & ADRs
- Record decision dates using **absolute ISO dates**.
- For ongoing timelines, state start and end explicitly (e.g., `2025-08-01` →
`2025-08-17`).
- Avoid ambiguous terms like *recently*, *last month*, or *soon*.
- For time-based experiments (e.g., A/B tests), always include:
- Start date
- Expected duration
- Review date checkpoint
## In Code & Commits
- Use **UTC timestamps** in logs, DB migrations, and serialized formats.
- In commits, link changes to **date-bound ADRs or investigation docs**.
- For migrations, include both **applied date** and **intended version window**.
- Use constants for known fixed dates; avoid hardcoding arbitrary strings.
## In Investigations & Research
- Capture **when** an issue occurred (absolute time or version tag).
- When describing failures: note whether they are **time-sensitive** (e.g., after
migrations, cache expirations).
- Record diagnostic timelines in ISO format (not relative).
- For performance regressions, annotate both **baseline timeframe** and
**measurement timeframe**.
## Collaboration Hooks
- During reviews, verify **time references are clear, absolute, and
standardized**.
- In syncs, reframe relative terms ("this week") into shared absolute
references.
- Tag ADRs with both **date created** and **review by** checkpoints.
## Self-Check Before Submitting
- [ ] Did I check the time using the **developer's actual system time and
timezone**?
- [ ] Am I using absolute ISO dates?
- [ ] Is UTC assumed unless specified otherwise?
- [ ] Did I avoid ambiguous relative terms?
- [ ] If duration matters, did I specify both start and end?
- [ ] For future work, did I include a review/revisit date?
## Real-Time Context in Developer Interactions
- The model must always resolve **"current time"** using the **developer's
actual system time and timezone**.
- When generating timestamps (e.g., in investigation logs, ADRs, or examples),
the model should:
- Use the **developer's current local time** by default.
- Indicate the timezone explicitly (e.g., `2025-08-17T10:32-05:00`).
- Optionally provide UTC alongside if context requires cross-team clarity.
- When interpreting relative terms like *now*, *today*, *last week*:
- Resolve them against the **developer's current time**.
- Convert them into **absolute ISO-8601 values** in the output.
## LLM Time Checking Instructions
**CRITICAL**: The LLM must actively query the system for current time rather
than assuming or inventing times.
### How to Check Current Time
#### 1. **Query System Time (Required)**
- **Always start** by querying the current system time using available tools
- **Never assume** what the current time is
- **Never use** placeholder values like "current time" or "now"
#### 2. **Available Time Query Methods**
- **System Clock**: Use `date` command or equivalent system time function
- **Programming Language**: Use language-specific time functions (e.g.,
`Date.now()`, `datetime.now()`)
- **Environment Variables**: Check for time-related environment variables
- **API Calls**: Use time service APIs if available
#### 3. **Required Time Information**
When querying time, always obtain:
- **Current Date**: YYYY-MM-DD format
- **Current Time**: HH:MM:SS format (24-hour)
- **Timezone**: Current system timezone or UTC offset
- **UTC Equivalent**: Convert local time to UTC for cross-team clarity
#### 4. **Time Query Examples**
```bash
# Example: Query system time
$ date
# Expected output: Mon Aug 17 10:32:45 EDT 2025
# Example: Query UTC time
$ date -u
# Expected output: Mon Aug 17 14:32:45 UTC 2025
```
```python
# Example: Python time query
import datetime
current_time = datetime.datetime.now()
utc_time = datetime.datetime.utcnow()
print(f"Local: {current_time}")
print(f"UTC: {utc_time}")
```
```javascript
// Example: JavaScript time query
const now = new Date();
const utc = new Date().toISOString();
console.log(`Local: ${now}`);
console.log(`UTC: ${utc}`);
```
#### 5. **LLM Time Checking Workflow**
1. **Query**: Actively query system for current time
2. **Validate**: Confirm time data is reasonable and current
3. **Format**: Convert to ISO 8601 format
4. **Context**: Provide both local and UTC times when helpful
5. **Document**: Show the source of time information
#### 6. **Error Handling for Time Queries**
- **If time query fails**: Ask user for current time or use "unknown time"
with explanation
- **If timezone unclear**: Default to UTC and ask for clarification
- **If time seems wrong**: Verify with user before proceeding
- **Always log**: Record when and how time was obtained
#### 7. **Time Query Verification**
Before using queried time, verify:
- [ ] Time is recent (within last few minutes)
- [ ] Timezone information is available
- [ ] UTC conversion is accurate
- [ ] Format follows ISO 8601 standard
## Model Behavior Rules
- **Never invent a "fake now"**: All "current time" references must come from
the real system clock available at runtime.
- **Check developer time zone**: If ambiguous, ask for clarification (e.g.,
"Should I use UTC or your local timezone?").
- **Format for clarity**:
- Local time: `YYYY-MM-DDTHH:mm±hh:mm`
- UTC equivalent (if needed): `YYYY-MM-DDTHH:mmZ`
## Examples
### Good
- "Feature flag rollout started on `2025-08-01` and will be reviewed on
`2025-08-21`."
- "Migration applied on `2025-07-15T14:00Z`."
- "Issue reproduced on `2025-08-17T09:00-05:00 (local)` /
`2025-08-17T14:00Z (UTC)`."
### Bad
- "Feature flag rolled out last week."
- "Migration applied recently."
- "Now is August, so we assume this was last month."
### More Examples
#### Issue Reports
- ✅ **Good**: "User reported login failure at `2025-08-17T14:30:00Z`. Issue
persisted until `2025-08-17T15:45:00Z`."
- ❌ **Bad**: "User reported login failure earlier today. Issue lasted for a
while."
#### Release Planning
- ✅ **Good**: "Feature X scheduled for release on `2025-08-25`. Testing
window: `2025-08-20` to `2025-08-24`."
- ❌ **Bad**: "Feature X will be released next week after testing."
#### Performance Monitoring
- ✅ **Good**: "Baseline performance measured on `2025-08-10T09:00:00Z`.
Regression detected on `2025-08-15T14:00:00Z`."
- ❌ **Bad**: "Performance was good last week but got worse this week."
## Technical Implementation Notes
### UTC Storage Principle
- **Store all timestamps in UTC** in databases, logs, and serialized formats
- **Convert to local time only for user display**
- **Use ISO 8601 format** for all storage: `YYYY-MM-DDTHH:mm:ss.sssZ`
### Common Implementation Patterns
#### Database Storage
```sql
-- ✅ Good: Store in UTC
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
-- ❌ Bad: Store in local time
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
```
#### API Responses
```json
// ✅ Good: Include both UTC and local time
{
"eventTime": "2025-08-17T14:00:00Z",
"localTime": "2025-08-17T10:00:00-04:00",
"timezone": "America/New_York"
}
// ❌ Bad: Only local time
{
"eventTime": "2025-08-17T10:00:00-04:00"
}
```
#### Logging
```python
# ✅ Good: Log in UTC with timezone info
logger.info(f"User action at {datetime.utcnow().isoformat()}Z (UTC)")
# ❌ Bad: Log in local time
logger.info(f"User action at {datetime.now()}")
```
### Timezone Handling Best Practices
#### 1. Always Store Timezone Information
- Include IANA timezone identifier (e.g., `America/New_York`)
- Store UTC offset at time of creation
- Handle daylight saving time transitions automatically
#### 2. User Display Considerations
- Convert UTC to user's preferred timezone
- Show timezone abbreviation when helpful
- Use relative time for recent events ("2 hours ago")
#### 3. Edge Case Handling
- **Daylight Saving Time**: Use timezone-aware libraries
- **Leap Seconds**: Handle gracefully (rare but important)
- **Invalid Times**: Validate before processing
### Common Mistakes to Avoid
#### 1. Timezone Confusion
- ❌ **Don't**: Assume server timezone is user timezone
- ✅ **Do**: Always convert UTC to user's local time for display
#### 2. Format Inconsistency
- ❌ **Don't**: Mix different time formats in the same system
- ✅ **Do**: Standardize on ISO 8601 for all storage
#### 3. Relative Time References
- ❌ **Don't**: Use relative terms in persistent storage
- ✅ **Do**: Convert relative terms to absolute timestamps immediately
## References
- [ISO 8601 Date and Time Standard](https://en.wikipedia.org/wiki/ISO_8601)
- [IANA Timezone Database](https://www.iana.org/time-zones)
- [ADR Template](./adr_template.md)
- [Research & Diagnostic Workflow](./research_diagnostic.mdc)
---
**Rule of Thumb**: Every time reference in development artifacts should be
**clear in 6 months without context**, and aligned to the **developer's actual
current time**.
**Technical Rule of Thumb**: **Store in UTC, display in local time, always
include timezone context.**
---
**Status**: Active
**Version**: 1.0
**Maintainer**: Matthew Raymer
**Next Review**: 2025-09-17

324
.cursor/rules/workflow/version_control.mdc

@ -1,133 +1,306 @@
--- ---
alwaysApply: true description: interacting with git
alwaysApply: false
--- ---
# Directive: Peaceful Co-Existence with Developers # Directive: Peaceful Co-Existence with Developers
**Author**: Matthew Raymer
**Date**: 2025-08-19
**Status**: 🎯 **ACTIVE** - Version control guidelines
## 1) Version-Control Ownership ## 1) Version-Control Ownership
* **MUST NOT** run `git add`, `git commit`, or any write action. - **MUST NOT** run `git add`, `git commit`, or any write action.
* **MUST** leave staging/committing to the developer. - **MUST** leave staging/committing to the developer.
## 2) Source of Truth for Commit Text ## 2) Source of Truth for Commit Text
* **MUST** derive messages **only** from: - **MUST** derive messages **only** from:
- files **staged** for commit (primary), and
* files **staged** for commit (primary), and - files **awaiting staging** (context).
* files **awaiting staging** (context). - **MUST** use the **diffs** to inform content.
* **MUST** use the **diffs** to inform content. - **MUST NOT** invent changes or imply work not present in diffs.
* **MUST NOT** invent changes or imply work not present in diffs.
## 3) Mandatory Preview Flow ## 3) Mandatory Preview Flow
* **ALWAYS** present, before any real commit: - **ALWAYS** present, before any real commit:
- file list + brief per-file notes,
* file list + brief per-file notes, - a **draft commit message** (copy-paste ready),
* a **draft commit message** (copy-paste ready), - nothing auto-applied.
* nothing auto-applied.
## 4) Version Synchronization Requirements ## 4) Version Synchronization Requirements
* **MUST** check for version changes in `package.json` before committing - **MUST** check for version changes in `package.json` before committing
* **MUST** ensure `CHANGELOG.md` is updated when `package.json` version changes - **MUST** ensure `CHANGELOG.md` is updated when `package.json` version
* **MUST** validate version format consistency between both files changes
* **MUST** include version bump commits in changelog with proper semantic versioning - **MUST** validate version format consistency between both files
- **MUST** include version bump commits in changelog with proper semantic
versioning
### Version Sync Checklist (Before Commit) ### Version Sync Checklist (Before Commit)
- [ ] `package.json` version matches latest `CHANGELOG.md` entry - [ ] `package.json` version matches latest `CHANGELOG.md` entry
- [ ] New version follows semantic versioning (MAJOR.MINOR.PATCH[-PRERELEASE]) - [ ] New version follows semantic versioning
(MAJOR.MINOR.PATCH[-PRERELEASE])
- [ ] Changelog entry includes all significant changes since last version - [ ] Changelog entry includes all significant changes since last version
- [ ] Version bump commit message follows `build(version): bump to X.Y.Z` format - [ ] Version bump commit message follows `build(version): bump to X.Y.Z`
format
- [ ] Breaking changes properly documented with migration notes - [ ] Breaking changes properly documented with migration notes
- [ ] Alert developer in chat message that version has been updated - [ ] Alert developer in chat message that version has been updated
### Version Change Detection ### Version Change Detection
* **Check for version changes** in staged/unstaged `package.json` - **Check for version changes** in staged/unstaged `package.json`
* **Alert developer** if version changed but changelog not updated - **Alert developer** if version changed but changelog not updated
* **Suggest changelog update** with proper format and content - **Suggest changelog update** with proper format and content
* **Validate semantic versioning** compliance - **Validate semantic versioning** compliance
### Implementation Notes ### Implementation Notes
* **Version Detection**: Compare `package.json` version field with latest changelog entry - **Version Detection**: Compare `package.json` version field with latest
* **Semantic Validation**: Ensure version follows `X.Y.Z[-PRERELEASE]` format changelog entry
* **Changelog Format**: Follow [Keep a Changelog](https://keepachangelog.com/) standards - **Semantic Validation**: Ensure version follows `X.Y.Z[-PRERELEASE]`
* **Breaking Changes**: Use `!` in commit message and `BREAKING CHANGE:` in changelog format
* **Pre-release Versions**: Include beta/alpha/rc suffixes in both files consistently - **Changelog Format**: Follow [Keep a Changelog](https://keepachangelog.com/)
standards
- **Breaking Changes**: Use `!` in commit message and `BREAKING CHANGE:`
in changelog
- **Pre-release Versions**: Include beta/alpha/rc suffixes in both files
consistently
--- ## Commit Message Format (Normative)
# Commit Message Format (Normative)
## A. Subject Line (required) ### A. Subject Line (required)
``` ```
<type>(<scope>)<!>: <summary> <type>(<scope>)<!>: <summary>
``` ```
* **type** (lowercase, Conventional Commits): `feat|fix|refactor|perf|docs|test|build|chore|ci|revert` - **type** (lowercase, Conventional Commits):
* **scope**: optional module/package/area (e.g., `api`, `ui/login`, `db`) `feat|fix|refactor|perf|docs|test|build|chore|ci|revert`
* **!**: include when a breaking change is introduced - **scope**: optional module/package/area (e.g., `api`, `ui/login`, `db`)
* **summary**: imperative mood, ≤ 72 chars, no trailing period - **!**: include when a breaking change is introduced
- **summary**: imperative mood, ≤ 72 chars, no trailing period
**Examples** **Examples**
* `fix(api): handle null token in refresh path` - `fix(api): handle null token in refresh path`
* `feat(ui/login)!: require OTP after 3 failed attempts` - `feat(ui/login)!: require OTP after 3 failed attempts`
## B. Body (optional, when it adds non-obvious value) ### B. Body (optional, when it adds non-obvious value)
* One blank line after subject. - One blank line after subject.
* Wrap at \~72 chars. - Wrap at ~72 chars.
* Explain **what** and **why**, not line-by-line “how”. - Explain **what** and **why**, not line-by-line "how".
* Include brief notes like tests passing or TS/lint issues resolved **only if material**. - Include brief notes like tests passing or TS/lint issues resolved
**only if material**.
**Body checklist** **Body checklist**
* [ ] Problem/symptom being addressed - [ ] Problem/symptom being addressed
* [ ] High-level approach or rationale - [ ] High-level approach or rationale
* [ ] Risks, tradeoffs, or follow-ups (if any) - [ ] Risks, tradeoffs, or follow-ups (if any)
## C. Footer (optional) ### C. Footer (optional)
* Issue refs: `Closes #123`, `Refs #456` - Issue refs: `Closes #123`, `Refs #456`
* Breaking change (alternative to `!`): - Breaking change (alternative to `!`):
`BREAKING CHANGE: <impact + migration note>` `BREAKING CHANGE: <impact + migration note>`
* Authors: `Co-authored-by: Name <email>` - Authors: `Co-authored-by: Name <email>`
* Security: `CVE-XXXX-YYYY: <short note>` (if applicable) - Security: `CVE-XXXX-YYYY: <short note>` (if applicable)
---
## Content Guidance ## Content Guidance
### Include (when relevant) ### Include (when relevant)
* Specific fixes/features delivered - Specific fixes/features delivered
* Symptoms/problems fixed - Symptoms/problems fixed
* Brief note that tests passed or TS/lint errors resolved - Brief note that tests passed or TS/lint errors resolved
### Avoid ### Avoid
* Vague: *improved, enhanced, better* - Vague: *improved, enhanced, better*
* Trivialities: tiny docs, one-liners, pure lint cleanups (separate, focused commits if needed) - Trivialities: tiny docs, one-liners, pure lint cleanups (separate,
* Redundancy: generic blurbs repeated across files focused commits if needed)
* Multi-purpose dumps: keep commits **narrow and focused** - Redundancy: generic blurbs repeated across files
* Long explanations that good inline code comments already cover - Multi-purpose dumps: keep commits **narrow and focused**
- Long explanations that good inline code comments already cover
**Guiding Principle:** Let code and inline docs speak. Use commits to
highlight what isn't obvious.
## Copy-Paste Templates
### Minimal (no body)
```text
<type>(<scope>): <summary>
```
### Standard (with body & footer)
```text
<type>(<scope>)<!>: <summary>
<why-this-change?>
<what-it-does?>
<risks-or-follow-ups?>
Closes #<id>
BREAKING CHANGE: <impact + migration>
Co-authored-by: <Name> <email>
```
**Guiding Principle:** Let code and inline docs speak. Use commits to highlight what isn’t obvious. ## Assistant Output Checklist (before showing the draft)
- [ ] List changed files + 1–2 line notes per file
- [ ] Provide **one** focused draft message (subject/body/footer)
- [ ] Subject ≤ 72 chars, imperative mood, correct `type(scope)!` syntax
- [ ] Body only if it adds non-obvious value
- [ ] No invented changes; aligns strictly with diffs
- [ ] Render as a single copy-paste block for the developer
--- ---
# Copy-Paste Templates **Status**: Active version control guidelines
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: git, package.json, CHANGELOG.md
**Stakeholders**: Development team, AI assistants
- [ ] No invented changes; aligns strictly with diffs
- [ ] Render as a single copy-paste block for the developer
## 1) Version-Control Ownership
- **MUST NOT** run `git add`, `git commit`, or any write action.
- **MUST** leave staging/committing to the developer.
## 2) Source of Truth for Commit Text
- **MUST** derive messages **only** from:
- files **staged** for commit (primary), and
- files **awaiting staging** (context).
- **MUST** use the **diffs** to inform content.
- **MUST NOT** invent changes or imply work not present in diffs.
## 3) Mandatory Preview Flow
- **ALWAYS** present, before any real commit:
- file list + brief per-file notes,
- a **draft commit message** (copy-paste ready),
- nothing auto-applied.
## 4) Version Synchronization Requirements
- **MUST** check for version changes in `package.json` before committing
- **MUST** ensure `CHANGELOG.md` is updated when `package.json` version
changes
- **MUST** validate version format consistency between both files
- **MUST** include version bump commits in changelog with proper semantic
versioning
### Version Sync Checklist (Before Commit)
- [ ] `package.json` version matches latest `CHANGELOG.md` entry
- [ ] New version follows semantic versioning
(MAJOR.MINOR.PATCH[-PRERELEASE])
- [ ] Changelog entry includes all significant changes since last version
- [ ] Version bump commit message follows `build(version): bump to X.Y.Z`
format
- [ ] Breaking changes properly documented with migration notes
- [ ] Alert developer in chat message that version has been updated
### Version Change Detection
- **Check for version changes** in staged/unstaged `package.json`
- **Alert developer** if version changed but changelog not updated
- **Suggest changelog update** with proper format and content
- **Validate semantic versioning** compliance
### Implementation Notes
- **Version Detection**: Compare `package.json` version field with latest
changelog entry
- **Semantic Validation**: Ensure version follows `X.Y.Z[-PRERELEASE]`
format
- **Changelog Format**: Follow [Keep a Changelog](https://keepachangelog.com/)
standards
- **Breaking Changes**: Use `!` in commit message and `BREAKING CHANGE:`
in changelog
- **Pre-release Versions**: Include beta/alpha/rc suffixes in both files
consistently
## Commit Message Format (Normative)
### A. Subject Line (required)
```
<type>(<scope>)<!>: <summary>
```
- **type** (lowercase, Conventional Commits):
`feat|fix|refactor|perf|docs|test|build|chore|ci|revert`
- **scope**: optional module/package/area (e.g., `api`, `ui/login`, `db`)
- **!**: include when a breaking change is introduced
- **summary**: imperative mood, ≤ 72 chars, no trailing period
**Examples**
## Minimal (no body) - `fix(api): handle null token in refresh path`
- `feat(ui/login)!: require OTP after 3 failed attempts`
### B. Body (optional, when it adds non-obvious value)
- One blank line after subject.
- Wrap at ~72 chars.
- Explain **what** and **why**, not line-by-line "how".
- Include brief notes like tests passing or TS/lint issues resolved
**only if material**.
**Body checklist**
- [ ] Problem/symptom being addressed
- [ ] High-level approach or rationale
- [ ] Risks, tradeoffs, or follow-ups (if any)
### C. Footer (optional)
- Issue refs: `Closes #123`, `Refs #456`
- Breaking change (alternative to `!`):
`BREAKING CHANGE: <impact + migration note>`
- Authors: `Co-authored-by: Name <email>`
- Security: `CVE-XXXX-YYYY: <short note>` (if applicable)
## Content Guidance
### Include (when relevant)
- Specific fixes/features delivered
- Symptoms/problems fixed
- Brief note that tests passed or TS/lint errors resolved
### Avoid
- Vague: *improved, enhanced, better*
- Trivialities: tiny docs, one-liners, pure lint cleanups (separate,
focused commits if needed)
- Redundancy: generic blurbs repeated across files
- Multi-purpose dumps: keep commits **narrow and focused**
- Long explanations that good inline code comments already cover
**Guiding Principle:** Let code and inline docs speak. Use commits to
highlight what isn't obvious.
## Copy-Paste Templates
### Minimal (no body)
```text ```text
<type>(<scope>): <summary> <type>(<scope>): <summary>
``` ```
## Standard (with body & footer) ### Standard (with body & footer)
```text ```text
<type>(<scope>)<!>: <summary> <type>(<scope>)<!>: <summary>
@ -141,13 +314,22 @@ BREAKING CHANGE: <impact + migration>
Co-authored-by: <Name> <email> Co-authored-by: <Name> <email>
``` ```
## Assistant Output Checklist (before showing the draft)
- [ ] List changed files + 1–2 line notes per file
- [ ] Provide **one** focused draft message (subject/body/footer)
- [ ] Subject ≤ 72 chars, imperative mood, correct `type(scope)!` syntax
- [ ] Body only if it adds non-obvious value
- [ ] No invented changes; aligns strictly with diffs
- [ ] Render as a single copy-paste block for the developer
--- ---
# Assistant Output Checklist (before showing the draft) **Status**: Active version control guidelines
**Priority**: High
**Estimated Effort**: Ongoing reference
**Dependencies**: git, package.json, CHANGELOG.md
**Stakeholders**: Development team, AI assistants
* [ ] List changed files + 1–2 line notes per file
* [ ] Provide **one** focused draft message (subject/body/footer)
* [ ] Subject ≤ 72 chars, imperative mood, correct `type(scope)!` syntax
* [ ] Body only if it adds non-obvious value
* [ ] No invented changes; aligns strictly with diffs * [ ] No invented changes; aligns strictly with diffs
* [ ] Render as a single copy-paste block for the developer * [ ] Render as a single copy-paste block for the developer

Loading…
Cancel
Save