원클릭으로
add-rule
Captures a team convention or best practice and adds it to the appropriate .claude/rules/ or .claude/agents/ file
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Captures a team convention or best practice and adds it to the appropriate .claude/rules/ or .claude/agents/ file
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Guide for using ToolHive CLI (thv) to run and manage MCP servers and skills. Use when running, listing, stopping, building, or configuring MCP servers locally. Covers server lifecycle, registry browsing, secrets management, client registration, groups, container builds, exports, permissions, network isolation, authentication, and skill management (install, uninstall, list, info, build, push, validate). NOT for Kubernetes operator usage or ToolHive development/contributing.
Validates operator chart contribution practices (helm template, ct lint, docs generation) before committing changes.
Creates ToolHive release PRs by analyzing commits since the last release, categorizing changes, recommending semantic version bump type (major/minor/patch), and triggering the release workflow. Use when cutting a release, preparing a new version, checking what changed since last release, or when the user mentions "release", "version bump", or "cut a release".
Implements a GitHub user story from planning through PR creation, with research, codebase analysis, and structured commits.
Generates polished GitHub release notes for a ToolHive release by analyzing every merged PR, cross-referencing linked issues, dispatching expert agents to assess breaking changes, and producing a formatted release body. Use when the user provides a GitHub release URL, tag name, or says "release notes".
Finds flaky tests on the main branch by analyzing GitHub Actions failures, ranks them by frequency, and enters parallel plan mode to design deflake strategies. Use when you want to find and fix the flakiest tests.
| name | add-rule |
| description | Captures a team convention or best practice and adds it to the appropriate .claude/rules/ or .claude/agents/ file |
Formalize a convention, best practice, or correction into the project's .claude/rules/ or .claude/agents/ files so it applies automatically for all team members.
The user provides a convention in natural language. Examples:
/add-rule "prefer require.NoError over t.Fatal for error assertions"/add-rule "use context.Background() in tests, not context.TODO()"/add-rule "CLI commands must support --format json"If no argument is provided, ask: "What convention would you like to add?"
Parse the user's input to identify:
Rules vs Agents — key principle: Rules define conventions; agents reference rules. Never duplicate rule content in agent files.
.claude/rules/): Auto-loaded based on paths: frontmatter globs when Claude touches matching files. These define the canonical conventions (style, testing patterns, error handling, etc.)..claude/agents/): Define agent-specific behavior — persona, review checklist, output format, workflow steps. Agents inherit the full conversation context (including CLAUDE.md), so they already have access to all loaded rules. Agent files should reference rules (e.g., "Follows conventions in .claude/rules/testing.md"), never restate them.Match the convention to an existing file based on scope:
| Scope | Target file | What goes here |
|---|---|---|
| General Go code | .claude/rules/go-style.md | Style, naming, error handling conventions |
| Test files | .claude/rules/testing.md | Testing patterns, framework usage |
| CLI commands | .claude/rules/cli-commands.md | CLI architecture, flag conventions |
| Kubernetes operator | .claude/rules/operator.md | CRD, controller conventions |
| PR creation | .claude/rules/pr-creation.md | PR format, review expectations |
| Agent workflow/persona | .claude/agents/<agent-name>.md | Agent-specific behavior, checklists, output format |
If no existing file fits, propose creating a new rule file with appropriate paths: frontmatter. New rule files need a glob pattern that determines when they auto-load.
If the convention is about code (how to write Go, test patterns, error handling), it belongs in a rules file — even if it's most relevant to a specific agent. The agent can reference the rule.
Read the target file and draft the new content:
Format examples:
Simple rule:
- Use `context.Background()` in tests, not `context.TODO()` — tests have no caller to propagate cancellation from
Rule with example:
## Prefer Table-Driven Tests
Use table-driven tests over repeated test functions:
` ``go
// Good
tests := []struct{ name string; input int; want int }{...}
// Avoid: separate TestFoo1, TestFoo2, TestFoo3 functions
` ``
Show the user:
.claude/rules/testing.md? (y/n)"Use the Edit tool to add the rule to the target file. After applying:
~/.claude/ memory instead."