Skip to content

GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.

refactor(new-release): enhance skill description and safety rules for GitHub release process

Aldino Kemal3ce2e76f8d56
diff --git a/.agents/skills/new-release/SKILL.md b/.agents/skills/new-release/SKILL.md
index a0a202c9..30951730 100644
--- a/.agents/skills/new-release/SKILL.md
+++ b/.agents/skills/new-release/SKILL.md
@@ -1,11 +1,11 @@
---
name: new-release
-description: Use when publishing a new stable GitHub release for this project after updating its hardcoded AppVersion.
+description: Prepare and publish a stable GitHub release for this project by updating the hardcoded AppVersion, testing, committing, pushing main, creating the matching tag, and verifying the release. Use only for an explicit $new-release vX.Y.Z invocation.
---
# New Release
-Release only an already-prepared, tested `main` commit. This skill never edits source, release notes, tags, or releases except for the single confirmed tag push.
+Publish a stable release from a clean, current `main` checkout. After the sole affirmative confirmation, update only `AppVersion`, test, commit, push `main`, push the tag, and verify the GitHub release. Do not create release notes or run `gh release create`.
## Argument contract
@@ -13,33 +13,44 @@ Accept exactly one argument: a stable version matching `^v[0-9]+\.[0-9]+\.[0-9]+
## Safety rules
-- Never edit `AppVersion`, release notes, or any repository file. Stop and tell the user to prepare those changes separately.
-- Never run `gh release create`.
-- Never force, move, overwrite, reuse, or delete tags or releases.
+- Run every Git and GitHub command from the repository root returned by `git rev-parse --show-toplevel`.
+- Never force, move, overwrite, reuse, or delete a branch, tag, or release.
+- Make no mutation before the user replies exactly `yes`.
+- After confirmation, edit only `src/config/settings.go`; commit only that file.
- Treat only the documented absence statuses as availability. Stop on every command, network, authentication, authorization, parsing, or API error.
## Preflight
-1. Resolve the repository root with `git rev-parse --show-toplevel` and run every command from it. Read fetch URLs with `git remote get-url --all origin` and push URLs with `git remote get-url --push --all origin`. Require each command to succeed and return exactly one nonempty URL; call them `fetch_url` and `push_url`. Normalize each with `gh repo view <url> --json nameWithOwner --jq .nameWithOwner` and require both to equal `aldinokemal/go-whatsapp-web-multidevice`; require `gh auth status` to succeed.
-2. Run `git fetch origin main --tags --prune`. Require branch `main`, an empty `git status --porcelain=v1`, and `git rev-parse HEAD` exactly equal to `git rev-parse origin/main`.
-3. In `src/config/settings.go`, find exactly one declaration matching `^\s*AppVersion\s*=`. Extract its quoted value and require exact equality with the requested version; otherwise stop without editing it.
-4. Check the exact local ref `refs/tags/<version>` with `git show-ref --verify --quiet`. Continue only on its expected absent exit status; stop if present or if any other error occurs. Check the exact remote ref on `push_url` with `git ls-remote --exit-code --refs --tags <push_url> refs/tags/<version>`; continue only on exit status `2` (absent), stop on `0` (present) or any other result.
-5. Perform an exact GitHub Release lookup with `gh api -i repos/aldinokemal/go-whatsapp-web-multidevice/releases/tags/<version>`. Continue only after an explicit HTTP `404` not-found response. Stop if a release is returned or the response is any other API, network, authentication, authorization, or permission error.
-6. Run `go test ./...` from `src/` and require success. Return to the repository root. Record `validated_sha=$(git rev-parse HEAD)` and `subject=$(git log -1 --format=%s "$validated_sha")`.
-7. Show the exact repository, requested version, detected `AppVersion`, full validated SHA, and subject. Output this confirmation prompt verbatim, replacing only placeholders: `Push tag <version> at <validated_sha>? [yes/no]` Do not paraphrase it or add signing, release-creation, or other actions.
+1. Read fetch URLs with `git remote get-url --all origin` and push URLs with `git remote get-url --push --all origin`. Require each command to succeed and return exactly one nonempty URL; call them `fetch_url` and `push_url`. Normalize each with `gh repo view <url> --json nameWithOwner --jq .nameWithOwner` and require both to equal `aldinokemal/go-whatsapp-web-multidevice`. Require `gh auth status` to succeed.
+2. Run `git fetch origin main --tags --prune`. Require branch `main`, empty `git status --porcelain=v1`, and `git rev-parse HEAD` exactly equal to `git rev-parse origin/main`. Record that SHA as `base_sha` and its subject.
+3. In `src/config/settings.go`, find exactly one declaration matching `^\s*AppVersion\s*=`. Extract its quoted value as `current_version`. Require it to be a stable version and not equal the requested version. Do not edit it yet.
+4. Check exact local ref `refs/tags/<version>` with `git show-ref --verify --quiet`. Continue only on expected absent exit status; stop if present or any other error. Check exact remote ref with `git ls-remote --exit-code --refs --tags <push_url> refs/tags/<version>`; continue only on exit status `2` (absent), stop on `0` (present) or any other result.
+5. Run `gh api -i repos/aldinokemal/go-whatsapp-web-multidevice/releases/tags/<version>`. Continue only after an explicit HTTP `404` not-found response. Stop if a release is returned or any other API, network, authentication, authorization, or permission error occurs.
+6. Run `go test ./...` from `src/`, require success, then return to the repository root.
+7. Show exact repository, requested version, detected `current_version`, full `base_sha`, and subject. Output this confirmation prompt verbatim, replacing only placeholders: `Update AppVersion to <version>, commit, push main, and tag the release? [yes/no]`
-## Confirmation and tag push
+## Confirmation, version commit, and tag push
-Stop without mutation unless the user replies `yes` affirmatively. Immediately before any mutation, repeat the fetch/push URL collection, exactly-one-nonempty-URL, and repository-identity checks above, then run `git fetch origin main --tags --prune` to refresh remote state. Require branch `main`, empty porcelain status, `HEAD`, freshly read `origin/main`, and the validated SHA all equal `validated_sha`; recheck the exact local and remote tag absence using the same expected-status rules above, and recheck that the exact GitHub Release lookup returns explicit HTTP `404`.
+Stop without mutation unless the user replies exactly `yes`.
-Only then run `git tag <version> <validated_sha>` followed by `git push origin refs/tags/<version>:refs/tags/<version>`. Do not add force flags or push any other ref. If tag creation fails, stop and report it. If the push fails, do not retry, delete, force, or clean up: read back the exact local ref and the exact remote ref on the sole validated `push_url` using the same checks above, and report each as `present`, `absent`, or `unknown` when its read-back has an operational error; then stop.
+Immediately before mutation, repeat preflight steps 1, 2, 4, and 5. Require the freshly read `HEAD` and `origin/main` both equal `base_sha`, clean porcelain status, and unchanged tag/release absence. Re-read `AppVersion` and require it still equals `current_version`.
+
+Then perform this sequence:
+
+1. Change the single `AppVersion` declaration in `src/config/settings.go` to the requested version. Do not alter whitespace or any other file.
+2. Require `git diff --check` to succeed. Require `git diff --name-only` to output only `src/config/settings.go`, and require the diff to replace exactly the `AppVersion` quoted value from `current_version` to the requested version.
+3. Run `go test ./...` from `src/` and require success. Return to the repository root.
+4. Stage exactly `src/config/settings.go`. Require `git diff --cached --name-only` to output only that path. Create exactly one commit with `git commit -m "chore(release): <version>"`. Record `release_sha=$(git rev-parse HEAD)` and require it differs from `base_sha`.
+5. Push only the release commit to main using `git push origin HEAD:refs/heads/main`. If the push fails, stop without retrying, forcing, resetting, or cleaning up. Read `git rev-parse HEAD`, `git rev-parse origin/main`, and `git status --porcelain=v1`; report the evidence and ask for direction.
+6. Run `git fetch origin main --tags --prune`; require local `HEAD`, freshly read `origin/main`, and `release_sha` all equal. Recheck exact local and remote tag absence and exact release HTTP `404` as above.
+7. Run `git tag <version> <release_sha>` followed by `git push origin refs/tags/<version>:refs/tags/<version>`. Do not add force flags or push any other ref. If tag creation fails, stop and report it. If tag push fails, do not retry, delete, force, or clean up. Read back the exact local and remote tag refs and report each as `present`, `absent`, or `unknown` when its read-back has an operational error; then stop.
## Workflow verification
-For no more than two minutes after the push, poll `gh run list --workflow release.yml --branch <version> --json databaseId,event,headSha,status,conclusion,url --limit 20`. Select only a run whose `event` is `push` and whose `headSha` equals `validated_sha`; show each observed status/progress. Stop and report failure if no matching push run appears before the deadline.
+For no more than two minutes after the tag push, poll `gh run list --workflow release.yml --branch <version> --json databaseId,event,headSha,status,conclusion,url --limit 20`. Select only a run whose `event` is `push` and whose `headSha` equals `release_sha`; show each observed status/progress. Stop and report failure if no matching push run appears before the deadline.
-Run `gh run watch <run-id> --exit-status`. Require success and report its terminal state and URL. Then run `gh release view <version> --json tagName,isDraft,isPrerelease,url,publishedAt,targetCommitish`; require exact `tagName`, `isDraft=false`, and `isPrerelease=false`, then report the published release URL. Stop and report any mismatch or lookup error.
+Run `gh run watch <run-id> --exit-status`. Require success and report terminal state and URL. Then run `gh release view <version> --json tagName,isDraft,isPrerelease,url,publishedAt,targetCommitish`; require exact `tagName`, `isDraft=false`, `isPrerelease=false`, and `targetCommitish` equal to `release_sha`; then report the published release URL. Stop and report any mismatch or lookup error.
## Failure reporting
-On every stop, state the failed check, the observed safe evidence, and that no further mutation was performed. After a push failure, include the exact local and remote tag read-back states, preserving `unknown` for any read-back error. Do not suggest changing version state, creating a release directly, reusing an existing tag, or deleting a failed tag. After a pushed tag, report the failed workflow or release evidence and ask the user for direction.
+On every stop, state the failed check, observed safe evidence, and whether a mutation has occurred. Before confirmation, report that no mutation was performed. After the version commit or `main` push, report local and remote SHA/status evidence and ask for direction; never repair state autonomously. After a pushed tag, report the failed workflow or release evidence and ask the user for direction.
diff --git a/.agents/skills/new-release/agents/openai.yaml b/.agents/skills/new-release/agents/openai.yaml
index 0b0e4aa5..c879d2c2 100644
--- a/.agents/skills/new-release/agents/openai.yaml
+++ b/.agents/skills/new-release/agents/openai.yaml
@@ -1,4 +1,4 @@
interface:
display_name: "New Release"
- short_description: "Safely publish a tagged project release"
- default_prompt: "Use $new-release v9.1.0 to publish and verify a project release."
+ short_description: "Version, commit, push, tag, and verify a release"
+ default_prompt: "Use $new-release v9.1.0 to version, publish, and verify a project release."