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
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user