DEV Community

Naimul Karim
Naimul Karim

Posted on

Stop Prompt Engineering, Start Context Engineering

AI agents get talked about a lot, but most explanations stay abstract. Here's a short, practical breakdown of what actually makes an agent work — plus a simple example.

Chat vs. Agent

  • Chat model → question → answer (you do the work)
  • Agent → goal → result (it plans + executes for you)
Chat:   You ask ──> Model answers ──> You act
Agent:  You set goal ──> Agent plans → acts → checks ──> Result delivered
Enter fullscreen mode Exit fullscreen mode

The Agent Loop

Every agent — no matter the platform — runs the same loop:

   ┌─────────┐
   │ OBSERVE │  read context, current state
   └────┬────┘
        ▼
   ┌─────────┐
   │  THINK  │  decide next action
   └────┬────┘
        ▼
   ┌─────────┐
   │   ACT   │  execute, then loop again
   └────┬────┘
        │
        └──────► repeats until task is done
Enter fullscreen mode Exit fullscreen mode

An agent = LLM (brain) + Loop + Tools + Context. The "harness" (Claude Code, Cowork, Codex, etc.) is just the app that runs this loop.

The Stack, in Layers

┌────────────────────────────┐
│ 5. Skills   → reusable SOPs │
├────────────────────────────┤
│ 4. Tools    → via MCP       │
├────────────────────────────┤
│ 3. Memory   → memory.md     │
├────────────────────────────┤
│ 2. Context  → agents.md     │
├────────────────────────────┤
│ 1. Loop     → observe→think→act │
└────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode
  • Context file (agents.md / Claude.md) — persistent "system prompt" with your role, business, tools, and preferences. Loaded every session.
  • Memory (memory.md) — updated whenever the agent is corrected. Compounds over time.
  • Tools (MCP) — Model Context Protocol connects the agent to Gmail, Notion, Calendar, Stripe, etc. without custom integration work per tool.
  • Skills — a markdown file documenting a repeatable process once, so it never needs re-explaining. Can be chained or scheduled.

Prompt engineering → Context engineering. Rich context turns a 2-word prompt into a great result.

A Quick Example

A solo creator automating their weekly newsletter:

  1. agents.md — newsletter's audience, tone, format, connected tools (Notion, Docs, social)
  2. memory.md — learns preferences over time ("shorter subject lines," etc.)
  3. Connect Notion + Docs + social via MCP
  4. One prompt: "Pull this week's notes, draft the issue, write a companion thread."
  5. Package it as a weekly-newsletter skill → schedule it for every Thursday

Same shape every time: context + memory + tools set up once → simple prompts → consistent results.

Starter Checklist

  • [ ] Pick a simple harness, create a project folder
  • [ ] Write agents.md (role, business, tools, preferences)
  • [ ] Add a starter memory.md
  • [ ] Connect 2–3 high-value tools via MCP
  • [ ] Run a real task, watch the loop work
  • [ ] Turn a repeatable task into a skill
  • [ ] Schedule a recurring skill
  • [ ] Repeat for another role/project

This isn't about cleverer prompts — it's front-loading context once so every future ask can stay simple.

Top comments (0)