type-fixing-agent

Enforce database-derived types as the single source of truth in TypeScript code.

2|1|Updated Aug 24, 2024
One-click install
npx skills add https://github.com/armanisadeghi/ai-matrx --skill type-fixing-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: type-fixing-agent
Source: https://github.com/armanisadeghi/ai-matrx/tree/main/.cursor/skills/type-fixing-agent
Command: npx skills add https://github.com/armanisadeghi/ai-matrx --skill type-fixing-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Skill ensures database-generated types are the single source of truth and guides developers to align local TypeScript types to the database schema, preventing drift and cascading errors.

Core Features & Use Cases

  • Enforces the canonical database types as the source of truth for all local types and code.
  • Provides a structured workflow to fix type errors, resolve tsc failures, and align types when database schemas evolve.
  • Offers common patterns such as replacing local types with database imports, updating property access to reflect schema changes, and safely handling unknown JSON shapes.

Quick Start

Run the type-fix pass on the provided files to align local TS types with the database schema.

Frequently Asked Questions about type-fixing-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix TypeScript type drift when my database schema evolves?

Fix TypeScript type drift by enforcing database-generated types as the single source of truth. This aligns local TypeScript types with the updated database schema, resolving cascading errors and preventing future mismatches.

How do I resolve tsc errors caused by mismatched database types?

Resolve tsc type errors by replacing local TypeScript types with database imports. This validates property access against the canonical schema and safely escalates any unresolved type conflicts within the targeted files.

What is the best way to align local TypeScript types with a database schema?

The best way to align local TypeScript types with a database schema is to enforce database-derived types as the single source of truth, replacing local definitions with database imports to validate shapes and fix drift.

How do I handle unknown JSON shapes in TypeScript when aligning with database types?

Handle unknown JSON shapes in TypeScript by applying database-derived type validation patterns. This ensures local types safely conform to the canonical database schema while resolving structural type conflicts during code refactoring.

Can I use database imports to replace local types across specific TypeScript files?

Yes, you can run a targeted type-fix pass to replace local types with database imports across specific TypeScript files. This safely updates property access and escalates unresolved conflicts without modifying unrelated code.

Why does TypeScript report type errors after a database schema update?

TypeScript reports type errors after a database schema update due to type drift, where local TS types no longer match the updated schema. Aligning local types to database-derived imports resolves these cascading mismatches.