pytorch-lightning — Claude Code skill: what it does, how to install
Guides agents through structuring PyTorch Lightning 2.6.6 code, from LightningModules to distributed trainers. Useful when scaling training across GPUs.
npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning -a claude-codeWhat pytorch-lightning does
This skill helps agents organize deep learning pipelines according to Lightning 2.6.6 patterns. It provides guidance on splitting model logic into LightningModule steps, encapsulating data processing inside LightningDataModule, and configuring Trainer instances for distributed execution using DDP, FSDP, or DeepSpeed.
The environment requires Python 3.10 or higher with lightning and a compatible PyTorch build. CPU tests run locally without active network access, but multi-GPU strategies and online loggers like Wandb or MLflow require appropriate hardware and service credentials.
A critical technical rule here is namespace consistency: use either import lightning as L or legacy pytorch_lightning, because mixing them in one codebase breaks class compatibility.
What it helps with
- Refactor raw PyTorch training loops into structured LightningModule classes
- Configure multi-GPU scaling strategies such as DDP and FSDP
- Organize data downloading and batch loading inside a LightningDataModule
- Set up training callbacks for model checkpoints and early stopping
Example prompts for the agent
- Convert this PyTorch model and its training loop into a clean LightningModule
- Configure a Trainer for 4 GPUs using the DDP strategy and mixed precision
- Build a reusable LightningDataModule for caching and splitting dataset batches
How to install pytorch-lightning
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning -a claude-code2Manually: put the files in place
~/.claude/skills/pytorch-lightning/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/pytorch-lightning/
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning -a codex2Manually: put the files in place
.agents/skills/pytorch-lightning/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning -a cursor2Manually: put the files in place
.cursor/skills/pytorch-lightning/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install K-Dense-AI/scientific-agent-skills pytorch-lightning2Manually: put the files in place
.github/skills/pytorch-lightning/SKILL.md1Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning -a gemini-cli2Platform CLI
gemini skills install https://github.com/K-Dense-AI/scientific-agent-skills --path skills/pytorch-lightningManually: put the files in place
.devin/skills/pytorch-lightning/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
From the same set120
The whole set →Similar
Questions about pytorch-lightning
How do I install the pytorch-lightning skill in Claude Code?
Run npx skills add K-Dense-AI/scientific-agent-skills --skill pytorch-lightning -a claude-code in your terminal.
What does the pytorch-lightning skill do?
It provides the agent with structured references and best practices for creating LightningModules, data modules, and multi-device training workflows.
Can I mix lightning and pytorch-lightning imports?
No. You should use import lightning as L with the lightning package and avoid mixing class namespaces with legacy pytorch-lightning imports.