# A Complete Guide to the Six Core Concepts in LLM Applications

    This article breaks down six widely used but often confused terms in large language model development: foundation models, prompts, skills, agents, AI coding tools, and CLI agents. It explains the industry-accepted definition of each concept, the problems it solves and does not solve, and how they map to a layered architecture from models to systems. You will also find practical guidance on context budgeting, sampling parameter governance, prompt specification, skill design principles, agent guardrails, and terminal usage conventions, along with common misconceptions and selection criteria for choosing the right abstraction layer.

    A Complete Guide to the Six Core Concepts in LLM Applications

    Once generative AI moves into engineering deployment, a group of related but poorly defined terms tends to dominate discussions: foundation models, prompts, skills, agents, AI coding tools, CLI agents, and several aliases borrowed from community slang. Many teams argue endlessly during architecture reviews. The root cause is rarely a disagreement over technology choices; it is a lack of conceptual alignment — treating a capability as a product, or a wrapper as a model — which eventually produces architectures that are hard to maintain.

    The goal of this article is to take these concepts apart piece by piece: define each one as the industry generally does, explain what it solves and what it does not, and then propose a reusable layered architecture along with engineering practices. No specific vendor products are discussed, and no third-party tools are recommended or reviewed.

    1. Setting Up the Coordinate System: A Six-Layer Structure from “Model” to “System”

    The fastest way to understand these terms is to recognize that they sit at different levels of abstraction. A bottom-up layering works well for locating them:

    1. Foundation model layer: General-purpose models that provide language understanding, reasoning, and generation, typically invoked through a model-as-a-service interface and metered per token.
    2. Interaction contract layer: The prompt and the way context is organized, which sets the quality ceiling for model behavior.
    3. Capability encapsulation layer: Skills, which turn reusable workflows into modules that a model can invoke.
    4. Autonomous decision layer: Agents, which execute through planning, tool invocation, and iterative reflection.
    5. Scenario product layer: AI coding tools, interaction forms refined for the vertical scenario of software development.
    6. Terminal interaction layer: CLI agents, an agent form that runs in a terminal and uses text streams as its interface.

    The “English codename,” “Chinese product name,” and “multiplier plan” phrases circulating in communities are mostly colloquial labels for one of these layers or sales-channel wording; they do not constitute new technical categories. To decide which layer a term belongs to, ask three questions: Does it consume tokens? Can it be replaced? Does it have an autonomous loop?

    2. Foundation Models and Token Metering: The Starting Point of All Costs

    The foundation model is the source of capability, but what engineering really needs to care about is its interface contract: input is a token sequence within a context window, and output is a token sequence obtained by probabilistic sampling. So-called multipliers and discounts are essentially adjustment coefficients applied by the service provider to token pricing. They belong to commercial and channel information, are unrelated to technical architecture, and can change at any time, so they should not sit on the critical path of design documents.

    Three things need to be put in place in engineering:

    • Context budget: Bring the system prompt, retrieved snippets, conversation history, and tool return results into a unified budget, trimming by priority when limits are exceeded.
    • Sampling parameter governance: Parameters such as temperature, nucleus sampling thresholds, and maximum output length should be configured centrally rather than scattered across business code.
    • Observability: Record token consumption, time to first token, overall latency, and failure rates as a basis for capacity and cost assessment.
    1. context budget = system instructions + skill descriptions + retrieved snippets + history summary + current input + reserved output
    2. constraint: total <= model context window * safety factor (0.8 recommended)

    3. Prompt Engineering: Turning Vague Requirements into Verifiable Instructions

    A prompt is not a magic spell; it is a specification of model behavior. A high-quality prompt usually contains five elements: role and goal, input description, constraints and prohibitions, output format, and failure handling. Making the output format explicit delivers the largest payoff, because it turns a natural-language task into a verifiable structured contract.

    A practical pattern is “plan first, then execute”: ask the model to output a brief plan and its assumptions before giving results, and require confirmation before high-risk actions. This significantly reduces the probability of hallucinations and out-of-scope operations.

    1. [Goal] Identify the root cause of an anomaly from a given log excerpt.
    2. [Input] time_range, service_name, log_excerpt
    3. [Constraints] Infer only from the input; do not fabricate metrics; output "unknown" and list missing items when information is insufficient.
    4. [Output] JSON: {root_cause, confidence, evidence[], missing[]}
    5. [Failure handling] When confidence < 0.6, switch to a list of troubleshooting suggestions.

    It is worth stressing that prompts are volatile assets. They should be placed under version control and regression evaluation, using a fixed test set to compare accuracy and stability across versions rather than adjusting them by intuition.

    4. Skills: Consolidating Repetitive Workflows into Invocable Capabilities

    A skill is an encapsulation of a class of tasks. It typically includes a description of trigger conditions, required inputs, execution steps, dependent external capabilities, and the return structure. Its value lies in reuse and noise reduction: it extracts long workflows out of prompts, so the main prompt retains only dispatch logic and context consumption drops significantly.

    Four principles for skill design:

    • Single responsibility: One skill does one verifiable thing; avoid “do-everything” skills.
    • Idempotence and rollback: Provide compensation paths for write operations to prevent data inconsistency from repeated execution.
    • Least privilege: A skill requests only the read permissions necessary for the task; write permissions require separate approval.
    • Clear failure semantics: Distinguish between “invalid parameters,” “dependency unavailable,” and “uncertain result” so the upper layer can make decisions.

    5. Agents: Moving from “Answering” to “Closed-Loop Execution”

    The defining feature of an agent is the loop: perceive — plan — call tools — observe results — revise the plan, until a termination condition is met. The essential difference from a single question-and-answer interaction lies in state management and termination judgment. In implementation, three kinds of guardrails are mandatory: a maximum iteration count, per-step and total budget caps, and an allowlist for dangerous operations.

    1. # Pseudocode: agent main loop with guardrails
    2. for step in range(MAX_STEPS):
    3. plan = model.decide(state, tools=ALLOWED_TOOLS)
    4. if plan.action == "final":
    5. return plan.answer
    6. result = executor.run(plan.action, budget=STEP_BUDGET) # abort on timeout or over-budget
    7. state = memory.update(state, result, summarize=True) # compress history, control context
    8. raise MaxIterationsReached()

    A layered memory strategy is recommended: keep raw steps in the short term, produce rolling summaries in the medium term, and write to external storage in the long term for on-demand retrieval. This preserves traceability while preventing context from growing without bound.

    6. AI Coding Tools and CLI Agents: Two Interfaces to the Same Capability

    An AI coding tool is an agent form built for the development scenario, emphasizing integration with code repositories and build and test pipelines. A CLI agent runs in a terminal and is characterized by pure text interaction; it excels at scripting, orchestration, and integration into CI pipelines. Both share the same core — model + prompts + skills + tool invocation + permission control — and differ mainly in the interaction layer and integration points.

    When working in a terminal environment, the following conventions are recommended:

    • Work inside a version-controlled repository so any change can be diffed and rolled back.
    • Default to read-only; write operations and network access require explicit authorization.
    • Make build, static analysis, and tests mandatory acceptance steps, with the pipeline — not the model’s self-assessment — determining whether they pass.
    • Redact output logs to keep secrets and personal information out of the context.

    7. Common Misconceptions and Selection Advice

    Misconception 1: Equating model capability with product capability. The model only provides probabilistic generation; stability comes from the surrounding engineering.

    Misconception 2: Using overly long prompts instead of skill encapsulation. The result is higher cost and conflicting instructions.

    Misconception 3: Granting agents overly broad permissions. This is a major source of production incidents.

    Misconception 4: Using community aliases as a basis for technology selection. An alias is not an interface contract and says nothing about replaceability.

    For selection, ask yourself in order: Does the task need an autonomous loop? If not, prompts plus skills are enough; if it does, introduce an agent, and prefer solutions with standardized interfaces, clear permission models, and solid observability. If an organization already uses cloud-based general capabilities, model services, object storage, message queues, container platforms, log services, and monitoring and alerting can be combined into a complete pipeline, with a unified gateway handling rate limiting, auditing, and cost accounting — avoiding lock-in to a single implementation.

    Closing Thoughts

    These six terms are not a parallel list of products but a layered chain from capability to delivery: models provide capability, prompts define behavior, skills consolidate workflows, agents complete the loop, and coding tools and CLI forms handle scenario delivery. Once the layers are clearly separated, the discussion moves from arguing over terminology back to engineering questions — how to budget context, how to constrain permissions, how to evaluate effectiveness, and how to allocate costs. That is the real return you get without spending extra tokens.