home / skills / tlabs-xyz / tbtc-v2-performance / backend--models

backend--models skill

/.codex/skills/backend--models

This skill helps implement backend models following the Agent OS standard, ensuring consistency and quality across TypeScript backend components.

npx playbooks add skill tlabs-xyz/tbtc-v2-performance --skill backend--models

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
346 B
---
name: backend--models
description: Apply the Agent OS standard for backend models.
tags: [agent-os, standard, backend]
---

# Backend Models

Use this skill when working on backend models in this repo.

## Instructions

- Follow the standard in `agent-os/standards/backend/models.md`.

## References

- `agent-os/standards/backend/models.md`

Overview

This skill applies the Agent OS standard for backend models to TypeScript projects. It enforces consistent model shape, typing, and lifecycle rules so backend code is predictable and maintainable. Use it to align new or existing models with the Agent OS conventions.

How this skill works

The skill inspects model definitions, TypeScript types/interfaces, and related serialization/parsing logic to detect deviations from the Agent OS standard. It highlights missing fields, inconsistent types, naming mismatches, and lifecycle hooks that don't follow the convention. It can guide corrections and suggest code snippets that bring models into compliance.

When to use it

  • When creating new backend models in TypeScript
  • When refactoring or consolidating existing model code
  • Before code review to ensure model conventions are met
  • When integrating third-party data into your domain models
  • When adding serialization, validation, or migration logic to models

Best practices

  • Define explicit interfaces or types for every model and export them for reuse
  • Keep model validation and serialization logic centralized and reusable
  • Use consistent naming and field ordering to improve diff readability and API contracts
  • Document required vs optional fields and include minimal examples in code comments
  • Write unit tests for model validators and simple round-trip serialization tests

Example use cases

  • Add a new domain model with typed fields and validation rules that match the Agent OS standard
  • Refactor several related models to share a base interface and common validators
  • Validate incoming JSON payloads against model types before processing
  • Create migration helpers to evolve model shapes while preserving backward compatibility
  • Audit models to ensure consistent date/time handling and ID typing

FAQ

Does this skill modify code automatically?

It can suggest fixes and example patches; apply changes manually or with your preferred code-modification toolchain.

Will adopting the standard break existing APIs?

The skill highlights breaking changes and recommends migration patterns; follow incremental migrations and compatibility shims to avoid outages.