Agentic Coding in Practice: From Getting Started to Engineering Delivery
This article lays out a practical engineering workflow for agentic coding, moving from beginner habits to production-grade delivery. It explains five mental models for working with coding agents, how to write verifiable requirements, how to layer and manage context as a finite asset, and how to use spec-driven development, task decomposition, and automated quality checks. It also covers scaling beyond a single agent instance with custom commands, hooks, external integrations, and sub-agents, plus the shared delivery loop behind five end-to-end project types.
1. Why the Agentic Era Needs an Engineering Workflow
Agentic coding tools are changing how developers collaborate with software: instead of writing code line by line, developers describe intent, review results, and constrain boundaries. But if you treat these tools as nothing more than a faster autocomplete, you will quickly hit three bottlenecks: vague requirements that cause repeated rework, context bloat that degrades output quality, and missing verification that lets errors spread fast.
What actually creates value is not memorizing a handful of operations, but building a stable engineering workflow. It can be reduced to five mental models:
- The conversation is the development environment: work proceeds through intent, execution, feedback, and correction.
- Context is a finite asset: the context window is limited, so you must actively filter and compress it.
- Decomposition is the new programming: complex tasks must be split into small, verifiable steps.
- Tools are nerve endings: agents can call retrieval, execution, and testing capabilities, but humans set the goals.
- Humans judge, AI executes: architectural trade-offs, risk assessment, and final acceptance cannot be outsourced.
2. Getting Started: State Requirements Clearly and Get the Execution Loop Running
1. Make requirements verifiable
A vague request like “help me implement login” invites the model to make its own assumptions. A more robust prompt states the goal, constraints, inputs and outputs, and acceptance criteria. For example:
Goal: implement a user login serviceConstraints: use the existing user table; hash passwords with salt; do not introduce a new frameworkInput: username and plaintext passwordOutput: return a session token on success; return a unified error code on failureAcceptance: cover empty values, wrong password, and unknown user
When acceptance criteria are explicit, generated results are easier to validate with automated tests, which reduces subjective debate.
2. Constrain the process with an expert-level workflow
Borrow the flow of plan first, implement second, verify last: have the agent produce an implementation plan and risk points, confirm them, then write code, and finally run static checks and tests. This catches errors before any code is written.
3. Switching models and adapting to local requirements
Some teams need to switch models by task type, or use domestic models to meet compliance and cost requirements. In engineering terms, model invocation should be abstracted into configuration so that vendor-specific details are not scattered across scripts. Example configuration:
model_profile:default: general-purposelong_context: high-capacitycode_heavy: code-optimized
3. Intermediate Stage: Context Management and Long-Term Memory
1. Layer the context
Split context into four layers: long-term project conventions, module descriptions, the current task context, and temporary debugging information. Write long-term conventions into a project documentation file (code style, directory responsibilities, prohibited actions), maintain module descriptions alongside the code, and use temporary information only within the current session.
2. Designing long-term project memory
A project documentation file should not read like an encyclopedia; it should read like a constraint checklist:
- Tech stack and version constraints- Directory responsibilities and dependency direction- Checks that must pass before committing- Types of dependencies that must not be introduced- Logging, exception, and configuration conventions
3. Debugging and course correction
The key to correction is reproducible evidence: error logs, minimal reproduction steps, and the relevant code scope. Do not make the agent guess. Also keep commits small and use version control, so that when something goes wrong you can roll back quickly instead of debugging inside one massive change.
4. Advanced Stage: Decomposition, Spec-Driven Development, and Built-In Quality
1. Breaking down large tasks
The rule is that every step can be verified independently: data model, interface contract, core logic, exception handling, tests, and documentation. Verify immediately after each step to prevent errors from accumulating.
2. Spec-driven development
Produce a specification first (interfaces, data, error codes, acceptance cases), then generate the implementation and tests from it. The spec is a shared contract between humans and the agent, and it significantly reduces misunderstandings.
3. Refactoring, testing, and documentation
Add characterization tests before refactoring to ensure behavior stays unchanged; produce documentation in the same batch as code so it does not lag behind. Example code can express the same design in mainstream languages such as Java, TypeScript, and Swift, making it reusable across teams on different platforms.
5. Scaling Stage: Going Beyond a Single Instance
- Custom commands: turn frequent workflows into reusable instructions to avoid repeated description.
- Automation hooks: trigger checks at save, commit, and build points to build quality in.
- External capability integration: connect retrieval, ticketing, monitoring alerts, logging services, object storage, and other common cloud capabilities through standardized protocols so the agent can access real-world information.
- Skills and sub-agent collaboration: the main agent handles planning and acceptance, while sub-agents handle specialized tasks such as retrieval, testing, and review.
6. Practice Stage: Common Method Behind Five End-to-End Cases
Whether it is a CLI tool, a mobile app, a web app, an open-source project, or everyday office automation, end-to-end delivery follows the same loop: define acceptance criteria, generate the spec, implement in small steps, verify automatically, and capture lessons learned. Only the tech stack and verification methods differ. If a team already uses relevant general-purpose capabilities from Baidu AI Cloud, logging, monitoring, and container platforms can be added as standard integrations so the agent workflow connects with the existing operations setup.
7. Conclusion
The competitiveness of agentic coding lies not in tool proficiency but in engineering constraint: writing requirements as verifiable specs, managing context as a finite asset, decomposing large tasks into small steps, automating quality checks, and always keeping human judgment in the loop. With this method, teams can turn a one-off smooth experience into delivery capability they can reuse over the long term.
