Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
One-time setup that gathers your project's design context and saves it to CLAUDE.md for future sessions.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
scripts/live-discard-manual-edits.mjs
1#!/usr/bin/env node2/**3* CLI helper: discard pending manual edits from the buffer without applying.4*5* Reads .impeccable/live/pending-manual-edits.json, drops entries, writes back.6* No source-file writes. Use this when the user wants to throw away unsaved7* manual edits.8*9* Trigger: only when the user explicitly asks the AI to discard / throw away /10* clear pending manual edits.11*12* Usage:13* node live-discard-manual-edits.mjs # discard all pending14* node live-discard-manual-edits.mjs --page-url=/ # discard only entries for "/"15*16* Output JSON: { discarded: N, entries: [...discardedEntries], totalCount: N }17*/1819import { readBuffer, removeEntries, truncateBuffer } from './live-manual-edits-buffer.mjs';2021function argVal(args, name) {22const prefix = name + '=';23for (const a of args) {24if (a === name) return true;25if (a.startsWith(prefix)) return a.slice(prefix.length);26}27return null;28}2930const args = process.argv.slice(2);31if (args.includes('--help') || args.includes('-h')) {32console.log('Usage: node live-discard-manual-edits.mjs [--page-url=<url>]');33process.exit(0);34}3536const pageUrlFilter = argVal(args, '--page-url');37const cwd = process.cwd();3839let discarded;40let entries;41const buffer = readBuffer(cwd);42if (pageUrlFilter) {43entries = buffer.entries.filter((entry) => entry.pageUrl === pageUrlFilter);44discarded = removeEntries(cwd, (entry) => entry.pageUrl === pageUrlFilter);45} else {46entries = buffer.entries;47discarded = truncateBuffer(cwd);48}4950const remaining = readBuffer(cwd).entries.reduce((n, e) => n + e.ops.length, 0);51console.log(JSON.stringify({ discarded, entries, totalCount: remaining }));52