Quick Ref / Command

Engineer Kit

/ak:context-engineering

Optimize LLM context quality

Optimize LLM context quality, token budgets, memory, tool design, and multi-agent isolation when context limits or degradation matter.

01

Identify failure

02

Measure baseline

03

Select reference

04

Choose strategy

Rule 01

Context quality beats quantity.

Rule 02

Attention is finite; beginning and end positions matter.

Rule 03

Load information just in time through progressive disclosure.

Rule 04

Partition work to prevent context degradation.

Rule 05

Measure before optimizing.

Execution Map

Core lanes from input to output, aligned with the command's real execution path.

01

Start

Input, scope, route

  1. 1 Identify failure Start from the observed context problem: limit pressure, lost-in-middle behavior, poisoning, noisy context, memory gaps, or agent architecture trouble.
  2. 2 Measure baseline Use available runtime awareness, supplied context, token utilization, variance, cache signals, and cost or latency evidence before optimizing.
02

Work

Agent / skill execution

  1. 3 Select reference Load only the relevant reference: fundamentals, degradation, optimization, compression, memory, multi-agent, evaluation, tool design, pipelines, or runtime awareness.
  2. 4 Choose strategy Apply the four buckets—write, select, compress, isolate—while preserving goals, decisions, constraints, artifacts, current state, and next steps.
03

Verify

Gate, review, validation

  1. 5 Act at thresholds Warn around 70% context utilization, optimize around 80%, and treat 90% as critical; target 50–70% compaction with under 5% quality loss when compression is chosen.
  2. 6 Validate with probes Use probe-based evaluation and task-level metrics so factual recall, artifacts, continuation, and decision rationale survive token reduction.

Syntax, arguments, subcommands

How to invoke the skill: syntax, positional arguments, shared options, then each subcommand with its own syntax and outcome.

Syntax

/ak:context-engineering [topic or question]

Arguments

[topic or question] Required

Context question

Natural-language context budget, degradation, compression, memory, tool-design, runtime-usage, or agent-coordination problem. Ask for a specific output such as a diagnosis, budget, compression policy, memory design, tool review, or evaluation plan.

/ak:context-engineering "Our tool outputs dominate a long debugging session. Design a compaction policy that preserves errors, decisions, changed files, and next steps; do not write files."

Special Operations

Write

Move durable information into scratchpads, files, or memory stores.

Select

Retrieve only relevant context for the current step.

Compress

Summarize while preserving decisions, constraints, and evidence.

Isolate

Split work across subagents to avoid one overloaded context.

Sample Prompt

Concrete invocations for each flag, subcommand, mode, or route available in the live workflow.

Usage warning Recommended
/ak:context-engineering context window is at 82%; help compact without losing critical requirements, decisions, changed files, or next steps
Use when:
A long session is near context limits.
Expected:
A measured compaction plan that names the pressure, preservation contract, reduction target, and probes for checking critical facts after compression.
Agent architecture
/ak:context-engineering design context isolation for a multi-agent review workflow with clear handoffs and cost boundaries
Use when:
A multi-agent system needs clean work partitioning.
Expected:
Guidance for splitting work across agents, passing only high-signal context, avoiding role-play-only isolation, and measuring tokens per task.
Memory design
/ak:context-engineering design a cross-session memory approach for an LLM coding assistant without storing private user data
Use when:
A product needs memory or retrieval without unsafe persistence.
Expected:
A bounded memory strategy covering what to write, what to retrieve just in time, privacy limits, and evaluation probes for future recall.
Tool descriptions
/ak:context-engineering review these tool descriptions for token cost, clarity, when-to-use boundaries, inputs, and returns
Use when:
Tool definitions are bloated or agents choose the wrong tools.
Expected:
A tool-design review using the four-question framework, with concrete trimming advice and checks for clearer selection boundaries.

Handled Scope

  • Context window monitoring
  • Compression strategies
  • Memory systems
  • Multi-agent coordination
  • Tool description design
  • LLM evaluation

Next