xs-debugging

Diagnose XS engine value-stack overflows by classifying import-time width versus runtime recursion depth.

3|2|Updated May 12, 2026
One-click install
npx skills add https://github.com/kriscendobot/garden --skill xs-debugging
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xs-debugging
Source: https://github.com/kriscendobot/garden/tree/main/skills/xs-debugging
Command: npx skills add https://github.com/kriscendobot/garden --skill xs-debugging

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill addresses XS value-stack exhaustion, a common failure mode in Agoric and Endo environments where memory limits are hit during module evaluation or deep recursion.

Core Features & Use Cases

  • Signal Classification: Identifies whether a crash is caused by stack width (import-time) or call-depth (recursion).
  • Instrumentation Guidance: Provides a methodology for interleaving C-stack traces with symbolicated JavaScript frames to pinpoint the exact line of code causing the overflow.
  • Remediation Strategies: Offers a decision framework for choosing between targeted code refactoring (e.g., replacing flatMap with loops) and systemic configuration changes (e.g., increasing stackCount).

Quick Start

Use the xs-debugging skill to analyze the latest stack overflow signal and determine if a targeted code rewrite is required.

Frequently Asked Questions about xs-debugging

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

FAQPage Schema
Why does my XS engine hit a value-stack overflow during module evaluation in Agoric?

XS engine value-stack overflow during module evaluation in Agoric typically occurs when import-time stack width exceeds memory limits. This skill classifies the crash signal to distinguish between import-time width issues and runtime recursion depth to pinpoint the cause.

How do I diagnose XS stack exhaustion in Endojs development environments?

To diagnose XS stack exhaustion in Endojs environments, you need systematic trace analysis that interleaves C-stack traces with symbolicated JavaScript frames. This methodology pinpoints the exact line of code causing the value-stack overflow.

What is the difference between stack width and call-depth when debugging XS engine crashes?

Stack width refers to import-time memory consumption during module evaluation, while call-depth relates to runtime recursion limits. Distinguishing between these two failure modes is essential for applying the correct remediation strategy to resolve stack exhaustion.

What's the best way to resolve array-heavy stack overflows in JavaScript running on the XS engine?

The best way to resolve array-heavy stack overflows in JavaScript on the XS engine is targeted code refactoring, such as replacing flatMap operations with loops. This reduces call-depth pressure and maintains engine stability without requiring systemic configuration changes.

When should I increase stackCount instead of refactoring code to fix an XS stack overflow?

You should increase stackCount as a systemic configuration change when targeted code refactoring cannot resolve the stack overflow. This skill provides a decision framework to help choose between code rewrites and configuration adjustments based on the specific overflow signal.

Can I use this debugging approach for JavaScript performance issues outside of Agoric-sdk?

This debugging approach specifically applies to XS engine environments like Agoric-sdk and Endojs where memory constraints trigger stack exhaustion. It focuses on resolving value-stack overflows unique to these JavaScript runtime environments.