trex.kind.new

trex.kind.new is a command for Claude Code from openshift-online/agent-control-plane. It costs 0 tokens per session (730 once invoked), scanned A, a copy of trex.kind.new, MIT.

A generator command that creates a complete CRUD Kind, meaning the code for creating, reading, updating, and deleting one type of entity.

In plain words
What is it for?
Use it to define an entity and its fields, then generate the related Go files, database migration, OpenAPI description, generated client code, factories, and integration tests.
Why use it?
It removes the repetitive work of creating matching API, database, service, plugin, documentation, and test files by hand.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: names the TodoWrite tool.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is go run ./scripts/generator.go --kind {KindName}.

Good fit Use it to define an entity and its fields, then generate the related Go files, database migration, OpenAPI description, generated client code, factories, and integration tests.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/openshift-online/agent-control-plane
agentmods
npx agentmods add commands/openshift-online/agent-control-plane/trex.kind.new

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 trex.kind.new

README.md
[![agentmods](https://agentmods.dev/badge/commands/openshift-online/agent-control-plane/trex.kind.new.svg)](https://agentmods.dev/commands/openshift-online/agent-control-plane/trex.kind.new)
Your own site
<a href="https://agentmods.dev/commands/openshift-online/agent-control-plane/trex.kind.new"><img src="https://agentmods.dev/badge/commands/openshift-online/agent-control-plane/trex.kind.new.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 730 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.
Origin 100% copy Near-identical to another mod 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.00000 $0.00730
Opus 5 $0.00000 $0.00365
Sonnet 5 $0.00000 $0.00146
Haiku 4.5 $0.00000 $0.00073

Measured 7d ago against content hash 831f0db5cbd2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

trex.kind.new 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 7d 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.

Origin

This is a copy

100% identical to trex.kind.new — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

components/ambient-api-server/.claude/commands/trex.kind.new.md · 86 lines

How it starts

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

Generate a New Kind

Generate a complete CRUD entity (Kind) using the automated generator script.

Instructions

Use the TodoWrite tool to track progress.

Step 1: Gather Requirements

Ask the user for:

  1. Kind name (singular, PascalCase): e.g., "Widget", "Rocket", "Customer"
  2. Fields beyond the base Meta fields (optional):
    • Name (use snake_case): e.g., "fuel_type", "max_speed"
    • Type: string, int, int64, bool, float64, time
    • Nullability: :required or :optional (default: nullable)

Step 2: Run the Generator

go run ./scripts/generator.go --kind {KindName}

With custom fields:

go run ./scripts/generator.go --kind {KindName} --fields "{field1}:{type1}:{nullability},{field2}:{type2}"

Example:

go run ./scripts/generator.go --kind Rocket --fields "name:string:required,fuel_type:string,max_speed:int"

The generator automatically:

  • Creates 11 new files (plugin, model, DAO, mock, service, presenters, handlers, migration, OpenAPI spec, test factory, integration tests)
  • Modifies 3 existing files (cmd/ambient-api-server/main.go, pkg/db/migrations/migration_structs.go, openapi/openapi.yaml)
  • Runs make generate to regenerate the OpenAPI client
  • Formats all Go files with gofmt

Step 3: Build and Verify

make binary

Fix any compilation errors if they occur.

Step 4: Test

make test-integration

Or run just the new Kind's tests:

TESTFLAGS="-run Test{Kind}" make test-integration

Field Type Reference

User Type Go (required) Go (nullable) OpenAPI type OpenAPI format DB Type
string string *string string varchar
int int *int integer int32 integer
int64 int64 *int64 integer int64 bigint
bool bool *bool boolean boolean
float64 float64 *float64 number double float8
time time.Time *time.Time string date-time timestamptz

Read the full file on GitHub · 86 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. 7d ago First seen · 86 lines · 0 tokens per session scan A 831f0db5cbd2

Subscribe to this mod's changes

trex.kind.new is a command published in the GitHub repository openshift-online/agent-control-plane (11 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 730 tokens. A static security scan graded it A with 0 findings. It is 100% identical to trex.kind.new, differing in 0 lines, and is treated as a copy.