debug-cross-platform — community debug-cross-platform, community, ide skills, Claude Code, Cursor, Windsurf

v1.0.0
GitHub

About this Skill

Essential for Gleam development agents debugging cross-platform compatibility issues between Erlang and JavaScript targets. Logs that gleam. ✨🪵✨ A comprehensive logging library in Gleam that targets both Erlang and JavaScript.

tylerbutler tylerbutler
[0]
[0]
Updated: 3/5/2026

Agent Capability Analysis

The debug-cross-platform skill by tylerbutler is an open-source community AI agent skill for Claude Code and other IDE workflows, helping agents execute tasks with better context, repeatability, and domain-specific guidance.

Ideal Agent Persona

Essential for Gleam development agents debugging cross-platform compatibility issues between Erlang and JavaScript targets.

Core Value

Enables systematic diagnosis of platform-specific failures through comprehensive logging and FFI implementation comparison. Provides immediate test execution via Just commands to identify which target platform fails, and offers direct diff comparison tools for FFI function analysis.

Capabilities Granted for debug-cross-platform

Diagnosing Erlang vs JavaScript behavioral mismatches
Comparing FFI implementation differences across platforms
Running targeted platform tests to isolate failures
Identifying platform-specific function implementation gaps

! Prerequisites & Limits

  • Requires Gleam project structure with FFI files
  • Dependent on Just command availability
  • Limited to Erlang and JavaScript target environments
Labs Demo

Browser Sandbox Environment

⚡️ Ready to unleash?

Experience this Agent in a zero-setup browser environment powered by WebContainers. No installation required.

Boot Container Sandbox

debug-cross-platform

Install debug-cross-platform, an AI agent skill for AI agent workflows and automation. Works with Claude Code, Cursor, and Windsurf with one-command setup.

SKILL.md
Readonly

Cross-Platform Debugging

Systematic approach to debugging issues that only occur on Erlang OR JavaScript.

Quick Diagnosis

bash
1# Run on both targets to identify which fails 2just test-erlang 3just test-js

Common Causes

1. FFI Implementation Mismatch

Symptom: Different behavior between targets for the same function.

Check:

bash
1# Compare FFI implementations 2diff <(grep -A 20 "function_name" src/birch_ffi.erl) \ 3 <(grep -A 20 "function_name" src/birch_ffi.mjs)

Common issues:

  • Return type mismatch (tuples vs arrays)
  • Error handling differences
  • String encoding (UTF-8 handling)

2. Platform-Specific APIs

Symptom: Function works on one platform, undefined/error on other.

JavaScript-only APIs:

  • process.stdout, process.stderr (Node.js)
  • Deno.isatty() (Deno)
  • console.log behavior varies by runtime

Erlang-only APIs:

  • Process dictionary (erlang:put/get)
  • OTP behaviors (gen_server, etc.)
  • :logger integration

3. Async Behavior

Symptom: Race conditions or timing issues on JavaScript.

Check:

  • Erlang is synchronous by default
  • JavaScript may need await or callbacks
  • Look for Promise handling in FFI

4. Type Coercion

Symptom: Unexpected values or type errors.

Gleam TypeErlangJavaScript
IntIntegerNumber
FloatFloatNumber
StringBinaryString
ListListArray
TupleTupleArray
Nilnil atomundefined

5. TTY/Terminal Detection

Symptom: Color output works on one platform.

Check:

gleam
1// In platform.gleam 2is_stdout_tty() // Different implementation per platform

Debugging Steps

Step 1: Isolate the Failure

bash
1# Run specific test 2gleam test --target erlang -- --filter "test_name" 3gleam test --target javascript -- --filter "test_name"

Step 2: Add Debug Output

gleam
1// Temporary debug logging 2import gleam/io 3io.debug(value) // Works on both targets

Step 3: Check FFI

  1. Read src/birch/internal/platform.gleam for declarations
  2. Compare src/birch_ffi.erl and src/birch_ffi.mjs
  3. Look for behavioral differences

Step 4: Test JavaScript Runtimes

bash
1# Test on all JS runtimes 2just test-integration-node 3just test-integration-deno 4just test-integration-bun

Step 5: Check Runtime Detection

In birch_ffi.mjs, verify runtime detection:

javascript
1// Node.js 2typeof process !== 'undefined' && process.versions?.node 3 4// Deno 5typeof Deno !== 'undefined' 6 7// Bun 8typeof Bun !== 'undefined' 9 10// Browser 11typeof window !== 'undefined'

FFI Debugging Checklist

  • Both implementations exist for the function
  • Return types match Gleam declaration
  • Error cases handled identically
  • Edge cases (empty string, null, special chars) tested
  • All JS runtimes have fallbacks (Node, Deno, Bun, browser)

Quick Fixes

IssueErlang FixJavaScript Fix
Undefined functionCheck module exportsCheck export statement
Wrong return typeMatch Gleam type exactlyReturn correct JS type
Encoding issuesUse unicode:characters_to_binaryUse TextEncoder
TTY detectionCheck os:type()Check process.stdout.isTTY

FAQ & Installation Steps

These questions and steps mirror the structured data on this page for better search understanding.

? Frequently Asked Questions

What is debug-cross-platform?

Essential for Gleam development agents debugging cross-platform compatibility issues between Erlang and JavaScript targets. Logs that gleam. ✨🪵✨ A comprehensive logging library in Gleam that targets both Erlang and JavaScript.

How do I install debug-cross-platform?

Run the command: npx killer-skills add tylerbutler/birch/debug-cross-platform. It works with Cursor, Windsurf, VS Code, Claude Code, and 19+ other IDEs.

What are the use cases for debug-cross-platform?

Key use cases include: Diagnosing Erlang vs JavaScript behavioral mismatches, Comparing FFI implementation differences across platforms, Running targeted platform tests to isolate failures, Identifying platform-specific function implementation gaps.

Which IDEs are compatible with debug-cross-platform?

This skill is compatible with Cursor, Windsurf, VS Code, Trae, Claude Code, OpenClaw, Aider, Codex, OpenCode, Goose, Cline, Roo Code, Kiro, Augment Code, Continue, GitHub Copilot, Sourcegraph Cody, and Amazon Q Developer. Use the Killer-Skills CLI for universal one-command installation.

Are there any limitations for debug-cross-platform?

Requires Gleam project structure with FFI files. Dependent on Just command availability. Limited to Erlang and JavaScript target environments.

How To Install

  1. 1. Open your terminal

    Open the terminal or command line in your project directory.

  2. 2. Run the install command

    Run: npx killer-skills add tylerbutler/birch/debug-cross-platform. The CLI will automatically detect your IDE or AI agent and configure the skill.

  3. 3. Start using the skill

    The skill is now active. Your AI agent can use debug-cross-platform immediately in the current project.

Related Skills

Looking for an alternative to debug-cross-platform or another community skill for your workflow? Explore these related open-source skills.

View All

widget-generator

Logo of f
f

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

149.6k
0
AI

flags

Logo of vercel
vercel

flags is a Next.js feature management skill that enables developers to efficiently add or modify framework feature flags, streamlining React application development.

138.4k
0
Browser

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
AI