From 73ef60fdeba56ef61bcb1bf6104a868a8a4899e1 Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Tue, 1 Sep 2026 14:43:34 -0500 Subject: [PATCH] docs(rules): strengthen working tree pre-creation checks and architectural review in AGENTS.md and CLAUDE.md --- AGENTS.md | 11 ++++++----- CLAUDE.md | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 8c3b502..7115413 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -11,16 +11,17 @@ ## 2. Working Tree Authority & Safety (MANDATORY) The working tree represents the user's active work. -1. **Inspect First:** Run `git status` and read target files before modifying anything. -2. **Never Overwrite Blindly:** Use available file-reading tools. Preserve user comments, links, and conventions. Prefer surgical edits over wholesale overwrites. -3. **No Destructive Git Commands:** Never run `reset --hard`, `clean -fd`, `restore`, `checkout`, `stash`, `rebase`, or `amend` without explicit permission. -4. **Final Diff Verification:** Before completing work, run `git status` and `git diff` to verify that no unrelated user changes were modified or discarded. Distinguish user changes from agent changes in completion reports. +1. **Inspect First:** Run `git status` and list/read target directories/files before creating or modifying anything. +2. **Check for Existing Files:** Before creating any new file, verify whether the file (or a user equivalent) already exists on disk. Never overwrite or re-scaffold user work. +3. **Never Overwrite Blindly:** Use available file-reading tools. Preserve user comments, links, and conventions. Prefer surgical edits over wholesale overwrites. +4. **No Destructive Git Commands:** Never run `reset --hard`, `clean -fd`, `restore`, `checkout`, `stash`, `rebase`, or `amend` without explicit permission. +5. **Final Diff Verification:** Before completing work, run `git status` and `git diff` to verify that no unrelated user changes were modified or discarded. Distinguish user changes from agent changes in completion reports. --- ## 3. Architecture & Component Contracts (Progressive Triggers) -- **Read `docs/architecture.md`** before modifying API contracts, changing gRPC/Protobuf definitions, or crossing BFF/Worker/Transmission boundaries. +- **Mandatory Architecture Review:** Always read `docs/architecture.md` before making any changes affecting API routes, gRPC definitions, database models, directory layouts, or component boundaries. - **Read `docs/deployment.md`** before altering networking, Traefik routing, Authelia SSO middleware, or Docker volume bindings. - **Stop and Ask:** If an implementation conflicts with documentation or an ambiguous requirement materially affects architecture, stop and ask the user rather than guessing or silently changing the design. - **No Speculative Robustness:** Do not add unrequested fallback layers, complex generic abstractions, or future-proofing bloat. diff --git a/CLAUDE.md b/CLAUDE.md index ef23481..13d5c5c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -2,6 +2,7 @@ ## Progressive Context Loading - Do not load external rule files for simple localized code edits. +- Always inspect `git status` and verify existing files on disk before creating or scaffolding new files. - Read `AGENTS.md` before making changes affecting database schema, package dependencies, Git state, or cross-component contracts. - Read `docs/architecture.md` before modifying API routes, gRPC definitions, or worker state machines. - Read `docs/deployment.md` before changing Dockerfiles, Compose services, or Traefik/Authelia configs.