Claude Code 開發流程紀錄

我的 AI 工作流中,同時訂閱了 Claude、ChatGPT 和 Cursor。

ChatGPT 常用於日常和設計討論,Cursor 則輔助理解 codebase,各司其職。

但最近,專注於用 Claude 進行開發的體驗,卻讓我第一次真實地感覺到:「原來,想法和現實的距離,可以如此的近。」


紀錄我的 Claude Code 開發流程:

💡 產品需求文檔 (PRD)

首先我會將我的點子收集起來,和 Gemini 2.5 Pro 討論出產品的 PRD,這個過程有時候會迸發出更棒的點子,但更主要的是將發散的點子集中起來,成為一個有脈絡的文檔。

💡 開發文檔architecture.mdtasks.md

這個步驟主要是將 產品面向的 PRD 轉化為 可以執行的架構和代辦事項:

建構 architecture.md

// prompt to generate architecture.md
You are a senior staff-level software architect.
Based on the following PRD, generate a detailed technical architecture document in markdown format.
The output should be saved as architecture.md at the root folder of the project.
Requirements for the document: High-Level Overview Briefly describe the purpose of the system and what problems it solves.
Include a high-level diagram or description of the architecture if relevant.
Folder Structure and Key Files Define the top-level folder structure of the codebase (e.g., /api, /frontend, /infra, etc.).
For each folder, briefly explain what it contains.
List and explain key files or configurations (e.g., main.py, docker-compose.yml, terraform/main.tf).
Component Breakdown Break down the system into major components or modules (e.g., backend API, database, frontend app, auth service, job queue).
For each component, explain: What it does What technologies it uses How it interacts with other components (APIs, message queues, etc.)
State Management and Data Storage Explain what kind of data is stored, and where (e.g., RDS, DynamoDB, Redis, local storage).
Clarify how the application manages state (e.g., client-side Redux, server-side session, cache).
Mention any persistence patterns or data retention considerations.
Service Communication Detail how services talk to each other (e.g., REST, gRPC, events, webhooks).
Highlight any synchronous vs. asynchronous communication paths.
Deployment and Environment Describe how the system is deployed (e.g., Docker, Kubernetes, serverless).
Mention CI/CD pipelines if applicable.
Indicate environments supported (e.g., local dev, staging, production). Security and Access Control (if relevant).
Summarize how authentication/authorization is handled.
Mention any data protection, encryption, or security practices.
Extensibility Notes Describe how the system is designed to scale or adapt to new features.
Instructions:
Use markdown formatting for sections, bullet points, and code snippets where appropriate.
Make the document self-contained and understandable to a new engineer joining the project.
Here is the PRD you should base this document on: [your_prd.md]

建構 tasks.md

// prompt to generate tasks.md
You are an experienced technical project planner.
Your job is to take the previously generated @your_prd.md and@architecture.md and break it down into a list of small, testable implementation tasks for building the MVP.
Output Format: Generate a markdown file named tasks.md, placed at the root of the project (same level as @architecture.md.)
What to include: Purpose: Compile a clear, comprehensive list of engineering tasks derived from architecture.md. 
This list will be used to coordinate the development of the MVP in an incremental and testable fashion.
Task Structure: Each task must:
- Be atomic: small enough to complete independently and ideally within a few hours
- Be testable: have a clearly defined outcome or deliverable
- Be focused: address only one feature, function, or integration point Have a defined start and end condition (e.g., "Add login API endpoint – when a user posts credentials, return a JWT on success")
Organization: Group tasks by component or module (e.g., Frontend, Backend API, Database, CI/CD, Infrastructure, etc.)
Example Task Format (for each item):
### [Component Name] - [Short Task Name]
- **Description:** [Short explanation of the task]
- **Input:** [What inputs/data/decisions this task depends on]
- **Output:** [What should be done or working after this task is complete]
- **Testable Criteria:** [How we can verify it is done]
Instructions for the LLM:
Use only the content from @your_prd.md and @architecture.md to determine which tasks need to be done.
Prioritize tasks required to build a functional MVP.
The resulting tasks.md will be used by an engineering LLM to work on one task at a time, with testing performed in between.

💡 Review and Refine

接著 review 這兩個文件,看看大致需求和 plan,這個過程會和 LLM 討論一點點細節,確保所規劃的 tasks.md 可以完成項目。之後我們就可以將這兩個文件放在 project 的根目錄下,準備下最後一個指令給 Claude Code。

💡 Start Vibing

// 給 LLM 執行的 Prompt -- CLAUDE.local.md
You are the software engineer responsible for implementing this product.

You have access to two key documents:
- @architecture.md Describes the overall system design and structure.
- @tasks.md: Lists detailed, incremental tasks to build the MVP.

Your Mission:
Read both documents carefully. You must fully understand the product architecture and purpose before starting.
Stick to the plan. Do not deviate from the architecture or task list unless absolutely necessary.

FOCUS on @tasks.md
You will work on one task at a time
no jumping ahead or bundling unrelated changes.

Workflow
Pick the next task in tasks.md and implement it.

Stop immediately after completing the task.
I will perform testing and confirm everything works as expected.
Once verified, we will submit a Git commit.
Then, you will be assigned the next task.
---
Coding Guide
* Do only what is necessary for the current task. No extras.
* Do not refactor unrelated code unless it is blocking the current task.
* Code should be:
	- Accurate
	- Modular and easy to test
	- Minimal yet complete
	- Dont break existing functionality. Reuse or extend carefully.
	- Ask if anything is unclear or blockedespecially if a resource (e.g., AWS service, secret, deployment step) needs to be prepared by me.

以上是事前準備工作,接著就可以和 LLM 一起執行 tasks.md 裡面的 plan。

幾個做完一個 project 的 takeaways:

  1. Vision – 要將想 build 的東西一開始就想好,先想好再執行,比如一個產品有哪些 feature,想要解決什麼問題等等。不然在和 LLM 溝通的時候容易進入一個抽象循環。
  2. UI/UX – 在開始之前,將 UI/UX、Color Palette 等等規劃好
    • 我嘗試了用 v0、Google Stitch 去做第一版的設計。
    • 但到了中間很多頁面不知道該長什麼樣子,讓 LLM 自由發揮的結果就會有很多反覆的對話,消耗很多 token和精力。
  3. Prompt – 要提供清晰的 Prompt。在實作過程中,我很常將我的點子和 prompt 交給 Gemini 或 ChatGPT 精煉,最後再將更精確的 prompt 提供給 Claude Code。
  4. Git/GitHub – 在每次完成一個 tasks.md 的 task 的時候,我會提交一個新分支和 commit,確保隨時可以 return to an older version。

我按照這個流程做了兩個小小的 project,每次開始都會有新的啟發。

我會繼續紀錄這個過程,期望創立一個 workflow 能迅速將點子轉化為現實。

最後,祝大家 Happy vibe coding :)