From 36b74db7816b34dc269f5c7dfa2941258478d718 Mon Sep 17 00:00:00 2001 From: Hirogen Date: Sat, 27 Jun 2026 10:50:29 +0200 Subject: [PATCH] update guardrails in case --- .github/CLAUDE.md | 56 +++++++++++++++++++++++++++++++++ .github/copilot-instructions.md | 56 +++++++++++++++++++++++++++++++++ CONTEXT.md | 38 ++++++++++++++++++++++ 3 files changed, 150 insertions(+) create mode 100644 CONTEXT.md diff --git a/.github/CLAUDE.md b/.github/CLAUDE.md index da1bb1a1..aa807299 100644 --- a/.github/CLAUDE.md +++ b/.github/CLAUDE.md @@ -2,6 +2,62 @@ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. +## 1. Think Before Coding + +**Don't assume. Don't hide confusion. Surface tradeoffs.** + +Before implementing: +- State your assumptions explicitly. If uncertain, ask. +- If multiple interpretations exist, present them - don't pick silently. +- If a simpler approach exists, say so. Push back when warranted. +- If something is unclear, stop. Name what's confusing. Ask. + +## 2. Simplicity First + +**Minimum code that solves the problem. Nothing speculative.** + +- No features beyond what was asked. +- No abstractions for single-use code. +- No "flexibility" or "configurability" that wasn't requested. +- No error handling for impossible scenarios. +- If you write 200 lines and it could be 50, rewrite it. + +Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify. + +## 3. Surgical Changes + +**Touch only what you must. Clean up only your own mess.** + +When editing existing code: +- Don't "improve" adjacent code, comments, or formatting. +- Don't refactor things that aren't broken. +- Match existing style, even if you'd do it differently. +- If you notice unrelated dead code, mention it - don't delete it. + +When your changes create orphans: +- Remove imports/variables/functions that YOUR changes made unused. +- Don't remove pre-existing dead code unless asked. + +The test: Every changed line should trace directly to the user's request. + +## 4. Goal-Driven Execution + +**Define success criteria. Loop until verified.** + +Transform tasks into verifiable goals: +- "Add validation" → "Write tests for invalid inputs, then make them pass" +- "Fix the bug" → "Write a test that reproduces it, then make it pass" +- "Refactor X" → "Ensure tests pass before and after" + +For multi-step tasks, state a brief plan: +``` +1. [Step] → verify: [check] +2. [Step] → verify: [check] +3. [Step] → verify: [check] +``` + +Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification. + ## Project Overview LogExpert is a Windows log file viewer and analyzer built with C# and Windows Forms. It's a GUI replacement for the Unix `tail` command with extensive features including tail mode, filtering, bookmarks, highlighting, and a plugin-based architecture for parsing custom log formats. diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7cb04ee9..a6c61524 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,5 +1,61 @@ # GitHub Copilot Instructions for LogExpert +## 1. Think Before Coding + +**Don't assume. Don't hide confusion. Surface tradeoffs.** + +Before implementing: +- State your assumptions explicitly. If uncertain, ask. +- If multiple interpretations exist, present them - don't pick silently. +- If a simpler approach exists, say so. Push back when warranted. +- If something is unclear, stop. Name what's confusing. Ask. + +## 2. Simplicity First + +**Minimum code that solves the problem. Nothing speculative.** + +- No features beyond what was asked. +- No abstractions for single-use code. +- No "flexibility" or "configurability" that wasn't requested. +- No error handling for impossible scenarios. +- If you write 200 lines and it could be 50, rewrite it. + +Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify. + +## 3. Surgical Changes + +**Touch only what you must. Clean up only your own mess.** + +When editing existing code: +- Don't "improve" adjacent code, comments, or formatting. +- Don't refactor things that aren't broken. +- Match existing style, even if you'd do it differently. +- If you notice unrelated dead code, mention it - don't delete it. + +When your changes create orphans: +- Remove imports/variables/functions that YOUR changes made unused. +- Don't remove pre-existing dead code unless asked. + +The test: Every changed line should trace directly to the user's request. + +## 4. Goal-Driven Execution + +**Define success criteria. Loop until verified.** + +Transform tasks into verifiable goals: +- "Add validation" → "Write tests for invalid inputs, then make them pass" +- "Fix the bug" → "Write a test that reproduces it, then make it pass" +- "Refactor X" → "Ensure tests pass before and after" + +For multi-step tasks, state a brief plan: +``` +1. [Step] → verify: [check] +2. [Step] → verify: [check] +3. [Step] → verify: [check] +``` + +Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification. + ## Repository Overview **LogExpert** is a Windows-based log file tail and analysis application written in C#. It's a GUI replacement for the Unix tail command, originally from CodePlex, with extensive features for viewing, analyzing, and filtering log files. diff --git a/CONTEXT.md b/CONTEXT.md new file mode 100644 index 00000000..e3f3522b --- /dev/null +++ b/CONTEXT.md @@ -0,0 +1,38 @@ +# LogExpert + +A Windows log file viewer that supports real-time tailing, filtering, highlighting, bookmarking, and columnar parsing of structured log formats. + +## Language + +### Log Viewing + +**Log Window**: The control that displays, tails, and filters a single log file. One Log Window per open file. +_Avoid_: Tab, panel, view + +**Session**: A named set of Log Windows and their layout, persisted to disk and restored together. +_Avoid_: Project, workspace, profile + +**Columnizer**: A plugin that parses a raw log line into typed columns for structured display. +_Avoid_: Parser, formatter + +**Highlight Group**: A named set of rules that colour-code log lines by content pattern. +_Avoid_: Colour scheme, filter rule + +### External Tools + +**External Tool**: A user-configured command-line program that LogExpert can launch from the Tool Launcher Bar, optionally with Sysout Capture. +_Avoid_: Plugin, script + +**Sysout Capture**: A mode for an External Tool where the tool's stdout is redirected to a temp file and opened as a live Log Window. +_Avoid_: Stdout pipe, output redirect + +**Tool Launcher Bar**: The toolbar strip populated from the configured External Tool entries. +_Avoid_: Toolbar, tool strip + +### Sessions & Persistence + +**Session File**: A `.lxj` file that stores the list of log files, per-file settings, and the dock layout for a Session. +_Avoid_: Project file, config file + +**Session File Reference** (`.lxp`): An indirection file that maps to one or more actual log files, allowing a Session to track a logical source rather than a fixed path. +_Avoid_: Log pointer, alias