AI Coding Tool Selection and Building an E-Commerce Site from 0 to 1

    This article explains how to turn "generate ten pages" into a verifiable engineering task, defines six neutral criteria for comparing AI coding tools, and catalogs six defect patterns that show up repeatedly in hands-on testing along with their root causes. It also provides a prompt skeleton, a post-generation convergence workflow, a recommended directory layout, and practical selection guidance for choosing tools in a fast-moving ecosystem.

    1. Define the Task First: From “Generate Ten Pages” to “Deliver a Maintainable Project”

    Before evaluating any AI coding tool, one thing has to be settled: asking a tool to “generate ten pages” is not a valid engineering task description. It is a vague wish. A task that can actually be accepted and verified needs four parts: functional boundaries, dependencies, data contracts, and quality standards.

    Take an e-commerce front-end site as an example. Ten pages collapse into four main lines:

    • The transaction flow: home page (product listing) → product detail → checkout → order success. This flow determines whether the site closes the commercial loop.
    • Identity and accounts: login, registration, and the global handling of session persistence and expiry.
    • User center: dashboard, orders, wallet (coupons and vouchers), settings. All four sub-pages share one layout and one permission check.
    • Cross-cutting capabilities: routing and guards, form validation, error and empty states, loading states, responsive behavior, design consistency.

    The real difficulty is not the number of pages but overall consistency. If ten pages are stitched together from ten independent generations, you will inevitably get color drift, inconsistent spacing, mismatched button states, conflicting field names, and mock data scattered everywhere. The task description must therefore state constraints explicitly: one shared design token file, one route table, one API layer, one form validation scheme.

    A reusable prompt skeleton (illustrative):

    1. Role: Senior front-end engineer.
    2. Goal: Build an e-commerce front-end site with a mainstream component-based framework.
    3. Page list: home / detail / checkout / order success / login / register / user center (dashboard, orders, wallet, settings).
    4. Hard constraints:
    5. 1. All colors, font sizes, and spacing come from a single design token file; no magic values inside components.
    6. 2. All data access goes through the src/api layer; no hard-coded business data inside components.
    7. 3. Form validation rules are configured centrally, with unified error messages.
    8. 4. Mobile adaptation, empty states, and error states are required.
    9. 5. Output the directory structure and data model first; implement pages one by one only after confirmation.
    10. Acceptance criteria: the project starts directly, the console is error-free, and all ten pages link to each other.

    The last two items are the critical ones: structure before code, and explicit acceptance criteria. Without them, the output is almost certainly a “demo” that runs but cannot be maintained.

    2. Neutral Evaluation Criteria: Don’t Judge Only by “Does It Run”

    Faced with AI coding tools of very different shapes, use six dimensions for a side-by-side judgment instead of relying on how the interface looks.

    1. Interaction quality and discoverability: panel layout, how context is referenced, whether diff review is clear, and whether a privacy mode exists (code not used for training). This dimension affects long-term usage cost, not single-shot generation quality.
    2. Fit of the generation mode: three modes are common — one-shot full generation, step-by-step construction (plan first, then implement), and multi-agent collaboration (planner, implementer, reviewer). Full generation is fast but structure is easy to lose control of; step-by-step offers the best controllability; multi-agent suits complex refactoring, but response latency and context consistency are the main risks.
    3. First-pass success rate: whether the output starts directly, and how many repair rounds are needed to clear errors. This is the core indicator of a tool’s engineering maturity.
    4. Code structure quality: whether styles and logic are separated, whether configuration files are independent, whether the directory hierarchy is reasonable, and whether state management and the API layer are actually implemented rather than empty shells.
    5. Consistency and completeness: whether the design language is unified, whether images and copy are still placeholders, whether the detail page carries enough information density, and whether mobile is genuinely responsive.
    6. Performance and stability: response speed, whether long tasks stall, and whether the context length is enough to support a ten-page scope.

    It is worth stressing that a “cold” or “friendly” interface is a subjective preference and should not be a primary selection criterion. What really separates tools is items 3, 4, and 5.

    3. Six Recurring Defect Patterns and Their Root Causes

    Testing multiple tools side by side under one unified task, the problems that surface converge strongly into six categories:

    • Directory structure out of control: creating a folder with the same name inside an existing folder, which breaks module resolution and prevents the project from starting. Root cause: the generation process never reads or validates the existing file tree.
    • Visual defects: white text on a white background makes content invisible, palettes lack contrast, and mobile is not responsive. Root cause: no design tokens and no accessibility constraints (contrast, minimum tap target size).
    • Hollow content: all images are placeholders and the detail page has too few fields. Root cause: the data model was never defined explicitly.
    • Data coupling: mock data written directly inside components, so wiring up a real API later requires large-scale rewriting.
    • Shell abstractions: state management, context, and similar slots exist in the directory but are empty — a pseudo-structure that “looks professional.”
    • High repair-loop cost: it runs but throws errors continuously, multiple repair rounds fail to converge, and eventually the effort is abandoned.

    The corresponding engineering countermeasure is clear: write structure, data model, design tokens, and acceptance criteria into the prompt and the project scaffold, so generation works inside existing constraints instead of improvising from zero every time.

    4. Convergence Strategy After Generation

    Generation is only the starting point; convergence is where the work lies. Handle it in a fixed order:

    1. 1. Get it running: install dependencies -> start -> clear console errors (do not chase feature completeness)
    2. 2. Unify: extract design tokens and layout components, replace all magic values and duplicated styles
    3. 3. Decouple: create src/api and type definitions, move mock data out of components
    4. 4. Fill gaps: empty states, error states, loading states, form validation, mobile breakpoints
    5. 5. Verify: walk the full ten-page navigation flow plus regression on key interactions

    Recommended directory organization (illustrative):

    1. src/
    2. tokens/ # colors, font sizes, spacing, breakpoints
    3. api/ # API wrappers and type definitions
    4. components/ # shared components (button, input, card, empty state)
    5. layouts/ # shared layouts such as the user center
    6. pages/ # the ten pages, composition only
    7. hooks/ # real business logic, no empty shells
    8. stores/ # global state (session, cart)

    Illustrative code for design tokens and the API layer:

    1. // tokens/index.js — the single source of visual truth
    2. export const tokens = {
    3. color: { primary: '#2f6bff', text: '#1f2329', disabled: '#c9cdd4' },
    4. space: [4, 8, 12, 16, 24],
    5. breakpoint: { sm: 640, md: 768, lg: 1024 },
    6. };
    7. // api/index.js — components do not depend on data sources directly
    8. export async function fetchProducts(params) {
    9. const res = await fetch('/api/products?' + new URLSearchParams(params));
    10. if (!res.ok) throw new Error('Failed to load the product list');
    11. return res.json();
    12. }

    5. Connecting to General Cloud Capabilities

    Once a front-end site goes live, it typically needs a few categories of general cloud capabilities. Static assets and images can live in object storage and be accelerated by a content delivery network; asynchronous processing of products and orders can be handed to a message queue; server-side applications can be deployed on a container platform with auto scaling; troubleshooting relies on logging and monitoring and alerting; and the data side uses general-purpose relational databases and caching services. Baidu AI Cloud offers corresponding capabilities in each of these general categories, and you can combine them according to actual business scale rather than binding yourself to one specific generation tool.

    6. Selection Conclusions and Practical Advice

    • If you want low learning cost and one-shot output, look first at tools with strong full-generation ability and stable responses, but accept the refactoring cost that follows.
    • If you want controllability and maintainability, look first at tools that support step-by-step planning, can read an existing project structure, and offer clear diff review.
    • If the task is complex refactoring or multi-module coordination, a multi-agent mode is worth considering, but budget for longer waits and stricter acceptance.
    • Whatever category you pick, the structural constraints and acceptance criteria in your prompt determine final delivery quality more than brand differences between tools.

    Treat “generate an e-commerce site” as an engineering delivery rather than a demo, and measure tools with a unified task, unified criteria, and unified acceptance — that is how you make stable, reproducible technical decisions in a tool ecosystem that keeps changing fast.