AI Coding Workflow in Practice: Combining LLMs, Cloud Dev Environments, and Terminal Assistants

    This article shares a practical AI-assisted development workflow built around three task categories matched to three processing paths: an AI agent mode for large features and refactors, a terminal assistant for quick fixes, and a long-context open-source LLM for code comprehension. It covers model selection considerations, the data-localization benefits of cloud development environments, a reusable prompt specification for constraining AI behavior, and a real-world refactoring case study.

    Over the past six months or so, I have tried nearly every mainstream AI coding tool on the market, from early code-completion plugins to more recent conversational development environments, and I have hit my share of pitfalls along the way. After enough detours, I settled on a workflow that feels genuinely smooth. Today, instead of reviewing a specific product, I want to share the design thinking behind this combination, the logic of task decomposition, and the prompt specification I have refined over time—hopefully as a useful reference for fellow developers exploring AI-assisted development.

    1. Why Common AI Coding Tools Always Feel Slightly Off

    Let’s start with the common pain points. The first AI coding tools most developers encounter are autocomplete plugins in the IDE. These are genuinely efficient for boilerplate code and function signatures, but once you face tasks requiring global understanding—cross-file refactoring, designing a new feature module—they clearly fall short. They either answer the wrong question or fix one spot while breaking three others.

    Conversational AI coding tools came later, integrating large language models into the editor so they can understand the currently open file or even the entire repository. In practice, though, two problems remain hard to avoid. First, task boundaries are blurry: without explicit planning, the AI tends to “freestyle,” producing code that doesn’t fit the project’s existing architecture. Second, costs are unpredictable: long sessions with large contexts add up quickly.

    It wasn’t until I combined an AI agent mode running in an independent cloud development environment with a terminal-based intelligent assistant, and brought in an open-source large language model as the workhorse, that the whole process finally felt “closed-loop.”

    2. Workload Decomposition: Three Task Types, Three Paths

    The first step in AI-assisted coding isn’t choosing tools—it’s learning to decompose tasks. My approach is to divide daily development work into three categories based on complexity and context dependency, each routed through a different channel.

    Type 1: New feature development and large-scale refactoring. These tasks often touch a dozen or more files and require understanding inter-module dependencies, data flows, and business constraints. They are best handed to an AI agent mode with independent planning capability: starting from requirement analysis, it automatically generates a task list, implements the code step by step, runs tests, and iterates on fixes. This scenario places extremely high demands on the model’s planning and instruction-following abilities.

    Type 2: Minor fixes and troubleshooting. Fixing an edge-case error, adjusting a function’s log output, tracking down an intermittent null pointer. These are perfect for invoking an intelligent assistant directly in the terminal. The advantages: no need to leave the terminal, no interruption to your train of thought, short context, a controllable scope of changes, and negligible cost.

    Type 3: Understanding and explaining complex code. When taking over a legacy project or reading the source of an open-source module, massive contextual correlation is involved. This is where the model’s long-context window really matters. My primary model is configured with a large-context version, allowing me to feed in an entire core module’s source code at once and have it produce an architecture overview and data-flow diagrams—far more accurate than reading file by file and piecing things together manually.

    These three channels each do their own job without interfering with one another. My daily rhythm: in the morning, I submit a large refactoring task to the AI agent mode to plan and execute in the background, while I focus on immediate issues in the terminal; in the afternoon, I review the agent’s output, do a code review, and merge.

    3. Long Context and Open-Source Models: Comprehension Is Foundational Productivity

    A key foundation that makes this workflow viable is a sufficiently large context window. Many models I used in the past had context windows of only tens of thousands of tokens. Faced with a moderately sized project, they couldn’t hold the complete codebase, and halfway through a conversation they would start “forgetting” the original instructions. The primary model I now use offers very large context support, which brings two practical benefits:

    First, global consistency. When writing a new feature, I no longer need to repeatedly paste in old code to remind it to “stay consistent.” It remembers previously defined data structures, naming conventions, and interface signatures on its own, generating code whose style closely matches the existing codebase—rarely requiring me to make secondary adjustments.

    Second, cross-file reasoning. Once, I needed to map out the complete chain from order placement to callback in a payment module. I fed in a dozen related files at once and asked it to draw a sequence diagram and annotate exception scenarios. The output was nearly identical to what a senior colleague had mapped out by hand. This kind of cross-file reasoning was previously unimaginable.

    Cost is another dimension that can’t be ignored. Compared to pay-as-you-go commercial LLM APIs, I chose an open-source model. Not only does it rank first among open-source models on authoritative coding benchmarks, its API pricing is much lower—and more importantly, it can be deployed on-premises or in a private cloud environment, completely eliminating concerns about data leaving your control or network latency. The model’s companion coding plan is also fairly generous, with ample capacity at a reasonable price; given my usage intensity, one month’s quota comfortably covers daily development, code review, and documentation generation.

    4. The Data-Localization Advantage of Cloud Development Environments

    Many developers overlook the importance of the runtime environment. Cloud development environments have a natural advantage over local IDEs: both the code and model inference happen remotely, and your local machine only needs a browser. This means that even if you’re working on a lightweight laptop in a coffee shop, you get the same high-performance development experience as in the office.

    More important is the data security layer. When you use a privately deployed model service inside a cloud development environment, your code data never leaves your organization’s cloud account system—avoiding the worry that code might be used for training when working with third-party public model services. This matters especially for projects in finance or government sectors, and it gives me greater peace of mind when delivering source code to clients.

    5. A Long-Refined Prompt Specification

    No matter how complete the toolchain, without a rigorous set of prompt constraints, AI output quality will remain erratic. Here is the AI development specification I have been using, in full. The core idea is to make the AI behave like a reliable development partner rather than a code-typing tool.

    1. # AI Development Specification
    2. ## Execution Confirmation
    3. Before every response, you must declare: "I have understood the rules."
    4. ## Rule Priority (Highest-Priority Section)
    5. Before performing any action, the AI must evaluate according to the following priority:
    6. Explicit user instruction > Project memory document > Other rules in this specification > AI's own judgment
    7. ### Priority Explanation
    8. - Explicit user instruction: Explicit requirements in the current conversation; cannot be replaced or ignored.
    9. - Project memory document: Project-level persistent constraints. Must check for its existence at the start of every session; if absent, proactively create it.
    10. - Other rules in this specification: General default-behavior guidance in this document.
    11. - AI's own judgment: Only used when none of the above rules apply. Base the judgment on rework risk, inferability, and scope of impact.
    12. - High rework risk → ask first, then execute.
    13. - Reasonably inferable from context → execute directly but state your understanding in writing.
    14. - The larger the change, the more confirmation is warranted; small changes may be executed directly.
    15. ### Conflict Handling
    16. - When rules conflict, follow the higher-priority rule.
    17. - If still uncertain, confirm with the user.
    18. ## Language and Communication
    19. 1. Always reply in Simplified Chinese; all responses must use Simplified Chinese.
    20. 2. Break complex requirements into small tasks; implement step by step, completing one small task before continuing.
    21. 3. If in doubt, ask before modifying; do not make decisions on your own.

    Note: the “reply in Chinese” rule reflects my own working environment—adapt the language setting to your needs.

    The practical effects of this specification show up in several ways:

    The rule-priority design resolves the oscillation between an “overly proactive” and an “overly passive” AI. Without this priority scheme, I frequently ran into situations where the AI took it upon itself to refactor my utility functions, or plainly ignored conventions documented in the project files. After establishing “explicit user instruction > project memory document > general rules > AI judgment,” the AI’s behavioral boundaries became much clearer and instruction adherence improved noticeably.

    The “rework risk and impact scope” logic is also very useful. In the past, when I raised a change request, the AI often completed the edit before I realized it had misunderstood, wasting a full round of waiting. Now it proactively pauses for confirmation when a change touches database structures or global configuration, while simple field adjustments are executed directly with a written statement of its understanding—a significant boost in interaction efficiency.

    6. A Real-World Application Example

    Take the recent refactoring of an e-commerce admin backend as an example; I ran the complete workflow end to end:

    1. Requirement confirmation: The prompt explicitly required the AI to first map out the existing order module’s code structure, output a module dependency graph, and list the refactoring’s impact surface.
    2. Task planning: Based on the tech stack and coding conventions in the project memory document, the AI agent mode generated a phased refactoring plan covering data model adjustments, service-layer decomposition, API route updates, and frontend component adaptation.
    3. Execution and verification: After each phase, unit tests and static checks ran automatically; failures were corrected automatically until everything passed.
    4. Human review: I reviewed the output file by file and only made minor tweaks to a few naming choices and exception-handling details. The overall rework rate was far lower than in previous collaboration modes.

    This case confirms one judgment: the productivity of AI-assisted coding lies not in how clever the model is, but in how clearly you define its working rules—and whether your workflow assigns the right tasks to the right tools.

    7. Summary and Recommendations

    To recap the elements of this workflow: the cloud development environment provides a stable, secure runtime foundation; the open-source LLM delivers low-cost, high-comprehension code generation; the terminal assistant handles lightweight tasks instantly; and a well-structured prompt specification constrains the AI’s behavior within reasonable boundaries.

    For those exploring AI-assisted development, my advice is: don’t blindly chase the newest tools. First spend time analyzing the types of tasks in your daily work, design a matching decomposition strategy, and then continuously iterate your own prompt specification. Tools will keep changing, but methodology and rule systems are assets that compound over the long term. I hope this article gives you some useful inspiration.