Dbt Best Practicesのロゴ

Dbt Best Practices

組織
astrafy
dbt-best-practices

Kimball/dimensional dbt best practices for this repo. Use whenever creating, editing, reviewing, or testing any dbt model, snapshot, seed, macro, or test. Also use when answering questions about data modeling patterns, surrogate keys, SCD2, incremental strategies, or layer architecture in this project.

概要

公開者astrafy
リポジトリastrafy-agent-tools
スキル名dbt-best-practices
スター
28
フォーク
5
同梱ファイル
10
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 10個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

dbt Best Practices

Approach: Kimball / dimensional modeling (star schema).

Creating New Models

Step 1: Decide what to build

Read Architecture to determine:

  • Which models to create (layer, prefix, naming convention)
  • What each model queries (flow rules)
  • Where to place files (folder structure)

Step 2: Write the model or snapshot files

Read these three references, then create the required files:

  1. General Rules — key rules, BigQuery optimization, testing by column pattern, severity, useful packages
  2. Naming & Style — column naming conventions, SQL/YAML/Jinja style
  3. The corresponding layer file:
Model prefixSub-layerLayer file
seed_, raw_Raw
stg_ (incl. stg_*_scd2 snapshots)Staging
int_Intermediate
dim_, dim_*_scd2, fct_, brg_01_coreDatamart
agg_, wide_02_enrichedDatamart
rpt_, retl_, ai_, comp_, rec_03_consumptionDatamart

For regular models, create matching .sql and .yml files. For stg_*_scd2, create a dbt snapshot SQL definition and follow the snapshot-specific guidance in the staging reference.

SCD2 Work

When creating or editing any *_scd2 artifact, read all of:

  1. General Rules
  2. Naming & Style
  3. Staging — for the stg_*_scd2 snapshot definition
  4. Intermediate — for the int_ model that consumes the snapshot
  5. Datamart — for the dim_*_scd2

A dim_*_scd2 must be built from an int_ model that consumes a stg_*_scd2 snapshot. Before building the dimension, verify the upstream snapshot and intermediate model exist — if missing, create them first.

Editing Existing Models

Identify the layer from the model's prefix, then read:

  1. General Rules
  2. Naming & Style
  3. The corresponding layer file (see table above)

Reviewing / Auditing Models

Read General Rules, Naming & Style, the corresponding layer file, and the Review Checklist. Walk through each checklist item and report violations. If the layer is unclear, infer it from the model prefix; if there is no prefix, ask the user.

Macros

Read General Rules.

Adding or Fixing Tests Only

Read General Rules (testing section) and the corresponding layer file for layer-specific testing requirements.

Performance / Incremental Work

Read General Rules (partitioning & clustering) and Incremental Models.

Deduplication / Mapping Patterns

When working with dedup, mapping, or remapped models in the intermediate layer, read Intermediate Dedup Patterns in addition to the intermediate layer file.

Before Finishing

After creating or editing any model, build it with uv run dbt build --select <model> (append + for downstream if relevant). Use the bq CLI against the dev project/datasets for data checks. Do not consider the task complete until the model builds and its tests pass.

When to Ask the User

Always ask the user before making assumptions on:

  • Business logic decisions: dedup strategy, grain definition, accepted values lists, SCD type
  • Ambiguous entity naming: when multiple sources produce entities with the same name
  • Model placement: whether to create a new intermediate model vs. inline logic in the datamart
  • Grain changes: when a transformation changes the grain of the data

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Dbt Best Practices」では何ができますか?

Kimball/dimensional dbt best practices for this repo. Use whenever creating, editing, reviewing, or testing any dbt model, snapshot, seed, macro, or test. Also use when answering questions about data modeling patterns, surrogate keys, SCD2, incremental strategies, or layer architecture in this project.

TypingMindでDbt Best Practicesを使うメリットは何ですか?

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

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

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/astrafy/astrafy-agent-tools/tree/main/skills/dbt-best-practicesを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Dbt Best Practicesを使えるAIモデルはどれですか?

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

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

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

AIスキル「Dbt Best Practices」は無料ですか?

astrafyがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

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

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

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

すべて見る

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

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