dj-prefixed-ulids

dj-prefixed-ulids is a skill for Claude Code from dvf/opinionated-django. It costs 102 tokens per session (1,388 once invoked), scanned A, original, MIT.

A Django database convention that uses readable, time-sortable ULID strings with entity prefixes as model IDs.

In plain words
What is it for?
Use it when creating or reviewing Django models, replacing integer or UUID primary keys, or designing public identifiers and referential debugging workflows.
Why use it?
Prefixed ULIDs show what kind of record an ID represents, avoid exposing sequential counts, and work consistently as strings across application layers.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it when creating or reviewing Django models, replacing integer or UUID primary keys, or designing public identifiers and referential debugging workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dvf/opinionated-django/dj-prefixed-ulids
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 dvf/opinionated-django --skill dj-prefixed-ulids
Clone the repo
git clone --depth 1 https://github.com/dvf/opinionated-django

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 dj-prefixed-ulids

README.md
[![agentmods](https://agentmods.dev/badge/skills/dvf/opinionated-django/dj-prefixed-ulids/github.svg)](https://agentmods.dev/skills/dvf/opinionated-django/dj-prefixed-ulids)
Your own site
<a href="https://agentmods.dev/skills/dvf/opinionated-django/dj-prefixed-ulids"><img src="https://agentmods.dev/badge/skills/dvf/opinionated-django/dj-prefixed-ulids/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 dj-prefixed-ulids

Your own site · 80×15
<a href="https://agentmods.dev/skills/dvf/opinionated-django/dj-prefixed-ulids"><img src="https://agentmods.dev/badge/skills/dvf/opinionated-django/dj-prefixed-ulids.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,388 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.00102 $0.01388
Opus 5 $0.00051 $0.00694
Sonnet 5 $0.00020 $0.00278
Haiku 4.5 $0.00010 $0.00139

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

Security

Grade A, and why

dj-prefixed-ulids 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 11d 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/dj-prefixed-ulids/SKILL.md · 132 lines

How it starts

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

Prefixed ULID Primary Keys

This project uses Stripe-style prefixed ULIDs as the primary key for every Django model:

prd_01jq3v8f6a7b2c8d9e0f1g2h3j4k
ord_01jq3v8fgh7x2y5z9a1b2c3d4e5f

A 3-4 character prefix identifies the entity type, followed by an underscore and a lowercase ULID. ULIDs are 128-bit, lexicographically sortable by creation time, URL-safe, and collision-resistant.

Why

  • Debuggable. ord_01jq... in a log line tells you immediately it's an order — no need to cross-reference the column.
  • Safe to expose. Unlike auto-increment integers, prefixed ULIDs leak no ordering or volume information, and unlike opaque UUIDs they remain human-readable.
  • Time-sortable. ULIDs sort chronologically, so ORDER BY id doubles as ORDER BY created_at without a second index.
  • Type-safe across layers. Every ID is a str end-to-end — no UUID / str coercion at the service/API boundary.
  • No integer collisions. Exporting, importing, and sharding are all easier without monotonic counters.

The Generator

Put this in src/project/ids.py:

from ulid import ULID


def prefixed_ulid(prefix: str) -> str:
    return f"{prefix}_{str(ULID()).lower()}"


def _make_generator(prefix: str):
    def generate() -> str:
        return prefixed_ulid(prefix)

    generate.__name__ = f"generate_{prefix}_id"
    generate.__qualname__ = f"generate_{prefix}_id"
    return generate

Then register a generator per aggregate root:

generate_prd_id = _make_generator("prd")
generate_ord_id = _make_generator("ord")
generate_itm_id = _make_generator("itm")

The __name__ / __qualname__ rewrite matters: Django migrations serialize the default callable's fully qualified name, so each generator needs a distinct identity or the autodetector will get confused.

Choosing a Prefix

  • 3 to 4 lowercase letters — short enough to stay readable in logs
  • Must be unique across the whole project
  • Prefer mnemonic, not cryptic: ord for order, inv for invoice, prd for product, usr for user
  • Avoid collisions with existing prefixes — grep src/project/ids.py before inventing a new one
  • Never rename a prefix once it's in production; the prefix is part of the ID

Read the full file on GitHub · 132 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. 11d ago First seen · 132 lines · 102 tokens per session scan A f1db8007c2c3

Subscribe to this mod's changes

dj-prefixed-ulids is a skill published in the GitHub repository dvf/opinionated-django (110 stars, last pushed 27d ago), licensed MIT. It adds 102 tokens to every session and 1,388 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-30.

Related

Other skills, from other repositories

azure-cosmos-db-py

Build Azure Cosmos DB NoSQL services with Python/FastAPI following production-grade patterns. Use when implementing database client setup with dual auth (DefaultAzureCredential + emulator), service...

benjaminasterA/antigravity-awesome-skills · 42 tokens

azure-cosmos-py

Client library for Azure Cosmos DB NoSQL API — globally distributed, multi-model database.

benjaminasterA/antigravity-awesome-skills · 0 tokens

azure-data-tables-py

NoSQL key-value store for structured data (Azure Storage Tables or Cosmos DB Table API).

benjaminasterA/antigravity-awesome-skills · 0 tokens

neo4j-driver-python-skill

Neo4j Python Driver v6 — driver lifecycle, executequery, managed and explicit transactions, async (AsyncGraphDatabase), result handling, data type mapping, error handling, UNWIND batching, connection pool tuning, and causal consistency. Use when writing Python code that connects to Neo4j via GraphDatabase.driver…

neo4j-contrib/neo4j-skills · 186 tokens

alembic

Manage database migrations with Alembic. Use when a user asks to version database schemas, create migration scripts, handle schema changes in production, or manage SQLAlchemy model migrations.

TerminalSkills/skills · 39 tokens

huawei-cloud-ges-graph

Provides access guide for Huawei Cloud Graph Database GES service. Covers Cypher queries, GQL queries, schema/label management, summary info queries, graph data editing and more. Use this skill when users want to operate Huawei Cloud graph database GES service via terminal.

huaweicloud/huaweicloud-skills · 64 tokens