ewig-editor

The eternal text editor — Didactic Ersatz Emacs demonstrating immutable

16 stars

Best use case

ewig-editor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

The eternal text editor — Didactic Ersatz Emacs demonstrating immutable

Teams using ewig-editor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ewig-editor/SKILL.md --create-dirs "https://raw.githubusercontent.com/plurigrid/asi/main/plugins/asi/skills/ewig-editor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ewig-editor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ewig-editor Compares

Feature / Agentewig-editorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

The eternal text editor — Didactic Ersatz Emacs demonstrating immutable

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Ewig - Eternal Didactic Text Editor

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

## Repository
- **Source**: https://github.com/bmorphism/ewig (fork of arximboldi/ewig)
- **Language**: C++ (immer library)
- **Pattern**: Persistent data structures + single atom state

## 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

```cpp
// 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++:
```cpp
#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:
```cpp
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:

```cpp
// 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

```bash
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



## Scientific Skill Interleaving

This skill connects to the K-Dense-AI/claude-scientific-skills ecosystem:

### Graph Theory
- **networkx** [○] via bicomodule
  - Universal graph hub

### Bibliography References

- `general`: 734 citations in bib.duckdb

## Cat# Integration

This skill maps to **Cat# = Comod(P)** as a bicomodule in the equipment structure:

```
Trit: 0 (ERGODIC)
Home: Prof
Poly Op: ⊗
Kan Role: Adj
Color: #26D826
```

### GF(3) Naturality

The skill participates in triads satisfying:
```
(-1) + (0) + (+1) ≡ 0 (mod 3)
```

This ensures compositional coherence in the Cat# equipment structure.

Related Skills

jepsen-testing

16
from plurigrid/asi

Jepsen-style correctness testing for distributed systems under faults (partitions, crashes, clock skew) using concurrent operation histories and formal checkers (linearizability/serializability and Elle-style anomalies). Use when designing, implementing, or running Jepsen tests, or interpreting histories/violations.

Deterministic Color Generation via Metadata Hashing

16
from plurigrid/asi

**Status**: ✅ Production Ready

cyton-dongle

16
from plurigrid/asi

Connect and stream from OpenBCI Cyton/Daisy via USB dongle, including first-time radio channel pairing

asi-transient-agenda

16
from plurigrid/asi

Org-agenda-like transient views for ASI skill orchestration via nbb/squint + Emacs hydra

Topological Superintelligence (TSI)

16
from plurigrid/asi

Compositional AI framework using GF(3) triadic balance and category-theoretic foundations.

zx-calculus

16
from plurigrid/asi

Coecke's ZX-calculus for quantum circuit reasoning via string diagrams with Z-spiders (green) and X-spiders (red)

zulip-cogen

16
from plurigrid/asi

Zulip Cogen Skill 🐸⚡

zls-integration

16
from plurigrid/asi

zls-integration skill

zig

16
from plurigrid/asi

zig skill

zig-syrup-bci

16
from plurigrid/asi

Multimodal BCI pipeline in Zig: DSI-24 EEG, fNIRS mBLL, eye tracking IVT, LSL sync, EDF read/write, GF(3) conservation

zig-programming

16
from plurigrid/asi

zig-programming skill

zeroth-bot

16
from plurigrid/asi

Zeroth Bot - 3D-printed open-source humanoid robot platform for sim-to-real and RL research. Affordable entry point for humanoid robotics.