Prefer Type Annotations
This skill automatically adds type annotations to your code for improved readability and maintainability, boosting developer productivity.
Install on your platform
We auto-selected Claude Code based on this skill’s supported platforms.
Run in terminal (recommended)
claude mcp add prefer-type-annotations npx -- -y @trustedskills/prefer-type-annotations
Or manually add to ~/.claude/settings.json
{
"mcpServers": {
"prefer-type-annotations": {
"command": "npx",
"args": [
"-y",
"@trustedskills/prefer-type-annotations"
]
}
}
}Requires Claude Code (claude CLI). Run claude --version to verify your install.
About This Skill
What it does
This skill guides an AI agent to prefer using type annotations in TypeScript code. It encourages explicit typing for variables, function parameters and return values, improving code readability and maintainability. The skill aims to reduce ambiguity and potential errors by ensuring types are clearly defined throughout the codebase.
When to use it
- Refactoring existing JavaScript codebases to TypeScript.
- Writing new TypeScript modules or libraries where type safety is critical.
- Reviewing code written by other developers to ensure consistent typing practices.
- Generating TypeScript code from natural language descriptions of functions and data structures.
Key capabilities
- Suggests adding type annotations to variables.
- Recommends specifying parameter types in function signatures.
- Promotes defining return types for functions.
- Encourages the use of explicit
typealiases and interfaces.
Example prompts
- "Add type annotations to this JavaScript code snippet."
- "Convert this function to TypeScript, including appropriate type definitions."
- "Review this code for missing or unclear type annotations."
Tips & gotchas
This skill is most effective when used in conjunction with a basic understanding of TypeScript syntax and concepts. While it can suggest types, the agent may not always choose the optimal type – review its suggestions carefully.
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.