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

backend--queries skill

/.codex/skills/backend--queries

This skill helps you apply the Agent OS standard for backend queries across TypeScript projects, ensuring consistent patterns and reliable data access.

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

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

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

# Backend Queries

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

## Instructions

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

## References

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

Overview

This skill applies the Agent OS backend queries standard to TypeScript backends. It helps enforce consistent query patterns, typing, error handling, and performance considerations across services. Use it to make backend query code predictable, maintainable, and interoperable with Agent OS conventions.

How this skill works

The skill inspects TypeScript query implementations and checks them against the Agent OS backend queries standard. It validates typing, query composition, parameter handling, and recommended error/response shapes, and flags deviations or missing concerns. It outputs concrete suggestions for alignment and examples for corrections.

When to use it

  • When adding or refactoring query logic in a backend service
  • During code reviews for TypeScript query modules
  • When implementing new endpoints that depend on database or external queries
  • Before merging changes affecting query typing, error models, or performance-critical paths

Best practices

  • Prefer explicit, narrow TypeScript types for inputs and outputs to reduce runtime errors
  • Centralize common query utilities (pagination, filtering, sanitization) for reuse
  • Return consistent error shapes and status semantics so callers can handle failures uniformly
  • Avoid embedding raw SQL or unparameterized inputs; use parameterized queries or query builders
  • Document query contracts and side effects in the module-level comments

Example use cases

  • Standardize CRUD query implementations across microservices to share the same input/output contract
  • Refactor an endpoint to replace ad-hoc queries with typed, reusable query helpers
  • Audit query modules for inconsistent error handling and align them to a single error schema
  • Add pagination and filtering to an existing list endpoint while keeping type safety intact

FAQ

Does this skill modify code automatically?

It provides concrete suggestions and examples; automatic changes depend on the integration or tooling you run it with.

Which areas does it prioritize?

It prioritizes type safety, predictable error shapes, parameter sanitization, and performance-aware query patterns.