SKILL.md--- name: skill-permissions description: Skill permission analysis, one-time authorization, analyze skill permissions, batch authorization --- # Skill Permissions Automatically analyze permissions required by all skills in Claude Code and generate one-time authorization commands. ## Dangerous Operations Warning **This skill can modify other skill files.** The following commands may cause widespread file changes: | Command | Risk Level | Description | |---------|------------|-------------| | `/skill-permissions inject` | High | Batch modify all skill SKILL.md files | | `/skill-permissions allow-all` | Medium | Batch modify settings.json | | `/skill-permissions allow <name>` | Low | Only modify settings.json | | `/skill-permissions <name>` | Safe | Read-only analysis, no file modifications | **Recommendations:** - Prefer **explicit commands** (e.g., `/skill-permissions allow port-allocator`) - Avoid `inject` or `allow-all` unless you understand the impact - Run `/skill-permissions` first to see analysis results before batch operations ## Usage | Command | Description | |---------|-------------| | `/skill-permissions` | Analyze all skills and show permission summary | | `/skill-permissions <skill-name>` | Analyze specific skill's permission requirements | | `/skill-permissions allow <skill-name>` | Execute one-time authorization for specific skill | | `/skill-permissions allow-all` | Execute one-time authorization for all skills | | `/skill-permissions inject` | Inject allow command into all skills | | `/skill-permissions allow` | Execute one-time authorization for this skill | ## How It Works ### 1. Permission Analysis Scan skill's SKILL.md file, identifying patterns like: **Bash Command Patterns:** ``` find * → Bash(find *) ls * → Bash(ls *) cat ~/.claude/* → Bash(cat ~/.claude/*) lsof -i:3* → Bash(lsof -i:3*) git * → Bash(git *) npm * → Bash(npm *) ``` **Recognition Rules:** - Bash commands in code blocks (```bash ... ```) - Inline commands (`command`) - Explicitly mentioned system commands ### 2. Permission Rule Generation Convert identified commands to `permissions.allow` rules: ```json { "permissions": { "allow": [ "Bash(find * -name package.json *)", "Bash(ls -d *)", "Bash(cat ~/.claude/*)", "Bash(lsof -i:3*)" ] } } ``` ## Execution Steps ### Command: `/skill-permissions` Analyze all skills and show permission summary: 1. **Scan all skills** ```bash find ~/.claude/skills -name "SKILL.md" -type f 2>/dev/null ``` 2. **Analyze permissions for each skill** - Read SKILL.md content - Extract bash code blocks - Identify command patterns - Generate permission rules 3. **Output analysis results** ### Command: `/skill-permissions <skill-name>` Analyze specific skill's permission requirements: 1. **Locate skill** ```bash SKILL_PATH=$(find ~/.claude/skills -type d -name "<skill-name>" 2>/dev/null | head -1) ``` 2. **Read and analyze SKILL.md** 3. **Output