Skip to content

docs: Add CLAUDE.md#219

Open
bkieling wants to merge 1 commit intomainfrom
task/add-claude
Open

docs: Add CLAUDE.md#219
bkieling wants to merge 1 commit intomainfrom
task/add-claude

Conversation

@bkieling
Copy link
Copy Markdown
Contributor

@bkieling bkieling commented Mar 23, 2026

Summary by CodeRabbit

  • Documentation
    • Added repository guidance documentation covering project structure and module context, available development commands and tools, entry-point binaries and their responsibilities, internal package organization, infrastructure components, error handling patterns, testing conventions and locations, and standardized practices for version control, imports, linting, logging, and configuration management.

@bkieling bkieling self-assigned this Mar 23, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 23, 2026

📝 Walkthrough

Walkthrough

A new documentation file CLAUDE.md has been added to provide module context and guidance for Claude Code users working with the Go microservice. The document includes build/test commands, architectural reference material, infrastructure details, and repository conventions.

Changes

Cohort / File(s) Summary
Documentation
CLAUDE.md
New guidance document for Claude Code defining module context, standardized command mappings, architectural reference material (service entry-points and internal packages), infrastructure references, error handling approach, testing conventions, and repository conventions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A document unfurls, so clear and bright,
With guidance mapped to Claude's delight,
Build, test, and lint—the commands align,
Architectural wisdom in every line!
Hops away happily 🌟

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided. The description template requires at least 'What this PR does / why we need it' section to be filled. Add a description explaining the purpose of CLAUDE.md, its intended audience (Claude Code users), and key sections it covers (build commands, architecture, testing, conventions).
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'docs: Add CLAUDE.md' clearly and specifically describes the main change: adding documentation for Claude Code integration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch task/add-claude

Comment @coderabbitai help to get the list of available commands and usage tips.

@bkieling bkieling changed the title chore: Add CLAUDE.md docs: Add CLAUDE.md Mar 23, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CLAUDE.md`:
- Around line 14-59: The README/CLAUDE.md lists six Makefile targets that don't
exist: build-tenant-cli, create-empty-secrets, generate-signing-keys,
go-imports-changed, provision-tenants-locally, and start-cmk; update the doc to
match the Makefile by either removing these entries or adding corresponding
rules to the Makefile (implement targets with appropriate recipes and comments),
and ensure targets like go-imports and codegen (api=cmk) remain accurate; verify
by running make <target> for each listed target and updating CLAUDE.md to
reflect the final set of supported targets.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 89489855-8661-4a0d-aa80-b6f1a5ebef16

📥 Commits

Reviewing files that changed from the base of the PR and between 12d6a32 and 573fd23.

📒 Files selected for processing (1)
  • CLAUDE.md

Comment on lines +14 to +59
```bash
# Run unit tests (uses gotestsum, clears cache, produces coverage)
make test

# Run integration tests (spins up containers for PostgreSQL, Redis, RabbitMQ)
make integration_test

# Run linter (golangci-lint v2 with --fix)
make lint

# Format all Go files (gofmt + goimports + golines + gci)
make go-imports

# Format only changed files
make go-imports-changed

# Generate OpenAPI server code from spec
make codegen api=cmk

# Run the API server locally
make run

# Run benchmarks
make benchmark

# Full local K3d cluster setup (PostgreSQL, Redis, RabbitMQ, OTEL, CMK)
make start-cmk

# Build dev Docker image
make docker-dev-build

# Generate signing keys for local testing
make generate-signing-keys

# Create empty secret files from blueprints
make create-empty-secrets

# Build tenant-manager CLI locally
make build-tenant-cli

# Provision test tenants locally
make provision-tenants-locally

# Tidy Go modules
make tidy
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find CLAUDE.md and Makefile(s)
CLAUDE_FILE="$(fd -HI '^CLAUDE\.md$' -t f | head -n1)"
if [[ -z "${CLAUDE_FILE:-}" ]]; then
  echo "CLAUDE.md not found"; exit 1
fi

echo "Using CLAUDE file: $CLAUDE_FILE"
echo

# Extract make targets referenced in the command section
echo "Documented make targets:"
TARGETS=$(awk '
  /## Build & Development Commands/{inblk=1}
  inblk && /^```bash/{code=1; next}
  code && /^```/{exit}
  code && $1=="make"{print $2}
' "$CLAUDE_FILE" | sort -u)

printf '%s\n' "$TARGETS"
echo

# Collect declared targets from all Makefiles
echo "Discovered Makefile targets:"
MAKEFILES="$(fd -HI '(^|/)Makefile$' -t f)"
if [[ -z "${MAKEFILES:-}" ]]; then
  echo "No Makefile found"; exit 1
fi

DECLARED=$(for mf in $MAKEFILES; do
  awk -F: '
    /^[A-Za-z0-9_.-]+:[^=]/ {
      if ($1 !~ /^\./) print $1
    }
  ' "$mf"
done | sort -u)

printf '%s\n' "$DECLARED"
echo

echo "Missing documented targets:"
comm -23 <(printf '%s\n' "$TARGETS" | sort -u) <(printf '%s\n' "$DECLARED" | sort -u) || true

Repository: openkcm/cmk

Length of output: 694


🏁 Script executed:

fd -HI '^Makefile$' -t f

Repository: openkcm/cmk

Length of output: 63


🏁 Script executed:

cat -n Makefile | head -100

Repository: openkcm/cmk

Length of output: 4053


Remove or implement the 6 undocumented make targets before merging.

This documentation block references targets that do not exist in the Makefile: build-tenant-cli, create-empty-secrets, generate-signing-keys, go-imports-changed, provision-tenants-locally, and start-cmk. Remove these entries or add the targets to the Makefile. Mismatches will break onboarding and CI debugging workflows.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` around lines 14 - 59, The README/CLAUDE.md lists six Makefile
targets that don't exist: build-tenant-cli, create-empty-secrets,
generate-signing-keys, go-imports-changed, provision-tenants-locally, and
start-cmk; update the doc to match the Makefile by either removing these entries
or adding corresponding rules to the Makefile (implement targets with
appropriate recipes and comments), and ensure targets like go-imports and
codegen (api=cmk) remain accurate; verify by running make <target> for each
listed target and updating CLAUDE.md to reflect the final set of supported
targets.


- **Commits**: Conventional Commits (`feat:`, `fix:`, `docs:`, `chore:`, `ci:`, `build:`). Release-please automates versioning.
- **Import ordering** (gci): standard → default → `prefix(github.com/openkcm/cmk)` → blank → dot → alias → localmodule
- **Linting**: golangci-lint v2 with `default: all` minus disabled linters. JSON tags use `goCamel` case. Exhaustive switch requires `default` to count as exhaustive.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Config in .golangcilint


Errors are mapped per operation in `internal/apierrors/`. Each `ErrorMap` pairs internal error(s) with an HTTP status and error code. The system matches by most specific error chain. To add a new error:
1. Define error constant in `apierrors`
2. Add `ErrorMap` entry with matching error(s) and `DetailedError` (code, message, status)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note, for quite some commits now it's no longer DetailedError neither ErroMap. Now there is a generic ExposedErrors which expects a type. For API APIError where we set an internal error chain to match and exposed error. Might also be useful to provide the AI with the matching algorithm found on the generic implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants