Files
claude-code-rust/claude-code-main (2)/claude-code-main/plugins/hookify/commands/configure.md
T
Serendipity 1a1254f045
CI - 构建、测试和质量检查 / Rust 代码检查 (push) Has been cancelled
CI - 构建、测试和质量检查 / 单元测试 (push) Has been cancelled
CI - 构建、测试和质量检查 / 代码格式检查 (push) Has been cancelled
CI - 构建、测试和质量检查 / Clippy 代码质量检查 (push) Has been cancelled
CI - 构建、测试和质量检查 / 构建可执行文件 (claude_code_rs, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
CI - 构建、测试和质量检查 / 构建可执行文件 (claude_code_rs, ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
CI - 构建、测试和质量检查 / 构建可执行文件 (claude_code_rs.exe, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
feat: 添加初始项目结构和基础文件
- 添加 Rust GUI 桌面应用程序入口点
- 添加 TypeScript/JavaScript 项目基础结构文件
- 包含组件、工具、命令、服务和工具定义
- 添加配置文件如 .gitignore、.gitattributes 和 LICENSE
- 包含图片资源和演示文件
- 为各种功能模块添加占位符和类型定义
2026-04-20 16:58:22 +08:00

2.8 KiB

description, allowed-tools
description allowed-tools
Enable or disable hookify rules interactively
Glob
Read
Edit
AskUserQuestion
Skill

Configure Hookify Rules

Load hookify:writing-rules skill first to understand rule format.

Enable or disable existing hookify rules using an interactive interface.

Steps

1. Find Existing Rules

Use Glob tool to find all hookify rule files:

pattern: ".claude/hookify.*.local.md"

If no rules found, inform user:

No hookify rules configured yet. Use `/hookify` to create your first rule.

2. Read Current State

For each rule file:

  • Read the file
  • Extract name and enabled fields from frontmatter
  • Build list of rules with current state

3. Ask User Which Rules to Toggle

Use AskUserQuestion to let user select rules:

{
  "questions": [
    {
      "question": "Which rules would you like to enable or disable?",
      "header": "Configure",
      "multiSelect": true,
      "options": [
        {
          "label": "warn-dangerous-rm (currently enabled)",
          "description": "Warns about rm -rf commands"
        },
        {
          "label": "warn-console-log (currently disabled)",
          "description": "Warns about console.log in code"
        },
        {
          "label": "require-tests (currently enabled)",
          "description": "Requires tests before stopping"
        }
      ]
    }
  ]
}

Option format:

  • Label: {rule-name} (currently {enabled|disabled})
  • Description: Brief description from rule's message or pattern

4. Parse User Selection

For each selected rule:

  • Determine current state from label (enabled/disabled)
  • Toggle state: enabled → disabled, disabled → enabled

5. Update Rule Files

For each rule to toggle:

  • Use Read tool to read current content
  • Use Edit tool to change enabled: true to enabled: false (or vice versa)
  • Handle both with and without quotes

Edit pattern for enabling:

old_string: "enabled: false"
new_string: "enabled: true"

Edit pattern for disabling:

old_string: "enabled: true"
new_string: "enabled: false"

6. Confirm Changes

Show user what was changed:

## Hookify Rules Updated

**Enabled:**
- warn-console-log

**Disabled:**
- warn-dangerous-rm

**Unchanged:**
- require-tests

Changes apply immediately - no restart needed

Important Notes

  • Changes take effect immediately on next tool use
  • You can also manually edit .claude/hookify.*.local.md files
  • To permanently remove a rule, delete its .local.md file
  • Use /hookify:list to see all configured rules

Edge Cases

No rules to configure:

  • Show message about using /hookify to create rules first

User selects no rules:

  • Inform that no changes were made

File read/write errors:

  • Inform user of specific error
  • Suggest manual editing as fallback