trex.kind.add-field

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

A guided change that adds a field to an existing Kind, a named type of object in the application, across the relevant code and database layers.

In plain words
What is it for?
Use it when an existing Kind needs a new string, number, boolean, or time field that may be required or nullable.
Why use it?
It reduces the chance that the API model, database migration, and update behavior disagree about the new field.

Command for Claude Code

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

Good fit Use it when an existing Kind needs a new string, number, boolean, or time field that may be required or nullable.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/openshift-online/agent-control-plane/trex.kind.add-field
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.

Clone the repo
git clone --depth 1 https://github.com/openshift-online/agent-control-plane

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.add-field

README.md
[![agentmods](https://agentmods.dev/badge/commands/openshift-online/agent-control-plane/trex.kind.add-field/github.svg)](https://agentmods.dev/commands/openshift-online/agent-control-plane/trex.kind.add-field)
Your own site
<a href="https://agentmods.dev/commands/openshift-online/agent-control-plane/trex.kind.add-field"><img src="https://agentmods.dev/badge/commands/openshift-online/agent-control-plane/trex.kind.add-field/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 trex.kind.add-field

Your own site · 80×15
<a href="https://agentmods.dev/commands/openshift-online/agent-control-plane/trex.kind.add-field"><img src="https://agentmods.dev/badge/commands/openshift-online/agent-control-plane/trex.kind.add-field.svg" alt="Reviewed on agentmods" width="80" 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 844 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.00844
Opus 5 $0.00000 $0.00422
Sonnet 5 $0.00000 $0.00169
Haiku 4.5 $0.00000 $0.00084

Measured 9d ago against content hash 999836adf643, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

trex.kind.add-field 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 9d 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.add-field — 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.add-field.md · 106 lines

How it starts

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

Add a Field to an Existing Kind

Add a new field to an existing Kind, updating all layers consistently.

Instructions

Ask the user for:

  1. Kind name (PascalCase): e.g., "Dinosaur"
  2. Field name (snake_case): e.g., "habitat_type"
  3. Field type: string, int, int64, bool, float64, time.Time
  4. Required or nullable: required fields use base types (string), nullable use pointers (*string)

Derive the Go field name in PascalCase (e.g., habitat_type -> HabitatType).

Use the TodoWrite tool to track progress.

Step 1: Update API Model (pkg/api/{kind}.go)

Add the field to the {Kind} struct:

HabitatType string `json:"habitat_type"`

Add the field to {Kind}PatchRequest as a pointer:

HabitatType *string `json:"habitat_type,omitempty"`

Step 2: Create a New Migration File

IMPORTANT: Create a brand new migration file at pkg/db/migrations/{YYYYMMDDHHMM}_add_{field}_to_{kindLowerPlural}.go. Do NOT modify the Kind's existing migration.

package migrations

import (
    "gorm.io/gorm"
    "github.com/go-gormigrate/gormigrate/v2"
)

func add{FieldPascalCase}To{KindPlural}() *gormigrate.Migration {
    type {Kind} struct {
        Model
        {FieldPascalCase} {GoType}
    }

    return &gormigrate.Migration{
        ID: "{YYYYMMDDHHMM}",
        Migrate: func(tx *gorm.DB) error {
            return tx.AutoMigrate(&{Kind}{})
        },
        Rollback: func(tx *gorm.DB) error {
            return tx.Migrator().DropColumn(&{Kind}{}, "{field_snake_case}")
        },
    }
}

Register it in pkg/db/migrations/migration_structs.go by appending to MigrationList.

Step 3: Update Presenter (pkg/api/presenters/{kind}.go)

Add the field to both Convert{Kind}() and Present{Kind}() functions, handling the type conversion between internal and OpenAPI models.

Step 4: Update Handler (pkg/handlers/{kind}.go)

In the Patch method, add the nil-check for the new field:

if patch.{FieldPascalCase} != nil {
    found.{FieldPascalCase} = patch.{FieldPascalCase}
}

Read the full file on GitHub · 106 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. 9d ago First seen · 106 lines · 0 tokens per session scan A 999836adf643

Subscribe to this mod's changes

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