transparent-ui
Create standalone debugging interfaces that reveal the internal workings of complex systems through interactive visualization. Use when the user wants to understand how something works, debug internal state, visualize data flow, see what happens when they interact with the system, or build a debug panel for any complex mechanism. Triggers on requests like "I don't understand how this works", "show me what's happening", "visualize the state machine", "build a debug view for this", "help me see the data flow", "make this transparent", or any request to understand, debug, or visualize internal system behavior. Applies to state machines, rendering systems, event flows, algorithms, animations, data pipelines, CSS calculations, database queries, or any system with non-obvious internal workings.
NPX Install
npx skill4agent add petekp/claude-code-setup transparent-uiTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Transparent UI
Core Principles
Workflow
Step 1: Identify What to Make Transparent
- State: What values change over time? What's the shape of the data?
- Transitions: What events trigger state changes? What's the sequence?
- Relationships: How do components/modules communicate? What depends on what?
- Hidden logic: What conditions, thresholds, or rules govern behavior?
Step 2: Choose Visualization Approach
| System Type | Primary Visualization | Key Elements |
|---|---|---|
| State machines | Node-edge graph | States as nodes, transitions as edges, current state highlighted |
| Data flow | Directed graph or Sankey | Sources, transformations, sinks with data flowing between |
| Event systems | Timeline or sequence diagram | Events on time axis, handlers, propagation paths |
| Algorithms | Step-by-step animation | Data structure state at each step, highlighting active elements |
| Render/update cycles | Tree with diff overlay | Component tree, what re-rendered, why |
| Animations | Timeline scrubber | Keyframes, easing curves, current progress |
| CSS/Layout | Box model overlay | Computed values, constraint sources |
Step 3: Design Interactivity Level
Step 4: Instrument the System
- Add event emitters at key points
- Wrap state setters to broadcast changes
- Use existing debug/logging hooks if available
- Create observable wrappers around the system
- Intercept calls without modifying core code
- Useful for third-party code or when core modifications are undesirable
// Event emitter pattern - add to existing code
const debugEmitter = new EventEmitter();
function transition(from: State, to: State, event: string) {
debugEmitter.emit('transition', { from, to, event, timestamp: Date.now() });
// ... existing logic
}
// Proxy pattern - wrap without modifying
function createObservableStore<T>(store: T): T & { subscribe: (fn: Listener) => void } {
const listeners: Listener[] = [];
return new Proxy(store, {
set(target, prop, value) {
const oldValue = target[prop];
target[prop] = value;
listeners.forEach(fn => fn({ prop, oldValue, newValue: value }));
return true;
}
});
}Step 5: Build the Debug Route
- Guards against production: Check
process.env.NODE_ENV === 'development' - Connects to instrumentation: Subscribe to events/state changes
- Renders visualization: Use the project's components where possible
- Provides controls: Play/pause, speed, filters, time scrubbing as needed
app/
__dev/
transparent/
[system]/
page.tsx # Dynamic route for different systemsapp/
__dev/
state-machine/
page.tsx- react-flow or reactflow: Node-edge graphs for state machines, data flow
- framer-motion: Smooth transitions in visualization itself
- Existing charting library: If project already has one, use it
Step 6: Document Removal Path
/**
* TRANSPARENT-UI DEBUG TOOL
*
* Temporary debugging visualization. Remove when no longer needed:
* 1. Delete this file: app/__dev/[name]/page.tsx
* 2. Delete instrumentation: src/lib/[system]-debug.ts
* 3. Remove debug hooks from: src/lib/[system].ts (lines XX-YY)
*
* Created for: [description of what this helps debug]
*/Cleanup
- Delete debug route: Remove the page(s)
__dev/ - Remove instrumentation: Delete event emitters, proxies, debug hooks
- Uninstall unused deps: If visualization libraries were added solely for this
- Verify no remnants: Search for ,
debugEmitter, or similar markersTRANSPARENT-UI