From Chat to Agent: Rebuilding Workflows with Skills

    This article explains why conversational, one-off LLM usage fails to meet production requirements, and how to move from chat-based interaction to agent-based execution. It introduces the skill abstraction for turning business expertise into versioned engineering assets, outlines a five-layer architecture that decouples access, orchestration, capabilities, models, and supporting infrastructure, and shows how to build skill-based workflows on cloud services. It also covers common pitfalls and governance practices, including skill granularity, output contracts, fallback paths, least-privilege sandboxes, and regression testing.

    1. Background: Why Conversational Invocation Cannot Support Production Workloads

    Over the past two years, many teams have integrated large language models into their products using a simple question-and-answer pattern: a user pastes a requirement into a chat box, the model returns a block of text, and a human copies that text into the target system. This works well for validation, but it quickly exposes three structural problems in production.

    The first is lack of reproducibility. For the same task, a different engineer, a different phrasing, or even a different context order can produce noticeably different output quality. Stakeholders cannot build stable acceptance criteria on top of that.

    The second is lack of auditability. When a result is wrong, the team can rarely answer what instructions were given to the model, which materials it relied on, or which step failed. Without intermediate state records, debugging becomes guesswork.

    The third is lack of reusability. Subject-matter experts write their experience into long prompts, and that experience stays locked in one person’s chat history. It cannot be versioned, reviewed, or shared across the team.

    The conclusion is clear: for a model to take on real work, it must be turned from an object that answers questions into an execution unit that can be scheduled. That is the core shift from Chat to Agent — the center of interaction moves from prompts to capability definition and workflow orchestration.

    2. Core Abstraction: Turning Experience into Skills

    Mature AI coding tools and agent frameworks share a common concept: the skill. A skill is usually a structured text configuration file that uses natural language plus agreed-upon sections to describe four things:

    1. When it applies: the conditions under which the skill should be activated, to avoid false triggers;
    2. Input contract: required parameters, formats, and mandatory constraints;
    3. Execution steps: how many steps are involved, the pass/fail criteria for each step, and the fallback strategy on failure;
    4. Output contract: the structure of the returned result, so downstream programs can parse it.

    The value of a skill file is that it moves a business standard operating procedure out of human memory and into a version-controlled asset. The model no longer has to re-interpret the task every time; it invokes a piece of repeatedly refined experience the way it would call a function.

    A minimal skill definition looks like this:

    1. ---
    2. name: api-doc-review
    3. description: Use when a user submits an API document and wants a standards review
    4. inputs:
    5. - name: doc_path
    6. required: true
    7. - name: rule_set
    8. required: false
    9. steps:
    10. - Read the document and extract all API entries
    11. - Compare naming, parameters, and error codes against rule_set item by item
    12. - Output an issue list with severity levels and suggested fixes
    13. outputs:
    14. - Structured issue list (JSON)
    15. - Readable review summary (Markdown)
    16. ---

    It is worth stressing that a skill description is itself a prompt, but it differs fundamentally from a chat prompt: it is an engineering asset that is version-managed, discoverable by programs, and covered by tests.

    3. Layered Architecture: From Model Invocation to an Operable System

    To put the skill-based approach into engineering practice, a five-layer structure works well, with clear contracts decoupling each layer from the next.

    • Access layer: handles sessions, task submission, and identity authentication, hiding differences between front ends;
    • Orchestration layer: handles task decomposition, skill selection, multi-step chaining, and conditional branching; it is the scheduling core of the agent;
    • Capability layer: the skill library, knowledge retrieval, and tool adapters (database queries, file reads and writes, build and test execution);
    • Model layer: unified access to large models through a Model-as-a-Service (MaaS) approach, hiding differences between models and making gradual rollout and switching easier;
    • Support layer: object storage holds skill packages and artifacts, a container platform hosts execution sandboxes, and logging plus monitoring and alerting provide observability.

    The direct benefit of this layering is that models are replaceable, skills are reusable, execution is isolated, and problems are traceable.

    Pseudocode for the orchestration layer shows its basic shape:

    1. def run_task(task):
    2. plan = planner(task) # Task decomposition
    3. for step in plan.steps:
    4. skill = registry.match(step) # Skill matching
    5. if skill is None:
    6. return fallback(task, step)
    7. result = skill.execute(step.args) # Constrained execution
    8. audit_log.write(step, skill, result)
    9. if not result.ok:
    10. return retry_or_escalate(step, result)
    11. return aggregate(plan.steps)

    4. Implementation: Building Skill-Based Workflows on the Cloud

    To host the architecture above on Baidu AI Cloud, you can compose general cloud product categories rather than binding to any proprietary interface.

    Unified model access. A MaaS-style service manages model invocations centrally, with unified authentication, quotas, and call logs, so teams can adjust model versions and parameter policies without changing business code.

    Skill asset hosting. Put the entire skill directory into object storage and use version prefixes (such as skills/v3/) for gradual rollout. Skill packages are small and plain text, which makes them naturally suited to diff comparison and rollback.

    Execution isolation. Steps that read and write code repositories or run tests go into a one-time sandbox started on a container platform and destroyed when the task ends, preventing contamination and privilege spread.

    Observability loop. The call chain and a summary of each step’s input and output are written to the logging service, with monitoring and alerting thresholds set for failure rate, average number of steps, and per-task duration. Experience shows that most production issues in agent systems are not “the model doesn’t know how” but “the input to some step does not match the contract”.

    5. Common Pitfalls and Governance Recommendations

    • Skills that are too coarse: one skill taking on too many responsibilities leads to long step lists and difficult failure localization. Keep a single skill focused on one verifiable goal.
    • Missing output contracts: returning free text leaves downstream unable to parse. Insist on structured output and validate it against a schema.
    • No fallback path: define an explicit degradation strategy for failures, such as handing off to a human or returning partial results.
    • Overly broad permissions: sandboxes should default to least privilege, and write operations should require a second confirmation.
    • No regression testing: prepare a sample set for each skill and run regression after any skill change, so you don’t fix one thing and break three.

    6. Conclusion

    The move from Chat to Agent is essentially a rebuild of uncontrolled language interaction into controlled capability orchestration. Skills are the key lever in that shift: they turn business experience into engineering assets that are versionable, testable, and reusable. Meanwhile, cloud model services, storage, containers, and observability give the system the stability and operability that production demands. A team that starts with one small, clear skill and gradually fills in contracts, sandboxes, and monitoring can follow a repeatable evolution path toward intelligent workflows at relatively low cost.