Files
AIPortPilot/AGENTS.md
T
selfrelease 51feae55ba feat(backend): Phase 0 项目骨架完成 — 后端/前端/数据库/Docker
- 后端:FastAPI + SQLAlchemy + Alembic,7 张核心表迁移成功
- 前端:Next.js 16 + TailwindCSS 4 + 三端布局(投资人/创始人/Admin)
- 数据库:PostgreSQL 16,7 张核心实体表(tenants/users/companies/monthly_reports/health_scores/risk_events/audit_logs)
- Docker:docker-compose.yml + 前后端 Dockerfile
- 测试:健康检查 4 个测试全部 GREEN
- 文档:README/run.md/AGENTS.md/docs 体系完整
2026-07-18 21:50:15 +08:00

49 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# AGENTS.md — Agent 协作规则
## 核心原则
1. **先想再写**:任何代码变更前,确认当前处于方法论七步流程的哪一步
2. **先测再码**TDD 强制,RED-GREEN-REFACTOR
3. **小步快跑**:任务粒度 2-5 分钟,每个 RED-GREEN 循环提交一次
4. **不删旧代码**:修改时保留无关代码,用快照隔离历史
5. **中文沟通**:所有对话、注释、文档使用中文
## 分工
| Agent | 职责 | 触发时机 |
|---|---|---|
| Brainstorm Agent | 需求澄清、方案探索 | 新功能提出时 |
| Plan Agent | 任务拆解、文件路径规划 | 设计批准后 |
| TDD Agent | 写测试 → 写实现 → 重构 | 任务执行时 |
| Review Agent | 代码审查、规格符合度检查 | 每个任务完成后 |
| Debug Agent | 根因分析、复现测试 | Bug 出现时 |
## 禁止事项
- 禁止跳过测试直接写代码
- 禁止删除无关代码
- 禁止 `alert()/confirm()`
- 禁止硬编码 hex 色值
- 禁止多 UI 库混用
- 禁止 `@skip/it.only` 进 PR
- 禁止 mock DB 跑集成测试
## 提交规范
```
type(scope): description
type ∈ feat/fix/refactor/test/docs/chore
scope ∈ frontend/backend/db/docs/infra
```
## 文件路径约定
- 前端页面:`frontend/src/app/(role)/page.tsx`
- 前端组件:`frontend/src/components/`
- 后端路由:`backend/app/routers/`
- 后端模型:`backend/app/models/`
- 后端服务:`backend/app/services/`
- 测试:`backend/tests/` / `frontend/__tests__/`
- 文档:`docs/`