安全审计
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 安全
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: agent-audit
description: Audits Claude Code agent configuration against latest best practices. Works on any project. Manu…
category: 安全
runtime: 无特殊运行时
---
# agent-audit 输出预览
## PART A: 任务判断
- 适用问题:安全审计、密钥扫描、权限检查或风险分析。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Gotchas / Argument Parsing / Phase 1: Research Latest Best Practices”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于安全审计、密钥扫描、权限检查或风险分析,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Gotchas / Argument Parsing / Phase 1: Research Latest Best Practices”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、读取环境变量、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/agent-audit` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令、读取环境变量。
先用一个小任务确认它会围绕“Gotchas / Argument Parsing / Phase 1: Research Latest Best Practices”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: agent-audit
description: Audits Claude Code agent configuration against latest best practices. Works on any project. Manu…
category: 安全
source: tomevault-io/skills-registry
---
# agent-audit
## 什么时候使用
- 用于组织测试、定位失败并形成修复闭环 适合处理安全审计、密钥扫描、权限检查和风险分析,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额外 API…
- 面向安全审计、密钥扫描、权限检查或风险分析,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Gotchas / Argument Parsing / Phase 1: Research Latest Best Practices」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令、读取环境变量;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "agent-audit" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Gotchas / Argument Parsing / Phase 1: Research Latest Best Practices
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} Agent Configuration Audit
Audit this project's Claude Code agent configuration against latest best practices.
Gotchas
- Flagging intentional patterns as issues. Read CLAUDE.md and
.claude/rules/FIRST. What looks like a misconfiguration may be an intentional project convention documented there. Never report something as an issue if it's explained in the project's own docs. - Recommending fields that don't exist. Claude Code's supported frontmatter fields change between versions. ALWAYS verify against the latest docs (Phase 1 research) before flagging a "missing" field — it may not be supported yet, or may have been deprecated.
- Overwhelming output. A full audit can produce 50+ findings. Prioritize ruthlessly — lead with HIGH severity, collapse LOW items into a summary table. Users stop reading after 10 findings.
- Ignoring user-level config. Project-level
.claude/is only half the picture. Always check~/.claude/settings.json,~/.claude/rules/, and~/.claude/skills/for conflicts or overrides that affect behavior.
Argument Parsing
Parse $ARGUMENTS to determine scope. Examples:
| Invocation | Scope |
|---|---|
/agent-audit |
Full audit — all components |
/agent-audit full |
Same as above |
/agent-audit hooks |
Only hooks (settings.json hook config + .claude/hooks/ scripts) |
/agent-audit permissions |
Only permission allowlists/denylists in settings.json |
/agent-audit claudeignore |
Only .claudeignore |
/agent-audit claude-md |
Only CLAUDE.md |
/agent-audit memory |
Only MEMORY.md |
/agent-audit skills |
Deep-dive ALL skills — skip general audit |
/agent-audit skill:add-logs |
Deep-dive ONLY the add-logs skill — skip everything else |
/agent-audit skill:agent-audit |
Deep-dive ONLY this skill (meta-audit) |
/agent-audit agents |
Deep-dive ALL agents — skip general audit |
/agent-audit agent:code-reviewer |
Deep-dive ONLY the code-reviewer agent — skip everything else |
/agent-audit rules |
Audit rules files — quality + conflict detection |
Routing logic:
- If argument starts with
skill:→ extract skill name → jump directly to Skill Deep-Dive for that one skill only. Skip Phases 1-2. - If argument starts with
agent:→ extract agent name → jump directly to Agent Deep-Dive for that one agent only. Skip Phases 1-2. - If argument is
skills→ discover all skills → run Skill Deep-Dive for each. Skip Phase 2 general audit. - If argument is
agents→ discover all agents → run Agent Deep-Dive for each. Skip Phase 2 general audit. - If argument is
rules→ jump directly to Rules Conflict Detection. Skip Phases 1-2. - If argument is a component name (
hooks,permissions, etc.) → run Phase 1 research scoped to that topic + Phase 2 checklist for that component only. - If empty or
full→ run everything.
Phase 1: Research Latest Best Practices
Use the Agent tool to launch parallel research agents (subagent_type: "general-purpose"). All agents MUST search the web for the current year's content:
Agent 1: Official Claude Code Docs
Fetch latest official Claude Code documentation for:
- Hooks: events, matchers, exit codes
- Settings: permissions, deny lists, sandbox, attribution
- Memory: CLAUDE.md hierarchy, auto-memory,
.claude/rules/ - Skills: valid frontmatter fields (critical — verify which fields are actually supported vs silently ignored)
- MCP, plugins, subagents
Agent 2: Community Patterns & New Features
Search for:
- Claude Code changelog / release notes for current year
- Community best practices and patterns
- New features or deprecated settings
When scoped to a component (e.g., /agent-audit hooks): only research that component's docs, not everything.
Phase 2: General Audit
Read and audit agent-related files. Skip this phase entirely for skills or skill:<name> arguments.
Files to Check
Auto-discover — check for existence of each:
.claudeignore
.claude/settings.json
.claude/settings.local.json
.claude/hooks/*
.claude/commands/*
.claude/skills/*/SKILL.md (surface-level only — name, description, size)
.claude/agents/* (if exists)
.claude/rules/* (if exists)
.mcp.json (if exists)
CLAUDE.md (or claude.md)
openspec/ (if exists)
.gitignore
Checklist
.claudeignore
- Excludes build artifacts (dist/, build/, node_modules/, .next/, etc.)
- Excludes secrets (.env, .keys/, certificates, *.pem)
- Excludes coverage and logs
- Excludes .git/
- No over-exclusion of files Claude needs
.claude/settings.json
- Has
$schemafor validation (if supported) - Permission allowlists cover common safe commands
- Permission denylists block destructive commands
- Hooks are configured (PreToolUse protection, PostToolUse formatting)
- No outdated or deprecated settings
Hooks
- Protect-files hook covers sensitive paths (if exists)
- Hook scripts are executable (chmod +x)
- Exit codes correct (0=allow, 2=block)
- PostToolUse auto-format covers relevant extensions (if exists)
- No missing hook events that would be beneficial
CLAUDE.md
- Size under 15KB (if over, recommend moving sections to
.claude/rules/) - Contains project overview, commands, architecture, patterns
- No stale information
- No duplication with other config files
Commands & Skills (surface-level)
- All commands functional for current environment
- Referenced templates and files exist
- Each skill has frontmatter with
nameanddescription - Descriptions are concise
Memory (MEMORY.md if exists)
- Under 200 lines
- Organized by topic
- No stale information
.gitignore
- Includes
.claude/settings.local.json
Phase 3: Skill Deep-Dive
Triggered by: skills (all), skill:<name> (one), or during full audit if a skill looks problematic in surface-level check.
Discovery
- List all skills:
ls .claude/skills/*/SKILL.md - If
skill:<name>— find the matching skill directory - Read each target skill's SKILL.md fully
Complexity Assessment (for skills argument only)
Before auditing each skill, assess if it needs a separate agent:
Use a separate agent when ANY of these are true:
- SKILL.md exceeds 100 lines
- Skill contains inline commands (exclamation-backtick syntax) that need execution testing
- Skill references external files or scripts
- Skill has complex argument handling
Audit inline (no separate agent) when:
- SKILL.md is short and simple (under 100 lines)
- No inline commands or external references
- Straightforward instructions
Skill Audit Checklist
For EVERY skill being deep-dived, check ALL of the following:
Frontmatter
- Only uses supported fields (from Phase 1 research — verify against latest docs)
-
nameis lowercase with hyphens -
descriptionis concise — long descriptions bloat every session's system prompt - No unsupported fields silently ignored
Content & Structure
- SKILL.md under 500 lines
- Clear separation of conventions vs workflow
- Examples provided for non-trivial behavior
- Supporting files (if any) exist and are referenced
Technical Correctness
- Inline commands (exclamation-backtick syntax) are valid — execute them and verify output
- Grep/filter patterns match current codebase naming conventions
- Referenced file paths and directories exist
- No hardcoded absolute paths
- No project-specific assumptions that should be generalized (for user-level skills)
Codebase Alignment
- Conventions match CLAUDE.md and project rules
- No contradictions with project patterns
- File naming patterns reflect current state
- Filter patterns cover all relevant file types
Invocation & UX
- Description clearly signals manual-only if intended
-
$ARGUMENTShandling documented - Output format specified (what user sees after skill runs)
- Error cases handled (e.g., no files match, empty diff)
Security
- No secrets in skill content
- Inline commands don't expose sensitive data
- Doesn't bypass protect-files hook
Skill Deep-Dive Report (per skill)
### Skill: <skill-name>
**Lines:** N | **Complexity:** low/medium/high | **Agent used:** yes/no
**Checks Passed:** X/Y
| Category | Check | Status | Detail |
|----------|-------|--------|--------|
| Frontmatter | Supported fields only | PASS/FAIL | ... |
| Frontmatter | Description concise | PASS/FAIL | ... |
| Technical | Inline commands valid | PASS/FAIL | ... |
| Technical | Patterns match codebase | PASS/FAIL | ... |
| Alignment | Matches CLAUDE.md | PASS/FAIL | ... |
| Security | No secrets exposed | PASS/FAIL | ... |
Phase 3b: Agent Deep-Dive
Triggered by: agents (all), agent:<name> (one), or during full audit.
Discovery
- List all agents:
ls .claude/agents/*.md - If
agent:<name>— find the matching agent file - Read each target agent file fully
Agent Audit Checklist
For EVERY agent being deep-dived, check ALL of the following:
Frontmatter
- Has
nameanddescription -
modelis appropriate for the agent's complexity (sonnet for fast tasks, opus for complex) - Description examples match the project's domain and conventions
Codebase Alignment
- Tech stack references match actual project
- Review dimensions are relevant to this project's stack
- Convention checklist matches CLAUDE.md and project rules
- Architecture checks reflect actual patterns
- No references to frameworks, libraries, or patterns not used in this project
Content Quality
- Clear review process / workflow steps
- Output format specified
- Edge cases handled
- Guidelines are actionable and specific
Security
- No secrets in agent content
- No instructions that could bypass safety measures
Agent Deep-Dive Report (per agent)
### Agent: <agent-name>
**Lines:** N | **Model:** sonnet/opus
**Checks Passed:** X/Y
| Category | Check | Status | Detail |
|----------|-------|--------|--------|
| Frontmatter | Has name + description | PASS/FAIL | ... |
| Frontmatter | Model appropriate | PASS/FAIL | ... |
| Alignment | Tech stack matches project | PASS/FAIL | ... |
| Alignment | Conventions match CLAUDE.md | PASS/FAIL | ... |
| Content | Clear workflow | PASS/FAIL | ... |
| Security | No secrets | PASS/FAIL | ... |
Phase 3c: Rules Conflict Detection
Triggered by: rules, or during full audit.
Rules Conflict Detection
When auditing rules (either as part of full or rules scope):
Identify sources: Classify each rules file:
- Arcana rules: files matching
arcana-*.mdpattern in.claude/rules/ - User rules: all other
.mdfiles in.claude/rules/ - CLAUDE.md: project root instructions
- Arcana rules: files matching
Read all rules files and extract the key directives from each
Cross-check for semantic conflicts:
- For each Arcana directive, check if any user rule contradicts it
- Example conflict: Arcana says "research before acting" but user rule says "be concise, no research"
- Example non-conflict: Arcana says "verify before output" and user says "use TypeScript strict" (different concerns)
Report findings with source labels:
📦 Arcana rules (3 files): ✓ arcana-quality.md — no conflicts ⚠ arcana-research.md — potential conflict with your rules Arcana: "Research before acting" Your rule (coding-style.md): "Keep responses concise and fast" → These may conflict during complex analysis tasks 📁 Your project rules (2 files): ✓ architecture.md — no issues ✓ coding-style.md — reviewed (see conflict above)For each conflict: Ask the user which should take priority. Do NOT auto-resolve.
Self-audit note: When auditing Arcana's own skills, label them clearly:
📦 Arcana skill: deep-review ✓ Frontmatter valid ⚠ Could benefit from `context: fork` (new Claude Code feature)Never say "Arcana's skill is wrong." Say "could benefit from [improvement]" or "consider updating."
Phase 4: Report
Full/Component Audit Report
## Agent Configuration Audit Report
**Date:** YYYY-MM-DD
**Project:** <project name from CLAUDE.md or directory name>
**New Features Found:** [any new Claude Code features from research]
### Score: X/10
### What's Working Well
- ...
### Issues Found
| # | Severity | Component | Issue | Recommendation |
|---|----------|-----------|-------|----------------|
### Recommendations (Priority Ordered)
1. [HIGH] ...
2. [MEDIUM] ...
3. [LOW] ...
Phase 5: Implementation Plan
If actionable improvements found:
- Write concrete plan with exact file changes
- Wait for user approval
- On approval, implement changes
If no issues: report "All clear — configuration is up to date" and skip planning.
Rules
- NEVER modify files without user approval
- ALWAYS search latest docs — do not rely on cached knowledge
- Be specific — include exact file paths and code snippets in recommendations
- Flag deprecated or silently-ignored settings/fields
- If CLAUDE.md exceeds 15KB, recommend moving sections to
.claude/rules/ - Adapt to whatever project structure exists — don't assume any specific stack
- Check for both project-level AND user-level skills/rules conflicts
Source: cj-ways/arcana — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核