From ede3f06689db5ca35ef1590757aa546806573b45 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Sun, 16 Aug 2026 19:49:38 +0000 Subject: [PATCH] fix(kyberforge): restore the authoring rules the ADR-0020 trim dropped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Diffing each retrofitted SKILL.md against its replacement references/ files found rules that existed on main and now existed nowhere — relocated in intent, deleted in fact. A trim that loses a rule is not progressive disclosure, it is data loss with a smaller word count. Three had no survivor. The least-privilege guidance for `tools` kept its mechanics and lost the "restrict to what the agent needs" half, so the remaining text read as encouragement to omit the field. The improve flow lost its regression check, so nothing compared the closing audit against the pre-edit state and a PASS quietly becoming a SUGGESTION went unnoticed — restored on both halves of the author pair, since agent-author had dropped its equivalent too. And agent bodies lost "would the agent get this wrong without it?", which mattered more than it looks: ADR-0020 deliberately sets no body word gate for agents, three of the four already sit between 933 and 1,199 words, and the delegation check only fires on procedure a skill already owns. That heuristic was the only brake left. Two more were reachable only from the wrong scope. agent-author tells the reader to load only the file for the resolved scope, but the mcp__ glob syntax for disallowedTools and the five tools no subagent ever receives had both landed in project-user-scope.md. disallowedTools is the ONLY permitted fence at plugin/APM scope, so the scope that needs the syntax most could not reach it, and a plugin-scope run could write a body telling the agent to ask the user a question. Two documents were actively wrong rather than merely thin. agent-audit told auditors that validate.sh resolves boundary targets for skills only; it runs at both scopes, so the auditor was hand-resolving what the script had already decided and could contradict it. And skill-audit routed to its script-troubleshooting reference whenever validate.sh "fails" — but it exits 1 on ordinary content FAILs, the normal outcome for the whole #99 population, so 1,302 words loaded on nearly every audit. A context-budget regression inside the skill that enforces the context budget. Finally, two illustrations taught the shape the gate ERRORs on, unfenced, while an adjacent rubric called it a hard ERROR. LESSONS.md records the reference-chain depth rule flipping from "one level deep" to "two hops, never three". ADR-0020 is silent on it and the reversal rode entirely on the diff; the looser rule is what mandatory dispatch requires. Refs: #99 ADR: 0020 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_015W3iwF9ncfRZddGBxsMCYi --- LESSONS.md | 16 ++++++++++++++++ .../references/description-quality.md | 9 ++++++--- .../kyberforge/.apm/skills/agent-author/SKILL.md | 2 ++ .../agent-author/assets/templates/claude-code.md | 5 +++-- .../skills/agent-author/references/improve.md | 11 +++++++++++ .../agent-author/references/plugin-scope.md | 5 +++++ .../references/project-user-scope.md | 5 ++++- .../kyberforge/.apm/skills/skill-audit/SKILL.md | 2 +- .../skill-audit/references/body-discipline.md | 6 ++++-- .../skills/skill-audit/references/patterns.md | 12 ++++++++++-- .../skills/skill-author/references/improve.md | 6 ++++++ .../references/description-quality.md | 9 ++++++--- plugins/kyberforge/skills/agent-author/SKILL.md | 2 ++ .../agent-author/assets/templates/claude-code.md | 5 +++-- .../skills/agent-author/references/improve.md | 11 +++++++++++ .../agent-author/references/plugin-scope.md | 5 +++++ .../references/project-user-scope.md | 5 ++++- plugins/kyberforge/skills/skill-audit/SKILL.md | 2 +- .../skill-audit/references/body-discipline.md | 6 ++++-- .../skills/skill-audit/references/patterns.md | 12 ++++++++++-- .../skills/skill-author/references/improve.md | 6 ++++++ 21 files changed, 120 insertions(+), 22 deletions(-) diff --git a/LESSONS.md b/LESSONS.md index 00518a3..1b9a1ed 100644 --- a/LESSONS.md +++ b/LESSONS.md @@ -245,3 +245,19 @@ noticed — and before describing any defect as pre-existing, run `git log -S` o plugin-content and vale-style drift deterministically and has no equivalent gate asserting tool-owned paths stay out of formatter scope — `.claude/settings.json` was the sixteenth exclude and nothing prevents a seventeenth. + +## 2026-08-16 — A rule reversed inside a retrofit leaves no trace unless someone writes it down + +`skill-author/SKILL.md:204` on `main` said "Keep reference chains one level deep — a reference file +that references another reference file is rarely loaded correctly." The ADR-0020 retrofit replaced it +with "Two hops from `SKILL.md`, never three" in `references/create.md` and `references/retrofit.md`, +which permits exactly the chain the old rule banned. The looser rule is the right one and the +retrofit could not have shipped without it: dispatch pushes each flow into its own file, so the +shipped structure is `SKILL.md` → `improve.md` → `retrofit.md`, and a one-level ceiling would have +made the mandatory dispatch pattern illegal. But ADR-0020 says nothing about chain depth, so the +reversal was carried entirely by the diff — the new text asserts the new rule with no sign that a +contradicting rule ever existed, and a reader who remembers the old one has no way to tell whether it +was overturned or overlooked. Fix: when a change inverts a standing authoring rule rather than +tightening or restating it, record the inversion where the rule's rationale lives — the ADR if the +ADR is the reason, here otherwise. A rule that quietly flips is indistinguishable from a rule that +was forgotten, and the second reading is the one that gets it re-added later. diff --git a/plugins/kyberforge/.apm/skills/agent-audit/references/description-quality.md b/plugins/kyberforge/.apm/skills/agent-audit/references/description-quality.md index 2a41718..d3863af 100644 --- a/plugins/kyberforge/.apm/skills/agent-audit/references/description-quality.md +++ b/plugins/kyberforge/.apm/skills/agent-audit/references/description-quality.md @@ -111,9 +111,12 @@ Flag as FAIL if: available). `Kyberforge.VagueWording` catches the known filler; imprecision outside that list is judgment. - **A boundary clause naming a target that does not resolve** to a real skill directory or agent - file in the authoring source. No script checks this for an agent file — `validate.sh` resolves - boundary targets for skills only, so resolve the name yourself against `plugins/*/.apm/skills/` - and `plugins/*/.apm/agents/`. + file in the authoring source. `validate.sh` resolves this for agent files at both scopes and + reports each unresolved target itself — take its verdict rather than re-resolving the name by + hand, because a hand-walk over a different universe can contradict it. What is left to you is + semantic and the script cannot reach it: whether a target that *does* resolve is the right + sibling to exclude, and whether a clause naming no target at all ("examine the files manually") + should have named one. - **`Use proactively` in a Copilot or vendor-neutral description.** `KyberforgeCopilot.ProactivePhrase` catches it. The phrase steers the Claude Code runtime and does nothing anywhere else, so in a `.agent.md` it is preloaded text that buys no behaviour. diff --git a/plugins/kyberforge/.apm/skills/agent-author/SKILL.md b/plugins/kyberforge/.apm/skills/agent-author/SKILL.md index c7af792..c6ca310 100644 --- a/plugins/kyberforge/.apm/skills/agent-author/SKILL.md +++ b/plugins/kyberforge/.apm/skills/agent-author/SKILL.md @@ -53,6 +53,8 @@ Gates `agent-audit` enforces at every scope: - **Body** — no word gate, and a delegation check in its place: name the skill to invoke rather than restating what it does. - **Invocation** — decide whether the agent is model-delegated or reached only by name. Only Copilot's cloud/IDE format expresses that in frontmatter (`disable-model-invocation`, `user-invocable`). +At every scope, five tools reach no subagent whatever `tools` says — `AskUserQuestion`, `EnterPlanMode`, `ExitPlanMode`, `ScheduleWakeup`, `WaitForMcpServers`. Never write a body that has the agent ask the user a question or enter plan mode; it describes a turn the runtime cannot give it. + ## Step 4 — Validate and close Invoke `agent-audit` on each file written and resolve every FAIL before reporting done. It checks the field allowlist, name-to-stem match, leftover placeholders and template comments, the description budget and the Copilot body limit — do not hand-check those. diff --git a/plugins/kyberforge/.apm/skills/agent-author/assets/templates/claude-code.md b/plugins/kyberforge/.apm/skills/agent-author/assets/templates/claude-code.md index a09f07f..15a4175 100644 --- a/plugins/kyberforge/.apm/skills/agent-author/assets/templates/claude-code.md +++ b/plugins/kyberforge/.apm/skills/agent-author/assets/templates/claude-code.md @@ -25,12 +25,13 @@ description: FILL IN: Use when . Not - + Listing any of them is a finding: agent-audit enforces the flat rule. --> + Listing any of them is a finding: agent-audit enforces the flat rule. -->