Agentic Coding in Practice: From Getting Started to Engineering-Grade Workflows

    This article explains how to move from casual, chat-based use of AI coding tools to agentic engineering. It covers five core mental models, requirement framing, execution loops, context budgeting, version control as a safety net, task decomposition, spec-driven development, refactoring with test guardrails, custom commands and hooks, standardized protocol integrations, sub-agent coordination, five end-to-end delivery patterns, and a phased adoption plan with common anti-patterns to avoid.

    1. Why Agentic Engineering Matters, Not Just Chatting

    Over the past two years, AI coding tools with code understanding and generation capabilities have spread quickly. Many teams follow a similar curve: they are impressed by the generation speed at first, then discover in real projects that the output is hard to maintain, loses focus once the context grows, and stalls halfway through larger tasks. The root cause is not model capability. It is that the working style is still stuck at the “treat the tool as a search engine” stage.

    The real dividing line is the shift from conversational usage to agentic engineering. The former cares about whether a single answer is satisfying. The latter cares about whether a repeatable, auditable, handoff-ready production pipeline exists. Engineering means requirements can be expressed in a structured way, context can be actively governed, tasks can be decomposed reliably, output can be validated automatically, and experience can be captured and reused. Five mental models run through all of it:

    • The conversation is the development environment: the interaction itself is where coding, compiling, debugging, and review happen.
    • Context is a finite asset: both window capacity and attention are scarce resources that need budget management.
    • Decomposition is the new programming: the core skill shifts from writing code to defining well-bounded subproblems.
    • Tools are nerve endings: external capabilities plug in through standardized protocols, extending what the agent can perceive and do.
    • Humans judge, AI executes: goals, tradeoffs, and acceptance criteria come from people; mechanical work goes to the agent.

    2. Beginner Level: State Requirements Clearly, Understand the Execution Flow

    2.1 Four Elements of Requirement Expression

    High-quality output starts with high-quality input. For every task, fill in four elements: goal (what to achieve), constraints (what must not be broken), context (relevant files and existing conventions), and acceptance (how completion is judged). A task without acceptance criteria almost inevitably leads to repeated rework.

    1. Goal: Add timeout-based closure to the order module
    2. Constraints: Do not change existing public interfaces; do not introduce new persistence dependencies
    3. Context: OrderService, scheduler configuration, existing unit tests
    4. Acceptance: New cases cover boundary durations; the full test suite passes; no static analysis warnings

    2.2 Three Stages of the Conversational Execution Flow

    A stable execution flow usually follows a plan-execute-verify loop. In the planning stage, have the agent output the approach and an impact list first. In the execution stage, limit the scope of changes and commit in small steps. In the verification stage, force test runs and static checks. Making verification a step that cannot be skipped is the key to going from “it works” to “it works reliably.”

    2.3 Engineering Value of Switchable Models

    Different tasks weight capabilities differently: long-context understanding, code reasoning, structured output, and cost-sensitive batch work each have their own preferences. Switching among multiple models through a unified access layer lets you make dynamic tradeoffs between quality, latency, and cost, while avoiding lock-in to a single vendor. Engineering-wise, model selection should be abstracted into configuration rather than hardcoded across scripts.

    3. Intermediate Level: Context Governance and Long-Term Project Memory

    3.1 Context Budget Table

    Manage context as a budget: set separate quotas for “project conventions,” “current task,” “reference code,” and “prior conclusions.” A practice that works well is maintaining a concise project notes file that records directory responsibilities, build and test commands, coding standards, prohibited actions, and common pitfalls, so every session does not need to re-explain the basics.

    1. # Project Conventions (Example)
    2. - Build: use the script at the repository root; installing dependencies globally is prohibited
    3. - Test: new logic must come with unit tests
    4. - Layering: controllers hold no business logic; access to external resources goes through an adapter layer
    5. - Prohibited: do not modify generated directories; do not commit local configuration

    2.2 Standard Moves for Debugging and Course Correction

    Correction is not repeating “try again.” It means providing decidable feedback: paste the error output, point out the difference between expected and actual, and narrow the reproduction scope. When there is a directional deviation, go back to the requirements and constraints to realign first, then have the agent produce two or three candidate approaches with tradeoff notes, and let a human decide.

    3.3 Version Control as a Safety Net

    Small, frequent branches and commits make every agent change revertible, comparable, and reviewable. The recommended flow: commit a baseline first, let the agent work on a separate branch, then review the diff view item by item. Version control is not only a backup; it is the infrastructure that turns “untrusted output” into “governable output.”

    4. Advanced Level: Large-Task Decomposition and Spec-Driven Development

    4.1 Four Ways to Slice Work

    For large tasks, you can split vertically by layer (interface, service, storage), by use case (deliver one business flow at a time), by risk (connect the most uncertain part first), or by verifiability (stand up a runnable skeleton first). The only standard for judging whether a split is good: every subtask can be accepted independently.

    4.2 Specs Before Implementation

    Spec-driven development emphasizes producing a machine-readable, human-reviewable spec first, then having the agent generate the implementation and tests from it. A spec typically includes the goal, scope, data and interface contracts, exception paths, and acceptance conditions. The benefit is moving arguments forward into the design stage, which significantly reduces rework during implementation.

    1. Spec excerpt (illustrative)
    2. Capability: order timeout closure
    3. Input: order identifier, current time
    4. Behavior: if the threshold is exceeded and payment is not completed, set status to closed
    5. Exception: remain idempotent when the status has already changed; do not trigger twice
    6. Acceptance: boundary threshold, concurrent triggers, and duplicate messages — all three case types pass

    4.3 Coordinating Refactoring and Testing

    Refactoring must happen under test guardrails. You can have the agent first add characterization tests to lock in current behavior, then perform the structural change, and finally compare behavior for consistency. Documentation works the same way: have the agent extract facts from code and tests to produce a first draft, and let humans correct intent and tradeoffs, so docs do not drift from the implementation.

    5. Extension Level: Going Beyond a Single Instance

    5.1 Custom Commands and Automation Hooks

    Turn high-frequency flows into custom commands, and turn pre-commit checks, formatting, and log trails into hooks. This converts team standards from verbal agreements into automatic execution. Hook design should follow three principles: switchable, observable, and fail-fast, so the process does not become so heavy that people bypass it.

    5.2 Connecting to the Outside World Through Standardized Protocols

    Through an industry-standard context protocol, an agent can connect to code hosting, defect tracking, log services, monitoring and alerting, message queues, object storage, and other external systems, extending it from “only working inside the editor” to “able to read production facts.” Integrations should follow least privilege, read-only first, and operation logging, and returned content should be filtered for length and sensitive information.

    5.3 Coordinating Skills and Sub-Agents

    Package domain capabilities as reusable skills, hand independently parallelizable subproblems to sub-agents, and let the main agent handle orchestration and aggregation. The key to coordination is clear interface contracts, mergeable results, and detectable conflicts; otherwise parallelism only amplifies chaos.

    6. Practice Level: Five End-to-End Delivery Patterns

    • Command-line tools: good for validating the spec-implement-test loop, with clear boundaries and fast feedback.
    • Mobile applications: the focus is state management and real-device differences; write UI acceptance criteria as a checkable list.
    • Web applications: emphasize layering and interface contracts, with automated tests and static checks as guardrails.
    • Open-source collaboration: read the contribution conventions and past discussions first, then commit in small steps and respect the existing style.
    • Everyday office automation: scriptability and revertibility are the baseline; any external write operation requires human confirmation.

    Each case should produce four things: a runnable deliverable, passing tests, concise documentation, and reusable commands and hooks. Those four are what can be captured as team assets.

    7. Adoption Advice and Common Anti-Patterns

    Introduce this gradually on a two-week cadence: in the first week, do only context governance and the project notes file; in the second week, add specs and test guardrails; from the third week onward, bring in automation hooks and external connections. Metrics should focus on rework rate, review time, test pass rate, and rollback count, not lines of generated code.

    Anti-patterns to watch for include: throwing out one huge task at once, starting work with no acceptance criteria, refactoring while skipping tests, writing sensitive credentials into context, blindly parallelizing sub-agents, and treating model output as a source of truth without verification. In scenarios that need elastic compute and managed environments, you can rely on general cloud capabilities (such as container platforms, log services, monitoring and alerting, object storage) to carry the execution and observability stages, giving the agent workflow a foundation for sustainable operation and auditing.

    Ultimately, competitiveness in the agent era is not about who asks better questions, but about who engineers the judgment criteria, context assets, and verification mechanisms. When decomposition, spec constraints, and automated verification become the team default, AI truly turns from a demo into a production line.