accurate-environment-model
SKILL.md
Create an Accurate Model of Your Environment
Overview
Your TypeScript environment includes globals, environment variables, and platform-specific APIs. Create accurate type definitions for your environment using declaration files (.d.ts). This ensures type safety for platform-specific code and global variables.
When to Use This Skill
- Defining global types
- Augmenting window or globalThis
- Typing environment variables
- Working with build-time constants
- Configuring type definitions
The Iron Rule
Model your environment accurately with .d.ts files. Declare globals, window properties, and environment variables that your code depends on.
Example
// types/environment.d.ts
declare global {
interface Window {
APP_CONFIG: {
apiUrl: string;
version: string;
};
}
const BUILD_TIMESTAMP: number;
}
// Usage
console.log(window.APP_CONFIG.apiUrl);
console.log(BUILD_TIMESTAMP);
Reference
- Effective TypeScript, 2nd Edition by Dan Vanderkam
- Item 76: Create an Accurate Model of Your Environment
Weekly Installs
6
Repository
marius-townhous…t-skillsGitHub Stars
2
First Seen
Feb 3, 2026
Security Audits
Installed on
opencode6
claude-code5
mcpjam4
iflow-cli4
windsurf4
zencoder4