Kein-chronicle

LLM Text Edit Revision Guard — AI skill for Claude Code

AI community

Apply AI-proposed text edits only to the exact revision they were written against, with expected-text checks and overlap rejection.

How to install LLM Text Edit Revision Guard

This entry records only its repository, not the path inside it, so there is no exact command to give. Open Kein-chronicle/llm-text-edit-revision-guard and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What LLM Text Edit Revision Guard does

Apply AI-proposed text edits only to the exact revision they were written against, with expected-text checks and overlap rejection.

Alternatives in AI

  • Paul — Plan-Apply-Unify Loop — Structured AI-assisted development for Claude Code 1.2k ★
  • SkillEvaluator — Multi-tier framework for evaluating AI agent skills with quality gates, semantic overlap detection, synthetic 327 ★
  • Agentlint — Local guardrails for AI coding agents 38 ★

README

llm-text-edit-revision-guard

**Apply AI-proposed text edits only to the exact revision they were written against, with expected-text checks and overlap rejection.**

[![test](https://github.com/Kein-chronicle/llm-text-edit-revision-guard/actions/workflows/test.yml/badge.svg)](https://github.com/Kein-chronicle/llm-text-edit-revision-guard/actions/workflows/test.yml) ![license](https://img.shields.io/badge/license-MIT-blue.svg) ![dependencies](https://img.shields.io/badge/dependencies-none-brightgreen.svg)

Why

An LLM proposes edits against a snapshot, a person approves them minutes later, and by then the document has moved. Applying offsets to the new text corrupts it. Each edit carries the text it expects to replace, and the whole proposal carries the revision it was made against.

Install

**As a Claude Code skill** (Claude uses it when the task matches the skill description):

git clone https://github.com/Kein-chronicle/llm-text-edit-revision-guard.git ~/.claude/skills/revision-bound-edit

For a single project, clone into `/.claude/skills/revision-bound-edit` instead, then start a new Claude Code session.

**As a library** (Node.js 22+, no dependencies):

npm install github:Kein-chronicle/llm-text-edit-revision-guard

or copy the one file you need: `scripts/edit.mjs` is self-contained.

**Requires:** Node.js 22+.

Quick start

Run the quickstart:

$ node examples/quickstart.mjs
The slow brown fox jumps over the sleepy dog.
refused: document moved on (rev-8) -> STALE_REVISION
refused: text under the range changed -> CONTEXT_MISMATCH
refused: two edits overlap -> OVERLAPPING_EDITS

The output above is real: it is produced by the files in `examples/`.

API

import { applyEdits } from 'llm-text-edit-revision-guard';

applyEdits('The quick brown fox.', {
  baseRevision: 'rev-7',
  edits: [{ start: 4, end: 9, expected: 'quick', text: 'slow' }],   // zero-based UTF-16 offsets, end exclusive
}, 'rev-7');