跳到正文
Skillpedia
通用编程48k · #6261

claude-settings-audit

它能做什么

这个工具会分析项目代码,建议 Claude Code 可以安全运行哪些命令。它会检查项目使用了哪些技术,并为只读命令生成一份权限列表。

适用场景

  • ✓在新项目中设置 Claude Code 的权限时。
  • ✓在检查现有项目的权限、确保其安全时。
  • ✓在决定代码仓库中哪些只读命令可以安全放行时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/claude-settings-audit/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/skills/claude-settings-audit/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“分析这个代码仓库,并告诉我应该在 Claude Code 的 settings.json 文件中添加哪些只读命令权限。”

每周 5 个新技能,1 分钟读完。

工作原理

这个工具会先检查项目文件,识别所使用的技术(比如 Python、Node.js 等)。然后,它会将这些技术与一份安全命令清单进行比对,并生成一个包含推荐权限的配置文件。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Claude Settings Audit

Analyze this repository and generate recommended Claude Code settings.json permissions for read-only commands.

When to Use

  • You are setting up or auditing Claude Code settings.json permissions for a repository.
  • You need to infer a safe read-only allow list from the repo's tech stack, tooling, and monorepo structure.
  • You want to review or replace an existing Claude permissions baseline with something evidence-based.

Phase 1: Detect Tech Stack

Run these commands to detect the repository structure:

ls -la
find . -maxdepth 2 \( -name "*.toml" -o -name "*.json" -o -name "*.lock" -o -name "*.yaml" -o -name "*.yml" -o -name "Makefile" -o -name "Dockerfile" -o -name "*.tf" \) 2>/dev/null | head -50

Check for these indicator files:

Category Files to Check
Python pyproject.toml, setup.py, requirements.txt, Pipfile, poetry.lock, uv.lock
Node.js package.json, package-lock.json, yarn.lock, pnpm-lock.yaml
Go go.mod, go.sum
Rust Cargo.toml, Cargo.lock
Ruby Gemfile, Gemfile.lock
Java pom.xml, build.gradle, build.gradle.kts
Build Makefile, Dockerfile, docker-compose.yml
Infra *.tf files, kubernetes/, helm/
Monorepo lerna.json, nx.json, turbo.json, pnpm-workspace.yaml

Phase 2: Detect Services

Check for service integrations:

Service Detection
Sentry sentry-sdk in deps, @sentry/* packages, .sentryclirc, sentry.properties
Linear Linear config files, .linear/ directory

Read dependency files to identify frameworks:

  • package.json → check dependencies and devDependencies
  • pyproject.toml → check [project.dependencies] or [tool.poetry.dependencies]
  • Gemfile → check gem names
  • Cargo.toml → check [dependencies]

Phase 3: Check Existing Settings

cat .claude/settings.json 2>/dev/null || echo "No existing settings"

Phase 4: Generate Recommendations

Build the allow list by combining:

Baseline Commands (Always Include)

[
  "Bash(ls:*)",
  "Bash(pwd:*)",
  "Bash(find:*)",
  "Bash(file:*)",
  "Bash(stat:*)",
  "Bash(wc:*)",
  "Bash(head:*)",
  "Bash(tail:*)",
  "Bash(cat:*)",
  "Bash(tree:*)",
  "Bash(git status:*)",
  "Bash(git log:*)",
  "Bash(git diff:*)",
  "Bash(git show:*)",
  "Bash(git branch:*)",
  "Bash(git remote:*)",
  "Bash(git tag:*)",
  "Bash(git stash list:*)",
  "Bash(git rev-parse:*)",
  "Bash(gh pr view:*)",
  "Bash(gh pr list:*)",
  "Bash(gh pr checks:*)",
  "Bash(gh pr diff:*)",
  "Bash(gh issue view:*)",
  "Bash(gh issue list:*)",
  "Bash(gh run view:*)",
  "Bash(gh run list:*)",
  "Bash(gh run logs:*)",
  "Bash(gh repo view:*)",
  "Bash(gh api:*)"
]

Stack-Specific Commands

Only include commands for tools actually detected in the project.

Python (if any Python files or config detected)

If Detected Add These Commands
Any Python python --version, python3 --version
poetry.lock poetry show, poetry env info
uv.lock uv pip list, uv tree
Pipfile.lock pipenv graph
requirements.txt (no other lock) pip list, pip show, pip freeze

Node.js (if package.json detected)

If Detected Add These Commands

…

常见问题

什么是“只读命令权限”?

这些是告诉 Claude Code 可以对你的代码执行哪些命令、且不会修改代码的规则,确保它能安全地检查项目。

为什么要设置这些权限?

正确的权限设置可以防止 Claude Code 意外运行可能修改或损坏代码的命令,从而保障项目安全。

这个工具会修改我的代码吗?

不会。这个工具只分析代码以提出设置建议,不会对你的项目做任何改动。

详情

作者的原始描述

Analyze a repository to generate recommended Claude Code settings.json permissions. Use when setting up a new project, auditing existing settings, or determining which read-only bash commands to allow. Detects tech stack, build tools, and monorepo structure.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#6261
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能