An open-source project, MyCodeAgent, splits the "system prompt" (the instructions and rules sent to the AI) into 5 independent modules — in our view, this signals that Agent engineering is shifting from "one prompt to rule them all" to layered management.
What this is
An AI agent receives a set of system messages before "speaking," defining "who you are, what you can use, how to work." Most products pack this into a single mega-prompt — change a tool and you must comb through the whole thing, add a project rule and the persona gets contaminated, and the cache breaks along with it.
MyCodeAgent (a Juejin technical article walks through it in detail) splits it into five independent modules:
- Identity constitution layer: tone, safety red lines, working style
- Tool manual layer: how to use each tool, dynamically generated from a registry; supports MCP (the standard protocol that lets AI call external tools) tool circuit-breaking
- Project rules layer: read from code_law.md at the repo root
- Runtime signal layer: transient notifications, e.g., "this tool just got circuit-broken"
- Cross-turn memory layer (optional): feedback summary of the previous conversation segment
Key design: persona and tool instructions are fully decoupled, with zero contamination between them.
Industry view
This layering is the main thread in Agent engineering today. Serious players — Cursor, Anthropic, Devin — all show similar designs: tool registries, project-level rule files, dynamic context injection. Calling it an industry consensus is not an overstatement.
But counter-arguments exist:
- Complexity trap: the more layers, the harder debugging and root-causing get — one voice put it as "the prettier the prompt architecture, the bigger the nightmare in production"
- Over-engineering: a narrow-scope agent (one job) running on five layers is using a sledgehammer on a peanut
- MCP protocol still early: tool circuit-breaking and Skills hot-loading are elegant in design, but production data is still missing
Impact on regular people
For enterprise IT: when evaluating AI coding tools, the focus is not "which foundation model does it run on" but "how does it manage behavioral rules." Products that support project-level rules and clean layering will be more controllable in the long run.
For individual professionals: when Cursor or Copilot "suddenly stops listening," the cause is usually a missing project rule file or context pollution — not the AI getting dumber. Check the project rule file first.
For the consumer market: customer-service AI and shopping AI run on the same layered architecture under the hood. In the short term, behavior will become more predictable; in the long term, "training" your AI assistant will feel like onboarding a new hire — increasingly demanding a rules document.