mirror of
https://github.com/wassname/.tweakcc.git
synced 2026-06-27 16:58:37 +08:00
mv to skill
This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
# Git Commit and PR Creation (cc-commit)
|
||||||
|
|
||||||
|
## Committing
|
||||||
|
|
||||||
|
Only commit when explicitly asked. Stage by name (not `git add -A`); never commit .env/credentials.
|
||||||
|
|
||||||
|
1. Run git status (no -uall), git diff, git log in parallel
|
||||||
|
2. Draft concise commit message (1-2 sentences, focus on "why")
|
||||||
|
3. Stage files, commit with HEREDOC, verify with git status:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git commit -m "$(cat <<'EOF'
|
||||||
|
Commit message here.
|
||||||
|
EOF
|
||||||
|
)"
|
||||||
|
```
|
||||||
|
|
||||||
|
4. If hook fails: fix root cause, create a NEW commit (not --amend). Do NOT push unless explicitly asked.
|
||||||
|
|
||||||
|
## Creating pull requests
|
||||||
|
|
||||||
|
Use `gh` CLI. Check status, diff, log, and `git diff [base-branch]...HEAD` in parallel first.
|
||||||
|
Create branch if needed, push with `-u`. PR title under 70 chars.
|
||||||
|
View PR comments: `gh api repos/{owner}/{repo}/pulls/{number}/comments`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
gh pr create --title "the pr title" --body "$(cat <<'EOF'
|
||||||
|
## Summary
|
||||||
|
- bullet points
|
||||||
|
|
||||||
|
## Test plan
|
||||||
|
- [ ] ...
|
||||||
|
EOF
|
||||||
|
)"
|
||||||
|
```
|
||||||
|
|
||||||
|
Return the PR URL when done.
|
||||||
@@ -10,43 +10,4 @@ variables:
|
|||||||
- TASK_TOOL_NAME
|
- TASK_TOOL_NAME
|
||||||
- PR_GENERATED_WITH_CLAUDE_CODE
|
- PR_GENERATED_WITH_CLAUDE_CODE
|
||||||
-->
|
-->
|
||||||
# Committing changes with git
|
For git commits and PR creation, invoke the \`cc-commit\` skill.
|
||||||
|
|
||||||
Only commit when the user explicitly asks. Stage specific files by name (not \`git add -A\`); never commit .env/credentials.
|
|
||||||
|
|
||||||
Workflow:
|
|
||||||
1. ${GIT_COMMAND_PARALLEL_NOTE} run git status (never -uall flag), git diff, git log in parallel
|
|
||||||
2. Draft concise commit message (1-2 sentences, focus on "why")
|
|
||||||
3. Stage files, commit with HEREDOC format, then git status to verify:
|
|
||||||
<example>
|
|
||||||
git commit -m "$(cat <<'EOF'
|
|
||||||
Commit message here.${COMMIT_CO_AUTHORED_BY_CLAUDE_CODE?`
|
|
||||||
|
|
||||||
${COMMIT_CO_AUTHORED_BY_CLAUDE_CODE}`:""}
|
|
||||||
EOF
|
|
||||||
)"
|
|
||||||
</example>
|
|
||||||
4. If hook fails: fix the issue and create a NEW commit (not --amend)
|
|
||||||
|
|
||||||
Notes:
|
|
||||||
- Do NOT push unless explicitly asked
|
|
||||||
|
|
||||||
# Creating pull requests
|
|
||||||
|
|
||||||
Use \`gh\` CLI. ${GIT_COMMAND_PARALLEL_NOTE} check status, diff, log, \`git diff [base-branch]...HEAD\` to understand ALL commits (not just latest).
|
|
||||||
Create branch if needed, push with \`-u\` flag. Keep PR title under 70 chars. Use body for details.
|
|
||||||
View PR comments: \`gh api repos/{owner}/{repo}/pulls/{number}/comments\`
|
|
||||||
<example>
|
|
||||||
gh pr create --title "the pr title" --body "$(cat <<'EOF'
|
|
||||||
## Summary
|
|
||||||
<1-3 bullet points>
|
|
||||||
|
|
||||||
## Test plan
|
|
||||||
[Checklist...]${PR_GENERATED_WITH_CLAUDE_CODE?`
|
|
||||||
|
|
||||||
${PR_GENERATED_WITH_CLAUDE_CODE}`:""}
|
|
||||||
EOF
|
|
||||||
)"
|
|
||||||
</example>
|
|
||||||
|
|
||||||
Return the PR URL when done.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user