Pattern: Context engineering (right context, right time)

Deliberately curate what an agent sees: rules files, packed context, and MCP integrations that supply the relevant code, types, and conventions at the moment they are needed — no more, no less. Treats the context window as a managed resource rather than a dumping ground, so output quality stays high and degradation (drift, forgotten constraints) is caught and reset.

Addy Osmani — Agent Skills:

BMAD:

  • bmad-create-story — front-loads “all the context the agent will need” into the story file.
  • bmad-dev-story — implements from that self-contained context, so it can run fresh.
  • bmad-prd — maintains a .memlog.md append-only decision/audit trail as durable run context.

A second framework promotes this from an Addy-only technique to a two-framework pattern. Addy curates context at invocation (rules files, packing, MCP); BMAD engineers it into the work unit — the story file, project-context.md, and .memlog.md carry the context forward so each agent starts fully briefed. Context engineering is arguably BMAD’s organizing principle.

Compound Engineering:

gstack:

  • gstack-sync-gbrain — writes a GBrain search-guidance block into CLAUDE.md so the agent prefers the right context tools.
  • gstack-learn — cross-session learnings fed back into new work.

Agent OS — the framework built almost entirely around this pattern:

  • agent-os-inject-standards — the purest realization: deploy only the standards the current task needs, choosing file-reference vs embedded-snapshot payloads — right context, right time made an explicit, invocable act.
  • agent-os-index-standards — the index.yml one-line-description matcher that lets standards be loaded selectively instead of all-at-once (“Every word costs tokens”), the mechanism that keeps the guide layer from becoming context rot.
  • agent-os-discover-standards — authors the standard files this curates. See artifact-standards.

Provided by (harness)

The harness layer supplies the context-assembly machinery these skills configure — what actually loads into the window at each turn:

  • claude-codeCLAUDE.md (project + ~/.claude/CLAUDE.md global) loaded every session as standing instructions, a file-based persistent memory (/memory), MCP resource/tool loading (deferred until needed), and description-triggered skill loading — the primitive under addy-context-engineering’s rules-files-and-MCP and gstack’s CLAUDE.md search guidance.
  • opencodeAGENTS.md project config + configurable skills/rules + MCP assemble per-turn context.
  • piAGENTS.md + SYSTEM.md loaded from ~/.pi/agent/, parent dirs, and cwd, plus skills and customizable compaction summarization.
  • factory-droidAGENTS.md (shared standard, CLAUDE.md-compatible; discovery walks to the git root plus ~/.factory/ personal defaults) + skills + 40+ MCP servers + plugins assemble per-turn context.

See Also