From d7d6a60c9d8c453c25d523fb43ff53da016bf3f6 Mon Sep 17 00:00:00 2001 From: Loretta Date: Sun, 26 Apr 2026 13:44:27 +0200 Subject: [PATCH] [LOADED_DOCS: NONE] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactor skill loading protocol in copilot-instructions Clarified session setup: only two reactive skills are pre-loaded, with three user-gated skills now lazy-loaded on demand. Updated documentation to add "AUTHORITY, RULE SCOPE, AND SKILL INVOCATION" section, revised skill trigger descriptions, and adjusted `[LOADED_DOCS: ...]` prefix logic. Documented docs-archive as a lazy-loaded skill. Added settings.local.json for local file removal permissions. No code logic changes—documentation and protocol only. --- .../.github/copilot-instructions.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Nop.Plugin.Misc.AIPlugin/.github/copilot-instructions.md b/Nop.Plugin.Misc.AIPlugin/.github/copilot-instructions.md index 08eac58..9f91bbc 100644 --- a/Nop.Plugin.Misc.AIPlugin/.github/copilot-instructions.md +++ b/Nop.Plugin.Misc.AIPlugin/.github/copilot-instructions.md @@ -10,15 +10,18 @@ This plugin follows the AI Agent Core Protocol defined in AyCode.Core. Same rule **Mandatory reads at session start** — in addition to this `copilot-instructions.md`, the agent MUST also load: 1. **Canonical AI Agent Core Protocol** — AyCode.Core's `copilot-instructions.md` (for the full numbered Rules #1-5 that this inherit file references but does NOT duplicate). Path: `../../../../../../Aycode/Source/AyCode.Core/.github/copilot-instructions.md`. -2. **The four workspace skills** (see `## Shared Agent Skills` section below for paths): +2. **The two reactive workspace skills** (see `## Shared Agent Skills` section below for paths; the three user-gated skills are lazy-loaded on demand): - `docs-discovery/SKILL.md` — **reactive** (triggers on domain questions) - `docs-check/SKILL.md` — **reactive** (triggers at end of code-modifying responses) - - `protocol-audit/SKILL.md` — **on-demand** (triggers on explicit "audit protocol" command) - - `adr-author/SKILL.md` — **on-demand + LLM-suggested** (triggers on explicit planning/design requests, or LLM flag + user confirmation) -The first response's `[LOADED_DOCS: ...]` prefix must reflect **6 files** (this file + AyCode.Core's `copilot-instructions.md` + 4 SKILL.md files). +Lazy-loaded (read on invocation, not at session start; the `## Shared Agent Skills` bullets below describe their triggers): + - `protocol-audit/SKILL.md` — user-invoked / LLM-suggest-back on meta-protocol file modifications + - `adr-author/SKILL.md` — user-invoked / LLM-suggest-back on ADR-worthy conversation + - `docs-archive/SKILL.md` — user-invoked / LLM-suggest-back on bloated active artifact files -**Why mandatory**: workspace skills are NOT in Claude Code's native skill-registry / system-reminder — without pre-loading, implicit triggers (e.g., "domain question → invoke docs-discovery" at the moment of the question) may be missed. This file inherits rules from AyCode.Core, so the canonical protocol file must be loaded alongside. One-time cost per session; Rule #3 (no-re-read) prevents repeated reads; re-read only if Rule #4 (Context Recovery) fires. +The first response's `[LOADED_DOCS: ...]` prefix must reflect **4 files** (this file + AyCode.Core's `copilot-instructions.md` + 2 reactive SKILL.md files). Lazy-loaded skills add to the count when invoked. + +**Why mandatory**: workspace skills live as plain `SKILL.md` files in `.github/skills/` — LLMs do NOT auto-discover them via any built-in skill-registry. Without pre-loading, implicit triggers (e.g., "domain question → invoke docs-discovery" at the moment of the question) may be missed. This file inherits rules from AyCode.Core, so the canonical protocol file must be loaded alongside. One-time cost per session; Rule #3 (no-re-read) prevents repeated reads; re-read only if Rule #4 (Context Recovery) fires. **Amortization — critical, do NOT re-evaluate per-turn**: the Session Setup cost is measured over the ENTIRE session, not per single turn. A typical session has many turns; the first domain question alone already recoups the investment (alternative — repeated source-code `Grep`/`Read` per turn — costs 10-20K tokens *per turn* with lower output quality). Do NOT flag pre-loaded content as "wasteful" for turns that don't invoke it — the design depends on cross-turn amortization + Rule #3 (no-re-read) + on-demand specificity of Rule #4 (Context Recovery). This amortization is the **central token-economics principle** of the entire protocol stack. @@ -39,7 +42,7 @@ The first response's `[LOADED_DOCS: ...]` prefix must reflect **6 files** (this ## Shared Agent Skills -Skills defined in other repos. **All four are pre-loaded at session start per the `## Session Setup` section above** (mandatory — ensures implicit triggers fire reliably): +Skills defined in other repos. **Two reactive skills are pre-loaded at session start; three user-gated skills are lazy-loaded on demand** — see `## Session Setup` above for the load matrix: - **docs-discovery** — Load relevant `.md` documentation (main + `_ISSUES` + `_TODO` paired sets) BEFORE source-code search or modifications. Saves tokens vs. grep-based rediscovery. Location: `AyCode.Core/.github/skills/docs-discovery/SKILL.md` (see `own-dep-repos` above for the relative path to AyCode.Core) @@ -57,6 +60,10 @@ Skills defined in other repos. **All four are pre-loaded at session start per th Location: `AyCode.Core/.github/skills/adr-author/SKILL.md` **Invoke on explicit user request** ("let's plan X", "decide Y vs Z", "design the W module") **or proactively flag** when the conversation looks ADR-worthy (user must confirm — never auto-invoke). +- **docs-archive** — Rotate closed entries (Status: Fixed/Resolved/Won't fix/Superseded by X) from active `_ISSUES.md`, `_TODO.md`, and `LLM_PROTOCOL_DECISIONS.md` into year-bucketed archive companions (`*_.md`). Year of the Status update determines destination file. Active files retain only Open/Partially Fixed entries plus a pointer to the archives. Archive files are NOT auto-loaded — agents read them on-demand when historical context becomes relevant. + Location: `AyCode.Core/.github/skills/docs-archive/SKILL.md` + **Invoke on explicit user request** ("archive ISSUES", "rotate logs") **or proactively flag** when an active artifact file has many closed prior entries (user must confirm — never auto-invoke). + ## Protocol History Cumulative log of LLM-protocol decisions (rule changes, new skills, structural shifts):