.cursor/skills/code-documentation-standards/SKILL.md
Enforces Dart doc comments for public APIs, parameter descriptions, usage examples. Use when writing public APIs, reviewing code, or ensuring documentation completeness.
npx skillsauth add avra-cadavra/avrai code-documentation-standardsInstall 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.
✅ ALWAYS document public APIs (classes, methods, functions)
✅ Use Dart doc comments (///) for public APIs
✅ Include parameter descriptions, return values, exceptions
✅ Document complex business logic with inline comments
❌ Don't document obvious code (e.g., /// Gets the name for getName())
Document WHY, not WHAT (code should be self-explanatory).
/// Service for managing user authentication
///
/// Handles sign in, sign up, sign out, and password management.
/// Uses Supabase for backend authentication.
class AuthService {
// Implementation
}
/// Signs in a user with email and password
///
/// Returns the authenticated user on success.
/// Throws [AuthException] if credentials are invalid.
Future<User> signIn(String email, String password) async {
// Implementation
}
/// Calculate sales tax for an event
///
/// **Flow:**
/// 1. Get event details
/// 2. Check if event type is taxable
/// 3. Get tax rate for location
/// 4. Calculate tax amount
///
/// **Parameters:**
/// - `eventId`: Event ID
/// - `ticketPrice`: Ticket price in dollars
///
/// **Returns:**
/// SalesTaxCalculation with tax details
///
/// **Throws:**
/// - [EventNotFoundException] if event not found
/// - [InvalidPriceException] if price is negative
Future<SalesTaxCalculation> calculateSalesTax({
required String eventId,
required double ticketPrice,
}) async {
// Implementation
}
/// Creates a new spot
///
/// [name] - Name of the spot
/// [latitude] - Latitude coordinate (-90 to 90)
/// [longitude] - Longitude coordinate (-180 to 180)
/// [address] - Optional address string
Spot createSpot({
required String name,
required double latitude,
required double longitude,
String? address,
}) {
// Implementation
}
class User {
/// User's unique identifier
final String id;
/// User's display name
final String name;
/// User's email address
///
/// May be null if user signed up with social auth
final String? email;
}
/// Event types available in the system
enum EventType {
/// Community meetup or gathering
meetup,
/// Workshop or educational event
workshop,
/// Social event or party
social,
}
Use inline comments for complex business logic:
Future<Result<User>> authenticate(String email, String password) async {
// Validate email format before attempting auth
// This prevents unnecessary API calls
if (!_isValidEmail(email)) {
return Result.failure('Invalid email format');
}
try {
// Attempt Supabase authentication
// This may throw AuthException if credentials are invalid
final user = await _supabase.auth.signIn(
email: email,
password: password,
);
// Cache user locally for offline access
await _storageService.saveUser(user);
return Result.success(user);
} on AuthException catch (e) {
// Don't log password in error message
developer.log('Authentication failed', error: e, name: 'AuthService');
return Result.failure('Invalid email or password');
}
}
For complex APIs, include usage examples:
/// Calculates compatibility score between two users
///
/// Uses 12-dimensional personality spectrum to calculate compatibility.
///
/// **Example:**
/// ```dart
/// final user1 = User(personality: Personality(...));
/// final user2 = User(personality: Personality(...));
/// final score = compatibilityCalculator.calculate(user1, user2);
/// print('Compatibility: ${score * 100}%');
/// ```
double calculateCompatibility(User user1, User user2) {
// Implementation
}
Use TODO comments with phase notation:
// TODO(Phase 8.3.2): Add support for event cancellations
// TODO(Phase 9.1): Implement batch operations
Don't document obvious code:
// ❌ BAD: Obvious documentation
/// Gets the user's name
String getName() => _name;
// ✅ GOOD: Self-explanatory code
String getName() => _name;
Before committing:
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