skill-structure
Skill file structure, naming conventions, directory layout, frontmatter requirements, and invocation control. Use when creating skill files or slash commands to ensure correct format and validation.
What this skill does
# Skill Structure
## Commands and Skills Are Merged
Custom slash commands and skills are the same thing. A file at `.claude/commands/review.md` and a skill at `.claude/skills/review/SKILL.md` both create `/review`. Existing `.claude/commands/` files keep working. Skills add: a directory for supporting files, frontmatter to control invocation, and automatic context loading.
If a skill and command share the same name, the skill takes precedence.
**When to use which:**
| Type | When |
|------|------|
| Command file (`commands/name.md`) | Simple single-file workflow, no supporting files |
| Skill directory (`skills/name/SKILL.md`) | Needs references, background knowledge, or progressive disclosure |
## Naming Rules
| Rule | Example |
|------|---------|
| Format | `kebab-case`, lowercase, 1-64 chars |
| Pattern | `^[a-z][a-z0-9]*(-[a-z0-9]+)*$` |
| Must match | Directory name exactly |
**Good/Bad Examples:**
| Good | Bad | Why |
|------|-----|-----|
| `stimulus-coder` | `MySkill` | Uppercase not allowed |
| `tdd-workflow` | `skill_helper` | Underscores not allowed |
| `pdf-processing` | `-invalid` | Can't start with hyphen |
| `seo-content` | `skill--bad` | No consecutive hyphens |
## Directory Structure
### Flat Structure (most skills)
```
plugins/majestic-rails/skills/stimulus-coder/SKILL.md
-> name: stimulus-coder
-> invoked as: Skill("stimulus-coder")
```
### Nested Structure (categorized skills)
```
plugins/majestic-rails/skills/dhh-coder/SKILL.md
-> name: dhh-coder
-> invoked as: Skill("dhh-coder")
```
**Key Points:**
- The `name` field is ONLY the final skill name (not the full path)
- Directory name must match `name` exactly
- Use nesting to group related skills (ceo/, fundraising/, research/)
## Progressive Disclosure
For complex skills, split into multiple files:
```
my-skill/
+-- SKILL.md (overview, <500 lines)
+-- references/
| +-- patterns.md (detailed patterns)
| +-- examples.md (extended examples)
+-- scripts/
+-- helper.py (utility scripts)
```
**Rules:**
- References one level deep only (SKILL.md to reference.md, not deeper)
- Scripts execute without loading into context
- Keep SKILL.md focused on navigation and core content
- Subdirectories only: `scripts/`, `references/`, `assets/`
## Frontmatter
### Core Fields
```yaml
---
name: skill-name # Matches directory, defaults to dir name if omitted
description: What it does... # Recommended, max 1024 chars
allowed-tools: Read Bash # Optional, space-delimited
---
```
### All Fields Reference
| Field | Required | Description |
|-------|----------|-------------|
| `name` | No | Lowercase letters, numbers, hyphens (max 64 chars). Defaults to directory name. |
| `description` | Recommended | What it does AND when to use it. Max 1024 chars. |
| `argument-hint` | No | Hint during autocomplete. Example: `[issue-number]` |
| `disable-model-invocation` | No | `true` = Claude cannot auto-load. For manual workflows. Default: `false` |
| `user-invocable` | No | `false` = hidden from `/` menu. For background knowledge. Default: `true` |
| `allowed-tools` | No | Tools without permission prompts. Example: `Read, Bash(git *)` |
| `model` | No | `haiku`, `sonnet`, or `opus` |
| `context` | No | `fork` to run in isolated subagent context |
| `agent` | No | Subagent type when `context: fork`: `Explore`, `Plan`, `general-purpose`, or custom |
### Description Template
```
[What it does]. Use when [trigger contexts]. Triggers on [specific keywords].
```
**Rules:**
- Max 1024 characters
- Third person ("Processes..." not "I process...")
- Include trigger keywords users would naturally say
## Invocation Control
| Frontmatter | User can invoke | Claude can invoke | When loaded |
|-------------|----------------|-------------------|-------------|
| (default) | Yes | Yes | Description always in context, full content on invocation |
| `user-invocable: false` | No | Yes | Description always in context, loads when relevant |
**Decision guide:**
- Background knowledge (conventions, domain context) -> `user-invocable: false`
- Everything else -> defaults (both user and model can invoke)
**Note:** Avoid `disable-model-invocation: true`. Commands/skills with side effects should use confirmation steps (`AskUserQuestion`) rather than blocking model invocation entirely.
## Dynamic Features
### Arguments
Use `$ARGUMENTS` for user input. If not present in content, arguments are appended automatically.
```yaml
---
name: fix-issue
---
Fix GitHub issue $ARGUMENTS following our coding standards.
```
Individual args: `$ARGUMENTS[0]` or shorthand `$0`, `$1`, `$2`.
### Dynamic Context Injection
The `` !`command` `` syntax runs shell commands before content reaches Claude:
```markdown
## Context
- Current branch: !`git branch --show-current`
- PR diff: !`gh pr diff`
```
Commands execute immediately; output replaces the placeholder.
### Subagent Execution
Add `context: fork` to run in isolation (no conversation history):
```yaml
---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---
Research $ARGUMENTS thoroughly...
```
## Tool Access
| Tools Needed | Example Use Case |
|--------------|------------------|
| `Read, Grep, Glob` | Search codebase for patterns |
| `Bash(git *)` | Git operations only |
| `Bash(gh *)` | GitHub CLI operations |
| `WebFetch` | Fetch external documentation |
| None | Pure knowledge/guidance |
## Limits
- **SKILL.md:** Max 500 lines
- **Name:** Max 64 characters
- **Description:** Max 1024 characters
## Validation Checklist
- [ ] Name matches directory name exactly
- [ ] Name follows pattern `^[a-z][a-z0-9]*(-[a-z0-9]+)*$`
- [ ] Description under 1024 chars with trigger keywords
- [ ] Uses standard markdown headings (not XML tags)
- [ ] SKILL.md under 500 lines
- [ ] Uses `AskUserQuestion` for confirmation if skill has side effects
- [ ] `allowed-tools` set if specific tools needed
- [ ] No persona statements or attribution
- [ ] Subdirectories only: `scripts/`, `references/`, `assets/`
- [ ] Tested with real usage
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.