Files
ai4se-harness-suite/example-project/.agents/skills/dev-build/SKILL.md
ning-inspire 28f0490dbf refactor: 将 apps 重命名为 containers 并同步 harness 默认路径
example-project 与占位符/安装器默认改为 containers/backend|frontend,探测仍兼容旧 apps/。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-17 13:46:59 +08:00

40 lines
1.3 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.
---
name: dev-build
description: 遵循四层 DDD 架构实现功能。当为 example-project 编写后端或前端代码时使用。
---
# 开发:构建实现
按照 `AGENTS.md` 中的架构约定编写代码。
## 后端
- `containers/backend/adapter/rest/` — Controller:仅做协议转换,不含业务逻辑
- `containers/backend/application/service/` — AppService:用例编排,`@Transactional`
- `containers/backend/domain/` — 聚合、值对象、领域服务:业务不变量
- `containers/backend/infrastructure/` — 持久化、安全、配置
层依赖关系:adapter → application → domain ← infrastructure
## 前端
- Vue 3 Composition API + `<script setup>`
- Pinia store 管理认证状态,位于 `containers/frontend/src/stores/auth.ts`
- 视图位于 `containers/frontend/src/views/user/` 或 `containers/frontend/src/views/admin/`
- Axios 拦截器处理 JWT 和 401 跳转
## 验证
```bash
cd containers/backend && mvn test
cd containers/frontend && npm run build
```
## 文档同步
实现完成后检查是否需要更新:
- `docs/facts/api.yaml` — API 变更
- `docs/facts/db-schema.md` — 数据库变更
- `docs/facts/tech-topic/businessrule.md` — 业务规则变更
- `docs/facts/tech-topic/data-dict.md` — 数据字典变更