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
{{ message }}
Repository navigation
Commit 246dfa6
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: packages/cli/src/tool/bash.txt
-68Lines changed: 0 additions & 68 deletions
Original file line number
Diff line number
Diff line change
@@ -45,71 +45,3 @@ Usage notes:
45
45
<bad-example>
46
46
cd /foo/bar && pytest tests
47
47
</bad-example>
48
-
49
-
# Committing changes with git
50
-
51
-
Only create commits when requested by the user. If unclear, ask first. When the user asks you to create a new git commit, follow these steps carefully:
52
-
53
-
Git Safety Protocol:
54
-
- NEVER update the git config
55
-
- NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
56
-
- NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
57
-
- NEVER run force push to main/master, warn the user if they request it
58
-
- Avoid git commit --amend. ONLY use --amend when ALL conditions are met:
59
-
(1) User explicitly requested amend, OR commit SUCCEEDED but pre-commit hook auto-modified files that need including
60
-
(2) HEAD commit was created by you in this conversation (verify: git log -1 --format='%an %ae')
61
-
(3) Commit has NOT been pushed to remote (verify: git status shows "Your branch is ahead")
62
-
- CRITICAL: If commit FAILED or was REJECTED by hook, NEVER amend - fix the issue and create a NEW commit
63
-
- CRITICAL: If you already pushed to remote, NEVER amend unless user explicitly requests it (requires force push)
64
-
- NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
65
-
66
-
1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the Bash tool:
67
-
- Run a git status command to see all untracked files.
68
-
- Run a git diff command to see both staged and unstaged changes that will be committed.
69
-
- Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
70
-
2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:
71
-
- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.). 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.).
72
-
- Do not commit files that likely contain secrets (.env, credentials.json, etc.). Warn the user if they specifically request to commit those files
73
-
- Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"
74
-
- Ensure it accurately reflects the changes and their purpose
75
-
3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:
76
-
- Add relevant untracked files to the staging area.
77
-
- Create the commit with a message
78
-
- Run git status after the commit completes to verify success.
79
-
Note: git status depends on the commit completing, so run it sequentially after the commit.
80
-
4. If the commit fails due to pre-commit hook, fix the issue and create a NEW commit (see amend rules above)
81
-
82
-
Important notes:
83
-
- NEVER run additional commands to read or explore code, besides git bash commands
84
-
- NEVER use the TodoWrite or Task tools
85
-
- DO NOT push to the remote repository unless the user explicitly asks you to do so
86
-
- 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.
87
-
- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
88
-
89
-
# Creating pull requests
90
-
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.
91
-
92
-
IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
93
-
94
-
1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the Bash tool, in order to understand the current state of the branch since it diverged from the main branch:
95
-
- Run a git status command to see all untracked files
96
-
- Run a git diff command to see both staged and unstaged changes that will be committed
97
-
- 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
98
-
- Run a git log command and `git diff [base-branch]...HEAD` to understand the full commit history for the current branch (from the time it diverged from the base branch)
99
-
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
100
-
3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:
101
-
- Create new branch if needed
102
-
- Push to remote with -u flag if needed
103
-
- Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
104
-
<example>
105
-
gh pr create --title "the pr title" --body "$(cat <<'EOF'
106
-
## Summary
107
-
<1-3 bullet points>
108
-
</example>
109
-
110
-
Important:
111
-
- DO NOT use the TodoWrite or Task tools
112
-
- Return the PR URL when you're done, so the user can see it
113
-
114
-
# Other common operations
115
-
- View comments on a GitHub PR: gh api repos/foo/bar/pulls/123/comments
0 commit comments