maintaining-quality

Enforce TypeScript best practices with Zod validation, typed tryCatch, and T3 Env.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/alexejluft/brudi --skill maintaining-quality
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: maintaining-quality
Source: https://github.com/alexejluft/brudi/tree/main/skills/maintaining-quality
Command: npx skills add https://github.com/alexejluft/brudi --skill maintaining-quality

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses common pitfalls in TypeScript development that lead to runtime errors or broken builds, such as unsafe type assertions, poor error handling, insecure environment variable access, and unused imports.

Core Features & Use Cases

  • Type Safety: Enforces strict typing for parsed JSON and API responses using Zod schemas.
  • Robust Error Handling: Implements a typed tryCatch utility for predictable error management.
  • Secure Environment Variables: Integrates with T3 Env for validated, type-safe access to environment variables.
  • Clean Imports: Utilizes eslint-plugin-unused-imports to eliminate unused dependencies.
  • Use Case: When refactoring a legacy JavaScript project to TypeScript, this Skill ensures that all external data is validated, errors are caught gracefully, and the codebase remains clean and maintainable.

Quick Start

Use the maintaining-quality skill to refactor the provided TypeScript code snippet to include Zod validation for JSON parsing.

Frequently Asked Questions about maintaining-quality

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

FAQPage Schema
How do I validate JSON parsing in TypeScript to prevent runtime errors?

Type-safe JSON parsing uses Zod schemas to validate external data in TypeScript. This enforces strict typing for parsed JSON and API responses, preventing silent runtime errors and build failures caused by unsafe type assertions in complex projects.

What's the best way to handle environment variables securely in a TypeScript project?

Secure environment variable management uses T3 Env to provide validated, type-safe access in TypeScript projects. This approach prevents broken builds and insecure runtime access by ensuring environment variables are strictly validated before use.

How do I implement robust error handling for TypeScript functions?

Robust error handling in TypeScript uses a typed tryCatch utility to manage errors predictably. This mechanism replaces unsafe type assertions and helps catch runtime errors gracefully, ensuring complex projects maintain stability during execution.

How do I automatically remove unused imports in an ESLint TypeScript configuration?

Automatically removing unused imports uses eslint-plugin-unused-imports to eliminate unused dependencies in TypeScript. This enforces code hygiene and prevents build failures by ensuring the codebase remains clean and maintainable during refactoring.

Can I use Zod and T3 Env together when refactoring legacy JavaScript to TypeScript?

Yes, Zod and T3 Env work together when refactoring legacy JavaScript to TypeScript. Zod enforces type-safe JSON parsing and API validation, while T3 Env secures environment variables, ensuring external data is validated and errors are caught gracefully.

Why do unsafe type assertions cause build failures in TypeScript?

Unsafe type assertions cause build failures and runtime errors in TypeScript by bypassing strict type checking. Replacing them with Zod schema validation for external data ensures type safety, preventing silent runtime errors common in complex projects.