natural-transformations — Claude Code skill for category theory
This skill guides category-theory work on natural transformations, with Lean 4 notation for checking naturality and applying related constructions.
MIT ★ 3,951 updated 2026-01-26
npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a claude-codeWhat natural-transformations does
The skill lays out a way to analyze a natural transformation: check the naturality condition for each morphism, then inspect its components. Further sections cover natural isomorphisms, functor categories, and the Yoneda lemma.
Lean 4 examples name Mathlib constructions such as NatTrans.vcomp, NatTrans.hcomp, and CategoryTheory.yonedaEquiv. The skill also points to lake build for checking a project build. That check depends on having a Lean 4 project set up for compilation; the skill itself is not a compiler.
What it helps with
- verify the naturality condition for a morphism
- inspect components of a natural transformation
- relate two functors through a natural isomorphism
- choose vertical or horizontal composition
- apply the Yoneda lemma in Lean 4
Example prompts for the agent
- Check the naturality condition for this transformation and write it in Lean 4.
- Show how to define the components of
η : F ⟶ Gin Lean 4. - Explain how to use
CategoryTheory.yonedaEquivin this proof.
How to install natural-transformations
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a claude-code2Manually: put the files in place
~/.claude/skills/natural-transformations/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/natural-transformations/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a codex2Manually: put the files in place
.agents/skills/natural-transformations/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a cursor2Manually: put the files in place
.cursor/skills/natural-transformations/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install parcadei/Continuous-Claude-v3 .claude/skills/math/category-theory/natural-transformations2Manually: put the files in place
.github/skills/natural-transformations/SKILL.md1Skills CLI (Vercel)
npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a gemini-cli2Platform CLI
gemini skills install https://github.com/parcadei/Continuous-Claude-v3 --path .claude/skills/math/category-theory/natural-transformationsManually: put the files in place
.devin/skills/natural-transformations/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about natural-transformations
How do I install natural-transformations in Claude Code?
Run npx skills add parcadei/Continuous-Claude-v3 --skill natural-transformations -a claude-code. The skill file is at ~/.claude/skills/natural-transformations/SKILL.md.
What does natural-transformations do?
It provides a workflow for reasoning about natural transformations, natural isomorphisms, functor categories, and the Yoneda lemma, with Lean 4 examples.
Do I need Lean 4 to use this skill?
Its code examples use Lean 4 and Mathlib notation. To check a build, use lake build in a configured Lean 4 project.
Source text
SKILL.md · MIT
---
name: natural-transformations
description: "Problem-solving strategies for natural transformations in category theory"
allowed-tools: [Bash, Read]
---
# Natural Transformations
## When to Use
Use this skill when working on natural-transformations problems in category theory.
## Decision Tree
1. **Verify Naturality**
- eta: F => G is natural transformation between functors F, G: C -> D
- For each f: A -> B in C, diagram commutes:
G(f) . eta_A = eta_B . F(f)
- Write Lean 4: `theorem nat : η.app B ≫ G.map f = F.map f ≫ η.app A := η.naturality`
2. **Component Analysis**
- eta_A: F(A) -> G(A) for each object A
- Each component is morphism in target category D
- Lean 4: `def η : F ⟶ G where app := fun X => ...`
3. **Natural Isomorphism**
- Each component eta_A is isomorphism
- Functors F and G are naturally isomorphic
- Notation: F ≅ G (NatIso in Mathlib)
4. **Functor Category**
- [C, D] has functors as objects
- Natural transformations as morphisms
- Vertical composition: Lean 4 `CategoryTheory.NatTrans.vcomp`
- Horizontal composition: `CategoryTheory.NatTrans.hcomp`
5. **Yoneda Lemma Application**
- Nat(Hom(A, -), F) ~ F(A) naturally in A
- Lean 4: `CategoryTheory.yonedaEquiv`
- Fully embeds C into [C^op, Set]
- See: `.claude/skills/lean4-nat-trans/SKILL.md` for exact syntax
## Tool Commands
### Lean4_Naturality
```bash
# Lean 4: theorem nat : η.app B ≫ G.map f = F.map f ≫ η.app A := η.naturality
```
### Lean4_Nat_Trans
```bash
# Lean 4: def η : F ⟶ G where app := fun X => component_X
```
### Lean4_Yoneda
```bash
# Lean 4: CategoryTheory.yonedaEquiv -- Yoneda lemma
```
### Lean4_Build
```bash
lake build # Compiler-in-the-loop verification
```
## Cognitive Tools Reference
See `.claude/skills/math-mode/SKILL.md` for full tool documentation.
© parcadei · MIT · parcadei/Continuous-Claude-v3