Karthik R Code Styleのロゴ

Karthik R Code Style

コミュニティ
skthewimp
karthik-r-code-style

Karthik's R code layout: one pipe per line, right-assigned pipelines, expanded multi-arg calls, +-per-line ggplot, 2-space indent.

概要

公開者skthewimp
リポジトリkarthik-data-visualization-skill
スキル名karthik-r-code-style
スター
49
フォーク
5
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

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

  • どのLLMでも利用可能

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

  • 指示だけで完結

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

  • オープンソース

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

インストール

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

1

TypingMindにインストール

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

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

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

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

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

TypingMindで使用

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

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

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

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

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

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

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

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

スキルの指示

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

Karthik R Code Style

Use whenever you write or edit R for Karthik - scripts, .Rmd/.qmd chunks, ggplot code, anything. This skill governs layout: line breaks, indentation, bracket expansion, assignment direction, spacing. It does not govern which idioms or which analysis to write - that is karthik-r-analysis-style. Apply both together when generating a notebook; apply this one alone when the request is just "format this" or "write this in my R style".

LLM-generated R packs everything onto long horizontal lines. Karthik's R breaks vertically so each step reads as its own line and a pipeline can be run line by line while exploring. Default to the expanded layout below; don't wait to be asked for it.

The rules

1. One pipe per line

Every %>% or |> ends its line. The source object sits at the pipeline's base indent; each following verb goes on a new line, indented one step (2 spaces) under it.

r
movie_shows %>%
  arrange(show_id, desc(start_at)) %>%
  distinct(show_id, .keep_all = TRUE) %>%
  mutate(show_date = as_date(start_at))

Never chain two verbs on one line (x %>% filter(...) %>% select(...) on a single line is wrong for anything beyond a throwaway one-liner).

2. Right-assign pipelines

A pipeline that builds a named object ends with right assignment, so the chain can be selected and run top-down. Always put -> at the end of the expression and the target object on the next line, indented 2 spaces from the pipeline's base indent. Never put the target on the same line as ->, even for a short expression.

r
shows %>%
  summarise(
    first_show_date = min(show_date),
    .by = movie_id
  ) ->
  movie_show_dates

movie_show_dates %>%
  left_join(selected_releases, by = "movie_id", relationship = "one-to-one") ->
  movie_releases

Reserve <- for short, single-line assignments that are not pipelines (outdir <- "report_assets", emph <- "#C6462F"). Reading a file into a name also uses right assignment with the target on the next line:

r
read_parquet(path) ->
  movie_shows

3. Expand multi-argument calls

When a call carries several arguments, or won't sit comfortably on one line, put ( at the end of the line, one argument (or one logical group) per line indented one step, and the closing ) on its own line at the call's base indent. The next %>% or -> follows the ); after ->, put the target object on the next line.

r
screens_raw %>%
  summarise(
    rows = n(),
    seat_values = n_distinct(seats),
    .by = screen_id
  ) ->
  screen_capacity

For per-operation grouping (the default in karthik-r-analysis-style), put .by = key or .by = c(key1, key2) last, on its own argument line inside mutate(), summarise(), or another supporting verb. Avoid a surrounding group_by() / ungroup() pair for a single grouped operation.

Don't expand trivial calls. n(), select(chat_id, year), count(uuid) stay inline - the rule is for calls with real argument lists, not every set of parentheses.

4. ggplot: + per line

Each layer ends with +; the next geom_*, scale_*, labs(), annotate(), theme() goes on its own line indented one step under ggplot(...). A single layer with many arguments expands by rule 3.

r
ggplot(arc, aes(year)) +
  geom_line(aes(y = affection), colour = emph, linewidth = 1.3) +
  geom_point(aes(y = affection), colour = emph, size = 2.4) +
  labs(
    title = "The relationship, in two lines",
    subtitle = "Mean coded affection and tension per chat, by year"
  ) +
  base_theme

5. Indent is 2 spaces, and it nests

One step is two spaces. A bracket opened inside an already-indented line adds another two. Align the closing bracket with the line that opened it.

6. Spacing

Space after every comma. Spaces around = in named arguments and around operators (year >= 2008, by = "movie_id"). This is the modern-notebook convention; ignore the cramped no-space style of the pre-2016 base-R files on disk.

What this is not

Not a linter to run over Karthik's old code - old hand-written files keep their own style, including base-R Allman braces and cramped spacing. This skill shapes new R you generate. Idiom choice (tidyverse over base R, cummean over index loops, no raw SQL) and notebook structure live in karthik-r-analysis-style; final chart design lives in karthik-data-visualization.

よくある質問

AIスキル「Karthik R Code Style」では何ができますか?

Karthik's R code layout: one pipe per line, right-assigned pipelines, expanded multi-arg calls, +-per-line ggplot, 2-space indent.

TypingMindでKarthik R Code Styleを使うメリットは何ですか?

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

TypingMindにKarthik R Code Styleをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/skthewimp/karthik-data-visualization-skill/tree/main/karthik-r-code-style/claudeを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Karthik R Code Styleを使えるAIモデルはどれですか?

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

Karthik R Code Styleで使えるAIモデルの数に制限はありますか?

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

AIスキル「Karthik R Code Style」は無料ですか?

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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