kafka

kafka is a skill for Claude Code, Codex from navikt/copilot. It costs 26 tokens per session (2,288 once invoked), scanned A, original, MIT.

A guide to Kafka-based event systems using Nav's Rapids & Rivers framework. Kafka is a system that lets applications publish events and react to events from other applications; a River is a consumer that reads and handles those events.

In plain words
What is it for?
Use it to configure Kafka in Nais, build event producers and consumers, design event schemas, test consumers with TestRapid, and investigate Kafka credentials, connectivity, or consumer delays.
Why use it?
It helps teams set up event communication correctly and investigate connection problems or delayed event processing. It also provides patterns for keeping event data structured and testable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to configure Kafka in Nais, build event producers and consumers, design event schemas, test consumers with TestRapid, and investigate Kafka credentials, connectivity, or consumer delays.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/navikt/copilot/kafka
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add navikt/copilot --skill kafka
Clone the repo
git clone --depth 1 https://github.com/navikt/copilot

Made for: Claude Code, Codex.

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 kafka

README.md
[![agentmods](https://agentmods.dev/badge/skills/navikt/copilot/kafka/github.svg)](https://agentmods.dev/skills/navikt/copilot/kafka)
Your own site
<a href="https://agentmods.dev/skills/navikt/copilot/kafka"><img src="https://agentmods.dev/badge/skills/navikt/copilot/kafka/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 kafka

Your own site · 80×15
<a href="https://agentmods.dev/skills/navikt/copilot/kafka"><img src="https://agentmods.dev/badge/skills/navikt/copilot/kafka.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,288 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00026 $0.02288
Opus 5 $0.00013 $0.01144
Sonnet 5 $0.00005 $0.00458
Haiku 4.5 $0.00003 $0.00229

Measured 9d ago against content hash 17ebbc88c85f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

kafka 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 9d 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.

skills/kafka/SKILL.md · 332 lines

How it starts

The opening of the file, as written. The whole thing — 332 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Kafka & Rapids & Rivers Skill

Patterns, templates, and procedures for building event-driven systems with Kafka on Nais. Covers Rapids & Rivers framework, event schema design, and consumer/producer patterns.

When to Use

  • Setting up Kafka in a Nais application
  • Implementing a Rapids & Rivers consumer (River)
  • Designing event schemas
  • Testing event-driven code with TestRapid
  • Troubleshooting Kafka connectivity or consumer lag

Commands

# Check Kafka env vars are present (names only, not values)
kubectl exec -it <pod> -n <namespace> -- env | grep -o '^KAFKA[^=]*'

# Verify Kafka credentials are mounted
kubectl exec -it <pod> -n <namespace> -- ls -la /var/run/secrets/nais.io/kafka/

# View pod logs for Kafka events
kubectl logs -n <namespace> <pod> --tail=50 | grep -i "event\|kafka\|river"

Setting Up Kafka

Nais Manifest

apiVersion: nais.io/v1alpha1
kind: Application
metadata:
  name: my-app
spec:
  kafka:
    pool: nav-dev # or nav-prod

This automatically:

  • Creates Kafka credentials
  • Mounts credentials in /var/run/secrets/nais.io/kafka/
  • Provides environment variables

Configuration

// Environment variables automatically set by Nais
val kafkaConfig = mapOf(
    "KAFKA_BROKERS" to System.getenv("KAFKA_BROKERS"),
    "KAFKA_TRUSTSTORE_PATH" to System.getenv("KAFKA_TRUSTSTORE_PATH"),
    "KAFKA_CREDSTORE_PASSWORD" to System.getenv("KAFKA_CREDSTORE_PASSWORD"),
    "KAFKA_KEYSTORE_PATH" to System.getenv("KAFKA_KEYSTORE_PATH"),
    "KAFKA_CONSUMER_GROUP_ID" to "my-app-v1",
    "KAFKA_RAPID_TOPIC" to "teamname.rapid-v1"
)

Rapids & Rivers

Core Concepts

  • Rapid: The Kafka topic where all events flow
  • River: A consumer that listens to specific event types
  • Need: A request for data/action
  • Demand: Required fields in an event
  • Require: Required values in an event
  • Reject: Conditions that exclude an event
  • Interested In: Optional fields to capture

Application Setup

Read the full file on GitHub · 332 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 332 lines · 26 tokens per session scan A 17ebbc88c85f

Subscribe to this mod's changes

kafka is a skill published in the GitHub repository navikt/copilot (54 stars, last pushed today), licensed MIT. It adds 26 tokens to every session and 2,288 once invoked, about $0.0001 per session on Opus 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.