Claude Code with Spec-Driven Development

I recently want to use an AI agents (Claude Code) to build an E-commerce website that allows customers to pre-order products online. Customers should be able to:

  • View and select products
  • Choose between pick-up or delivery
  • Complete payment online
  • Receive confirmation emails
  • View order history and status

I decided to use Spec-Driven Development approach instead of Vibe coding. It can bring several key benefits:

  • Alignment: It ensures that every team member is on the same page. It promotes clarity and provides a single source of truth throughout the development lifecycle; aligning project goals and system architecture.
  • Knowledge Sharing: It acts as a comprehensive knowledge base, reducing dependency on key individuals and making it easier to onboard new hires.
  • Collaboration: It provides a clear framework for discussion and feedback, leading to more robust and well-thought-out solutions.
  • Stakeholder Communication: can be easily shared with non-technical stakeholders to provide a clear overview of project progress and architecture.

The workflow is : Specification → Requirements → Design → Tasks (Implementation)

  • spec.md: This is the foundational document. It defines the project's scope, core functionality, and high-level technology choices. It ensures everyone understands the "what" and "why" of the project.
  • requirements.md: Building on the spec, this document translates features into detailed user stories with specific technical constraints and acceptance criteria. It provides the granular detail needed for engineering teams to understand exactly what needs to be built.
  • design.md: The requirements are transformed into a concrete technical architecture. This document defines data models, service interfaces, and integration patterns, serving as the architectural blueprint for implementation.
  • tasks.md: The design is now broken down into executable chunks. This document organizes the implementation into manageable tasks, making it easy to track progress and assign work.

Step

  1. Use ChatGPT to write the spec
  2. Generate requirement document based on spec using Claude code
  3. Generate design document based on the requirements using Claude
  4. From the design, create an Implementation Plan using Claude

The project Structure:

Article content

Outcome

The application

Article content
Product page


Article content
Order page

Tech Stack

Article content

System Topology


Article content

Key Takeaways

  1. In my opinion, the Claude Code agent is the best for code generation. It works perfectly on the first try, creating and running entire systems without a single error. The application is used mock data initially. I need to provide another guide for MongoDB integration.
  2. With all the necessary documentation readily available, the system is easy to manage. This makes it simple to generate additional documents, such as a system topology or production-ready recommendations.
  3. It's recommended to break into small, manageble documents for each feature of the application

Anh Danh code APC Thin Film trong vòng 1 nốt nhạc hả 😆

Like
Reply

Very impressive! I’d love to learn more about this sharing when you have time 🙌

Like
Reply

To view or add a comment, sign in

More articles by Danh Ngo

Others also viewed

Explore content categories