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 $0.00049 $0.00609
Sonnet 5 $0.00020 $0.00243
Haiku 4.5 $0.00010 $0.00122

Measured 8d ago against content hash 7a5f67742498, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 8d 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 idFieldsort=-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. 8d 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 (14 stars, last pushed today), licensed MIT. It adds 99 tokens to every session and 1,217 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-09-02.

Related

Other skills, from other repositories

db-infra-mocks

Propose minimal seams and local substitutes so tests run without real RDBMS/Redis/Mongo infrastructure.

pilinux/gorest · 27 tokens

servicenow-table-api

Foundational ServiceNow data access — generic Table API CRUD, Aggregate/stats roll-ups, and raw REST escape-hatch via the servicenow-api MCP server. Use when the agent must read, insert, update, patch, delete, count, or aggregate records in ANY ServiceNow table (including scoped app tables with no dedicated API), or…

Knuckles-Team/servicenow-api · 180 tokens

draft-release-notes

Author the committed release-notes file for a Prisma 8 release (stable or 8.0.0-rc.N) by enumerating the merged PRs since the previous release v tag (stable or -rc.N), resolving opaque TML-NNNN: titles via Linear context (never copied verbatim), triaging public-worthiness, and writing categorized notes — breaking…

prisma/orm · 174 tokens

record-upgrade-instructions

Record upgrade instructions alongside a Prisma Next breaking-change PR, so downstream consumers (users of @internal/ and authors of Prisma Next extensions) can apply the matching code translation automatically via the published upgrade skills. Use when you have refactored framework code and the test suite went red in…

prisma/orm · 120 tokens

create-pr

Creates a GitHub PR with a Linear-ticket-prefixed title and a decision-led, narrative description for prisma-next. Use when the user wants to create a pull request, open a PR, or submit changes for review.

prisma/orm · 47 tokens

triage-contributor-pr

Triage open pull requests from external contributors to prisma/prisma and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…

prisma/orm · 131 tokens