@dahawa/hawa-code 2.4.50 → 2.4.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dahawa/hawa-code",
3
- "version": "2.4.50",
3
+ "version": "2.4.52",
4
4
  "bin": {
5
5
  "hcode": "hawa.js"
6
6
  },
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: git-convention
3
+ description: Hawa Code git usage conventions. Load this skill for ANY git-related task, including: creating commits (git commit), analyzing commit history and records (git log / commit analysis), creating pull requests, and viewing branches or change status. Covers commit message format, git safety rules (no force push, amend restrictions, never skip hooks) and the PR creation workflow.
4
+ user-invocable: true
5
+ disable-model-invocation: false
6
+ ---
7
+
8
+ # Committing changes with git
9
+
10
+ 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:
11
+
12
+ Git Safety Protocol:
13
+ - NEVER update the git config
14
+ - NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
15
+ - NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
16
+ - NEVER run force push to main/master, warn the user if they request it
17
+ - Avoid git commit --amend. ONLY use --amend when ALL conditions are met:
18
+ (1) User explicitly requested amend, OR commit SUCCEEDED but pre-commit hook auto-modified files that need including
19
+ (2) HEAD commit was created by you in this conversation (verify: git log -1 --format='%an %ae')
20
+ (3) Commit has NOT been pushed to remote (verify: git status shows \"Your branch is ahead\")
21
+ - CRITICAL: If commit FAILED or was REJECTED by hook, NEVER amend - fix the issue and create a NEW commit
22
+ - CRITICAL: If you already pushed to remote, NEVER amend unless user explicitly requests it (requires force push)
23
+ - 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.
24
+
25
+ 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:
26
+ - Run a git status command to see all untracked files.
27
+ - Run a git diff command to see both staged and unstaged changes that will be committed.
28
+ - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
29
+ 2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:
30
+ - 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.).
31
+ - Do not commit files that likely contain secrets (.env, credentials.json, etc). Warn the user if they specifically request to commit those files
32
+ - Draft a concise (1-2 sentences) commit message that focuses on the \"why\" rather than the \"what\"
33
+ - Ensure it accurately reflects the changes and their purpose
34
+ 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:
35
+ - Add relevant untracked files to the staging area.
36
+ - Create the commit with a message ending with:
37
+ 🤖 Generated with [Hawa Code](https://github.com/italking/hawa-code)
38
+
39
+ Co-Authored-By: Hawa Code <noreply@hawacode.com>
40
+ - Run git status after the commit completes to verify success.
41
+ Note: git status depends on the commit completing, so run it sequentially after the commit.
42
+ 4. If the commit fails due to pre-commit hook, fix the issue and create a NEW commit (see amend rules above)
43
+
44
+
45
+ Important notes:
46
+ - NEVER run additional commands to read or explore code, besides git bash commands
47
+ - NEVER use the TodoWrite or Task tools
48
+ - DO NOT push to the remote repository unless the user explicitly asks you to do so
49
+ - 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.
50
+ - If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
51
+ - In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:
52
+ <example>
53
+ git commit -m \"$(cat <<'EOF'
54
+ Commit message here.
55
+
56
+ 🤖 Generated with [Hawa Code](https://github.com/italking/hawa-code)
57
+
58
+ Co-Authored-By: Hawa Code <noreply@hawacode.com>
59
+ EOF
60
+ )\"
61
+ </example>
62
+
63
+ # Creating pull requests
64
+ 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.
65
+
66
+ IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
67
+
68
+ 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:
69
+ - Run a git status command to see all untracked files
70
+ - Run a git diff command to see both staged and unstaged changes that will be committed
71
+ - 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
72
+ - 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)
73
+ 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
74
+ 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:
75
+ - Create new branch if needed
76
+ - Push to remote with -u flag if needed
77
+ - Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
78
+ <example>
79
+ gh pr create --title \"the pr title\" --body \"$(cat <<'EOF'
80
+ ## Summary
81
+ <1-3 bullet points>
82
+
83
+ ## Test plan
84
+ [Bulleted markdown checklist of TODOs for testing the pull request...]
85
+
86
+ 🤖 Generated with [Hawa Code](https://github.com/italking/hawa-code)
87
+ EOF
88
+ )\"
89
+ </example>
90
+
91
+ Important:
92
+ - DO NOT use the TodoWrite or Task tools
93
+ - Return the PR URL when you're done, so the user can see it
94
+
95
+ # Other common operations
96
+ - View comments on a Github PR: gh api repos/foo/bar/pulls/123/comments`