waveenv

Define WaveEnvSubset types and env.ts files for component testing.

Updated Apr 26, 2026
One-click install
npx skills add https://github.com/lihonghuacgk/waveterm --skill waveenv-lihonghuacgk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: waveenv
Source: https://github.com/lihonghuacgk/waveterm/tree/main/.kilocode/skills/waveenv
Command: npx skills add https://github.com/lihonghuacgk/waveterm --skill waveenv-lihonghuacgk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

WaveEnv narrowing documents exactly which parts of the environment a component tree uses, forms a concrete type contract for callers and tests, and enables mock environments for preview or test servers.

Core Features & Use Cases

  • Documents exact environment usage for a component tree, enabling precise mocks.
  • Provides a WaveEnvSubset type to constrain envs and tests.
  • Supports both separate env files (env.ts) adjacent to the component and inline exports for small components.
  • Improves reliability by making dependencies explicit and testable across environments.

Quick Start

Export a narrowed WaveEnv type next to your component and use useWaveEnv<MyEnv>() to access only the declared environment fields.

Frequently Asked Questions about waveenv

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I narrow environment types for reliable component testing?

Narrowing environment types for component testing uses a WaveEnvSubset type to constrain envs, making dependencies explicit and tests deterministic across mocked environments without leaking real data.

How do I mock environment variables for preview servers?

Mocking environment variables for preview servers involves defining mock fields that guide safe testing, using inline exports or adjacent env.ts files to document exact environment usage for component trees.

What is the best way to define explicit environment dependencies for component trees?

Defining explicit environment dependencies for component trees is best achieved by exporting a narrowed WaveEnv type next to your component and using useWaveEnv<MyEnv>() to access only declared environment fields.

Can I use inline env definitions instead of separate env.ts files for small components?

Using inline env definitions instead of separate env.ts files is supported for small components, allowing you to export narrowed WaveEnv types directly alongside component code to maintain precise type contracts.

Why does my component test fail due to ambiguous environment shapes?

Ambiguous environment shapes in component tests cause failures because undeclared dependencies leak real data; defining precise WaveEnv dependencies creates a concrete type contract that ensures deterministic behavior.