代码拉取完成,页面将自动刷新
version: "1.0.0"
rules:
backend:
jvm:
common: # JVM框架通用配置
patterns:
- "src/main/{language}/**/*"
- "src/test/{language}/**/*"
structure:
main:
- "src/main/"
- "{language}/"
- "controller/" # HTTP控制器
- "api/" # API接口控制器
- "web/" # Web页面控制器
- "service/" # 业务服务
- "impl/" # 服务实现
- "repository/" # 数据访问
- "jpa/" # JPA实现
- "r2dbc/" # R2DBC实现
- "domain/" # 领域模型
- "entity/" # 实体类
- "dto/" # 数据传输对象
- "vo/" # 视图对象
- "config/" # 配置类
- "db/" # 数据库配置
- "security/" # 安全配置
- "cache/" # 缓存配置
- "client/" # 外部服务客户端
- "feign/" # Feign客户端
- "http/" # HTTP客户端
- "factory/" # 工厂类
- "util/" # 工具类
- "constant/" # 常量类
- "exception/" # 异常类
- "resources/"
- "application.yml" # 主配置文件
- "application-{env}.yml" # 环境配置
- "bootstrap.yml" # 引导配置
- "logback.xml" # 日志配置
- "i18n/" # 国际化资源
- "db/migration/" # 数据库迁移脚本
test:
- "src/test/"
- "{language}/"
- "controller/" # 控制器测试
- "service/" # 服务测试
- "repository/" # 数据访问测试
- "resources/"
- "application-test.yml" # 测试配置
- "data/" # 测试数据
naming:
conventions:
controller:
pattern: "^[A-Z][a-zA-Z0-9]+Controller$"
examples:
- "UserController"
- "OrderController"
service:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
examples:
- "UserService"
- "OrderService"
repository:
pattern: "^[A-Z][a-zA-Z0-9]+Repository$"
examples:
- "UserRepository"
- "OrderRepository"
entity:
pattern: "^[A-Z][a-zA-Z0-9]+$"
examples:
- "User"
- "Order"
dto:
pattern: "^[A-Z][a-zA-Z0-9]+DTO$"
examples:
- "UserDTO"
- "OrderDTO"
dependencies:
core: # 核心依赖
spring-boot:
- "spring-boot-starter-web"
- "spring-boot-starter-validation"
- "spring-boot-starter-actuator"
quarkus:
- "quarkus-resteasy-reactive"
- "quarkus-hibernate-validator"
- "quarkus-smallrye-health"
micronaut:
- "micronaut-runtime"
- "micronaut-http-server-netty"
- "micronaut-validation"
data: # 数据访问
spring-boot:
- "spring-boot-starter-data-jpa"
- "spring-boot-starter-data-r2dbc"
quarkus:
- "quarkus-hibernate-orm"
- "quarkus-hibernate-reactive"
micronaut:
- "micronaut-data-jdbc"
- "micronaut-data-r2dbc"
security: # 安全框架
spring-boot:
- "spring-boot-starter-security"
- "spring-boot-starter-oauth2-resource-server"
quarkus:
- "quarkus-security"
- "quarkus-oidc"
micronaut:
- "micronaut-security"
- "micronaut-security-jwt"
cache: # 缓存支持
spring-boot:
- "spring-boot-starter-cache"
- "spring-boot-starter-data-redis"
quarkus:
- "quarkus-cache"
- "quarkus-redis-client"
micronaut:
- "micronaut-cache-caffeine"
- "micronaut-redis"
messaging: # 消息队列
spring-boot:
- "spring-boot-starter-amqp"
- "spring-boot-starter-kafka"
quarkus:
- "quarkus-smallrye-reactive-messaging"
- "quarkus-kafka-client"
micronaut:
- "micronaut-kafka"
- "micronaut-rabbitmq"
monitoring: # 监控工具
spring-boot:
- "spring-boot-starter-actuator"
- "micrometer-registry-prometheus"
quarkus:
- "quarkus-smallrye-health"
- "quarkus-micrometer-registry-prometheus"
micronaut:
- "micronaut-micrometer-core"
- "micronaut-management"
configuration:
patterns:
- "src/main/resources/application.yml"
- "src/main/resources/application-*.yml"
structure:
application:
server:
port: number
security:
enabled: boolean
datasource:
url: string
username: string
password: string
cache:
type: string
messaging:
bootstrap-servers: string
testing:
patterns:
- "src/test/{language}/**/*Test.{java,kt,groovy}"
- "src/test/{language}/**/*Spec.{java,kt,groovy}"
conventions:
- "单元测试覆盖"
- "集成测试支持"
- "测试容器使用"
- "Mock测试"
deployment:
docker:
patterns:
- "Dockerfile"
- "docker-compose.yml"
conventions:
- "多阶段构建"
- "基础镜像选择"
- "资源限制配置"
kubernetes:
patterns:
- "k8s/*.yml"
conventions:
- "部署配置"
- "服务配置"
- "资源配置"
documentation:
patterns:
- "src/main/docs/**/*.md"
- "README.md"
- "API.md"
conventions:
- "API文档"
- "配置说明"
- "部署文档"
ktor:
patterns:
- "src/main/{language}/**/*.{kt}"
- "src/test/{language}/**/*.{kt}"
structure:
main:
- "src/main/"
- "{language}/"
- "routes/" # 路由定义
- "api/" # API路由
- "web/" # Web路由
- "plugins/" # Ktor插件
- "Security.kt"
- "Serialization.kt"
- "Database.kt"
- "Monitoring.kt"
- "services/" # 业务服务
- "impl/"
- "models/" # 数据模型
- "entities/"
- "dtos/"
- "repositories/" # 数据访问
- "impl/"
- "config/" # 配置类
- "utils/" # 工具类
- "resources/"
- "application.conf" # HOCON配置
- "logback.xml"
- "db/"
- "migrations/"
test:
- "src/test/"
- "{language}/"
- "routes/"
- "services/"
- "resources/"
- "application-test.conf"
dependencies:
core:
- "ktor-server-core"
- "ktor-server-netty"
- "ktor-server-content-negotiation"
data:
- "exposed-core"
- "exposed-dao"
- "exposed-jdbc"
security:
- "ktor-server-auth"
- "ktor-server-auth-jwt"
monitoring:
- "ktor-server-metrics-micrometer"
- "ktor-server-call-logging"
grails:
patterns:
- "grails-app/**/*.{groovy,java,kt}"
- "src/test/**/*.{groovy,java,kt}"
structure:
main:
- "grails-app/"
- "controllers/" # 控制器
- "api/"
- "web/"
- "services/" # 服务层
- "domain/" # 领域类
- "views/" # GSP视图
- "i18n/" # 国际化
- "conf/" # 配置
- "taglib/" # 标签库
- "utils/" # 工具类
- "src/"
- "main/groovy/" # 额外源码
- "integration-test/groovy/" # 集成测试
- "test/groovy/" # 单元测试
- "conf/"
- "application.yml"
- "application.groovy"
- "logback.groovy"
dependencies:
core:
- "grails-web"
- "grails-gorm"
data:
- "grails-datastore-gorm"
- "grails-datastore-gorm-hibernate5"
security:
- "spring-security-core"
- "spring-security-rest"
monitoring:
- "grails-actuator"
- "grails-metrics"
play:
patterns:
- "app/**/*.{java,scala}"
- "test/**/*.{java,scala}"
structure:
main:
- "app/"
- "controllers/" # 控制器
- "api/"
- "web/"
- "services/" # 服务层
- "models/" # 数据模型
- "views/" # 模板视图
- "filters/" # 过滤器
- "tasks/" # 后台任务
- "utils/" # 工具类
- "conf/"
- "application.conf"
- "routes" # 路由配置
- "evolutions/" # 数据库变更
- "logback.xml"
- "test/"
- "controllers/"
- "services/"
- "models/"
dependencies:
core:
- "play"
- "play-guice"
- "play-akka-http-server"
data:
- "play-jdbc"
- "play-slick"
- "play-ebean"
security:
- "play-auth"
- "play-pac4j"
monitoring:
- "play-metrics"
- "play-actuator"
nodejs:
nextjs:
patterns:
- "src/**/*.{js,ts,tsx}"
- "src/app/api/**/*.{js,ts}"
express:
patterns:
- "src/**/*.{js,ts}"
- "src/routes/**/*.{js,ts}"
koa:
patterns:
- "src/**/*.{js,ts}"
- "src/routes/**/*.{js,ts}"
nest:
patterns:
- "src/**/*.ts"
- "src/controllers/**/*.ts"
hapi:
patterns:
- "src/**/*.{js,ts}"
- "src/routes/**/*.{js,ts}"
adonis:
patterns:
- "app/**/*.{js,ts}"
- "app/Controllers/**/*.{js,ts}"
python:
django:
patterns:
- "app/**/*.py"
- "app/models/**/*.py"
fastapi:
patterns:
- "app/**/*.py"
- "app/routers/**/*.py"
flask:
patterns:
- "app/**/*.py"
- "app/routes/**/*.py"
tornado:
patterns:
- "app/**/*.py"
- "app/handlers/**/*.py"
golang:
gin:
patterns:
- "internal/**/*.go"
- "internal/handlers/**/*.go"
echo:
patterns:
- "internal/**/*.go"
- "internal/handlers/**/*.go"
beego:
naming:
conventions:
controller:
pattern: "^[A-Z][a-zA-Z0-9]+Controller$"
examples:
- "UserController"
- "OrderController"
service:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
examples:
- "UserService"
- "OrderService"
repository:
pattern: "^[A-Z][a-zA-Z0-9]+Repository$"
examples:
- "UserRepository"
- "OrderRepository"
model:
pattern: "^[A-Z][a-zA-Z0-9]+$"
examples:
- "User"
- "Order"
dto:
pattern: "^[A-Z][a-zA-Z0-9]+DTO$"
examples:
- "UserDTO"
- "OrderDTO"
dependencies:
core: # 核心依赖
- "github.com/beego/beego/v2"
- "github.com/beego/bee"
data: # 数据访问
- "github.com/beego/beego/v2/client/orm"
- "github.com/go-sql-driver/mysql"
- "github.com/lib/pq"
security: # 安全框架
- "github.com/beego/beego/v2/server/web/filter/auth"
- "github.com/golang-jwt/jwt"
cache: # 缓存支持
- "github.com/beego/beego/v2/client/cache"
- "github.com/go-redis/redis/v8"
monitoring: # 监控工具
- "github.com/beego/beego/v2/core/logs"
- "github.com/prometheus/client_golang"
configuration:
patterns:
- "src/main/resources/config/*.{yaml,conf}"
- "src/main/resources/config/*/*.{yaml,conf}"
structure:
application:
appname: string
httpport: number
runmode: string
security:
enablexsrf: boolean
xsrfkey: string
jwt:
secret: string
expires: number
database:
driver: string
source: string
cache:
driver: string
config: string
log:
level: string
filename: string
testing:
patterns:
- "src/test/go/**/*_test.go"
dependencies:
- "github.com/beego/beego/v2/core/logs"
- "github.com/smartystreets/goconvey"
conventions:
- "单元测试覆盖"
- "集成测试支持"
- "测试容器使用"
- "Mock测试"
structure:
main:
- "src/test/"
- "go/"
- "controllers/" # 控制器测试
- "api/" # API测试
- "services/" # 服务测试
- "models/" # 模型测试
- "integration/" # 集成测试
- "resources/"
- "config/" # 测试配置
- "data/" # 测试数据
- "mocks/" # Mock数据
deployment:
docker:
patterns:
- "Dockerfile"
- "docker-compose.yml"
conventions:
- "多阶段构建"
- "基础镜像选择"
- "资源限制配置"
structure:
dockerfile:
- "构建阶段"
- "测试阶段"
- "运行阶段"
compose:
- "应用服务"
- "数据库服务"
- "缓存服务"
- "监控服务"
kubernetes:
patterns:
- "k8s/*.yml"
conventions:
- "���署配置"
- "服务配置"
- "资源配置"
monitoring:
metrics:
patterns:
- "src/main/go/**/metrics/**"
conventions:
- "应用指标"
- "请求计数"
- "响应时间"
- "错误率"
- "业务指标"
- "系统指标"
logging:
patterns:
- "src/main/go/**/logging/**"
conventions:
- "结构化日志"
- "日志级别"
- "链路追踪"
format:
pattern: |
{
"timestamp": "",
"level": "",
"trace_id": "",
"service": "",
"message": "",
"context": {}
}
tracing:
patterns:
- "src/main/go/**/tracing/**"
conventions:
- "分布式追踪"
- "链路上下文"
- "采样策略"
documentation:
patterns:
- "docs/**/*.md"
- "README.md"
- "API.md"
structure:
docs:
- "architecture/" # 架构文档
- "overview.md"
- "components.md"
- "api/" # API文档
- "overview.md"
- "endpoints.md"
- "development/" # 开发文档
- "setup.md"
- "guidelines.md"
- "deployment/" # 部署文档
- "docker.md"
- "kubernetes.md"
- "monitoring/" # 监控文档
- "metrics.md"
- "logging.md"
conventions:
- "文档及时更新"
- "版本号同步"
- "示例代码"
- "故障排除"
rust:
actix:
patterns:
- "src/**/*.rs"
- "src/handlers/**/*.rs"
rocket:
patterns:
- "src/**/*.rs"
- "src/routes/**/*.rs"
api:
rest:
conventions:
- "使用复数名词作为资源标识"
- "使用HTTP动词表示操作"
- "版本号放在URL中"
- "使用kebab-case命名URL"
patterns:
- "**/api/v[0-9]+/**"
graphql:
conventions:
- "使用PascalCase命名类型"
- "使用camelCase命名字段"
- "分页使用cursor"
patterns:
- "**/graphql/**/*.graphqls"
- "**/graphql/**/*.gql"
grpc:
conventions:
- "使用PascalCase命名服务"
- "使用PascalCase命名消息"
- "使用snake_case命名字段"
patterns:
- "**/proto/**/*.proto"
microservices:
naming:
service:
pattern: "^[a-z][a-z0-9-]*-service$"
maxLength: 64
gateway:
pattern: "^[a-z][a-z0-9-]*-gateway$"
maxLength: 64
conventions:
- "服务间通信使用异步消息"
- "每个服务独立数据库"
- "服务间数据最终一致性"
patterns:
- "**/services/**"
- "**/gateway/**"
messaging:
kafka:
naming:
topic:
pattern: "^[a-z][a-z0-9.-]*$"
maxLength: 255
consumer:
pattern: "^[a-z][a-z0-9-]*-consumer$"
producer:
pattern: "^[a-z][a-z0-9-]*-producer$"
rabbitmq:
naming:
exchange:
pattern: "^[a-z][a-z0-9.-]*$"
queue:
pattern: "^[a-z][a-z0-9.-]*$"
routing:
pattern: "^[a-z][a-z0-9.-]*$"
micronaut:
standard:
patterns:
- "src/main/{language}/**/*.{java,kt,groovy}"
- "src/test/{language}/**/*.{java,kt,groovy}"
structure:
main:
- "src/main/"
- "{language}/"
- "controller/" # HTTP控制器
- "api/" # API接口控制器
- "web/" # Web页面控制器
- "service/" # 业务服务
- "impl/" # 服务实现
- "repository/" # 数据访问
- "jpa/" # JPA实现
- "r2dbc/" # R2DBC实现
- "domain/" # 领域模型
- "entity/" # 实体类
- "dto/" # 数据传输对象
- "vo/" # 视图对象
- "config/" # 配置类
- "db/" # 数据库配置
- "security/" # 安全配置
- "cache/" # 缓存配置
- "client/" # 外部服务客户端
- "feign/" # Feign客户端
- "http/" # HTTP客户端
- "factory/" # 工厂类
- "util/" # 工具类
- "constant/" # 常量类
- "exception/" # 异常类
- "resources/"
- "application.yml" # 主配置文件
- "application-{env}.yml" # 环境配置
- "bootstrap.yml" # 引导配置
- "logback.xml" # 日志配置
- "i18n/" # 国际化资源
- "db/migration/" # 数据库迁移脚本
test:
- "src/test/"
- "{language}/"
- "controller/" # 控制器测试
- "service/" # 服务测试
- "repository/" # 数据访问测试
- "resources/"
- "application-test.yml" # 测试配置
- "data/" # 测试数据
reactive: # 响应式结构
patterns:
- "src/main/{language}/**/*.{java,kt,groovy}"
structure:
main:
- "src/main/{language}/"
- "handler/" # 请求处理器
- "router/" # 路由定���
- "service/" # 响应式服务
- "repository/" # 响应式存储
- "client/" # 响应式客户端
naming:
conventions:
controller:
pattern: "^[A-Z][a-zA-Z0-9]+Controller$"
examples:
- "UserController"
- "OrderController"
service:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
examples:
- "UserService"
- "OrderService"
repository:
pattern: "^[A-Z][a-zA-Z0-9]+Repository$"
examples:
- "UserRepository"
- "OrderRepository"
entity:
pattern: "^[A-Z][a-zA-Z0-9]+$"
examples:
- "User"
- "Order"
dto:
pattern: "^[A-Z][a-zA-Z0-9]+DTO$"
examples:
- "UserDTO"
- "OrderDTO"
dependencies:
core:
- "micronaut-runtime"
- "micronaut-http-server-netty"
- "micronaut-validation"
data:
- "micronaut-data-jdbc"
- "micronaut-data-r2dbc"
- "micronaut-jpa"
security:
- "micronaut-security"
- "micronaut-security-jwt"
cache:
- "micronaut-cache-caffeine"
- "micronaut-redis"
messaging:
- "micronaut-kafka"
- "micronaut-rabbitmq"
monitoring:
- "micronaut-micrometer-core"
- "micronaut-management"
configuration:
patterns:
- "src/main/resources/application.yml"
- "src/main/resources/application-*.yml"
structure:
application:
micronaut:
application:
name: string
server:
port: number
security:
enabled: boolean
token:
jwt:
enabled: boolean
netty:
worker:
threads: number
router:
static-resources:
enabled: boolean
metrics:
enabled: boolean
datasources:
default:
url: string
username: string
password: string
redis:
uri: string
kafka:
bootstrap:
servers: string
aot: # 提前编译配置
enabled: true
conventions:
- "使用GraalVM Native Image"
- "配置反射规则"
- "资源包含规则"
testing:
patterns:
- "src/test/{language}/**/*Test.{java,kt,groovy}"
- "src/test/{language}/**/*Spec.{java,kt,groovy}"
conventions:
- "使用@MicronautTest"
- "使用TestResources"
- "模拟外部服务"
- "数据库测试"
deployment:
docker:
patterns:
- "Dockerfile"
- "docker-compose.yml"
conventions:
- "多阶段构建"
- "基础镜像选择"
- "资源限制配置"
kubernetes:
patterns:
- "k8s/*.yml"
conventions:
- "部署配置"
- "服务配置"
- "资源配置"
monitoring:
metrics:
- "JVM指标"
- "HTTP指标"
- "数据库指标"
health:
- "应用健康检查"
- "依赖服务检查"
tracing:
- "请求追踪"
- "SQL追踪"
documentation:
patterns:
- "src/main/docs/**/*.md"
- "README.md"
- "API.md"
conventions:
- "API文档"
- "配置说明"
- "部署文档"
frontend:
web:
vue-app:
patterns:
- "src/components/**/*.vue"
- "src/pages/**/*.vue"
- "src/store/**/*.{js,ts}"
react-app:
patterns:
- "src/components/**/*.{jsx,tsx}"
- "src/pages/**/*.{jsx,tsx}"
- "src/store/**/*.{js,ts}"
angular:
patterns:
- "src/app/components/**/*.ts"
- "src/app/pages/**/*.ts"
- "src/app/services/**/*.ts"
svelte:
patterns:
- "src/components/**/*.svelte"
- "src/routes/**/*.svelte"
- "src/stores/**/*.{js,ts}"
nuxt:
patterns:
- "pages/**/*.vue"
- "components/**/*.vue"
- "layouts/**/*.vue"
- "middleware/**/*.{js,ts}"
- "plugins/**/*.{js,ts}"
- "composables/**/*.{js,ts}"
- "utils/**/*.{js,ts}"
- "server/**/*.{js,ts}"
- "assets/**/*.{css,scss,less}"
conventions:
- "页面使用index命名默认页"
- "组件使用PascalCase"
- "布局使用default作为默认"
- "API路由放在server/api目录"
- "使用auto-imports优化导入"
naming:
pages:
pattern: "^[a-z][a-z0-9-]*$"
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
composables:
pattern: "^use[A-Z][a-zA-Z0-9]+$"
next:
patterns:
- "app/**/*.{jsx,tsx}"
- "app/**/*.{js,ts}"
- "components/**/*.{jsx,tsx}"
- "lib/**/*.{js,ts}"
- "styles/**/*.{css,scss}"
- "public/**/*"
- "middleware.{js,ts}"
conventions:
- "使用App Router"
- "组件使用PascalCase"
- "API路由放在app/api目录"
- "使用Server Components"
- "遵循React Server Components约定"
naming:
pages:
pattern: "^(page|layout|loading|error|not-found)\\.(jsx|tsx)$"
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
hooks:
pattern: "^use[A-Z][a-zA-Z0-9]+$"
structure:
app:
- "layout.tsx"
- "page.tsx"
- "loading.tsx"
- "error.tsx"
- "not-found.tsx"
- "template.tsx"
- "default.tsx"
api:
- "route.ts"
analog:
patterns:
- "src/app/**/*.{ts,html}"
- "src/content/**/*.md"
- "src/routes/**/*.ts"
- "src/styles/**/*.{css,scss}"
- "src/lib/**/*.ts"
conventions:
- "使用独立组件"
- "使用Signal状态管理"
- "使用内容集合"
- "遵循Angular风格指南"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+Component$"
services:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
pipes:
pattern: "^[A-Z][a-zA-Z0-9]+Pipe$"
directives:
pattern: "^[A-Z][a-zA-Z0-9]+Directive$"
structure:
content:
- "blog"
- "docs"
- "pages"
routes:
- "+content"
- "+state"
- "+layout"
common:
seo:
patterns:
- "**/*head*.{jsx,tsx,vue}"
- "**/*meta*.{jsx,tsx,vue}"
conventions:
- "使用动态元数据"
- "优化Open Graph标签"
- "实现结构化数据"
performance:
conventions:
- "使用图片优化"
- "实现延迟加载"
- "优化字体加载"
- "使用流式渲染"
accessibility:
conventions:
- "使用ARIA属性"
- "确保键盘可访问"
- "提供替代文本"
- "使用语义化HTML"
internationalization:
patterns:
- "**/locales/**/*.{json,yaml}"
- "**/i18n/**/*.{js,ts}"
conventions:
- "使用命名空间"
- "支持复数形式"
- "处理日期格式"
- "处理数字格式"
state:
patterns:
- "**/store/**/*.{js,ts}"
- "**/states/**/*.{js,ts}"
conventions:
- "使用不可变状态"
- "实现状态持久化"
- "处理异步状态"
- "实现状态重置"
api:
patterns:
- "**/api/**/*.{js,ts}"
- "**/services/**/*.{js,ts}"
conventions:
- "使用类型安全的API调用"
- "实现请求缓存"
- "处理错误边界"
- "实现请求重试"
testing:
patterns:
- "**/*.test.{js,ts}"
- "**/*.spec.{js,ts}"
- "**/tests/**/*.{js,ts}"
- "**/cypress/**/*.{js,ts}"
- "**/playwright/**/*.{js,ts}"
conventions:
- "使用组件测试"
- "实现E2E测试"
- "测试错误场景"
- "测试性能指标"
styling:
patterns:
- "**/*.module.{css,scss}"
- "**/styles/**/*.{css,scss}"
- "**/*.styled.{js,ts}"
conventions:
- "使用CSS Modules"
- "实现响应式设计"
- "使用CSS变量"
- "实现主题切换"
desktop:
electron:
base: # 基础结构
patterns:
- "src-electron/**/*.rs"
- "src-electron/electron.conf.json"
structure:
src-electron:
- "src/"
- "main.rs"
- "app.rs"
- "menu.rs"
- "cmd.rs"
- "error.rs"
- "services/"
- "mod.rs"
- "storage.rs"
- "window.rs"
- "utils/"
- "mod.rs"
- "config.rs"
- "Cargo.toml"
- "electron.conf.json"
- "build.rs"
naming:
files:
pattern: "^[a-z][a-z0-9_]*\\.rs$"
modules:
pattern: "^[a-z][a-z0-9_]*$"
structs:
pattern: "^[A-Z][a-zA-Z0-9]+$"
conventions:
core:
- "使用命令模式通信"
- "状态管理集中化"
- "错误处理统一化"
- "窗口管理模块化"
security:
- "启用CSP"
- "限制文件系统访问"
- "配置允许的API"
vue: # Vue项目结构
patterns:
- "src/**/*.vue"
- "src/**/*.{js,ts}"
structure:
src:
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "views/"
- "main/"
- "settings/"
- "router/"
- "index.ts"
- "routes/"
- "store/"
- "modules/"
- "index.ts"
- "composables/"
- "useTauri.ts"
- "assets/"
- "images/"
- "styles/"
- "utils/"
- "types/"
- "App.vue"
- "main.ts"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
pages:
pattern: "^[A-Z][a-zA-Z0-9]+View$"
stores:
pattern: "^use[A-Z][a-zA-Z0-9]+Store$"
conventions:
- "使用组合式API"
- "使用TypeScript"
- "使用Pinia状态管理"
- "集成Tauri API"
react: # React项目结构
patterns:
- "src/**/*.{jsx,tsx}"
- "src/**/*.{js,ts}"
structure:
src:
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "pages/"
- "main/"
- "settings/"
- "routes/"
- "index.tsx"
- "AppRoutes.tsx"
- "store/"
- "slices/"
- "hooks/"
- "hooks/"
- "useTauri.ts"
- "assets/"
- "images/"
- "styles/"
- "utils/"
- "types/"
- "App.tsx"
- "main.tsx"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
pages:
pattern: "^[A-Z][a-zA-Z0-9]+Page$"
hooks:
pattern: "^use[A-Z][a-zA-Z0-9]+$"
conventions:
- "使用函数组件"
- "使用TypeScript"
- "使用Redux Toolkit"
- "集成Tauri API"
svelte: # Svelte项目结构
patterns:
- "src/**/*.svelte"
- "src/**/*.{js,ts}"
structure:
src:
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "routes/"
- "+page.svelte"
- "+layout.svelte"
- "stores/"
- "lib/"
- "tauri/"
- "assets/"
- "images/"
- "styles/"
- "utils/"
- "types/"
- "app.html"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
stores:
pattern: "^[a-z][a-zA-Z0-9]+Store$"
conventions:
- "使用TypeScript"
- "使用SvelteKit"
- "集成Tauri API"
angular: # Angular项目结构
patterns:
- "src/renderer/**/*.ts"
- "src/renderer/**/*.html"
- "src/renderer/**/*.scss"
structure:
renderer:
- "src/"
- "app/"
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "pages/"
- "main/"
- "settings/"
- "services/"
- "electron/"
- "electron.service.ts"
- "window/"
- "ipc/"
- "core/"
- "guards/"
- "interceptors/"
- "models/"
- "shared/"
- "pipes/"
- "directives/"
- "store/"
- "actions/"
- "effects/"
- "reducers/"
- "selectors/"
- "assets/"
- "images/"
- "styles/"
- "i18n/"
- "environments/"
- "styles/"
- "index.html"
- "main.ts"
- "polyfills.ts"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+Component$"
services:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
pages:
pattern: "^[A-Z][a-zA-Z0-9]+PageComponent$"
guards:
pattern: "^[A-Z][a-zA-Z0-9]+Guard$"
conventions:
- "使用TypeScript"
- "使用SCSS样式"
- "使用NgRx状态管理"
- "遵循Angular风格指南"
- "集成Electron IPC"
tauri:
base: # Tauri基础结构
patterns:
- "src-tauri/**/*.rs"
- "src-tauri/tauri.conf.json"
structure:
src-tauri:
- "src/"
- "main.rs"
- "app.rs"
- "menu.rs"
- "cmd.rs"
- "error.rs"
- "services/"
- "mod.rs"
- "storage.rs"
- "window.rs"
- "utils/"
- "mod.rs"
- "config.rs"
- "Cargo.toml"
- "tauri.conf.json"
- "build.rs"
naming:
files:
pattern: "^[a-z][a-z0-9_]*\\.rs$"
modules:
pattern: "^[a-z][a-z0-9_]*$"
structs:
pattern: "^[A-Z][a-zA-Z0-9]+$"
conventions:
core:
- "使用命令模式通信"
- "状态管理集中化"
- "错误处理统一化"
- "窗口管理模块化"
security:
- "启用CSP"
- "限制文件系统访问"
- "配置允许的API"
vue: # Vue项目结构
patterns:
- "src/**/*.vue"
- "src/**/*.{js,ts}"
structure:
src:
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "views/"
- "main/"
- "settings/"
- "router/"
- "index.ts"
- "routes/"
- "store/"
- "modules/"
- "index.ts"
- "composables/"
- "useTauri.ts"
- "assets/"
- "images/"
- "styles/"
- "utils/"
- "types/"
- "App.vue"
- "main.ts"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
pages:
pattern: "^[A-Z][a-zA-Z0-9]+View$"
stores:
pattern: "^use[A-Z][a-zA-Z0-9]+Store$"
conventions:
- "使用组合式API"
- "使用TypeScript"
- "使用Pinia状态管理"
- "集成Tauri API"
react: # React项目结构
patterns:
- "src/**/*.{jsx,tsx}"
- "src/**/*.{js,ts}"
structure:
src:
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "pages/"
- "main/"
- "settings/"
- "routes/"
- "index.tsx"
- "AppRoutes.tsx"
- "store/"
- "slices/"
- "hooks/"
- "hooks/"
- "useTauri.ts"
- "assets/"
- "images/"
- "styles/"
- "utils/"
- "types/"
- "App.tsx"
- "main.tsx"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
pages:
pattern: "^[A-Z][a-zA-Z0-9]+Page$"
hooks:
pattern: "^use[A-Z][a-zA-Z0-9]+$"
conventions:
- "使用函数组件"
- "使用TypeScript"
- "使用Redux Toolkit"
- "集成Tauri API"
svelte: # Svelte项目结构
patterns:
- "src/**/*.svelte"
- "src/**/*.{js,ts}"
structure:
src:
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "routes/"
- "+page.svelte"
- "+layout.svelte"
- "stores/"
- "lib/"
- "tauri/"
- "assets/"
- "images/"
- "styles/"
- "utils/"
- "types/"
- "app.html"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
stores:
pattern: "^[a-z][a-zA-Z0-9]+Store$"
conventions:
- "使用TypeScript"
- "使用SvelteKit"
- "集成Tauri API"
angular: # Angular项目结构
patterns:
- "src/**/*.ts"
- "src/**/*.html"
- "src/**/*.scss"
structure:
src:
- "app/"
- "components/"
- "common/"
- "layout/"
- "widgets/"
- "pages/"
- "main/"
- "settings/"
- "services/"
- "tauri/"
- "tauri.service.ts"
- "window/"
- "commands/"
- "core/"
- "guards/"
- "interceptors/"
- "models/"
- "shared/"
- "pipes/"
- "directives/"
- "store/"
- "actions/"
- "effects/"
- "reducers/"
- "selectors/"
- "assets/"
- "images/"
- "styles/"
- "i18n/"
- "environments/"
- "styles/"
- "index.html"
- "main.ts"
- "polyfills.ts"
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+Component$"
services:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
pages:
pattern: "^[A-Z][a-zA-Z0-9]+PageComponent$"
guards:
pattern: "^[A-Z][a-zA-Z0-9]+Guard$"
conventions:
- "使用TypeScript"
- "使用SCSS样式"
- "使用NgRx状态管理"
- "遵循Angular风格指南"
- "集成Tauri命令API"
common: # 通用配置
config:
patterns:
- "src-tauri/tauri.conf.json"
- "vite.config.ts"
- ".cargo/config.toml"
conventions:
- "使用统一配置文件"
- "环境变量管理"
- "构建优化配置"
commands:
naming:
pattern: "^[a-z][a-z0-9_]*$"
structure:
- "src-tauri/src/commands/"
- "app.rs"
- "fs.rs"
- "window.rs"
conventions:
- "命令分类管理"
- "错误处理统一"
- "参数类型安全"
testing:
patterns:
- "src-tauri/tests/**/*.rs"
- "src/**/*.test.{js,ts,jsx,tsx}"
- "src/**/*.spec.{js,ts,jsx,tsx}"
conventions:
- "Rust单元测试"
- "前端组件测试"
- "E2E测试集成"
packaging:
patterns:
- "src-tauri/tauri.conf.json"
- "package.json"
conventions:
- "版本号同步"
- "资源打包优化"
- "多平台构建配置"
development:
patterns:
- ".vscode/"
- "scripts/"
conventions:
- "开发环境配置"
- "调试工具集成"
- "热重载支持"
assets:
structure:
- "src-tauri/icons/"
- "public/"
- "images/"
- "fonts/"
- "src/assets/"
- "images/"
- "styles/"
- "icons/"
frontend-common:
naming:
components:
pattern: "^[A-Z][a-zA-Z0-9]+$"
pages:
pattern: "^[A-Z][a-zA-Z0-9]+Page$"
hooks:
pattern: "^use[A-Z][a-zA-Z0-9]+$"
conventions:
- "组件目录结构统一"
- "状态管理规范"
- "由管理规范"
- "Tauri API集成规范"
database:
sql:
patterns:
- "src/main/resources/db/migration/*.sql"
- "src/main/resources/db/changelog/*.{sql,xml,yaml,json}"
- "src/main/resources/schema/*.sql"
naming:
table:
pattern: "^[a-z][a-z0-9_]*$"
prefix: "t_"
maxLength: 64
column:
pattern: "^[a-z][a-z0-9_]*$"
prefix: "c_"
maxLength: 64
index:
pattern: "^idx_[a-z0-9_]+$"
maxLength: 64
foreignKey:
pattern: "^fk_[a-z0-9_]+$"
maxLength: 64
conventions:
- "使用小写字母和下划线"
- "表名使用单数形式"
- "主键命名为 id"
- "外键命名为 {table_name}_id"
- "创建时间字段命名为 created_at"
- "更新时间字段命名为 updated_at"
- "删除标记字段命名为 deleted"
- "版本号字段命名为 version"
nosql:
patterns:
- "src/main/resources/mongodb/*.json"
- "src/main/resources/redis/*.conf"
- "src/main/resources/elasticsearch/*.json"
naming:
collection:
pattern: "^[a-z][a-z0-9_]*$"
maxLength: 64
key:
pattern: "^[a-z][a-z0-9:_]*$"
maxLength: 128
conventions:
- "MongoDB集合名使用复数形式"
- "Redis键使用号分隔"
- "ES索引使用小写字母"
build:
tools:
maven:
patterns:
- "pom.xml"
- "mvnw"
- ".mvn/**"
conventions:
- "使用属性管理版本"
- "使用dependencyManagement管理依赖"
- "使用pluginManagement管理插件"
gradle:
patterns:
- "build.gradle"
- "build.gradle.kts"
- "settings.gradle"
- "settings.gradle.kts"
- "gradlew"
- ".gradle/**"
conventions:
- "使用buildSrc管理依赖"
- "使用复合构建"
- "用版本目录"
sbt:
patterns:
- "build.sbt"
- "project/**"
conventions:
- "使用多项目构建"
- "使用插件管理"
dependencies:
maven:
scopes:
- "compile"
- "implementation"
- "testImplementation"
- "api"
- "runtime"
- "provided"
conventions:
- "使用BOM管理��本"
- "排除传递依赖使用exclusions"
gradle:
configurations:
- "implementation"
- "api"
- "testImplementation"
- "compileOnly"
- "runtimeOnly"
conventions:
- "使用platform管理版本"
- "用exclude排除依赖"
sbt:
scopes:
- "compile"
- "test"
- "provided"
conventions:
- "使用%%区分Scala版本"
- "使用exclusions排除依"
quality:
checkstyle:
patterns:
- "config/checkstyle/*.xml"
rules:
- "命名规范"
- "代码格式"
- "代码复杂度"
spotbugs:
patterns:
- "config/spotbugs/*.xml"
rules:
- "空指针检查"
- "并发问题检查"
- "安全漏检查"
pmd:
patterns:
- "config/pmd/*.xml"
rules:
- "代码规范"
- "最佳实践"
- "性能优化"
docs:
patterns:
- "docs/**/*.md"
- "README.md"
- "CHANGELOG.md"
- "API.md"
conventions:
- "使用Markdown格式"
- "包含示例代码"
- "包含API文档"
- "包含变更日志"
config:
patterns:
- "src/main/resources/application.{yml,properties}"
- "src/main/resources/application-*.{yml,properties}"
- "src/main/resources/bootstrap.{yml,properties}"
- "src/main/resources/bootstrap-*.{yml,properties}"
- ".env"
- ".env.*"
- "config/**/*"
conventions:
- "使用YAML格式"
- "使用profile区分环境"
- "敏感信息使用密文"
- "配置项使用小写字母和横线"
security:
patterns:
- "src/main/resources/**/*.keystore"
- "src/main/resources/**/*.truststore"
- "src/main/resources/**/*.jks"
- "src/main/resources/**/*.p12"
conventions:
- "密钥文件不提交到版本控制"
- "密码使用环境变量"
- "证书使用密文存储"
authentication:
conventions:
- "使用JWT令牌"
- "实现刷新机制"
- "加密敏感信息"
patterns:
- "**/security/**/*.{java,kt}"
authorization:
conventions:
- "基于角色控制"
- "最小权限原则"
- "审计关键操作"
patterns:
- "**/security/**/*.{java,kt}"
test:
unit:
naming:
pattern: "^.*Test$|^.*Spec$"
conventions:
- "使用given-when-then格式"
- "每个测试只验证一个行为"
- "避免测试私有方法"
patterns:
- "**/test/**/*Test.{java,kt}"
- "**/test/**/*Spec.{groovy,scala}"
integration:
naming:
pattern: "^.*IT$|^.*IntegrationTest$"
conventions:
- "使用测试器"
- "清理测试数据"
- "避免测试依赖"
patterns:
- "**/test/**/*IT.{java,kt}"
- "**/test/**/*IntegrationTest.{java,kt}"
e2e:
naming:
pattern: "^.*E2E$"
conventions:
- "使用页面对象模式"
- "处理异步操作"
- "验证关键流程"
patterns:
- "**/e2e/**/*.{js,ts}"
cicd:
github:
workflows:
patterns:
- ".github/workflows/*.yml"
conventions:
- "使用语义化版本"
- "使用多段构建"
- "缓存依赖项"
gitlab:
patterns:
- ".gitlab-ci.yml"
conventions:
- "使用阶段划分"
- "使用依赖缓存"
- "使用变量替换"
jenkins:
patterns:
- "Jenkinsfile"
conventions:
- "使用声明式流水线"
- "使用共享库"
- "使用参数化构建"
monitoring:
metrics:
patterns:
- "**/metrics/**"
conventions:
- "使用有意义的指标名"
- "添加适当的标签"
- "记录关键业务指标"
logging:
patterns:
- "**/logs/**"
conventions:
- "使用结构化日志"
- "包含追踪ID"
- "分级记录日志"
tracing:
patterns:
- "**/trace/**"
conventions:
- "记录关键操作"
- "添加业务标签"
- "控制采样"
nodejs:
common: # Node.js通用配置
patterns:
- "src/**/*.{js,ts}"
- "test/**/*.{js,ts}"
structure:
main:
- "src/"
- "controllers/" # 控制器层
- "api/" # API控制器
- "web/" # Web控制器
- "services/" # 业务服务层
- "impl/" # 服务实现
- "models/" # 数据模型
- "entities/" # 实体
- "dtos/" # 数据传输对象
- "repositories/" # 数据访问层
- "middlewares/" # 中间件
- "auth/" # 认证中间件
- "validation/" # 验证中间件
- "error/" # 错误处理
- "config/" # 配置
- "database.ts"
- "redis.ts"
- "queue.ts"
- "utils/" # 工具
- "types/" # 类型定义
- "constants/" # 常量定义
- "test/"
- "unit/" # 单元测试
- "integration/" # 集成测试
- "e2e/" # E2E测试
- "config/"
- "default.json"
- "{env}.json"
express:
testing:
<<: *common_test_deploy_monitor_doc
dependencies:
- "jest"
- "supertest"
- "ts-jest"
ext: "ts"
nest:
testing:
<<: *common_test_deploy_monitor_doc
dependencies:
- "@nestjs/testing"
- "jest"
- "supertest"
ext: "ts"
golang:
gin:
testing:
<<: *common_test_deploy_monitor_doc
dependencies:
- "testing"
- "testify"
- "gomock"
ext: "go"
echo:
testing:
<<: *common_test_deploy_monitor_doc
dependencies:
- "testing"
- "testify"
- "gomock"
ext: "go"
python:
fastapi:
testing:
<<: *common_test_deploy_monitor_doc
dependencies:
- "pytest"
- "pytest-asyncio"
- "httpx"
ext: "py"
django:
testing:
<<: *common_test_deploy_monitor_doc
dependencies:
- "pytest"
- "pytest-django"
- "factory-boy"
ext: "py"
flask:
naming:
conventions:
controller:
pattern: "^[A-Z][a-zA-Z0-9]+Controller$"
examples:
- "UserController"
- "OrderController"
service:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
examples:
- "UserService"
- "OrderService"
repository:
pattern: "^[A-Z][a-zA-Z0-9]+Repository$"
examples:
- "UserRepository"
- "OrderRepository"
model:
pattern: "^[A-Z][a-zA-Z0-9]+$"
examples:
- "User"
- "Order"
dto:
pattern: "^[A-Z][a-zA-Z0-9]+DTO$"
examples:
- "UserDTO"
- "OrderDTO"
dependencies:
core: # 核心依赖
- "flask"
- "flask-restful"
- "flask-cors"
- "flask-marshmallow"
data: # 数据访问
- "flask-sqlalchemy"
- "flask-migrate"
- "pymongo"
security: # 安全框架
- "flask-jwt-extended"
- "flask-security"
- "flask-bcrypt"
cache: # 缓存支持
- "flask-caching"
- "redis"
monitoring: # 监控工具
- "flask-prometheus-metrics"
- "structlog"
tornado:
naming:
conventions:
controller:
pattern: "^[A-Z][a-zA-Z0-9]+Handler$"
examples:
- "UserHandler"
- "OrderHandler"
service:
pattern: "^[A-Z][a-zA-Z0-9]+Service$"
examples:
- "UserService"
- "OrderService"
repository:
pattern: "^[A-Z][a-zA-Z0-9]+Repository$"
examples:
- "UserRepository"
- "OrderRepository"
model:
pattern: "^[A-Z][a-zA-Z0-9]+$"
examples:
- "User"
- "Order"
dto:
pattern: "^[A-Z][a-zA-Z0-9]+DTO$"
examples:
- "UserDTO"
- "OrderDTO"
dependencies:
core: # 核心依赖
- "tornado"
- "tornado-cors"
- "marshmallow"
data: # 数据访问
- "sqlalchemy"
- "alembic"
- "motor"
security: # 安全框架
- "python-jose"
- "passlib"
- "bcrypt"
cache: # 缓存支持
- "aioredis"
- "cachetools"
monitoring: # 监控工具
- "prometheus-client"
- "structlog"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。