AI规范准则生成 README.md初始化

This commit is contained in:
2025-11-10 15:48:47 +08:00
parent eb8a759d4d
commit 2413baf945
5 changed files with 456 additions and 60 deletions

View File

@@ -95,6 +95,43 @@
- **FR-006**: System MUST authenticate users via [NEEDS CLARIFICATION: auth method not specified - email/password, SSO, OAuth?]
- **FR-007**: System MUST retain user data for [NEEDS CLARIFICATION: retention period not specified]
### Technical Requirements (Constitution-Driven)
**Tech Stack Compliance**:
- [ ] All HTTP operations use Fiber framework (no `net/http` shortcuts)
- [ ] All database operations use GORM (no `database/sql` direct calls)
- [ ] All JSON operations use sonic (no `encoding/json` usage)
- [ ] All async tasks use Asynq
- [ ] All logging uses Zap + Lumberjack.v2
- [ ] All configuration uses Viper
**Architecture Requirements**:
- [ ] Implementation follows Handler → Service → Store → Model layers
- [ ] Dependencies injected via Service/Store structs
- [ ] Unified error codes defined in `pkg/errors/`
- [ ] Unified API responses via `pkg/response/`
**API Design Requirements**:
- [ ] All APIs follow RESTful principles
- [ ] All responses use unified JSON format with code/message/data/timestamp
- [ ] All error messages include error codes and bilingual descriptions
- [ ] All pagination uses standard parameters (page, page_size, total)
- [ ] All time fields use ISO 8601 format (RFC3339)
- [ ] All currency amounts use integers (cents)
**Performance Requirements**:
- [ ] API response time (P95) < 200ms
- [ ] Database queries < 50ms
- [ ] Batch operations use bulk queries
- [ ] List queries implement pagination (default 20, max 100)
- [ ] Non-realtime operations delegated to async tasks
**Testing Requirements**:
- [ ] Unit tests for all Service layer business logic
- [ ] Integration tests for all API endpoints
- [ ] Tests are independent and use mocks/testcontainers
- [ ] Target coverage: 70%+ overall, 90%+ for core business logic
### Key Entities *(include if feature involves data)*
- **[Entity 1]**: [What it represents, key attributes without implementation]