KS
Killer-Skills

debug-cross-platform — cross-platform debugging cross-platform debugging, Erlang debugging, JavaScript debugging, logging library, FFI implementation, systematic debugging, quick diagnosis, debugging tools

v1.0.0
GitHub

About this Skill

Perfect for Multi-Language Agents needing systematic cross-platform debugging capabilities across Erlang and JavaScript A cross-platform debugging system for identifying issues in Erlang and JavaScript using a logging library

Features

Systematic approach to debugging
Comprehensive logging library for Erlang and JavaScript
Quick diagnosis using test-erlang and test-js
Identification of FFI implementation mismatches
Comparison of FFI implementations using diff

# Core Topics

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

Quality Score

Top 5%
36
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add tylerbutler/birch/debug-cross-platform

Agent Capability Analysis

The debug-cross-platform MCP Server by tylerbutler is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion. Optimized for cross-platform debugging, Erlang debugging, JavaScript debugging.

Ideal Agent Persona

Perfect for Multi-Language Agents needing systematic cross-platform debugging capabilities across Erlang and JavaScript

Core Value

Empowers agents to diagnose and resolve FFI implementation mismatches using comprehensive logging and comparison tools like diff, targeting Erlang and JavaScript environments with libraries such as birch_ffi.erl and birch_ffi.mjs

Capabilities Granted for debug-cross-platform MCP Server

Debugging cross-platform issues in Erlang and JavaScript applications
Identifying FFI implementation mismatches between targets
Comparing debugging logs across different platforms using tools like just test-erlang and just test-js

! Prerequisites & Limits

  • Requires Erlang and JavaScript environments
  • Limited to debugging Erlang and JavaScript applications
  • Needs access to source code files like src/birch_ffi.erl and src/birch_ffi.mjs for comparison
Project
SKILL.md
3.3 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
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

Related Skills

Looking for an alternative to debug-cross-platform or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

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
Communication

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
Communication