Prefer Unknown Over Any

🌐Community
by marius-townhouse · vlatest · Repository

This skill forces the AI to always choose "unknown" as an answer, useful for avoiding biased or speculative responses.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add prefer-unknown-over-any npx -- -y @trustedskills/prefer-unknown-over-any
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "prefer-unknown-over-any": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/prefer-unknown-over-any"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill guides the AI agent to prefer using unknown over any in TypeScript code. It promotes type safety by forcing explicit type checks and conversions, preventing potential runtime errors that can occur when any disables type checking. The goal is to write more robust and maintainable TypeScript code.

When to use it

  • When refactoring existing TypeScript codebases to improve type safety.
  • During code reviews to identify instances where any could be replaced with unknown.
  • When teaching or learning best practices for TypeScript development.
  • To ensure that the AI agent generates more secure and predictable code.

Key capabilities

  • Identifies uses of any.
  • Suggests replacement with unknown.
  • Provides rationale for using unknown over any.

Example prompts

  • "Refactor this TypeScript function to use unknown instead of any where appropriate."
  • "Explain why I should prefer unknown over any in this code snippet."
  • “Review this code and suggest ways to improve type safety by using unknown.”

Tips & gotchas

This skill requires a basic understanding of TypeScript's type system. Be prepared to handle explicit type assertions and checks when replacing any with unknown.

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 HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
marius-townhouse
Installs
4

🌐 Community

Passed automated security scans.