
--- name: payment-service-integration description: Guides payment service integration: Stripe integration, event ticketing, revenue splits, refund handling. Use when implementing payment processing, ticketing, or financial transactions. --- # Payment Service Integration ## Core Components ### Payment Service Handles payment processing, Stripe integration, and transaction management. ### Event Ticketing Manages event tickets, pricing, and ticket sales. ### Revenue Splits Handles multi-party
Validates technology enhances real world experience, doesn't replace it. Use when implementing features, reviewing UX, or ensuring technology serves life rather than replaces it.
--- name: ai2ai-learning-service description: Guides AI2AI learning service implementation: personality spectrum, compatibility calculations, learning methods, anonymous data exchange. Use when implementing AI2AI learning, personality evolution, or peer learning features. --- # AI2AI Learning Service ## Core Purpose AI2AI learning enables personality learning through anonymized peer interactions. ## Learning Methods ### 1. Personal Learning (On-Device) - Learn which doors user opens - Track
--- name: ai2ai-protocol-implementation description: Guides AI2AI protocol implementation: personality learning, anonymous communication, AI2AI-only (never p2p), Personality AI Layer routing. Use when implementing AI2AI features, network protocols, or device communication. --- # AI2AI Protocol Implementation ## Core Principles **✅ AI2AI ONLY** - Never peer-to-peer (p2p) **✅ All device interactions through Personality AI Layer** **✅ Anonymous communication** - No personal identifiers **✅ Priva
--- name: battery-adaptive-scheduling description: Guides battery-adaptive BLE scheduling: adaptive scanning, power optimization, foreground services, background modes. Use when implementing BLE features, background operations, or battery optimization. --- # Battery-Adaptive Scheduling ## Core Purpose Optimize BLE operations based on battery level to minimize battery drain while maintaining functionality. ## Adaptive Scanning Pattern ```dart /// Adaptive BLE Scanner /// /// Adjusts scan fr
--- name: ble-implementation-patterns description: Guides BLE implementation: device discovery, background scanning, power optimization, platform-specific implementations (Android/iOS). Use when implementing Bluetooth Low Energy features or device discovery. --- # BLE Implementation Patterns ## Core Purpose Bluetooth Low Energy (BLE) enables device discovery and personality data advertising in AI2AI system. ## Platform Support - **Android:** BLE APIs with foreground service for background -
--- name: business-partnership-patterns description: Guides business partnership implementation: multi-party events, revenue sharing, vibe matching, pre-event agreements. Use when implementing partnerships, event collaborations, or revenue sharing features. --- # Business Partnership Patterns ## Core Components ### Partnership Matching Service Matches users with businesses based on compatibility. ### Partnership Service Manages partnership agreements and revenue splits. ### Revenue Split Ca
Enforces Clean Architecture layer separation (core, data, domain, presentation). Use when creating new features, organizing code, or ensuring proper dependency direction.
Guides GetIt dependency injection patterns for service registration. Use when creating new services, registering dependencies, or refactoring service architecture.
Guides device discovery implementation patterns for AI2AI connections. Use when implementing device discovery, BLE scanning, or WiFi-based device detection.
Guides energy function (critic network) implementation and formula replacement protocol. Use when replacing hardcoded formulas, implementing energy-based scoring, creating A/B tests between formulas and learned functions, or working on Phase 4 tasks.
--- name: error-handling-patterns description: Enforces comprehensive error handling: explicit catch blocks, user-friendly messages, Result/Either patterns. Use when writing async code, service methods, or handling exceptions. --- # Error Handling Patterns ## Mandatory Rules **✅ ALWAYS handle errors explicitly** - never silently swallow exceptions **✅ Use try-catch blocks** for async operations that can fail **✅ Provide user-friendly error messages** in UI **✅ Log errors with context** using
--- name: event-system-implementation description: Guides event system implementation: creation, ticketing, partnerships, sponsorships, check-in, analytics. Use when implementing events, event management, or event-related features. --- # Event System Implementation ## Core Components ### Event Service Core event management (create, update, delete, retrieve). ### Event Ticketing Service Manages tickets, pricing, sales. ### Event Partnership Service Handles multi-party partnerships and revenu
--- name: geographic-services-patterns description: Guides geographic services patterns: locality agents, geofence planning, location-based features, geographic hierarchy. Use when implementing location-based features, geofencing, or geographic services. --- # Geographic Services Patterns ## Geographic Hierarchy ``` Locality → City → State → National → Global → Universal ``` ## Locality Agents ```dart /// Locality Agent Service /// /// Manages locality-specific AI agents class LocalityAgen
--- name: integration-optimization-checklist description: Guides integration optimization checklist: output contracts, breaking changes, service registry updates, integration tests. Use when completing phases, starting phases, or modifying services. --- # Integration Optimization Checklist ## Before Completing a Phase ### Output Contracts Create output contracts document: ```markdown # Phase X.Y Output Contracts ## Services Provided - ServiceName: [Description] - Methods: [List] - Depend
--- name: integration-test-patterns description: Guides integration test patterns: end-to-end workflows, cross-layer testing, real dependencies, no mocks unless approved. Use when writing integration tests, testing complete features, or validating system integration. --- # Integration Test Patterns ## Core Principle **Integration tests verify complete features work in the system.** Use real dependencies whenever possible. ## Integration Test Types ### End-to-End Workflows Test complete user
Enforces zero linter errors, common issue prevention, code cleanup. Use when writing code, reviewing code, or ensuring code quality standards.
--- name: performance-optimization-guide description: Guides performance optimization: atomic clock service, performance monitoring, memory optimization, battery optimization. Use when optimizing performance, monitoring metrics, or improving app efficiency. --- # Performance Optimization Guide ## Core Components ### Performance Monitor Monitors application performance metrics: - Memory usage - Response times - Battery usage - Network performance ### Atomic Clock Service Provides synchronized
Enforces design token usage (AppColors/AppTheme) instead of direct Colors.*. Use when writing UI code, reviewing widgets, or ensuring design consistency.
--- name: native-code-error-handling description: Guides native code error handling patterns: exception conversion, error propagation to Dart, user-friendly messages. Use when implementing native code error handling, platform channel error handling, or FFI error handling. --- # Native Code Error Handling ## Core Principle Native code errors must be converted to Dart-friendly errors with user-friendly messages. ## Platform Channel Error Handling ### Swift/iOS ```swift public func handle(_ ca
--- name: connection-orchestrator-patterns description: Guides connection orchestration patterns: Personality AI Layer routing, compatibility scoring, connection prioritization. Use when implementing AI2AI connections, device communication, or connection management. --- # Connection Orchestrator Patterns ## Core Principle **All device connections route through Personality AI Layer, NOT direct peer-to-peer.** ## Connection Orchestration Flow ``` Device Discovery → Extract Personality → Calcu
Detects and flags deprecated Flutter/Dart APIs, suggests modern equivalents. Use when reviewing code, refactoring, or ensuring code uses modern APIs.
--- name: expertise-system-implementation description: Guides expertise system implementation: multi-path recognition, hierarchy (local → city → state → national), golden experts, visit quality. Use when implementing expertise calculations, expert recognition, or expertise-based features. Note that hardcoded weights are being replaced by energy functions per Phase 4.3. --- # Expertise System Implementation ## Core Principle Users can become experts through multiple paths. Expertise is recogni
--- name: kotlin-java-android-patterns description: Guides Kotlin/Java Android integration patterns: platform channels, method channels, native Android features, BLE implementation. Use when implementing Android-specific features, native platform channels, or Kotlin/Java integration. --- # Kotlin/Java Android Integration Patterns ## Core Purpose Kotlin/Java integration enables Flutter apps to use Android-specific features via platform channels. ## Method Channel Pattern ### Kotlin Side ```k
--- name: master-plan-integration-workflow description: Guides Master Plan integration workflow: plan creation, tracker updates, dependency analysis, execution sequence insertion. Use when adding new features to Master Plan or integrating plans into execution sequence. --- # Master Plan Integration Workflow ## When to Use **Trigger:** When user says "I want to add [feature]" or "I want to implement [feature]" **Action Required:** Follow automated workflow to integrate into Master Plan ## Wo
--- name: privacy-protection-patterns description: Enforces privacy protection patterns: anonymization, no PII in logs, secure data handling, GDPR compliance. Use when handling user data, implementing AI2AI, or ensuring privacy compliance. --- # Privacy Protection Patterns ## Core Principle **Complete privacy protection with zero personal data exposure for AI2AI personality learning.** ## Anonymization Pattern ### Anonymize Personal Data ```dart /// Anonymize personality profile for AI2AI c
--- name: plan-discovery-workflow description: Guides plan discovery workflow: glob search, recency filtering, relevance assessment, priority reading. Use when starting new tasks, finding related plans, or gathering context. --- # Plan Discovery Workflow ## Purpose Discover and filter all relevant plans before starting implementation. ## Discovery Steps ### Step 1: Search for Plans ```bash # Search all plans glob_file_search('**/*plan*.md') glob_file_search('docs/plans/**/*.md') # Search b
--- name: spots-philosophy-integration description: Ensures all code aligns with SPOTS core philosophy: "Doors, not badges", meaningful connections, real-world enhancement. Use when implementing features, reviewing code, or making architectural decisions to validate philosophy alignment. --- # SPOTS Philosophy Integration ## Core Principle **All development must align with SPOTS philosophy.** This is non-negotiable. ## Key Philosophy Concepts ### The Core Truth **"There is no secret to life
--- name: swift-integration-patterns description: Guides Swift integration patterns: platform channels, method channels, async callbacks, native iOS features. Use when implementing iOS-specific features, native platform channels, or Swift code integration. --- # Swift Integration Patterns ## Core Purpose Swift integration enables Flutter apps to use iOS-specific features via platform channels. ## Method Channel Pattern ### Swift Side ```swift import Flutter import UIKit public class SwiftM
--- name: test-coverage-requirements description: Enforces test coverage requirements: models (100%), repositories (95%), BLoCs (100%), use cases (100%), services (90%). Use when writing tests, reviewing test coverage, or ensuring adequate test coverage. --- # Test Coverage Requirements ## Coverage Targets ### Line Coverage ```yaml Models: 100% required Repositories: 95% required BLoCs: 100% required Use Cases: 100% required Services: 90% required UI Components: 85% required ``` ### Branch
--- name: test-implementation-requirements description: Enforces test implementation requirements: real dependencies, no mocks/stubs unless approved. Use when writing tests, reviewing test implementations, or ensuring tests use real functionality. --- # Test Implementation Requirements ## Core Principle **Tests must test real functionality. Mocks and stubs have strict limitations.** ## Mandatory Requirements ### ✅ REQUIRED - **Real Functionality** - Tests exercise actual code paths and real
--- name: test-quality-enforcement description: Enforces test quality standards: behavior-focused tests, no property-only tests, round-trip JSON, comprehensive test blocks. Use when writing tests, reviewing test code, or ensuring test quality. --- # Test Quality Enforcement ## Core Principle **Test what the code DOES, not what it IS.** ## ✅ DO Test - **Behavior** - What happens when you call a method? - **Business Logic** - Calculations, validation, transformations - **Error Handling** - Ho
Enforces Dart doc comments for public APIs, parameter descriptions, usage examples. Use when writing public APIs, reviewing code, or ensuring documentation completeness.
--- name: completion-report-generation description: Guides completion report generation: what was done, what's next, blockers, progress tracking, Master Plan updates. Use when completing phases, sections, or features. --- # Completion Report Generation ## Report Structure ```markdown # Phase X.Y.Z Completion Report **Date:** [Date] **Agent:** [Agent Name] **Status:** ✅ Complete ## What Was Done ### Completed Tasks - [x] Task 1 - [x] Task 2 - [x] Task 3 ### Implementation Summary [Brief su
Guides controller implementation for complex workflows, reservation creation, quantum matching, group matching. Use when creating controllers for multi-step processes or complex state management.
Validates that features align with "opening doors" concept, meaningful connections, user journey flow. Use when implementing features, reviewing code, or ensuring features serve the doors philosophy.
--- name: episodic-memory-patterns description: Guides episodic memory implementation: (state, action, next_state, outcome) tuple storage, outcome collection, memory pruning. Use when implementing outcome tracking, writing episodic tuples, wiring new user actions to outcome collection, or working on Phase 1 tasks. --- # Episodic Memory Patterns ## Core Principle Every user action must produce an episodic tuple: `(state_before, action, state_after, outcome)`. This is the training data for the
Validates the evolution cascade executes atomically when personality changes. Use when modifying personality evolution, quantum state updates, knot calculations, or any service in the cascade chain. Ensures consistent state observations for the world model.
Enforces the 5-step formula replacement protocol for replacing hardcoded scoring formulas with learned energy functions. Use when working on any formula in the Phase 4.2 replacement schedule, implementing A/B tests, or transitioning from formula to energy function scoring.
--- name: experiment-testing-standards description: Enforces experiment testing standards: real implementation testing, no simplified approximations, exact formula matching. Use when creating experiments, testing algorithms, or validating mathematical implementations. --- # Experiment Testing Standards ## Core Principle **Experiments must test the REAL implementation, never simplified approximations.** ## Mandatory Requirements ### ✅ REQUIRED - **Real Implementation Logic** - Use exact same
--- name: hybrid-search-implementation description: Guides hybrid search implementation: vector embeddings, keyword search, fusion algorithms, caching strategies. Use when implementing search, recommendation systems, or discovery features. --- # Hybrid Search Implementation ## Core Principle **Community-first prioritization** - Local community knowledge comes first, external data fills gaps. ## Search Flow ``` 1. Search community data (highest priority) 2. Search external data (if needed) 3
--- name: quantum-matching-algorithms description: Guides quantum matching implementation: state calculations, compatibility formulas (being replaced by energy function per Phase 4), quantum entanglement matching patterns. Use when implementing matching algorithms, compatibility calculations, or quantum state operations. Note that hardcoded formulas are being replaced by learned energy functions -- see World Model Standards. --- # Quantum Matching Algorithms ## Core Principle Quantum matching
--- name: status-query-handling description: Guides status query handling protocol: find all related documents (plan, progress, status, complete), synthesize comprehensive answer. Use when user asks about status, progress, or completion. --- # Status Query Handling ## Trigger Phrases When user says: - "where are we with [topic]" - "what's the status of [topic]" - "how far along is [topic]" - "what's complete in [topic]" - "show me progress on [topic]" - "update me on [topic]" ## Mandatory Pr
--- name: widget-test-patterns description: Guides widget test patterns: BLoC testing, user interactions, state changes, material app setup. Use when writing widget tests, testing UI components, or validating widget behavior. --- # Widget Test Patterns ## Core Pattern Widget tests verify UI behavior: user interactions, state changes, and visual display. ## Basic Widget Test Setup ```dart testWidgets('widget displays correctly', (WidgetTester tester) async { // Arrange: Create widget awa
Enforces 40-minute context gathering protocol for implementation tasks. Use when starting new tasks, implementing features, or beginning development work.
Enforces async/await patterns over .then() chains, proper error handling, mounted checks. Use when writing async code, handling Futures, or working with async operations.
Enforces Master Plan notation format (Phase.Section.Subsection X.Y.Z). Use when referencing phases, sections, documenting progress, or updating status trackers.
Ensures features support Spots → Community → Life journey flow. Use when implementing features, reviewing UX flows, or validating that features enable the complete user journey.
Validates that new features and services align with LeCun's world model framework. Use when creating new services, adding features, reviewing architecture decisions, or questioning whether a component fits the intelligence-first architecture.
Enforces mandatory logging standards using developer.log() instead of print(). Use when writing production code, reviewing code, or fixing logging violations.
--- name: offline-first-patterns description: Enforces offline-first architecture patterns: GetStorage/Drift database, local-first data sources, sync strategies, offline indicator. Use when implementing features, designing data flow, or ensuring offline functionality. --- # Offline-First Patterns ## Core Principle **All features must work offline.** Online features are enhancements, not requirements. ## Architecture Pattern ### Local-First Data Flow ``` User Action → Local Database → UI Upd
Guides BLoC state management implementation patterns. Use when creating new BLoCs, handling state changes, or managing application state.
Enforces file naming conventions, directory structure, one class per file, Clean Architecture layer placement. Use when creating new files, organizing code, or refactoring file structure.
--- name: documentation-refactoring-protocol description: Enforces documentation refactoring protocol: phase folders, status tracker updates, proper file placement, naming conventions. Use when creating documentation, organizing docs, or updating documentation structure. --- # Documentation Refactoring Protocol ## Mandatory Protocol **ALL agents MUST follow the Documentation Refactoring Protocol when creating or organizing documentation.** ## Folder Structure ### Phase-Specific Docs ``` doc
Ensures features support meaningful connections, not gamification or engagement metrics. Use when implementing features, reviewing UX, or validating that features serve meaningful connections.
--- name: reservation-system-patterns description: Guides reservation system patterns: quantum states, availability calculation, check-in services, payment integration. Use when implementing reservations, availability management, or reservation workflows. --- # Reservation System Patterns ## Core Components ### Reservation Quantum Service Creates quantum states for reservations and calculates compatibility. ### Reservation Availability Service Manages availability, capacity, and booking conf
--- name: security-validation-checklist description: Guides security validation checklist: Signal protocol security, encryption standards, authentication patterns, data protection. Use when validating security, reviewing security implementations, or ensuring security compliance. --- # Security Validation Checklist ## Security Components ### Authentication Security - [ ] Secure authentication implemented (OAuth 2.0) - [ ] Token security validated - [ ] Session management secure - [ ] Password
--- name: rust-ffi-bindings description: Guides Rust FFI bindings implementation: FFI bindings, type conversion, memory management, error handling, Flutter Rust Bridge. Use when implementing Rust FFI bindings, native code integration, or FFI callbacks. --- # Rust FFI Bindings ## Core Purpose Rust FFI bindings bridge Rust code with Dart/Flutter using C-compatible FFI. ## Architecture Pattern ``` Dart Code ↓ (C FFI) Rust Wrapper ↓ (creates function pointers) C Library / Dart Callbacks
--- name: signal-protocol-integration description: Guides Signal protocol integration: encryption/decryption, key management, session management, FFI bindings, security best practices. Use when implementing encryption, secure communication, or Signal protocol features. --- # Signal Protocol Integration ## Core Purpose Signal protocol provides end-to-end encryption for secure communication in AI2AI system. ## Key Components ### Signal Protocol Service - Encryption/decryption - Key management
Implements base workflow controller patterns for multi-step processes. Use when creating complex workflows that require orchestration of multiple steps with error handling and rollback.
--- name: world-model-development description: Guides world model development patterns: state/action encoders, ONNX inference, feature extraction pipeline, latency budgets. Use when implementing world model components, state encoders, action encoders, feature extractors, or ONNX models. Core skill for Phases 3-6. --- # World Model Development Patterns ## Core Principle All world model components follow LeCun's autonomous machine intelligence framework. State observations flow through a percep
--- name: test-template-generation description: Generates test templates: unit, widget, integration, service tests following project patterns. Use when creating new tests or ensuring tests follow project standards. --- # Test Template Generation ## Available Templates Test templates are located in `test/templates/`: - `unit_test_template.dart` - `widget_test_template.dart` - `integration_test_template.dart` - `service_test_template.dart` ## Unit Test Template ```dart /// SPOTS Component Uni
--- name: master-plan-integration-validation description: Validates Master Plan integration workflow completion: plan created, tracker updated, dependencies analyzed, execution sequence updated. Use when validating Master Plan integration or reviewing plan integration completeness. --- # Master Plan Integration Validation ## Validation Checklist ### Plan Document - [ ] Comprehensive plan document created - [ ] Plan folder structure created - [ ] Supporting docs initialized (progress.md, statu
--- name: service-pattern-standardization description: Standardizes service patterns: constructor injection, error handling, logging with developer.log(), service-to-service communication. Use when creating new services or refactoring existing services. --- # Service Pattern Standardization ## Core Pattern All services use constructor injection with required and optional dependencies. ## Service Structure ```dart import 'dart:developer' as developer; import 'package:avrai/core/services/logg
--- name: ai2ai-privacy-validation description: Enforces AI2AI privacy validation: anonymized data exchange, no personal identifiers, privacy-preserving learning. Use when implementing AI2AI features, validating privacy, or ensuring privacy compliance. --- # AI2AI Privacy Validation ## Core Principle **Complete privacy protection with zero personal data exposure for AI2AI personality learning.** ## Validation Requirements ### Anonymized Data Exchange - [ ] No personal identifiers in AI2AI d
Enforces import grouping (Dart SDK → Flutter → packages → relative), alphabetical order, unused import removal. Use when writing or reviewing code to ensure consistent import organization.