smithery/plurigrid

ewig-editor

The eternal text editor — Didactic Ersatz Emacs demonstrating immutable data-structures and the single-atom architecture.

Installation

$ npx skills add smithery/plurigrid --skill ewig-editor

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/plurigrid · top by installs.

npx skills add smithery/plurigrid

Browse all from smithery/plurigrid

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
trit
0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 4,018 B
  • docs SUMMARY.md 92 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Ewig - Eternal Didactic Text Editor

The eternal text editor — Didactic Ersatz Emacs demonstrating immutable data-structures and the single-atom architecture.

Repository

Core Concept

Ewig demonstrates how to build a text editor using:

  1. Immutable data structures - All state changes create new versions
  2. Single-atom architecture - One atom holds the entire application state
  3. Structural sharing - Efficient memory via shared structure
// Single atom state
atom<editor_state> state;

// All mutations are pure transformations
state.update([](editor_state s) {
    return s.insert_char('x');  // Returns new state, doesn't mutate
});

Architecture

┌─────────────────────────────────────────────────────┐
│                      Ewig                           │
├─────────────────────────────────────────────────────┤
│                                                     │
│   ┌─────────────────────────────────────────────┐   │
│   │              Single Atom                    │   │
│   │         (immutable editor_state)            │   │
│   └─────────────────────────────────────────────┘   │
│        │                              │             │
│        ▼                              ▼             │
│   ┌─────────┐                    ┌─────────┐       │
│   │ immer   │   structural       │ lager   │       │
│   │ vectors │   sharing          │ cursors │       │
│   └─────────┘                    └─────────┘       │
│                                                     │
└─────────────────────────────────────────────────────┘

Key Libraries

immer

Persistent immutable data structures for C++:

#include <immer/vector.hpp>

immer::vector<char> buffer = {'h', 'e', 'l', 'l', 'o'};
auto new_buffer = buffer.push_back('!');  // O(log n), shares structure

lager

Unidirectional data-flow architecture:

auto store = lager::make_store<action>(
    model{},
    lager::with_reducer(update),
    lager::with_effect(effect)
);

Relevance to CRDT/Collaborative Editing

Ewig's immutable architecture aligns with CRDT principles:

Ewig Concept CRDT Parallel
Immutable state Operation-based CRDT
Structural sharing Delta-state CRDT
Single atom Causal consistency
Pure transformations Commutative operations

Integration with crdt-vterm-bridge

The single-atom pattern can be applied to terminal state:

// Terminal state as immutable atom
struct terminal_state {
    immer::flex_vector<line> lines;
    cursor_pos cursor;
    gf3_trit trit;  // GF(3) assignment
};

atom<terminal_state> term_state;

Building

git clone https://github.com/bmorphism/ewig
cd ewig
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
./ewig

Related Skills

  • code-refactoring - Immutable refactoring patterns
  • bisimulation-game - State equivalence
  • gay-mcp - Deterministic UI coloring