mirror of
https://github.com/sweetwisdom/everything-claude-code-zh.git
synced 2026-03-21 22:10:09 +00:00
docs: 完成所有文档的中文翻译并应用到项目
This commit is contained in:
@@ -1,46 +1,46 @@
|
||||
# Hooks System
|
||||
# 钩子系统(Hooks System)
|
||||
|
||||
## Hook Types
|
||||
## 钩子类型(Hook Types)
|
||||
|
||||
- **PreToolUse**: Before tool execution (validation, parameter modification)
|
||||
- **PostToolUse**: After tool execution (auto-format, checks)
|
||||
- **Stop**: When session ends (final verification)
|
||||
- **工具调用前(PreToolUse)**:在工具执行之前(验证、参数修改)
|
||||
- **工具调用后(PostToolUse)**:在工具执行之后(自动格式化、检查)
|
||||
- **会话终止(Stop)**:当会话结束时(最终验证)
|
||||
|
||||
## Current Hooks (in ~/.claude/settings.json)
|
||||
## 当前已配置的钩子(Current Hooks)(位于 ~/.claude/settings.json 中)
|
||||
|
||||
### PreToolUse
|
||||
- **tmux reminder**: Suggests tmux for long-running commands (npm, pnpm, yarn, cargo, etc.)
|
||||
- **git push review**: Opens Zed for review before push
|
||||
- **doc blocker**: Blocks creation of unnecessary .md/.txt files
|
||||
### 工具调用前(PreToolUse)
|
||||
- **tmux 提醒**:针对耗时较长的命令(npm, pnpm, yarn, cargo 等)建议使用 tmux
|
||||
- **git push 审查**:在推送(push)之前打开 Zed 进行代码审查
|
||||
- **文档拦截器(doc blocker)**:拦截不必要的 .md/.txt 文件创建
|
||||
|
||||
### PostToolUse
|
||||
- **PR creation**: Logs PR URL and GitHub Actions status
|
||||
- **Prettier**: Auto-formats JS/TS files after edit
|
||||
- **TypeScript check**: Runs tsc after editing .ts/.tsx files
|
||||
- **console.log warning**: Warns about console.log in edited files
|
||||
### 工具调用后(PostToolUse)
|
||||
- **PR 创建**:记录 PR URL 和 GitHub Actions 状态
|
||||
- **Prettier**:编辑后自动格式化 JS/TS 文件
|
||||
- **TypeScript 检查**:编辑 .ts/.tsx 文件后运行 tsc
|
||||
- **console.log 警告**:对已编辑文件中的 console.log 发出警告
|
||||
|
||||
### Stop
|
||||
- **console.log audit**: Checks all modified files for console.log before session ends
|
||||
### 会话终止(Stop)
|
||||
- **console.log 审计**:在会话结束前检查所有已修改的文件中是否存在 console.log
|
||||
|
||||
## Auto-Accept Permissions
|
||||
## 自动授权许可(Auto-Accept Permissions)
|
||||
|
||||
Use with caution:
|
||||
- Enable for trusted, well-defined plans
|
||||
- Disable for exploratory work
|
||||
- Never use dangerously-skip-permissions flag
|
||||
- Configure `allowedTools` in `~/.claude.json` instead
|
||||
请谨慎使用:
|
||||
- 仅对受信任且定义明确的任务方案启用
|
||||
- 在探索性工作中禁用
|
||||
- 严禁使用 `dangerously-skip-permissions` 标志
|
||||
- 改为在 `~/.claude.json` 中配置 `allowedTools`
|
||||
|
||||
## TodoWrite Best Practices
|
||||
## TodoWrite 最佳实践
|
||||
|
||||
Use TodoWrite tool to:
|
||||
- Track progress on multi-step tasks
|
||||
- Verify understanding of instructions
|
||||
- Enable real-time steering
|
||||
- Show granular implementation steps
|
||||
使用 TodoWrite 工具(Tool)以:
|
||||
- 跟踪多步骤任务的进度
|
||||
- 验证对指令的理解程度
|
||||
- 实现实时引导(steering)
|
||||
- 展示细粒度的实现步骤
|
||||
|
||||
Todo list reveals:
|
||||
- Out of order steps
|
||||
- Missing items
|
||||
- Extra unnecessary items
|
||||
- Wrong granularity
|
||||
- Misinterpreted requirements
|
||||
待办事项列表(Todo list)能够揭示:
|
||||
- 步骤顺序错乱
|
||||
- 遗漏项
|
||||
- 多余的不必要项
|
||||
- 粒度错误
|
||||
- 需求误读
|
||||
|
||||
Reference in New Issue
Block a user