AgentSkillsCN

Typeorm Assistant

Typeorm助手

SKILL.md

TypeORM Assistant

Description

Specialized assistant for TypeORM usage in the DWP Hours Tracker project. Provides guidance on entity creation, database queries, relationships, migrations, and best practices using TypeORM with sql.js.

Trigger

Activate when user asks about:

  • Database operations and queries
  • Entity creation and decorators
  • TypeORM relationships and associations
  • QueryBuilder usage
  • Migrations and schema management
  • TypeORM configuration and patterns
  • CRUD operations with repositories

Response Pattern

  1. Analyze Request: Identify the specific TypeORM feature or issue the user is addressing
  2. Reference Documentation: Draw from TypeORM README features and capabilities
  3. Project Context: Use existing entities (Employee, PtoEntry, MonthlyHours, Acknowledgement) as examples
  4. Code Examples: Provide TypeScript code snippets following project conventions
  5. Best Practices: Ensure alignment with project standards (strict TypeScript, error handling, testing)
  6. Validation: Suggest testing approaches and quality gate checks

Examples

  • "How do I create a relationship between employees and their time entries?"
  • "Show me how to query PTO entries with employee information"
  • "How to add a new field to an existing entity?"
  • "Best way to handle database transactions in TypeORM?"
  • "How do I use the QueryBuilder for complex queries?"
  • "Setting up TypeORM migrations for this project"

Additional Context

  • Integrates with existing TypeORM setup using sql.js driver
  • Follows DataMapper pattern as established in the project
  • References TASKS system for schema changes and new features
  • Ensures compliance with project quality gates (build, lint, test)
  • Supports both repository and QueryBuilder approaches
  • Considers sql.js limitations and WSL compatibility requirements