惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 聂微东
IT之家
IT之家
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
博客园 - 【当耐特】
The Cloudflare Blog
宝玉的分享
宝玉的分享
罗磊的独立博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
V
Visual Studio Blog
小众软件
小众软件
博客园_首页
Last Week in AI
Last Week in AI
J
Java Code Geeks
V
V2EX
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
博客园 - 司徒正美
Engineering at Meta
Engineering at Meta
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
DataBreaches.Net
博客园 - 三生石上(FineUI控件)
MyScale Blog
MyScale Blog
云风的 BLOG
云风的 BLOG
The Register - Security
The Register - Security
M
MIT News - Artificial intelligence
Microsoft Azure Blog
Microsoft Azure Blog
T
The Blog of Author Tim Ferriss
N
Netflix TechBlog - Medium
F
Full Disclosure
B
Blog
H
Help Net Security
C
Check Point Blog
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog
P
Proofpoint News Feed
D
Docker
Microsoft Security Blog
Microsoft Security Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Claude Code Skills: A Practical Guide for 2026
Muhammad Moe · 2026-05-05 · via DEV Community

If you have spent any real time with Claude Code, you have probably noticed the same problem I did. You write the same instructions in the prompt every other day. "Use four-space indentation here." "Always run the linter after edits." "Format commit messages this way." After the third or fourth repeat, it stops feeling like a prompt and starts feeling like missing config.

Skills are how Claude Code fixes that. A skill is a small folder, with one markdown file inside, that Claude pulls into the conversation only when your request actually needs it. No setup screen. No plugin manager. Just a file in a folder and a one-line description telling Claude what it is for.

This post is a clean walkthrough for 2026. What a skill actually is, how to write your first one, where to put it, and how it compares to the two things people often confuse it with: slash commands and subagents.

What a Claude Code Skill actually is

At the most basic level, a skill is a directory with a single file called SKILL.md inside it. The file has two parts.

  • A short YAML frontmatter at the top, with a name and a description.
  • A markdown body underneath, with the instructions Claude follows when the skill is triggered.

That is the whole spec. Everything else, examples, supporting scripts, templates, helper files, is optional and lives in the same directory.

Here is the smallest valid skill you can write:

.claude/skills/run-tests/
└── SKILL.md

Enter fullscreen mode Exit fullscreen mode

---
name: run-tests
description: "Run the project's test suite using the Makefile target. Use this whenever the user asks to run tests, check tests, or verify the test suite is passing."
---

Run `make test` from the repo root. If the command fails, read the failing test
output, point out the specific assertion that broke, and ask before changing
anything in the source files.

Enter fullscreen mode Exit fullscreen mode

That is a working skill. Drop it in .claude/skills/run-tests/, restart Claude Code, and the next time you say "run the tests" Claude will use this instead of guessing.

How Claude actually picks up a skill

This is the part that confuses people most. Skills are not always-on. They are auto-discovered.

Here is what happens when you send a message:

  1. Claude reads the descriptions of every skill it can see.
  2. It compares your message to those descriptions.
  3. If one matches, it pulls that skill's full content into the conversation.
  4. If nothing matches, no skill is loaded and you get the default behavior.

This is why the description does most of the heavy lifting in any skill. It is the only thing Claude has to decide whether the skill applies. A vague description ("Helps with tests") will rarely fire. A specific one ("Runs the project's pytest suite when the user asks to run, check, or verify tests") will fire reliably.

A simple test: read your description out loud. If it does not start with a clear verb and end with a clear trigger, rewrite it.

Where skills live

Skills sit in one of three places. The location decides who sees them.

Location Scope When to use
.claude/skills/<name>/ inside a repo Project Workflows specific to one codebase
~/.claude/skills/<name>/ in your home directory Personal Workflows you want everywhere
Plugins or shared packages Team Skills you want to ship to others

Project skills win when there is a conflict. So if your repo has a run-tests skill and your personal folder has one too, the project one is used while you are inside that repo. That is almost always what you want.

A small but important detail: skills that live inside the repo are checked into git by default. That is fine. They are usually short, they help every collaborator, and they are easier to review than long CLAUDE.md files.

A walkthrough: build a skill from scratch

Let us write something slightly more useful than run-tests. Say you have a personal habit of starting every commit message with a Conventional Commit type (feat:, fix:, chore:). You want Claude to do the same when it commits.

Step 1: make the directory

From the root of your project:

mkdir -p .claude/skills/conventional-commit

Enter fullscreen mode Exit fullscreen mode

Step 2: write SKILL.md

Open .claude/skills/conventional-commit/SKILL.md and put this inside:

---
name: conventional-commit
description: Use this skill any time the user asks for a git commit, to commit changes, or to write a commit message. It writes the message in Conventional Commit format.
---

When you create a git commit, follow these rules.

1. Start the subject line with one of: feat, fix, chore, docs, refactor, test, perf.
2. Add a colon and a space, then a short imperative summary, no period.
3. Keep the subject under 70 characters.
4. If the change touches more than two files, add a one-line body that says why.

Example:

  feat: add IndexNow ping to publish workflow

  Auto-pings Bing on every push to main so new posts get indexed faster.

Enter fullscreen mode Exit fullscreen mode

Step 3: try it

Restart Claude Code (or just open a new conversation). Say "commit these changes". Claude should pull in the skill, follow the format, and you should see a commit subject that matches the rules.

If it does not fire, the description is the first thing to fix. Make the trigger words match what you actually say to Claude.

Skills vs slash commands vs subagents

This is the question I get most often, and the line is genuinely fuzzy because the three features have grown closer over time. Here is how I think about them in practice.

Skills

  • Auto-discovered. Claude decides when to use them based on your message.
  • Live inside the main conversation, so the work stays visible and you can intervene.
  • Best for: repeated workflows you do not want to type out, like commit formatting, test running, or PR conventions.

Slash commands

  • You invoke them by hand, with /command-name.
  • Same file format as skills now, in fact a single skill file gives you both an auto-trigger and a /run-tests slash command for free.
  • Best for: explicit triggers when you want full control over when something runs.

Subagents

  • Spawned by Claude into a separate, fresh context with their own tools and memory.
  • They do not see your conversation. They get a brief from Claude and report back.
  • Best for: heavy or noisy work you want to keep out of your main context, like searching the whole repo, running long evals, or summarising a large diff.

A useful rule of thumb. If the work is small and should stay in front of you, that is a skill. If the work is big and should run in a side process, that is a subagent. If you specifically want a typed entry point, slash command.

For more on the subagent side, the hooks guide on this site covers the shell-level lifecycle that pairs well with skill-based workflows.

Three small skills that pay for themselves

These are skills I have on most of my repos. None of them are clever. All of them save real time.

1. lint-after-edit

---
name: lint-after-edit
description: Run the project's linter after any code edit. Use any time the user asks Claude to edit, refactor, fix, or modify a source file.
---

After completing any edit to a .ts, .tsx, .js, or .py file, run `npm run lint`
(or `ruff check .` for Python). If the lint fails, fix the warnings before
reporting that the edit is done.

Enter fullscreen mode Exit fullscreen mode

The reason this works is that "edit a source file" is a very common trigger. The skill fires almost every coding session and you stop seeing lint failures land in commits.

2. pr-description

---
name: pr-description
description: Write a pull request description from the current branch's commits. Use any time the user asks for a PR description, PR body, or pull request summary.
---

Read `git log main..HEAD` and write a PR description in this format.

## Summary
One short paragraph, no marketing language.

## Changes
- One bullet per logical change, not per commit.

## Test plan
- A checklist a reviewer can run.

Do not include emojis, do not start lines with "This PR".

Enter fullscreen mode Exit fullscreen mode

The "do not" lines matter. Negative instructions are how you stop Claude from drifting back to its defaults.

3. clean-imports

---
name: clean-imports
description: Remove unused imports and sort the rest. Use any time the user asks to clean imports, sort imports, or tidy imports in a file.
---

For each file the user asks to clean:

1. Remove imports that are not referenced anywhere in the file.
2. Sort what remains by: standard library, then third-party, then local.
3. Group each section with a blank line between them.

Do not touch import side effects (imports with no name).

Enter fullscreen mode Exit fullscreen mode

Skill, slash command, and auto-trigger all in one file. Same content. Three ways to invoke it.

Best practices that actually matter

After writing dozens of skills for myself and clients, three rules stand out.

One skill, one job

The most common mistake is the mega-skill. A single SKILL.md trying to handle commits, PRs, branch naming, and changelog updates all at once. Mega-skills load late, fire less reliably, and confuse Claude when two parts conflict. Split them. A skill should fit on one screen.

Write the description like a trigger, not a label

Bad:

A skill for working with tests.

Good:

Run the project's pytest suite when the user asks to run tests, check tests, or verify the test suite is passing.

The good version names the verbs Claude needs to spot. "Run", "check", "verify" — those are the words a user actually types.

Keep instructions imperative

Skills that read like documentation ("This skill is responsible for...") fire less reliably than skills that read like instructions ("Run X. Then Y. If Z, do W.") Direct verbs map cleanly to actions.

Resist the urge to over-script

You can ship Python or shell scripts inside a skill folder, and sometimes that is right. But for most workflows, plain markdown instructions are enough and easier to maintain. Use scripts when the work is genuinely deterministic, not just because you can.

Common mistakes

A few patterns I see again and again.

  • Description is too generic. If yours starts with "A skill that helps with...", it will rarely fire. Rewrite it to start with a verb.
  • Skill is in the wrong folder. ~/.claude/skills/ is for personal skills across all projects. .claude/skills/ is for the current project only. Mixing them up is the most common reason a skill "is not picked up."
  • Trying to replace CLAUDE.md. Skills are for repeated, triggered workflows. CLAUDE.md is for always-on context like project conventions. They complement each other.
  • Forgetting to restart Claude Code. Skills are loaded on session start. If you add one mid-conversation, end the session and start a new one.
  • Putting secrets inside SKILL.md. Skills are committed to git in most setups. Treat them like source code, not config.

Frequently asked questions

Where exactly do project skills go?
Inside your repo at .claude/skills/<skill-name>/SKILL.md. The folder is committed to git unless you ignore it.

How is this different from a slash command?
A skill file is a slash command. The same file gives you both auto-discovery and a /skill-name invocation. Slash commands are the manual entry point. Skills are the auto-discovered side of the same thing.

How is it different from a subagent?
Subagents run in a fresh, isolated context. Skills run inside your current conversation. Use a skill when you want the work in front of you. Use a subagent when you want it offloaded.

Do I need to restart Claude Code after adding a skill?
Yes. New skills are picked up when a session starts. End the conversation and open a new one to load them.

Can a skill use external scripts?
Yes. You can include shell or Python scripts in the skill folder and reference them from SKILL.md. For most workflows, plain markdown instructions are enough.

Does this work in Claude Chat or only in Claude Code?
The same SKILL.md format works across Claude Code, Claude Chat, and Claude Cowork. Each product looks for skills in its own location, but the file format is identical.

Should I put skills in CLAUDE.md instead?
No. CLAUDE.md is for always-on project context. Skills are for triggered workflows. Loading every workflow into CLAUDE.md bloats the main context and slows the model down.

A short closing thought

The reason skills matter is not that they are clever. It is that they remove the small, repeated friction of telling Claude the same thing every day. A good skill is short, targeted, and almost invisible: you stop noticing it because the work just gets done the way you wanted.

Start with one. The smallest one you can think of. A commit format, a lint rule, a PR template. Once one is working, write the next one. Within a week or two you will have a folder of small files that quietly shape how Claude works on your project, and you will wonder how you ever managed without them.

If you are extending Claude Code with hooks for shell-level enforcement or building MCP servers for richer integrations, skills sit comfortably between the two: lighter than a server, more flexible than a hook, and easier to share across a team than either.