kubectl.nvim: Agent for Claude Code

.claude/agents/keymappings.md

keymappings is an agent for Claude Code from Ramilito/kubectl.nvim. It costs 28 tokens per session (734 once invoked), scanned A, original, Apache-2.0.

A specialist guide for adding, changing, or removing keyboard shortcuts in a Lua-based application. It explains where global, resource-specific, and view-specific mappings belong.

In plain words
What is it for?
Use it when implementing keybindings, changing existing shortcuts, or finding how shortcuts are defined for a resource or view.
Why use it?
It reduces the risk of putting a shortcut in the wrong file or registering it incorrectly. It also covers the related help text shown in views.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions subagents.

This is Ramilito/kubectl.nvim's own configuration. It tells Claude Code how to work on kubectl.nvim itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kubectl.nvim configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Ramilito/kubectl.nvim. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Ramilito/kubectl.nvim/main/.claude/agents/keymappings.md
Clone the repo
git clone --depth 1 https://github.com/Ramilito/kubectl.nvim

Made for: Claude Code.

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 keymappings

README.md
[![agentmods](https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/keymappings.svg)](https://agentmods.dev/agents/ramilito/kubectl.nvim/keymappings)
Your own site
<a href="https://agentmods.dev/agents/ramilito/kubectl.nvim/keymappings"><img src="https://agentmods.dev/badge/agents/ramilito/kubectl.nvim/keymappings.svg" alt="Measured on agentmods" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 734 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00028 $0.00734
Opus 5 $0.00014 $0.00367
Sonnet 5 $0.00006 $0.00147
Haiku 4.5 $0.00003 $0.00073

Measured yesterday against content hash 8c5b83f3edff, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

keymappings 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 yesterday.

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.

.claude/agents/keymappings.md · 102 lines

How it starts

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

Keymappings Guidance

ALWAYS use this subagent for ANY task involving:

  • Adding new keybindings to a view or resource
  • Modifying existing keybindings
  • Understanding how keybindings work in this codebase

File Map

File Purpose
lua/kubectl/mappings.lua Global mappings, map_if_plug_not_set(), register()
lua/kubectl/resources/<name>/mappings.lua Resource-specific overrides
lua/kubectl/views/<name>/mappings.lua View-specific overrides
lua/kubectl/views/<name>/init.lua View definition with hints array

Pattern: Adding a Keybinding

Step 1: Define the Plug mapping in mappings.lua

M.overrides = {
  ["<Plug>(kubectl.my_action)"] = {
    desc = "short description",  -- Used in help view
    callback = function()
      -- Implementation
    end,
  },
}

Step 2: Register the key in M.register()

M.register = function()
  mappings.map_if_plug_not_set("n", "gX", "<Plug>(kubectl.my_action)")
end

Step 3: Add hint in view's init.lua

M.definition = {
  hints = {
    { key = "<Plug>(kubectl.my_action)", desc = "my action" },
  },
}

Key Rules

  1. Always use <Plug>(kubectl.*) format - Never map raw keys directly in overrides
  2. Use mappings.map_if_plug_not_set() - Respects user customizations
  3. Hints reference <Plug> keys - System resolves to actual keys automatically
  4. Short descriptions - desc in overrides should be 2-4 words

Common Key Conventions

Prefix Purpose Examples
g Go/Get actions gd describe, gy yaml, gl logs
<C-> Views/Navigation <C-n> namespace, <C-f> filter
<cr> Select/Enter Primary action
1-6 Quick view switch Deployments, Pods, etc.

Example: Complete Mapping File

local mappings = require("kubectl.mappings")
local M = {}

M.overrides = {
  ["<Plug>(kubectl.my_action)"] = {
    desc = "do something",
    callback = function()
      local view = require("kubectl.views.myview")
      -- implementation
    end,
  },
}

M.register = function()
  mappings.map_if_plug_not_set("n", "gX", "<Plug>(kubectl.my_action)")
end

return M

Read the full file on GitHub · 102 lines

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. yesterday First seen · 102 lines · 28 tokens per session scan A 8c5b83f3edff

Subscribe to this mod's changes

keymappings is an agent published in the GitHub repository Ramilito/kubectl.nvim (537 stars, last pushed 22d ago), licensed Apache-2.0. It adds 28 tokens to every session and 734 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-09-04.

Related

Other agents, from other repositories

launch-captain

Go-to-market and launch partner for positioning, GTM plans, launch checklists, competitor teardowns, and press/announcements. Use to position a product, plan a launch, or analyse a competitor.

mohitagw15856/pm-claude-skills · 48 tokens

golang-code-writer

Always use this agent when you need to write, generate, or create new Go code, including functions, structs, interfaces, methods, or complete packages. Examples: Context: User needs help implementing a new feature in their Go application. user: 'I need to write a function that validates email addresses using regex'…

stacklok/toolhive-registry-server · 0 tokens

unit-test-writer

Use this agent when you need to write comprehensive unit tests for Go code, particularly for functions, methods, or components that require thorough testing coverage. Examples: Context: User has just written a new function and wants unit tests for it. user: 'I just wrote this function to validate email addresses, can…

stacklok/toolhive-registry-server · 0 tokens

spring-boot-engineer

Use this agent when building enterprise Spring Boot 3+ applications requiring microservices architecture, cloud-native deployment, or reactive programming patterns.

piomin/claude-ai-spring-boot · 32 tokens

Geoprocessing Specialist

ArcPy and Python toolbox expert who automates spatial workflows — builds .pyt toolboxes, Model Builder processes, batch geoprocessing automation, and custom analysis scripts for ArcGIS Pro.

criptogus/agent-evolve-network · 45 tokens

python-developer

Write clean, efficient Python code following PEP standards. Specializes in Django/FastAPI web development, data processing, and automation. Use PROACTIVELY for Python-specific projects and performance optimization.

sonomirco/agents-and-commands · 44 tokens