Core AI Coding Concepts Explained: Skills, MCP, Workflow, Rules, and Memories

    This article breaks down five core concepts in AI coding tools and agent platforms: Skills, MCP, Workflow, Rules, and Memories. It explains what each component does, how they differ in scope, and how they work together, with practical examples and selection guidance for building reliable AI agents.

    1. Why These Concepts Are Easy to Confuse

    In the documentation for AI coding tools and general-purpose agent platforms, five terms appear frequently: Skill, MCP, Workflow, Rules, and Memories. They all seem to make models “smarter,” but they operate at completely different levels. Some inject methods, some connect external systems, some constrain behavior, and some accumulate experience across sessions. Treating them as the same thing often leads to architectural mistakes, such as putting rule-enforced content into a skill or hardcoding a one-off process into a prompt.

    From an agent architecture perspective, an AI coding tool is essentially a specialized agent. It needs to perceive context, call tools, follow constraints, orchestrate steps, and stay consistent across multiple turns of interaction. These five concepts map directly to those capability dimensions. The key to understanding them is to first build a layered model, then examine each one in detail.

    2. Skills: Reusable Domain Expertise Components

    A Skill is a modular capability component made up of a structured description, execution logic, and optional resources. It injects domain expertise and execution strategy into an agent and is triggered automatically through semantic matching. Put simply, a skill answers “how should this be done.”

    A skill typically has three parts: metadata (name and description, used by the model to decide whether to load it), the main instructions (steps, rules, examples), and optional resources (reference documents and scripts). For example, a skill for “generating a visualization dashboard demo page from tabular data” could be organized as:

    1. my-skill/
    2. ├── SKILL.md # Main instructions: name, description, steps, constraints
    3. ├── reference.md # Optional: field definitions and style reference
    4. ├── examples.md # Optional: input and output examples
    5. └── scripts/
    6. └── read_table.py # Optional: helper script for parsing tables

    The header metadata in the main file determines “when it is selected,” while the body determines “how it is executed”:

    1. ---
    2. name: Generate Visualization Dashboard Demo Page
    3. description: Invoke when the user asks to turn metric definitions in a table into a demo dashboard
    4. ---
    5. # Steps
    6. 1. Parse the input table and extract the dashboard name, presentation format, metrics, and dimensions
    7. 2. Design the layout and color scheme
    8. 3. Generate mock data for the demo
    9. 4. Output the final page and self-check
    10. # Constraints
    11. - Do not change the original data definitions
    12. - Output must be self-contained, avoiding external link dependencies

    The design points are: write the description to clarify the trigger scenario rather than list features; make the steps executable and verifiable; keep scripts limited to deterministic computation and leave judgment to the model. A skill’s granularity should be “one skill per task,” avoiding a catch-all manual.

    3. MCP: A Standardized Tool and Data Connection Layer

    MCP (Model Context Protocol) addresses “how an agent securely and uniformly connects to external capabilities.” It is an open protocol that declares tools, resources, and prompt templates in a unified way, so the model does not need custom adapter code for every system. Think of it as the agent’s “standard interface layer”: skills decide the method, and the protocol decides the channel.

    A typical architecture has three roles: the host (the application hosting the interaction interface), the client (the module inside the host that communicates externally), and the server (the process exposing specific capabilities). The server declares its capabilities to the outside world, stating “what tools I have, what the parameters are, and what is returned,” and the host generates invocation options accordingly. An example:

    1. {
    2. "tools": [
    3. {
    4. "name": "query_metric",
    5. "description": "Query aggregated values by metric and dimension",
    6. "input_schema": {
    7. "type": "object",
    8. "properties": {
    9. "metric": {"type": "string"},
    10. "dimension": {"type": "string"}
    11. },
    12. "required": ["metric"]
    13. }
    14. }
    15. ]
    16. }

    Practical advice: keep tool granularity small and orthogonal; write descriptions for the model rather than for documentation; set confirmation and idempotency policies for write operations; manage sensitive credentials centrally in the host and keep them out of the prompt context.

    4. Workflow: Deterministic Process Orchestration

    A Workflow arranges multiple steps in a predefined order or by condition, with the program controlling the flow rather than leaving everything to the model’s improvisation. It answers “in what order and under what conditions to proceed.” When a task is stable, enumerable, and demands high reliability, a workflow is better than purely autonomous planning.

    A minimal example:

    1. workflow: report_pipeline
    2. steps:
    3. - name: parse
    4. uses: skill.parse_table
    5. - name: analyze
    6. uses: tool.query_metric
    7. when: steps.parse.ok == true
    8. - name: render
    9. uses: skill.render_dashboard
    10. - name: notify
    11. uses: tool.send_message
    12. when: steps.render.ok == true

    The value of a workflow lies in controllability and observability: the input and output of each step can be logged, retried, and audited. Its relationship with skills is “skills provide capabilities, workflows decide orchestration”; its relationship with the protocol is “tool nodes in a workflow call external systems through the protocol.”

    5. Rules: Global Constraints and Boundaries

    Rules are constraints that are always in effect and do not depend on semantic triggering. They are typically used for security, compliance, style, and prohibited areas. They answer “what must be done and what must never be done.” Common categories include: forbidden paths, required coding and naming conventions, checks that must run before committing, and output format requirements.

    Rules should be as decidable as possible. For example, “write clear code” is not decidable, whereas “new functions must include type annotations and a docstring” and “never print tokens in logs” are decidable. Rules should be few and hard, avoiding conflicts with skill steps; when conflicts occur, priority should be explicit, and safety rules generally rank above efficiency suggestions.

    6. Memories: Accumulating Experience Across Sessions

    Memories store information that is reusable across turns and sessions, such as project conventions, user preferences, past decisions, and known pitfalls. They answer “how did we do this before.” Unlike the context window, memory is persistent, retrievable, and updatable.

    By lifecycle, memory can be divided into: short-term memory (intermediate results of the current task), long-term memory (stable preferences and architecture decisions), and archived memory (expired but traceable). Governance points include: assessing importance before writing to avoid noise; supporting deduplication and conflict resolution; providing viewing and deletion entry points to meet explainability and compliance requirements.

    7. How the Five Work Together and How to Choose

    It can be summarized in one sentence: skills are methods, the protocol is the channel, workflows are orchestration, rules are boundaries, and memories are experience. A typical task might go like this: memory provides project conventions, rules set safety boundaries, the workflow determines the steps, skills fill in how each step is done, and the protocol completes external calls.

    For selection: use skills when capabilities are reusable and need automatic triggering; use the protocol when you need to connect multiple systems and want decoupling; use workflows when the process is stable and reliability is required; use rules when there are hard compliance requirements; use memory when you need personalization and continuous improvement. If running in the cloud, you can use a container platform to host servers, object storage to store skill packages, and logging, monitoring, and alerting services for full-chain tracing, so that all five components become operable in environments such as Baidu AI Cloud.