Skip to content

Adding a Skill

Step 1: Create the Skill Directory

Create .claude/skills/ghs-{name}/SKILL.md.

Step 2: Write the SKILL.md

Frontmatter

Use this frontmatter format with all required fields:

yaml
---
name: ghs-{name}
description: >
  One-line description.

  Trigger: "trigger phrase 1", "trigger phrase 2".
  Do NOT use for {out-of-scope tasks} (use {other-skill}).
argument-hint: "[owner/repo] [--flag <value>]"
allowed-tools: "Bash(gh:*) Read [etc]"
compatibility: "Requires gh CLI (authenticated), git, network access"
license: MIT
metadata:
  author: your-name
  version: 1.0.0
routes-to:
  - ghs-{next-skill}
routes-from:
  - ghs-{previous-skill}
---

Frontmatter Fields

FieldRequiredDescription
nameYesSkill identifier with ghs- prefix (e.g., ghs-repo-scan)
descriptionYesMulti-line description with trigger phrases and "Do NOT use for" routing
argument-hintYesFree-form string showing expected args: <required>, [optional], (no arguments)
allowed-toolsYesTool whitelist for the skill's execution
compatibilityYesRuntime requirements (gh CLI, git, jq, etc.)
licenseYesLicense identifier (MIT)
metadataYesAuthor and version info
routes-toNoSkills suggested after this one completes
routes-fromNoSkills that may invoke this one

Argument Hint Syntax

The argument-hint field documents what arguments the skill accepts:

SyntaxMeaningExample
<arg>Required argument<owner/repo#number>
[arg]Optional argument[owner/repo]
(no arguments)Skill takes no args(no arguments)
--flagBoolean flag--dry-run
--flag <value>Value flag--tier 1|2|3

Step 3: Structure the Body

Required Body Tags

Wrap major sections in XML tags following GSD conventions:

TagRequiredPurpose
<execution_context>YesLists shared reference files the skill depends on
<required_reading>YesPrerequisites to read before execution (state, project data, etc.)
<context>YesPurpose, roles, key definitions
<anti-patterns>Yes3-column Do NOT | Do Instead | Why table
<objective>YesGoal, outputs, next actions
<process>YesStep-by-step execution flow
<rules>NoAdditional constraints
<examples>NoGood/bad output pairs

Execution Context

List all shared references the skill depends on inside <execution_context>:

xml
<execution_context>
References:
- ../shared/references/gh-cli-patterns.md
- ../shared/references/output-conventions.md
- ../shared/references/ui-brand.md
- ../shared/references/argument-parsing.md
</execution_context>

Required Reading

Declare what data must be loaded before execution:

xml
<required_reading>
- Read project items via `gh project item-list` before any operation
- Check state issue for blockers and previous session context
</required_reading>

Step 4: Use Templates for Generated Output

For skills that generate PRs, comments, or issues, use the reusable templates in .claude/skills/shared/templates/:

TemplateUsed ByPurpose
pr-body.mdbacklog-fix, issue-implement, action-fixPR description body
analysis-comment.mdissue-analyzeIssue analysis comment
review-comment.mdreview-prPR review comment
state-issue-body.mdbacklog-fix, orchestrate, dev-loopState issue body
sync-issue-body.mdbacklog-syncSynced issue body

Templates use {placeholder} syntax for variable substitution.

Step 5: Add Dry-Run Support (Mutation Skills)

If your skill modifies external state (creates PRs, merges, creates releases), add --dry-run support:

  • Document --dry-run in the argument-hint field
  • Add a "Dry-Run Mode" section in the <process> block
  • Prefix all would-be mutations with [DRY RUN] in output
  • Display the dry-run indicator box from ui-brand.md

Step 6: Register the Skill

Update CLAUDE.md in the "Available Skills" section with your new skill.

Step 7: Test

Open Claude Code and trigger the skill with one of its trigger phrases.

Tips

  • Use the gh CLI for all GitHub API interactions
  • Handle errors gracefully: 404 = missing, 403 = insufficient permissions
  • Follow the status indicator convention: [PASS], [FAIL], [WARN], [INFO]
  • Use the Task tool for parallel agent work
  • Reference shared docs from .claude/skills/shared/references/
  • Use templates from .claude/skills/shared/templates/ for generated output
  • Use typed checkpoints from checkpoint-patterns.md for human-in-the-loop interactions
  • Follow the visual branding from ui-brand.md for stage banners, boxes, and symbols

Released under the MIT License.