by guo-yu
Claude Code 技能需要权限才能访问文件和运行命令。此技能自动分析每个技能所需的权限并生成安全的授权规则。它识别危险模式(如递归删除和权限提升),阻止它们获得授权。
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 skill-permissions 技能" 开始使用
=== skill-permissions 技能 === 作者: guo-yu 描述: Claude Code 技能需要权限才能访问文件和运行命令。此技能自动分析每个技能所需的权限并生成安全的授权规则。它识别危险模式(如递归删除和权限提升),阻止它们获得授权。 使用方法: 1. 调用技能: "使用 skill-permissions 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 skill-permissions 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
productivity
safe
Automatically analyze permissions required by all skills in Claude Code and generate one-time authorization commands.
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:
/skill-permissions allow port-allocator)inject or allow-all unless you understand the impact/skill-permissions first to see analysis results before batch operations| 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 |
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 ... )command)Convert identified commands to permissions.allow rules:
{
"permissions": {
"allow": [
"Bash(find * -name package.json *)",
"Bash(ls -d *)",
"Bash(cat ~/.claude/*)",
"Bash(lsof -i:3*)"
]
}
}
/skill-permissionsAnalyze all skills and show permission summary:
Scan all skills
find ~/.claude/skills -name "SKILL.md" -type f 2>/dev/null
Analyze permissions for each skill
Output analysis results
/skill-permissions <skill-name>Analyze specific skill's permission requirements:
Locate skill
SKILL_PATH=$(find ~/.claude/skills -type d -name "<skill-name>" 2>/dev/null | head -1)
Read and analyze SKILL.md
Output detailed permission list
/skill-permissions allow <skill-name>Execute one-time authorization for specific skill:
The following command patterns are automatically blocked and won't be added to the allowlist:
| Command | Reason |
|---|---|
rm * | File deletion, may cause data loss |
rm -rf * | Recursive force delete, extremely dangerous |
sudo * | Super user privileges |
chmod 777 * | Opens all permissions |
| Command | Reason |
|---|---|
kill -9 * | Force kill process |
pkill * | Kill processes by name |
curl * | bash | Remote code execution |
eval * | Dynamic code execution |
| Command | Reason |
|---|---|
git push --force * | Force push, may overwrite remote |
git reset --hard * | Hard reset, loses uncommitted changes |
Skill: port-allocator
Location: ~/.claude/skills/port-allocator
Detected commands:
- find ~/Codes -maxdepth 3 -name "package.json"
- ls -d */
- cat ~/.claude/port-registry.json
- lsof -i:3000
Generated permission rules:
- Bash(find * -maxdepth * -name package.json *)
- Bash(ls -d *)
- Bash(cat ~/.claude/*)
- Bash(lsof -i:3*)
Run `/skill-permissions allow port-allocator` to authorize
Permission authorization successful
Skill: port-allocator
Added permission rules:
- Bash(find * -maxdepth * -name package.json *)
- Bash(ls -d *)
- Bash(cat ~/.claude/*)
- Bash(lsof -i:3*)
Config file: ~/.claude/settings.json
New permissions take effect in next session, or run /clear to apply immediately
~/.claude/settings.json~/.claude/skills/If you encounter permission prompts, first run:
/skill-permissions allow
/skill-permissions allowExecute one-time authorization for this skill:
~/.claude/settings.jsonpermissions.allow:{
"permissions": {
"allow": [
"Bash(find ~/.claude/skills *)",
"Bash(cat ~/.claude/*)"
]
}
}
* to match varying parameter partsView Count
0
Download Count
0
Favorite Count
0
Quality Score
69