Mastering Slash Commands and Agents in Claude Code
Overview of Structural Code Review
Software development often suffers from a gap between "working code" and "complete features."

Prerequisites and Tools
To follow this guide, you should have
- Claude Code CLI: The primary environment for executing commands.
- Claude Models: Specifically Claude 3.5 SonnetorClaude 3 Opus.
- Markdown: Used for defining agent instructions and command logic.
Creating Your Slash Command
You can bootstrap a command by simply asking the AI. For example, prompt: "Create a slash command called /are-we-done that calls the agent structural_completeness_reviewer." You have two choices for scope: Global (available across all projects) or Local (contained within the current project's .claude/commands directory).
Once created, open the generated .md file in your IDE. You can manually refine the logic by copying raw configurations from community repositories. A standard command structure typically includes the trigger name and the specific agent it should invoke.
Building the Specialist Agent
An agent is defined by its system prompt. Create a new folder named agents and a markdown file for your reviewer. The magic lies in the instructions. Rather than focusing on "code style," instruct the agent to act as a Technical Lead.
## Role: Structural Completeness Reviewer
Focus on:
- Dead code detection
- Dependency audit
- Feature parity across layers (e.g., Model vs. UI)
Practical Application and Token Usage
When you run /are-we-done, the agent analyzes uncommitted changes. In a real-world test on a quiz project, the agent correctly identified that while tags were added to questions, the corresponding database indexes and admin filters were missing. While these deep reviews consume more tokens—sometimes increasing session usage by several percentage points—the cost is negligible compared to the long-term price of accumulated technical debt.