adding-a-language

A coding guide for adding a programming language to Kivgraph, a code graph that tracks definitions, uses, and relationships between code elements.

In plain words
What is it for?
Use it when adding or extending language support, especially when deciding how definitions, uses, branches, and validation should work.
Why use it?
It explains decisions that must be made before language support is added and highlights checks that prevent silently incorrect graph data.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/luqueee/kivgraph/adding-a-language
Any agent
npx skills add Luqueee/kivgraph --skill adding-a-language
Clone the repo
git clone --depth 1 https://github.com/Luqueee/kivgraph

Made for: Claude Code, Codex.

Per session 90 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,626 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 $0.00090 $0.05626
Opus 5 $0.00045 $0.02813
Sonnet 5 $0.00018 $0.01125
Haiku 4.5 $0.00009 $0.00563

Measured 2d ago against content hash fda3f3181a22, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

adding-a-language 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 2d 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.

.claude/skills/adding-a-language/SKILL.md · 438 lines

How it starts

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

Adding a language to Kivgraph

The rule that costs the most to discover

internal/facts/semantic.go:483:

func definitionProvenance(language Language) Provenance {
	if language == LanguageDart {
		return DartAnalyzerDefinition
	}
	return PythonIndexerDefinition
}

That was the shape until Java arrived: two functions, both if Dart, else Python. A language added through the payload route and not added here published every definition as PYTHON_INDEXER_DEF and every use as PYTHON_INDEXER_USE. Nothing failed. The provenance is legal, canonicalProvenanceValues accepts it, stage.integrity passes with 0 invariant violations, the golden probes pass, doctor goes green. The graph is wrong in the one field that says where a fact came from, and nothing but reading it would have told you.

It is a table with no default now, and NormalizeSemantic refuses a payload whose language has no provenance. That check is not decoration: Set.Validate would not have caught it, because it only rejects an empty provenance under an EXACT confidence and DEFINES is StructuralCertain. Add your two constants, or your first test fails at the door.

The same shape repeated in the indexer, where the fallthrough was TypeScript, and that one is fixed too -- see The branch that used to decide what you are.

So the work is not writing a loader. The work is finding the branches that already decide what your language is without being asked. Two of them are now failures instead of defaults, which is the only reason this file is shorter than it was. Assume there are more.

Two routes, and the one you want

Route A: the payload Route B: your own normalizer
The producer emits facts.SemanticPayload as JSON whatever it likes
Graph semantics written by facts.NormalizeSemantic you
Who took it Python, Dart, Java, C# Go, TypeScript, Rust
Cost internal/pythonloader/loader.go is 178 lines, python-worker/index.py is 258 internal/facts/golang.go is 747 lines, typescript.go 937, rust.go 534 -- each with its own Input, Report, unit type, cache branch and counters, on top of a loader
Contract docs/protocol/semantic-facts-v1.md none; it is code

Read the full file on GitHub · 438 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. 2d ago First seen · 438 lines · 90 tokens per session scan A fda3f3181a22

Subscribe to this mod's changes

adding-a-language is a skill published in the GitHub repository Luqueee/kivgraph (11 stars, last pushed 2d ago), licensed Apache-2.0. It adds 90 tokens to every session and 5,626 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories

codestory-grounding

Use when an agent should ground a local repository with CodeStory before making source claims, planning edits, choosing tests, reviewing changes, or using broad retrieval evidence through the CodeStory plugin MCP.

TheGreenCedar/CodeStory · 44 tokens

graft

This repo is indexed by graft/. For ANY task here, whether understanding how something works, finding where code lives, tracing what calls a symbol or what a change breaks, or scoping an edit, get your context from graft before grepping or reading source files.

trailhq/Graft · 56 tokens

omnigraph

Store, retrieve, and query knowledge, memory, and relationships in an Omnigraph graph, and operate a local or remote Omnigraph deployment. Use when the user wants to capture or recall facts, notes, or entities, build or query a knowledge graph or agent memory, or run Omnigraph — and whenever you see Omnigraph CLI…

ModernRelay/omnigraph · 236 tokens

roam

Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring…

Cranot/roam-code · 86 tokens

code-graph

This skill should be used when understanding code structure, finding dependencies between functions/classes, tracing call graphs, or exploring code relationships. Trigger phrases include 'code graph', 'call graph', 'who calls', 'what calls', 'find dependencies', 'code structure', 'inheritance', 'find paths'.

FalkorDB/code-graph · 64 tokens

using-leankg

Code search via LeanKG MCP when HTTP :9699 is healthy; otherwise skip LeanKG and use default Grep/Glob/Read. Invoke before code navigation when LeanKG may apply.

FreePeak/LeanKG · 43 tokens