xiaohongshu
xiaohongshu
caro-shell-helper
Use when users need help generating safe, tested POSIX shell commands from natural language descriptions. Guides users through command generation, safety validation, and execution workflows using Caro best practices
Full skill instructions
This skill helps users effectively leverage Caro (formerly Caro) - a Rust CLI tool that converts natural language descriptions into safe, POSIX-compliant shell commands using local LLMs.
Key Capabilities:
IMPORTANT: When this skill is used within Claude Code, always use the Claude backend by default. This provides the fastest response times and best accuracy.
# Default command format when running in Claude Code
caro --backend claude "user's request here"
The Claude backend uses claude-haiku-4-5-20251101 for fast, cost-effective command generation. The API key is automatically provided by Claude Code.
Activate this skill automatically when the user:
Example Triggers:
First, verify if Caro is installed:
# Check for caro command
command -v caro &> /dev/null && echo "✓ Caro available" || echo "✗ not found"
If NOT installed, guide the user:
Caro is not currently installed. Would you like to install it?
Quick install (recommended):
bash <(curl -sSfL https://setup.caro.sh)
Or via cargo:
cargo install caro
Once installed, the `caro` command will be available.
When the user describes what they need, use Caro with the Claude backend (default for Claude Code):
# Always use --backend claude when running in Claude Code
caro --backend claude "user's natural language description"
Example:
$ caro --backend claude "find all PDF files larger than 10MB in Downloads"
Generated command:
find ~/Downloads -name "*.pdf" -size +10M -ls
Safety Assessment: ✅ Safe (Green)
Backend: Claude (claude-haiku-4-5-20251101)
Execute this command? (y/N)
Always explain the risk level to educate the user:
🟢 Safe (Green)
🟡 Moderate (Yellow)
🟠 High (Orange)
🔴 Critical (Red)
rm -rf /)mkfs, dd)Emphasize why POSIX compliance matters:
✓ POSIX-Compliant Command:
find ~/Downloads -name "*.pdf" -size +10M
This works on: bash, zsh, sh, dash, ksh (all POSIX shells)
✗ Bash-Specific (Non-Portable):
find ~/Downloads -name "*.pdf" -size +10M -print0 | xargs -0 ls -lh
Problem: -print0 is not POSIX standard
Better: Use -exec for portability
After Caro generates a command, guide the user:
System Destruction:
rm -rf / # Deletes entire filesystem
rm -rf ~ # Deletes home directory
rm -rf /* # Same as rm -rf /
Fork Bombs:
:(){ :|:& };: # Creates infinite processes
Disk Operations:
mkfs /dev/sda # Formats disk (destroys data)
dd if=/dev/zero of=/dev/sda # Overwrites disk
Privilege Escalation:
sudo su # Gains root access
chmod 777 / # Makes root world-writable
When users request dangerous operations, suggest safer alternatives:
User wants: "Delete all log files"
Dangerous: rm -rf /var/log/*
Safe alternative:
# First, preview what will be deleted
find /var/log -name "*.log" -type f -mtime +30 -ls
# Then delete only old logs with confirmation
find /var/log -name "*.log" -type f -mtime +30 -exec rm -i {} \;
User wants: "Clean up temp files"
Dangerous: rm -rf /tmp/*
Safe alternative:
# Use tmpwatch or tmpreaper (proper cleanup tools)
tmpwatch 24 /tmp
# Or manually with safety checks
find /tmp -type f -mtime +7 -user $(whoami) -delete
Caro supports multiple inference backends. Help users choose:
# ~/.config/caro/config.toml
[backend]
primary = "claude"
[backend.claude]
model_name = "claude-haiku-4-5-20251101" # Fast and cost-effective
# API key read from ANTHROPIC_API_KEY environment variable
When running in Claude Code: The Claude backend is automatically preferred as it provides the best integration and fastest response times. No additional configuration is needed - Claude Code provides the API key automatically.
# ~/.config/caro/config.toml
[backend]
primary = "ollama"
[backend.ollama]
base_url = "http://localhost:11434"
model_name = "codellama:7b"
[backend]
primary = "vllm"
[backend.vllm]
base_url = "http://localhost:8000"
model_name = "codellama/CodeLlama-7b-hf"
User: "I need to find all Python files modified in the last week"
Response:
I'll help you generate a safe command using Caro with Claude Haiku 4.5.
$ caro --backend claude "find all Python files modified in the last week"
Generated command:
find . -name "*.py" -type f -mtime -7
Safety Assessment: ✅ Safe (Green)
Backend: Claude (claude-haiku-4-5-20251101)
- Read-only operation
- POSIX-compliant syntax
- Searches current directory and subdirectories
Explanation:
- find . : Search from current directory
- -name "*.py" : Match files ending in .py
- -type f : Only regular files (not directories)
- -mtime -7 : Modified within last 7 days
Execute? (y/N)
User: "Delete all .log files older than 30 days"
Response:
This involves deletion, so let's be careful. I'll use Caro with Claude Haiku 4.5.
$ caro --backend claude "delete all .log files older than 30 days"
Generated command:
find . -name "*.log" -type f -mtime +30 -delete
Safety Assessment: 🟠 High (Orange)
Backend: Claude (claude-haiku-4-5-20251101)
- Performs deletion (irreversible)
- Recursive operation
- Affects multiple files
⚠️ SAFETY RECOMMENDATION:
Preview what will be deleted first:
$ find . -name "*.log" -type f -mtime +30 -ls
Review the list, then if it looks correct, run with -delete.
Better yet, use interactive deletion:
$ find . -name "*.log" -type f -mtime +30 -exec rm -i {} \;
This will ask for confirmation on each file.
Proceed with preview? (y/N)
User: "How do I check disk space?"
Response:
$ caro --backend claude "check disk space for all mounted filesystems"
Generated command:
df -h
Safety Assessment: ✅ Safe (Green)
Backend: Claude (claude-haiku-4-5-20251101)
- Read-only operation
- Standard system utility
- No modifications
Explanation:
- df : Disk free - shows filesystem disk space usage
- -h : Human-readable format (GB, MB instead of bytes)
This is completely safe to run. Execute? (y/N)
For complex tasks, break them into steps:
User: "Find large files and compress them"
Response:
This is a multi-step operation. Let's do it safely using Claude Haiku 4.5:
Step 1: Find large files (>100MB)
$ caro --backend claude "find files larger than 100MB"
find . -type f -size +100M -ls
Step 2: Review the list (don't automate yet)
[User reviews output]
Step 3: Compress specific files
$ caro --backend claude "compress file.txt with gzip"
gzip -k file.txt
The -k flag keeps the original file as a backup.
Would you like to proceed with step 1?
Help users customize Caro behavior:
# ~/.config/caro/config.toml
[safety]
enabled = true
level = "moderate" # strict, moderate, or permissive
require_confirmation = true
[output]
format = "plain" # json, yaml, or plain
color = true
[backend]
primary = "claude" # claude (default in Claude Code), embedded, ollama, or vllm
enable_fallback = true
[backend.claude]
model_name = "claude-haiku-4-5-20251101" # Fast and cost-effective
# API key read from ANTHROPIC_API_KEY environment variable
POSIX-compliant commands work across:
- ✓ bash (most common)
- ✓ zsh (macOS default since Catalina)
- ✓ sh (minimal, universal)
- ✓ dash (Debian/Ubuntu default /bin/sh)
- ✓ ksh (Korn shell)
Non-POSIX features that break portability:
- Bash arrays: myarray=(one two three)
- Process substitution: <(command)
- Extended globbing: shopt -s extglob
- [[ ]] conditional (use [ ] instead)
Caro generates POSIX-compliant commands by default for maximum portability.
Caro uses a 4-tier risk model:
1. Safe (Green): Read-only, no system impact
- Listings, searches, queries
- Safe to execute without review
2. Moderate (Yellow): Limited modifications
- File edits, package updates
- Review recommended
3. High (Orange): Significant changes
- Deletions, mass operations
- Careful review required
4. Critical (Red): Dangerous operations
- System destruction, privilege escalation
- Blocked or requires explicit override
This helps users develop safety intuition over time.
# Add cargo bin to PATH
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Check Caro status
caro --version
# Enable verbose mode for debugging
caro --verbose "your prompt here"
# Try different backend
caro --backend claude "your prompt here" # Use Claude Haiku 4.5 (fastest)
caro --backend ollama "your prompt here" # Use local Ollama
caro --backend embedded "your prompt here" # Use embedded model
# Check if API key is set
echo $ANTHROPIC_API_KEY
# Set API key if missing
export ANTHROPIC_API_KEY="sk-ant-your-key-here"
# When running in Claude Code, the API key is provided automatically
# Adjust in ~/.config/caro/config.toml
[safety]
level = "permissive" # or "moderate"
references/safety-patterns.mdreferences/posix-compliance.mdThe goal is not just to generate commands, but to help users:
Always prioritize user education and safety over convenience.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience