docs: 在 AGENTS.md 中加入产品愿景与设计信条
This commit is contained in:
@@ -2,6 +2,46 @@
|
|||||||
|
|
||||||
Guidelines for AI agents working in this Bun monorepo.
|
Guidelines for AI agents working in this Bun monorepo.
|
||||||
|
|
||||||
|
## Product Vision
|
||||||
|
|
||||||
|
> **Kairos 是一个人生操作系统(Personal Life OS)。所有开发决策必须服务于这个愿景。**
|
||||||
|
|
||||||
|
Kairos 将个人生活的每一个维度 —— 财务、订阅、健康、资产、决策 —— 整合进一个统一的、自托管的平台。它不是又一个效率工具或仪表盘,而是一个完整的操作系统。
|
||||||
|
|
||||||
|
### 核心模块
|
||||||
|
|
||||||
|
| 模块 | 职责 |
|
||||||
|
|------|------|
|
||||||
|
| **财务** | 银行账户、交易流水、消费分析、预算追踪 |
|
||||||
|
| **订阅** | 周期性服务管理 —— 费用、续期、使用频率 |
|
||||||
|
| **健康** | 身体指标、习惯、睡眠、营养 |
|
||||||
|
| **资产** | 实体与数字资产、保修、生命周期追踪 |
|
||||||
|
| **日志** | 决策、复盘、人生事件 |
|
||||||
|
| **集成** | API 对接、数据导入、自动化 |
|
||||||
|
|
||||||
|
每个模块是同一个统一数据层的不同视角,模块之间的数据可以交叉关联和分析。
|
||||||
|
|
||||||
|
### 设计信条
|
||||||
|
|
||||||
|
1. **数据主权** —— 自托管、本地优先。用户数据不离开用户的机器,除非用户自己决定。所有功能必须在无外部云依赖的情况下完整可用。
|
||||||
|
2. **关联即洞察** —— 孤立数据是噪音,关联数据是洞察。所有模块共享统一数据层,设计时必须考虑跨模块的数据关联能力。
|
||||||
|
3. **可扩展基座** —— Kairos 是有主见的基座,不是封闭成品。架构必须支持模块的独立扩展和自定义。
|
||||||
|
|
||||||
|
### 架构原则
|
||||||
|
|
||||||
|
- **契约优先 API** —— 每个端点从类型化契约定义开始,实现紧随其后。一份契约,Web 和 CLI 两个消费者共享。
|
||||||
|
- **Web + CLI 双入口** —— Web 应用是主界面;CLI 调用同一套 API,支持脚本编排、自动化、快速数据录入。
|
||||||
|
- **编译为单文件** —— 服务端编译为独立 Bun 二进制,零运行时依赖,部署极简。
|
||||||
|
|
||||||
|
### Agent 决策指南
|
||||||
|
|
||||||
|
在做任何设计或实现决策时,用以下问题自检:
|
||||||
|
|
||||||
|
- **这是否让用户更完整地掌控自己的数据?** 如果否,重新考虑。
|
||||||
|
- **这个模块的数据是否可以被其他模块关联使用?** 如果不能,说明数据模型设计有问题。
|
||||||
|
- **这个功能是否可以在完全离线/自托管环境下工作?** 如果不能,必须提供无外部依赖的替代方案。
|
||||||
|
- **新增的功能是否通过 ORPC 契约暴露?** Web 和 CLI 必须能同等访问所有能力。
|
||||||
|
|
||||||
## Project Overview
|
## Project Overview
|
||||||
|
|
||||||
> **This project uses [Bun](https://bun.sh) exclusively as both the JavaScript runtime and package manager. Do NOT use Node.js / npm / yarn / pnpm. All commands start with `bun` — use `bun install` for dependencies and `bun run <script>` for scripts. Always prefer `bun run <script>` over `bun <script>` to avoid conflicts with Bun built-in subcommands (e.g. `bun build` invokes Bun's bundler, NOT your package.json script). Never use `npm`, `npx`, or `node`.**
|
> **This project uses [Bun](https://bun.sh) exclusively as both the JavaScript runtime and package manager. Do NOT use Node.js / npm / yarn / pnpm. All commands start with `bun` — use `bun install` for dependencies and `bun run <script>` for scripts. Always prefer `bun run <script>` over `bun <script>` to avoid conflicts with Bun built-in subcommands (e.g. `bun build` invokes Bun's bundler, NOT your package.json script). Never use `npm`, `npx`, or `node`.**
|
||||||
|
|||||||
Reference in New Issue
Block a user