project

project is a cursor rule for Cursor from themoah/klag. It costs 561 tokens per session, scanned A, original, Apache-2.0.

Project-specific instructions for Klag, a Java service that monitors Kafka consumer lag and exports monitoring data. They describe its build commands, source layout, runtime requirements, tests, and native-image setup.

In plain words
What is it for?
Use them when compiling, testing, running, packaging, or navigating the Klag codebase, including its Kafka, metrics, Helm, and end-to-end test areas.
Why use it?
They give a coding agent the project context and commands needed to make changes consistently.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/. Also seen: mentions CLAUDE.md.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/test-helm-chart.sh # Helm template tests (offline).

Good fit Use them when compiling, testing, running, packaging, or navigating the Klag codebase, including its Kafka, metrics, Helm, and end-to-end test areas.

Compare 6 cursor rules from other repositories ↓
View source ↗ themoah/klag
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/themoah/klag
agentmods
npx agentmods add rules/themoah/klag/project

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for project

README.md
[![agentmods](https://agentmods.dev/badge/rules/themoah/klag/project/github.svg)](https://agentmods.dev/rules/themoah/klag/project)
Your own site
<a href="https://agentmods.dev/rules/themoah/klag/project"><img src="https://agentmods.dev/badge/rules/themoah/klag/project/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for project

Your own site · 80×15
<a href="https://agentmods.dev/rules/themoah/klag/project"><img src="https://agentmods.dev/badge/rules/themoah/klag/project.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 561 This file is loaded in full into every session.
When invoked 561 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00561 $0.00561
Opus 5.5 $0.00224 $0.00224
Sonnet 5.5 $0.00112 $0.00112
Haiku 4.5 $0.00056 $0.00056

Measured 1mo ago against content hash d692d072254f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

project scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/project.mdc · 60 lines

What it actually says

Klag

Kafka consumer lag exporter (Vert.x 4.5.34, Java 21). Monitors lag, velocity, hot partitions, time-based lag, commit freshness, ISR, topic data skew, and group state. Exports to Prometheus, Datadog, or OTLP.

Build

# Java 21 — sdk use java 21.0.9-tem
./gradlew compileJava   # compile
./gradlew test          # unit tests
./gradlew assemble      # fat JAR
./gradlew run           # hot-reload dev

./scripts/test-helm-chart.sh    # Helm template tests (offline)
./scripts/e2e-test.sh           # k3d + real Kafka e2e
./scripts/e2e-strimzi-test.sh   # Strimzi/KRaft e2e

CI uses gradle directly (wrapper JAR is not committed). Local dev uses ./gradlew.

Native image: GraalVM JDK 21 + gradle nativeCompile → build/native/nativeCompile/klag. Entry point is KlagLauncher (no reflective Vert.x launcher).

Layout

src/main/java/io/github/themoah/klag/
├── MainVerticle.java       # HTTP router, lifecycle
├── config/                 # AppConfig, Env
├── health/                 # probes, version
├── kafka/                  # KafkaClientService[Impl]
├── metrics/                # collector, reporter, velocity/hotpartition/timelag/dataskew
├── mcp/                    # read-only MCP snapshot tools
└── model/                  # Java 21 records

HTTP endpoints

Path Purpose
/healthz Liveness (always 200)
/readyz Readiness (200 if Kafka up)
/metrics Prometheus scrape
/version Build info
/mcp MCP JSON-RPC (if MCP_ENABLED=true)

Code style

  • Async APIs return Future<T>; use Java 21 records for DTOs
  • SLF4J + Logback; no stdout from application code
  • Config precedence: classpath application.properties → KLAG_CONFIG_FILE → env vars
  • Bump version in build.gradle.kts after minor/major changes
  • Minimize diff scope; match existing patterns; no drive-by refactors

Full env var and metric reference: CLAUDE.md.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed d692d072254f
  2. 1mo ago Changed · +7 tokens per session aff7f11af690
  3. 1mo ago First seen · 60 lines · 554 tokens per session scan A 17cdd078d011

Subscribe to this mod's changes

project is a cursor rule published in the GitHub repository themoah/klag (88 stars, last pushed 5d ago), licensed Apache-2.0. It adds 561 tokens to every session, about $0.0022 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.