2.6 KiB
2.6 KiB
Example: Prompt Service PRD (调用测试 + 集合)
This is a real PRD produced for prompt.ephron.ren. It demonstrates the full workflow: codebase analysis → draft → interactive decisions → finalization.
Project Context
- Tech Stack: FastAPI + Jinja2 templates + SQLite + vanilla JS
- Design System: Dark theme, Inter/JetBrains Mono, CSS custom properties
- CSP Policy:
connect-src 'self'; script-src 'self' 'unsafe-inline' - Auth: Shared
ephron_authCookie across sub-services - Existing API: 7 endpoints (public list/detail + service CRUD)
Codebase Analysis Approach
findto enumerate all files in the prompt service- Read
src/main.py→ FastAPI app with 4 routers (pages, api, admin, service_api) - Read
src/services/db.py→prompts+prompt_versionstables - Read
src/services/prompts.py→ full CRUD with version management - Read
src/routes/api.py→ public API with PromptResponse schema - Read
src/routes/service_api.py→ service token auth pattern - Read
src/routes/admin.py→ admin CRUD with CSRF, audit logging - Read
templates/public/detail.html→ current detail page (view + copy only) - Read
templates/public/index.html→ grid layout with filter bar - Read
src/config.py→ env-based config, shared DB path - Read
prompt-api-spec/api-specification.md→ existing API spec to extend - Checked
shared/directory for reusable utilities
Decisions Collected (7 items)
| # | Decision | User's Choice | Notes |
|---|---|---|---|
| 1 | LLM Provider | Direct Anthropic API | Admin settings page for model config |
| 2 | API Key storage | .env | Model params in DB + admin UI |
| 3 | Streaming | SSE | Simple, FastAPI native support |
| 4 | Markdown rendering | Frontend (marked.js) | Less server overhead |
| 5 | Login required | Yes | Rate limiting + audit |
| 6 | Multi-collection membership | Yes | UNIQUE(collection_key, prompt_key) |
| 7 | Collection ordering | Manual (sort_order) | Author controls flow |
Workflow Notes
- User preferred decision questions asked ONE AT A TIME (not all at once)
- User asked for recommendations before answering — always include your pick
- PRD was saved to
prompt-api-spec/prd-test-and-collections.md(project-relative) clarifytool was not available in this execution context — fell back to direct Q&A
Output Stats
- ~24KB markdown document
- 7 tables (data model, API spec, decision record, risk matrix, etc.)
- 2 new SQL tables proposed (collections, collection_items)
- 6 new API endpoints proposed
- 5.5 day estimated implementation