Skip to content

Project Structure — 仓库结构

本页是根 README.md 的目录拆分页,说明顶层目录职责与 backend/app/ 场域包结构。 设计文档体系自身的目录树见 docs/README.md


一、顶层目录

text
agent_hub/
├── README.md              项目入口(全貌 + 导航)
├── AGENTS.md              Cursor Cloud Agent 启动入口
├── CLAUDE.md              Claude Code 启动入口
├── LICENSE                MIT
├── Makefile               顶层任务(install / lint / typecheck / test / dev / compose-*)

├── backend/               后端:FastAPI 模块化单体(业务实现集中地)
├── frontend/              前端:pnpm workspace(web-builder / web-ops / web-starter / miniprogram / shared / ui / web-saas-template 已实现)
├── configs/              环境配置样例(local / staging / production .env.example)
├── deploy/               部署:compose(本地/CI)+ helm(Phase 2+)
├── scripts/              运维与自检脚本(白名单远程操作三件套 + cloud-agent-* + verify_*)
├── tests/               仓库级测试(unit / integration / e2e)
├── docs/                设计文档体系 + 本 README 分册(docs/readme/)+ 用户手册(docs/user-manual/)

├── .github/             GitHub Actions(ci.yml / branch-flow-guard.yml)
├── .cursor/             Cursor 规则、命令、环境与 Dockerfile
├── .claude/             Claude Code agents 与 skills(被 Cursor 兼容扫描)
└── .trae/              Trae IDE 规则(remote-ops 事实源)与 skills

二、backend/ 结构

text
backend/
├── app/                  应用代码(按 7 场域分包)
├── alembic/             数据库迁移脚本
├── alembic.ini
├── tests/               后端测试套件
├── conftest.py
├── Dockerfile           多阶段生产镜像
├── pyproject.toml       依赖 + ruff / mypy / pytest / import-linter 配置
└── uv.lock              依赖锁文件(uv)

backend/app/ 场域包

场域角色
builder/D-A项目与资源建模
orchestrator/D-B流程编排与发布
delivery/D-C应用交付与前端契约
ops/D-D运营监控与系统自治
runtime/D-E用户任务执行
billing/D-F商业化与账务
core/D-H基础设施与平台内核
identity/ security/ audit/ storage/ workers/横向支撑子包(鉴权 / 安全 / 审计 / 文件 / Celery worker)
main.pyFastAPI 应用装配入口

场域 → 模块的完整映射见 domain_and_module_division.md;场域职责摘要见 architecture.md


三、deploy/ 结构

text
deploy/
├── compose/
│   ├── docker-compose.yml      本地 / CI 依赖编排
│   └── initdb/                 PG 初始化 SQL(扩展 + RLS 角色)
└── helm/agenthub/              Helm Chart(Phase 2+ deferred)

四、docs/ 结构(摘要)

text
docs/
├── README.md                设计文档体系总览
├── readme/                  本 README 的分册(getting-started / architecture / 本页 / development)
├── user-manual/             面向使用者的操作手册(index.html,单页 HTML)
├── design/
│   ├── 0.inspiration/        阶段 0:灵感
│   ├── 1.product/            阶段 1:产品
│   ├── 2.technical/          阶段 2:技术(frozen v1.0 + ADR)
│   └── 3.task/               阶段 3:任务(Agent 清单 / 任务包 / 编排)
├── seminar/                 关键议题多模型研讨与决议
└── z.reference/             跨阶段参考资料

五、相关页