xiaohongshu
xiaohongshu
claude-skill
Use when user asks to leverage claude or claude code to do something (e.g. implement a feature design or review codes, etc). Provides non-interactive automation mode for hands-off task execution without approval prompts.
Full skill instructions
You are operating in Claude Code headless mode - a non-interactive automation mode for hands-off task execution.
Before using this skill, ensure Claude Code CLI is installed and configured:
Installation verification:
claude --version
First-time setup: If not installed, guide the user to install Claude Code CLI with command npm install -g @anthropic-ai/claude-code.
references/examples.md.Claude Code uses permission modes to control what operations are permitted. Set via --permission-mode flag:
| Mode | Description |
|---|---|
default | Standard behavior - prompts for permission on first use of each tool |
acceptEdits | Automatically accepts file edit permissions for the session (Default for this skill) |
plan | Plan Mode - Claude can analyze but not modify files or execute commands |
bypassPermissions | Skips all permission prompts (requires safe environment - see warning below) |
Accept Edits Mode (--permission-mode acceptEdits) - Default
Default Mode (--permission-mode default)
Plan Mode (--permission-mode plan)
Bypass Permissions Mode (--permission-mode bypassPermissions)
--allowedTools to restrict specific tools for safetyNote: The following commands are based on the official Claude Code headless mode documentation.
Use the --print (or -p) flag to run in non-interactive mode:
claude -p "analyze the codebase structure and explain the architecture"
Control which tools Claude can use with --allowedTools and --disallowedTools:
# Allow specific tools
claude -p "stage my changes and write commits" \
--allowedTools "Bash,Read" \
--permission-mode acceptEdits
# Allow multiple tools (space-separated)
claude -p "implement the feature" \
--permission-mode acceptEdits \
--allowedTools Bash Read Write Edit
# Allow tools with restrictions (comma-separated string)
claude -p "run tests" \
--permission-mode acceptEdits \
--allowedTools "Bash(npm test),Read"
# Disallow specific tools
claude -p "analyze the code" \
--disallowedTools "Bash,Write"
Control how permissions are handled:
# Accept file edits automatically (recommended for programming)
claude -p "implement the user authentication feature" \
--permission-mode acceptEdits \
--allowedTools "Bash,Read,Write,Edit"
# Combine with allowed tools for safe automation
claude -p "fix the bug in login flow" \
--permission-mode acceptEdits \
--allowedTools "Read,Write,Edit,Bash(npm test)"
claude -p "explain file src/components/Header.tsx"
# Output: Plain text response
Returns structured data including metadata:
claude -p "how does the data layer work?" --output-format json
Response format:
{
"type": "result",
"subtype": "success",
"total_cost_usd": 0.003,
"is_error": false,
"duration_ms": 1234,
"duration_api_ms": 800,
"num_turns": 6,
"result": "The response text here...",
"session_id": "abc123"
}
Streams each message as it is received:
claude -p "build an application" \
--permission-mode acceptEdits \
--output-format stream-json
Each conversation begins with an initial init system message, followed by user and assistant messages, followed by a final result system message with stats.
For multi-turn conversations, you can resume or continue sessions:
# Continue the most recent conversation
claude --continue --permission-mode acceptEdits "now refactor this for better performance"
# Resume a specific conversation by session ID
claude --resume 550e8400-e29b-41d4-a716-446655440000 \
--permission-mode acceptEdits "update the tests"
# Resume in non-interactive mode
claude --resume 550e8400-e29b-41d4-a716-446655440000 -p \
--permission-mode acceptEdits "fix all linting issues"
# Short flags
claude -c --permission-mode acceptEdits "continue with next step"
claude -r abc123 -p --permission-mode acceptEdits "implement the next feature"
Append custom instructions to the system prompt:
claude -p "review this code" \
--append-system-prompt "Focus on security vulnerabilities and performance issues"
Load MCP servers from a JSON configuration file:
claude -p "analyze the metrics" \
--mcp-config monitoring-tools.json \
--allowedTools "mcp__datadog,mcp__prometheus"
Enable verbose output for debugging:
claude -p "debug this issue" --verbose
Combine multiple flags for complex scenarios:
# Full automation with JSON output
claude -p "implement authentication and output results" \
--permission-mode acceptEdits \
--allowedTools "Bash,Read,Write,Edit" \
--output-format json
# Multi-turn with custom instructions
session_id=$(claude -p "start code review" --output-format json | jq -r '.session_id')
claude -r "$session_id" -p "now check for security issues" \
--permission-mode acceptEdits \
--append-system-prompt "Be thorough with OWASP top 10"
# Streaming with MCP tools
claude -p "deploy the application" \
--permission-mode acceptEdits \
--output-format stream-json \
--mcp-config deploy-tools.json \
--allowedTools "mcp__kubernetes,mcp__docker"
Check exit codes and stderr for errors
Use timeouts for long-running operations:
timeout 300 claude -p "$complex_prompt" --permission-mode acceptEdits || echo "Timed out after 5 minutes"
Respect rate limits when making multiple requests by adding delays between calls
Only pause for user input when encountering:
For all other decisions, proceed autonomously using best judgment.
Always conclude with a structured summary:
✓ Task completed successfully
Changes made:
- [List of files modified/created]
- [Key code changes]
Results:
- [Metrics: lines changed, files affected, tests run]
- [What now works that didn't before]
Verification:
- [Tests run, checks performed]
Next steps (if applicable):
- [Suggestions for follow-up tasks]
See references/examples.md for extended usage scenarios.
When errors occur:
If execution is interrupted:
claude --resume <session_id> -p "continue" --permission-mode acceptEditsxiaohongshu
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