.cursor/skills/linter-error-prevention/SKILL.md
Enforces zero linter errors, common issue prevention, code cleanup. Use when writing code, reviewing code, or ensuring code quality standards.
npx skillsauth add avra-cadavra/avrai linter-error-preventionInstall 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.
✅ Zero linter errors before completion ✅ Zero warnings before completion ✅ Follow Dart style guide
// ❌ BAD: Unused import
import 'package:unused/package.dart';
class MyClass {
// Doesn't use unused package
}
// ✅ GOOD: Remove unused imports
class MyClass {
// No unused imports
}
// ❌ BAD: Unused variable
void method() {
final unused = calculateValue();
doSomething();
}
// ✅ GOOD: Use variable or remove
void method() {
final value = calculateValue();
doSomething(value);
}
// ❌ BAD: Missing required parameter
createUser(name: 'John');
// ✅ GOOD: Provide required parameters
createUser(name: 'John', email: '[email protected]');
// ❌ BAD: Const constructor error
const MyWidget(
required this.value, // Required parameters can't be const
)
// ✅ GOOD: Remove const if constructor isn't const
MyWidget(
required this.value,
)
Check analysis_options.yaml for enabled linter rules:
linter:
rules:
- prefer_const_constructors
- prefer_const_literals_to_create_immutables
- avoid_print
- prefer_single_quotes
prefer_const_constructors:
// ✅ GOOD: Use const when possible
const Text('Hello')
// ❌ BAD: Not using const
Text('Hello')
avoid_print:
// ✅ GOOD: Use developer.log
developer.log('Message', name: 'ServiceName');
// ❌ BAD: Using print
print('Message');
prefer_single_quotes:
// ✅ GOOD: Single quotes
final text = 'Hello';
// ❌ BAD: Double quotes
final text = "Hello";
flutter analyze
dart analyze
Most IDEs run linter automatically and show warnings.
Many linter issues can be auto-fixed:
dart fix --apply
flutter pub run dart_code_metrics:metrics analyze lib/
For issues that can't be auto-fixed:
Before committing:
flutter analyze - no errorsflutter analyze - no warningsanalysis_options.yaml - Linter configurationdevelopment
--- 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