agentic-workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAI Agent Workflow (Workflow & Productivity)
AI Agent工作流(工作流与生产力)
When to use this skill
什么时候使用这个技能
- Optimize everyday AI agent work
- Integrate Git/GitHub workflows
- Use MCP servers
- Manage and recover sessions
- Apply productivity techniques
- 优化日常AI Agent工作
- 集成Git/GitHub工作流
- 使用MCP服务器
- 管理和恢复会话
- 应用生产力技巧
1. Key commands by agent
1. 按Agent分类的核心命令
Claude Code commands
Claude Code命令
| Command | Function | When to use |
|---|---|---|
| Auto-generate a CLAUDE.md draft | Start a new project |
| Show token usage/reset time | Start of every session |
| Clear conversation history | When context is polluted; start a new task |
| Context window X-Ray | When performance degrades |
| Clone the entire conversation | A/B experiments; backups |
| Manage MCP servers | Enable/disable MCP |
| Run immediately without Claude processing | Quick status checks |
| 命令 | 功能 | 适用场景 |
|---|---|---|
| 自动生成CLAUDE.md草稿 | 启动新项目时 |
| 显示Token用量/重置时间 | 每次会话开始时 |
| 清空对话历史 | 上下文被污染时;开启新任务时 |
| 上下文窗口X光检测 | 性能下降时 |
| 克隆整个对话 | A/B实验;备份时 |
| 管理MCP服务器 | 启用/禁用MCP时 |
| 无需Claude处理直接运行命令 | 快速状态检查时 |
Gemini CLI commands
Gemini CLI命令
| Command | Function |
|---|---|
| Start a conversation |
| Add file context |
| Select model |
| 命令 | 功能 |
|---|---|
| 开启对话 |
| 添加文件上下文 |
| 选择模型 |
Codex CLI commands
Codex CLI命令
| Command | Function |
|---|---|
| Start a conversation |
| Run a command |
| 命令 | 功能 |
|---|---|
| 开启对话 |
| 运行命令 |
2. Keyboard shortcuts (Claude Code)
2. 键盘快捷键(Claude Code)
Essential shortcuts
核心快捷键
| Shortcut | Function | Importance |
|---|---|---|
| Cancel the last task immediately | Highest |
| Search prompt history | High |
| Toggle plan mode | High |
| Accept prompt suggestion | Medium |
| Send to background | Medium |
| Edit in external editor | Low |
| 快捷键 | 功能 | 重要程度 |
|---|---|---|
| 立即取消上一个任务 | 最高 |
| 搜索提示词历史 | 高 |
| 切换计划模式 | 高 |
| 接受提示词建议 | 中 |
| 发送到后台运行 | 中 |
| 在外部编辑器中编辑 | 低 |
Editor editing shortcuts
编辑器编辑快捷键
| Shortcut | Function |
|---|---|
| Move to start of line |
| Move to end of line |
| Delete previous word |
| Delete to start of line |
| Delete to end of line |
| 快捷键 | 功能 |
|---|---|
| 移动到行首 |
| 移动到行尾 |
| 删除前一个单词 |
| 删除内容到行首 |
| 删除内容到行尾 |
3. Session management
3. 会话管理
Claude Code sessions
Claude Code会话
bash
undefinedbash
undefinedContinue the last conversation
Continue the last conversation
claude --continue
claude --continue
Resume a specific session
Resume a specific session
claude --resume <session-name>
claude --resume <session-name>
Name the session during the conversation
Name the session during the conversation
/rename stripe-integration
undefined/rename stripe-integration
undefinedRecommended aliases
推荐别名配置
bash
undefinedbash
undefined~/.zshrc or ~/.bashrc
~/.zshrc or ~/.bashrc
alias c='claude'
alias cc='claude --continue'
alias cr='claude --resume'
alias g='gemini'
alias cx='codex'
---alias c='claude'
alias cc='claude --continue'
alias cr='claude --resume'
alias g='gemini'
alias cx='codex'
---4. Git workflow
4. Git工作流
Auto-generate commit messages
自动生成提交信息
"Analyze the changes, write an appropriate commit message, then commit""Analyze the changes, write an appropriate commit message, then commit"Auto-generate draft PR
自动生成PR草稿
"Create a draft PR from the current branch's changes.
Make the title summarize the changes, and list the key changes in the body.""Create a draft PR from the current branch's changes.
Make the title summarize the changes, and list the key changes in the body."Use Git worktrees
使用Git工作树
bash
undefinedbash
undefinedWork on multiple branches simultaneously
Work on multiple branches simultaneously
git worktree add ../myapp-feature-auth feature/auth
git worktree add ../myapp-hotfix hotfix/critical-bug
git worktree add ../myapp-feature-auth feature/auth
git worktree add ../myapp-hotfix hotfix/critical-bug
Independent AI sessions per worktree
Independent AI sessions per worktree
Tab 1: ~/myapp-feature-auth → new feature development
Tab 2: ~/myapp-hotfix → urgent bug fix
Tab 3: ~/myapp (main) → keep main branch
undefinedTab 1: ~/myapp-feature-auth → new feature development
Tab 2: ~/myapp-hotfix → urgent bug fix
Tab 3: ~/myapp (main) → keep main branch
undefinedPR review workflow
PR评审工作流
1. "Run gh pr checkout 123 and summarize this PR's changes"
2. "Analyze changes in src/auth/middleware.ts. Check for security issues or performance problems"
3. "Is there a way to make this logic more efficient?"
4. "Apply the improvements you suggested and run tests"1. "Run gh pr checkout 123 and summarize this PR's changes"
2. "Analyze changes in src/auth/middleware.ts. Check for security issues or performance problems"
3. "Is there a way to make this logic more efficient?"
4. "Apply the improvements you suggested and run tests"5. Using MCP servers (Multi-Agent)
5. MCP服务器使用(多Agent)
Key MCP servers
核心MCP服务器
| MCP server | Function | Use case |
|---|---|---|
| Playwright | Control web browser | E2E tests |
| Supabase | Database queries | Direct DB access |
| Firecrawl | Web crawling | Data collection |
| Gemini-CLI | Large-scale analysis | 1M+ token analysis |
| Codex-CLI | Run commands | Build, deploy |
| MCP服务器 | 功能 | 适用场景 |
|---|---|---|
| Playwright | 控制网页浏览器 | E2E测试 |
| Supabase | 数据库查询 | 直接访问数据库 |
| Firecrawl | 网页爬虫 | 数据收集 |
| Gemini-CLI | 大规模分析 | 百万级Token分析 |
| Codex-CLI | 运行命令 | 构建、部署 |
MCP usage examples
MCP使用示例
bash
undefinedbash
undefinedGemini: large-scale analysis
Gemini: large-scale analysis
ask-gemini "@src/ Analyze the structure of the entire codebase"
ask-gemini "@src/ Analyze the structure of the entire codebase"
Codex: run commands
Codex: run commands
shell "docker-compose up -d" shell "npm test && npm run build"
undefinedshell "docker-compose up -d" shell "npm test && npm run build"
undefinedMCP optimization
MCP优化
bash
undefinedbash
undefinedDisable unused MCP servers
Disable unused MCP servers
/mcp
/mcp
Recommended numbers
Recommended numbers
- MCP servers: fewer than 10
- MCP servers: fewer than 10
- Active tools: fewer than 80
- Active tools: fewer than 80
---
---6. Multi-Agent workflow patterns
6. 多Agent工作流模式
Orchestration pattern
编排模式
[Claude] Plan → [Gemini] Analysis/research → [Claude] Write code → [Codex] Run/test → [Claude] Synthesize results[Claude] 制定计划 → [Gemini] 分析/调研 → [Claude] 编写代码 → [Codex] 运行/测试 → [Claude] 汇总结果Practical example: API design + implementation + testing
实际示例:API设计 + 实现 + 测试
1. [Claude] Design API spec using the skill
2. [Gemini] ask-gemini "@src/ Analyze existing API patterns" - large-scale codebase analysis
3. [Claude] Implement code based on the analysis
4. [Codex] shell "npm test && npm run build" - test and build
5. [Claude] Create final report1. [Claude] 使用技能设计API规范
2. [Gemini] ask-gemini "@src/ Analyze existing API patterns" - 大规模代码库分析
3. [Claude] 基于分析结果实现代码
4. [Codex] shell "npm test && npm run build" - 测试与构建
5. [Claude] 生成最终报告TDD workflow
TDD工作流
"Work using TDD. First write a failing test,
then write code that makes the test pass.""Work using TDD. First write a failing test,
then write code that makes the test pass."The AI:
人工智能执行步骤:
1. Write a failing test
1. 编写失败的测试用例
2. git commit -m "Add failing test for user auth"
2. git commit -m "Add failing test for user auth"
3. Write minimal code to pass the test
3. 编写最少代码让测试通过
4. Run tests → confirm they pass
4. 运行测试 → 确认通过
5. git commit -m "Implement user auth to pass test"
5. git commit -m "Implement user auth to pass test"
---
---7. Container workflow
7. 容器工作流
Docker container setup
Docker容器配置
dockerfile
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y \
curl git tmux vim nodejs npm python3 python3-pip
RUN curl -fsSL https://claude.ai/install.sh | sh
WORKDIR /workspace
CMD ["/bin/bash"]dockerfile
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y \
curl git tmux vim nodejs npm python3 python3-pip
RUN curl -fsSL https://claude.ai/install.sh | sh
WORKDIR /workspace
CMD ["/bin/bash"]Safe experimentation environment
安全实验环境
bash
undefinedbash
undefinedBuild and run the container
Build and run the container
docker build -t ai-sandbox .
docker run -it --rm
-v $(pwd):/workspace
-e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
ai-sandbox
-v $(pwd):/workspace
-e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
ai-sandbox
docker build -t ai-sandbox .
docker run -it --rm
-v $(pwd):/workspace
-e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
ai-sandbox
-v $(pwd):/workspace
-e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
ai-sandbox
Do experimental work inside the container
Do experimental work inside the container
---
---8. Troubleshooting
8. 问题排查
When context is overloaded
上下文过载时
bash
/context # Check usage
/clear # Reset contextbash
/context # 检查用量
/clear # 重置上下文Or create HANDOFF.md and start a new session
Or create HANDOFF.md and start a new session
undefinedundefinedCancel a task
取消任务
Esc Esc # Cancel the last task immediatelyEsc Esc # 立即取消上一个任务When performance degrades
性能下降时
bash
undefinedbash
undefinedCheck MCP/tool counts
Check MCP/tool counts
/mcp
/mcp
Disable unnecessary MCP servers
Disable unnecessary MCP servers
Reset context
Reset context
---
---Quick Reference Card
快速参考卡
=== Essential commands ===
/clear reset context
/context check usage
/usage check tokens
/init generate project description file
!command run immediately
=== Shortcuts ===
Esc Esc cancel task
Ctrl+R search history
Shift+Tab×2 plan mode
Ctrl+B background
=== CLI flags ===
--continue continue conversation
--resume resume session
-p "prompt" headless mode
=== Multi-Agent ===
Claude plan/code generation
Gemini large-scale analysis
Codex run commands
=== Troubleshooting ===
Context overloaded → /clear
Cancel task → Esc Esc
Performance degradation → check /context=== 核心命令 ===
/clear 重置上下文
/context 检查用量
/usage 检查Token
/init 生成项目描述文件
!command 立即运行
=== 快捷键 ===
Esc Esc 取消任务
Ctrl+R 搜索历史
Shift+Tab×2 计划模式
Ctrl+B 后台运行
=== CLI参数 ===
--continue 继续对话
--resume 恢复会话
-p "prompt" 无头模式
=== 多Agent ===
Claude 制定计划/生成代码
Gemini 大规模分析
Codex 运行命令
=== 问题排查 ===
上下文过载 → /clear
取消任务 → Esc Esc
性能下降 → 检查 /context