Building an E-commerce Site with AI Coding Tools: Selection and Practice Guide
The capability of AI coding tools has evolved from simple line-level code completion to task-level delivery capable of generating runnable projects from a single prompt. However, feature lists and marketing pitches often look identical, making real-world performance the only true differentiator. This article uses a standardized task—building a 9-page e-commerce front-end from scratch—to evaluate AI coding tools. It analyzes common pitfalls such as poor responsiveness, unmaintainable code structures, and stability issues, while offering actionable engineering practices including spec-driven prompts, phased generation, and systematic error debugging to help developers select the right tools and maximize generation quality.
1. Background: From Code Completion to Project Delivery
Over the past two years, the boundaries of AI-assisted programming have been continuously pushed: from initial line-level code completion to conversational function generation, and now to task-level delivery where a single prompt yields a runnable project. For developers facing network constraints with mainstream overseas tools—where registration, payment, and API calls can be challenging—native, out-of-the-box solutions have become a practical necessity.
Cloud providers, represented by platforms like Baidu AI Cloud, have entered this space, integrating AI code assistants with the full cloud development lifecycle to close the loop from generation and debugging to deployment.
Currently, mainstream AI coding tools generally fall into three categories:
- IDE Plugins: Embedded into existing editors, providing capabilities like code completion, explanation, and unit test generation.
- AI-Native IDEs: Development environments redesigned around conversations and AI Agents, supporting the generation of entire projects via natural language.
- Cloud-based Development Platforms: Integrating code generation with hosting, building, and deployment into a unified pipeline.
However, a significant issue remains: feature lists look largely identical, and marketing pitches are highly similar, yet actual performance varies drastically. Tool selection cannot rely on feature comparison tables alone; it requires horizontal validation using the same real-world task. This is the core motivation of this article.
2. Evaluation Task Design: Why an E-commerce Site
2.1 Task Definition
Unified Task: Build an e-commerce shopping front-end from scratch using a mainstream component-based framework. The task requires delivering the following 9 pages within a single round:
- Product Detail Page
- Checkout Page
- Payment Success Page
- User Login Page
- User Registration Page
- User Center - Overview (Dashboard)
- User Center - Orders
- User Center - Wallet (Coupons)
- User Center - Settings
2.2 Task Representativeness Analysis
This task seems ordinary but actually covers most of the core challenges in front-end engineering:
- Completeness: All 9 pages are indispensable, testing the model’s ability to follow long-list instructions.
- Consistency: The shopping flow (Detail -> Checkout -> Success) and User Center (Overview -> Orders -> Wallet -> Settings) require globally unified color schemes, layouts, and component styles.
- Engineering Quality: Login and registration involve form validation, directly exposing the rigor of the generated code.
- State Management: Login state, shopping cart, and order data need to flow across pages, testing architectural design.
- Responsiveness: Differences between desktop and mobile performance test the model’s understanding of design constraints.
The core difficulty lies in “site completeness and overall consistency”—making a single page look good is easy; the challenge is making 9 pages look like they were written by one team following the same specification.
2.3 Evaluation Dimensions
| Dimension | Key Question | Observation Points |
|---|---|---|
| Completeness | Are all pages present, and is the flow closed? | Route accessibility, cross-page navigation |
| Consistency | Are visuals and interactions unified? | Primary color, spacing, component style |
| Interaction | Does the basic experience meet standards? | Form validation, responsiveness, error prompts |
| Code Quality | Is the code maintainable? | Separation of styles and logic, component division, data decoupling |
| Project Structure | Is the architecture reasonable? | Directory layering, state management, mock data organization |
| Stability | Can it run successfully on the first try? | Initial error count, fix success rate |
| Efficiency | Is generation fast enough? | Task duration, interaction response speed |
3. Common Issues Exposed During Testing
After validating multiple tools on the same task, several highly common issues can be identified. These are not product-specific but rather reflect the current paradigm of AI code generation.
3.1 Visual Performance: Mobile Bias, Responsive Failures, Placeholder Overload
Most tools produce layouts biased toward mobile screens, with desktop views merely acting as “simple scaling.” Some scenarios even result in contrast disasters like white text on a white background, rendering buttons completely invisible. Images are almost exclusively gray placeholder blocks, leading to insufficient information density on product detail pages.
Attribution: Mobile page examples account for a large proportion of training data. If the task description does not explicitly declare the target device and design specifications, the model defaults to the “most common” mobile layout.
3.2 Project Structure: Runnable but Unmaintainable
Typical manifestations include:
- Mock data is tightly coupled within components; changing data requires modifying multiple files.
- Directories reserve spaces for custom hooks and global state contexts, but they are empty files—the model mimics the “shape” of mainstream scaffolding without filling in the “substance.”
- While some tools separate styles from logic, others just dump styles at the bottom of the file. The degree of separation varies significantly.
Attribution: Single-round generation tends to favor the “fastest closure,” lacking external constraints from engineering scaffolding. Empty shell directories are essentially pattern replications of common project structures rather than genuine design decisions.
3.3 Stability: One-shot Success vs. Endless Errors
In tests, tools showed polarized performance: some completed the task in one go via auto-execution mode with fast response and no stuttering; others threw errors on the first generation and failed to converge after multiple fix attempts, eventually being abandoned. Additionally, many tools offer multiple parallel Agents or execution modes, leaving average users confused. Choosing the wrong mode can directly prevent the project from running.
Attribution: Task-level generation is essentially a “generate-run-fix” loop. The capability to fix errors (accurately locating issues, self-reflection) matters more than generation capability. Excessive modes lacking intelligent routing transfer complexity to the user.
3.4 Interaction Mode: Automatic vs. Manual
An interesting industry phenomenon: some products offer an “auto-execute” mode running unattended from a single prompt, while others insist on step-by-step confirmation. Auto mode is efficient but carries a high risk of losing control; step-by-step is safer but breaks the flow state. Currently, the ideal form is dynamic switching based on task risk—automatic for prototyping, manual confirmation for critical operations involving build configurations or dependency changes.
4. Engineering Practices to Improve Generation Quality
While tool differences objectively exist, better task descriptions and process designs can significantly elevate the upper limit of generation quality. Here are several proven practices.
4.1 Front-load Constraints: Replace “One Sentence” with a “Specification”
Vague instructions only yield average outputs. It is recommended to explicitly include the page list, design specs, and engineering constraints in the task description:
Target: Build an e-commerce shopping site front-end1. Page List (9 pages, all must be implemented and mutually navigable)Product Detail / Checkout / Payment Success / Login / Register /User Center-Overview / Orders / Wallet(Coupons) / Settings2. Design Constraints- Desktop-first, minimum adaptable width 1280px, downward compatible with mobile- Unified primary color and spacing system; foreground and background colors must not be identical- Use placeholder image components with text descriptions uniformly3. Engineering Constraints- Pages, components, styles, and mock data should be stored in separate layers- Mock data should be independent modules, referenced via a unified data access layer- Login state and shopping cart must use global state management- Login/Register must include email format and password strength validation
4.2 Phased Generation: Skeleton First, Then Flesh
Generating 9 complete pages at once puts immense pressure on the context, causing errors to accumulate. A more robust rhythm is:
- Round 1: Generate route table + empty page skeletons + global layout to ensure the “navigation map” runs first.
- Round 2: Fill in content page by page, focusing on 1-2 pages at a time.
- Round 3: Connect data layer and state management, replace mock data.
- Round 4: Unify and review visual consistency and responsive issues.
Recommended directory structure and routing skeleton:
src/├── components/ # Common components (buttons, form items, placeholders, etc.)├── pages/ # Page-level components, corresponding one-to-one with routes├── services/ # Data access layer, isolating mock data from real APIs├── store/ # Global state (login state, shopping cart)├── mock/ # Mock data└── styles/ # Design variables and global styles
Route Table Design (Round 1 Deliverable):/ -> Home/product/:id -> Product Detail/checkout -> Checkout/payment-success -> Payment Success/login -> Login/register -> Register/user -> User Center Layout/user/orders -> Orders/user/wallet -> Wallet/Coupons/user/settings -> Settings
The benefit of phased generation is a smaller validation surface per round, making it easier to locate errors and avoiding cascading regeneration issues.
4.3 Error Debugging: Locate Before You Act
When facing errors in generated code, blindly “trying again” is a big mistake. Recommended fix flow:
- Read the complete error stack and distinguish between missing dependencies, syntax errors, and runtime logic errors.
- Attach the error message and relevant source files into the conversation, asking the model to explain the cause before providing a fix, rather than directly modifying the code.
- If the same error persists after 3 fix attempts, the model is likely “lost” in the current context. Roll back to the last runnable version, narrow the scope, and start over.
- For core modules that repeatedly fail, take over manually and downgrade the AI to a completion assistant.
4.4 Mode Selection: Tiered by Task Risk
- One-off prototype validation -> Auto-execute mode, prioritize speed.
- Involving dependency installation, build configs, or data structure changes -> Step-by-step confirmation mode, hold the bottom line.
- Multi-Agent capabilities are still in early stages. It is recommended to break tasks into smaller pieces before assigning them, preventing “Agents stepping on each other’s toes” and breaking the project.
5. Tool Selection and Future Trends
5.1 Select by Scenario
- Individual Developers/Learners: Prioritize onboarding costs and free tiers. User-friendly interfaces and quick feedback significantly reduce frustration.
- Professional Developers: Prioritize generated code quality, engineering support (style separation, directory standards, state management suggestions), and compatibility with existing workflows.
- Enterprise Teams: Data security and compliance are top priorities—verify privacy modes, private deployment options, and whether code is used for training. Secondly, consider integration capabilities with internal R&D processes (code hosting, review, CI/CD).
5.2 Future Trends
- From Completion to Delivery: The evaluation metric is shifting from “completion accuracy” to “task completion rate.” The ability to stably deliver runnable, maintainable complete projects will determine a tool’s survival.
- Fixing Capability as a Moat: Generation is no longer the bottleneck; automatic error location and self-repair capabilities are the key differentiators.
- Intelligent Mode Routing: Rather than making users struggle between multiple Agents, the system should automatically allocate execution strategies based on task characteristics.
- Deep Integration with Cloud Development: Generating code is just the starting point. The seamless connection with cloud capabilities like object storage, container deployment, and monitoring is the complete answer to “from idea to launch.” Teams should establish their own benchmark task sets for regular regression testing, moving tool selection from “impression scores” to “data-driven.”
Conclusion
The competition among AI coding tools has entered deep waters. For developers, rather than chasing individual products, it is better to establish a personal evaluation methodology and usage paradigm: validate capabilities with real tasks, elevate the lower limit with engineering constraints, and control risks with phased processes. Tools will continue to iterate, but this methodology will remain consistently effective.
