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
laurigates/claude-plugins
Claude Code plugin marketplace. Sets up
.claude/settings.json
permissions and GitHub Actions workflows (
claude.yml
,
claude-code-review.yml
) with the marketplace pre-configured.
配置项目以使用
laurigates/claude-plugins
Claude Code插件市场。设置
.claude/settings.json
权限,并预配置好该插件市场的GitHub Actions工作流(
claude.yml
claude-code-review.yml
)。

When to Use This Skill

何时使用此技能

Use this skill when...Use another approach when...
Onboarding a new project to use Claude Code pluginsConfiguring Claude Code settings unrelated to plugins
Setting up
claude.yml
and
claude-code-review.yml
workflows
Creating general GitHub Actions workflows (
/configure:workflows
)
Adding the
laurigates/claude-plugins
marketplace to a repo
Installing individual plugins manually
Merging plugin permissions into existing
.claude/settings.json
Debugging Claude Code action failures (check GitHub Actions logs)
Selecting recommended plugins based on project typeDeveloping new plugins (see CLAUDE.md plugin lifecycle)
使用此技能的场景...使用其他方法的场景...
为新项目接入Claude Code插件配置与插件无关的Claude Code设置
设置
claude.yml
claude-code-review.yml
工作流
创建通用GitHub Actions工作流(使用
/configure:workflows
为代码库添加
laurigates/claude-plugins
插件市场
手动安装单个插件
将插件权限合并到现有
.claude/settings.json
调试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:
ParameterDescription
--check-only
Report current configuration status without changes
--fix
Apply configuration automatically
--plugins
Comma-separated list of plugins to install (default: all recommended)
从命令参数中解析:
参数描述
--check-only
仅报告当前配置状态,不进行修改
--fix
自动应用配置
--plugins
要安装的插件列表,用逗号分隔(默认:所有推荐插件)

Execution

执行步骤

Execute this Claude plugins configuration workflow:
执行以下Claude插件配置工作流:

Step 1: Detect current state

步骤1:检测当前状态

  1. Check for existing
    .claude/settings.json
  2. Check for existing
    .github/workflows/claude.yml
  3. Check for existing
    .github/workflows/claude-code-review.yml
  4. Detect project type (language, framework) from file indicators
  1. 检查是否存在现有
    .claude/settings.json
  2. 检查是否存在现有
    .github/workflows/claude.yml
  3. 检查是否存在现有
    .github/workflows/claude-code-review.yml
  4. 根据文件标识检测项目类型(语言、框架)

Step 2: Configure .claude/settings.json

步骤2:配置.claude/settings.json

Create or merge into
.claude/settings.json
the following permissions structure:
json
{
  "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
.claude/settings.json
already exists, MERGE the
permissions.allow
array without duplicating entries. Preserve any existing
hooks
,
env
, or other fields.
创建或合并到
.claude/settings.json
中,添加以下权限结构:
json
{
  "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.json
已存在,合并
permissions.allow
数组,不重复添加条目。保留现有的
hooks
env
或其他字段。

Step 3: Configure .github/workflows/claude.yml

步骤3:配置.github/workflows/claude.yml

Create
.github/workflows/claude.yml
with the Claude Code action configured to use the plugin marketplace:
yaml
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
Replace
PLUGINS_LIST
with the selected plugins in the format
plugin-name@laurigates-claude-plugins
, one per line.
创建
.github/workflows/claude.yml
,配置Claude Code操作以使用插件市场:
yaml
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_LIST
替换为所选插件,格式为
plugin-name@laurigates-claude-plugins
,每行一个。

Step 4: Configure .github/workflows/claude-code-review.yml

步骤4:配置.github/workflows/claude-code-review.yml

Create
.github/workflows/claude-code-review.yml
for automatic PR reviews:
yaml
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
创建
.github/workflows/claude-code-review.yml
用于自动PR评审:
yaml
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

Step 5: Select plugins

步骤5:选择插件

If
--plugins
is not specified, select recommended plugins based on detected project type:
Project IndicatorRecommended Plugins
package.json
git-plugin
,
typescript-plugin
,
testing-plugin
,
code-quality-plugin
pyproject.toml
/
setup.py
git-plugin
,
python-plugin
,
testing-plugin
,
code-quality-plugin
Cargo.toml
git-plugin
,
rust-plugin
,
testing-plugin
,
code-quality-plugin
Dockerfile
Above +
container-plugin
.github/workflows/
Above +
github-actions-plugin
Default (any)
git-plugin
,
code-quality-plugin
,
testing-plugin
,
tools-plugin
如果未指定
--plugins
,根据检测到的项目类型选择推荐插件:
项目标识推荐插件
package.json
git-plugin
,
typescript-plugin
,
testing-plugin
,
code-quality-plugin
pyproject.toml
/
setup.py
git-plugin
,
python-plugin
,
testing-plugin
,
code-quality-plugin
Cargo.toml
git-plugin
,
rust-plugin
,
testing-plugin
,
code-quality-plugin
Dockerfile
上述插件 +
container-plugin
.github/workflows/
上述插件 +
github-actions-plugin
默认(任意)
git-plugin
,
code-quality-plugin
,
testing-plugin
,
tools-plugin

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 comment

Agentic Optimizations

智能优化

ContextCommand
Quick status check
/configure:claude-plugins --check-only
Auto-configure all
/configure:claude-plugins --fix
Specific plugins only
/configure:claude-plugins --fix --plugins git-plugin,testing-plugin
Verify settings exist
test -f .claude/settings.json && echo "EXISTS"
List Claude workflows
find .github/workflows -name 'claude*.yml' 2>/dev/null
上下文命令
快速状态检查
/configure:claude-plugins --check-only
自动配置所有项
/configure:claude-plugins --fix
仅配置特定插件
/configure:claude-plugins --fix --plugins git-plugin,testing-plugin
验证配置文件是否存在
test -f .claude/settings.json && echo "EXISTS"
列出Claude工作流
find .github/workflows -name 'claude*.yml' 2>/dev/null

Flags

标志

FlagDescription
--check-only
Report current status without making changes
--fix
Apply all configuration automatically
--plugins
Override automatic plugin selection
标志描述
--check-only
仅报告当前状态,不进行修改
--fix
自动应用所有配置
--plugins
覆盖自动插件选择

Important Notes

重要说明

  • The
    CLAUDE_CODE_OAUTH_TOKEN
    secret must be added manually to the repository
  • 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
    <plugin-name>@laurigates-claude-plugins
    (marketplace name from marketplace.json)
  • 必须手动将
    CLAUDE_CODE_OAUTH_TOKEN
    添加到仓库密钥中
  • 如果使用AWS Bedrock或Google Vertex AI,请相应调整认证部分
  • 插件市场URL使用HTTPS Git格式:
    https://github.com/laurigates/claude-plugins.git
  • 插件引用格式为
    <plugin-name>@laurigates-claude-plugins
    (来自marketplace.json的市场名称)

See Also

另请参见

  • /configure:workflows
    - General GitHub Actions workflow configuration
  • /configure:all
    - Run all compliance checks
  • claude-security-settings
    skill - Claude Code security settings
  • /configure:workflows
    - 通用GitHub Actions工作流配置
  • /configure:all
    - 运行所有合规性检查
  • claude-security-settings
    技能 - Claude Code安全设置