AI规范准则生成 README.md初始化
This commit is contained in:
@@ -48,9 +48,11 @@ description: "Task list template for feature implementation"
|
||||
|
||||
**Purpose**: Project initialization and basic structure
|
||||
|
||||
- [ ] T001 Create project structure per implementation plan
|
||||
- [ ] T002 Initialize [language] project with [framework] dependencies
|
||||
- [ ] T003 [P] Configure linting and formatting tools
|
||||
- [ ] T001 Create project structure per implementation plan (internal/, pkg/, cmd/)
|
||||
- [ ] T002 Initialize Go project with Fiber + GORM + Viper + Zap + Asynq dependencies
|
||||
- [ ] T003 [P] Configure linting (golangci-lint) and formatting tools (gofmt/goimports)
|
||||
- [ ] T004 [P] Setup unified error codes in pkg/errors/
|
||||
- [ ] T005 [P] Setup unified API response in pkg/response/
|
||||
|
||||
---
|
||||
|
||||
@@ -60,14 +62,20 @@ description: "Task list template for feature implementation"
|
||||
|
||||
**⚠️ CRITICAL**: No user story work can begin until this phase is complete
|
||||
|
||||
Examples of foundational tasks (adjust based on your project):
|
||||
Foundational tasks for 君鸿卡管系统 tech stack:
|
||||
|
||||
- [ ] T004 Setup database schema and migrations framework
|
||||
- [ ] T005 [P] Implement authentication/authorization framework
|
||||
- [ ] T006 [P] Setup API routing and middleware structure
|
||||
- [ ] T007 Create base models/entities that all stories depend on
|
||||
- [ ] T008 Configure error handling and logging infrastructure
|
||||
- [ ] T009 Setup environment configuration management
|
||||
- [ ] T006 Setup PostgreSQL database connection via GORM with connection pool (MaxOpenConns=25, MaxIdleConns=10)
|
||||
- [ ] T007 Setup Redis connection with connection pool (PoolSize=10, MinIdleConns=5)
|
||||
- [ ] T008 [P] Setup database migrations framework (golang-migrate or GORM AutoMigrate)
|
||||
- [ ] T009 [P] Implement Fiber routing structure in internal/router/
|
||||
- [ ] T010 [P] Implement Fiber middleware (authentication, logging, recovery, validation) in internal/handler/middleware/
|
||||
- [ ] T011 [P] Setup Zap logger with Lumberjack rotation in pkg/logger/
|
||||
- [ ] T012 [P] Setup Viper configuration management in pkg/config/
|
||||
- [ ] T013 [P] Setup Asynq task queue client and server in pkg/queue/
|
||||
- [ ] T014 [P] Setup Validator integration in pkg/validator/
|
||||
- [ ] T015 Create base Store structure with transaction support in internal/store/
|
||||
- [ ] T016 Create base Service structure with dependency injection in internal/service/
|
||||
- [ ] T017 Setup sonic JSON as default serializer for Fiber
|
||||
|
||||
**Checkpoint**: Foundation ready - user story implementation can now begin in parallel
|
||||
|
||||
@@ -79,21 +87,28 @@ Examples of foundational tasks (adjust based on your project):
|
||||
|
||||
**Independent Test**: [How to verify this story works on its own]
|
||||
|
||||
### Tests for User Story 1 (OPTIONAL - only if tests requested) ⚠️
|
||||
### Tests for User Story 1 (REQUIRED per Constitution - Testing Standards) ⚠️
|
||||
|
||||
> **NOTE: Write these tests FIRST, ensure they FAIL before implementation**
|
||||
|
||||
- [ ] T010 [P] [US1] Contract test for [endpoint] in tests/contract/test_[name].py
|
||||
- [ ] T011 [P] [US1] Integration test for [user journey] in tests/integration/test_[name].py
|
||||
- [ ] T020 [P] [US1] Unit tests for Service layer business logic in internal/service/[service]_test.go
|
||||
- [ ] T021 [P] [US1] Integration tests for API endpoints in internal/handler/[handler]_test.go
|
||||
- [ ] T022 [P] [US1] Transaction rollback tests for Store layer in internal/store/[store]_test.go
|
||||
|
||||
### Implementation for User Story 1
|
||||
|
||||
- [ ] T012 [P] [US1] Create [Entity1] model in src/models/[entity1].py
|
||||
- [ ] T013 [P] [US1] Create [Entity2] model in src/models/[entity2].py
|
||||
- [ ] T014 [US1] Implement [Service] in src/services/[service].py (depends on T012, T013)
|
||||
- [ ] T015 [US1] Implement [endpoint/feature] in src/[location]/[file].py
|
||||
- [ ] T016 [US1] Add validation and error handling
|
||||
- [ ] T017 [US1] Add logging for user story 1 operations
|
||||
- [ ] T023 [P] [US1] Create [Entity1] model with GORM tags in internal/model/[entity1].go
|
||||
- [ ] T024 [P] [US1] Create [Entity2] model with GORM tags in internal/model/[entity2].go
|
||||
- [ ] T025 [P] [US1] Create DTOs and request/response structs in internal/model/dto/[feature].go
|
||||
- [ ] T026 [US1] Implement Store methods with GORM in internal/store/postgres/[store].go (depends on T023, T024)
|
||||
- [ ] T027 [US1] Implement Service business logic in internal/service/[service].go (depends on T026)
|
||||
- [ ] T028 [US1] Implement Fiber Handler in internal/handler/[handler].go (depends on T027)
|
||||
- [ ] T029 [US1] Register routes in internal/router/router.go
|
||||
- [ ] T030 [US1] Add validation rules using Validator in Handler
|
||||
- [ ] T031 [US1] Add unified error handling using pkg/errors/ and pkg/response/
|
||||
- [ ] T032 [US1] Add Zap logging with structured fields
|
||||
- [ ] T033 [US1] Add database indexes for queries (if needed)
|
||||
- [ ] T034 [US1] Create Asynq tasks for async operations (if needed) in internal/task/[task].go
|
||||
|
||||
**Checkpoint**: At this point, User Story 1 should be fully functional and testable independently
|
||||
|
||||
@@ -146,16 +161,24 @@ Examples of foundational tasks (adjust based on your project):
|
||||
|
||||
---
|
||||
|
||||
## Phase N: Polish & Cross-Cutting Concerns
|
||||
## Phase N: Polish & Quality Gates
|
||||
|
||||
**Purpose**: Improvements that affect multiple user stories
|
||||
**Purpose**: Improvements that affect multiple user stories and final quality checks
|
||||
|
||||
- [ ] TXXX [P] Documentation updates in docs/
|
||||
- [ ] TXXX Code cleanup and refactoring
|
||||
- [ ] TXXX Performance optimization across all stories
|
||||
- [ ] TXXX [P] Additional unit tests (if requested) in tests/unit/
|
||||
- [ ] TXXX Security hardening
|
||||
- [ ] TXXX Performance optimization and load testing (verify P95 < 200ms, P99 < 500ms)
|
||||
- [ ] TXXX [P] Additional unit tests to reach 70%+ coverage (90%+ for core business)
|
||||
- [ ] TXXX Security audit (SQL injection, XSS, command injection prevention)
|
||||
- [ ] TXXX Run quickstart.md validation
|
||||
- [ ] TXXX Quality Gate: Run `go test ./...` (all tests pass)
|
||||
- [ ] TXXX Quality Gate: Run `gofmt -l .` (no formatting issues)
|
||||
- [ ] TXXX Quality Gate: Run `go vet ./...` (no issues)
|
||||
- [ ] TXXX Quality Gate: Run `golangci-lint run` (no issues)
|
||||
- [ ] TXXX Quality Gate: Verify test coverage with `go test -cover ./...`
|
||||
- [ ] TXXX Quality Gate: Check no TODO/FIXME remains (or documented in issues)
|
||||
- [ ] TXXX Quality Gate: Verify database migrations work correctly
|
||||
- [ ] TXXX Quality Gate: Verify API documentation updated (if API changes)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user