# Day 4: Context Engineering and MCP

> You'll learn how to give AI the right context at the right time via rules, skills, and MCP. Strong context engineering is what makes AI outputs consistent and production-ready.

- **Source:** https://ainativesoftware.engineering/roadmap/day-4
- **Site:** AI-Native Software Engineering — https://ainativesoftware.engineering/book

- **Day:** 4 of 7
- **Topics:** 8
- **Reading time:** 30 minutes

You'll learn how to give AI the right context at the right time via rules, skills, and MCP. Strong context engineering is what makes AI outputs consistent and production-ready.

## The 8 topics

- 01 · [From Prompt Engineering to Context Engineering](https://ainativesoftware.engineering/roadmap/day-4/from-prompt-engineering-to-context-engineering.md) — Why the craft has shifted from writing clever individual prompts to curating the full state an agent receives: tools, history, files, rules, and constraints. How that shift changes what good engineering looks like. _(1 min)_
- 02 · [Rules and Instructions: Persistent Context for Your Agent](https://ainativesoftware.engineering/roadmap/day-4/rules-and-instructions-persistent-context-for-your-agent.md) — How to use rules files, repository instructions, and AGENTS.md to give agents consistent, project-level context without repeating yourself in every prompt. The difference between global rules, project rules, and task-specific instructions. _(3 min)_
- 03 · [Skills and Commands: Reusable Patterns](https://ainativesoftware.engineering/roadmap/day-4/skills-and-commands-reusable-patterns.md) — How to package reusable capabilities as skills and reusable prompt workflows as commands, so agents can load exactly what they need for a task without bloating the default context. _(4 min)_
- 04 · [Custom Agents and Personas](https://ainativesoftware.engineering/roadmap/day-4/custom-agents-and-personas.md) — When and how to define specialized agents configured for a specific role or task. How persona definitions, scoped instructions, and the AGENTS.md pattern let you build agents that stay focused and don't overstep. _(3 min)_
- 05 · [Rules, Skills, Commands, and Custom Agents: Knowing What to Use When](https://ainativesoftware.engineering/roadmap/day-4/rules-skills-commands-and-custom-agents-knowing-what-to-use-when.md) — A clear map of the four context management techniques available in modern AI coding tools, what each one is for, who triggers it, and how to combine them without creating a mess. _(6 min)_
- 06 · [Model Context Protocol (MCP): What It Is and Why It Matters](https://ainativesoftware.engineering/roadmap/day-4/model-context-protocol-mcp-what-it-is-and-why-it-matters.md) — What MCP is, why it emerged as a standard, and how the client-server architecture connects AI assistants to external data sources, tools, and APIs in a consistent and composable way. _(4 min)_
- 07 · [MCP Security: What Can Go Wrong](https://ainativesoftware.engineering/roadmap/day-4/mcp-security-what-can-go-wrong.md) — The real security risks that come with connecting agents to external systems via MCP: prompt injection through tool outputs, data exfiltration, confused deputy attacks, and the practices that mitigate them. _(5 min)_
- 08 · [Harness Engineering: Everything Around the Model](https://ainativesoftware.engineering/roadmap/day-4/harness-engineering-everything-around-the-model.md) — Why the systems wrapped around an LLM — the prompts, tools, sensors, and guardrails — matter as much as the model itself, and how to think about them as a discipline rather than a bag of tricks. _(4 min)_

**Every curated resource in day 4**

- [Context Engineering as a Pillar of AI-Native Engineering (jsdevai.com)](https://jsdevai.com/pillars/context)
- [Effective Context Engineering for AI Agents – Anthropic](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents)
- [Custom Instructions in VS Code – Microsoft Docs](https://code.visualstudio.com/docs/copilot/customization/custom-instructions)
- [Rules – Cursor Docs](https://cursor.com/docs/context/rules)
- [Agents.md](https://agents.md/)
- [Awesome Cursor Rules – Community-Contributed Rulesets](https://github.com/PatrickJS/awesome-cursorrules)
- [Agent Skills – Claude Docs](https://code.claude.com/docs/en/skills)
- [Agent Skills in VS Code – Microsoft Docs](https://code.visualstudio.com/docs/copilot/customization/agent-skills)
- [Agent Skills – Cursor Docs](https://cursor.com/docs/context/skills)
- [Commands – Cursor Docs](https://cursor.com/docs/context/commands)
- [Prompt Files (Commands) – VS Code Docs](https://code.visualstudio.com/docs/copilot/customization/prompt-files)
- [Custom Agents in VS Code – Microsoft Docs](https://code.visualstudio.com/docs/copilot/customization/custom-agents)
- [SubAgents – Cursor Docs](https://cursor.com/docs/context/subagents)
- [Sub-Agents – Claude Docs](https://code.claude.com/docs/en/sub-agents)
- [Agent Skills vs. Rules vs. Commands – Builder.io](https://www.builder.io/blog/agent-skills-rules-commands)
- [Custom Agents, Agent Skills and Custom Instructions in Copilot – GitHub Community](https://github.com/orgs/community/discussions/183962)
- [What Is the Model Context Protocol? – Official Docs](https://modelcontextprotocol.io/docs/getting-started/intro)
- [MCP Server Registry – mcp.so](https://mcp.so)
- [Awesome MCP Servers – Community List](https://github.com/punkpeye/awesome-mcp-servers)
- [MCP Security Issues Threatening AI Infrastructure – Docker](https://www.docker.com/blog/mcp-security-issues-threatening-ai-infrastructure/)
- [Harness Engineering for Coding Agents – Martin Fowler](https://martinfowler.com/articles/harness-engineering.html)

- **Previous day:** [Day 3: The AI Agents Landscape](https://ainativesoftware.engineering/roadmap/day-3.md)
- **Next day:** [Day 5: Spec-Driven Development](https://ainativesoftware.engineering/roadmap/day-5.md)
- **All days:** [The 7-day roadmap](https://ainativesoftware.engineering/roadmap.md)

---

_AI-Native Software Engineering by Alfonso Graziano (O'Reilly Media, Early Release; print edition February 2027). Every page of ainativesoftware.engineering is also served as Markdown: append `.md` to any URL. Index: https://ainativesoftware.engineering/llms.txt — whole site in one file: https://ainativesoftware.engineering/llms-full.txt._
