Build a fully automated Twitter content pipeline using five Claude Code Skills. This hands-on tutorial covers persona cloning, content sourcing, AI writing, image generation, and scheduled publishing — all running unattended. Learn the single-responsibility principle for Skill design, file-based dat
18 prompt frameworks tested across GPT-4o, Claude, Gemini, and DeepSeek. Start with 3 beginner templates that cover 80% of daily use, then graduate to advanced frameworks for complex tasks. Includes a quick-reference cheat sheet, model-specific recommendations, framework combination strategies, and
Three battle-tested SEO meta description prompts that generate click-worthy page descriptions in under five minutes. Covers character limits, keyword placement, CTA design, AI search optimization, and content-type strategies. Pages with optimized meta descriptions see 20-30% higher CTR.
Claude Code Slash Commands: How to Build Custom Commands That Actually Save Time
Learn how to write Claude Code slash commands and custom commands. Turn repetitive prompts into reusable command files with parameters, bash injection, and file references.
Claude Code slash commands turn repetitive prompts into one-line calls. You store a prompt as a markdown file, type /command-name, and get consistent results every time — with parameters, live project data, and file context baked in.
This guide covers everything you need: when custom commands pay off, how to write your first one, the four syntax features that make commands dynamic, and battle-tested patterns for organizing them at scale.
What Problem Do Claude Code Slash Commands Solve?
Every time you retype a complex instruction, you phrase boundaries slightly differently. Claude Code fills the gaps with its own interpretation — sometimes modifying files you did not intend, sometimes skipping tests you forgot to mention.
A command file locks down the prompt: scope, required inputs, forbidden actions, acceptance criteria. You write it once. Every invocation reproduces the same boundaries.
The time savings come not from fewer keystrokes but from eliminating the hidden cost of re-explaining boundaries each session. I run about 40 custom commands across my projects. The ones I built six months ago still fire exactly as intended because the boundaries live in the file, not in my memory.
The real question before writing any command: "Will I say this same prompt next week? And the week after?" Two yeses means it deserves a file.
Who Should Use Custom Commands (and Who Should Wait)?
Your situation
Recommended action
Just installed Claude Code, still exploring
Wait. Use plain conversation for 2 weeks. Write down prompts you repeat.
Solo developer with recurring tasks
Write your first read-only command. Store it in the Personal tier.
Team member sharing workflows
Write project-level commands. Commit to git so the whole team shares one playbook.
Power user with 10+ commands
Organize with subdirectories. Prune unstable commands regularly.
The most common beginner mistake: creating a library of commands before running a single task three times. Commands earn value through reuse, not through quantity.
How Do You Create Your First Slash Command?
A command file is a markdown file placed in a directory Claude Code watches, as described in Anthropic's slash commands documentation. The filename (minus .md) becomes the command name.
Create ~/.claude/commands/changelog.md with this content:
Summarize the current uncommitted changes into three bullet points. Flag anything risky: missing error handling, hardcoded values, tests that need updating.
Type /changelog in Claude Code. That prompt fires exactly as written.
This bare-bones version has one gap: it tells Claude to summarize changes but doesn't feed in the actual diff. Claude guesses based on open files. Section six adds !git diff HEAD`` to inject real data — the leap from static template to dynamic command. Keep that in mind.
What slash commands are not: They don't add new capabilities to Claude Code. They don't run as background scripts. They remain prompts — stored, named, parameterized prompts. The command file defines the entry point; what you write inside and which tools you allow define the boundary.
Current project only. Committed to git = shared with team.
Project-specific: deploy checks, module refactors, local test flows
Decision rule: Use it everywhere → Personal. Use it here and share with teammates → Project.
Four practical patterns:
Solo, multiple projects: Generic commands (git workflows, commit templates) go Personal. Saves reconfiguring each repo.
Team collaboration: Core process commands go Project, committed to git. The team runs the same playbook without drift.
Onboarding to a new codebase: Check .claude/commands/ first. Existing commands reveal the project's standard operations faster than any README.
Mixed personal and team work: Use both tiers but keep them strictly separated. A project-specific command in Personal pollutes every unrelated project's menu.
2026 note: Claude Code has merged custom commands into the skills system. Both .claude/commands/deploy.md and .claude/skills/deploy/SKILL.md create /deploy with identical behavior. Existing .claude/commands/ files keep working. Start with the commands approach in this guide; explore the skills form later when you want support files or auto-triggering.
What Does Each Frontmatter Field Control?
Frontmatter is the YAML block between --- markers at the top of a command file. It configures metadata, parameter hints, and tool permissions.
Here is a command with three essential fields:
---
description: Review a file for code quality and best practices
argument-hint: [file path]
allowed-tools: Read, Grep
---
Review this file for code quality and potential issues: @$0
Focus on: naming clarity, duplicated logic, error handling completeness.
Read only — do not modify the file.
Field-by-field breakdown:
description — Appears in the / menu. Also helps Claude decide when to auto-invoke this command.
argument-hint — Shows [file path] in the autocomplete menu when you type the command name. Reminds you what input to provide.
allowed-tools — Tools this command can use without confirmation prompts. Read, Grep here means read-only access.
Start with these three. Add model (pin a specific model), disable-model-invocation (prevent auto-triggering), or arguments (declare named parameters) later when you need them.
Avoid hardcoding a model version in the model field during early experimentation. Model names change. Let the command inherit the session's active model until you have a specific reason to pin.
How Do the Four Syntax Features Make Commands Dynamic?
Frontmatter was covered above. The remaining three features — $ARGUMENTS, ! bash preprocessing, and @ file references — inject runtime context that turns a static template into an adaptive command.
How Does `$ARGUMENTS` Pass Variable Data Into Commands?
Text after the command name flows into the command file as arguments. Two retrieval modes:
$0 / $1 capture by position (zero-indexed). Same example: $0 = 123, $1 = urgent. These are shorthand for $ARGUMENTS[0] and $ARGUMENTS[1].
A single-parameter command (~/.claude/commands/fix-issue.md):
---
description: Fix a GitHub issue by number
argument-hint: [issue number]
---
Fix GitHub issue $ARGUMENTS following our code standards:
1. Read the issue description and understand requirements
2. Implement the fix
3. Add tests
4. Create a single commit
For structured multi-parameter input, use positional references:
---
description: Migrate a component between frameworks
argument-hint: [component] [source framework] [target framework]
---
Migrate the $0 component from $1 to $2. Preserve all existing behavior and tests.
Watch out for multi-word arguments. Positional parsing splits on whitespace. If a single argument contains spaces, wrap it in quotes: /migrate "User Dashboard" React Vue. Without quotes, User and Dashboard split into separate positions.
How Does `!` Bash Preprocessing Inject Live Project State?
Lines starting with ! followed by a backtick-wrapped command execute before Claude sees the prompt. The output replaces that line in the final text. This is preprocessing — Claude only sees the result.
A changelog command that reads real diffs:
---
description: Summarize uncommitted changes and flag risks
allowed-tools: Bash(git diff *), Bash(git status *)
---
## Current Changes
!`git diff HEAD`
## Your Task
Summarize the changes above into three bullet points. Flag risks: missing error handling, hardcoded values, tests needing updates.
When you run /changelog, the !git diff HEAD`` line executes first, injecting your actual diff into the prompt. Claude works with real data, not guesses.
Key details:
Bash commands require explicit permission in allowed-tools. Example: allowed-tools: Bash(git diff *). Without this, the permission system blocks execution.
! triggers only at line start or after whitespace. Mid-word occurrences (like KEY=!...``) are treated as plain text.
For multi-line bash, use a ```! fenced code block.
Bash preprocessing is the most underrated feature in the command system. Without it, commands are fixed text. With it, every invocation sees the project's current state before acting. In my workflow, I use ! in roughly 60% of commands — pulling git status, listing test failures, reading config files, or checking dependency versions.
How Does @ Pull File Content Into Context?
The @ prefix injects file, directory, or URL content directly into the command's context.
@README.md — includes a single file
@src/components/ — includes a directory listing
@https://example.com — fetches a URL (read-only)
Combined with parameters, @ creates adaptive commands:
---
description: Review a specific file
argument-hint: [file path]
allowed-tools: Read
---
Review this file for code quality and best practices: @$0
Running `/review src/app.js` expands `@$0` to `@src/app.js`, injecting the file's content. You point; it reads.
### How Do All Four Features Work Together?
Here is a complete command combining every syntax feature (`~/.claude/commands/changelog.md`):
```text
---
description: Summarize uncommitted changes and flag risks
argument-hint: [optional: additional context]
allowed-tools: Bash(git diff *), Bash(git status *)
---
Current Changes
!git diff HEAD
Changelog Convention
@docs/changelog-format.md
Your Task
$ARGUMENTS
Summarize the changes above following the changelog convention. Produce three bullet points and flag risks (missing error handling, hardcoded values, tests needing updates).
Read only — do not modify any files. If no uncommitted changes exist, state that explicitly.
Line by line: frontmatter sets description, parameter hint, and tool permissions. !git diff HEAD`` injects the real diff at runtime. @docs/changelog-format.md pulls in the team's formatting standard. $ARGUMENTS accepts optional context (e.g., /changelog backend changes only). The final two sentences define boundaries and the failure path — which matter more than syntax for command stability.
How Should You Organize Commands as the Library Grows?
Place command files in subdirectories to group by domain. For example, .claude/commands/frontend/component.md creates the /component command grouped under frontend.
Benefits:
The / autocomplete menu shows categorized results.
Timing rule: Keep commands flat until you reach 10. Fewer than 5 commands never need subdirectories. Premature organization adds friction to a library that hasn't found its shape yet.
What Are MCP Server Commands?
MCP (Model Context Protocol) servers expose prompts that appear as slash commands in the format /mcp__servername__promptname. Connect a GitHub MCP server, and commands like /mcp__github__list_prs become available automatically.
Key differences from custom commands:
Naming is fixed: double-underscore delimiters, server-defined names.
Dynamic discovery: commands appear when the server connects and vanish when it disconnects.
Server-dependent: the server must be running. Manage connections with /mcp.
MCP commands and custom commands serve complementary roles. MCP commands wrap external capabilities (GitHub, databases, APIs). Custom commands codify your internal workflows. Use both.
What Does a Mature Command Library Look Like?
Commands grow organically. The healthy progression follows a risk ladder:
Start with read-only check commands. Pre-deploy checklists, dependency scans, structure audits. Zero risk, easy to verify, ideal for practice.
Add summary commands. Changelog generators, status reports, test result digests. These train you to specify output format precisely.
Graduate to execution commands. File modifications, tool invocations, build triggers. Write the narrowest possible boundaries: working directory, allowed file scope, required confirmations, failure behavior.
Group and prune. Past 10 commands, organize by subdirectory. Delete commands that are unstable, low-frequency, or unclear in scope.
Name commands plainly. article-check, release-notes, test-summary beat abstract names. You will forget clever names in three months.
Maturity signal: When you invoke a command on a real task without adding extra explanation, it has graduated. If every run requires supplementary instructions, the command is still a draft.
What Are the 5 Most Common Mistakes?
Cramming multiple responsibilities into one command. Check, modify, deploy, and report in a single file means constant babysitting. Split them: one command, one job.
Treating commands as permission escalation. A command is an entry point, not an authorization bypass. Destructive actions (delete, publish, deploy) must include explicit confirmation steps inside the command body.
Writing vague goals instead of concrete actions. "Optimize the project" is not a command. Specify which file to check, which metric to evaluate, which output to produce.
Over-parameterizing early. More parameters mean more input variations and more failure modes. Start with one parameter. Add a second only after the command proves stable.
Omitting failure paths. What happens when there are no uncommitted changes? When the target file doesn't exist? When the schema is incomplete? Write the failure behavior explicitly. Without it, Claude guesses — and guessing under ambiguity produces inconsistent results.
What Should You Learn After Your First Two Weeks?
Build confidence in stages:
Day 1: Write one read-only check command. Run it once. Verify the output is stable.
Week 1: Pick one or two repeated tasks from the past week. Convert them to commands using $ARGUMENTS and @ file references.
Month 1: Group commands by subdirectory once you pass 10. Move shared rules to your project memory file (CLAUDE.md) and keep commands as task entry points. Start using ! bash preprocessing for live project state.
After the basics are solid, explore Claude Code's project memory (CLAUDE.md), permission boundaries, and MCP tool integration. Commands, memory, and permissions work as a system — configuring all three gives you a workflow you can trust to run unsupervised.
Self-Check: Is Your First Command Production-Ready?
Run through this list after writing a command:
[ ] Stored in the correct directory? (Cross-project → ~/.claude/commands/ | Project-specific → .claude/commands/)
[ ] Describes what tasks it handles and what it excludes?
[ ] Passed three consecutive runs with consistent results? (This is the hard acceptance test.)
Validation method: Run the same command three times on real work. If results stay consistent without extra prompting, the command is ready. If you keep adding explanations before each run, the boundary definitions need more work — refine the command file, not the model.
One Sentence to Take Away
A slash command is not magic. It saves you from re-explaining what you already know works. Wait until a prompt repeats three times with stable boundaries, then store it. Your attention shifts from "how to explain this to AI" back to "what to check, what to deliver, what not to touch."
Start with a read-only check command. Low risk, immediate feedback, and you learn whether your boundary definitions hold up under real use.
Build a fully automated Twitter content pipeline using five Claude Code Skills. This hands-on tutorial covers persona cloning, content sourcing, AI writing, image generation, and scheduled publishing — all running unattended. Learn the single-responsibility principle for Skill design, file-based dat
18 prompt frameworks tested across GPT-4o, Claude, Gemini, and DeepSeek. Start with 3 beginner templates that cover 80% of daily use, then graduate to advanced frameworks for complex tasks. Includes a quick-reference cheat sheet, model-specific recommendations, framework combination strategies, and
Battle-tested Ghost CMS best practices from 18 months of running two self-hosted sites. Covers VPS deployment, Cloudflare DNS, theme customization, newsletter growth, SEO configuration, multi-site management, and API-driven publishing.
Most developers spend 60% of their Skill development time debugging. The Quality Loop framework cuts that to under an hour through dual-phase detection, four-layer verification, and SubAgent self-repair. Here is the complete system I built after testing 20+ Skills.