Project 9: Hello World Skill - Git Commit Assistant

Project 9: Hello World Skill - Git Commit Assistant

Build your first Claude Code skill that Claude auto-discovers and invokes when you mention commits.

Quick Reference

Attribute Value
Difficulty Beginner
Time Estimate 2-4 hours
Language Markdown (SKILL.md)
Prerequisites Basic git knowledge, understanding of Claude Code
Key Topics Skills, skill discovery, prompt engineering, YAML frontmatter
Knowledge Area Skills / Git / Developer Workflow
Main Book โ€œPro Gitโ€ by Scott Chacon

1. Learning Objectives

By completing this project, you will:

  1. Understand the SKILL.md format: Master the YAML frontmatter and markdown body structure that defines a skill
  2. Grasp skill discovery mechanics: Learn how Claude matches skill descriptions to user intent
  3. Write effective skill descriptions: Create descriptions that trigger appropriately without over-matching
  4. Implement single-purpose design: Scope a skill to do one thing well
  5. Test skill activation: Verify that Claude discovers and invokes your skill correctly
  6. Apply prompt engineering: Write clear instructions that guide Claudeโ€™s behavior

2. Theoretical Foundation

2.1 What Are Claude Code Skills?

Skills are the building blocks of Claude Code automation. They are declarative markdown files that define reusable capabilities Claude can invoke. Unlike slash commands (explicit user invocation), skills are implicitly discovered when Claude detects a matching description in the userโ€™s request.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    SKILL vs SLASH COMMAND                                โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  SKILL (Implicit Discovery)           SLASH COMMAND (Explicit Invocation)โ”‚
โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€           โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”‚
โ”‚                                                                          โ”‚
โ”‚  User: "I want to commit my changes"  User: "/commit"                   โ”‚
โ”‚         โ”‚                                      โ”‚                         โ”‚
โ”‚         โ–ผ                                      โ–ผ                         โ”‚
โ”‚  Claude: "Hmm, this matches the       Claude: "User explicitly called   โ”‚
โ”‚   git-commit skill description"        the commit command"               โ”‚
โ”‚         โ”‚                                      โ”‚                         โ”‚
โ”‚         โ–ผ                                      โ–ผ                         โ”‚
โ”‚  [Invokes skill automatically]        [Invokes command directly]        โ”‚
โ”‚                                                                          โ”‚
โ”‚  Key: Natural language triggers       Key: Explicit command triggers    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

2.2 The SKILL.md File Format

Every skill is defined in a SKILL.md file with two parts:

---
# YAML Frontmatter - Metadata
name: skill-name
description: What this skill does and when to use it
allowed-tools:       # Optional: restrict available tools
  - Bash
  - Read
---

# Markdown Body - Instructions
When the user wants to [do something], follow these steps...

YAML Frontmatter Fields:

Field Required Purpose
name Yes Unique identifier for the skill
description Yes Critical: This is what Claude matches against user intent
allowed-tools No Restrict which tools Claude can use (security/focus)

2.3 Skill Discovery: How Claude Finds Skills

Claudeโ€™s skill discovery works through semantic matching:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                      SKILL DISCOVERY FLOW                                โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  User Message: "I'm ready to commit my changes"                         โ”‚
โ”‚         โ”‚                                                                โ”‚
โ”‚         โ–ผ                                                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”‚
โ”‚  โ”‚     Claude analyzes the message         โ”‚                            โ”‚
โ”‚  โ”‚     looking for intent signals          โ”‚                            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ”‚
โ”‚                    โ”‚                                                     โ”‚
โ”‚                    โ–ผ                                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”‚
โ”‚  โ”‚   Compare against all skill descriptionsโ”‚                            โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚   git-commit: "Help create well-        โ”‚  โ—„โ”€โ”€โ”€ MATCH! (commit,      โ”‚
โ”‚  โ”‚   formatted git commit messages..."     โ”‚       changes, git)        โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚   web-testing: "Automate web browser    โ”‚  โ—„โ”€โ”€โ”€ No match             โ”‚
โ”‚  โ”‚   testing including login flows..."     โ”‚                            โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚   doc-generator: "Generate documentationโ”‚  โ—„โ”€โ”€โ”€ No match             โ”‚
โ”‚  โ”‚   for code modules..."                  โ”‚                            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ”‚
โ”‚                    โ”‚                                                     โ”‚
โ”‚                    โ–ผ                                                     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”‚
โ”‚  โ”‚   Best match: git-commit skill          โ”‚                            โ”‚
โ”‚  โ”‚   โ†’ Load and follow its instructions    โ”‚                            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Key insight: The description field is the most important part of your skill. It determines when Claude will choose to use it.

2.4 Skill Locations

Skills can be stored in two locations:

Location Scope Path
User-level Available in all projects ~/.claude/skills/skill-name/SKILL.md
Project-level Available in specific project .claude/skills/skill-name/SKILL.md

Project-level skills take precedence over user-level skills with the same name.

2.5 Progressive Disclosure

Skills support progressive disclosureโ€”loading additional files only when needed:

skill-name/
โ”œโ”€โ”€ SKILL.md           # Always loaded when skill is invoked
โ”œโ”€โ”€ REFERENCES.md      # Loaded on-demand when referenced
โ”œโ”€โ”€ templates/         # Loaded on-demand
โ”‚   โ””โ”€โ”€ format.md
โ””โ”€โ”€ scripts/           # Executed when called
    โ””โ”€โ”€ helper.py

This keeps context small while maintaining access to rich resources.

2.6 Conventional Commits

This project teaches you to implement the Conventional Commits specification:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types: | Type | When to Use | |โ€”โ€”|โ€”โ€”โ€”โ€”-| | feat | New feature for the user | | fix | Bug fix for the user | | docs | Documentation only changes | | style | Formatting, no code change | | refactor | Refactoring production code | | test | Adding or refactoring tests | | chore | Updating build tasks, configs, etc. |

Examples:

feat(auth): add login with OAuth2 support
fix(api): handle null response from payment gateway
docs: update API documentation for v2 endpoints
refactor(database): extract connection pooling logic

3. Project Specification

3.1 What You Will Build

A Claude Code skill that:

  1. Auto-discovers when users mention commits or staging changes
  2. Analyzes the current git state (staged, unstaged, untracked files)
  3. Suggests a well-formatted conventional commit message
  4. Confirms with the user before committing

3.2 Functional Requirements

  1. Skill Discovery: The skill should activate when users say things like:
    • โ€œI want to commit my changesโ€
    • โ€œcommit thisโ€
    • โ€œready to commitโ€
    • โ€œhelp me create a commit messageโ€
  2. Git State Analysis: When invoked, the skill should:
    • Check staged changes (git status)
    • Show what files are affected
    • Analyze the nature of changes (git diff)
  3. Commit Message Generation: The skill should:
    • Suggest appropriate commit type (feat, fix, docs, etc.)
    • Identify scope from file paths if possible
    • Write a concise description
    • Include bullet points for body if multiple changes
  4. User Confirmation: Always confirm before committing

3.3 Non-Functional Requirements

  • Precision: Donโ€™t trigger on unrelated git commands (push, pull, branch)
  • Helpful: Explain why a particular commit type was chosen
  • Safe: Never commit without user confirmation
  • Educational: Teach users about conventional commits

4. Real World Outcome

When you complete this project, hereโ€™s exactly what youโ€™ll experience:

You: I'm ready to commit my changes

Claude: [Auto-discovers and invokes git-commit skill]

I'll help you create a well-formatted commit. Let me check your changes...

Staged Changes:
- src/auth/login.ts (modified)
- src/auth/logout.ts (new file)
- tests/auth.test.ts (modified)

Analyzing changes...

The changes appear to:
- Add a new logout function (new file)
- Update login to work with the new logout flow
- Add test coverage for logout

Based on these changes, here's a suggested commit message:

feat(auth): add logout functionality and update login flow

- Implement logout endpoint with token invalidation
- Update login to support remember-me option
- Add tests for new logout functionality

Commit Type: `feat` (new feature - the logout functionality is new)
Scope: `auth` (all changes are in the auth module)

Shall I proceed with this commit message, or would you like to modify it?

5. The Core Question Youโ€™re Answering

โ€œHow do I create reusable capabilities that Claude automatically discovers and invokes based on user intent?โ€

This project answers that question by teaching you:

  • The mechanics of skill discovery
  • How to write descriptions that match intent
  • How to structure instructions Claude follows
  • The difference between skills (implicit) and commands (explicit)

6. Concepts You Must Understand First

Stop and research these before coding:

6.1 SKILL.md Structure

Concept Questions to Answer Reference
YAML frontmatter What fields are required? What are optional? Claude Code Docs - โ€œSkillsโ€
Markdown body What should go here? How detailed? Claude Code Docs - โ€œSkillsโ€
Skill location Where do skills live? User vs project level? Claude Code Docs - โ€œSkillsโ€

6.2 Skill Discovery

Concept Questions to Answer Reference
Description matching How does Claude decide to use a skill? Claude Code Docs - โ€œSkill Discoveryโ€
Keyword importance What words should be in the description? Experiment with your skill
Avoiding over-matching How do you prevent false positives? Single-purpose design principle

6.3 Git Operations

Concept Questions to Answer Reference
Git status What does git status tell you? โ€œPro Gitโ€ Ch. 2
Git diff How do you see what changed? โ€œPro Gitโ€ Ch. 2
Conventional commits What are the types and when to use them? conventionalcommits.org

7. Questions to Guide Your Design

Before implementing, think through these:

7.1 Skill Scope

  • Should this skill ONLY handle commits?
  • Or should it cover all git operations (push, pull, branch)?
  • Whatโ€™s the right granularity?

Recommended: Single-purpose. A commit skill that does commits well is better than a git skill that does everything poorly.

7.2 Discovery Keywords

  • What phrases should trigger this skill?
  • โ€œcommitโ€, โ€œcommit my changesโ€, โ€œcreate a commitโ€
  • How specific should the description be?

Recommended: Include multiple variations: โ€œcommitโ€, โ€œcommit messageโ€, โ€œgit commitโ€, โ€œstage and commitโ€

7.3 Instructions Content

  • What should Claude do when this skill is invoked?
  • Check staged changes?
  • Suggest conventional commit format?
  • Auto-stage related files?

Recommended: Always check status first, analyze changes, then suggestโ€”never auto-commit without confirmation.


8. Thinking Exercise

8.1 Design the SKILL.md

Before writing, sketch out the structure:

---
name: git-commit
description: ???  # What triggers discovery?
allowed-tools:    # Should you restrict tools?
  - Bash
  - Read
---

# Instructions

When the user wants to commit changes...

## What to do:
1. ???
2. ???
3. ???

## Commit message format:
???

Questions to answer:

  • What description will match โ€œI want to commit my changesโ€?
  • Should you include โ€œgitโ€ in the description?
  • What tools does Claude need for this skill?

8.2 Trace Through Discovery

Imagine these user messages. Which should trigger your skill?

User Message Should Trigger? Why/Why Not?
โ€œI want to commit my changesโ€ Yes Direct intent
โ€œcommit thisโ€ Yes Clear intent
โ€œpush my changes to GitHubโ€ No Different operation
โ€œwhat did I change?โ€ Maybe Could be checking before commit
โ€œcreate a PRโ€ No Different workflow

Adjust your description to match only the appropriate cases.


9. The Interview Questions Theyโ€™ll Ask

After completing this project, youโ€™ll be ready for:

  1. โ€œHow would you create a reusable capability for an AI coding assistant?โ€
    • Expected: Explain skills as declarative capabilities with descriptions for discovery
    • Bonus: Discuss trade-offs between skills (implicit) and commands (explicit)
  2. โ€œWhatโ€™s the difference between explicit and implicit invocation?โ€
    • Expected: Slash commands are explicit; skills are discovered from intent
    • Bonus: When to use each approach
  3. โ€œHow do you scope a skill to avoid over-matching?โ€
    • Expected: Specific descriptions, single-purpose design, testing
    • Bonus: Discuss precision vs recall in skill matching
  4. โ€œHow would you test that a skill is discovered correctly?โ€
    • Expected: Try various phrasings, check for false positives/negatives
    • Bonus: Create a test matrix of inputs and expected behaviors
  5. โ€œWhat are the security implications of skill auto-discovery?โ€
    • Expected: Skills can restrict tools, but users should understand whatโ€™s activated
    • Bonus: Discuss allowed-tools for limiting capabilities

10. Solution Architecture

10.1 Skill Directory Structure

~/.claude/skills/git-commit/
โ””โ”€โ”€ SKILL.md                # Your skill definition

10.2 SKILL.md Components

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         SKILL.md STRUCTURE                               โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”‚
โ”‚  โ”‚           YAML FRONTMATTER              โ”‚                            โ”‚
โ”‚  โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚                            โ”‚
โ”‚  โ”‚  name: git-commit                       โ”‚ โ—„โ”€โ”€โ”€ Unique identifier     โ”‚
โ”‚  โ”‚  description: Help create well-         โ”‚ โ—„โ”€โ”€โ”€ Discovery trigger     โ”‚
โ”‚  โ”‚    formatted git commit messages...     โ”‚                            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ”‚
โ”‚                                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                            โ”‚
โ”‚  โ”‚           MARKDOWN BODY                 โ”‚                            โ”‚
โ”‚  โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€  โ”‚                            โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚  # Git Commit Assistant                 โ”‚ โ—„โ”€โ”€โ”€ Title                 โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚  ## 1. Check Current State              โ”‚ โ—„โ”€โ”€โ”€ Step-by-step         โ”‚
โ”‚  โ”‚  Run `git status`...                    โ”‚      instructions          โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚  ## 2. Analyze Changes                  โ”‚                            โ”‚
โ”‚  โ”‚  For each changed file...               โ”‚                            โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚  ## 3. Suggest Commit Message           โ”‚                            โ”‚
โ”‚  โ”‚  Follow conventional commit format...   โ”‚                            โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ”‚  ## 4. Confirm with User                โ”‚                            โ”‚
โ”‚  โ”‚  Present suggestion and wait...         โ”‚                            โ”‚
โ”‚  โ”‚                                         โ”‚                            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                            โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

10.3 Workflow Diagram

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     GIT COMMIT SKILL WORKFLOW                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                          โ”‚
โ”‚  User: "I want to commit my changes"                                    โ”‚
โ”‚         โ”‚                                                                โ”‚
โ”‚         โ–ผ                                                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ Skill Discovery โ”‚  Match against "commit", "commit message", etc.    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 1. Git Status   โ”‚  Run: git status                                   โ”‚
โ”‚  โ”‚    Check state  โ”‚  Identify: staged, unstaged, untracked            โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 2. Analyze Diff โ”‚  Run: git diff --staged                           โ”‚
โ”‚  โ”‚    Understand   โ”‚  Determine: what changed, what was added          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 3. Determine    โ”‚  Based on changes:                                 โ”‚
โ”‚  โ”‚    Commit Type  โ”‚  - New file? โ†’ feat                               โ”‚
โ”‚  โ”‚                 โ”‚  - Bug fix? โ†’ fix                                  โ”‚
โ”‚  โ”‚                 โ”‚  - Docs only? โ†’ docs                               โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 4. Suggest      โ”‚  Format: type(scope): description                 โ”‚
โ”‚  โ”‚    Message      โ”‚  Include body if multiple changes                 โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 5. Confirm      โ”‚  "Shall I proceed with this commit message?"      โ”‚
โ”‚  โ”‚    with User    โ”‚  Wait for explicit approval                        โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚           โ”‚                                                              โ”‚
โ”‚           โ–ผ                                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                                    โ”‚
โ”‚  โ”‚ 6. Execute      โ”‚  Run: git commit -m "message"                     โ”‚
โ”‚  โ”‚    (if approved)โ”‚  Report success/failure                           โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                                    โ”‚
โ”‚                                                                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

11. Implementation Guide

11.1 Phase 1: Create the Skill Directory

# Create the skill directory
mkdir -p ~/.claude/skills/git-commit

# Create the SKILL.md file
touch ~/.claude/skills/git-commit/SKILL.md

11.2 Phase 2: Write the Frontmatter

---
name: git-commit
description: Help create well-formatted git commit messages following conventional commit format. Use this when the user mentions committing, staging, or preparing changes for git.
---

Why this description works:

  • โ€œcommit messagesโ€ - matches โ€œI want to commitโ€
  • โ€œconventional commit formatโ€ - signals this is about formatting
  • โ€œcommitting, staging, or preparing changesโ€ - covers related intents

11.3 Phase 3: Write the Instructions

# Git Commit Assistant

When the user wants to create a commit, follow these steps:

## 1. Check Current State
Run `git status` to see:
- What files are staged
- What files are modified but not staged
- What files are untracked

## 2. Analyze Changes
For each changed file, briefly understand what changed using `git diff --staged`.
If nothing is staged, suggest what should be staged.

## 3. Determine Commit Type
Based on the changes, select the appropriate type:
- `feat:` - A new feature
- `fix:` - A bug fix
- `docs:` - Documentation only changes
- `style:` - Formatting, missing semi colons, etc.
- `refactor:` - Code change that neither fixes a bug nor adds a feature
- `test:` - Adding or correcting tests
- `chore:` - Changes to build process or auxiliary tools

## 4. Identify Scope (Optional)
Look at file paths to determine scope:
- `src/auth/*` โ†’ scope: auth
- `src/api/*` โ†’ scope: api
- Multiple directories โ†’ omit scope or use most significant

## 5. Suggest Commit Message
Format: `type(scope): brief description`

If there are multiple significant changes, include a body:

type(scope): brief description

  • Detail about first change
  • Detail about second change ```

6. Confirm with User

Present the suggested message and ask: โ€œShall I proceed with this commit message, or would you like to modify it?โ€

Never commit without explicit user approval.


### 11.4 Phase 4: Test the Skill

Test with various phrasings:

| Test Input | Expected Behavior |
|------------|-------------------|
| "I want to commit my changes" | Skill activates, checks status |
| "commit this" | Skill activates |
| "help me write a commit message" | Skill activates |
| "push to origin" | Skill should NOT activate |
| "create a new branch" | Skill should NOT activate |

---

## 12. Hints in Layers

If you're stuck, reveal hints one at a time:

<details markdown="1">
<summary><strong>Hint 1: Create the Directory</strong></summary>

Create `~/.claude/skills/git-commit/SKILL.md` (user-level) or `.claude/skills/git-commit/SKILL.md` (project-level).

The directory name should match the skill name for clarity.
</details>

<details markdown="1">
<summary><strong>Hint 2: Write the Frontmatter</strong></summary>

```yaml
---
name: git-commit
description: Help create well-formatted git commit messages following conventional commit format
---

Include keywords users might say: โ€œcommitโ€, โ€œcommit messageโ€, โ€œstageโ€, โ€œchangesโ€. </details>

Hint 3: Add Instructions

Tell Claude to:

  1. Check git status first
  2. Analyze changes with git diff --staged
  3. Suggest a commit message following conventional commits
  4. Always confirm before committing

Be specific about the format you want.

Hint 4: Test Discovery

Ask Claude โ€œI want to commit my changesโ€ and see if it mentions using the skill.

If it doesnโ€™t activate:

  • Check that the skill file is in the right location
  • Verify the YAML frontmatter is valid
  • Try more explicit triggers in your description

13. Common Pitfalls & Debugging

13.1 Frequent Mistakes

Pitfall Symptom Solution
Skill not discovered Claude doesnโ€™t mention using the skill Check description keywords, file location
YAML syntax error Skill fails to load Validate YAML, check indentation
Over-matching Skill triggers on unrelated requests Make description more specific
Under-matching Skill doesnโ€™t trigger when expected Add more keyword variations
Committing without approval Unsafe behavior Add explicit confirmation step in instructions

13.2 Debugging Steps

  1. Verify file location: ls ~/.claude/skills/git-commit/SKILL.md
  2. Check YAML validity: Use an online YAML validator
  3. Test explicitly: Ask Claude โ€œUse the git-commit skillโ€
  4. Review Claudeโ€™s response: Does it mention loading the skill?

14. Extensions & Challenges

14.1 Beginner Extensions

  • Add emoji to commit types (e.g., feat gets sparkles)
  • Support for --amend commits
  • Show unstaged files and offer to stage them

14.2 Intermediate Extensions

  • Add a REFERENCES.md with full conventional commit spec
  • Support breaking change notation (feat!: or BREAKING CHANGE:)
  • Integrate with git hooks for commit message validation

14.3 Advanced Extensions

  • Multi-language commit message templates
  • AI-powered commit message improvement suggestions
  • Integration with issue trackers (add Closes #123)

15. Books That Will Help

Topic Book Chapter
Git workflows โ€œPro Gitโ€ by Scott Chacon Chapter 5: Distributed Workflows
Conventional commits conventionalcommits.org Full Specification
Prompt engineering โ€œPrompt Engineering Guideโ€ All sections
Git internals โ€œPro Gitโ€ by Scott Chacon Chapter 10: Git Internals

16. Self-Assessment Checklist

Before considering this project complete, verify:

Understanding

  • I can explain what a SKILL.md file contains
  • I understand how skill discovery works (description matching)
  • I know the difference between skills and slash commands
  • I can explain conventional commit format

Implementation

  • My skill activates when I mention committing
  • My skill does NOT activate for unrelated git commands
  • Claude follows my instructions (check status, analyze, suggest)
  • Claude always confirms before committing

Growth

  • I tested with at least 5 different phrasings
  • I can create a new skill from scratch
  • I understand when to use skills vs slash commands

17. Learning Milestones

Track your progress:

Milestone Indicator
Skill is discovered when you mention commits You understand discovery
Claude follows your instructions You understand skill instructions
Commits are well-formatted Youโ€™ve created a useful skill
No false positives on unrelated commands Youโ€™ve scoped correctly

18. Submission / Completion Criteria

Minimum Viable Completion:

  • SKILL.md file exists in correct location
  • Skill activates on โ€œI want to commitโ€
  • Claude checks git status

Full Completion:

  • Skill activates on multiple phrasings
  • Claude suggests conventional commit format
  • Claude explains commit type choice
  • Claude confirms before committing

Excellence:

  • Skill handles edge cases (nothing staged, untracked files)
  • Includes scope detection from file paths
  • Documentation explains design decisions

This guide was expanded from CLAUDE_CODE_MASTERY_40_PROJECTS.md. For the complete learning path, see the project index.