Understanding Skills, MCP, Workflow, Rules, and Memories in AI Coding Tools

    This article explains five core components in AI-assisted coding—Rules, Memories, Skills, MCP, and Workflow—and clarifies their overlapping responsibilities. It frames them as a capability layering model, details what each component does and where it belongs, compares Skills with Workflow, and shows how they work together in a typical development scenario, along with practical guidance for choosing and adopting them.

    1. The Problem: Mixed Concepts Create Engineering Friction

    In AI-assisted development today, teams run into a recurring problem. Terms such as Skill, MCP, Workflow, Rules, and Memories appear across different tools and documentation, but their boundaries are blurry and their responsibilities overlap. As a result, teams building an automated development system struggle to decide where a given piece of logic belongs. Put it in the wrong place, and you get rules the model ignores, workflows that cannot be reused, context that keeps expanding, and unstable tool calls.

    Understanding these five components is therefore not about memorizing names. It is about building a mental model of capability layering. The sections below first position each component, then look at them one by one.

    Overall, they fall into five layers:

    • Rules (constraint layer): define what can and cannot be done—static boundaries.
    • Memories (state layer): preserve what happened in the past—accumulated state.
    • Skills (capability layer): define how to do something—reusable expertise.
    • MCP (protocol layer): solve how to connect to the external world—standardized interfaces.
    • Workflow (orchestration layer): arrange the order in which work gets done—the execution skeleton.

    2. Skills: Modular Domain Expertise

    A Skill is a modular capability component. It typically consists of three parts: a structured description, execution logic, and optional supporting resources. It injects domain-specific expertise and operating strategies into an agent and is triggered automatically based on semantics during interaction with the user or the environment.

    It has three key characteristics:

    1. Semantic triggering rather than hard-coded invocation. The model decides whether to load a skill based on the current intent, instead of relying on fixed conditional branches.
    2. Progressive loading. The full skill description does not have to be pushed into context all at once. A summary can be loaded first, with details and attached resources read only when needed, which keeps context cost under control.
    3. Composability. Multiple skills can be stacked. For example, a “generate a visualization report” skill can call a “data query” skill along with external tool capabilities.

    A sample skill description structure looks like this (pseudocode, only to show the organization):

    1. name: report-dashboard
    2. description: Use when the user needs data results presented as a dashboard
    3. when_to_use: user mentions reports, dashboards, visualization, or briefing material
    4. steps:
    5. 1. Confirm the data scope and time range
    6. 2. Call the data query capability to fetch the result set
    7. 3. Organize the data by metric and dimension
    8. 4. Output a single-file dashboard page and self-check
    9. resources:
    10. - templates/dashboard_base.html
    11. - references/chart_conventions.md

    It is worth stressing that a Skill is still a structured, prompt-like description. It tells the model the methods, steps, examples, and available tools for a certain type of task, but it does not connect tools or decide the order of a workflow.

    3. MCP: A Standardized Protocol for Capability Access

    MCP is an open protocol that standardizes how agents interact with external systems. It exposes capabilities such as tools, resources, and prompt templates in a standard form, which the agent side discovers and invokes uniformly.

    The core pain point it addresses is fragmented integration. In the past, connecting each new system required a custom adapter, and maintenance costs rose sharply as the number of tools grew. Once the interface is standardized, an integrator only needs to implement a standard server once, and any compatible agent client can reuse it.

    In the layering, MCP sits at the capability supply position:

    • It does not decide when to use a given tool—that is the job of Skills and Workflow.
    • It only ensures that tools can be discovered reliably, parameters can be validated correctly, and results can be returned in a structured form.

    Practical advice: enforce permission and audit constraints at the protocol layer for high-risk operations (deletion, release, database writes), rather than relying on prompts to hold the security boundary.

    4. Workflow: Deterministic Execution Orchestration

    Workflow emphasizes controllable ordering and state transitions. It fits scenarios with clear steps, predictable results, and a need for auditing and rollback—for example, a check pipeline before code commits, a release process, or a batch refactoring task.

    The comparison with Skill is the most revealing:

    Dimension Skill Workflow
    Driving mode Semantic judgment, elastic triggering Predefined nodes, deterministic execution
    Applicable scenarios Open-ended, experience-driven tasks Repetitive, strongly constrained tasks
    Predictability Lower High
    Failure handling Relies on model self-correction Explicit retry, branching, rollback

    A simplified workflow definition:

    1. workflow: pr-gate
    2. nodes:
    3. - lint # static checks
    4. - unit-test # unit tests
    5. - review # agent review
    6. - report # summarize and output the conclusion
    7. on_failure: terminate and return the failed node's logs

    A mature engineering practice is “workflow as the skeleton, skills as the flesh”: the main path uses a Workflow to guarantee determinism, while individual nodes are allowed to call Skills for open-ended judgment.

    5. Rules and Memories: Boundaries and State

    Rules are always-on static constraints, such as coding standards, directory structure conventions, a ban on directly modifying generated directories, and commit message formats. They should stay concise and always in effect. Too many rules dilute attention and actually lower compliance. The test is simple: only write a rule if violating it causes irreversible consequences.

    Memories are state accumulated across sessions, and can be divided into:

    • Factual memories: the project’s tech stack, dependency versions, and deployment environment conventions.
    • Preference memories: the user’s preferred naming style, comment density, and level of detail in answers.
    • Experiential memories: pitfalls encountered before and fixes that worked.

    The key to memory governance is write filtering and a forgetting mechanism. Recording without constraints lets noise flood the context and may cause outdated information to be treated as fact. A good practice is to attach source, time, and confidence to each memory, and to allow explicit invalidation.

    6. How They Combine: A Typical Development Scenario

    Take “add a new endpoint to an existing service and deliver it” as an example:

    1. Rules are in effect throughout, constraining style and the security baseline.
    2. Memories provide project background and past decisions.
    3. Workflow orchestrates “read code → design → implement → test → summarize”.
    4. Inside the “implement” node, a Skill provides coding and self-check methods for this type of task.
    5. When reading or writing external systems is needed, MCP provides standardized tool calls.

    7. Selection and Adoption Guidance

    • Capture content that is semantically ambiguous and experience-driven as a Skill.
    • Capture content that needs strict determinism and auditability as a Workflow.
    • Route all external system interaction through the protocol layer, avoiding scattered custom adapters.
    • Write non-negotiable bottom lines into Rules, and keep the number restrained.
    • Let information that is valuable and stable across sessions enter Memories, with an invalidation strategy in place.

    In related engineering practice at Baidu AI Cloud, this kind of layered approach is typically used alongside general cloud capabilities such as container platforms, log services, and monitoring and alerting to achieve observability and operability. Overall, the relationship among the five can be summarized as: Rules set the boundaries, Memories carry the state, Skills provide the methods, MCP connects the tools, and Workflow decides the order.