docs: cut the every-session context set by 74%, and fix what the cut broke #105

Merged
Defame1297 merged 16 commits from docs/slim-agents-md into main 2026-08-17 14:08:24 +00:00
6 changed files with 23 additions and 21 deletions
Showing only changes of commit 56cc173f65 - Show all commits

View File

@@ -207,7 +207,7 @@ repos:
# pre-commit prints nothing at all for a passing hook, so without this # pre-commit prints nothing at all for a passing hook, so without this
# the opt-out reinstated exactly the silent vacuous pass the script was # the opt-out reinstated exactly the silent vacuous pass the script was
# written to kill, one level up -- the run showed a bare `Passed` and # written to kill, one level up -- the run showed a bare `Passed` and
# AGENTS.md's instruction to read that summary line was impossible to # the documented instruction to read that summary line was impossible to
# follow in the one situation the opt-out exists for. The script's clean # follow in the one situation the opt-out exists for. The script's clean
# output is a single line, so this costs one line per push. # output is a single line, so this costs one line per push.

View File

@@ -26,7 +26,7 @@ Issue files frequently referenced "the workflow defined in `docs/notes/skill-imp
The repo CLAUDE.md instructs agents to read CONTEXT.md at session start, but agents skip this in practice — defaulting to reading only what's directly relevant to the immediate prompt (e.g. the skills folder). The governance.md works because `@import` is technically enforced by Claude Code. Fix: (1) add `@CONTEXT.md` to repo CLAUDE.md using `@import` to make it always-loaded; (2) add a "Key decisions" section to CONTEXT.md with one-line resolved-ADR summaries so locked choices are always in context. The repo CLAUDE.md instructs agents to read CONTEXT.md at session start, but agents skip this in practice — defaulting to reading only what's directly relevant to the immediate prompt (e.g. the skills folder). The governance.md works because `@import` is technically enforced by Claude Code. Fix: (1) add `@CONTEXT.md` to repo CLAUDE.md using `@import` to make it always-loaded; (2) add a "Key decisions" section to CONTEXT.md with one-line resolved-ADR summaries so locked choices are always in context.
**Status (2026-08-14): neither part landed.** Root `CLAUDE.md` imports `@AGENTS.md` only — no `@CONTEXT.md` — and `CONTEXT.md` has no "Key decisions" section. The behavioral hope this entry diagnosed is still the only mechanism in place: `AGENTS.md` carries the line "Read CONTEXT.md at the start of every session in this repo," which is loaded but is itself an instruction, not an import. The proposal above is open work, not a record of a completed change. **Status (2026-08-14): neither part landed.** Root `CLAUDE.md` imports `@AGENTS.md` only — no `@CONTEXT.md` — and `CONTEXT.md` has no "Key decisions" section. The behavioral hope this entry diagnosed is still the only mechanism in place: `AGENTS.md` carries the line "Read `CONTEXT.md` at the start of every session," which is loaded but is itself an instruction, not an import. The proposal above is open work, not a record of a completed change.
## 2026-05-17 — Instruction rules lose to RLHF defaults without specificity ## 2026-05-17 — Instruction rules lose to RLHF defaults without specificity

View File

@@ -127,8 +127,8 @@ for ini in "$SKILL_INI" "$AGENT_INI"; do
err "$rel_ini has no section whose BasedOnStyles names Kyberforge — every rule the audit prefilters on lives in that style" err "$rel_ini has no section whose BasedOnStyles names Kyberforge — every rule the audit prefilters on lives in that style"
fi fi
# Per-rule overrides are the third way to retire a rule without touching a # Per-rule overrides are the third way to retire a rule without touching a
# style file or a glob. CONTEXT.md's "Vale audit prefilter" entry: "Every rule # style file or a glob. Per ADR-0013, every rule is `level: error` and every
# is `level: error` and every alert is a FAIL — no ignorable tier". Vale's exit # alert is a FAIL — there is no ignorable tier. Vale's exit
# code keys on `error` alerts alone, so any override that leaves a rule at # code keys on `error` alerts alone, so any override that leaves a rule at
# anything other than `error` still lints the file, still exits 0, and still # anything other than `error` still lints the file, still exits 0, and still
# shows `Passed` in pre-commit. The glob probe below cannot backstop this: it # shows `Passed` in pre-commit. The glob probe below cannot backstop this: it
@@ -175,9 +175,10 @@ for ini in "$SKILL_INI" "$AGENT_INI"; do
fi fi
done done
# KyberforgeCopilot is agent-audit's alone — CONTEXT.md describes it as "scoped # KyberforgeCopilot is agent-audit's alone — ADR-0013 scopes it to `.agent.md`
# only to `.agent.md` files for the Copilot-only 'Use proactively has no effect' # files only, for the Copilot-only 'Use proactively has no effect' check, and
# check". The loop above deliberately asserts only `Kyberforge`, since # records that it must not be extended to `.md` files. The loop above
# deliberately asserts only `Kyberforge`, since
# skill-audit's copy legitimately has no Copilot style, so dropping # skill-audit's copy legitimately has no Copilot style, so dropping
# `, KyberforgeCopilot` from agent-audit's `[**/*.agent.md]` section unloaded the # `, KyberforgeCopilot` from agent-audit's `[**/*.agent.md]` section unloaded the
# whole style silently: no glob broke, the styles/ diff above stayed clean (the # whole style silently: no glob broke, the styles/ diff above stayed clean (the
@@ -353,10 +354,10 @@ while IFS='|' read -r skill rel scope; do
# `.pre-commit-config.yaml`'s regex correctly no longer matches it and that's # `.pre-commit-config.yaml`'s regex correctly no longer matches it and that's
# not drift. `demo.agent.md` is the real, current shape and is `shared`. # not drift. `demo.agent.md` is the real, current shape and is `shared`.
# #
# The two `.claude/`-prefixed probes carry the location-independence CONTEXT.md # The two `.claude/`-prefixed probes carry the location-independence property: a
# asserts: "A `SKILL.md` outside `plugins/` (e.g. project-scope # `SKILL.md` outside `plugins/` (e.g. project-scope
# `.claude/skills/foo/SKILL.md`) still matches `[**/SKILL.md]` and gets linted # `.claude/skills/foo/SKILL.md`) still matches `[**/SKILL.md]` and gets linted
# normally — the globs constrain filename shape, not location." Every other # normally — the globs constrain filename shape, not location. Every other
# probe here starts with `plugins/`, so narrowing a glob to a `plugins/`-shaped # probe here starts with `plugins/`, so narrowing a glob to a `plugins/`-shaped
# path (`[**/SKILL.md]` -> `[**/.apm/skills/*/SKILL.md]`) left all of them # path (`[**/SKILL.md]` -> `[**/.apm/skills/*/SKILL.md]`) left all of them
# matching while the project-scope shape started linting as `0 errors ... in 0 # matching while the project-scope shape started linting as `0 errors ... in 0

View File

@@ -6,7 +6,7 @@ set -euo pipefail
# that same file at .claude-plugin/marketplace.json directly, but also has a legacy # that same file at .claude-plugin/marketplace.json directly, but also has a legacy
# convention path at .github/plugin/marketplace.json (see # convention path at .github/plugin/marketplace.json (see
# plugins/kyberforge/docs/research/docs/github-copilot-plugins/marketplace.md) -- and # plugins/kyberforge/docs/research/docs/github-copilot-plugins/marketplace.md) -- and
# CONTEXT.md documents that path as a mirror of the Claude output, not a separate apm # that path is a mirror of the Claude output, not a separate apm
# output profile (apm only ships "claude" and "codex" mappers; codex writes a # output profile (apm only ships "claude" and "codex" mappers; codex writes a
# differently-shaped file to .agents/plugins/marketplace.json, not this path). This # differently-shaped file to .agents/plugins/marketplace.json, not this path). This
# script keeps that legacy mirror byte-identical to .claude-plugin/marketplace.json # script keeps that legacy mirror byte-identical to .claude-plugin/marketplace.json

View File

@@ -457,8 +457,8 @@ fi
# --- 9b. Exits 1 when a per-rule override leaves a rule at anything but error --- # --- 9b. Exits 1 when a per-rule override leaves a rule at anything but error ---
# The third way to switch a rule off without touching a style file or a glob. # The third way to switch a rule off without touching a style file or a glob.
# CONTEXT.md's "Vale audit prefilter" entry: "Every rule is `level: error` and # Per ADR-0013, every rule is `level: error` and every alert is a FAIL -- there
# every alert is a FAIL -- no ignorable tier". Vale's exit code keys on `error` # is no ignorable tier. Vale's exit code keys on `error`
# alerts alone, so any such override leaves the glob intact, the styles # alerts alone, so any such override leaves the glob intact, the styles
# byte-identical, and the run at `0 errors`, exit 0, `Passed`. # byte-identical, and the run at `0 errors`, exit 0, `Passed`.
# #
@@ -553,9 +553,9 @@ fi
# equality check applies, and case 10's probe still passed because it keys on a # equality check applies, and case 10's probe still passed because it keys on a
# Kyberforge alert. Verified dead by probing a `.agent.md` carrying # Kyberforge alert. Verified dead by probing a `.agent.md` carrying
# "Use proactively": 0 alerts under the broken config, KyberforgeCopilot. # "Use proactively": 0 alerts under the broken config, KyberforgeCopilot.
# ProactivePhrase under the shipped one. CONTEXT.md describes the style as # ProactivePhrase under the shipped one. ADR-0013 scopes the style to
# "scoped only to `.agent.md` files for the Copilot-only 'Use proactively has # `.agent.md` files only, for the Copilot-only 'Use proactively has no effect'
# no effect' check", so shipping it unloaded is drift. # check, so shipping it unloaded is drift.
echo "" echo ""
echo "--- exits 1 when the shipped KyberforgeCopilot style is named by no BasedOnStyles ---" echo "--- exits 1 when the shipped KyberforgeCopilot style is named by no BasedOnStyles ---"
FIXTURE11C="$(make_fixture)" FIXTURE11C="$(make_fixture)"
@@ -609,9 +609,9 @@ fi
# still matched all of them and the check passed -- while a project-scope # still matched all of them and the check passed -- while a project-scope
# `.claude/skills/foo/SKILL.md` started linting as `0 errors ... in 0 files`, # `.claude/skills/foo/SKILL.md` started linting as `0 errors ... in 0 files`,
# exit 0, hook `Passed`: the exact failure the script's own header comment says # exit 0, hook `Passed`: the exact failure the script's own header comment says
# it exists to catch. CONTEXT.md: "A `SKILL.md` outside `plugins/` (e.g. # it exists to catch. A `SKILL.md` outside `plugins/` (e.g. project-scope
# project-scope `.claude/skills/foo/SKILL.md`) still matches `[**/SKILL.md]` and # `.claude/skills/foo/SKILL.md`) still matches `[**/SKILL.md]` and gets linted
# gets linted normally -- the globs constrain filename shape, not location." # normally -- the globs constrain filename shape, not location.
# These narrowings are still valid glob syntax and break no `plugins/`-shaped # These narrowings are still valid glob syntax and break no `plugins/`-shaped
# file, so only a non-`plugins/` probe path catches them. # file, so only a non-`plugins/` probe path catches them.
echo "" echo ""

View File

@@ -451,8 +451,9 @@ fi
# cover anything new: it omitted scripts/lib/batch-run.sh — the shared runner # cover anything new: it omitted scripts/lib/batch-run.sh — the shared runner
# this branch introduced, whose own header (batch-run.sh:9-11) documents it as # this branch introduced, whose own header (batch-run.sh:9-11) documents it as
# bash-3.2-safe — along with four other scripts/*.sh. Deriving the list means a # bash-3.2-safe — along with four other scripts/*.sh. Deriving the list means a
# new script is covered the moment it lands. AGENTS.md names bash 3.2 as an # new script is covered the moment it lands. LESSONS.md and the script headers
# explicit repo target, so the scope is four globs, each floor-asserted below: # name bash 3.2 as an explicit repo target, so the scope is four globs, each
# floor-asserted below:
# - scripts/**/*.sh — repo tooling and pre-commit hook scripts # - scripts/**/*.sh — repo tooling and pre-commit hook scripts
# - tests/*.sh — the runners and every regression test # - tests/*.sh — the runners and every regression test
# - plugins/*/.apm/**/*.sh — the scripts plugins ship to users # - plugins/*/.apm/**/*.sh — the scripts plugins ship to users