Core Concepts in AI Coding: Skills, MCP, Workflows, Rules, and Memories
This article breaks down five core components used when building AI agents: Skills, the Model Context Protocol (MCP), Workflows, Rules, and Memories. It explains how each component is defined, how it works in practice, where its boundaries lie, and how the five fit together, along with practical guidance on choosing and combining them in production systems.
Core Concepts in AI Coding: Skills, MCP, Workflows, Rules, and Memories
When building AI agents, developers repeatedly run into five core components: Skills, the Model Context Protocol (MCP) for tool connectivity, Workflows, Rules, and Memories. Because these concepts overlap and different platforms name them differently, they carry a high learning cost. Starting from engineering practice, this article breaks down each one’s definition, implementation logic, and boundaries, then suggests how to combine them.
1. Skills: Modular Packages of Domain Expertise
Skills were first systematically formalized by leading research institutions in the second half of 2025. The core idea is to package the methods, steps, examples, and resources needed for a class of tasks into a module that can be semantically retrieved and loaded on demand.
In essence, a Skill is usually a structured prompt plus optional scripts and reference documents. It tells the model “what to do when you hit this kind of task” rather than “who you are.” The value of a Skill lies in reuse and composition: write it once, share it across projects; chain several Skills together to complete a complex task.
A typical Skill directory looks like this:
my-skill/├── SKILL.md # Main spec: name, description, steps, constraints├── reference.md # Optional: domain reference material├── examples.md # Optional: input/output examples└── scripts/ # Optional: deterministic scripts└── parse_data.py
The header metadata in SKILL.md determines whether the Skill can be triggered correctly:
---name: Generate HTML Demo Reportdescription: Use when the user asks to convert tabular data into a visual presentation page---# Core Steps1. Call the script to parse the table file provided by the user2. Design the layout based on dashboard name, metric definitions, dimensions, and thresholds3. Generate demo mock data for each metric4. Output the final HTML page
Three engineering points matter here. First, description must state the trigger scenario clearly, otherwise the model cannot select the Skill accurately. Second, the steps inside a Skill should stay deterministic rather than leaving room for the model to improvise. Third, scripts handle deterministic computation while the model handles planning and integration; this “model + script” split significantly reduces hallucination.
2. MCP: A Standardized Capability Access Layer
If a Skill is “the method of doing the work,” MCP is “the hands and feet that do it.” It is an open standard that exposes external data sources, system APIs, local files, and similar capabilities to an agent in a uniform way.
The architecture has three sides: the host application (which carries the conversation and orchestration), the client (the protocol connector), and the server (which actually provides tools and data). A server exposes three kinds of primitives through standardized declarations: tools (executable actions), resources (readable data), and prompt templates (predefined instructions). This layering decouples tool implementations from the model, so the same tool server can be reused by different agents.
Compared with hard-coded function calls, protocol-based access means adding a data source requires no change to the agent’s main logic, only registering a server; permissions and auditing can be consolidated on the server side. In practice on cloud platforms such as Baidu AI Cloud, this connectivity layer is typically paired with common capabilities like object storage, message queues, and logging services to handle data access and leave an execution trail.
3. Workflows: The Deterministic Orchestration Skeleton
A Workflow chains multiple steps along a predefined path. It differs from a Skill in who decides the next step: a Workflow is driven by code or configuration, so the path is predictable and testable, while a Skill is triggered by model semantics, so the path depends on reasoning.
A typical scenario is: requirement parsing → code retrieval → patch generation → static checks → test verification → result summary. Each step’s output becomes the next step’s input, and human approval gates can be inserted in between. Workflows suit stable processes with strict compliance requirements; Skills suit situations where the path is uncertain and flexible judgment is needed. Mature solutions mix the two: Workflows keep the main path reliable, Skills handle open-ended questions on the branches.
4. Rules: Persistent Declarations of Boundaries
Rules are constraints that stay in effect over the long term, usually as project-level configuration files: technology stack versions, directory conventions, naming conventions, prohibited APIs, checks that must pass before a commit, and so on.
The key difference from Skills is that Rules are an “always on” baseline that need not be retrieved or triggered, while Skills are capabilities loaded on demand. Rules should be as concise and verifiable as possible; too many conflicting rules dilute the model’s attention and lower compliance. The best practice is to hand automatically checkable rules to scripts or pipeline gates, and leave rules that require semantic understanding to the model.
5. Memories: Persisting State Across Sessions
Memories resolve the tension between a limited context window and continuity across sessions. They usually fall into three types: short-term memory (the current session context), project memory (long-lived facts such as architecture decisions and module responsibilities), and user preferences (language style, output format habits).
The key to memory management is the write and forget policy: persist only stable, reusable facts, and avoid writing one-off debugging details into long-term memory; also provide entry points to inspect and clear memory so that wrong information does not pollute decisions over time. In engineering terms, memories can be stored in a vector retrieval service or a relational store, isolated by project and by user.
6. How the Five Work Together, and How to Choose
In one sentence: Rules draw the boundaries, Memories supply context, MCP connects external capabilities, Skills package methodology, and Workflows handle orchestration.
For selection, use these heuristics: choose a Skill when a capability needs semantic triggering and reuse; choose protocol-based access when you need to reach external systems; choose a Workflow when the process is fixed and needs auditing; choose Rules for long-term constraints; choose Memories for cross-session continuity.
For enterprise adoption, put all five component types under version control and a permission system so they are reviewable, rollback-able, and observable. Only by clearly separating “model capability” from “engineering constraints” can agent applications move from demo to stable production.
