A Three-Stage AI-Assisted Workflow for Web Admin System Development

    This article presents a three-stage engineering workflow for AI-assisted development of small and mid-sized web admin systems: requirements & design, coding & implementation, and testing & validation. It explains how to place AI coding tools inside an auditable pipeline—document-first design with traceable business rule IDs, step-based incremental code generation with resumable checkpoints, and self-loop testing with four-layer quality gates—while keeping humans in charge of business decisions and final acceptance. It also provides a sample workflow directory structure, role definitions, and risk control recommendations for small teams.

    A Three-Stage AI-Assisted Workflow for Web Admin System Development

    1. Background and Problem Definition

    In small and mid-sized web admin system projects, the real challenge is rarely whether to use AI—it is how to keep engineering under control once AI is involved. Limited headcount, rapidly changing business rules, incomplete requirement documents, and unstable test coverage all cause productivity to be consumed by repetitive work and rework. If you hand natural-language requirements directly to an AI coding tool, things look fast in the short term, but over time you tend to accumulate inconsistent APIs, drifting database design, missing permission checks, and unhandled edge cases.

    A more reliable approach is to place AI inside an auditable pipeline: let AI coding tools handle repetitive work such as document drafting, code scaffolding, repetitive fixes, and test case completion, while humans remain responsible for confirming business rules, reviewing design baselines, deciding on breaking changes, and final acceptance. This article introduces a three-stage workflow: requirements & design, coding & implementation, and testing & validation. Its core is not tied to any specific product; it is an interchangeable engineering method. As long as the AI tool supports repository-level context understanding, file editing, command execution, and session recovery, the workflow can be applied.

    2. Overall Design: A Three-Stage Pipeline

    The overall flow can be summarized as:

    1. Requirements & Design → Coding & Implementation → Testing & Validation
    2. ↓ ↓ ↓
    3. Document first Code generation Self-loop testing
    4. Externalized rules Resumable checkpoints Quality gates
    5. Human confirmation Incremental changes Knowledge capture

    The outputs of each stage must be persisted to disk to form a traceable chain. The design stage produces the requirement specification, use case specifications, database design, API design, menu & permission design, and numbered business rules. The coding stage takes the design documents as its sole input and produces frontend and backend source code, database scripts, and change descriptions. The testing stage uses the business rule IDs and use case specifications as the traceability baseline, executing self-loop testing and multi-layer quality gates. Each stage includes a human confirmation checkpoint, preventing AI from amplifying problems on top of a wrong baseline.

    Key principles of this workflow:

    • Document first: establish a reviewable design baseline before any code is generated.
    • Externalized rules: write coding standards, naming conventions, and permission rules into reusable rule files.
    • Small-step generation: advance step by step and record progress along the way.
    • Recoverable failures: use checkpoints to resume work instead of repeating effort.
    • Human oversight: AI does not replace business decisions or final testing.

    3. Stage One: Requirements and Design

    The goal of the design stage is not to produce a document that merely looks complete, but a baseline that later code generation and test validation can reference. Six categories of deliverables are recommended: the requirement specification, use case specifications, database design, API design, menu & permission design, and the business rule list. Business rules should be numbered—for example, BR-001 for an approval state-transition rule, BR-002 for a data visibility scope rule. Once an ID is assigned, code comments, test cases, defect records, and code reviews all reference the same ID, forming a traceability chain from requirement to implementation to test.

    Design rules should also be file-based. For example: use case rules constrain the main flow, exception flows, preconditions, and postconditions; database rules constrain table names, field types, indexes, audit fields, and soft-delete strategy; API rules constrain resource naming, error codes, pagination parameters, and idempotency requirements; menu & permission rules constrain the mapping between roles, menus, button permissions, and data permissions. Rule files may be drafted by AI, but they must be reviewed and confirmed by a human—especially rules involving money, permissions, state machines, or compliance requirements.

    The design stage should also reserve an incremental mode for changes to existing systems. Brand-new modules go through the full design steps. For changes to existing functionality, first perform an impact analysis—identifying affected use cases, table structures, APIs, menu permissions, and test cases—then generate an incremental design note. This avoids regenerating full documentation for every change, reducing context load and review cost.

    4. Stage Two: Coding and Implementation

    The input to the coding stage should be the confirmed design documents, not scattered chat history. Outputs include backend source code, frontend source code, database scripts, configuration notes, and a change list. Two modes are recommended: Creation Mode for brand-new modules, which generates everything from scratch in fixed steps; and Modification Mode for changes to existing code, which only incrementally updates affected files and outputs an impact-scope description.

    Creation Mode can be split into six steps: read the design documents and rule files; generate the backend layered skeleton and API contracts; generate frontend page skeletons and route/menu entries; generate database scripts or migration scripts; run compilation and static checks and fix issues; output delivery notes and a self-check list. After each step, write a progress file recording completed files, pending items, failure reasons, and next actions. If the session is interrupted, work resumes from the progress file instead of re-describing the entire context.

    Modification Mode should start with impact analysis: locate the relevant controllers, services, persistence layer, frontend pages, permission configuration, and test cases; generate a minimal patch; run regression tests over the affected scope; and update the design documents and rule files. The key to incremental mode is that changes must be explainable: every modification should state why it was made, which files changed, which business rules are affected, and what regression verification is needed.

    Coding rules should be as concrete as possible. For example, a backend layering rule states that controllers only perform parameter validation and orchestration while business logic lives in the service layer; persistence-layer rules constrain query conditions, pagination, and audit fields; frontend component rules constrain form validation, error messaging, and permission-based button visibility. The more explicit the rules, the more stable the AI’s output and the more focused the human review.

    5. Stage Three: Testing and Validation

    The testing stage combines self-loop testing + quality gates + a three-dimension coverage matrix. The basic self-loop flow is: run tests; on failure, ask why repeatedly to form a 5-Why analysis; propose a fix; fix and regress. Each inquiry chain should record the symptom, reproduction steps, hypotheses, verification results, root cause, fix, and regression conclusion, and be captured into a knowledge base that feeds back into the design rules and coding rules.

    Four layers of quality gates are recommended: the first layer is backend compilation, validating syntax, dependencies, and type issues; the second is backend testing, covering unit tests and key integration tests; the third is frontend type checking, validating frontend-backend contracts and type consistency; the fourth is the frontend production build, validating bundling, asset references, and build configuration. A failure at any layer enters the fix loop—no skipping layers. Only after all four layers pass does the work go to human confirmation.

    Test coverage should include at least three categories: normal scenarios verifying the main flow; exception scenarios verifying invalid parameters, insufficient permissions, duplicate submissions, and external dependency failures; and boundary scenarios verifying null values, extreme values, overly long text, pagination boundaries, time boundaries, concurrent conflicts, illegal state-machine transitions, and permission escalation. If boundary tests are missing, the loop should pause and prompt for completion rather than declaring success. Manual testing remains indispensable, especially for interaction experience, permission combinations, and validation against real business data.

    6. Sample Workflow Directory Structure

    To give AI a stable context on every run, place rules, steps, and deliverables in a unified workflow directory:

    1. .ai-workflow/
    2. ├── design/
    3. │ ├── INDEX.md
    4. │ ├── rules/
    5. │ │ ├── use-case-rules.md
    6. │ │ ├── db-design-rules.md
    7. │ │ ├── api-naming.md
    8. │ │ └── menu-permission-rules.md
    9. │ └── stages/
    10. │ ├── Step-01-req.md
    11. │ ├── Step-02-uc.md
    12. │ ├── Step-03-db.md
    13. │ ├── Step-04-api.md
    14. │ ├── Step-05-menu.md
    15. │ └── mod/
    16. ├── code/
    17. │ ├── INDEX.md
    18. │ ├── rules/
    19. │ │ ├── backend-structure.md
    20. │ │ ├── controller-rules.md
    21. │ │ ├── orm-rules.md
    22. │ │ └── ui-component-rules.md
    23. │ └── stages/
    24. │ ├── Step-01-read-docs.md
    25. │ ├── Step-02-backend.md
    26. │ ├── Step-03-frontend.md
    27. │ ├── Step-04-sql.md
    28. │ ├── Step-05-compile.md
    29. │ └── mod/

    Rule files and step files in this directory may be drafted by AI but must be reviewed by humans. INDEX.md describes the current stage’s goal, inputs/outputs, and completion criteria; the mod directory stores incremental change notes; and progress files record checkpoint information for session recovery. This way, even if the execution session changes, context can be restored from files and rules.

    7. Adoption Recommendations and Risk Control

    For small teams, define three roles clearly: a business decision-maker who confirms rules and acceptance criteria; a development reviewer who owns the design baseline, code quality, and security/permissions; and the AI coding tool, which handles repetitive generation, fixes, and test completion. AI does not replace business judgment or final testing. High-risk operations—database migrations, permission models, monetary calculations, state machine changes—must have human confirmation checkpoints.

    For risk control, guard against over-generation and rule drift. Rule files should be version-controlled, and every change should state its reason. Generated code should be committed in small steps and be reversible. Sensitive data should be masked before entering the context. Tool permissions should follow least privilege—never let the tool operate directly on production environments. Useful metrics include first-pass rate through quality gates, defect escape rate, boundary-case coverage ratio, requirement traceability coverage, and rework time; use this data to judge whether the workflow is actually improving efficiency.

    Overall, the value of this three-stage workflow is turning AI from a “random code generator” into an auditable engineering executor. Humans own business decisions and the quality floor; AI handles repetitive labor and process advancement—together forming a closed loop across design, implementation, and testing.