composite-primary-keys

composite-primary-keys is a skill for Claude Code from kavo-labs/kavo. It costs 99 tokens per session (1,217 once invoked), scanned A, original, MIT.

A reference for using composite primary keys in Kavo's TypeORM adapter. A composite primary key identifies a database row with multiple columns instead of one ID, and this guide explains how those keys appear in routes and write operations.

In plain words
What is it for?
Use it when defining entities with multiple primary columns, building route IDs, or checking whether create, update, and adapter features support composite keys.
Why use it?
It clarifies how Kavo encodes multi-part row identities and where this feature is supported or limited.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the kavo-skills plugin — 15 skills shipped together

Good fit Use it when defining entities with multiple primary columns, building route IDs, or checking whether create, update, and adapter features support composite keys.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kavo-labs/kavo/composite-primary-keys
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 kavo-labs/kavo --skill composite-primary-keys
Clone the repo
git clone --depth 1 https://github.com/kavo-labs/kavo

Made for: Claude Code.

Or install kavo-skills, the plugin that ships this one along with the rest of its 15 skills.

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 composite-primary-keys

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kavo-labs/kavo/composite-primary-keys"><img src="https://agentmods.dev/badge/skills/kavo-labs/kavo/composite-primary-keys.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 99 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,217 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 warn 7 Sept 2026
SkillSpector: 15 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Memory Poisoning · line 73
    Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
    Fix: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
  • medium Memory Poisoning · line 79
    Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
    Fix: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
  • medium Memory Poisoning · line 81
    Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.
    Fix: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
  • medium Prompt Injection · line 73
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 73
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 75
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 75
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 77
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 78
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 79
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 79
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 80
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 80
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 81
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
  • medium Prompt Injection · line 81
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
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.00099 $0.01217
Opus 5.5 $0.00040 $0.00487
Sonnet 5.5 $0.00020 $0.00243
Haiku 4.5 $0.00010 $0.00122

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

Security

Grade A, and why

composite-primary-keys 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 3mo 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.

extensions/skills/composite-primary-keys/SKILL.md · 85 lines

How it starts

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

Composite primary key reference (@kavo/typeorm)

An entity with more than one @PrimaryColumn — a natural key with no surrogate id — is supported, TypeORM only:

@Entity()
export class UserSentence {
  @PrimaryColumn("uuid")
  userId!: string;

  @PrimaryColumn()
  topic!: string;

  @Column()
  key!: string;
}

EntityMetadata.compositeIdFields reports the key columns, in declaration order. idField still exists (the first declared column, for callers that only ever need one name) but nothing that addresses a row's real identity may rely on it alone once compositeIdFields is set.

Route id encoding

One path segment, key columns joined by ~:

GET /user-sentences/u1~billing   →  { userId: "u1", topic: "billing" }

A literal ~ inside a value is escaped by doubling it (~~) — the id has already passed URL decoding by the time Kavo sees it, so percent-escaping the separator would be silently invisible. encodeCompositeId/ decodeCompositeId (@kavo/core's barrel) implement the codec; a malformed id (wrong part count) is a clean 400, never a driver error.

Writable defaults

Key columns are creatable but not updatable: createOne accepts them (a natural key the client supplies), updateOne/patchOne silently drop them from the body — the row's identity doesn't change after creation. This is the one case where creatable's and updatable's shared default diverges; narrow either explicitly (see the kavo-decorator skill) if that default is wrong for an entity.

Pagination

Offset, page, cursor, and since all work. Cursor/since force the sort's tail to the full compositeIdFields tuple, in declaration order, instead of a single idField — sort=-createdAt,userId,topic, not sort=-createdAt,userId. A since token's id half reuses the same ~-delimited encoding a route id uses.

Association by id (ADR-0014)

Works in both directions:

  • As a relation's source — an owner entity can include= it normally.
  • As a relation's target — a write body names it as an object keyed by each column ({ owner: { userId: "u1", topic: "billing" } }) or the bare ~-delimited scalar ({ owner: "u1~billing" }). Either narrows to the target's real column names before it reaches the adapter.

Read the full file on GitHub · 85 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. 3mo ago First seen · 85 lines · 99 tokens per session scan A 7a5f67742498

Subscribe to this mod's changes

composite-primary-keys is a skill published in the GitHub repository kavo-labs/kavo (16 stars, last pushed yesterday), licensed MIT. It adds 99 tokens to every session and 1,217 once invoked, about $0.0004 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-09-02.

Related

composite-primary-keys compared with skills from other repositories

composite-primary-keys next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
composite-primary-keyskavo-labs/kavoSkill16yesterdayMITA99Claude Code
draft-release-notesprisma/ormSkill48ktodayApache-2.0A174Claude Code, Codex
publish-npm-versionprisma/ormSkill48ktodayApache-2.0A206Claude Code, Codex
create-prprisma/ormSkill48ktodayApache-2.0A47Claude Code, Codex
triage-contributor-prprisma/ormSkill48ktodayApache-2.0A131Claude Code
record-upgrade-instructionsprisma/ormSkill48ktodayApache-2.0A135Claude Code, Codex
contrib-prprisma/ormSkill48ktodayApache-2.0A65Claude Code, Codex