trex.kind.remove

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

A cleanup command that removes a generated Kind, meaning a complete CRUD entity and all files created for it.

In plain words
What is it for?
Use it to verify that a Kind exists and remove its generated plugins, models, services, database files, OpenAPI files, clients, and tests.
Why use it?
It avoids leaving code, database migrations, API descriptions, generated clients, or tests behind after an entity is no longer needed.

Command for Claude Code

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/openshift-online/agent-control-plane/trex.kind.remove
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.remove

README.md
[![agentmods](https://agentmods.dev/badge/commands/openshift-online/agent-control-plane/trex.kind.remove.svg)](https://agentmods.dev/commands/openshift-online/agent-control-plane/trex.kind.remove)
Your own site
<a href="https://agentmods.dev/commands/openshift-online/agent-control-plane/trex.kind.remove"><img src="https://agentmods.dev/badge/commands/openshift-online/agent-control-plane/trex.kind.remove.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 652 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00000 $0.00652
Opus 5 $0.00000 $0.00326
Sonnet 5 $0.00000 $0.00130
Haiku 4.5 $0.00000 $0.00065

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

Security

Grade C, and why

trex.kind.remove scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf plugins/{kindLowerPlural}/
Origin

This is a copy

100% identical to trex.kind.remove — 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.remove.md · 97 lines

How it starts

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

Remove a Kind

Completely remove a generated Kind and all its artifacts from the project.

Instructions

Ask the user for the Kind name (PascalCase, e.g., "Widget").

Derive the naming variants (see /trex.kind.new for the full table):

  • Kind = PascalCase (e.g., Widget)
  • kindLowerPlural = camelCase plural (e.g., widgets)
  • kind_snake_case = snake_case (e.g., widget)

Use the TodoWrite tool to track progress.

Step 1: Verify the Kind Exists

Check that the Kind's files exist before removing:

ls plugins/{kindLowerPlural}/plugin.go
ls pkg/api/{kind}.go
ls pkg/services/{kind}.go

If files don't exist, inform the user and stop.

Step 2: Remove Generated Files (11 files)

Delete all files created by the generator:

rm -rf plugins/{kindLowerPlural}/
rm -f pkg/api/{kind}.go
rm -f pkg/api/presenters/{kind}.go
rm -f pkg/handlers/{kind}.go
rm -f pkg/services/{kind}.go
rm -f pkg/dao/{kind}.go
rm -f pkg/dao/mocks/{kind}.go
rm -f pkg/db/migrations/*_add_{kindLowerPlural}.go
rm -f openapi/openapi.{kindLowerPlural}.yaml
rm -f test/integration/{kindLowerPlural}_test.go
rm -f test/factories/{kindLowerPlural}.go

Step 3: Remove Generated OpenAPI Client Files

rm -f pkg/api/openapi/model_{kind_snake_case}*.go
rm -f pkg/api/openapi/docs/{Kind}*.md

Step 4: Unwire from Existing Files

4.1 cmd/ambient-api-server/main.go

Remove the blank import line for the Kind's plugin.

4.2 pkg/db/migrations/migration_structs.go

Remove from MigrationList:

add{Kind}s(),
4.3 openapi/openapi.yaml

Remove the path $ref entries for this Kind (both collection and item paths). Remove the schema $ref entries ({Kind}, {Kind}List, {Kind}PatchRequest).

Step 5: Regenerate OpenAPI Client

make generate

This ensures the OpenAPI client code no longer references the removed Kind.

Step 6: Verify Clean Removal

make binary

Fix any remaining references. Common issues:

  • Other services importing the removed Kind's plugin
  • Test files referencing the removed Kind's factory
  • Stale references in OpenAPI generated code

Read the full file on GitHub · 97 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. 4d ago First seen · 97 lines · 0 tokens per session scan C eabb426c745e

Subscribe to this mod's changes

trex.kind.remove 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 652 tokens. A static security scan graded it C with 1 finding (recursive force delete). It is 100% identical to trex.kind.remove, differing in 0 lines, and is treated as a copy.