Dart 3.x and Flutter 3.x conventions, naming patterns, code organization, null safety, and async/await best practices
Enforces Flutter 3.x and Dart 3.x conventions, naming patterns, and best practices for code organization.
/plugin marketplace add Kaakati/rails-enterprise-dev/plugin install reactree-flutter-dev@manifest-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
String describeUser(User user) {
return switch (user) {
User(role: 'admin', isActive: true) => 'Active administrator',
User(role: 'user', isActive: true) => 'Active user',
User(isActive: false) => 'Inactive account',
_ => 'Unknown status',
};
}
(int, String) getUserInfo() => (123, 'John Doe');
final (id, name) = getUserInfo();
sealed class Result<T> {}
class Success<T> extends Result<T> {
final T data;
Success(this.data);
}
class Error<T> extends Result<T> {
final String message;
Error(this.message);
}
snake_case.dartPascalCasecamelCaselowerCamelCase or SCREAMING_SNAKE_CASE for compile-time constants// user_controller.dart
class UserController extends GetxController {
static const int maxRetries = 3;
static const String BASE_URL = 'https://api.example.com';
final userName = 'John'.obs;
void fetchUserData() {
// ...
}
}
Layer-first (recommended for Clean Architecture):
lib/
├── domain/
├── data/
└── presentation/
Feature-first (alternative):
lib/
└── features/
├── auth/
│ ├── domain/
│ ├── data/
│ └── presentation/
└── profile/
// Use late for non-nullable fields initialized later
class MyController extends GetxController {
late final UserRepository repository;
@override
void onInit() {
super.onInit();
repository = Get.find();
}
}
// Use ? for nullable types
String? userName;
// Use ! only when absolutely certain
final name = userName!; // Use sparingly
// Prefer ?? for defaults
final displayName = userName ?? 'Guest';
// Use async/await for asynchronous operations
Future<User> fetchUser(String id) async {
try {
final response = await client.get(Uri.parse('/users/$id'));
return User.fromJson(jsonDecode(response.body));
} on SocketException {
throw NetworkException();
} catch (e) {
throw UnknownException(e.toString());
}
}
// Use Future.wait for parallel operations
Future<void> loadAllData() async {
final results = await Future.wait([
fetchUsers(),
fetchSettings(),
fetchPreferences(),
]);
}
// Use unawaited for fire-and-forget
unawaited(analytics.logEvent('page_view'));
class MyClass {
// 1. Constants
static const int maxRetries = 3;
// 2. Static fields
static final instance = MyClass._();
// 3. Instance fields
final String id;
final _isLoading = false.obs;
// 4. Constructors
MyClass(this.id);
MyClass._();
// 5. Getters/Setters
bool get isLoading => _isLoading.value;
// 6. Lifecycle methods
@override
void onInit() {}
// 7. Public methods
void publicMethod() {}
// 8. Private methods
void _privateMethod() {}
}
// Prefer const constructors
class MyWidget extends StatelessWidget {
const MyWidget({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return const Text('Hello');
}
}
// Extract widgets for reusability
class UserCard extends StatelessWidget {
final User user;
const UserCard({Key? key, required this.user}) : super(key: key);
@override
Widget build(BuildContext context) {
return Card(
child: _buildContent(),
);
}
Widget _buildContent() {
return Column(
children: [
Text(user.name),
Text(user.email),
],
);
}
}
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.