jira.log
Log a new Jira issue to RHOAIENG with Team (Ambient team) and Component (Agentic) pre-filled.
Add a new field to an existing Kind, updating all layers consistently.
$ npx -y skills add ambient-code/platform --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/trex.kind.add-fieldContext preview
What this command does when you run it.
Add a new field to an existing Kind, updating all layers consistently.
Add a new field to an existing Kind, updating all layers consistently.
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.
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"`
**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`.
Add the field to both `Convert{Kind}()` and `Present{Kind}()` functions, handling the type conversion between internal and OpenAPI models.
In the `Patch` method, add the nil-check for the new field:
if patch.{FieldPascalCase} != nil {
found.{FieldPascalCase} = patch.{FieldPascalCase}
}Add the field to three schema sections:
make generate
Wait for completion, then verify the new field appears in:
make binary make test-integration
**Note**: Integration tests use testcontainers, which provisions a fresh PostgreSQL instance automatically. No manual `db/teardown` or `db/setup` is needed for tests. However, if running the server locally, use `/trex.db.setup` to recreate the database with the new migration.
Kubernetes-native AI automation platform for intelligent agentic sessions
Log a new Jira issue to RHOAIENG with Team (Ambient team) and Component (Agentic) pre-filled.
Start a fresh PostgreSQL container and run all migrations. If a database already exists, this will tear it down first.
Generate a complete CRUD entity (Kind) using the automated generator script.
Completely remove a generated Kind and all its artifacts from the project.
Regenerate the Go client code from OpenAPI specifications. Run this after modifying any `openapi/*.yaml` files.
Validate that this TRex-spawned project is in a healthy, working state. This command is idempotent — it succeeds if everything is…