Module 5: LLM Skills

AI-Powered Coding and Data Analysis

Context files

  • Context files (AGENTS.md, CLAUDE.md) are persistent instructions an agent reads with each request.
  • They hold rules that apply across prompts: project purpose, conventions, and prohibited actions.
  • They are plain text files added to the messages sent to the model.

Keep AGENTS.md brief, with guidelines for the whole project. Put guidance on specific tasks in skills. A skill loads only when a task needs it, so the agent doesn’t receive unrelated instructions with every request.

In my experience, AI-generated AGENTS.md and SKILL.md files are adequate when they’re kept short and focused. Research suggests you should watch them closely: AI-generated AGENTS.md files reduced success and increased cost on SWE-bench tasks, and hand-written files performed better (Gloaguen et al., 2026). If a generated file isn’t working, take it over and write it yourself.

Skills

A skill is a folder with a SKILL.md file: a name, a one-line description of when to use it, and instructions. The tool loads a skill when a task matches its description, so you don’t have to mention it. Context files always load. Skills load only when relevant.

Tool Reads project skills from
Posit Assistant .agents/skills/
Codex .agents/skills/
Claude Code .claude/skills/

A skill file starts with its name and description, followed by the rules:

---
name: ggplot-style
description: House style for ggplot2 figures in this project. Use whenever
  creating or editing a ggplot2 chart.
---

# ggplot2 house style

- Start from `theme_minimal(base_size = 14)`.
- The title states the finding in plain words.
- Axis labels include units.

Demonstration

This module uses the same project twice. One copy has no skills, and the other adds a ggplot-style skill. Download both:

Give both the same prompt:

Complete the task in notebooks/visualization.qmd and render it.

Claude Code has a built-in charting skill that it may load in either copy. If it reports using a skill in the copy without one, note which skill. The ggplot-style skill is the only difference between the copies.

Then compare the two figures and interpretations:

  • Theme and colors
  • The ages plotted
  • A title that states the finding
  • Units on the axes
  • A subtitle with the sample size
  • The “Source:” caption
  • Handling of missing rows
  • An interpretation without causal language that notes the estimates are unweighted

Check every rule in the skill. Verify at least one rule yourself in the figure, for example the colors or the n in the subtitle. If the agent says it followed every rule, treat that as a claim to check.

Limits of skills

  • A skill makes a behavior more likely, but it does not guarantee it.
  • Each loaded skill adds to the context window.
  • Every output still needs checking against the rules.