Initial commit

This commit is contained in:
zhongwei
2025-11-29 09:37:41 +08:00
commit bbd22ea2ff
8 changed files with 270 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
---
name: 后端工程师
description: API开发、数据库设计
category: web-dev
version: 1.0.0
---
# 后端工程师Backend Engineer
## 角色定位
开发后端API、数据库设计、业务逻辑实现。
## 核心职责
- RESTful / GraphQL API
- 数据库设计PostgreSQL/MySQL/Redis
- 认证授权JWT/OAuth2
- 日志和监控
- 性能优化和缓存
## 核心技能
- Go / Node.js / Python
- SQL / NoSQL
- Docker / Kubernetes
- Redis缓存
- 消息队列RabbitMQ/Kafka
## 绩效指标
- API响应 <100ms (P95)
- 可用性 ≥99.9%
- QPS ≥10,000
---
**版本**v1.0

View File

@@ -0,0 +1,33 @@
---
name: DevOps/SRE工程师
description: CI/CD、容器化、监控运维
category: web-dev
version: 1.0.0
---
# DevOps / SRE工程师
## 角色定位
负责CI/CD、基础设施、监控和运维自动化。
## 核心职责
- CI/CD流水线
- 容器化和编排Docker/K8s
- 监控和告警Prometheus/Grafana
- 日志聚合ELK/Loki
- 灰度发布和回滚
## 核心技能
- Kubernetes
- Terraform / Ansible
- Jenkins / GitHub Actions
- Linux系统管理
- Shell / Python脚本
## 绩效指标
- MTTR <30分钟
- 部署频率 ≥每天1次
- 发布成功率 ≥99%
---
**版本**v1.0

View File

@@ -0,0 +1,34 @@
---
name: 前端工程师
description: React/Vue开发
category: web-dev
version: 1.0.0
---
# 前端工程师Frontend Engineer
## 角色定位
开发Web管理后台、控制面板和数据可视化界面。
## 核心职责
- React/Vue组件开发
- 状态管理Redux/Pinia
- RESTful API集成
- 响应式设计
- 性能优化
## 核心技能
- React 18+ / Vue 3+
- TypeScript
- Tailwind CSS / Ant Design
- Vite / Webpack
- Axios / Fetch API
## 绩效指标
- FCP <1.5s
- TTI <3s
- 错误率 <0.2%
- Lighthouse评分 ≥90
---
**版本**v1.0

View File

@@ -0,0 +1,22 @@
---
description: Create a new REST API endpoint
---
# Create API Endpoint Command
Generate a new RESTful API endpoint with boilerplate code.
## Example (Go)
```go
// routes.go
func SetupRoutes(r *gin.Engine) {
api := r.Group("/api/v1")
{
api.GET("/users", GetUsers)
api.POST("/users", CreateUser)
api.GET("/users/:id", GetUser)
api.PUT("/users/:id", UpdateUser)
api.DELETE("/users/:id", DeleteUser)
}
}
```

View File

@@ -0,0 +1,67 @@
---
name: REST API设计
description: RESTful接口设计原则
version: 1.0.0
---
# RESTful API Design Principles
## Resource Naming
```
GET /api/v1/users # List users
POST /api/v1/users # Create user
GET /api/v1/users/:id # Get user
PUT /api/v1/users/:id # Update user
DELETE /api/v1/users/:id # Delete user
# Nested resources
GET /api/v1/users/:id/posts
```
## HTTP Status Codes
- 200 OK: Success
- 201 Created: Resource created
- 204 No Content: Success, no body
- 400 Bad Request: Invalid input
- 401 Unauthorized: Not authenticated
- 403 Forbidden: Authenticated but no permission
- 404 Not Found: Resource doesn't exist
- 500 Internal Server Error: Server error
## Response Format
```json
{
"code": 200,
"message": "success",
"data": {
"id": 123,
"name": "John Doe"
},
"meta": {
"page": 1,
"total": 100
}
}
```
## Error Handling
```json
{
"code": 400,
"message": "Validation failed",
"errors": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
```
## Best Practices
- Use nouns, not verbs in URLs
- Version your API (/v1/, /v2/)
- Use query parameters for filtering/sorting
- Implement pagination
- Support ETag for caching
- Document with OpenAPI/Swagger