You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/prompts/tools/shell_command.md
-107Lines changed: 0 additions & 107 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,110 +28,3 @@ Usage notes:
28
28
<bad-example>
29
29
cd /foo/bar && pytest tests
30
30
</bad-example>
31
-
32
-
# Committing changes with git
33
-
34
-
When the user asks you to create a new git commit, follow these steps carefully:
35
-
36
-
1.:
37
-
- Run a git status command to see all untracked files.
38
-
- Run a git diff command to see both staged and unstaged changes that will be committed.
39
-
- Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
40
-
41
-
2. Analyze all staged changes (both previously staged and newly added) and draft a commit message. Wrap your analysis process in <commit_analysis> tags:
42
-
43
-
<commit_analysis>
44
-
- List the files that have been changed or added
45
-
- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)
46
-
- Brainstorm the purpose or motivation behind these changes
47
-
- Assess the impact of these changes on the overall project
48
-
- Check for any sensitive information that shouldn't be committed
49
-
- Draft a concise (1-2 sentences) commit message that focuses on the \"why\" rather than the \"what\"
50
-
- Ensure your language is clear, concise, and to the point
51
-
- Ensure the message accurately reflects the changes and their purpose (i.e. \"add\" means a wholly new feature, \" update \" means an enhancement to an existing feature, \"fix\" means a bug fix, etc.)
52
-
- Ensure the message is not generic (avoid words like \"Update\" or \"Fix\" without context)
53
-
- Review the draft message to ensure it accurately reflects the changes and their purpose
54
-
</commit_analysis>
55
-
56
-
3.:
57
-
- Add relevant untracked files to the staging area.
58
-
- Create the commit with a message ending with:
59
-
🤖 Generated with [eca](https://eca.dev)
60
-
61
-
Co-Authored-By: eca <noreply@eca.dev>
62
-
- Run git status to make sure the commit succeeded.
63
-
64
-
4. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.
65
-
66
-
Important notes:
67
-
- Use the git context at the start of this conversation to determine which files are relevant to your commit. Be careful not to stage and commit files (e.g. with `git add .`) that aren't relevant to your commit.
68
-
- NEVER update the git config
69
-
- DO NOT run additional commands to read or explore code, beyond what is available in the git context
70
-
- DO NOT push to the remote repository
71
-
- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.
72
-
- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
73
-
- Ensure your commit message is meaningful and concise. It should explain the purpose of the changes, not just describe them.
74
-
- Return an empty response - the user will see the git output directly
75
-
- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:
76
-
<example>
77
-
git commit -m \"$(cat <<'EOF'
78
-
Commit message here.
79
-
80
-
🤖 Generated with [eca](https://eca.dev)
81
-
82
-
Co-Authored-By: eca <noreply@eca.dev>
83
-
EOF
84
-
)\"
85
-
</example>
86
-
87
-
# Creating pull requests
88
-
Use the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.
89
-
90
-
IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
91
-
92
-
1. In order to understand the current state of the branch since it diverged from the main branch:
93
-
- Run a git status command to see all untracked files
94
-
- Run a git diff command to see both staged and unstaged changes that will be committed
95
-
- Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote
96
-
- Run a git log command and `git diff main...HEAD` to understand the full commit history for the current branch (from the time it diverged from the `main` branch)
97
-
98
-
2. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (NOT just the latest commit, but ALL commits that will be included in the pull request!!!), and draft a pull request summary. Wrap your analysis process in <pr_analysis> tags:
99
-
100
-
<pr_analysis>
101
-
- List the commits since diverging from the main branch
102
-
- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)
103
-
- Brainstorm the purpose or motivation behind these changes
104
-
- Assess the impact of these changes on the overall project
105
-
- Do not use tools to explore code, beyond what is available in the git context
106
-
- Check for any sensitive information that shouldn't be committed
107
-
- Draft a concise (1-2 bullet points) pull request summary that focuses on the \"why\" rather than the \"what\"
108
-
- Ensure the summary accurately reflects all changes since diverging from the main branch
109
-
- Ensure your language is clear, concise, and to the point
110
-
- Ensure the summary accurately reflects the changes and their purpose (ie. \"add\" means a wholly new feature, " update " means an enhancement to an existing feature, \"fix\" means a bug fix, etc.)
111
-
- Ensure the summary is not generic (avoid words like \"Update\" or \"Fix\" without context)
112
-
- Review the draft summary to ensure it accurately reflects the changes and their purpose
113
-
</pr_analysis>
114
-
115
-
3. ALWAYS run the following commands in parallel:
116
-
- Create new branch if needed
117
-
- Push to remote with -u flag if needed
118
-
- Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
0 commit comments