Agent skill
defining-typescript-models
Defines standard TypeScript interfaces for Appwrite Collections. Use when creating new models for Tours, Users, or Bookings to ensure full type safety.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/defining-typescript-models-itsmealee-tourly2
SKILL.md
TypeScript Models and Interfaces
When to use this skill
- When defining the data structure for a new Appwrite collection.
- When creating props for components that data-fetch.
- To avoid using
anyacross the codebase.
Workflow
- Export interfaces from a central
types/directory. - Include standard Appwrite fields (
$id,$createdAt,$updatedAt,$permissions). - Use Enums for fields with fixed values (e.g.,
BookingStatus).
Example Template
import { Models } from 'appwrite';
export interface Tour extends Models.Document {
title: string;
description: string;
price: number;
location: string;
images: string[];
rating: number;
availableDates: string[]; // ISO Strings
}
export type BookingStatus = 'pending' | 'confirmed' | 'cancelled';
export interface Booking extends Models.Document {
userId: string;
tourId: string;
status: BookingStatus;
totalPrice: number;
}
Instructions
- Generics: Use these interfaces with Appwrite SDK methods:
databases.listDocuments<Tour>(...). - Readonly: Mark fields as
readonlyif they shouldn't be mutated by the frontend.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?