From bb08c7ae61a14e6b49396a98a0cdc2b98ebf1547 Mon Sep 17 00:00:00 2001 From: Loretta Date: Tue, 31 Mar 2026 16:15:02 +0200 Subject: [PATCH] Update LLM instruction files for token efficiency and cross-repo navigation - CLAUDE.md: reduced to single-line pointer to copilot-instructions.md (eliminates redundant auto-loaded content) - copilot-instructions.md: added @repo name field, relative paths in own-dep-repos, "do not re-read .md files" rule, and explicit permission to navigate external repos Co-Authored-By: Claude Opus 4.6 --- .github/copilot-instructions.md | 10 +++++++--- CLAUDE.md | 11 +---------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f89456f..50700ff 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -1,14 +1,17 @@ # Mango.Nop Libraries — Domain Rules +# own-dep-repos: "name: path" — paths are relative to this repo root (.github/..) @repo { + name = "Mango.Nop Libraries" type = "framework" layer = 1 - own-dep-repos = ["AyCode.Core"] + own-dep-repos = ["AyCode.Core: ../../../../../Aycode/Source/AyCode.Core"] } > This is the **single source of truth** for Mango.Nop library rules. Do not duplicate these elsewhere. > For detailed docs see: `README.md` → `docs/` > For core framework rules see: `.github/copilot-instructions.md` (in AyCode.Core repo) +> External repos in `own-dep-repos` are fully accessible — read their source code, docs, and `.github/copilot-instructions.md` freely when you need type definitions, base classes, or context. Do not limit yourself to the current workspace. ## nopCommerce Compatibility 1. All three libraries target **net9.0** — required by nopCommerce 4.80.9. Do NOT change TFM. @@ -37,8 +40,9 @@ 14. **`Mg` prefix** for all custom types: `MgEntityBase`, `MgOrderDto`, `MgDbTableBase`, etc. 15. **No redundant code** — before writing new logic, check whether similar methods already exist in the current context. Reuse or extract shared logic. 16. **Keep all .md files in sync** — when you modify code and you know which .md file documents it, update that .md file too. If you notice a contradiction between code and an .md file, automatically update the .md to match the code (code is the source of truth). When fixing a reference, check other .md files that may share the same broken reference. If the root cause is at a lower layer, fix it there first. During code review, if you find useful behavior or conventions not yet documented, briefly suggest what to document and where — but do not add new content without approval. -17. All AyCode references are via **DLL** (not ProjectReference) — this is intentional. Types not defined in this library (e.g. `IEntityInt`, `IId`, `AcConst`, `ToonDescription`) likely live in AyCode.Core. DLL HintPaths in .csproj point to the correct relative location. -18. **Documentation layering** — write `.md` documentation at the **defining layer** (where the code lives). Higher-layer `.md` files reference AyCode.Core base docs using the form `AyCode.Core/{Project}/docs/FILENAME.md` (resolved via rule 17 base path). Document only project-specific overrides or extensions. Never duplicate base-layer descriptions in consumer-level docs. +17. All AyCode references are via **DLL** (not ProjectReference) — this is intentional. **AyCode.Core** solution (`../../../../../Aycode/Source/AyCode.Core/`) contains all core framework code: interfaces, serialization, binary protocol, SignalR base classes, data sources, logging. Types not defined in this library (e.g. `IEntityInt`, `IId`, `AcConst`, `ToonDescription`) likely live in AyCode.Core. +18. **Do not re-read .md files** already in your context window. They only change if you modify them yourself (new content is already in context) or if the developer tells you they changed — in that case re-read them once. +18. **Documentation layering** — write `.md` documentation at the **defining layer** (where the code lives). Higher-layer `.md` files reference AyCode.Core base docs using the form `../../../../../Aycode/Source/AyCode.Core/{Project}/docs/FILENAME.md`. Document only project-specific overrides or extensions. Never duplicate base-layer descriptions in consumer-level docs. 19. **LinqToDB associations** — use `[Association(ThisKey = nameof(FK), OtherKey = nameof(Target.Id), CanBeNull = true/false)]` for navigation properties in DTOs. 20. **Timestamp auto-management** — entities with `ITimeStampCreated` or `ITimeStampModified` get automatic UTC timestamps in `MgDbTableBase` CRUD hooks. Don't set these manually. diff --git a/CLAUDE.md b/CLAUDE.md index d8f5167..6667677 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,10 +1 @@ -# Mango.Nop Libraries — Claude Code Instructions - -Before writing any code, read these files: -1. `.github/copilot-instructions.md` — Domain rules (single source of truth) -2. `docs/GLOSSARY.md` — Entity/DTO, data access, and service terminology -3. The relevant project's `README.md` for folder-specific context - -These libraries depend on **AyCode.Core** (DLL references — see HintPaths in .csproj for relative location). When a type is referenced but not defined here (e.g. `IEntityInt`, `IAcLoggerBase`, `AcBinarySerializer`, `ToonDescription`), look it up in AyCode.Core source. For core framework rules see `../AyCode.Core/CLAUDE.md`. - -When modifying code, update the corresponding README.md if it becomes out of sync with the code. +Always read `.github/copilot-instructions.md` first — it is the single source of truth for this repo.