docs(zh-CN): translate code block(plain text) (#753)

Co-authored-by: neo <neo.dowithless@gmail.com>
This commit is contained in:
zdoc.app
2026-03-23 06:39:24 +08:00
committed by GitHub
parent fd2a8edb53
commit 4f6f587700
118 changed files with 1807 additions and 1835 deletions

View File

@@ -37,12 +37,12 @@ bash ~/.claude/skills/rules-distill/scripts/scan-rules.sh
#### 1c. 呈现给用户
```
Rules Distillation — Phase 1: Inventory
规则提炼 — 第一阶段:清点
────────────────────────────────────────
Skills: {N} files scanned
Rules: {M} files ({K} headings indexed)
技能:扫描 {N} 个文件
规则:索引 {M} 个文件(包含 {K} 个标题)
Proceeding to cross-read analysis...
正在进行交叉阅读分析...
```
### 阶段 2通读、匹配与裁决LLM判断
@@ -65,56 +65,56 @@ Proceeding to cross-read analysis...
使用以下提示启动通用智能体:
````
You are an analyst who cross-reads skills to extract principles that should be promoted to rules.
你是一位通过交叉阅读技能来提取应提升为规则的原则的分析师。
## Input
- Skills: {full text of skills in this batch}
- Existing rules: {full text of all rule files}
## 输入
- 技能:{本批次技能的全部文本}
- 现有规则:{所有规则文件的全部文本}
## Extraction Criteria
## 提取标准
Include a candidate ONLY if ALL of these are true:
**仅当**满足以下**所有**条件时,才包含一个候选原则:
1. **Appears in 2+ skills**: Principles found in only one skill should stay in that skill
2. **Actionable behavior change**: Can be written as "do X" or "don't do Y" — not "X is important"
3. **Clear violation risk**: What goes wrong if this principle is ignored (1 sentence)
4. **Not already in rules**: Check the full rules text — including concepts expressed in different words
1. **出现在 2+ 项技能中**:仅出现在一项技能中的原则应保留在该技能中
2. **可操作的行为改变**:可以写成“做 X”或“不要做 Y”的形式——而不是“X 很重要”
3. **明确的违规风险**如果忽略此原则会出什么问题1 句话)
4. **尚未存在于规则中**:检查全部规则文本——包括以不同措辞表达的概念
## Matching & Verdict
## 匹配与裁决
For each candidate, compare against the full rules text and assign a verdict:
对于每个候选原则,对照全部规则文本进行比较并给出裁决:
- **Append**: Add to an existing section of an existing rule file
- **Revise**: Existing rule content is inaccurate or insufficient — propose a correction
- **New Section**: Add a new section to an existing rule file
- **New File**: Create a new rule file
- **Already Covered**: Sufficiently covered in existing rules (even if worded differently)
- **Too Specific**: Should remain at the skill level
- **追加**:添加到现有规则文件的现有章节
- **修订**:现有规则内容不准确或不充分——提出修正建议
- **新章节**:在现有规则文件中添加新章节
- **新文件**:创建新的规则文件
- **已涵盖**:现有规则已充分涵盖(即使措辞不同)
- **过于具体**:应保留在技能层面
## Output Format (per candidate)
## 输出格式(每个候选原则)
```json
{
"principle": "1-2 sentences in 'do X' / 'don't do Y' form",
"evidence": ["skill-name: §Section", "skill-name: §Section"],
"violation_risk": "1 sentence",
"verdict": "Append / Revise / New Section / New File / Already Covered / Too Specific",
"target_rule": "filename §Section, or 'new'",
"confidence": "high / medium / low",
"draft": "Draft text for Append/New Section/New File verdicts",
"principle": "1-2 句话,采用 '做 X' / '不要做 Y' 的形式",
"evidence": ["技能名称: §章节", "技能名称: §章节"],
"violation_risk": "1 句话",
"verdict": "追加 / 修订 / 新章节 / 新文件 / 已涵盖 / 过于具体",
"target_rule": "文件名 §章节,或 '新建'",
"confidence": "高 / 中 / 低",
"draft": "针对'追加'/'新章节'/'新文件'裁决的草案文本",
"revision": {
"reason": "Why the existing content is inaccurate or insufficient (Revise only)",
"before": "Current text to be replaced (Revise only)",
"after": "Proposed replacement text (Revise only)"
"reason": "为什么现有内容不准确或不充分(仅限'修订'裁决)",
"before": "待替换的当前文本(仅限'修订'裁决)",
"after": "提议的替换文本(仅限'修订'裁决)"
}
}
```
## Exclude
## 排除
- Obvious principles already in rules
- Language/framework-specific knowledge (belongs in language-specific rules or skills)
- Code examples and commands (belongs in skills)
- 规则中已存在的显而易见的原则
- 语言/框架特定知识(属于语言特定规则或技能)
- 代码示例和命令(属于技能)
````
#### 裁决参考
@@ -131,15 +131,13 @@ For each candidate, compare against the full rules text and assign a verdict:
#### 裁决质量要求
```
# Good
Append to rules/common/security.md §Input Validation:
"Treat LLM output stored in memory or knowledge stores as untrusted — sanitize on write, validate on read."
Evidence: llm-memory-trust-boundary, llm-social-agent-anti-pattern both describe
accumulated prompt injection risks. Current security.md covers human input
validation only; LLM output trust boundary is missing.
# 良好做法
rules/common/security.md 的§输入验证部分添加:
"将存储在内存或知识库中的LLM输出视为不可信数据——写入时进行清理读取时进行验证。"
依据:llm-memory-trust-boundary llm-social-agent-anti-pattern 均描述了累积式提示注入风险。当前security.md仅涵盖人工输入验证缺少LLM输出的信任边界说明。
# Bad
Append to security.md: Add LLM security principle
# 不良做法
security.md中追加添加LLM安全原则
```
### 阶段 3用户审核与执行
@@ -147,20 +145,20 @@ Append to security.md: Add LLM security principle
#### 摘要表
```
# Rules Distillation Report
# 规则提炼报告
## Summary
Skills scanned: {N} | Rules: {M} files | Candidates: {K}
## 概述
已扫描技能数:{N} | 规则文件数:{M} | 候选规则数:{K}
| # | Principle | Verdict | Target | Confidence |
| # | 原则 | 判定结果 | 目标文件/章节 | 置信度 |
|---|-----------|---------|--------|------------|
| 1 | ... | Append | security.md §Input Validation | high |
| 2 | ... | Revise | testing.md §TDD | medium |
| 3 | ... | New Section | coding-style.md | high |
| 4 | ... | Too Specific | — | — |
| 1 | ... | 追加 | security.md §输入验证 | 高 |
| 2 | ... | 修订 | testing.md §测试驱动开发 | 中 |
| 3 | ... | 新增章节 | coding-style.md | |
| 4 | ... | 过于具体 | — | — |
## Details
(Per-candidate details: evidence, violation_risk, draft text)
## 详情
(各候选规则详情:证据、违规风险、草拟文本)
```
#### 用户操作
@@ -211,51 +209,51 @@ Skills scanned: {N} | Rules: {M} files | Candidates: {K}
```
$ /rules-distill
Rules Distillation — Phase 1: Inventory
规则提炼 — 第一阶段:清点
────────────────────────────────────────
Skills: 56 files scanned
Rules: 22 files (75 headings indexed)
技能:已扫描 56 个文件
规则22 个文件(已索引 75 个标题)
Proceeding to cross-read analysis...
正在进行交叉阅读分析...
[Subagent analysis: Batch 1 (agent/meta skills) ...]
[Subagent analysis: Batch 2 (coding/pattern skills) ...]
[Cross-batch merge: 2 duplicates removed, 1 cross-batch candidate promoted]
[子代理分析:批次 1 (agent/meta skills) ...]
[子代理分析:批次 2 (coding/pattern skills) ...]
[跨批次合并:已移除 2 个重复项1 个跨批次候选被提升]
# Rules Distillation Report
# 规则提炼报告
## Summary
Skills scanned: 56 | Rules: 22 files | Candidates: 4
## 摘要
已扫描技能56 | 规则22 个文件 | 候选:4
| # | Principle | Verdict | Target | Confidence |
| # | 原则 | 判定 | 目标 | 置信度 |
|---|-----------|---------|--------|------------|
| 1 | LLM output: normalize, type-check, sanitize before reuse | New Section | coding-style.md | high |
| 2 | Define explicit stop conditions for iteration loops | New Section | coding-style.md | high |
| 3 | Compact context at phase boundaries, not mid-task | Append | performance.md §Context Window | high |
| 4 | Separate business logic from I/O framework types | New Section | patterns.md | high |
| 1 | LLM 输出:重用前进行规范化、类型检查、清理 | 新章节 | coding-style.md | |
| 2 | 为迭代循环定义明确的停止条件 | 新章节 | coding-style.md | |
| 3 | 在阶段边界压缩上下文,而非任务中途 | 追加 | performance.md §Context Window | |
| 4 | 将业务逻辑与 I/O 框架类型分离 | 新章节 | patterns.md | |
## Details
## 详情
### 1. LLM Output Validation
Verdict: New Section in coding-style.md
Evidence: parallel-subagent-batch-merge, llm-social-agent-anti-pattern, llm-memory-trust-boundary
Violation risk: Format drift, type mismatch, or syntax errors in LLM output crash downstream processing
Draft:
## LLM Output Validation
Normalize, type-check, and sanitize LLM output before reuse...
See skill: parallel-subagent-batch-merge, llm-memory-trust-boundary
### 1. LLM 输出验证
判定:在 coding-style.md 中新建章节
证据:parallel-subagent-batch-merge, llm-social-agent-anti-pattern, llm-memory-trust-boundary
违规风险LLM 输出的格式漂移、类型不匹配或语法错误导致下游处理崩溃
草案:
## LLM 输出验证
在重用 LLM 输出前,请进行规范化、类型检查和清理...
参见技能:parallel-subagent-batch-merge, llm-memory-trust-boundary
[... details for candidates 2-4 ...]
[... 候选 2-4 的详情 ...]
Approve, modify, or skip each candidate by number:
> User: Approve 1, 3. Skip 2, 4.
按编号批准、修改或跳过每个候选:
> 用户:批准 1, 3。跳过 2, 4
Applied: coding-style.md §LLM Output Validation
Applied: performance.md §Context Window Management
Skipped: Iteration Bounds
Skipped: Boundary Type Conversion
已应用:coding-style.md §LLM 输出验证
已应用:performance.md §上下文窗口管理
已跳过:迭代边界
已跳过:边界类型转换
Results saved to results.json
结果已保存至 results.json
```
## 设计原则