<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-write-a-claude-code-skill-8khn4pvbb" -->

---
title: How to Write a Claude Code Skill | daily.dev
description: A practical guide to writing Claude Code skills — reusable, on-demand instruction sets for Claude Code sessions. Covers the anatomy of a skill (SKILL.md with...
canonical: https://daily.dev/posts/how-to-write-a-claude-code-skill-8khn4pvbb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Write a Claude Code Skill | daily.dev
og:description: A practical guide to writing Claude Code skills — reusable, on-demand instruction sets for Claude Code sessions. Covers the anatomy of a skill (SKILL.md with...
og:url: https://daily.dev/posts/how-to-write-a-claude-code-skill-8khn4pvbb
og:image: https://api.daily.dev/og/posts/8KhN4PVbb.png
og:image:alt: How to Write a Claude Code Skill
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Write a Claude Code Skill

**[RUBYLAND](https://daily.dev/sources/rubyla)** · 9 min read · 0 upvotes · 0 comments

## Summary

A practical guide to writing Claude Code skills — reusable, on-demand instruction sets for Claude Code sessions. Covers the anatomy of a skill (SKILL.md with YAML front matter and Markdown body), where to store skills (personal, project, or plugin), how to write effective descriptions that trigger the skill reliably, dynamic context injection using shell commands, and progressive disclosure via references/, patterns/, and scripts/ subdirectories to keep token costs low. Illustrated with a Rails migration review skill as a concrete example.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.ombulabs.ai/blog/how-to-write-a-claude-code-skill.html>

## Similar posts on daily.dev

- [Write a Claude Code Skill: 2026 Developer Guide](https://daily.dev/posts/write-a-claude-code-skill-2026-developer-guide-bl6gfoqoj) · Alex CloudStar · 0 upvotes · 0 comments
- [How to Build a Production-Ready Claude Code Skill](https://daily.dev/posts/how-to-build-a-production-ready-claude-code-skill-lpjaqohp3) · Towards Data Science · 3 upvotes · 1 comments

---

Tags: [#rails](https://daily.dev/tags/rails), [#ai-coding](https://daily.dev/tags/ai-coding), [#prompt-engineering](https://daily.dev/tags/prompt-engineering), [#claude-code](https://daily.dev/tags/claude-code)

[View this post on daily.dev](https://daily.dev/posts/how-to-write-a-claude-code-skill-8khn4pvbb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Write a Claude Code Skill","url":"https://daily.dev/posts/how-to-write-a-claude-code-skill-8khn4pvbb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-write-a-claude-code-skill-8khn4pvbb"},"datePublished":"2026-06-23T23:22:14.519Z","dateModified":"2026-06-24T10:25:27.253Z","description":"A practical guide to writing Claude Code skills — reusable, on-demand instruction sets for Claude Code sessions. Covers the anatomy of a skill (SKILL.md with...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/36a5990acbe9ddc862893b9870575d76?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/36a5990acbe9ddc862893b9870575d76?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"RUBYLAND","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"RUBYLAND","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/rubyla","url":"https://daily.dev/sources/rubyla"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-write-a-claude-code-skill-8khn4pvbb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"rails,ai-coding,prompt-engineering,claude-code","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"RUBYLAND","item":"https://daily.dev/sources/rubyla"},{"@type":"ListItem","position":3,"name":"How to Write a Claude Code Skill"}]}
```

