AI Coding Concepts Explained: Skills, MCP, Workflows, Rules, and Memories
As AI enters the software development workflow, five concepts keep surfacing—Skills, MCP, Workflows, Rules, and Memories—yet they are often treated as interchangeable. This article breaks them down across five dimensions: capability injection, tool connectivity, process orchestration, behavioral constraints, and state persistence. It also includes directory structures and sample code, along with practical guidance to help developers build AI coding systems that are reusable and maintainable.
1. Background: Too Many Concepts, Too Little Engineering Clarity
As large language models are adopted in software development, AI coding tools have introduced a wave of new terms: skills, connection protocols, workflows, rules, and memories. These terms are often listed side by side in documentation and community discussions, but rarely compared within a single framework. As a result, teams repeatedly run into the same problems during selection and implementation: stability issues that should be handled by process orchestration get patched with prompt stacking; real-time data that should come from external systems gets forced into the context window; and team conventions that should be fixed in place are left for the model to guess at every time.
To untangle these concepts, start with one criterion: every mechanism ultimately answers one of four engineering questions—where capabilities come from, in what order actions run, who enforces the boundaries, and where state is stored. Once these four questions are mapped clearly, the division of labor among the five concepts stops being ambiguous.
2. Precise Definitions of the Five Concepts
2.1 Skill: Reusable Packaging of a Methodology
A Skill is a modular capability component made up of three parts: a structured description, execution logic, and optional resources. It injects domain expertise and execution strategy into an agent, and is invoked automatically based on semantic similarity during interaction. Think of it as “writing down how a senior engineer gets things done, as documentation plus scripts”—not just a conversational prompt.
A typical scenario: a business team has already produced reports in a fixed format using a spreadsheet tool, and now needs an agent to read the layout and data from the spreadsheet and generate a web dashboard suitable for a presentation. In this case, the Skill must declare its name, functional description, execution steps, detailed constraints, and callable scripts. The directory layout usually looks like this:
report-dashboard/├── SKILL.md # Main doc: name, description, steps, constraints├── reference.md # Optional: domain reference material├── examples.md # Optional: positive and negative examples└── scripts/└── read_table.py # Reads the spreadsheet and outputs structured data
There are three design essentials. First, the description must make clear “when to use me,” otherwise the model cannot route correctly. Second, steps must be verifiable, so avoid open-ended phrasing. Third, scripts handle deterministic computation, while the model is responsible only for decisions and assembly.
2.2 MCP (Model Context Protocol): A Standardized Capability Access Layer
MCP is an open protocol that exposes external data sources and tool capabilities to the model side in a unified way. It solves the “connection” problem. It typically consists of three elements: queryable resources, callable tools, and reusable prompt templates. Databases, file systems, logging services, monitoring and alerting, container platforms, and more can all be standardized through an adapter layer.
Its relationship with Skill is one of “supply and consumption”: a Skill describes a methodology and declares which tools it needs, while MCP provides the actual entry points for those tools. Conflating the two couples methodology with infrastructure, so any change on either side triggers large-scale rework.
2.3 Workflow: Deterministic Execution Orchestration
A Workflow emphasizes order, branching, retries, and human confirmation points, with an orchestration engine—not the model’s free choice—deciding the path. It fits scenarios with clear requirements and stable steps, such as static checks, builds, tests, and artifact archiving before a code commit. Its value lies in repeatability and auditability: the same input always produces the same path.
A practical rule of thumb: if the result must be stable and reproducible, use a Workflow; if the path requires on-the-spot judgment, leave it to the model’s autonomous planning.
2.4 Rules: Always-On Hard Constraints
Rules are behavioral guidelines that stay resident in context, covering coding style, directory conventions, dependency-adoption policy, security red lines, and more. They do not vary by scenario and do not perform semantic matching; they always participate in reasoning. The difference from Skills is the trigger mechanism: Skills load on demand to save context, while Rules stay constantly present to guarantee the baseline.
Rules should be short, decidable, and automatically verifiable. Anything that can be handed to formatting tools and static analysis should not consume the model’s attention.
2.5 Memories: State Persistence Across Sessions
Memories retain information that stays valid across turns and across sessions, such as architecture decisions, past pitfalls, and user preferences. They resolve the tension between a limited context window and long project cycles. In engineering terms, you need to distinguish short-term session state from long-term knowledge accumulation, and set write thresholds, confidence levels, and expiration policies for memories; otherwise stale information will keep polluting judgment.
3. How They Work Together and How to Choose
A complete task usually involves all five working in concert: Rules draw the boundaries, Memories supply historical context, the model selects a Skill based on semantics, the Skill calls external capabilities through MCP, and deterministic steps are handed off to a Workflow.
For implementation, three stages are recommended: first, lock down Rules and Workflows to secure deterministic gains; then accumulate high-frequency Skills into team assets; finally, introduce MCP to connect enterprise systems and use Memories to close the loop on experience. In related engineering practice, Baidu AI Cloud typically follows the same order—“standards first, capability integration next, knowledge accumulation last”—to reduce trial-and-error costs.
4. Common Pitfalls
The first is writing every requirement as a Skill, which bloats context and lowers routing accuracy. The second is letting the model orchestrate critical paths on its own, sacrificing reproducibility. The third is ungoverned memory, with arbitrary writes and no cleanup of expired entries. The fourth is rules that are overly long and duplicate what automation tools already do. The remedy is always the same: define the responsibility boundary of each mechanism clearly, so determinism belongs to the engine, judgment belongs to the model, and knowledge belongs to the asset repository.
