Using Claude Code - CLI Mastery
When to Activate This Skill
Use this skill when user asks about:
- "How do I create a custom skill?"
- "What can Claude Code do?"
- "How do I use MCP servers?"
- "Show me Claude Code commands"
- "How can I optimize my workflow with Claude?"
- "Debug my skill"
- "What's the best way to integrate with APIs?"
- Questions about Claude Code features, capabilities, or usage
- Creating slash commands or hooks
- File operations and git integration
- Web tools and search capabilities
- Troubleshooting Claude Code issues
Core Capabilities
Understanding Claude Code Architecture
- CLI command structure and usage
- Skills system and skill creation
- MCP (Model Context Protocol) server integration
- File operations (read, edit, search, glob)
- Git integration and version control
- Web tools (fetch, search)
- Slash commands and hooks
Creating Custom Skills
- Skills System: Create custom expertise domains
- Structure: Organize skills by domain (finance, development, content, etc.)
- Documentation: Clear SKILL.md with YAML frontmatter
- Testing: Validate skills work correctly
- Version Control: Track skill definitions in git
- Sharing: Share useful skills with team or community
MCP Server Integration
- What: Model Context Protocol for external integrations
- How: Configure MCP servers in settings
- Use Cases: APIs, databases, external tools, custom protocols
- Best Practice: Use MCP for any external system interaction
Workflow Optimization
- Create reusable slash commands for common tasks
- Use hooks for automated workflows
- Organize skills by frequency of use
- Leverage file operations efficiently
- Batch related operations
Key Features Explained
Skills System
Custom expertise domains that Claude loads when relevant to your task.
Structure:
.claude/skills/[skill-name]/
├── SKILL.md # Required - skill definition
└── CLAUDE.md # Optional - extended context
SKILL.md Format:
---
name: skill-name
description: What skill does and when to use it
---
# Skill Name
## When to Activate This Skill
- Trigger phrases
- Use cases
## [Content Sections]
Slash Commands
Quick command execution for common workflows.
Location:
.claude/commands/(project-level)~/.claude/commands/(user-level)
Format: YAML frontmatter + bash permissions
MCP Servers
External integrations via Model Context Protocol.
Configuration: .claude/settings.json or ~/.claude/settings.json
Common Uses:
- API integrations
- Database connections
- Custom tool integrations
- External service access
File Operations
- Read: View file contents
- Edit: Modify files in place
- Write: Create new files
- Glob: Pattern-based file finding
- Grep: Search file contents
Git Integration
- Status, diff, log
- Commit with proper messages
- Branch management
- Pull request creation
Best Practices
Skill Creation
- Clear Purpose: One skill, one domain
- Good Description: Include trigger phrases and keywords
- Proper Structure: YAML frontmatter + organized content
- Test Thoroughly: Verify skill loads and works
- Version Control: Track in git
- Document Clearly: Make it easy for others (and future you) to understand
MCP Integration
- Use for External Systems: Don't hardcode API calls
- Configure Properly: Test server connections
- Handle Errors: Graceful fallbacks
- Document Dependencies: List required MCP servers
Workflow Optimization
- Create Patterns: Identify repeated tasks
- Automate Common Tasks: Slash commands and hooks
- Organize by Domain: Group related skills
- Progressive Disclosure: Simple interface, deep capabilities
- Context Awareness: Load heavy context only when needed
Troubleshooting
- Check Logs: Review CLI output
- Validate Format: YAML syntax, file structure
- Test Incrementally: Build up complexity
- Verify Paths: Check file locations
- Review Permissions: Ensure access rights
Common Task Patterns
Creating a New Skill
# 1. Create directory
mkdir -p .claude/skills/my-skill
# 2. Write SKILL.md with frontmatter
# 3. Test activation
# 4. Iterate and refine
Integrating External API
# 1. Set up MCP server for API
# 2. Configure in settings.json
# 3. Create skill that uses MCP server
# 4. Test and document
Building Slash Command
# 1. Create command directory
mkdir -p .claude/commands/my-command
# 2. Write command.md with YAML + bash
# 3. Test execution
# 4. Document usage
Optimizing Workflow
# 1. Identify repeated pattern
# 2. Choose automation type (skill/command/hook)
# 3. Implement and test
# 4. Share with team
Example Use Cases
"How do I create a custom skill?"
- Explain skill structure and purpose
- Show SKILL.md format with YAML frontmatter
- Demonstrate creating directory and file
- Guide through testing and validation
- Provide best practices for organization
"What's the best way to integrate with APIs?"
- Recommend MCP server approach
- Explain configuration in settings.json
- Show skill creation for API interaction
- Demonstrate error handling
- Provide example patterns
"How can I debug my skill?"
- Check YAML frontmatter syntax
- Verify file structure and paths
- Review skill description and triggers
- Test activation manually
- Check for conflicts with other skills
- Validate any referenced files exist
"Show me how to use MCP servers"
- Explain Model Context Protocol concept
- Show settings.json configuration
- List common MCP server types
- Demonstrate integration in skills
- Provide testing approach
Resources
Official Documentation
- Claude Code Documentation - Complete CLI guide
- MCP Specification - Protocol details
- Anthropic API Docs - API reference
Skill Examples
- Check
.claude/skills/for existing patterns - Review
~/.claude/skills/for user-level skills - Explore community skills marketplace
Getting Help
/help- Built-in CLI help- GitHub Issues - Report bugs or request features
- Community - Share and discover skills
Quick Reference
File Locations
- Project Skills:
.claude/skills/[name]/ - User Skills:
~/.claude/skills/[name]/ - Project Commands:
.claude/commands/[name]/ - User Commands:
~/.claude/commands/[name]/ - Settings:
.claude/settings.jsonor~/.claude/settings.json
Skill Structure
skill-name/
├── SKILL.md # Required: name, description, content
└── CLAUDE.md # Optional: extended context
Command Structure
command-name/
└── command.md # YAML frontmatter + bash script
MCP Configuration
{
"mcpServers": {
"server-name": {
"command": "command-to-run",
"args": ["arg1", "arg2"]
}
}
}
Remember
- Skills = Knowledge Domains: Organize by topic
- MCP = External Integration: Don't hardcode APIs
- Commands = Quick Actions: Automate common tasks
- Hooks = Event Automation: Trigger on events
- Documentation = Future You: Write clear docs
- Testing = Confidence: Validate before sharing
- Simplicity = Power: Start simple, add complexity only when needed