Create Your First Claude Code Skill

John Lindquist
InstructorJohn Lindquist

Social Share Links

Tweet

AI assistants in Claude have limitations, like not knowing the current time, which can cause automation tasks to fail. This lesson teaches you how to overcome these issues by creating custom "Skills." You'll learn the file structure and SKILL.md format required to define a new skill, including the crucial description for discovery and allowed-tools to safely grant access to shell commands. By building a simple timestamp skill, you'll see how to provide Claude with the exact knowledge needed to turn a failed request into a successful, precisely timestamped result, unlocking a new level of custom automation.

The Problem

AI assistants like Claude have powerful capabilities but also inherent limitations. A common issue is their lack of awareness of the current time (hours, minutes, seconds), which prevents them from executing tasks that require precise timestamps. This lesson demonstrates this limitation and provides a powerful solution.

The Solution: Custom Skills

You can teach Claude new abilities using the "Skills" feature. By defining a custom skill in your project, you can grant the AI access to specific shell commands and provide it with the knowledge it needs to perform more complex and reliable automation.

Workflow Demonstrated

This lesson walks you through creating a timestamp skill from scratch. You will learn to:

  • Create a SKILL.md file in the required .claude/skills/ directory.
  • Define the skill's behavior using YAML frontmatter, including a name, description, and allowed-tools.
  • Understand why the description is the most critical part, as it's how Claude discovers when to use the skill.
  • Safely grant permission for the AI to run specific shell commands, like date.
  • See the skill in action as Claude successfully uses it to generate a file with a perfect, down-to-the-second timestamp.

Key Benefits

  • Overcome the built-in limitations of AI models.
  • Create reusable, project-specific tools to enhance automation.
  • Safely grant the AI access to your command line for more powerful actions.
  • Make your AI assistant a more reliable partner for complex development tasks.

Prompts

Please check the current git status and write out a timestamped file with a summary of it.

Commands

claude
# File path for the new skill
.claude/skills/timestamp/SKILL.md
# Example command provided within the skill's markdown body
date +%Y-%m-%d-%H-%M-%S

Code Snippets

The following is the complete content of the SKILL.md file created in the lesson to teach Claude how to generate a precise timestamp.

---
name: timestamp
description: Create timestamps for files, directories, and other resources, in the format YYYY-MM-DD-HH-MM-SS
allowed-tools: Bash(date:*)
---

# Timestamp

Create a timestamp in the format YYYY-MM-DD-HH-MM-SS.

## Usage

```bash
date +%Y-%m-%d-%H-%M-%S
```

[00:00] When running Clawed, if we try and run a command like please check the current git status and write out a timestamped file with a summary of it, you'll see when it tries to timestamp a file that it doesn't have knowledge of the current time for hours and minutes and seconds. So you run into this limitation of the AI only knowing the current date. So essentially you want to give Claude more capabilities and Claude calls these skills. So if I cancel out and then exit this session with ctrl-c I'm going to hit command-p and create a file at .claude slash skills slash timestamp and then slash skill dot MD and skill has to be all uppercase and I'll say create this file and in this file we need front matter in YAML format and I'm going to accept everything cursor is suggesting here where we're going to have these three properties of name, description, and allowed tools where the most critical piece is the description because Clawd isn't going to load this section unless Claude thinks from your instructions that this description should load in the rest of the file. And then for allowed tools, since we're using date here, we need to wrap it in bash until it accepts any date command which is just this date here.

[01:20] Now the format of the body of the markdown file doesn't matter nearly as much just keep it organized with headers, toss in examples, and be descriptive of how you want the tool to be used. But don't overdo it and just essentially assume that Clod will pick up on your instructions when it loads this file in. So close this out, then we'll open Clod again. I'm going to run the same query by pressing up, hit enter, and then this time you'll see it ran that bash command to generate a proper date with hours, minutes, and seconds. So I'll go ahead and save this by pressing 2 to allow edits, and now we have our time stamped file because we gave it that skill.