Naming Conventionsのロゴ

Naming Conventions

コミュニティ
zakariaf
naming-conventions

Effective-Dartの命名規則(型はUpperCamelCase、メンバー/定数はlowerCamelCase、ファイルはlowercase_with_underscores)と、アーキテクチャ上の役割を示すサフィックスを徹底します。名前やgrepでレイヤーが分かるよう、Screen/Notifier/Repository/Dao/Service/Gateway/Failureを使い、ファイル名は主要な宣言に合わせます。識別子には単位と意味を含め、真偽値はis/has/can/shouldで始まる表現にします。getで始める名前、ハンガリアン記法、SCREAMING_CAPSは使わず、importはグループ分けして並べ替えます。ファイルの作成、クラス/enum/mixin/extension/typedef/変数/関数/getter/定数/引数の命名、importの整理、役割を示すサフィックスの選択、命名とディレクティブ順に関する差分レビューに使用してください。

Add to TypingMind

概要

公開者zakariaf
リポジトリFlutter-Skills
スキル名naming-conventions
スター
64
フォーク
15
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    zakariafがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Naming Conventions」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/zakariaf/Flutter-Skills/tree/main/skills/naming-conventions
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills.git /tmp/Flutter-Skills
mkdir -p .claude/skills
cp -r /tmp/Flutter-Skills/skills/naming-conventions .claude/skills/naming-conventions
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでNaming Conventionsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にNaming Conventionsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Naming Conventionsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Naming Conventions

Consistent, role-carrying names make code searchable and self-explaining, and the suffix on a type declares which layer it lives in — so a reviewer, a grep, and a banned-import gate can all read the layer off the name alone. This skill is the how; the normative what is Effective Dart. Never invent a house style that contradicts the language's own.

Non-negotiable rules

  1. Types are UpperCamelCase. Classes, enums, mixins, extensions, typedefs, type parameters: TaskScreen, OrderStatus, Predicate<T>. Consistent shape makes types visually distinct from values.
  2. Members, variables, functions, and parameters are lowerCamelCase. dueDate, loadTasks(), itemCount. It is the language default; deviating costs readers a double-take.
  3. Constants are lowerCamelCase, never SCREAMING_CAPS. const maxItemsPerPage = 50; — not const MAX_ITEMS = 50. Dart dropped the C convention; the analyzer expects constant_identifier_names.
  4. Files, folders, libraries, and import prefixes are lowercase_with_underscores. task_detail_screen.dart, features/task_detail/, import 'package:app_core/app_core.dart';. Cross-platform filesystems and pub demand it.
  5. File name = its primary declaration, snake_cased, one primary public type per file. TaskNotifier lives in task_notifier.dart. No utils.dart/helpers.dart/models.dart grab-bags and no utils//common//helpers//misc/ junk-drawer folders — a reader who greps a symbol must land in the file that owns it. core/ is the sanctioned pure-foundation layer (value objects, Result/Failure, the Clock seam, pure calculators), not a junk-drawer — see project-structure-and-packages, which owns the layout.
  6. Acronyms longer than two letters are cased like a word. Json, Http, Url, Api → JsonOrder, HttpClient, fromJson, imageUrl — not JSONOrder, HTTPClient. Two-letter caps-in-English acronyms may stay caps as types (ID, UI). Mixed-case acronyms are unsearchable and inconsistent.
  7. A leading underscore means library-private — use it only when you mean private. Never prefix a public symbol with _ to "namespace" it; that makes it unusable from another file. Public (no _) is a documented contract — see dartdoc-conventions.
  8. No Hungarian / type-encoding in names. Not strName, iCount, lstItems, userMap, nameString, itemsList. The type system already knows the type; write name, usersById, items.
  9. Full dictionary words; units and semantics live in the name. maxItemsPerPage, retryDelaySeconds, orderTotalMinorUnits — never bare max, delay, total. Abbreviations (opt, qty, amt) are confined to the inside of one short pure function with a comment mapping them. A name that omits its unit invites a unit bug.
  10. Booleans read as assertions. isLoading, hasError, canSubmit, shouldRetry — not loading, error, retry. Boolean getters and methods start is/has/can/should so a condition reads like prose.
  11. No get-prefixed accessors. Expose dueTasks, not getDueTasks(). Dart has real getters. Functions are verb phrases (loadTasks(), scheduleReminder()); non-boolean getters are noun phrases (itemCount, nextDueDate).
  12. Imports grouped and sorted: dart: first, then package:, then relative — each group alphabetized, exports in their own section after imports. Let dart format plus the directives_ordering lint enforce it; never hand-fight the formatter.

The suffix declares the layer

A role suffix turns a name into a layer contract: a grep or a path-scoped import gate can tell a repository from a view from a platform boundary without opening the file. Use neutral domain nouns (Task, Order, Account, Item) for the entity token.

RoleSuffix / patternLayerFile → symbol
Screen / route target[Feature]ScreenUI (View)task_list_screen.dart → TaskListScreen
Reusable widget[Thing] (+ Widget only if ambiguous)UItask_card.dart → TaskCard
ViewModel (Riverpod, default)[Feature]NotifierUI (ViewModel)task_list_notifier.dart → TaskListNotifier
ViewModel (Provider appendix only)[Feature]ViewModelUI (ViewModel)task_list_view_model.dart → TaskListViewModel
Repository (interface)[Entity]Repositorydatatask_repository.dart → TaskRepository
Repository (impl)Drift[Entity]Repository / Remote[Entity]Repositorydatadrift_task_repository.dart
Drift DAO[Entity]Daodatatasks_dao.dart → TasksDao
Capability interface you define[Concern]Serviceboundaryshare_service.dart → ShareService
Service impl (per flavor)[Provider][Concern]Serviceapp adapterfirebase_analytics_service.dart → FirebaseAnalyticsService
Wrapper over a specific plugin/SDK/native channel[Concern]Gatewayboundarynotification_gateway.dart → NotificationGateway
Gateway impl[Plugin][Concern]Gateway / Live[Concern]Gatewayapp adapterfln_notification_gateway.dart → FlnNotificationGateway
Pure-Dart domain logic[Domain] + verb suffix (Calculator/Validator/Formatter)domainprice_calculator.dart → PriceCalculator
Immutable modeldomain noun, no suffixanytask.dart → Task
Failure type[Domain]Failure (sealed)anyorder_failure.dart → OrderFailure
  • Notifier is the ViewModel role — never ViewModel or ChangeNotifier in the type name. On Riverpod 3.x the ViewModel is a Notifier/AsyncNotifier/StreamNotifier, one per Screen, 1:1, named [Feature]Notifier in [feature]_notifier.dart (file = primary declaration). [Feature]ViewModel in [feature]_view_model.dart is sanctioned ONLY in the Provider/ChangeNotifier appendix — never on the Riverpod path, and never [Feature]Controller. See state-management-riverpod.
  • Service vs Gateway — both name provider-free boundary ports, distinguished by who owns the contract. A [Concern]Service is a capability interface YOU define (ShareService, AnalyticsService); a [Concern]Gateway is the thin wrapper over a SPECIFIC external plugin/SDK or native MethodChannel (NotificationGateway over flutter_local_notifications, SecureStorageGateway over flutter_secure_storage). Domain and UI code names the interface; the concrete impl (FirebaseAnalyticsService, FlnNotificationGateway) lives only in the composition root. A concrete impl name leaking into shared code is a grep-catchable smell. See service-boundary-and-native.
  • Pure-Dart types carry a Calculator/Validator/Formatter/Parser verb suffix and touch no Flutter. The suffix advertises that the type is framework-free and unit-testable without a widget.
  • Match the domain's ubiquitous language and keep it consistent everywhere — one word per concept across models, repositories, and UI, so search finds every reference.

Value vs. instant, and other name-carried distinctions

Encode a semantic distinction the type system can't in the name. A raw instant (DateTime.now()) used where a stable calendar value is expected is a common correctness bug; naming makes the boundary visible.

dart
// A real wall-clock instant is legal only at the Clock boundary and named as one.
final DateTime capturedAt = clock.now();      // instant, from package:clock's Clock (never DateTime.now())

// A stored quantity carries its canonical unit in the name.
final int priceMinorUnits;                    // not `price` — unit is explicit
final int distanceMeters;                     // SI base unit, integer

// Unused callback params are `_` (and `__` for a second).
onChanged: (_) => notifier.refresh(),

See value-objects-money-and-units for canonical storage and service-boundary-and-native for the Clock (from package:clock) injected via clockProvider — never a bespoke ClockService.

Worked example

dart
// task_list_notifier.dart — file name == primary declaration, snake_cased
import 'dart:async'; // dart: group, alphabetized

import 'package:flutter_riverpod/flutter_riverpod.dart'; // package: group, alphabetized

import 'task.dart'; // relative group, alphabetized

/// Frozen paging bound — unit lives in the name (rule 9).
const int maxItemsPerPage = 50; // lowerCamelCase const, not SCREAMING_CAPS

/// ViewModel for [TaskListScreen]. One Notifier per Screen, 1:1 (role suffix).
class TaskListNotifier extends AsyncNotifier<List<Task>> {
  @override
  Future<List<Task>> build() => ref.watch(taskRepositoryProvider).loadTasks();

  /// Verb-phrase command; routes through the repository's single write path.
  Future<void> archive(String taskId) async {
    await ref.read(taskRepositoryProvider).archive(taskId);
    ref.invalidateSelf();
  }

  bool get hasTasks => state.valueOrNull?.isNotEmpty ?? false; // boolean assertion
  int get taskCount => state.valueOrNull?.length ?? 0;          // noun getter, no get- prefix
}

Anti-patterns

  • SCREAMING_CAPS constants in new Dart (const MAX_ITEMS = 50) — use lowerCamelCase; the analyzer flags it.
  • Class name ≠ file name (TaskScreen living in home.dart), or a grab-bag utils.dart/models.dart holding unrelated things — breaks grep-to-file.
  • Naming a Flutter-touching type …Calculator/…Validator (a pure-Dart suffix), or a Riverpod ViewModel …ViewModel/…VM/…Controller — the suffix then lies about the layer (…Notifier on the Riverpod path; …ViewModel only in the Provider appendix).
  • A concrete impl name (FlnNotificationGateway, FirebaseAnalyticsService) referenced from shared/domain code — name the Gateway/Service interface; the impl belongs in the composition root.
  • DateTime.now() captured into a field meant to be stable, or an unnamed instant crossing into domain logic — inject a Clock and name the instant (capturedAt).
  • getDueTasks() / get/set prefixes — Dart has real getters.
  • Type baked into a name: userMap, nameString, itemsList, strName, iCount.
  • Booleans without is/has/can/should (loading, valid); unit-silent quantities (total, delay).
  • Leading _ to "namespace" a public symbol (it makes it private and unreachable); l/O/I single letters or data/temp/foo in committed code.
  • Abbreviations (opt, qty, msg) outside a single short function with a mapping comment.
  • Hand-sorted or mixed import groups — run dart format; obey directives_ordering.

Definition of done

  • Types UpperCamelCase; members/vars/constants lowerCamelCase; files/folders/prefixes lower_snake_case.
  • File name matches its primary declaration; one primary public type per file; no junk-drawer file or folder.
  • Architectural suffix applied and correct for the layer (Screen/Notifier/Repository/Dao/Service/Gateway/Failure).
  • Riverpod ViewModels are …Notifier (not …Controller/…ViewModel/…VM); pure-Dart types carry a Calculator/Validator/Formatter suffix and no Flutter import; Service/Gateway interfaces are provider-free with impls confined to the composition root.
  • Acronyms >2 letters word-cased; full dictionary words; units + semantics in the name; instants named at the Clock boundary.
  • Booleans read as assertions; functions are verb phrases; getters are noun phrases with no get prefix.
  • Imports grouped dart:/package:/relative and alphabetized; dart format + dart analyze --fatal-infos clean.

Related skills

  • dart3-idioms-and-coding-standards — which construct (sealed/record/enum) each declaration earns, and complexity limits.
  • state-management-riverpod — why the ViewModel is a Notifier, and the single write path.
  • service-boundary-and-native — provider-free Service interfaces and their composition-root impls.
  • value-objects-money-and-units — canonical-unit storage behind the unit-in-name rule.
  • naming neighbors: dartdoc-conventions for the /// contract on public symbols, lint-and-style-config for the directives_ordering/constant_identifier_names enforcement, and flutter-architecture for the layer DAG the suffixes map to.

References

よくある質問

AIスキル「Naming Conventions」では何ができますか?

Effective-Dartの命名規則(型はUpperCamelCase、メンバー/定数はlowerCamelCase、ファイルはlowercase_with_underscores)と、アーキテクチャ上の役割を示すサフィックスを徹底します。名前やgrepでレイヤーが分かるよう、Screen/Notifier/Repository/Dao/Service/Gateway/Failureを使い、ファイル名は主要な宣言に合わせます。識別子には単位と意味を含め、真偽値はis/has/can/shouldで始まる表現にします。getで始める名前、ハンガリアン記法、SCREAMING_CAPSは使わず、importはグループ分けして並べ替えます。ファイルの作成、クラス/enum/mixin/extension/typedef/変数/関数/getter/定数/引数の命名、importの整理、役割を示すサフィックスの選択、命名とディレクティブ順に関する差分レビューに使用してください。

TypingMindでNaming Conventionsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Naming Conventionsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにNaming Conventionsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/zakariaf/Flutter-Skills/tree/main/skills/naming-conventionsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Naming Conventionsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Naming Conventionsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもNaming Conventionsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Naming Conventions」は無料ですか?

はい。zakariafがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る
affaan-mのロゴ

Competitive Report Structure

affaan-m
コミュニティ人気

benchmark-methodologyで競合プロフィールカードのスコアを作成した後に使います。調査結果を、競争環境マップ、競合プロフィール、ベンチマーク比較表、未開拓領域の分析などを含む、意思決定に役立つレポートにまとめます…

40.4K
270.2K
1ファイル
表示
affaan-mのロゴ

Content Engine

affaan-m
コミュニティ人気

X、LinkedIn、TikTok、YouTube、ニュースレター向けのコンテンツ制作の仕組みや、複数プラットフォーム向けキャンペーンを作成します。SNS投稿、スレッド、台本、コンテンツカレンダーの作成や、1つの素材を各プラットフォームに合わせて調整したい場合に使います…

40.4K
270.2K
1ファイル
表示
affaan-mのロゴ

Crosspost

affaan-m
コミュニティ人気

X、LinkedIn、Threads、Blueskyを横断してコンテンツを配信します。content-engineのパターンを使って各プラットフォーム向けに調整し、同じ内容をそのまま投稿することはありません。SNS全体にコンテンツを配信したい場合に使います…

40.4K
270.2K
1ファイル
表示
affaan-mのロゴ

Deep Research

affaan-m
コミュニティ人気

firecrawlとexaのMCPを使って複数の情報源を詳細に調査します。ウェブ検索、調査結果の統合、出典を明記したレポート作成を行います。根拠と引用を含む綿密な調査が必要な場合に使います…

40.4K
270.2K
1ファイル
表示

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇