preen-typescript

Identify and strengthen weak TypeScript typings across a monorepo using rg discovery and replacement strategies.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/a2f0/tearleads --skill preen-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: preen-typescript
Source: https://github.com/a2f0/tearleads/tree/main/.codex/skills/preen-typescript
Command: npx skills add https://github.com/a2f0/tearleads --skill preen-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill proactively identifies and fixes weak TypeScript typings within a monorepo, improving overall code quality and maintainability.

Core Features & Use Cases

  • Type Safety Enhancement: Replaces any, narrows unknown, removes unsafe as casts, and eliminates @ts-ignore/@ts-expect-error comments.
  • Code Quality Maintenance: Ideal for improving the robustness of existing TypeScript codebases.
  • Use Case: When reviewing code or during downtime, run this skill to automatically find and suggest fixes for common TypeScript typing pitfalls, ensuring a more reliable codebase.

Quick Start

Run the preen-typescript skill to find weak TypeScript typings in the current project.

Frequently Asked Questions about preen-typescript

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

FAQPage Schema
How do I find and replace weak TypeScript typings in a monorepo?

To strengthen TypeScript typings in a monorepo, use ripgrep to discover instances of `any`, `unknown`, unsafe `as` casts, and `@ts-ignore` comments, then apply targeted type replacement strategies to enforce type safety across the codebase.

What is the best way to remove unsafe type assertions and ts-ignore comments from TypeScript?

Removing unsafe type assertions and `@ts-ignore` comments requires identifying them via search tools like `rg` and replacing them with strict, accurate type definitions to eliminate suppressed compiler errors and improve type safety.

How do I narrow unknown types in TypeScript to improve code quality?

Narrowing `unknown` types in TypeScript involves implementing runtime type checks and type guards to safely resolve ambiguous data structures, replacing loose typings with precise definitions to enhance overall code maintainability.

Can I automatically scan an entire monorepo for weak TypeScript types?

Yes, you can scan an entire monorepo for weak TypeScript types by utilizing `rg` to systematically discover poor typing patterns like `any` and `as` casts, providing detailed strategies for validating and replacing them project-wide.

When should I proactively refactor TypeScript typings instead of fixing errors as they appear?

Proactively refactoring TypeScript typings during code reviews or downtime prevents type safety degradation, systematically eliminating weak patterns like `any` and `@ts-expect-error` before they cause runtime errors and maintenance bottlenecks.