Index of every page on this site: llms.txt
All skills
lassejlv avatar

/libtermy-implementation

@72a388a
by Lasselassejlv/skills70 stars
2
Run it yourself

Implement, integrate, review, or optimize Termy's libtermy embeddable terminal engine. Use when working with termy_core Rust API, termy_ffi C ABI, crates/ffi/include/termy.h, Rust/C/Swift bindings, macOS SwiftUI or AppKit terminal hosts, frame snapshots, damage-scoped rendering, FFI ownership, config/render metrics, PTY/display modes, terminal input, search, events, tmux display terminals, or performance gates for libtermy-based apps.

Use this Skill: https://skilld.dev/gh/lassejlv/skills/libtermy-implementation

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈116 tokens for metadata: the name and description. ≈735 when used: this file. ≈5.6k more on demand in 4 files.

Description uses 5.8% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈464 characters, or 5.8%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

libtermy Implementation

Core Workflow

  1. Inspect the current Termy checkout or upstream docs first. Treat libtermy as experimental and breaking-change prone.
  2. Choose the narrowest surface:
    • Use termy_core for Rust embedders or changes that should be portable to FFI, WASM, JS, and tests.
    • Use termy_ffi for C, Swift, Objective-C, or any host that needs a stable C ABI.
    • Use the macOS Swift reference when building or tuning the native macOS host.
  3. Keep terminal behavior in Rust core. Do not reimplement VT parsing, keyboard/mouse encoding, search, shell integration, color query replies, resize anchoring, config parsing, or dirty damage tracking in the host.
  4. Build hosts around full-or-partial frame updates. Prefer frame_update / termy_terminal_take_frame_update over polling full snapshots in a render loop.
  5. Validate at the boundary you touched before broadening test scope.

Reference Routing

  • Read references/libtermy-api.md when touching termy_core, termy_ffi, ABI structs/functions, event/search/input APIs, config/render config, ownership, threading, or Rust embedding.
  • Read references/macos-swift-host.md when implementing a macOS Swift app, SwiftPM linking, CTermy, LibTermyTerminal, wakeup monitoring, AppKit rendering, panes/tabs, settings, or tmux display terminals.
  • Read references/optimization.md when optimizing rendering, reducing FFI marshaling, tuning cadence, avoiding CPU/RSS regressions, reviewing performance PRs, or adding gates.

Non-Negotiable Rules

  • Serialize access to each TermyFfiTerminal handle unless the C header explicitly names the wake channel exception.
  • Free every FFI result with its matching free function. Never free payloads owned by an event/search/config batch separately.
  • Derive cell size from libtermy render config or measure_cell; do not guess monospace ratios in the host.
  • Preserve the flat cell contract: full frames are row-major; partial updates provide cells in dirty-span order.
  • Keep termy_core independent of GPUI, desktop app chrome, Swift, and termy_ffi.
  • On macOS, keep SwiftUI out of the hot grid path. Use retained AppKit drawing, dirty rect invalidation, cached row render plans, and display-synced polling.
  • Do not force full frame updates for ordinary input, scroll, or wakeup ticks.

Validation

Use scripts/check_libtermy_repo.sh to orient an agent in a Termy checkout:

~/.codex/skills/libtermy-implementation/scripts/check_libtermy_repo.sh /path/to/termy

Run targeted checks based on the change:

cargo test -p termy_core
cargo test -p termy_ffi
cargo build -p termy_ffi
TERMY_FFI_LIBRARY_PATH="$PWD/target/debug" swift test --package-path macos
macos/scripts/check-performance-gates.sh --native-render-metrics
macos/scripts/check-render-perf.sh

Use broader macOS release gates only when packaging, launch behavior, signing, or app-level regressions are in scope.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts4mo3 checks · Risk SAFE
  • Gen Agent Trust Hub4mo

    The skill provides technical documentation and scripts for integrating the 'libtermy' terminal engine into Rust and macOS Swift applications. It includes a repository validation script that uses standard development tools like cargo and swift. No security concerns were identified.

  • Socket4mo

    No alerts

  • Snyk4mo

    Risk: LOW · No issues

Signed by skilld at 72a388a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 6 days ago.

Activeupdated 4 months ago

README badge

README badge for lassejlv/skills/libtermy-implementation