CrossLua Reader Development Guide

Define embedded C and Lua plugin development rules for the Xteink X4 e-reader.

36|2|Updated Apr 25, 2026
One-click install
npx skills add https://github.com/dcherrera/CrossLuaReader --skill crosslua-reader-development-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: CrossLua Reader Development Guide
Source: https://github.com/dcherrera/CrossLuaReader/tree/main/.skills
Command: npx skills add https://github.com/dcherrera/CrossLuaReader --skill crosslua-reader-development-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developing for the Xteink X4 e-reader requires navigating strict embedded hardware constraints (380KB RAM, no PSRAM, RISC-V alignment rules), adhering to precise C coding standards, and following safe SDK bridge patterns to avoid bricking devices or causing runtime instability, which is challenging for new contributors without a centralized guide.

Core Features & Use Cases

  • Embedded C Development Rules: Enforces resource discipline (heap/stack safety, flash placement, fixed-point math) and RISC-V-specific safety protocols (alignment, IRAM usage, ISR shared state) tailored to the ESP32-C3 hardware powering the Xteink X4.
  • Lua Plugin System Specifications: Defines the complete lifecycle, API binding patterns, and safety guardrails for building extensible e-reader features (readers, tools, services) that load from the SD card without modifying core firmware.
  • HAL and Build Workflow Guidance: Provides clear patterns for hardware abstraction layer usage, PlatformIO build commands, and debugging techniques for heap/stack monitoring to streamline firmware and plugin development.
  • Use Case: A developer can use this guide to build a custom RTL-aware Bible reader plugin for the Xteink X4 that handles Hebrew text reordering and stores reading progress on the SD card, without reflashing the core runtime.

Quick Start

Follow this development guide to write a compliant Lua plugin for the CrossLua Reader that adds a custom note-taking feature to your unlocked Xteink X4 e-reader.

Frequently Asked Questions about CrossLua Reader Development Guide

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

FAQPage Schema
How do I develop Lua plugins for the Xteink X4 e-reader without crashing the device?

To develop Lua plugins for the Xteink X4 e-reader safely, follow strict lifecycle specifications and API binding patterns that ensure runtime stability within 380KB RAM and 500KB flash limits.

What C coding standards are required for ESP32-C3 RISC-V embedded firmware development?

ESP32-C3 RISC-V embedded firmware requires C coding standards enforcing heap and stack safety, IRAM usage, ISR shared state management, and RISC-V alignment rules to prevent runtime instability.

Can I extend e-reader functionality by loading plugins from an SD card without reflashing core firmware?

Yes, you can load extensible e-reader features and plugins directly from the SD card using the CrossLua Reader system, extending functionality like custom readers without modifying core firmware.

How do I debug heap and stack usage when building e-reader firmware on the ESP32-C3?

Debug ESP32-C3 e-reader firmware heap and stack usage by applying HAL abstraction patterns and utilizing PlatformIO build commands for monitoring memory constraints during plugin development.

What are the hardware constraints for building resource-efficient plugins on the Xteink X4?

The Xteink X4 imposes strict hardware constraints including 380KB RAM, no PSRAM, and a 500KB flash budget, requiring fixed-point math and careful flash placement to maintain device stability.

Why does my embedded e-reader plugin cause runtime instability on RISC-V hardware?

Runtime instability in e-reader plugins on RISC-V hardware often stems from violating HAL usage rules, ignoring IRAM constraints, or exceeding the 380KB RAM budget during C development.