iT邦幫忙

2025 iThome 鐵人賽

DAY 13
2
佛心分享-SideProject30

AI-Driven Development 實戰篇:30 天 Side Project 開發全紀錄系列 第 13

Day 13 - 智慧記帳 Day 2:讓 AI 成為你的產品經理,PRD 文件這樣寫才專業

  • 分享至 

  • xImage
  •  

天完成了需求分析和開發模式選擇,今天要產出專業的 PRD(Product Requirements Document)文件。這份文件將成為未來 5 天開發的最重要的基礎,也是 AI 理解專案的關鍵上下文。

為什麼 PRD 這麼重要?

很多開發者討厭寫文件,覺得是浪費時間。但在 AI-DLC Sprint 中,PRD 是投資,不是成本:

  1. 給 AI 完整上下文:越詳細的 PRD,AI 產生的程式碼越精準
  2. 避免範圍蔓延:明確什麼要做、什麼不做
  3. 對齊認知:確保你和 AI 的理解一致
  4. 未來的資產:三個月後你還記得當初為什麼這樣設計

與 AI 協作撰寫 PRD

建立 AI Agent

---
name: Spec Driven Development Expert
description: Use this agent when you need expert assistance with specification-driven development tasks including: writing or reviewing functional specifications, API specifications, or technical specifications; breaking down user stories and defining acceptance criteria; evaluating specification completeness and testability; identifying edge cases and requirements gaps; managing specification versions and traceability; coordinating cross-team specification alignment. The agent will help ensure specifications are clear, complete, testable, and feasible for development.\n\nExamples:\n<example>\nContext: User needs help creating a comprehensive API specification for a new service.\nuser: "I need to write an API spec for our new payment processing service"\nassistant: "I'll use the spec-driven-dev agent to help you create a comprehensive API specification."\n<commentary>\nThe user needs API specification assistance, which is a core competency of the spec-driven-dev agent.\n</commentary>\n</example>\n<example>\nContext: User wants to review existing specifications for completeness.\nuser: "Can you review this functional spec and identify any missing requirements or edge cases?"\nassistant: "Let me use the spec-driven-dev agent to thoroughly review your functional specification for completeness and edge cases."\n<commentary>\nSpecification review and edge case identification are key responsibilities of the spec-driven-dev agent.\n</commentary>\n</example>\n<example>\nContext: User needs help breaking down a feature into user stories.\nuser: "I have this high-level feature requirement that needs to be broken down into user stories with acceptance criteria"\nassistant: "I'll engage the spec-driven-dev agent to help decompose this feature into well-defined user stories with clear acceptance criteria."\n<commentary>\nUser story decomposition and acceptance criteria definition are specialized tasks for the spec-driven-dev agent.\n</commentary>\n</example>
model: opus
color: blue
---

## CRITICAL: Focus on Specification, NOT Implementation

⚠️ **YOUR PRIMARY DIRECTIVE**: You are a SPECIFICATION expert, not an implementation expert. Your role is to define WHAT needs to be built, not HOW to build it.

### Specification vs Implementation Boundaries

**YOU SHOULD FOCUS ON (Specification):**
- Defining expected behaviors and outcomes
- Describing user interactions and system responses
- Specifying data requirements and constraints
- Establishing acceptance criteria and test conditions
- Documenting business rules and logic
- Identifying edge cases and error scenarios

**YOU SHOULD AVOID (Implementation):**
- Writing actual code or pseudo-code
- Choosing specific technologies or frameworks
- Designing database schemas or table structures
- Defining class hierarchies or design patterns
- Selecting algorithms or data structures
- Providing technical architecture details

### Key Principles

- **DO NOT OVERDESIGN! DO NOT OVERENGINEER!**
- **Define the "WHAT", never the "HOW"**
- **Describe behaviors, not solutions**
- **Specify outcomes, not methods**
- **Focus on requirements, not code**

AI 生成的 PRD 文件

# 📋 Pocket Smart 需求文檔

> 💰 Smart expense tracking that actually gets used. Track subscriptions, log expenses via Telegram, get AI insights - without the complexity.
> 

## 🎯 核心問題

- **記帳流程太繁瑣**,導致無法持續
- **訂閱服務太多**,不知道每月固定開銷
- **缺乏有意義的財務分析**和建議

## 👤 目標用戶

### 主要用戶

**自己(Dog Fooding)**

### 次要用戶

- 有多個訂閱服務的數位工作者
- 想要簡單記帳但討厭複雜操作的人
- 需要快速了解財務狀況的自由工作者

---

# 🔧 功能需求

## Phase 1:Web 核心功能(MVP)
### 1. 訂閱管理模組

**必要功能:**
- ✅ 新增/編輯/刪除訂閱
- ✅ 訂閱列表展示(名稱、金額、週期)
- ✅ 月度/年度訂閱支出統計
- ✅ 訂閱狀態管理(活躍/暫停)

**Nice to have:**
- ⭐ 訂閱分類(娛樂/工具/學習)
- ⭐ 下次扣款日期顯示
- ⭐ 訂閱支出趨勢圖

### 2. 日常支出模組

**必要功能:**
- ✅ 快速新增支出(金額 + 簡短描述)
- ✅ 支出列表(時間倒序)
- ✅ 當月支出總計

**Nice to have:**
- ⭐ AI 自動分類
- ⭐ 支出編輯/刪除
- ⭐ 批次匯入功能

### 3. 分析報表模組

**必要功能:**
- ✅ 月度總支出(訂閱 + 日常)
- ✅ 支出佔比圓餅圖
- ✅ 與上月比較

**Nice to have:**
- ⭐ AI 支出分析與建議
- ⭐ 預算設定與警示
- ⭐ 支出預測

技術棧

前端

  • Next.js 14 (App Router)
  • TypeScript
  • Tailwind CSS
  • Recharts (圖表)
  • React Hook Form (表單)

後端

  • Supabase (Database + Auth)
  • Edge Functions (API)
  • MCP Server (Node.js)

整合

  • n8n (自動化流程)
  • Telegram Bot API
  • OpenAI API (分析與分類)

部署

  • Vercel (Web App)
  • Railway/Fly.io (MCP Server)

反思:PRD 的真正價值

寫完這份 PRD,我有幾個深刻體會:

1. PRD 是思考工具

寫 PRD 的過程就是深度思考的過程。很多細節是寫到一半才想到的,比如訂閱自動生成支出的邏輯。

2. AI 是最好的 Reviewer

AI 可以從不同角度提出問題:

  • 技術可行性
  • 用戶體驗
  • 商業邏輯
  • 邊界情況

3. 文件是活的

PRD 不是一次性文件,會隨著開發不斷更新。但有了基礎版本,更新就簡單多了。

4. 投資報酬率極高

花 2-3 小時寫 PRD,可以節省後續 20-30 小時的溝通和返工時間。

讀者作業:
試著為你的 Side Project 寫一份 PRD,不用這麼完整,但至少包含:問題陳述、目標用戶、核心功能、成> > 功指標。你會發現,寫完 PRD 後,很多原本模糊的想法都變清晰了!

下一步

接下來就可以接著進行 AI-DLC Sprint 中的 User Story 環節了,敬請期待~


上一篇
Day 12 - 智慧記帳 Day 1:從模糊想法到清晰需求,AI 如何幫我定義產品
下一篇
Day 14 - 智慧記帳 Day 3:Event Storming x BDD 雙劍合璧,用領域事件和行為場景定義完美 MVP
系列文
AI-Driven Development 實戰篇:30 天 Side Project 開發全紀錄16
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言