.cursor/skills/performance-optimization-guide/SKILL.md
--- 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
npx skillsauth add avra-cadavra/avrai .cursor/skills/performance-optimization-guideInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Monitors application performance metrics:
Provides synchronized timestamps for performance tracking.
/// Performance Monitor Service
///
/// Monitors application performance metrics
class PerformanceMonitor {
/// Collect performance metrics
Future<void> collectMetrics() async {
final metrics = PerformanceMetrics(
memoryUsage: await _getMemoryUsage(),
responseTime: await _getAverageResponseTime(),
batteryLevel: await _getBatteryLevel(),
networkLatency: await _getNetworkLatency(),
);
// Store metrics
await _storeMetrics(metrics);
// Check thresholds
_checkThresholds(metrics);
}
/// Get memory usage
Future<int> _getMemoryUsage() async {
// Get current memory usage in MB
return await _nativeMemoryService.getMemoryUsage();
}
}
/// Optimize memory usage
Future<void> optimizeMemory() async {
// Clear caches if memory high
final memoryUsage = await _getMemoryUsage();
if (memoryUsage > _memoryWarningThreshold) {
await _clearCaches();
await _garbageCollect();
}
}
/// Optimize response times
Future<void> optimizeResponseTime() async {
// Use async operations
// Cache frequently accessed data
// Batch operations when possible
// Use background processing for heavy operations
}
/// Optimize battery usage
Future<void> optimizeBattery() async {
// Reduce background activity when battery low
final batteryLevel = await _getBatteryLevel();
if (batteryLevel < 20) {
// Reduce BLE scanning frequency
await _reduceBLEScanning();
// Reduce background sync frequency
await _reduceBackgroundSync();
}
}
lib/core/services/performance_monitor.dart - Performance monitoring servicelib/core/services/atomic_clock_service.dart - Atomic clock for timestampsdevelopment
--- 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
tools
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.
testing
--- 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
testing
--- 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