关于 configure-select
configure-select 是用于交互式选择基础设施标准检查项的技能,适合希望按需配置项目组件的团队。它会根据项目类型提供分类选项,并将选择映射到对应的配置命令。
主要功能
- 01检测项目类型
- 02交互式选择配置组件
- 03映射选择到配置命令
- 04支持仅检查与自动修复
适用场景
- 01只配置项目所需的标准
- 02分阶段设置基础设施组件
- 03仅审计所选组件或自动应用修复
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ laurigates/ claude-plugins --skill configure-select安装后在 Claude Code 中输入/configure-select确认已加载。
详细介绍
/configure:select
交互式选择要运行的基础设施标准检查。
何时使用此技能
| 在以下情况下使用此技能…… | 在以下情况下采用其他方式…… |
|---|---|
| 以交互方式设置所选组件 | 运行所有组件(使用 /configure:all) |
| 选择要实施的特定标准 | 仅检查状态(使用 /configure:status) |
| 自定义项目的配置范围 | 只需单个组件(使用特定的 /configure:X 技能) |
| 用户希望控制要配置的组件 | 更倾向于自动完成完整设置 |
| 逐步构建配置 | 需要立即完成基础设施设置 |
上下文
- 项目标准:!
find . -maxdepth 1 -name \'.project-standards.yaml' - 项目类型:!
find . -maxdepth 1 -name '.project-standards.yaml' -exec grep -m1 "^project_type:" {} + - 是否有 terraform:!
find . -maxdepth 2 \( -name '*.tf' -o -type d -name 'terraform' \) -print -quit - 是否有 package.json:!
find . -maxdepth 1 -name \'package.json' - 是否有 pyproject.toml:!
find . -maxdepth 1 -name \'pyproject.toml' - 是否有 Cargo.toml:!
find . -maxdepth 1 -name \'Cargo.toml'
参数
从 $ARGUMENTS 解析:
--check-only:报告状态,不提供修复方案(CI/CD 模式)--fix:自动为所有选定组件应用修复
执行
执行以下交互式组件选择流程:
步骤 1:检测项目类型
- 如果
.project-standards.yaml存在,则读取它(检查project_type字段) - 根据文件结构自动检测:
- infrastructure:包含
terraform/、helm/、argocd/或*.tf文件 - frontend:包含带有 vue/react 依赖项的
package.json - python:包含
pyproject.toml或requirements.txt - rust:包含
Cargo.toml
- infrastructure:包含
- 向用户报告检测到的类型
步骤 2:呈现组件选项
使用 AskUserQuestion 和 multiSelect,按类别呈现四个问题:
问题 1:CI/CD 和版本控制
| 选项 | 描述 |
|---|---|
| Pre-commit 钩子 | 用于代码检查、格式化和提交消息的 Git 钩子 |
| 发布自动化 | release-please 工作流和变更日志生成 |
| GitHub Actions | 用于测试和部署的 CI/CD 工作流 |
| 所有 CI/CD | 包含:pre-commit、release-please、workflows、github-pages、makefile |
问题 2:容器和部署
| 选项 | 描述 |
|---|---|
| Dockerfile | Alpine/slim 基础镜像、非 root 用户、多阶段构建 |
| 容器基础设施 | 注册表、扫描、devcontainer 设置 |
| Skaffold | Kubernetes 开发配置 |
| 所有容器 | 包含:dockerfile、container、skaffold、sentry、justfile |
问题 3:测试
| 选项 | 描述 |
|---|---|
| 测试框架 | Vitest、Jest、pytest 或 cargo-nextest 设置 |
| 代码覆盖率 | 覆盖率阈值和报告 |
| API 测试 | Pact 契约、OpenAPI 验证 |
| 所有测试 | 包含:tests、coverage、api-tests、integration-tests、load-tests、ux-testing、memory-profiling |
问题 4:代码质量
| 选项 | 描述 |
|---|---|
| 代码检查和格式化 | Biome、Ruff、Clippy 配置 |
| 安全扫描 | 依赖项审计、SAST、密钥检测 |
| 文档 | TSDoc、JSDoc、pydoc、rustdoc 生成器 |
| 所有质量检查 | 包含:linting、formatting、dead-code、docs、security、editor、package-management |
步骤 3:将选择映射到命令
| 选择 | 命令 |
|---|---|
| 预提交钩子 | /configure:pre-commit |
| 发布自动化 | /configure:release-please |
| GitHub Actions | /configure:workflows |
| 所有 CI/CD | pre-commit, release-please, workflows, github-pages, makefile |
| Dockerfile | /configure:dockerfile |
| 容器基础设施 | /configure:container |
| Skaffold | /configure:skaffold |
| 所有容器 | dockerfile, container, skaffold, sentry, justfile |
| 测试框架 | /configure:tests |
| 代码覆盖率 | /configure:coverage |
| API 测试 | /configure:api-tests |
| 所有测试 | tests, coverage, api-tests, integration-tests, load-tests, ux-testing, memory-profiling |
| 代码检查与格式化 | /configure:linting、/configure:formatting |
| 安全扫描 | /configure:security |
| 文档 | /configure:docs |
| 所有质量检查 | linting, formatting, dead-code, docs, security, editor, package-management |
步骤 4:执行所选检查
使用适当的标志运行每个所选命令:
- 默认:先使用
--check-only运行,然后提供--fix - 如果指定
--check-only标志:仅审计,不提供修复 - 如果指定
--fix标志:自动应用修复
每项检查完成后,报告其结果。
步骤 5:生成摘要报告
仅打印所选组件的摘要:
Selected Components Summary:
+-----------------+----------+---------------------------------+
| Component | Status | Notes |
+-----------------+----------+---------------------------------+
| Pre-commit | WARN | 2 outdated hooks |
| Linting | PASS | Biome configured |
| Formatting | PASS | Biome configured |
+-----------------+----------+---------------------------------+
Agentic 优化
| 上下文 | 命令 |
|---|---|
| 交互式选择组件 | /configure:select |
| 选择并自动修复 | /configure:select --fix |
| 仅检查模式 | /configure:select --check-only |
| 检测项目类型 | test -f .project-standards.yaml && grep "^project_type:" .project-standards.yaml | sed 's/.*:[[:space:]]*//' |
标志
| 标志 | 说明 |
|---|---|
--check-only | 报告状态,不提供修复 |
--fix | 自动对所有所选组件应用修复 |
与其他命令的比较
| 命令 | 使用场景 |
|---|---|
/configure:all | 运行所有内容(CI、完整审计) |
/configure:select | 以交互方式选择特定组件 |
/configure:status | 快速只读概览 |
/configure:<component> | 仅运行单个组件 |
另请参阅
/configure:all- 运行所有检查/configure:status- 只读状态概览
评论
支持 Markdown