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:
1 parent
9705167cbe
commit
6644d08eaa
17 files changed
+62
-62
No files matched your search
@@ -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.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user