.cursor/skills/logging-standards-enforcement/SKILL.md
Enforces mandatory logging standards using developer.log() instead of print(). Use when writing production code, reviewing code, or fixing logging violations.
npx skillsauth add avra-cadavra/avrai logging-standards-enforcementInstall 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.
❌ NEVER use print() or debugPrint() in production code
✅ ALWAYS use developer.log() from dart:developer for logging
import 'dart:developer' as developer;
// ✅ GOOD
developer.log('User signed in', name: 'AuthService');
developer.log('Operation failed', error: e, stackTrace: st, name: 'ServiceName');
developer.log('Data loaded successfully', name: 'DataService', level: 1000);
// ❌ BAD
print('User signed in');
debugPrint('Operation failed');
Use appropriate log levels:
developer.log(..., level: 700) - LogLevel.debugdeveloper.log(..., level: 800) - LogLevel.infodeveloper.log(..., level: 900) - LogLevel.warningdeveloper.log(..., level: 1000) - LogLevel.errorWhen AppLogger service is available, use it for consistent patterns:
import 'package:avrai/core/services/logger.dart';
class MyService {
final AppLogger _logger = const AppLogger(
defaultTag: 'MyService',
minimumLevel: LogLevel.debug,
);
Future<void> doSomething() async {
_logger.info('Starting operation', tag: 'doSomething');
try {
// operation
_logger.debug('Operation completed', tag: 'doSomething');
} catch (e, st) {
_logger.error('Operation failed', error: e, stackTrace: st, tag: 'doSomething');
}
}
}
Test files may use print() for debugging test output only:
// ✅ OK in test files
void main() {
print('Running test suite...');
}
Always include context when logging errors:
try {
await operation();
} catch (e, st) {
developer.log(
'Operation failed',
error: e,
stackTrace: st,
name: 'ServiceName',
);
}
development
--- 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