configure-claude-plugins
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/configure:claude-plugins
/configure:claude-plugins
Configure a project to use the Claude Code plugin marketplace. Sets up permissions and GitHub Actions workflows (, ) with the marketplace pre-configured.
laurigates/claude-plugins.claude/settings.jsonclaude.ymlclaude-code-review.yml配置项目以使用 Claude Code插件市场。设置权限,并预配置好该插件市场的GitHub Actions工作流(、)。
laurigates/claude-plugins.claude/settings.jsonclaude.ymlclaude-code-review.ymlWhen to Use This Skill
何时使用此技能
| Use this skill when... | Use another approach when... |
|---|---|
| Onboarding a new project to use Claude Code plugins | Configuring Claude Code settings unrelated to plugins |
Setting up | Creating general GitHub Actions workflows ( |
Adding the | Installing individual plugins manually |
Merging plugin permissions into existing | Debugging Claude Code action failures (check GitHub Actions logs) |
| Selecting recommended plugins based on project type | Developing new plugins (see CLAUDE.md plugin lifecycle) |
| 使用此技能的场景... | 使用其他方法的场景... |
|---|---|
| 为新项目接入Claude Code插件 | 配置与插件无关的Claude Code设置 |
设置 | 创建通用GitHub Actions工作流(使用 |
为代码库添加 | 手动安装单个插件 |
将插件权限合并到现有 | 调试Claude Code操作失败(查看GitHub Actions日志) |
| 根据项目类型选择推荐插件 | 开发新插件(参见CLAUDE.md插件生命周期) |
Context
上下文
- Settings file exists: !
find . -maxdepth 1 -name \'.claude/settings.json\' 2>/dev/null - Workflows: !
find .github/workflows -maxdepth 1 -name 'claude*.yml' 2>/dev/null - Git remote: !
git remote get-url origin 2>/dev/null - Project type indicators: !
find . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' -o -name 'Cargo.toml' -o -name 'Dockerfile' \) 2>/dev/null - Existing workflows dir: !
find . -maxdepth 1 -type d -name \'.github/workflows\' 2>/dev/null
- 配置文件是否存在:!
find . -maxdepth 1 -name \'.claude/settings.json\' 2>/dev/null - 工作流:!
find .github/workflows -maxdepth 1 -name 'claude*.yml' 2>/dev/null - Git远程仓库:!
git remote get-url origin 2>/dev/null - 项目类型标识:!
find . -maxdepth 1 \( -name 'package.json' -o -name 'pyproject.toml' -o -name 'Cargo.toml' -o -name 'Dockerfile' \) 2>/dev/null - 现有工作流目录:!
find . -maxdepth 1 -type d -name \'.github/workflows\' 2>/dev/null
Parameters
参数
Parse from command arguments:
| Parameter | Description |
|---|---|
| Report current configuration status without changes |
| Apply configuration automatically |
| Comma-separated list of plugins to install (default: all recommended) |
从命令参数中解析:
| 参数 | 描述 |
|---|---|
| 仅报告当前配置状态,不进行修改 |
| 自动应用配置 |
| 要安装的插件列表,用逗号分隔(默认:所有推荐插件) |
Execution
执行步骤
Execute this Claude plugins configuration workflow:
执行以下Claude插件配置工作流:
Step 1: Detect current state
步骤1:检测当前状态
- Check for existing
.claude/settings.json - Check for existing
.github/workflows/claude.yml - Check for existing
.github/workflows/claude-code-review.yml - Detect project type (language, framework) from file indicators
- 检查是否存在现有
.claude/settings.json - 检查是否存在现有
.github/workflows/claude.yml - 检查是否存在现有
.github/workflows/claude-code-review.yml - 根据文件标识检测项目类型(语言、框架)
Step 2: Configure .claude/settings.json
步骤2:配置.claude/settings.json
Create or merge into the following permissions structure:
.claude/settings.jsonjson
{
"permissions": {
"allow": [
"Bash(git status *)",
"Bash(git diff *)",
"Bash(git log *)",
"Bash(git branch *)",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git push *)",
"Bash(git remote *)",
"Bash(git checkout *)",
"Bash(git fetch *)",
"Bash(gh pr *)",
"Bash(gh run *)",
"Bash(gh issue *)",
"Bash(pre-commit *)",
"Bash(gitleaks *)",
"mcp__context7",
"mcp__sequential-thinking"
]
}
}If already exists, MERGE the array without duplicating entries. Preserve any existing , , or other fields.
.claude/settings.jsonpermissions.allowhooksenv创建或合并到中,添加以下权限结构:
.claude/settings.jsonjson
{
"permissions": {
"allow": [
"Bash(git status *)",
"Bash(git diff *)",
"Bash(git log *)",
"Bash(git branch *)",
"Bash(git add *)",
"Bash(git commit *)",
"Bash(git push *)",
"Bash(git remote *)",
"Bash(git checkout *)",
"Bash(git fetch *)",
"Bash(gh pr *)",
"Bash(gh run *)",
"Bash(gh issue *)",
"Bash(pre-commit *)",
"Bash(gitleaks *)",
"mcp__context7",
"mcp__sequential-thinking"
]
}
}如果已存在,合并数组,不重复添加条目。保留现有的、或其他字段。
.claude/settings.jsonpermissions.allowhooksenvStep 3: Configure .github/workflows/claude.yml
步骤3:配置.github/workflows/claude.yml
Create with the Claude Code action configured to use the plugin marketplace:
.github/workflows/claude.ymlyaml
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: |
https://github.com/laurigates/claude-plugins.git
plugins: |
PLUGINS_LISTReplace with the selected plugins in the format , one per line.
PLUGINS_LISTplugin-name@laurigates-claude-plugins创建,配置Claude Code操作以使用插件市场:
.github/workflows/claude.ymlyaml
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Claude Code
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: |
https://github.com/laurigates/claude-plugins.git
plugins: |
PLUGINS_LIST将替换为所选插件,格式为,每行一个。
PLUGINS_LISTplugin-name@laurigates-claude-pluginsStep 4: Configure .github/workflows/claude-code-review.yml
步骤4:配置.github/workflows/claude-code-review.yml
Create for automatic PR reviews:
.github/workflows/claude-code-review.ymlyaml
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Claude Code Review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
Review this pull request. Focus on:
- Code quality and best practices
- Potential bugs or security issues
- Test coverage gaps
- Documentation needs
claude_args: "--max-turns 5"
plugin_marketplaces: |
https://github.com/laurigates/claude-plugins.git
plugins: |
code-quality-plugin@laurigates-claude-plugins
testing-plugin@laurigates-claude-plugins创建用于自动PR评审:
.github/workflows/claude-code-review.ymlyaml
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
pull-requests: write
issues: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Claude Code Review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
Review this pull request. Focus on:
- Code quality and best practices
- Potential bugs or security issues
- Test coverage gaps
- Documentation needs
claude_args: "--max-turns 5"
plugin_marketplaces: |
https://github.com/laurigates/claude-plugins.git
plugins: |
code-quality-plugin@laurigates-claude-plugins
testing-plugin@laurigates-claude-pluginsStep 5: Select plugins
步骤5:选择插件
If is not specified, select recommended plugins based on detected project type:
--plugins| Project Indicator | Recommended Plugins |
|---|---|
| |
| |
| |
| Above + |
| Above + |
| Default (any) | |
如果未指定,根据检测到的项目类型选择推荐插件:
--plugins| 项目标识 | 推荐插件 |
|---|---|
| |
| |
| |
| 上述插件 + |
| 上述插件 + |
| 默认(任意) | |
Step 6: Report results
步骤6:报告结果
Print a status report:
Claude Plugins Configuration Report
=====================================
Repository: <repo-name>
.claude/settings.json:
Status: <CREATED|UPDATED|EXISTS>
Permissions: <N> allowed patterns configured
.github/workflows/claude.yml:
Status: <CREATED|UPDATED|EXISTS>
Marketplace: laurigates/claude-plugins
Plugins: <list>
.github/workflows/claude-code-review.yml:
Status: <CREATED|UPDATED|EXISTS>
Trigger: PR opened/synchronize/reopened
Plugins: <list>
Next Steps:
1. Add CLAUDE_CODE_OAUTH_TOKEN to repository secrets
Settings > Secrets and variables > Actions > New repository secret
2. Commit and push the new workflow files
3. Test by mentioning @claude in a PR comment打印状态报告:
Claude Plugins Configuration Report
=====================================
Repository: <repo-name>
.claude/settings.json:
Status: <CREATED|UPDATED|EXISTS>
Permissions: <N> allowed patterns configured
.github/workflows/claude.yml:
Status: <CREATED|UPDATED|EXISTS>
Marketplace: laurigates/claude-plugins
Plugins: <list>
.github/workflows/claude-code-review.yml:
Status: <CREATED|UPDATED|EXISTS>
Trigger: PR opened/synchronize/reopened
Plugins: <list>
Next Steps:
1. Add CLAUDE_CODE_OAUTH_TOKEN to repository secrets
Settings > Secrets and variables > Actions > New repository secret
2. Commit and push the new workflow files
3. Test by mentioning @claude in a PR commentAgentic Optimizations
智能优化
| Context | Command |
|---|---|
| Quick status check | |
| Auto-configure all | |
| Specific plugins only | |
| Verify settings exist | |
| List Claude workflows | |
| 上下文 | 命令 |
|---|---|
| 快速状态检查 | |
| 自动配置所有项 | |
| 仅配置特定插件 | |
| 验证配置文件是否存在 | |
| 列出Claude工作流 | |
Flags
标志
| Flag | Description |
|---|---|
| Report current status without making changes |
| Apply all configuration automatically |
| Override automatic plugin selection |
| 标志 | 描述 |
|---|---|
| 仅报告当前状态,不进行修改 |
| 自动应用所有配置 |
| 覆盖自动插件选择 |
Important Notes
重要说明
- The secret must be added manually to the repository
CLAUDE_CODE_OAUTH_TOKEN - If using AWS Bedrock or Google Vertex AI, adjust the authentication section accordingly
- The plugin marketplace URL uses HTTPS Git format:
https://github.com/laurigates/claude-plugins.git - Plugins are referenced as (marketplace name from marketplace.json)
<plugin-name>@laurigates-claude-plugins
- 必须手动将添加到仓库密钥中
CLAUDE_CODE_OAUTH_TOKEN - 如果使用AWS Bedrock或Google Vertex AI,请相应调整认证部分
- 插件市场URL使用HTTPS Git格式:
https://github.com/laurigates/claude-plugins.git - 插件引用格式为(来自marketplace.json的市场名称)
<plugin-name>@laurigates-claude-plugins
See Also
另请参见
- - General GitHub Actions workflow configuration
/configure:workflows - - Run all compliance checks
/configure:all - skill - Claude Code security settings
claude-security-settings
- - 通用GitHub Actions工作流配置
/configure:workflows - - 运行所有合规性检查
/configure:all - 技能 - Claude Code安全设置
claude-security-settings