mk:context-engineering
Decides the next runtime context move (read more, stop, ask, assume, delegate) and loads one pattern section to carry it out.
| Source | .claude/skills/context-engineering/SKILL.md |
| Owner | research |
| Runtime | claude-code |
| Risk | medium |
| Phase | on-demand |
mk:context-engineering decides the next context move for the task in front of you: read more, stop, ask, assume or delegate. It then loads at most one section of a pattern index to carry it out. It routes decisions and does not preload a knowledge library.
When to use it
- Context is near its working ceiling and phases remain.
- A long session is drifting or output quality is slipping.
- You must pick the minimal read-set before a Plan, Build or Review task.
- You are choosing between
/compact,/clearand a sub-agent. - A known pattern applies (lost in the middle, RAG dump, few-shot drift) and you want to be routed to it.
When not to use it
| Question | Use |
|---|---|
How much of .claude/ is loaded statically? | mk:context-audit |
| Record or read a memory entry | mk:memory |
| Where does code X live? | mk:scout |
| Run cost in USD | mewkit budget |
| A trivial one or two file task | Just do it |
If a request could mean either ("this project's context is messy"), the skill asks one question: the .claude/ setup or this session's runtime context.
Usage
/mk:context-engineeringWhat it does
The skill works through a five-step triage.
- Phase and tier: which workflow phase, and low, standard or complex.
- Context risk: near the ceiling, drifting, poisoned by an earlier claim, or a key fact buried. These are labelled heuristics (for example "compact around 60 to 70 percent of the window"), not measurements.
- Minimal read-set for this step, honouring the phase and tier budget in
.claude/skills/agent-detector/references/context-budget-rules.mdwhen present. - Route: load exactly one section of
references/pattern-index.md. - Apply the move and print the decision line.
Context decision: <read-more | stop | ask | assume | delegate> - <one-line reason>For assume, an ASSUMPTIONS I'M MAKING block follows.
| Move | Use when |
|---|---|
| Read more | A retrieval trigger in the context-budget rules matches (schema or contract change, security surface, cross-cutting refactor, failed verification, resume) |
| Stop | You can act, two reads in a row changed no decision, or the read ceiling is reached |
| Ask | A fact you cannot grep, a spec and code that disagree, or a business or irreversible decision |
| Assume | The uncertainty is cheap to fix |
| Delegate | An independent sub-scope would bloat this window |
Four operations
| Operation | Meaning |
|---|---|
| Write | Push durable state out of the window (memory file, scratchpad, hand-off brief) |
| Select | Load the smallest high-signal set |
| Compress | Summarise essential state and restart when the window degrades |
| Isolate | Give a sub-agent its own window and take back a distilled result |
Pattern index
Match the signal and load one section of references/pattern-index.md.
| Signal | Section |
|---|---|
| Too much loaded | less-noise |
| Long session, output drifting | degraded-session |
| State must survive compaction or a new session | persistence |
| Split work across sub-agents | delegation |
| RAG, index-first, grounding | retrieval |
| Prompt ordering, trust levels, constraints | prompt-structure |
| Few-shot, structured output, tool selection | examples-tools |
| Images or video in context | multimodal |
| Key fact ignored mid-context | critical-position |
| A model-generated claim treated as true | safety |
With no match, the skill says so and carries on with the four operations.
Host operations
| Situation | Move |
|---|---|
| Window long, task continues | /compact (costs latency, skip on small tasks) |
| Switching to an unrelated task | /clear, after durable state is written out |
| Independent sub-scope | Sub-agent |
Gotchas
- Load one reference section per decision. Loading several turns the router into a dump.
- Compacting at about 50 percent is safe but wastes latency on small tasks. The thresholds are heuristics.
- Never quote an API, number or config from memory when it can be read. An unverifiable fact is an ask or an explicit assume.