mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-08 18:33:28 +08:00
docs(zh-CN): translate code block(plain text) (#753)
Co-authored-by: neo <neo.dowithless@gmail.com>
This commit is contained in:
@@ -64,7 +64,7 @@ gog calendar events --today --all --max 30
|
||||
```
|
||||
|
||||
```text
|
||||
# Slack (via MCP)
|
||||
# Slack(通过 MCP)
|
||||
conversations_search_messages(search_query: "YOUR_NAME", filter_date_during: "Today")
|
||||
channels_list(channel_types: "im,mpim") → conversations_history(limit: "4h")
|
||||
```
|
||||
@@ -109,26 +109,26 @@ channels_list(channel_types: "im,mpim") → conversations_history(limit: "4h")
|
||||
## 简报输出格式
|
||||
|
||||
```
|
||||
# Today's Briefing — [Date]
|
||||
# 今日简报 — [日期]
|
||||
|
||||
## Schedule (N)
|
||||
| Time | Event | Location | Prep? |
|
||||
## 日程安排 (N)
|
||||
| 时间 | 事项 | 地点 | 准备? |
|
||||
|------|-------|----------|-------|
|
||||
|
||||
## Email — Skipped (N) → auto-archived
|
||||
## Email — Action Required (N)
|
||||
### 1. Sender <email>
|
||||
**Subject**: ...
|
||||
**Summary**: ...
|
||||
**Draft reply**: ...
|
||||
→ [Send] [Edit] [Skip]
|
||||
## 邮件 — 已跳过 (N) → 自动归档
|
||||
## 邮件 — 需处理 (N)
|
||||
### 1. 发件人 <邮箱>
|
||||
**主题**: ...
|
||||
**摘要**: ...
|
||||
**回复草稿**: ...
|
||||
→ [发送] [编辑] [跳过]
|
||||
|
||||
## Slack — Action Required (N)
|
||||
## LINE — Action Required (N)
|
||||
## Slack — 需处理 (N)
|
||||
## LINE — 需处理 (N)
|
||||
|
||||
## Triage Queue
|
||||
- Stale pending responses: N
|
||||
- Overdue tasks: N
|
||||
## 待处理队列
|
||||
- 待回复超时事项: N
|
||||
- 逾期任务: N
|
||||
```
|
||||
|
||||
## 关键设计原则
|
||||
|
||||
@@ -178,13 +178,13 @@ const usersWithPosts = await db.query(`
|
||||
按严重程度组织发现的问题。对于每个问题:
|
||||
|
||||
```
|
||||
[CRITICAL] Hardcoded API key in source
|
||||
File: src/api/client.ts:42
|
||||
Issue: API key "sk-abc..." exposed in source code. This will be committed to git history.
|
||||
Fix: Move to environment variable and add to .gitignore/.env.example
|
||||
[严重] 源代码中存在硬编码的API密钥
|
||||
文件: src/api/client.ts:42
|
||||
问题: API密钥 "sk-abc..." 在源代码中暴露。这将提交到git历史记录中。
|
||||
修复: 移至环境变量并添加到 .gitignore/.env.example
|
||||
|
||||
const apiKey = "sk-abc123"; // BAD
|
||||
const apiKey = process.env.API_KEY; // GOOD
|
||||
const apiKey = "sk-abc123"; // 错误做法
|
||||
const apiKey = process.env.API_KEY; // 正确做法
|
||||
```
|
||||
|
||||
### 摘要格式
|
||||
@@ -192,16 +192,16 @@ Fix: Move to environment variable and add to .gitignore/.env.example
|
||||
每次审查结束时使用:
|
||||
|
||||
```
|
||||
## Review Summary
|
||||
## 审查摘要
|
||||
|
||||
| Severity | Count | Status |
|
||||
| 严重程度 | 数量 | 状态 |
|
||||
|----------|-------|--------|
|
||||
| CRITICAL | 0 | pass |
|
||||
| HIGH | 2 | warn |
|
||||
| MEDIUM | 3 | info |
|
||||
| LOW | 1 | note |
|
||||
| CRITICAL | 0 | 通过 |
|
||||
| HIGH | 2 | 警告 |
|
||||
| MEDIUM | 3 | 信息 |
|
||||
| LOW | 1 | 备注 |
|
||||
|
||||
Verdict: WARNING — 2 HIGH issues should be resolved before merge.
|
||||
裁决:警告 — 2 个 HIGH 级别问题应在合并前解决。
|
||||
```
|
||||
|
||||
## 批准标准
|
||||
|
||||
@@ -31,11 +31,11 @@ cppcheck --enable=all src/ 2>/dev/null || echo "cppcheck not available"
|
||||
## 解决工作流程
|
||||
|
||||
```text
|
||||
1. cmake --build build -> Parse error message
|
||||
2. Read affected file -> Understand context
|
||||
3. Apply minimal fix -> Only what's needed
|
||||
4. cmake --build build -> Verify fix
|
||||
5. ctest --test-dir build -> Ensure nothing broke
|
||||
1. cmake --build build -> 解析错误信息
|
||||
2. 读取受影响的文件 -> 理解上下文
|
||||
3. 应用最小修复 -> 仅修复必需部分
|
||||
4. cmake --build build -> 验证修复
|
||||
5. ctest --test-dir build -> 确保未破坏其他功能
|
||||
```
|
||||
|
||||
## 常见修复模式
|
||||
@@ -80,10 +80,10 @@ cmake --build build --clean-first
|
||||
## 输出格式
|
||||
|
||||
```text
|
||||
[FIXED] src/handler/user.cpp:42
|
||||
Error: undefined reference to `UserService::create`
|
||||
Fix: Added missing method implementation in user_service.cpp
|
||||
Remaining errors: 3
|
||||
[已修复] src/handler/user.cpp:42
|
||||
错误:未定义的引用 `UserService::create`
|
||||
修复:在 user_service.cpp 中添加了缺失的方法实现
|
||||
剩余错误:3
|
||||
```
|
||||
|
||||
最终:`Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list`
|
||||
|
||||
@@ -44,12 +44,12 @@ npx jsdoc2md src/**/*.ts # Extract JSDoc
|
||||
|
||||
```
|
||||
docs/CODEMAPS/
|
||||
├── INDEX.md # Overview of all areas
|
||||
├── frontend.md # Frontend structure
|
||||
├── backend.md # Backend/API structure
|
||||
├── database.md # Database schema
|
||||
├── integrations.md # External services
|
||||
└── workers.md # Background jobs
|
||||
├── INDEX.md # 所有区域概览
|
||||
├── frontend.md # 前端结构
|
||||
├── backend.md # 后端/API 结构
|
||||
├── database.md # 数据库模式
|
||||
├── integrations.md # 外部服务
|
||||
└── workers.md # 后台任务
|
||||
```
|
||||
|
||||
### 4. 代码映射格式
|
||||
|
||||
@@ -214,15 +214,15 @@ model: sonnet
|
||||
## 输出格式
|
||||
|
||||
```
|
||||
[CRITICAL] Domain layer imports Flutter framework
|
||||
File: packages/domain/lib/src/usecases/user_usecase.dart:3
|
||||
Issue: `import 'package:flutter/material.dart'` — domain must be pure Dart.
|
||||
Fix: Move widget-dependent logic to presentation layer.
|
||||
[CRITICAL] 领域层导入了 Flutter 框架
|
||||
文件: packages/domain/lib/src/usecases/user_usecase.dart:3
|
||||
问题: `import 'package:flutter/material.dart'` — 领域层必须是纯 Dart。
|
||||
修复: 将依赖于 widget 的逻辑移至表示层。
|
||||
|
||||
[HIGH] State consumer wraps entire screen
|
||||
File: lib/features/cart/presentation/cart_page.dart:42
|
||||
Issue: Consumer rebuilds entire page on every state change.
|
||||
Fix: Narrow scope to the subtree that depends on changed state, or use a selector.
|
||||
[HIGH] 状态消费者包裹了整个屏幕
|
||||
文件: lib/features/cart/presentation/cart_page.dart:42
|
||||
问题: 每次状态变化时,Consumer 都会重建整个页面。
|
||||
修复: 将范围缩小到依赖于已更改状态的子树,或使用选择器。
|
||||
```
|
||||
|
||||
## 总结格式
|
||||
@@ -230,16 +230,16 @@ Fix: Narrow scope to the subtree that depends on changed state, or use a selecto
|
||||
每次评审结束时附上:
|
||||
|
||||
```
|
||||
## Review Summary
|
||||
## 审查摘要
|
||||
|
||||
| Severity | Count | Status |
|
||||
|----------|-------|--------|
|
||||
| CRITICAL | 0 | pass |
|
||||
| HIGH | 1 | block |
|
||||
| MEDIUM | 2 | info |
|
||||
| LOW | 0 | note |
|
||||
| 严重性 | 数量 | 状态 |
|
||||
|--------|------|----------|
|
||||
| 严重 | 0 | 通过 |
|
||||
| 高 | 1 | 阻塞 |
|
||||
| 中 | 2 | 信息提示 |
|
||||
| 低 | 0 | 备注 |
|
||||
|
||||
Verdict: BLOCK — HIGH issues must be fixed before merge.
|
||||
裁决:阻塞 — 必须修复高严重性问题后方可合并。
|
||||
```
|
||||
|
||||
## 批准标准
|
||||
|
||||
@@ -33,12 +33,12 @@ go mod tidy -v
|
||||
## 解决工作流
|
||||
|
||||
```text
|
||||
1. go build ./... -> Parse error message
|
||||
2. Read affected file -> Understand context
|
||||
3. Apply minimal fix -> Only what's needed
|
||||
4. go build ./... -> Verify fix
|
||||
5. go vet ./... -> Check for warnings
|
||||
6. go test ./... -> Ensure nothing broke
|
||||
1. go build ./... -> 解析错误信息
|
||||
2. 读取受影响文件 -> 理解上下文
|
||||
3. 应用最小化修复 -> 仅修复必要部分
|
||||
4. go build ./... -> 验证修复
|
||||
5. go vet ./... -> 检查警告
|
||||
6. go test ./... -> 确保未破坏原有功能
|
||||
```
|
||||
|
||||
## 常见修复模式
|
||||
@@ -84,10 +84,10 @@ go clean -modcache && go mod download # Fix checksum issues
|
||||
## 输出格式
|
||||
|
||||
```text
|
||||
[FIXED] internal/handler/user.go:42
|
||||
Error: undefined: UserService
|
||||
Fix: Added import "project/internal/service"
|
||||
Remaining errors: 3
|
||||
[已修复] internal/handler/user.go:42
|
||||
错误:未定义:UserService
|
||||
修复:添加了导入 "project/internal/service"
|
||||
剩余错误:3
|
||||
```
|
||||
|
||||
最终:`Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list`
|
||||
|
||||
@@ -36,11 +36,11 @@ model: sonnet
|
||||
## 解决工作流
|
||||
|
||||
```text
|
||||
1. ./mvnw compile OR ./gradlew build -> Parse error message
|
||||
2. Read affected file -> Understand context
|
||||
3. Apply minimal fix -> Only what's needed
|
||||
4. ./mvnw compile OR ./gradlew build -> Verify fix
|
||||
5. ./mvnw test OR ./gradlew test -> Ensure nothing broke
|
||||
1. ./mvnw compile 或 ./gradlew build -> 解析错误信息
|
||||
2. 读取受影响的文件 -> 理解上下文
|
||||
3. 应用最小修复 -> 仅处理必需项
|
||||
4. ./mvnw compile 或 ./gradlew build -> 验证修复
|
||||
5. ./mvnw test 或 ./gradlew test -> 确保未破坏其他功能
|
||||
```
|
||||
|
||||
## 常见修复模式
|
||||
@@ -143,10 +143,10 @@ grep -A5 "annotationProcessorPaths\|annotationProcessor" pom.xml build.gradle
|
||||
## 输出格式
|
||||
|
||||
```text
|
||||
[FIXED] src/main/java/com/example/service/PaymentService.java:87
|
||||
Error: cannot find symbol — symbol: class IdempotencyKey
|
||||
Fix: Added import com.example.domain.IdempotencyKey
|
||||
Remaining errors: 1
|
||||
[已修复] src/main/java/com/example/service/PaymentService.java:87
|
||||
错误: 找不到符号 — 符号: 类 IdempotencyKey
|
||||
修复: 添加了 import com.example.domain.IdempotencyKey
|
||||
剩余错误: 1
|
||||
```
|
||||
|
||||
最终:`Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list`
|
||||
|
||||
@@ -31,11 +31,11 @@ model: sonnet
|
||||
## 解决工作流
|
||||
|
||||
```text
|
||||
1. ./gradlew build -> Parse error message
|
||||
2. Read affected file -> Understand context
|
||||
3. Apply minimal fix -> Only what's needed
|
||||
4. ./gradlew build -> Verify fix
|
||||
5. ./gradlew test -> Ensure nothing broke
|
||||
1. ./gradlew build -> 解析错误信息
|
||||
2. 读取受影响的文件 -> 理解上下文
|
||||
3. 应用最小修复 -> 仅解决必要问题
|
||||
4. ./gradlew build -> 验证修复
|
||||
5. ./gradlew test -> 确保无新增问题
|
||||
```
|
||||
|
||||
## 常见修复模式
|
||||
@@ -108,10 +108,10 @@ kotlin {
|
||||
## 输出格式
|
||||
|
||||
```text
|
||||
[FIXED] src/main/kotlin/com/example/service/UserService.kt:42
|
||||
Error: Unresolved reference: UserRepository
|
||||
Fix: Added import com.example.repository.UserRepository
|
||||
Remaining errors: 2
|
||||
[已修复] src/main/kotlin/com/example/service/UserService.kt:42
|
||||
错误:未解析的引用:UserRepository
|
||||
修复:已添加导入 com.example.repository.UserRepository
|
||||
剩余错误:2
|
||||
```
|
||||
|
||||
最终:`Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list`
|
||||
|
||||
@@ -127,15 +127,15 @@ Button(onClick = onClick)
|
||||
## 输出格式
|
||||
|
||||
```
|
||||
[CRITICAL] Domain module imports Android framework
|
||||
File: domain/src/main/kotlin/com/app/domain/UserUseCase.kt:3
|
||||
Issue: `import android.content.Context` — domain must be pure Kotlin with no framework dependencies.
|
||||
Fix: Move Context-dependent logic to data or platforms layer. Pass data via repository interface.
|
||||
[CRITICAL] Domain 模块导入了 Android 框架
|
||||
文件: domain/src/main/kotlin/com/app/domain/UserUseCase.kt:3
|
||||
问题: `import android.content.Context` — domain 层必须是纯 Kotlin,不能有框架依赖。
|
||||
修复: 将依赖 Context 的逻辑移到 data 层或 platforms 层。通过 repository 接口传递数据。
|
||||
|
||||
[HIGH] StateFlow holding mutable list
|
||||
File: presentation/src/main/kotlin/com/app/ui/ListViewModel.kt:25
|
||||
Issue: `_state.value.items.add(newItem)` mutates the list inside StateFlow — Compose won't detect the change.
|
||||
Fix: Use `_state.update { it.copy(items = it.items + newItem) }`
|
||||
[HIGH] StateFlow 持有可变列表
|
||||
文件: presentation/src/main/kotlin/com/app/ui/ListViewModel.kt:25
|
||||
问题: `_state.value.items.add(newItem)` 在 StateFlow 内部修改了列表 — Compose 将无法检测到此更改。
|
||||
修复: 使用 `_state.update { it.copy(items = it.items + newItem) }`
|
||||
```
|
||||
|
||||
## 摘要格式
|
||||
@@ -143,16 +143,16 @@ Fix: Use `_state.update { it.copy(items = it.items + newItem) }`
|
||||
每次审查结束时附上:
|
||||
|
||||
```
|
||||
## Review Summary
|
||||
## 审查摘要
|
||||
|
||||
| Severity | Count | Status |
|
||||
| 严重程度 | 数量 | 状态 |
|
||||
|----------|-------|--------|
|
||||
| CRITICAL | 0 | pass |
|
||||
| HIGH | 1 | block |
|
||||
| MEDIUM | 2 | info |
|
||||
| LOW | 0 | note |
|
||||
| CRITICAL | 0 | 通过 |
|
||||
| HIGH | 1 | 阻止 |
|
||||
| MEDIUM | 2 | 信息 |
|
||||
| LOW | 0 | 备注 |
|
||||
|
||||
Verdict: BLOCK — HIGH issues must be fixed before merge.
|
||||
裁决:阻止 — 必须修复 HIGH 级别问题后方可合并。
|
||||
```
|
||||
|
||||
## 批准标准
|
||||
|
||||
@@ -79,10 +79,10 @@ pytest --cov=app --cov-report=term-missing # Test coverage
|
||||
## 审查输出格式
|
||||
|
||||
```text
|
||||
[SEVERITY] Issue title
|
||||
File: path/to/file.py:42
|
||||
Issue: Description
|
||||
Fix: What to change
|
||||
[严重性] 问题标题
|
||||
文件:path/to/file.py:42
|
||||
问题:描述
|
||||
修复:修改内容
|
||||
```
|
||||
|
||||
## 批准标准
|
||||
|
||||
@@ -33,12 +33,12 @@ python -c "import torch; x = torch.randn(2,3).cuda(); print('CUDA tensor test: O
|
||||
## 解决工作流
|
||||
|
||||
```text
|
||||
1. Read error traceback -> Identify failing line and error type
|
||||
2. Read affected file -> Understand model/training context
|
||||
3. Trace tensor shapes -> Print shapes at key points
|
||||
4. Apply minimal fix -> Only what's needed
|
||||
5. Run failing script -> Verify fix
|
||||
6. Check gradients flow -> Ensure backward pass works
|
||||
1. 阅读错误回溯 -> 定位失败行和错误类型
|
||||
2. 阅读受影响文件 -> 理解模型/训练上下文
|
||||
3. 追踪张量形状 -> 在关键点打印形状
|
||||
4. 应用最小修复 -> 仅修改必要部分
|
||||
5. 运行失败脚本 -> 验证修复
|
||||
6. 检查梯度流动 -> 确保反向传播正常工作
|
||||
```
|
||||
|
||||
## 常见修复模式
|
||||
@@ -109,10 +109,10 @@ print(f'Max allocated: {torch.cuda.max_memory_allocated()/1e9:.2f} GB')
|
||||
## 输出格式
|
||||
|
||||
```text
|
||||
[FIXED] train.py:42
|
||||
Error: RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x512 and 256x10)
|
||||
Fix: Changed nn.Linear(256, 10) to nn.Linear(512, 10) to match encoder output
|
||||
Remaining errors: 0
|
||||
[已修复] train.py:42
|
||||
错误:RuntimeError:无法相乘 mat1 和 mat2 的形状(32x512 和 256x10)
|
||||
修复:将 nn.Linear(256, 10) 更改为 nn.Linear(512, 10) 以匹配编码器输出
|
||||
剩余错误:0
|
||||
```
|
||||
|
||||
最终:`Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list`
|
||||
|
||||
@@ -32,12 +32,12 @@ if command -v cargo-audit >/dev/null; then cargo audit; else echo "cargo-audit n
|
||||
## 解决工作流
|
||||
|
||||
```text
|
||||
1. cargo check -> Parse error message and error code
|
||||
2. Read affected file -> Understand ownership and lifetime context
|
||||
3. Apply minimal fix -> Only what's needed
|
||||
4. cargo check -> Verify fix
|
||||
5. cargo clippy -> Check for warnings
|
||||
6. cargo test -> Ensure nothing broke
|
||||
1. cargo check -> 解析错误信息和错误代码
|
||||
2. 读取受影响的文件 -> 理解所有权和生命周期的上下文
|
||||
3. 应用最小修复 -> 仅做必要的修改
|
||||
4. cargo check -> 验证修复
|
||||
5. cargo clippy -> 检查警告
|
||||
6. cargo test -> 确保没有破坏原有功能
|
||||
```
|
||||
|
||||
## 常见修复模式
|
||||
@@ -138,10 +138,10 @@ grep "rust-version" Cargo.toml
|
||||
## 输出格式
|
||||
|
||||
```text
|
||||
[FIXED] src/handler/user.rs:42
|
||||
Error: E0502 — cannot borrow `map` as mutable because it is also borrowed as immutable
|
||||
Fix: Cloned value from immutable borrow before mutable insert
|
||||
Remaining errors: 3
|
||||
[已修复] src/handler/user.rs:42
|
||||
错误: E0502 — 无法以可变方式借用 `map`,因为它同时也被不可变借用
|
||||
修复: 在可变插入前从不可变借用克隆值
|
||||
剩余错误: 3
|
||||
```
|
||||
|
||||
最终:`Build Status: SUCCESS/FAILED | Errors Fixed: N | Files Modified: list`
|
||||
|
||||
Reference in New Issue
Block a user