·context-type-inference
</>

context-type-inference

marius-townhouse/effective-typescript-skills

Use when extracting values causes type errors. Use when callback types are wrong. Use when const assertions are needed.

2Installs·0Trend·@marius-townhouse

Installation

$npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill context-type-inference

SKILL.md

Separating a value from its context can cause type errors.

TypeScript infers types based on both the value AND where it's used. When you extract a value to a variable, you lose context, which can cause surprising type errors.

Note: as const makes it readonly. If the function expects a mutable tuple, this won't work:

Use when extracting values causes type errors. Use when callback types are wrong. Use when const assertions are needed. Source: marius-townhouse/effective-typescript-skills.

View raw

Facts (cite-ready)

Stable fields and commands for AI/search citations.

Install command
npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill context-type-inference
Category
</>Dev Tools
Verified
First Seen
2026-02-05
Updated
2026-02-18

Quick answers

What is context-type-inference?

Use when extracting values causes type errors. Use when callback types are wrong. Use when const assertions are needed. Source: marius-townhouse/effective-typescript-skills.

How do I install context-type-inference?

Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/marius-townhouse/effective-typescript-skills --skill context-type-inference Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor

Where is the source repository?

https://github.com/marius-townhouse/effective-typescript-skills