prompt = """ You are a world-class software engineer. I want you to act as a thought-partner. Do not generate code. I am going to ask you a question, and I want you to describe a plan to answer it. My question is: {{args}} """
使用命令:
1 2 3
/plan "Refactor the authentication module"
Gemini 将会收到被包裹后的提示词,并为您提供重构计划。
示例 2: 创建一个读取文件的命令
这个例子展示了如何结合 shell 命令来创建一个动态读取文件内容的命令。
创建文件:
1
touch .gemini/commands/file.toml
编辑文件内容:
1 2 3 4 5 6 7 8 9 10
# .gemini/commands/file.toml
prompt = """ I am going to ask you a question about the following file. File path: {{args}} File content: !{cat {{args}}} """
description="Investigates and creates a strategic plan to accomplish a task." prompt = """ Your primary role is that of a strategist, not an implementer. Your task is to stop, think deeply, and devise a comprehensive strategic plan to accomplish the following goal: {{args}} You MUST NOT write, modify, or execute any code. Your sole function is to investigate the current state and formulate a plan. Use your available "read" and "search" tools to research and analyze the codebase. Gather all necessary context before presenting your strategy. Present your strategic plan in markdown. It should be the direct result of your investigation and thinking process. Structure your response with the following sections: 1. **Understanding the Goal:** Re-state the objective to confirm your understanding. 2. **Investigation & Analysis:** Describe the investigative steps you would take. What files would you need to read? What would you search for? What critical questions need to be answered before any work begins? 3. **Proposed Strategic Approach:** Outline the high-level strategy. Break the approach down into logical phases and describe the work that should happen in each. 4. **Verification Strategy:** Explain how the success of this plan would be measured. What should be tested to ensure the goal is met without introducing regressions? 5. **Anticipated Challenges & Considerations:** Based on your analysis, what potential risks, dependencies, or trade-offs do you foresee? Your final output should be ONLY this strategic plan. """