docs: update stale CONTEXT.md references to GLOSSARY.md

Covers ADRs, research docs, notes and LESSONS.md. docs/notes/archive is
left as is: it describes CONTEXT.md in other repos.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
This commit is contained in:
Defame1297andClaude Sonnet 5.5 committed 2026-11-11 18:13:07 +00:00
1 parent 9705167cbe
commit 6644d08eaa
17 files changed
+62 -62

No files matched your search

@@ -18,4 +18,4 @@ Three alternatives were rejected. Keeping the file-based fallback adds code comp
The file-based model also had a structural weakness: issues in `docs/issues/` were invisible from the Gitea UI, making it impossible to track work, assign milestones, or filter by label without opening the repo locally. Gitea provides all of that natively.
The "Provider-agnostic issue tracker" glossary entry in CONTEXT.md is updated in the same workstream to remove the file-based phase framing. (Amended 2026-08-17: the CONTEXT.md trim renamed that entry to **Issue**; it still records Gitea as this repo's canonical tracker and still tells skills to say "linked issue" generically.) The `providers/gitea/` adapter path described in ADR-0011 was never implemented — Gitea integration runs entirely via MCP, not a provider adapter.
The "Provider-agnostic issue tracker" glossary entry in GLOSSARY.md is updated in the same workstream to remove the file-based phase framing. (Amended 2026-08-17: the GLOSSARY.md trim renamed that entry to **Issue**; it still records Gitea as this repo's canonical tracker and still tells skills to say "linked issue" generically.) The `providers/gitea/` adapter path described in ADR-0011 was never implemented — Gitea integration runs entirely via MCP, not a provider adapter.
@@ -4,16 +4,16 @@ Issue #84 wired Vale as a deterministic prefilter for `skill-audit`/`agent-audit
`factory-audit`'s two flows by ADR-0025; read every mention of the pair below that way), scoped to
exactly four pattern-matchable checks (imperative description opener, vague capability wording,
generic reference-pointer padding, Copilot's dead `Use proactively` phrasing), documented only in
CONTEXT.md's "Vale audit prefilter" section — never its own ADR — and explicitly excluding body
GLOSSARY.md's "Vale audit prefilter" section — never its own ADR — and explicitly excluding body
discipline, near-miss exclusion strength, and control calibration as non-goals. This ADR records a
deferred PR #85 review item to broaden that coverage, retroactively captures #84's own rationale
(since it was never recorded as a decision in its own right), and layers the expansion on top
without reversing or weakening the original four rules.
**2026-08-17 amendment.** The CONTEXT.md section named above no longer holds that documentation.
CONTEXT.md was cut back to a glossary and the prefilter's mechanics — the two-copy style layout,
**2026-08-17 amendment.** The GLOSSARY.md section named above no longer holds that documentation.
GLOSSARY.md was cut back to a glossary and the prefilter's mechanics — the two-copy style layout,
`vale-wrap.sh`, the `--config` argv defect, the rule inventory, and the 0-files-means-NOT-RUN
fallback — moved to `docs/spec/gates.md`. Read that file, not CONTEXT.md, for the harness itself;
fallback — moved to `docs/spec/gates.md`. Read that file, not GLOSSARY.md, for the harness itself;
this ADR still owns the scope decision.
**File scope stays the same.** `SKILL.md` plus agent files (`**/agents/*.md`,
@@ -60,9 +60,9 @@ new hand-maintained manifest format.
- Translating the existing plugins into `apm.yml` + `.apm/` and running the real conversion was
executed under issue #90 (https://git.dev.rkdr.net/Defame1297/holocron/issues/90), which tracks
that work through to merge.
- `CONTEXT.md`'s "Plugin"/"Plugin marketplace" glossary entries were rewritten in issue #90 to
- `GLOSSARY.md`'s "Plugin"/"Plugin marketplace" glossary entries were rewritten in issue #90 to
describe the compiled-output model directly, rather than carrying a forward-pointer to this ADR.
Superseded 2026-08-17: CONTEXT.md was cut back to one-line definitions, and the compiled-output
Superseded 2026-08-17: GLOSSARY.md was cut back to one-line definitions, and the compiled-output
model is now described in `docs/spec/architecture.md`. The same trim deleted the "lint plugin"
entry cited under Considered options below; that pointer now reads `docs/spec/architecture.md`'s
plugin scope table, which carries the repo-agnostic-versus-marketplace-specific argument.
@@ -339,9 +339,9 @@ mirror does carry, and is reported.
- ADR-0015's "Status: executed" now carries a pointer to this ADR (see that ADR's Consequences)
rather than being rewritten — the manifest-compilation half of its execution was correct and
stands; this ADR fixes the second, previously-unverified half.
- `CONTEXT.md`'s "Plugin" and "Plugin marketplace" glossary entries are updated to describe the
- `GLOSSARY.md`'s "Plugin" and "Plugin marketplace" glossary entries are updated to describe the
flat mirror as a second compiled-output category, alongside the existing
`.claude-plugin/plugin.json`/`marketplace.json` description. Superseded 2026-08-17: CONTEXT.md was
`.claude-plugin/plugin.json`/`marketplace.json` description. Superseded 2026-08-17: GLOSSARY.md was
cut back to one-line definitions and no longer describes either compiled-output category;
`docs/spec/architecture.md` is where the mirror is documented.
- A future apm release that ships a native `.apm/`-aware plugin.json compiler (closing this gap
@@ -69,14 +69,14 @@ answers to `git-commits` and `kyberforge:skill-audit` to `skill-audit` (**Amende
2026-09-15:** `skill-audit` was removed and its flow merged into `factory-audit`, so the live
example is `kyberforge:factory-audit` to `factory-audit`; the rule is unchanged). This is not
configurable —
a project skill has no plugin to prefix. `AGENTS.md` and `CONTEXT.md` are updated to name the bare
a project skill has no plugin to prefix. `AGENTS.md` and `GLOSSARY.md` are updated to name the bare
form, which is what apm deploys and the only form a repo consuming holocron through apm gets.
**Correction (2026-08-14): the namespaced form did not stop resolving.** *Superseded by the
2026-08-17 correction below: the machine state this cites is no longer present. Both are kept
because the pair is the finding — read neither as current.* An earlier revision of
this consequence said every `<plugin>:<skill>` reference "was stale the moment the switch landed",
and `AGENTS.md`/`CONTEXT.md` were written to match. That contradicts the "User scope is untouched,
and `AGENTS.md`/`GLOSSARY.md` were written to match. That contradicts the "User scope is untouched,
deliberately" consequence below, and the contradiction resolves against it: `~/.claude.json` still
enables `core`, `git`, `gitea`, `kyberforge` and `lint` at user scope, so both names are live at
once and a working `gitea:gitea-prs` is the user-scope copy answering. That doubling is the same
@@ -97,7 +97,7 @@ are not there, and neither is the state the *original* consequence described bef
about the namespaced form has now been written twice off two different observations of the same
machine, and this ADR has already reversed itself once on it. That is the finding: the fact is
machine state, not a property of this decision, and it changes without any commit. No instruction
file — `AGENTS.md`, `CONTEXT.md`, or a skill body — should assert either way whether
file — `AGENTS.md`, `GLOSSARY.md`, or a skill body — should assert either way whether
`<plugin>:<skill>` resolves. The rule that survives every observation is the one that was always the
actionable half: write the bare name, because it is the only form `apm install` produces.
@@ -368,7 +368,7 @@ the two gotchas that were over budget, because neither was shared:
- the 112-word body-word-gate bullet was two separate pre-merge gotchas welded together, a skill half
and an agent half.
A dispatch body is the dispatch table *plus the gates common to every branch* (CONTEXT.md; the
A dispatch body is the dispatch table *plus the gates common to every branch* (GLOSSARY.md; the
skill-flow rubric `references/skill-body-discipline.md`). Keeping a single-branch gotcha in it
contradicts that definition. Moving it into its flow file costs no read either, because the body
already loads exactly one flow file on every invocation by construction.
@@ -31,7 +31,7 @@ pre-approved. Add the tool once its name is sourced for each target.
`allowed-tools` and instruct spawning subagents — `forge` from `references/author-routes.md` and
`references/version-bump.md`, not from its `SKILL.md`. That shows they spawn, not that a run
succeeded. `skill-author/SKILL.md:24` forbids spawning a subagent to recheck one's own work, which
is a different question and unaffected here. `CONTEXT.md` says a plugin-scope agent delegates to
is a different question and unaffected here. `GLOSSARY.md` says a plugin-scope agent delegates to
skills because it cannot disclose to itself; nothing there bans a skill from delegating.
**The security cost is real and not mitigated.** "The orchestrator alone writes files" is prose,
@@ -44,4 +44,4 @@ the list was kept.
Rejected: dropping `allowed-tools` on the premise that it blocked spawning (unsupported by the
repo's own sources, and it widens the tool surface for nothing), and banning spawning in skills
(three skills instruct it, and `CONTEXT.md` does not forbid it).
(three skills instruct it, and `GLOSSARY.md` does not forbid it).
@@ -13,7 +13,7 @@ file, so 36 entries reported INFO and nothing failed. Measured by running the sc
directories (27 with a `references/sources.md`, 11 without), since nothing else runs it over the corpus.
We decided that `Research doc:` names exactly one **Research registry** (the term is in
`CONTEXT.md`), as the spec always said. Slug-to-H2 lookup in the registry is the only provenance link
`GLOSSARY.md`), as the spec always said. Slug-to-H2 lookup in the registry is the only provenance link
that can be verified deterministically; a topic doc has no per-source H2 to check against. A link to
the topic doc that digested a source stays as free-text annotation and is not checked.
+3 -3
View File
@@ -20,7 +20,7 @@ A future orchestration layer (cross-project automation agents) is a natural Chun
### 1. Coding conventions stay in coding.md
CONTEXT.md is for domain vocabulary (≤200 lines, always loaded). `core/instructions/coding.md` carries coding conventions, loaded on demand. The factory's "conventions in CONTEXT.md" principle applies to project repos where CONTEXT.md is the primary shared artefact, not to this provider repo where the CLAUDE.md content index handles selective loading.
GLOSSARY.md is for domain vocabulary (≤200 lines, always loaded). `core/instructions/coding.md` carries coding conventions, loaded on demand. The factory's "conventions in GLOSSARY.md" principle applies to project repos where GLOSSARY.md is the primary shared artefact, not to this provider repo where the CLAUDE.md content index handles selective loading.
Project repos can override with their own `coding.md` at `.claude/core/instructions/coding.md`.
@@ -80,7 +80,7 @@ All skills — new and rebuilt — must follow this standard:
- **This repo:** `LESSONS.md` at repo root, created in issue 0013. Captures lessons learned while building the config itself.
- **Project repos:** `LESSONS.md` scaffolded by `init-project.sh` (Chunk 6 template).
- **Session-handoff skill:** writes to whichever LESSONS.md is in scope before closing a session.
- **Graduation threshold:** three or more entries covering the same pattern → promote to CONTEXT.md (or `coding.md`, `git.md`, `testing.md` if domain-specific) as a standing rule.
- **Graduation threshold:** three or more entries covering the same pattern → promote to GLOSSARY.md (or `coding.md`, `git.md`, `testing.md` if domain-specific) as a standing rule.
### 6. Evals consciously deferred to Chunk 6
@@ -129,7 +129,7 @@ IaC skills (category: `iac`) and Gitea integration skills (category: `gitea`) li
- `.agents/skills/` as canonical skill path (ADR-0004)
- SKILL.md format with YAML frontmatter (agentskills.io standard)
- CONTEXT.md ≤200 lines
- GLOSSARY.md ≤200 lines
- Pull-based distribution (ADR-0001)
- governance.md via `@import` always-on
- No third-party skills without reading them (OWASP AST01 / governance.md)
@@ -20,10 +20,10 @@ This changes almost every downstream decision. Until it's resolved, individual g
### 2.1 Where coding conventions live
**Factory research:** Preferred/Avoid code blocks belong in `CONTEXT.md`. Convention lives in a single shared-vocabulary file the agent always loads.
**Factory research:** Preferred/Avoid code blocks belong in `GLOSSARY.md`. Convention lives in a single shared-vocabulary file the agent always loads.
**Chunk 2 plan:** Coding conventions go in a separate `core/instructions/coding.md` file, loaded on-demand.
One of these wins. If conventions go in `CONTEXT.md`, `coding.md` becomes much thinner or unnecessary. If they stay in `coding.md`, the factory's "CONTEXT.md is the primary context artefact" principle weakens.
One of these wins. If conventions go in `GLOSSARY.md`, `coding.md` becomes much thinner or unnecessary. If they stay in `coding.md`, the factory's "GLOSSARY.md is the primary context artefact" principle weakens.
### 2.2 Skill path structure: flat vs. nested
@@ -45,7 +45,7 @@ These serve the same purpose. The factory's naming is cleaner (one file, obvious
### 3.1 LESSONS.md (impacts Chunk 2)
Factory treats `LESSONS.md` as a required committed file — the mechanism for long-loop feedback and convention graduation. Without it, there is no defined path from "I noticed a pattern" to "this is now a standing rule in CONTEXT.md". Not in the Chunk 2 scope. Question: is this a Chunk 2 addition or deferred?
Factory treats `LESSONS.md` as a required committed file — the mechanism for long-loop feedback and convention graduation. Without it, there is no defined path from "I noticed a pattern" to "this is now a standing rule in GLOSSARY.md". Not in the Chunk 2 scope. Question: is this a Chunk 2 addition or deferred?
### 3.2 `docs/spec/` living spec layer
@@ -69,7 +69,7 @@ Factory requires a `references/` directory with `stack-versions.md` (authoritati
### 3.7 Model routing
Factory defines an explicit model routing table (Haiku for classification/formatting, Sonnet for most coding, Opus for adversarial review). Not in current vision or chunk scope. The factory treats this as both a cost decision and a sustainability decision — using frontier models for tasks a smaller model can do is waste, and the governance constitution calls this out explicitly. Where does this decision live — in `governance.md`, in CONTEXT.md, or per-skill?
Factory defines an explicit model routing table (Haiku for classification/formatting, Sonnet for most coding, Opus for adversarial review). Not in current vision or chunk scope. The factory treats this as both a cost decision and a sustainability decision — using frontier models for tasks a smaller model can do is waste, and the governance constitution calls this out explicitly. Where does this decision live — in `governance.md`, in GLOSSARY.md, or per-skill?
---
@@ -95,7 +95,7 @@ These don't have a "right answer" yet — they need explicit decisions.
- `.agents/skills/` as canonical skill path — consistent with the Agent Skills standard
- SKILL.md format with YAML frontmatter — consistent
- `CONTEXT.md` exists and is ≤200 lines — consistent with factory's context architecture
- `GLOSSARY.md` exists and is ≤200 lines — consistent with factory's context architecture
- Pull-based distribution model — consistent with factory's "no runtime dependency" principle
- Governance.md loaded via `@import` — matches factory's "always-on" governance pattern
- No third-party skill installs without reading them — consistent with OWASP AST01 guidance
+6 -6
View File
@@ -287,7 +287,7 @@ The shared pattern: per-skill `README.md` files no model reads, a `docs/research
>
> **Interaction with rejected finding 19, unacknowledged:** collapsing git to one skill absorbs `git-workflow` itself — one of the seven — so its 8-row Domains table would route to itself, and leaves `git-orchestrate` a dispatcher with exactly one target, its contract vacuous. Finding 19 was rejected for doing less than this, mechanically.
>
> Blast radius if ever revisited: **68 backticked references to git skill names, 99 to gitea names** under `plugins/`. Only the ones in a `SKILL.md` are boundary targets `skill-size-check` resolves and FAILs on if dangling — its `files:` regex is `^plugins/[^/]+/\.apm/skills/[^/]+/SKILL\.md$`, so it opens nothing else — and that is **35 of the 68 git mentions and 26 of the 99 gitea ones**. The remaining 33 and 73 live in `references/*.md`, the two orchestrate agents (10 and 23 on their own), the plugin READMEs, kyberforge's audit and author references, and two `validate.sh` copies — none of which this gate opens: they still have to be rewritten by hand, but they fail no hook. Plus `AGENTS.md:16,18`, `README.md:21-22`, `CONTEXT.md:168` (uses `gitea-prs` as the naming exemplar), `architecture.md:34` (uses `git-branches` vs `gitea-branches` as the canonical boundary example), and ADRs 0011, 0020, 0021, 0022, 0023. Two false alarms not worth chasing: `tests/test-check-rtk-prefix.sh:97` reads from a pinned historical SHA, and `scripts/check-rtk-prefix.sh`'s mention is in a comment.
> Blast radius if ever revisited: **68 backticked references to git skill names, 99 to gitea names** under `plugins/`. Only the ones in a `SKILL.md` are boundary targets `skill-size-check` resolves and FAILs on if dangling — its `files:` regex is `^plugins/[^/]+/\.apm/skills/[^/]+/SKILL\.md$`, so it opens nothing else — and that is **35 of the 68 git mentions and 26 of the 99 gitea ones**. The remaining 33 and 73 live in `references/*.md`, the two orchestrate agents (10 and 23 on their own), the plugin READMEs, kyberforge's audit and author references, and two `validate.sh` copies — none of which this gate opens: they still have to be rewritten by hand, but they fail no hook. Plus `AGENTS.md:16,18`, `README.md:21-22`, `GLOSSARY.md:168` (uses `gitea-prs` as the naming exemplar), `architecture.md:34` (uses `git-branches` vs `gitea-branches` as the canonical boundary example), and ADRs 0011, 0020, 0021, 0022, 0023. Two false alarms not worth chasing: `tests/test-check-rtk-prefix.sh:97` reads from a pinned historical SHA, and `scripts/check-rtk-prefix.sh`'s mention is in a comment.
>
> **Salvageable independently, ~230 lines:** `conventional-commits-spec.md` (~98% generic) and `bisect.md` (~97%) are the only two files where the generic-restatement thesis fully holds — reduce each to a pointer plus the house delta. Also worth a finding-13-style trim-in-place: the issue-vs-PR disambiguation duplicated across 4 gitea files. Neither needs a merge.
>
@@ -315,7 +315,7 @@ The shared pattern: per-skill `README.md` files no model reads, a `docs/research
>
> **Deferred (2026-09-16, grill).** The human is excluding `bin` from this audit: its skills are "binned for a reason" and will be fixed or relocated as a separate piece of work. Nothing in this finding is executed here; the itemised ~165-line estimate above is the starting point for that work. `bin` is still covered by the version-bump gate (finding 33) until then.
23. [x] **bin: merge `grill-me` into `grill-with-docs`.** `grill-me` is 16 lines and a subset of the docs flow; `grill-with-docs` creates `CONTEXT.md` when missing, so the merged skill needs a no-write opt-out. `caveman` (50 lines) and `zoom-out` (9) are hand-invoked prompts rather than workflow skills; they are also the repo's `disable-model-invocation` exemplars in `CONTEXT.md`, `contract.md`, ADR-0020, ADR-0021, and `gates.md`, and `install.sh` has no path for `~/.claude/commands/`, so moving them means picking a new exemplar. `improve-codebase-architecture` defines its glossary twice (inline and in `language.md`; the README documents the split as intentional). Effort S.
23. [x] **bin: merge `grill-me` into `grill-with-docs`.** `grill-me` is 16 lines and a subset of the docs flow; `grill-with-docs` creates `GLOSSARY.md` when missing, so the merged skill needs a no-write opt-out. `caveman` (50 lines) and `zoom-out` (9) are hand-invoked prompts rather than workflow skills; they are also the repo's `disable-model-invocation` exemplars in `GLOSSARY.md`, `contract.md`, ADR-0020, ADR-0021, and `gates.md`, and `install.sh` has no path for `~/.claude/commands/`, so moving them means picking a new exemplar. `improve-codebase-architecture` defines its glossary twice (inline and in `language.md`; the README documents the split as intentional). Effort S.
> **Decision (2026-09-16):** Not proceeding — the human declined this finding. `grill-me` and `grill-with-docs` stay separate.
24. [x] **core: `provider-adapter-author` is a 1,200-line wrapper around one instruction** ("replace duplicated lines with `@AGENTS.md`, keep provider-specific lines"): a 496-line validator with a 519-line bats suite for a check that is a grep. `agentsmd-author` already calls `agentsmd-audit` as mandatory closeout, and both route to `provider-adapter-author` in boundary clauses that must change with it. Target: one `agentsmd` skill with an audit mode, adapter conversion as a step, validator about 40 lines. Needs an ADR-0012 revisit. Effort L.
@@ -393,12 +393,12 @@ The shared pattern: per-skill `README.md` files no model reads, a `docs/research
> **Corrected then partially done (2026-09-14):** independent re-verification found the "edit `.apm/`, never the mirror" and apm.lock/SessionStart clusters confirmed but the third overstated — no file documents an offline `SKIP=` command (the one `SKIP=`-adjacent mention in `gates.md` explicitly says a *different* opt-out "is not `SKIP=`"), and "three-stage install" appears twice, not three times, with no restatement worth trimming. Trimmed the two confirmed clusters: README's "Editing plugin content" and AGENTS.md's "Edit `.apm/`, never the flat mirror" sections cut to the how-to/one-line-plus-link split the finding itself proposed, full mechanics (the `rm -rf` behavior and the `plugins/kyberforge/hooks/README.md` anecdote) staying solely in `docs/spec/architecture.md`. README's "Keeping the install current" and AGENTS.md's apm.lock bullet trimmed to drop the restated `apm outdated`/`apm update --yes` timing narrative, pointing to ADR-0019 as the canonical mechanism instead. No test greps the trimmed wording (checked).
30. [x] ~~**`LESSONS.md`: 41 entries, 2 graduated, about 12 stale.** Twelve entries from 2026-05-17 describe a write-skill / write-eval workflow whose skills no longer exist. One entry is open work labelled "Status: neither part landed". The longest eight are 200 to 550-word incident reports. Delete the stale entries, move open work to an issue, cap entries at about 60 words, target 100 lines. Effort S.~~
> **Done (2026-09-12):** see commit `629320b` on `docs/simplification-audit`. 255→131 lines, 41→30 entries. Kept 3 of the same-dated entries (RLHF defaults, secrets-rule gap, HITL gap) — judged unrelated to the defunct write-skill/write-eval workflow and still applicable, so 10 deleted rather than 12. The "neither part landed" open-work entry (CONTEXT.md not `@import`ed at session start) was removed rather than filed as an issue — full text preserved in this session's transcript if wanted later.
> **Done (2026-09-12):** see commit `629320b` on `docs/simplification-audit`. 255→131 lines, 41→30 entries. Kept 3 of the same-dated entries (RLHF defaults, secrets-rule gap, HITL gap) — judged unrelated to the defunct write-skill/write-eval workflow and still applicable, so 10 deleted rather than 12. The "neither part landed" open-work entry (GLOSSARY.md not `@import`ed at session start) was removed rather than filed as an issue — full text preserved in this session's transcript if wanted later.
31. [x] ~~**`CONTEXT.md`: 28 terms, most used only by gates.md, scripts, or tests rather than by skills;** two (Preload tax, Skill context contract) are never used outside `CONTEXT.md` and ADR-0020. The preload-tax entry quotes two dated numbers then says not to quote them. The example dialogue and flagged-ambiguities sections are grill residue. Cut to about 20 one-line terms. Effort S.~~
31. [x] ~~**`GLOSSARY.md`: 28 terms, most used only by gates.md, scripts, or tests rather than by skills;** two (Preload tax, Skill context contract) are never used outside `GLOSSARY.md` and ADR-0020. The preload-tax entry quotes two dated numbers then says not to quote them. The example dialogue and flagged-ambiguities sections are grill residue. Cut to about 20 one-line terms. Effort S.~~
> **Corrected then done (2026-09-13):** see commits `124ce6e` and follow-up on `docs/simplification-audit`. Independent re-verification found "most used only by gates.md/scripts/tests" overstated: 13 of 28 terms are actually referenced from model-facing `references/*.md` files skills load in normal use (Routing target, Hand-invoked skill, Dispatch body, Near-miss, Thin adapter, Provenance chain, Output profile, apm package, Plugin marketplace, HITL, Skill composition, Delegation discipline, holocron) and were kept untouched. Only the 9 terms confirmed as true orphans were removed after a fresh independent grep: Content mirror, apm-consumed install, Vale audit prefilter, Vacuous green, Management Application, Sycophancy, HOTL, Preload tax, Skill context contract — 28 → 19 terms.
> > **Corrected (2026-09-19) — "true orphans" is wrong for two of the nine.** **HOTL** and **Sycophancy** are both still used in `core/ai-constitution.md` (HOTL spelled out at `:111-112`, sycophancy at `:72-87`), and HOTL also in `docs/research/governance_principles/ai-governance-research.md:340-344`. The removals themselves were still right, for a different reason than the one given: the constitution **defines both terms itself, at the point of use**, so a second definition in `CONTEXT.md` was duplication rather than the only authority. Only the orphan justification is corrected here; the other seven and the 28 → 19 count are unaffected.
> **Re-counted (2026-09-14, at `a6434e0`): 18 terms, not 19.** The "28 → 19" above is an accurate record of this finding's own commit (`124ce6e`) and is left standing. `718c79a` then removed a twentieth-to-nineteenth entry this finding never touched: the standalone **Plugin** term, folded into **apm package** when ADR-0024 made "plugin" and "apm package" the same thing. Counted as bolded term entries between `## Language` and `## Relationships` in `CONTEXT.md`: 19 at `124ce6e`, 18 at `718c79a` and unchanged at `a6434e0`. The finding's own target ("about 20 one-line terms") is met either way. The preload-tax self-contradiction (quotes 23,427/10,478-char figures then says not to quote either) was confirmed verbatim and resolved by the entry's own deletion. The "example dialogue" and "flagged ambiguities" sections were found to be mandated by `grill-with-docs/references/context-format.md`'s template spec, not grill residue — left untouched, except one dangling bolded cross-reference to the now-deleted "Preload tax" term in a Flagged-ambiguities line, which was unbolded/de-referenced in place (the ambiguity resolution itself still holds without a defined glossary entry to point at).
> > **Corrected (2026-09-19) — "true orphans" is wrong for two of the nine.** **HOTL** and **Sycophancy** are both still used in `core/ai-constitution.md` (HOTL spelled out at `:111-112`, sycophancy at `:72-87`), and HOTL also in `docs/research/governance_principles/ai-governance-research.md:340-344`. The removals themselves were still right, for a different reason than the one given: the constitution **defines both terms itself, at the point of use**, so a second definition in `GLOSSARY.md` was duplication rather than the only authority. Only the orphan justification is corrected here; the other seven and the 28 → 19 count are unaffected.
> **Re-counted (2026-09-14, at `a6434e0`): 18 terms, not 19.** The "28 → 19" above is an accurate record of this finding's own commit (`124ce6e`) and is left standing. `718c79a` then removed a twentieth-to-nineteenth entry this finding never touched: the standalone **Plugin** term, folded into **apm package** when ADR-0024 made "plugin" and "apm package" the same thing. Counted as bolded term entries between `## Language` and `## Relationships` in `GLOSSARY.md`: 19 at `124ce6e`, 18 at `718c79a` and unchanged at `a6434e0`. The finding's own target ("about 20 one-line terms") is met either way. The preload-tax self-contradiction (quotes 23,427/10,478-char figures then says not to quote either) was confirmed verbatim and resolved by the entry's own deletion. The "example dialogue" and "flagged ambiguities" sections were found to be mandated by `grill-with-docs/references/context-format.md`'s template spec, not grill residue — left untouched, except one dangling bolded cross-reference to the now-deleted "Preload tax" term in a Flagged-ambiguities line, which was unbolded/de-referenced in place (the ambiguity resolution itself still holds without a defined glossary entry to point at).
32. [x] ~~**Structure is described three ways** (README layout table, architecture.md plugin table, AGENTS.md structure bullets), and `VISION.md` carries a 35-line stack spec for a product that lives in another repo. One layout table in README; architecture.md keeps mechanics only; VISION drops the stack detail. Effort S.~~
> **Premise corrected, residual done (2026-09-14).** Both halves were inflated; most of the proposed split already existed.
+1 -1
View File
@@ -139,7 +139,7 @@ After the behavioral test passes, close the skill session by appending a `## Han
- <deferred items, follow-on issues, or unresolved tensions — if none, write "none">
**Next session start:**
- Load: `CONTEXT.md`, `docs/notes/skill-implementation-workflow.md`, next skill's issue file
- Load: `GLOSSARY.md`, `docs/notes/skill-implementation-workflow.md`, next skill's issue file
- First action: Step 1 (source discovery) for `<next-skill-name>`
```
@@ -22,7 +22,7 @@
## 2. The 3,000-token degradation ceiling — does it hold for 2026 models?
**Current position:** LLM reasoning performance starts degrading around 3,000 tokens of context. This is the primary justification for the 500-line skill limit, the CONTEXT.md ≤200 line constraint, and most of the token optimisation strategy.
**Current position:** LLM reasoning performance starts degrading around 3,000 tokens of context. This is the primary justification for the 500-line skill limit, the GLOSSARY.md ≤200 line constraint, and most of the token optimisation strategy.
**What to challenge:**
- The source is Levy, Jacoby, and Goldberg (2024) — a study on models that predate Claude Sonnet 4.6 and Opus 4.7 by at least one generation. Do 2026 models show the same degradation at the same threshold?
@@ -30,7 +30,7 @@
- The SkillReducer paper (arxiv.org/pdf/2603.29919) documents context budget problems but does not validate the 3,000-token specific threshold. Is there a more recent primary source?
- Does the degradation manifest equally for structured code tasks vs. natural language tasks?
**Design implication:** If the threshold is actually higher for 2026 models, the 500-line skill limit and CONTEXT.md constraint may be over-conservative. If lower, they should tighten.
**Design implication:** If the threshold is actually higher for 2026 models, the 500-line skill limit and GLOSSARY.md constraint may be over-conservative. If lower, they should tighten.
---
@@ -51,7 +51,7 @@ The existing research and principles are complete and evidence-based. The gap is
Drift has a direction: implementation moves faster than docs, so docs lag. Disciplinary fixes ("remember to update the docs") don't work at scale. The only reliable fixes are structural.
The factory is documentation-driven by default. This means: every implementation decision either derives from an existing document or produces a new one. Code that cannot be traced to a spec is out-of-scope code. A convention that isn't in CONTEXT.md isn't a convention — it's undiscoverable tribal knowledge.
The factory is documentation-driven by default. This means: every implementation decision either derives from an existing document or produces a new one. Code that cannot be traced to a spec is out-of-scope code. A convention that isn't in GLOSSARY.md isn't a convention — it's undiscoverable tribal knowledge.
**Current tooling:** git + markdown. This is the correct starting point. Every layer described below is future-compatible: when better tools arrive (living-spec platforms, architecture-as-code, doc coverage CI), they read the file structure that already exists. No migration required.
@@ -68,7 +68,7 @@ Five layers, each with a clear scope and update frequency. The rule: content liv
| Layer | Files | Changes when | Update mechanism |
|---|---|---|---|
| Governance | `AGENTS.md`, `HUMANS.md`, `CONTROLS.md`, `ai-constitution.md` | Principles change or tooling changes fundamentally | Human deliberate edit; reviewed in PR |
| Convention | `CONTEXT.md`, `LESSONS.md`, `references/stack-versions.md` | New pattern adopted; LESSONS.md threshold hit | LESSONS.md auto-graduates to CONTEXT.md at 3× same pattern |
| Convention | `GLOSSARY.md`, `LESSONS.md`, `references/stack-versions.md` | New pattern adopted; LESSONS.md threshold hit | LESSONS.md auto-graduates to GLOSSARY.md at 3× same pattern |
| Specification | `docs/spec/` (what the system does now), `docs/adr/` (decisions) | Behaviour changes or decision made | Spec updated in same PR as implementation; ADRs via architect role; never deleted |
| Work tracking | Gitea issues + feature branches | New work begins or completes | Issue created with EARS spec; branch per issue; closed when PR merges |
| Skills & workflows | `.agents/skills/**`, `.agents/workflows/`, `.agents/evals/` | Skill behaviour changes or new skill added | PR with co-located eval update; CI blocks merge if eval fails |
@@ -80,7 +80,7 @@ Five layers, each with a clear scope and update frequency. The rule: content liv
Six structural mechanisms prevent drift. All six must be active — any one of them alone is insufficient.
**One source per concern.** No content is duplicated across layers or tool-specific files. CLAUDE.md references AGENTS.md; it does not duplicate it. A skill's trigger description appears only in its `SKILL.md`; it is not copied into CONTEXT.md or a workflow file.
**One source per concern.** No content is duplicated across layers or tool-specific files. CLAUDE.md references AGENTS.md; it does not duplicate it. A skill's trigger description appears only in its `SKILL.md`; it is not copied into GLOSSARY.md or a workflow file.
**Issue spec precedes code.** No implementation work begins without a Gitea issue containing an EARS-format spec. The `factory/write-issue-spec` skill drafts this; the Gitea MCP posts it. Code on a feature branch cannot drift from a spec that must exist before the branch is created. The `deploy/deployment-checklist` skill verifies a linked issue exists before any deployment.
@@ -88,9 +88,9 @@ Six structural mechanisms prevent drift. All six must be active — any one of t
**CI eval gates block skill drift.** Every skill has an `eval.yaml` co-located in `.agents/evals/`. A change to any file under `.agents/skills/**` triggers the co-located eval in CI. A failing eval blocks merge. This means a skill body can never drift from its documented behaviour without a deliberate eval update.
**LESSONS.md graduation.** Three or more occurrences of the same pattern in LESSONS.md trigger promotion to CONTEXT.md as a standing rule. This is the only sanctioned upward flow in the documentation hierarchy — and only into the convention layer, not higher.
**LESSONS.md graduation.** Three or more occurrences of the same pattern in LESSONS.md trigger promotion to GLOSSARY.md as a standing rule. This is the only sanctioned upward flow in the documentation hierarchy — and only into the convention layer, not higher.
**Tool adapter pattern.** Tool-specific files (CLAUDE.md, `.cursor/rules`, `copilot-instructions.md`) are thin adapters that reference the source layer. They contain no original content. When a tool changes its format, only the adapter changes. The source — AGENTS.md, CONTEXT.md — is untouched.
**Tool adapter pattern.** Tool-specific files (CLAUDE.md, `.cursor/rules`, `copilot-instructions.md`) are thin adapters that reference the source layer. They contain no original content. When a tool changes its format, only the adapter changes. The source — AGENTS.md, GLOSSARY.md — is untouched.
---
@@ -112,10 +112,10 @@ Five external frameworks are relevant. Each contributes a specific, non-overlapp
| `/to-prd` skill | Converts conversation into a structured PRD artifact | Adopt the forcing-function pattern: refuse to proceed until synthesis is complete |
| `/to-issues` skill | Breaks PRD into independently shippable issues | Maps to factory's `design/break-into-issues` skill — check Pocock's "independently shippable slices" constraint |
| `/tdd` skill structure | Multi-file skill: `SKILL.md` + `tests.md` + `mocking.md` + `refactoring.md` + `deep-modules.md` | The multi-file skill pattern is best practice for complex skills. Factory's `test/write-tests` skill should adopt this structure |
| `CONTEXT.md` generation | Setup skill creates a shared vocabulary file on init | Factory already has this concept; Pocock's implementation provides a concrete template |
| `GLOSSARY.md` generation | Setup skill creates a shared vocabulary file on init | Factory already has this concept; Pocock's implementation provides a concrete template |
| `/git-guardrails` | Blocks risky agent actions (force pushes, direct main commits) | Adopt as factory's `cross-cutting/git-guardrails` skill — currently absent |
| `/diagnose` | Structured debugging state machine | Adopt as factory's `implement/diagnose` skill — currently absent |
| `/improve-codebase-architecture` | Architecture debt hunting using CONTEXT.md + ADRs | Reinforces factory's Reviewer role; drives ADR creation workflow |
| `/improve-codebase-architecture` | Architecture debt hunting using GLOSSARY.md + ADRs | Reinforces factory's Reviewer role; drives ADR creation workflow |
| `/zoom-out` | Periodic architecture perspective shift | Maps to Architect role; adopt the "zoom out before diving in" forcing function |
| `caveman` skill | ~75% token reduction through compressed output mode | Adopt for token optimisation — maps to factory's orientation problem solution |
@@ -238,7 +238,7 @@ Nothing from external frameworks enters the repo as a runtime dependency. Every
| Pocock/skills | `tdd/` (multi-file) | Adopt directly — entire folder structure | `.agents/skills/implement/tdd/` (SKILL.md + tests.md + mocking.md + refactoring.md) |
| Pocock/skills | `diagnose/SKILL.md` | Adopt directly | `.agents/skills/implement/diagnose/SKILL.md` |
| Pocock/skills | `git-guardrails/SKILL.md` | Adopt directly | `.agents/skills/cross-cutting/git-guardrails/SKILL.md` |
| Pocock/skills | CONTEXT.md generation (setup skill) | Pattern only — content is yours | `CONTEXT.md` at repo root (content file, not a skill) |
| Pocock/skills | GLOSSARY.md generation (setup skill) | Pattern only — content is yours | `GLOSSARY.md` at repo root (content file, not a skill) |
| Pocock/skills | `zoom-out/SKILL.md` | Adopt directly — merge as a mode | `.agents/skills/roles/architect/SKILL.md` |
| BMAD-METHOD | Scale-adaptive planning depth | Pattern only — complexity gate logic | `.agents/skills/factory/write-issue-spec/SKILL.md` (complexity-gating section) |
| BMAD-METHOD | Scrum Master story format | Pattern only — embed full context | `.agents/skills/design/break-into-issues/SKILL.md` (output format) |
@@ -284,8 +284,8 @@ The working tree contains only permanent, final-state content. Work in progress
```
repo/
├── AGENTS.md # Agent governance (all rules)
├── CONTEXT.md # Shared vocabulary and conventions
├── LESSONS.md # Feedback → graduates to CONTEXT.md at 3× threshold
├── GLOSSARY.md # Shared vocabulary and conventions
├── LESSONS.md # Feedback → graduates to GLOSSARY.md at 3× threshold
├── HUMANS.md # Human orientation guide
├── CONTROLS.md # Operational safety controls
│
@@ -411,14 +411,14 @@ Goal: A working factory skeleton that a real task can be run through end-to-end.
**Acceptance criteria (EARS format):**
- WHEN any task is started, THE system SHALL have a Gitea issue with an EARS-format spec before a branch is created
- WHEN a Claude Code session begins, THE system SHALL have `AGENTS.md` and `CONTEXT.md` in context
- WHEN a Claude Code session begins, THE system SHALL have `AGENTS.md` and `GLOSSARY.md` in context
- WHEN any skill is invoked, THE system SHALL load only that skill's SKILL.md (not the full library)
- WHEN a PR is raised, THE system SHALL include updates to `docs/spec/` if behaviour changed
**Tasks:**
1. Commit `AGENTS.md` — merge existing governance content; validate against principles doc
2. Generate `CONTEXT.md` — manually populate shared vocabulary (10–15 domain terms to start)
2. Generate `GLOSSARY.md` — manually populate shared vocabulary (10–15 domain terms to start)
3. Create `docs/spec/architecture.md` — initial living spec, even if sparse
4. Create `docs/adr/` with an `adr-template.md`
5. Implement Phase 1 skill set (7 files):
@@ -621,7 +621,7 @@ The factory is working when:
| Spec–implementation sync | 0 PRs merged that change behaviour without updating `docs/spec/` |
| HITL gate compliance | 100% of irreversible actions have a human approval before execution |
| Eval coverage | Every skill has trigger tests and output tests before use in production |
| LESSONS.md graduation rate | Recurring patterns promoted to CONTEXT.md within 2 weeks of third occurrence |
| LESSONS.md graduation rate | Recurring patterns promoted to GLOSSARY.md within 2 weeks of third occurrence |
| Session handoff rate | All sessions that pause mid-task have a handoff document |
| Model regression detection | Weekly eval cron catches skill degradation before it reaches production use |
@@ -639,7 +639,7 @@ These must be resolved before implementation begins. Most are inputs *to* the gr
4. **promptfoo hosting:** Self-hosted promptfoo on the homelab, or Gitea Actions cloud runners? This affects eval architecture.
5. **`CONTEXT.md` bootstrap:** What are the 10–15 most important domain terms for this project? These must be manually written before any skill invokes CONTEXT.md.
5. **`GLOSSARY.md` bootstrap:** What are the 10–15 most important domain terms for this project? These must be manually written before any skill invokes GLOSSARY.md.
6. **`docs/spec/` initial scope:** How much of the current system needs to be described in the initial living spec before Phase 1 begins? Even a sparse overview.md + architecture.md is better than nothing — agents need something to read before they can update it correctly.
@@ -655,11 +655,11 @@ Each of the following warrants its own session. They are ordered by dependency
| Session | Produces | Feeds into |
|---|---|---|
| 1. Repo vision and goals | Vision statement, success criteria, what the factory is and is not for | All subsequent sessions; CONTEXT.md bootstrap |
| 1. Repo vision and goals | Vision statement, success criteria, what the factory is and is not for | All subsequent sessions; GLOSSARY.md bootstrap |
| 2. Stack and tooling decisions | Primary language(s), test frameworks, IaC tooling, CI platform | Skill body content for implement/, test/, iac/ skills; stack-versions.md |
| 3. Roadmap and phasing | Milestone sequence, phase gates, what "done" looks like per phase | Phase plan (Section 7 of this document becomes concrete) |
| 4. ADR: documentation structure | Decision on docs/spec/ scope, Gitea issue template, ADR conventions, Diátaxis applicability | write-issue-spec skill, docs/spec/ initial structure, issue template |
| 5. ADR: governance file structure | Decision on which governance files exist, what each owns, what adapters look like | AGENTS.md, CLAUDE.md, CONTEXT.md |
| 5. ADR: governance file structure | Decision on which governance files exist, what each owns, what adapters look like | AGENTS.md, CLAUDE.md, GLOSSARY.md |
| 6. ADR: skill library scope | Which skills to build first; factory/ vs other categories; which to defer | Phase 1 and 2 skill build order |
### What to give Claude Code before each session
@@ -676,7 +676,7 @@ ai-coding-factory-skills-index.md
ai-coding-factory-implementation-guidance.md
# Add for sessions 2-6 (outputs from session 1)
CONTEXT.md (once bootstrapped)
GLOSSARY.md (once bootstrapped)
docs/adr/ (any ADRs already produced)
```
@@ -4,7 +4,7 @@
**Scope:** Design, structure, and operation of the AI-assisted software development and infrastructure management factory
**Audience:** Humans maintaining and extending the factory; AI agents making design decisions within it
**Derivation:** Derived from sourced research across ten design topics. Principles are evidence-based, not aspirational.
**Operative files:** `AGENTS.md` (agent governance) | `CONTEXT.md` (project conventions) | `.agents/skills/` (skill library)
**Operative files:** `AGENTS.md` (agent governance) | `GLOSSARY.md` (project conventions) | `.agents/skills/` (skill library)
**Research basis:** `ai-coding-factory-research.md`
The factory is a governed AI-assisted development environment. This document defines the principles behind its structure — why it is built the way it is and what governs changes to it. It is not an implementation guide; the implementation lives in the repository files this document governs.
@@ -17,7 +17,7 @@ The factory is a governed AI-assisted development environment. This document def
Write conventions, principles, and skills once in plain language with no tool-specific references. Translate into tool-specific format (CLAUDE.md, copilot-instructions.md, cursor rules) with thin adapter files that reference the source, not duplicate it. When tools change, only the adapter changes. This is the same separation-of-concerns pattern as the governance constitution: conventions are stable; tool formats are not.
**One source of truth per concern.**
AGENTS.md is the single source of governance rules. CONTEXT.md is the single source of project conventions. Each skill is the single source for its task type. Duplicating content into tool-specific files creates maintenance debt and drift — it is prohibited.
AGENTS.md is the single source of governance rules. GLOSSARY.md is the single source of project conventions. Each skill is the single source for its task type. Duplicating content into tool-specific files creates maintenance debt and drift — it is prohibited.
**Spec before implementation.**
Every non-trivial implementation task begins with a spec. The spec is the prompt for all downstream work — it defines what the Developer role builds, what QA tests, and what the Reviewer evaluates. Without a spec the factory has no contract between its stages. Spec-Driven Development is rapidly emerging but not yet mainstream in production: GitHub Spec Kit (~92K stars, May 2026), AWS Kiro (~250K signups over its first preview period), dedicated DeepLearning.AI course. No controlled study comparing SDD with ad-hoc prompting outcomes exists as of May 2026. Even so: SDD overhead is documented and real — skip the spec skill for single-file fixes, obvious one-line changes, or tasks the human can describe completely in one sentence. GitHub's own documentation notes Spec Kit is "best suited for greenfield builds and large feature work rather than small bug fixes." (Thoughtworks Radar: "Assess, not Adopt", November 2025, with the pointed observation: *"We may be relearning a bitter lesson — that handcrafting detailed rules for AI ultimately doesn't scale."*)
@@ -130,7 +130,7 @@ Veracode's 2025 GenAI Code Security Report found that **45% of tested AI-generat
Tests derived from implementation validate behaviour, which may itself be wrong — circular reasoning. Tests derived from the spec validate intent. This is a structural constraint on the write-tests skill: it requires spec input, not just code input.
**Design both feedback loops explicitly.**
The short loop (finding → immediate fix) happens by default. The long loop (recurring pattern → standing convention) must be deliberately designed. The session-handoff skill explicitly prompts LESSONS.md extraction before closing a session. Convention graduation threshold: three or more LESSONS.md entries covering the same pattern promote to CONTEXT.md as a standing rule.
The short loop (finding → immediate fix) happens by default. The long loop (recurring pattern → standing convention) must be deliberately designed. The session-handoff skill explicitly prompts LESSONS.md extraction before closing a session. Convention graduation threshold: three or more LESSONS.md entries covering the same pattern promote to GLOSSARY.md as a standing rule.
**LESSONS.md is the repo-level feedback mechanism.**
Claude Code auto-memory is per-machine and not repo-shared. For lessons to survive machine boundaries and become team-inheritable, they must be committed to `LESSONS.md` in the repo root. This is a correction from common practice — auto-memory is not a substitute.
@@ -184,7 +184,7 @@ Promptfoo is the current standard tool (MIT, YAML-based, self-hosted, CI-native)
## 9. Context and Token Architecture
**Orientation is the primary token sink — solve it with structure.**
Agents spend up to 80% of token budget on orientation rather than work. The solution is well-structured, always-available context files, not prompt compression. CONTEXT.md and the reference file architecture solve this at the source.
Agents spend up to 80% of token budget on orientation rather than work. The solution is well-structured, always-available context files, not prompt compression. GLOSSARY.md and the reference file architecture solve this at the source.
**Progressive disclosure governs the load strategy.**
Only skill name and description pairs load at startup (~30–50 tokens per skill). Full skill bodies load on trigger. Reference files load only when needed during execution. 30 skills cost approximately 900–1,500 tokens at startup. The full body cost is paid only when a skill activates.
@@ -192,7 +192,7 @@ Only skill name and description pairs load at startup (~30–50 tokens per skill
| Context | Target | Load pattern |
|---|---|---|
| AGENTS.md | ≤2,000 tokens | Always loaded |
| CONTEXT.md | ≤200 lines | Always loaded |
| GLOSSARY.md | ≤200 lines | Always loaded |
| Per skill body | ≤500 lines | On demand — skill activation |
| Per skill references | As needed | On demand — skill instruction |
| Session handoff doc | ≤1,000 tokens | Compressed state per boundary |
@@ -207,7 +207,7 @@ Using frontier models for tasks a smaller model handles adequately imposes unnec
| Adversarial and complex | Flagship (Opus) | architecture-review, security-review (STRIDE), write-spec (ambiguous requirements), incident-diagnosis |
**Prompt caching is the highest single-ROI optimisation.**
Place static content first (AGENTS.md, CONTEXT.md); dynamic input last. The per-token discount is 90% on cache reads ($0.30/MTok vs. $3.00/MTok for Sonnet 4.6). Actual aggregate savings depend on hit rate, which varies by workflow type; peer-quality agentic data (arXiv 2601.06007) shows 41–80% cost reduction. **TTL caveat:** Around March 2026, Anthropic silently regressed the default cache TTL from 1 hour to 5 minutes for Pro/API users (Max subscribers retained 1-hour TTL). Factor this into strategy — intra-session reuse is reliable under 5 minutes; inter-session reuse requires Max tier or explicit API configuration for 1-hour TTL at 2× write cost.
Place static content first (AGENTS.md, GLOSSARY.md); dynamic input last. The per-token discount is 90% on cache reads ($0.30/MTok vs. $3.00/MTok for Sonnet 4.6). Actual aggregate savings depend on hit rate, which varies by workflow type; peer-quality agentic data (arXiv 2601.06007) shows 41–80% cost reduction. **TTL caveat:** Around March 2026, Anthropic silently regressed the default cache TTL from 1 hour to 5 minutes for Pro/API users (Max subscribers retained 1-hour TTL). Factor this into strategy — intra-session reuse is reliable under 5 minutes; inter-session reuse requires Max tier or explicit API configuration for 1-hour TTL at 2× write cost.
**Tokens per completed task is the sustainability metric.**
It simultaneously tracks cost, carbon intensity, and whether AI is doing genuine work. Per-token costs fall; aggregate consumption rises because adoption scale outpaces efficiency gains (Jevons paradox). Measure it per task, not in aggregate.
@@ -197,7 +197,7 @@ Veracode is a security tool vendor with commercial interest in finding vulnerabi
4. Design both feedback loops explicitly — short (finding → fix) and long (pattern → convention).
5. Repo-level lessons learned live in committed `LESSONS.md`, not in auto memory.
6. Tier review findings by severity — alert fatigue breaks the loop.
7. Convention graduation: 3+ LESSONS.md entries on same pattern → promote to CONTEXT.md.
7. Convention graduation: 3+ LESSONS.md entries on same pattern → promote to GLOSSARY.md.
8. Session handoff skill explicitly prompts LESSONS.md extraction before closing.
---
@@ -385,7 +385,7 @@ Context engineering has largely superseded prompt engineering in 2026. Four stra
- **OOLONG benchmark (arXiv 2511.02817, November 2025):** All frontier models (including GPT-5, Claude Sonnet 4, Gemini 2.5 Pro) score **<50% at 128K context on aggregation reasoning** — directly contradicting the assumption that large context windows solve comprehension problems.
- **"Intelligence Degradation in Long-Context LLMs" (arXiv 2601.15300):** F1 collapses ~45% at 50% of maximum context for tested models — degradation is catastrophic past a threshold, not gradual.
**Design implication:** The 500-line skill limit and ≤200-line CONTEXT.md constraint remain well-founded for a different reason: not because reasoning degrades at exactly 3,000 tokens, but because (a) aggregation reasoning is poor even at 128K for all current models, and (b) the SkillReducer paper (arXiv 2603.29919) confirms that large skill bodies provide worse quality output than compressed equivalents, independent of absolute token counts. Drop the "3,000-token ceiling" framing; keep the size limits with this corrected rationale. Source: Levy et al. (2024) via thomas-wiegold.com; arxiv.org/abs/2511.02817; arxiv.org/abs/2601.15300; Anthropic MRCR v2 eval.
**Design implication:** The 500-line skill limit and ≤200-line GLOSSARY.md constraint remain well-founded for a different reason: not because reasoning degrades at exactly 3,000 tokens, but because (a) aggregation reasoning is poor even at 128K for all current models, and (b) the SkillReducer paper (arXiv 2603.29919) confirms that large skill bodies provide worse quality output than compressed equivalents, independent of absolute token counts. Drop the "3,000-token ceiling" framing; keep the size limits with this corrected rationale. Source: Levy et al. (2024) via thomas-wiegold.com; arxiv.org/abs/2511.02817; arxiv.org/abs/2601.15300; Anthropic MRCR v2 eval.
### XML tags: when they help
@@ -397,7 +397,7 @@ Claude Opus 4.5 and 4.6 tend to overengineer — extra files, unnecessary abstra
### Context file design
"Decisions not descriptions" → ~20% token reduction. AST-level file loading → ~65% fewer file reads. Source: earezki.com/ai-news/2026-02-26 (February 2026 — single practitioner case study). ⚠️ **Commercial bias: Nicola Alessi is the developer of vexp** (vexp.dev, the AST-loading tool used in the case study). The case study should not be treated as an independent third-party result. The general principle (precise context over broad loading) is sound; the specific 65% figure reflects vexp's capabilities in that specific codebase and should be treated as an indicative upper bound, not a guaranteed outcome. The "40 file reads" baseline was also unusually broad — more disciplined CONTEXT.md instructions could close most of the gap without AST tooling. Technology choices with rationale, ADRs, codebase-specific anti-patterns, Preferred/Avoid code blocks. Source: packmind.com/context-engineering-ai-coding (April 2026).
"Decisions not descriptions" → ~20% token reduction. AST-level file loading → ~65% fewer file reads. Source: earezki.com/ai-news/2026-02-26 (February 2026 — single practitioner case study). ⚠️ **Commercial bias: Nicola Alessi is the developer of vexp** (vexp.dev, the AST-loading tool used in the case study). The case study should not be treated as an independent third-party result. The general principle (precise context over broad loading) is sound; the specific 65% figure reflects vexp's capabilities in that specific codebase and should be treated as an indicative upper bound, not a guaranteed outcome. The "40 file reads" baseline was also unusually broad — more disciplined GLOSSARY.md instructions could close most of the gap without AST tooling. Technology choices with rationale, ADRs, codebase-specific anti-patterns, Preferred/Avoid code blocks. Source: packmind.com/context-engineering-ai-coding (April 2026).
### Chain-of-thought for review skills
@@ -413,14 +413,14 @@ XML experiment small sample (N=12). "20% reduction" and "65% reduction" are sing
### Provisional principles
1. Context engineering is the primary discipline — CONTEXT.md and reference files are the primary artefact.
1. Context engineering is the primary discipline — GLOSSARY.md and reference files are the primary artefact.
2. Keep loaded context per skill invocation lean — the 500-line skill limit is justified by SkillReducer's "less-is-more effect" (+2.8% quality from compressed skills) and OOLONG's finding of <50% aggregation reasoning at 128K even for frontier models. The previous "3,000-token ceiling" framing (Levy et al. 2024) was a misreading — see corrected evidence above.
3. XML for complex skills (500+ tokens, 3+ sections); plain prose for simple skills.
4. Every implementation skill includes an explicit constraints section.
5. Use `<thinking>` + named output tags for review and security skills.
6. Reference files by path rather than loading full content.
7. End every implementation skill with a self-check instruction.
8. Document Preferred/Avoid code blocks in CONTEXT.md for every convention that matters.
8. Document Preferred/Avoid code blocks in GLOSSARY.md for every convention that matters.
---