crud

crud is a command for coding agents from JoaoEquer/Oficina. It costs 20 tokens per session (540 once invoked), scanned A, original, MIT.

A command for creating a complete CRUD area in a NestJS and Prisma application. CRUD means the basic actions for creating, reading, updating, and deleting records.

In plain words
What is it for?
Use it to add a multi-tenant entity, including its database model, migration, API routes, validation, services, and repository code.
Why use it?
It avoids repeatedly designing the same backend pieces and requires the new data model and routes to follow the project's existing patterns.

Command

Part of the oficina plugin — 6 skills, 5 commands shipped together

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 commands/joaoequer/oficina/crud
Clone the repo
git clone --depth 1 https://github.com/JoaoEquer/Oficina

Or install oficina, the plugin that ships this one along with the rest of its 6 skills, 5 commands.

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 crud

README.md
[![agentmods](https://agentmods.dev/badge/commands/joaoequer/oficina/crud.svg)](https://agentmods.dev/commands/joaoequer/oficina/crud)
Your own site
<a href="https://agentmods.dev/commands/joaoequer/oficina/crud"><img src="https://agentmods.dev/badge/commands/joaoequer/oficina/crud.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 540 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.00020 $0.00540
Opus 5 $0.00010 $0.00270
Sonnet 5 $0.00004 $0.00108
Haiku 4.5 $0.00002 $0.00054

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

Security

Grade A, and why

crud 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 4d 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.

commands/crud.md · 30 lines

What it actually says

Create the CRUD domain $ARGUMENTS strictly following the nestjs-crud-pattern skill and the conventions in the prisma-schema-conventions skill.

Mandatory steps, in this order:

  1. Locate the project's data model document (UML/diagram in docs/). If you can't find it or the entity isn't in it, STOP and ask for the fields — do not invent them.

  2. If a CRUD module already exists in the repo, use it as the mold and keep the format identical.

  3. Model the entity in schema.prisma following the conventions (workspaceId, soft delete, UTC, and whichever others apply) and generate the migration with a descriptive name.

  4. Create the complete src/modules/$ARGUMENTS/: controller, service, repository (abstract contract + Prisma implementation), DTOs with class-validator, module with provider token. Register it in AppModule.

  5. Validate: project boots, migration applied, all 5 routes respond, lint and build clean.

  6. Write the delivery log in docs/log/ (what was done, decisions, pending items), per the git-workflow rule.

  7. Self-verification (mandatory — do not skip): before declaring the domain done, check every item below and print the checklist with an explicit pass/fail per item. If any item fails, fix it before finishing; if it cannot be fixed, report it as a pending item — never declare done with a silent failure.

    • Entity fields match the project's data model document (no invented fields)
    • Migration applied with a descriptive name (table exists)
    • Repository is an abstract contract + Prisma implementation bound via provider token
    • workspaceId comes from the authenticated context; zero endpoints accept it in the body
    • Every repository query filters by workspaceId
    • DTOs validate via class-validator; global ValidationPipe active
    • All 5 routes respond (POST, GET list, GET by id, PATCH, DELETE)
    • Module registered in AppModule; lint and build clean
    • Delivery log written in docs/log/
    • Any decision marked PENDING in the project's AGENTS.md was flagged, not silently decided

Non-negotiable rules: workspaceId from the authenticated context (never from the body), every query filters by tenant, permissions validated on the server, dates in UTC.

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. 4d ago First seen · 30 lines · 20 tokens per session scan A e8c6342643f7

Subscribe to this mod's changes

crud is a command published in the GitHub repository JoaoEquer/Oficina (2 stars, last pushed 1mo ago), licensed MIT. It adds 20 tokens to every session and 540 once invoked, about $0.0001 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.