Skip to content

cycosoft/Eyas / .claude/skills/active-test-content-gating

active-test-content-gating

Verified

Architectural post-mortem and operational guidelines for implementing active test content visibility gating in Eyas UI components, specifically addressing IPC-to-Vue state synchronization, Vue test state leaks, and token reduction.

FileKindSize
SKILL.mdskill md2.8 KB
---
description: Architectural post-mortem and operational guidelines for implementing active test content visibility gating in Eyas UI components, specifically addressing IPC-to-Vue state synchronization, Vue test state leaks, and token reduction.
when_to_use: Use when debugging or extending AppHeader, AppHeaderOmniHub, or related navigation components, handling Electron IPC payloads in the Vue UI store, or troubleshooting Vitest UI component test state leaks.
allowed-tools: Read,Grep,Bash,Edit
---

# Feature Post-Mortem: Active Test Content Gating

## Overview
This skill documents the engineering post-mortem from implementing dynamic visibility gating for the `AppHeader` environment chooser dropdown. The dropdown dynamically hides when users navigate away to external websites, while remaining visible during active test content viewing or fallback/startup screens.

## When to Use
- Trigger when debugging or extending `AppHeader`, `AppHeaderOmniHub`, or related navigation components.
- Trigger when handling Electron IPC payloads (`NavigationStatePayload`) in the Vue UI store.
- Trigger when troubleshooting Vitest UI component test state leaks or configuring Vitest CLI executions.

## Instructions

### 1. Production Code Efficiency
- **Collocated State Contracts**: Understand that Electron main-process IPC payloads (`NavigationStatePayload`) map directly to reactive frontend state in `AppHeader.logic.ts`.
- **Pre-defined Helper Types**: Ensure clear separation and definitions of semantic types (`DomainUrl`) vs. raw strings when writing helper utilities, avoiding initial linter rejections (`no-restricted-syntax`).

### 2. Eliminating Test Re-Learning (Shared State Isolation)
- **Module-Level Reactive State Leaks**: In Vue UI testing, state is maintained in exported reactive objects (`export const state = reactive({...})`). Mutating this state in one test (e.g., setting `state.currentUrl`) persists into subsequent test cases unless explicitly cleared.
  - **Mandatory Pattern**: Every UI component test file MUST include a comprehensive state reset in its `beforeEach` block.
- **Explicit Vitest Configs**: Interface unit tests require specific configuration paths. Never run bare `vitest`; always specify:
  ```bash
  npx vitest run path/to/test.ts --config vitest.config.interface.ts
  ```

### 3. Token & Resource Reduction Strategies
- **Targeted CLI Verification**: Avoid running `npm run check` or project-wide linting during iteration. Localize verification to the exact test file and lint target (`npx eslint <file> --fix`) to keep stdout buffers small and token consumption minimal.
- **Precision Grepping**: When searching for IPC channels (e.g., `navigation-state-updated`), filter by directory (`src/eyas-interface` or `src/eyas-core`) rather than scanning the entire repository root.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall