cleanup-weak-types

Replace weak types like 'any' and 'unknown' with inferred types across codebases.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/raintree-technology/agent-starter --skill cleanup-weak-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cleanup-weak-types
Source: https://github.com/raintree-technology/agent-starter/tree/main/templates/.claude/skills/cleanup-weak-types
Command: npx skills add https://github.com/raintree-technology/agent-starter --skill cleanup-weak-types

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill replaces weak types in code, enhancing type safety and reducing the potential for runtime errors.

Core Features & Use Cases

  • Replace Weak Types: Identifies and replaces weak types like any, unknown, and interface{} with more precise types.
  • Typechecking: Performs individual type checks for each replacement to ensure code stability.
  • Use Case: Ideal for developers looking to clean up their codebase by strengthening typing for better maintainability and performance.

Quick Start

Apply the cleanup-weak-types skill to strengthen the typing of the current codebase.

Frequently Asked Questions about cleanup-weak-types

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

FAQPage Schema
How do I replace weak types like 'any' and 'unknown' in my codebase?

To replace weak types, the script identifies weak types and infers precise types based on actual usage. It substitutes weak types with inferred types to enforce stricter typing conventions and reduce runtime errors.

What are weak types and when do I need to clean them up?

Weak types are generic placeholders that bypass compiler checks, reducing code safety. You need to clean them up when improving codebase maintainability and enforcing type safety across JavaScript, TypeScript, Python, Go, and Rust projects.

Do I need type-checking tools to enforce type safety in Python and TypeScript?

Yes, enforcing type safety requires type-checking tools like 'mypy' for Python and 'tsc' for TypeScript. These tools verify individual type checks for each replacement to ensure code stability.

Can I use this cleanup script to replace 'interface{}' in my Go codebase?

Yes, you can replace 'interface{}' in Go codebases. The script supports JavaScript, TypeScript, Python, Go, and Rust, identifying and replacing weak types with inferred types based on actual usage.

What's the best way to ensure code stability when strengthening typing?

The best way to ensure code stability when strengthening typing is performing individual type checks for each replacement. This verifies that inferred types based on actual usage do not break existing code logic.