Agent skill

Dj Prefixed Ulids

by dvf in dvf/opinionated-django

Use Stripe-style prefixed ULID primary keys (e.g. An agent skill from dvf/opinionated-django.

MITAuto-check: notesBackend & APIs

Install Dj Prefixed Ulids

skills CLI
$ npx skills add dvf/opinionated-django --skill dj-prefixed-ulids -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dvf/opinionated-django dj-prefixed-ulids --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/dvf/opinionated-django.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dj-prefixed-ulids .claude/skills/dj-prefixed-ulids && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dj-prefixed-ulids
GitHub stars
109
Token cost
~1.4k tokens
SKILL.md length
547 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Use Stripe-style prefixed ULID primary keys (e.g. An agent skill from dvf/opinionated-django.

  • Works in 4 steps: Add a new CharField column with the… → Backfill with a data migration that… → Add unique=True and make it non-nullable… → …
  • Setting up a new model
  • SKILL.md covers Why, The Generator, Choosing a Prefix and Using it in a Model, plus 3 more sections
  • Calls uv

What it does

Dj Prefixed Ulids is an agent skill from dvf/opinionated-django. Use Stripe-style prefixed ULID primary keys (e.g. prd01jq3v...) for every Django model instead of integers or UUIDs. Use when setting up a new model, reviewing a schema that still uses auto-increment or UUID primary keys, or when the user mentions IDs, slugs, public identifiers, or referential debugging. Produces short readable prefixes, time-sortable values, and IDs that are safe to expose in URLs and logs.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Backend development and PRD writing. It works with Django and Stripe. The repository describes itself as: An opinionated Django project with Repository pattern, Pydantic DTOs, svcs DI, and Stripe-style ULID IDs. The licence is MIT.

When your agent uses it

  • Setting up a new model
  • Reviewing a schema that still uses auto-increment
  • UUID primary keys
  • The user mentions IDs

Example prompts

  • “/dj-prefixed-ulids”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Grep, Glob

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Add a new CharField column with the prefixed ULID default, nullable at first.
  2. Backfill with a data migration that assigns prefixed_ulid("prd") to every existing row.
  3. Add unique=True and make it non-nullable in a follow-up migration.
  4. Swap it to primary_key=True only after every foreign key has been migrated to reference the new column — this usually means a…

What it can do on your machine

Read from SKILL.md and the folder at commit f17fc2d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Grep
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dj Prefixed Ulids loads about 1.4k tokens when it runs. Until then it costs about 108 tokens; SKILL.md has 547 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~108
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Grep, Glob

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from dvf/opinionated-django at commit f17fc2d, republished under its MIT licence (© dvf). 547 words, ~1,353 tokens.

Download SKILL.mdSave it as .claude/skills/dj-prefixed-ulids/SKILL.md (or your agent's skills folder).
name
dj-prefixed-ulids
description
Use Stripe-style prefixed ULID primary keys (e.g. `prd_01jq3v...`) for every Django model instead of integers or UUIDs. Use when setting up a new model, reviewing a schema that still uses auto-increment or UUID primary keys, or when the user mentions IDs, slugs, public identifiers, or referential debugging. Produces short readable prefixes, time-sortable values, and IDs that are safe to expose in URLs and logs.
allowed-tools
Read, Write, Edit, Bash, Grep, Glob

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:

python
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:

python
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

Using it in a Model

python
from typing import ClassVar

from django.db import models

from project.ids import generate_prd_id


class Product(models.Model):
    __prefix__: ClassVar[str] = "prd"
    id = models.CharField(
        max_length=64,
        primary_key=True,
        default=generate_prd_id,
        editable=False,
    )
    name = models.CharField(max_length=255)

    def __str__(self) -> str:
        return self.name

Rules:

  • CharField(max_length=64) — ULID is 26 chars, prefix + separator adds up to ~10, 64 leaves headroom.
  • primary_key=True and editable=False.
  • The default is the generator function (no parentheses) so Django calls it per row.
  • __prefix__: ClassVar[str] mirrors the generator's prefix — makes the mapping discoverable from the model class alone, and lets tests assert on it.
  • Never override save() to generate the ID; the default handles it.
Show full SKILL.md (241 more words)Show less

Using it Across the Stack

Once IDs are strings at the ORM layer, they stay strings everywhere else:

  • DTOs (Pydantic): id: str — never UUID.
  • Repository params: def get(self, product_id: str) -> ProductDTO: ...
  • API path params (django-ninja): def get_product(request, product_id: str): ...
  • Celery task args: pass the string ID, never a model instance.
  • Tests: assert on the prefix, e.g. assert dto.id.startswith("prd_").

The prefix is also a cheap sanity check on every boundary: if an ID ever shows up without its prefix, something has stripped or regenerated it incorrectly.

Migrating an Existing Table

If the table already has integer or UUID primary keys, don't try to change them in place. Instead:

  1. Add a new CharField column with the prefixed ULID default, nullable at first.
  2. Backfill with a data migration that assigns prefixed_ulid("prd") to every existing row.
  3. Add unique=True and make it non-nullable in a follow-up migration.
  4. Swap it to primary_key=True only after every foreign key has been migrated to reference the new column — this usually means a multi-release cutover.

Prefer doing this on a new table where possible; in-place primary-key swaps in production are a lot of work for limited benefit.

Verify

  • Every model has __prefix__ and a CharField primary key using a generate_*_id default.
  • Every generate_*_id in src/project/ids.py has a unique prefix.
  • No model uses UUIDField, AutoField, or BigAutoField for its primary key.
  • No DTO field, service argument, or API path param types an ID as UUID — they're all str.
bash
uv run ruff check src
uv run pyrefly check src
uv run pytest

© dvf, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/dj-prefixed-ulids of dvf/opinionated-django.

Open the folder on GitHubat commit f17fc2d

Compare with similar skills

Dj Prefixed Ulids next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dj Prefixed Ulids compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dj Prefixed Ulids this skilldvf/opinionated-django109—~1.4kAutomated safety check: NotesMIT
Stripe Integration Expertalirezarezvani/claude-skills28k1 repos~3.7kAutomated safety check: PassMIT
Saleor Django Schema Migrationsaleor/saleor23k—~1kAutomated safety check: PassBSD-3-Clause
Cashier Stripe Developmentluadotsh/lua3431 repos~1.2kAutomated safety check: PassMIT
Django Access Reviewgetsentry/skills1k3 repos~2.6kAutomated safety check: NotesApache-2.0
Silk Profilerbaserow/baserow6.1k—~2.9kAutomated safety check: PassCustom licence

Similar skills

  • Stripe Integration Expert

    alirezarezvani/claude-skills

    Production-grade Stripe integrations: subscriptions with trials and proration, one-time payments, usage-based billing, checkout sessions, idempotent webhook handlers, customer portal, and invoicing.

    28k GitHub starsUsed in 1 repo~3.7k tokens
    Backend & APIsAuto-check passed
  • Generates and splits Django schema migrations for Saleor with manage.py makemigrations, enforcing one new model or one field change per migration file.

    23k GitHub stars~1k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Handles Laravel Cashier Stripe integration including subscriptions, webhooks, Stripe Checkout, invoices, charges, refunds, trials, coupons, metered billing, and payment failure handling.

    343 GitHub starsUsed in 1 repo~1.2k tokens
    Backend & APIsAuto-check passed
  • Django Access Review

    getsentry/skills

    Official

    Django access control and IDOR security review. An agent skill from getsentry/skills.

    1k GitHub starsUsed in 3 repos~2.6k tokens
    Backend & APIsAuto-check: notes
  • Silk Profiler

    baserow/baserow

    Investigate backend performance using Django Silk profiling data.

    6.1k GitHub stars~2.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • Arch Wiki

    ahmedemad3/arch-wiki

    Scans any project codebase for new/changed modules, endpoints, middleware, infrastructure, Docker topologies, SQL queries, or permissions and updates docs/architecture/architecture.json.

    249 GitHub stars~5.1k tokensUpdated 19 days ago
    Backend & APIsAuto-check passed

More from dvf/opinionated-django

All 9 skills in this repo
  • Dj Architecture

    dvf/opinionated-django

    Implement a Django feature following the opinionated architecture — prefixed ULID IDs, repository pattern, Pydantic DTOs, svcs service locator, project-scoped django-ninja API, Celery reliable…

    109 GitHub stars~4k tokensUpdated 1 mo ago
    Auto-check: notes
  • Dj Models

    dvf/opinionated-django

    Structure Django models with proper Meta classes, verbose names, and optimized indexes.

    109 GitHub stars~4.9k tokensUpdated 1 mo ago
    Auto-check: notes
  • Dj Pytest

    dvf/opinionated-django

    Set up and write pytest tests for an op-django project — pytest-django configuration, two-sided Celery testing (patched dispatch sites + plain-function task bodies, never eager mode), freezegun for…

    109 GitHub stars~4.3k tokensUpdated 1 mo ago
    Auto-check: notes
  • Dj Scaffold

    dvf/opinionated-django

    Set up a Django project into the op-django layout so the architecture, signals, and settings skills have a foundation to build on.

    109 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check: notes
  • Dj Services

    dvf/opinionated-django

    Structure Django business logic as plain services that receive their dependencies via constructor injection, and wire them through an svcs registry so they can be resolved anywhere — views, Celery…

    109 GitHub stars~3k tokensUpdated 1 mo ago
    Auto-check: notes
  • Dj Signals

    dvf/opinionated-django

    Add reliable signals (async side-effects via Celery) to a Django feature.

    109 GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check: notes

Works with

Questions about Dj Prefixed Ulids

What does Dj Prefixed Ulids do?

Use Stripe-style prefixed ULID primary keys (e.g. An agent skill from dvf/opinionated-django. Dj Prefixed Ulids is an agent skill from dvf/opinionated-django.g.

When should I use Dj Prefixed Ulids?

Dj Prefixed Ulids fits situations like: setting up a new model; reviewing a schema that still uses auto-increment; UUID primary keys; the user mentions IDs.

How do I install Dj Prefixed Ulids in Claude Code?

Run `npx skills add dvf/opinionated-django --skill dj-prefixed-ulids -a claude-code`. Or copy the skill folder (skills/dj-prefixed-ulids in dvf/opinionated-django) into .claude/skills/dj-prefixed-ulids in your project. Claude Code loads it when a task matches its description.

How do I install Dj Prefixed Ulids in Codex?

Run `npx skills add dvf/opinionated-django --skill dj-prefixed-ulids -a codex`. Or copy the skill folder (skills/dj-prefixed-ulids in dvf/opinionated-django) into .agents/skills/dj-prefixed-ulids in your project. Codex loads it when a task matches its description.

Can I use Dj Prefixed Ulids in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dvf/opinionated-django --skill dj-prefixed-ulids -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dj-prefixed-ulids, .gemini/skills/dj-prefixed-ulids, .github/skills/dj-prefixed-ulids and .opencode/skills/dj-prefixed-ulids in your project.

What does Dj Prefixed Ulids need to run?

Going by SKILL.md and its folder, Dj Prefixed Ulids needs the command-line tools its instructions call (uv). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Grep, Glob.

Does Dj Prefixed Ulids access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Dj Prefixed Ulids safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Dj Prefixed Ulids use?

Dj Prefixed Ulids is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dj Prefixed Ulids use?

About 1.4k tokens (SKILL.md is roughly 5.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dj Prefixed Ulids?

Skills that share tags, products or a category with Dj Prefixed Ulids: Stripe Integration Expert (alirezarezvani/claude-skills, 28k stars), Saleor Django Schema Migration (saleor/saleor, 23k stars), Cashier Stripe Development (luadotsh/lua, 343 stars) and Django Access Review (getsentry/skills, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dj Prefixed Ulids?

dvf (a GitHub user) maintains it in dvf/opinionated-django, which has 109 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on August 14, 2026.

Source: dvf/opinionated-django on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.