Typescript Refactorer
Automatically refactors TypeScript code to improve readability, maintainability, and adherence to best practices.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add typescript-refactorer npx -- -y @trustedskills/typescript-refactorer
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"typescript-refactorer": {
"command": "npx",
"args": [
"-y",
"@trustedskills/typescript-refactorer"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
The typescript-refactorer skill helps improve existing TypeScript codebases. It can identify and apply common refactoring patterns, such as extracting functions, renaming variables, and improving type safety. This leads to cleaner, more maintainable, and less error-prone code.
When to use it
- Legacy Code: Refactor older TypeScript projects that have accumulated technical debt.
- Code Reviews: Automate some of the tedious refactoring tasks during code reviews.
- Improving Readability: Enhance the clarity and structure of complex functions or modules.
- Type Safety Improvements: Identify areas where type annotations can be strengthened to prevent runtime errors.
Key capabilities
- Function extraction
- Variable renaming
- Type safety improvements
- Application of common refactoring patterns
Example prompts
- "Refactor this function to extract a helper function for calculating the total."
- "Rename this variable 'user_id' to 'userId' and update all references."
- "Improve the type safety of this code snippet, paying attention to potential
undefinedvalues."
Tips & gotchas
- The skill works best with reasonably well-formatted TypeScript code. Significant syntax errors may hinder its ability to refactor effectively.
Tags
TrustedSkills Verification
Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.
Security Audits
| Gen Agent Trust Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.