Token导航 LogoToken导航

Agent Skill · 研究检索

claude-code-mastery(Claude 代码 mastery)

claude-code-mastery 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

claude-code-mastery 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 38,803。

总安装 1,508周安装 61GitHub Stars 103下载 473核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:claude-code-mastery(Claude 代码 mastery)
来源仓库:https://github.com/borghei/claude-skills
仓库路径:skills/claude-code-mastery
安装命令:
npx skills add https://github.com/borghei/claude-skills --skill claude-code-mastery
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/borghei/claude-skills --skill claude-code-mastery

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

深度优化 Claude Code CLI 使用体验,提升编码效率与上下文管理能力。支持 CLAUDE.md 配置调优、子代理创建与钩子自动化扩展。提供技能开发脚手架与 MCP 服务器集成指南。高级功能可能触发额外权限请求,操作前请审阅授权范围。

claude-code-mastery 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/claude-code-mastery

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/borghei/claude-skills --skill claude-code-mast…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

claude-code-mastery 怎么安装?

在终端执行 npx skills add https://github.com/borghei/claude-skills --skill claude-code-mastery。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

claude-code-mastery 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

claude-code-mastery 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

claude-code-mastery 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

claude-code-mastery 用的人多吗?

公开数据是累计安装 1,508 次,近一周安装 61 次,下载 473 次,GitHub 103 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

claude-code-mastery 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
claude-code-mastery

Claude 代码 mastery · 本页

1,508103操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Claude Code Mastery

Expert skill for Claude Code CLI -- CLAUDE.md optimization, skill authoring, subagent creation, hooks automation, and context engineering.

Keywords

claude-code, claude-cli, CLAUDE.md, skill-authoring, subagents, hooks, context-window, token-budget, MCP-servers, worktrees, permission-modes, prompt-engineering, context-engineering, slash-commands


Quick Start

# Scaffold a new skill package
python scripts/skill_scaffolder.py my-new-skill --domain engineering --description "Brief description"

# Analyze and optimize an existing CLAUDE.md
python scripts/claudemd_optimizer.py path/to/CLAUDE.md

# Estimate context window usage across a project
python scripts/context_analyzer.py /path/to/project

# All tools support JSON output
python scripts/claudemd_optimizer.py CLAUDE.md --json

Tools

Skill Scaffolder

Generates a skill directory with SKILL.md template, scripts/, references/, assets/ directories, and YAML frontmatter.

python scripts/skill_scaffolder.py my-skill --domain engineering --description "Does X"
ParameterDescription
skill_nameName for the skill (kebab-case)
--domain, -dDomain category
--descriptionBrief description for frontmatter
--versionSemantic version (default: 1.0.0)
--licenseLicense type (default: MIT)
--output, -oParent directory for skill folder
--jsonOutput as JSON

CLAUDE.md Optimizer

Analyzes a CLAUDE.md file and produces optimization recommendations.

python scripts/claudemd_optimizer.py CLAUDE.md --token-limit 4000 --json

Output includes: line count, token estimate, section completeness, redundancy detection, missing sections, scored recommendations.

Context Analyzer

Scans a project to estimate context window consumption by file category.

python scripts/context_analyzer.py /path/to/project --max-depth 4 --json

Output includes: token estimates per category, percentage of context consumed, largest files, budget breakdown, reduction recommendations.


Workflow 1: Optimize a CLAUDE.md

  1. Audit -- Run python scripts/claudemd_optimizer.py CLAUDE.md and capture the score.
  2. Structure -- Reorganize into these sections: ## Project Purpose -- What the project is ## Architecture Overview -- Directory structure, key patterns ## Development Environment -- Build, test, setup commands ## Key Principles -- 3-7 non-obvious rules ## Anti-Patterns to Avoid -- Things that look right but are wrong ## Git Workflow -- Branch strategy, commit conventions
  3. Compress -- Convert paragraphs to bullets (saves ~30% tokens). Use code blocks for commands. Remove generic advice Claude already knows.
  4. Hierarchize -- Move domain details to child CLAUDE.md files: project/ ├── CLAUDE.md # Global: purpose, architecture, principles ├── frontend/CLAUDE.md # Frontend-specific: React patterns, styling ├── backend/CLAUDE.md # Backend-specific: API patterns, DB conventions └──.claude/CLAUDE.md # User-specific overrides (gitignored)
  5. Validate -- Run python scripts/claudemd_optimizer.py CLAUDE.md --token-limit 4000 and confirm score improved.

Workflow 2: Author a New Skill

  1. Scaffold -- python scripts/skill_scaffolder.py my-skill -d engineering --description "..."
  2. Write SKILL.md in this order:

- YAML frontmatter (name, description with trigger phrases, license, metadata) - Title and one-line summary - Quick Start (3-5 copy-pasteable commands) - Tools (each script with usage and parameters table) - Workflows (numbered step-by-step sequences) - Reference links

  1. Optimize the description for auto-discovery: description: >- This skill should be used when the user asks to "analyze performance", "optimize queries", "profile memory", or "benchmark endpoints". Use for performance engineering and capacity planning.
  2. Build Python tools -- standard library only, argparse CLI, --json flag, module docstring, error handling.
  3. Verify -- Confirm the skill triggers on expected prompts and tools run without errors.

Workflow 3: Create a Subagent

  1. Define scope -- One narrow responsibility per agent.
  2. Create agent YAML at .claude/agents/agent-name.yaml: name: security-reviewer description: Reviews code for security vulnerabilities model: claude-sonnet-4-20250514 allowed-tools: - Read - Glob - Grep - Bash(git diff*) custom-instructions: | For every change: 1. Check for hardcoded secrets 2. Identify injection vulnerabilities 3. Verify auth patterns 4. Flag insecure dependencies Output a structured report with severity levels.
  3. Set tool access -- read-only (Read, Glob, Grep), read+commands (+ Bash(npm test*)), or write-capable (+ Edit, Write).
  4. Invoke -- /agents/security-reviewer Review the last 3 commits
  5. Validate -- Confirm the agent stays within scope and produces structured output.

Workflow 4: Configure Hooks

Hooks run custom scripts at lifecycle events without user approval.

HookFires WhenBlocking
PreToolUseBefore tool executesYes (exit 1 blocks)
PostToolUseAfter tool completesNo
NotificationClaude sends notificationNo
StopClaude finishes turnNo
  1. Add hook config to .claude/settings.json: {"hooks": {"PostToolUse": [{"matcher": "Edit|Write", "hooks": [{"type": "command", "command": "prettier --write \"$CLAUDE_FILE_PATH\" 2>/dev/null || true"}]}], "PreToolUse": [{"matcher": "Bash", "hooks": [{"type": "command", "command": "bash.claude/hooks/validate.sh"}]}]}}
  2. Test -- Trigger the relevant tool and confirm the hook fires.
  3. Iterate -- Add matchers for additional tools as needed.

Workflow 5: Manage Context Budget

  1. Audit -- python scripts/context_analyzer.py /path/to/project
  2. Apply budget targets: Category Budget Purpose System prompt + CLAUDE.md 5-10% Project configuration Skill definitions 5-15% Active skill content Source code (read files) 30-50% Files Claude reads Conversation history 20-30% Messages and responses Working memory 10-20% Reasoning space
  3. Reduce overhead -- Keep root CLAUDE.md under 4000 tokens. Use hierarchical loading. Avoid reading entire large files. Use /compact after completing subtasks.
  4. Validate -- Re-run context analyzer and confirm overhead dropped.

Quick Reference

Slash Commands

CommandDescription
/compactSummarize conversation to free context
/clearClear conversation history
/modelSwitch model mid-session
/agentsList and invoke custom agents
/permissionsView and modify tool permissions
/costShow token usage and cost
/doctorDiagnose configuration issues
/initGenerate CLAUDE.md for current project

Permission Modes

ModeBehaviorBest For
DefaultAsks permission for writesNormal development
AllowlistAuto-approves listed toolsRepetitive workflows
YoloAuto-approves everythingTrusted automation
{ "permissions": { "allow": ["Read", "Glob", "Grep", "Bash(npm test*)"],
                    "deny": ["Bash(rm -rf*)", "Bash(git push*)"] } }

CLAUDE.md Loading Order

  1. ~/.claude/CLAUDE.md -- user global, always loaded
  2. /project/CLAUDE.md -- project root, always loaded
  3. /project/.claude/CLAUDE.md -- project config, always loaded
  4. /project/subdir/CLAUDE.md -- subdirectory, loaded when files accessed

MCP Servers

ServerPurpose
server-filesystemFile access beyond project
server-githubGitHub API (issues, PRs)
server-postgresDatabase queries
server-memoryPersistent key-value store
server-brave-searchWeb search
server-puppeteerBrowser automation

Reference Documentation


Troubleshooting

ProblemCauseSolution
CLAUDE.md changes not picked upClaude loads CLAUDE.md at session startStart a new conversation or use /clear to reload configuration
Skill not triggering on expected promptsDescription field in YAML frontmatter missing trigger phrasesAdd quoted user phrases to the description field (e.g., "optimize queries", "profile memory")
Context window exhausted mid-taskRoot CLAUDE.md too large or too many files readRun context_analyzer.py to audit token usage, then move domain content to child CLAUDE.md files
Hook not firing after tool useMatcher in .claude/settings.json does not match the tool nameVerify the matcher regex matches the exact tool name (e.g., `Edit\Write, not edit\write`)
Subagent exceeds scope and edits unrelated filesallowed-tools list is too permissiveRestrict to read-only tools (Read, Glob, Grep) and add write tools only when necessary
Scaffolder fails with "Directory already exists"Target skill directory already present on diskRemove or rename the existing directory, or choose a different skill name
Optimizer reports low score despite good structureToken count exceeds the default 6000 limitPass --token-limit matching your actual budget (e.g., --token-limit 10000)

Success Criteria

  • CLAUDE.md optimizer score of 80+ on all project CLAUDE.md files
  • Root CLAUDE.md stays under 4000 tokens (verified by claudemd_optimizer.py --token-limit 4000)
  • Auto-loaded configuration (all CLAUDE.md files combined) consumes less than 10% of the context window
  • Every new skill scaffolded passes the optimizer with zero "critical" missing sections
  • Subagents stay within their declared allowed-tools scope during testing
  • Hooks execute in under 500ms to avoid perceptible delay on tool use
  • Context analyzer shows 50%+ of the context window available for source code and reasoning

Scope & Limitations

This skill covers:

  • Authoring, structuring, and optimizing CLAUDE.md files for any project
  • Scaffolding new skill packages with correct directory layout and frontmatter
  • Creating and configuring Claude Code subagents with scoped tool access
  • Analyzing and managing context window token budgets across a codebase

This skill does NOT cover:

Integration Points

SkillIntegrationData Flow
senior-architectArchitecture decisions inform CLAUDE.md structure sectionsArchitecture diagrams and patterns feed into the Architecture Overview section of CLAUDE.md
code-reviewerSubagent creation for automated code reviewClaude Code Mastery creates the agent YAML; Code Reviewer provides the review logic
senior-prompt-engineerPrompt optimization for skill descriptions and agent instructionsPrompt engineering techniques improve YAML frontmatter trigger phrases and agent custom-instructions
doc-drift-detectorDetects when CLAUDE.md drifts out of sync with the codebaseContext Analyzer output feeds drift detection; drift findings trigger CLAUDE.md optimization
context-engineAdvanced context management strategiesContext Analyzer provides token budgets; Context Engine applies compression and prioritization
senior-secopsSecurity hooks and permission mode configurationSecOps policies define which tools to deny; Claude Code Mastery configures the permission allowlists

Tool Reference

1. Skill Scaffolder (scripts/skill_scaffolder.py)

Purpose: Generate a complete skill package directory with SKILL.md template, starter Python script, reference document, and proper YAML frontmatter.

Usage:

python scripts/skill_scaffolder.py <skill_name> [options]

Parameters:

ParameterTypeRequiredDefaultDescription
skill_namepositionalYes--Name for the skill in kebab-case (e.g., my-new-skill)
--domain, -dstringNoengineeringDomain category. Options: engineering, marketing, product, project-management, c-level, ra-qm, business-growth, finance, standards, development-tools
--descriptionstringNoauto-generatedBrief description for YAML frontmatter, optimized for auto-discovery
--versionstringNo1.0.0Semantic version for metadata
--licensestringNoMITLicense type for frontmatter
--categorystringNosame as domainSkill category for metadata
--output, -ostringNo. (current dir)Parent directory for the skill folder
--jsonflagNooffOutput results in JSON format

Example:

python scripts/skill_scaffolder.py api-analyzer -d engineering --description "API analysis and optimization" --json

Output Formats:

  • Human-readable (default): Prints skill name, domain, version, location, directory tree, and next-steps checklist.
  • JSON (--json): Returns {success, path, name, domain, version, directories_created, files_created}.

2. CLAUDE.md Optimizer (scripts/claudemd_optimizer.py)

Purpose: Analyze a CLAUDE.md file for structure completeness, token efficiency, redundancy, and verbosity. Produces a scored report with prioritized optimization recommendations.

Usage:

python scripts/claudemd_optimizer.py <file_path> [options]

Parameters:

ParameterTypeRequiredDefaultDescription
file_pathpositionalYes--Path to the CLAUDE.md file to analyze
--token-limitintegerNo6000Maximum recommended token count for the file
--jsonflagNooffOutput results in JSON format

Example:

python scripts/claudemd_optimizer.py path/to/CLAUDE.md --token-limit 4000

Output Formats:

  • Human-readable (default): Displays score (0-100), file metrics (lines, words, tokens), section breakdown with per-section token estimates, section completeness checklist (critical/high/medium), redundancy issues, and prioritized recommendations (HIGH/MEDIUM/LOW).
  • JSON (--json): Returns {success, file, metrics, sections, completeness, redundancies, recommendations, score}.

3. Context Analyzer (scripts/context_analyzer.py)

Purpose: Scan a project directory to estimate how much of Claude Code's context window is consumed by CLAUDE.md files, skill definitions, source code, and configuration. Produces a token budget breakdown with reduction recommendations.

Usage:

python scripts/context_analyzer.py <project_path> [options]

Parameters:

ParameterTypeRequiredDefaultDescription
project_pathpositionalYes--Path to the project directory to analyze
--max-depthintegerNo5Maximum directory traversal depth
--context-windowintegerNo200000Total context window size in tokens
--jsonflagNooffOutput results in JSON format

Example:

python scripts/context_analyzer.py /path/to/project --max-depth 3 --context-window 200000 --json

Output Formats:

  • Human-readable (default): Displays project summary (files scanned, total tokens, auto-loaded tokens), context budget breakdown with visual bar chart, per-category breakdown (Claude Configuration, Skill Definitions, Reference Documents, Source Code, Config & Build, Documentation) with largest files listed, top 20 largest files, and prioritized recommendations.
  • JSON (--json): Returns {success, project_path, context_window, summary, categories, budget, largest_files, recommendations}.

平台分布

Codex

33.9%
按下载量换算160

Claude

30.92%
按下载量换算146

Cursor

20.5%
按下载量换算97

Gemini CLI

9.13%
按下载量换算43

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills