Karthik R Code Style logo

Karthik R Code Style

Community
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.

Overview

Publisherskthewimp
Repositorykarthik-data-visualization-skill
Skill namekarthik-r-code-style
Stars
49
Forks
5
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by skthewimp on GitHub. Read the source before you install it.

Installation

Install the Karthik R Code Style AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/skthewimp/karthik-data-visualization-skill/tree/main/karthik-r-code-style/claude
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Karthik R Code Style in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Karthik R Code Style on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Karthik R Code Style is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Frequently asked questions

What does the Karthik R Code Style AI skill do?

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

Why use Karthik R Code Style on TypingMind?

Because you install it once and use it with any model. Karthik R Code Style is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Karthik R Code Style in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/skthewimp/karthik-data-visualization-skill/tree/main/karthik-r-code-style/claude. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Karthik R Code Style?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Karthik R Code Style?

As many as you like. As long as a model supports skills, you can use Karthik R Code Style with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Karthik R Code Style AI skill free?

Yes. It is published on GitHub by skthewimp under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇