index-signature-alternatives

Community

Prefer precise types over index signatures.

Authorluyi985
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Index signatures are imprecise and can lead to typos, weak autocomplete, and unsafe access. This skill guides developers to replace permissive index signatures with interfaces, Records, or Maps for known keys, enhancing type safety.

Core Features & Use Cases

  • Encourages replacing dynamic key maps with precise types (Interface, Record, or Map).
  • Demonstrates concrete usage patterns for modeling API shapes, configuration schemas, and data from CSV/JSON with strong typing.
  • Provides guidelines on when to apply index signatures only for truly additional properties.

Quick Start

Refactor an example object from an index signature to a typed interface for known keys, and migrate truly dynamic keys to a Map for safer access.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: index-signature-alternatives
Download link: https://github.com/luyi985/lyi-bash/archive/main.zip#index-signature-alternatives

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.