CLAUDE.md
CLAUDE.mdCLAUDE.mdroot
Quality
100/100
Scores the file, not the repository.Length
731 words
14 headings · 1 code blocksRepository
2.0k
— · pushed 0 days agoLast changed
3 days ago
First indexed 3 days ago.1# CLAUDE.md23This file provides guidance to Claude Code when working with this repository.45## Project Overview67ToolHive is a lightweight, secure manager for MCP (Model Context Protocol: https://modelcontextprotocol.io) servers written in Go. It provides a CLI (`thv`), a Kubernetes operator (`thv-operator`), and a proxy runner (`thv-proxyrunner`) for container-based MCP server isolation.89**To understand the system, start with the [Architecture Documentation](docs/arch/README.md).** Begin at the [Architecture Overview](docs/arch/00-overview.md) and [Core Concepts](docs/arch/02-core-concepts.md), then read the component deep-dives relevant to your task — [Deployment Modes](docs/arch/01-deployment-modes.md), [Transport Architecture](docs/arch/03-transport-architecture.md), [Kubernetes Operator](docs/arch/09-operator-architecture.md), [Virtual MCP](docs/arch/10-virtual-mcp-architecture.md), and more. The [architecture index](docs/arch/README.md) has a full map and by-topic navigation.1011## Build and Development Commands1213```bash14task build # Build the main binary15task install # Install binary to GOPATH/bin16task lint # Run linting17task lint-fix # Fix linting issues (preferred over lint)18task test # Unit tests (excluding e2e)19task test-e2e # E2E tests (requires build first)20task test-all # All tests (unit + e2e)21task test-coverage # Tests with coverage analysis22task gen # Generate mocks23task docs # Generate CLI documentation24task build-image # Build container image25task build-all-images # Build all container images26```2728**IMPORTANT**: Always use `task` commands. Never run `go test`, `go build`, or `golangci-lint` directly -- the Taskfile has correct flags, exclusions, and environment setup that direct commands miss.2930**Testing**: Ginkgo/Gomega for BDD-style tests. Unit tests for `pkg/` business logic; E2E tests for CLI commands.3132## Available Subagents3334Agents are in `.claude/agents/` and MUST be invoked for tasks matching their expertise:3536### Core Development37- **toolhive-expert**: Architecture, codebase navigation, implementation guidance38- **golang-code-writer**: Writing new Go code (functions, structs, interfaces, packages)39- **unit-test-writer**: Writing comprehensive unit tests40- **code-reviewer**: Code review for best practices, security, conventions41- **tech-lead-orchestrator**: Architectural oversight, task delegation, complex features4243### Specialized Domains44- **kubernetes-expert**: Operator patterns, CRDs, controllers, cloud-native architecture45- **mcp-protocol-expert**: MCP spec compliance, transport protocols, JSON-RPC46- **oauth-expert**: OAuth 2.0, OIDC, token exchange, authentication flows47- **site-reliability-engineer**: Observability, OpenTelemetry, monitoring4849### Support50- **documentation-writer**: Documentation updates, CLI docs51- **security-advisor**: Security guidance, code review, threat modeling5253### When to Use Subagents54- Writing new code: golang-code-writer55- Creating tests: unit-test-writer56- Orchestrating multi-component work: tech-lead-orchestrator57- Reviewing code: code-reviewer58- Domain expertise: kubernetes-expert, oauth-expert, mcp-protocol-expert, site-reliability-engineer5960## Key Conventions6162Detailed rules are in `.claude/rules/` (loaded automatically when matching files are read):63- **Go style, errors, logging, SPDX headers**: `.claude/rules/go-style.md`64- **CLI architecture**: `.claude/rules/cli-commands.md`65- **Testing**: `.claude/rules/testing.md`66- **Operator/CRDs**: `.claude/rules/operator.md`67- **PR creation**: `.claude/rules/pr-creation.md`6869**Plan review**: Before presenting an implementation plan, review all applicable `.claude/rules/` files for the languages and components involved. Plans must conform to existing conventions.7071## Commit Guidelines7273- Imperative mood, capitalize subject, no trailing period74- 50-char subject line limit75- Explain what and why, not how76- Do NOT use Conventional Commits (`feat:`, `fix:`, `chore:`, etc.)77- See `CONTRIBUTING.md` for full guidelines7879## Pull Request Guidelines8081- Follow `.claude/rules/pr-creation.md` and `.github/pull_request_template.md`82- Max **400 lines** of code changes, **10 files** changed (excluding tests/docs/generated)83- Each PR = one logical change (one feature, one bug fix, or one refactoring)84- If changes exceed limits, use `/split-pr` skill to propose a split strategy85- Large PRs acceptable for: generated code, dependency updates, docs-only, test-only changes (with user confirmation)8687## Architecture Documentation8889When making changes that affect architecture, update relevant docs in `docs/arch/`. See the [architecture documentation index](docs/arch/README.md) for structure and the per-component documents.9091## Things That Will Bite You9293- Running `go test ./...` or `golangci-lint run` directly skips Taskfile configuration (exclusions, flags, formatting). Always use `task test`, `task lint-fix`, etc.94- After modifying API handlers or CLI commands, run `task docs` to regenerate CLI documentation.9596## Evolving Conventions9798When a developer states a preference, convention, or correction during conversation (e.g., "we should use X instead of Y", "don't do Z", "always prefer A over B"), you MUST:991001. **Apply it immediately** in the current conversation1012. **Suggest codifying it** — identify which `.claude/rules/` file or `.claude/agents/` file it belongs in and propose the edit1023. **Offer to apply** with a one-line confirmation (e.g., "Want me to add this to `.claude/rules/go-style.md`?")103104Use the `/add-rule` skill to formalize conventions. This ensures tribal knowledge gets captured in version-controlled config, not lost in chat history.105106**Personal vs team conventions**: Personal preferences (e.g., "I like verbose output") belong in `~/.claude/` personal memory. Team-wide conventions (e.g., "always use `errors.Is()` for error checks") belong in `.claude/rules/` so all team members benefit.107
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| dotCMS/corecore-web/CLAUDE.md · 950 | CLAUDE.md | teststylearchtesting-strategy+3 | 100/100 | 3 days ago | |
| Adit-Jain-srm/NightmareNetCLAUDE.md · 45 | CLAUDE.md | buildtestlint-formatstyle+6 | 100/100 | 3 days ago | |
| microsoft/playwrightCLAUDE.md · 94k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| nimbalyst/nimbalystpackages/android/CLAUDE.md · 1.4k | CLAUDE.md | setupbuildstylearch+2 | 100/100 | 3 days ago | |
| filamentphp/filamentCLAUDE.md · 32k | CLAUDE.md | buildtestlint-formatstyle+7 | 100/100 | 3 days ago | |
| bagisto/bagistoCLAUDE.md · 28k | CLAUDE.md | setupbuildteststyle+5 | 100/100 | 3 days ago | |
| livewire/livewireCLAUDE.md · 24k | CLAUDE.md | setupbuildteststyle+4 | 100/100 | 3 days ago | |
| dotCMS/coreCLAUDE.md · 950 | CLAUDE.md | setupbuildteststyle+7 | 99/100 | 3 days ago |
