Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .cursor/skills/semantic-release-troubleshooting/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills need to live under plugins/<plugin-name>/skills/.cursor/skills/ isn't the right location. This is repo/release tooling, so plugins/pf-workflow/skills/semantic-release-troubleshooting/ would be the right home.

name: semantic-release-troubleshooting
description: >-
Diagnose and fix semantic-release issues when a specific version is not being
released. Use when semantic-release skips a version, fails to release, or when
troubleshooting after git push --force, squashed commits, permission errors,
or reference already exists.
---

# semantic-release Troubleshooting

When a specific version is not being released, follow this diagnostic workflow.

## 1. Identify the Problem

Determine which scenario matches:

| Symptom | Section |
|---------|---------|
| `You do not have permission to publish` (403) | → [Permission error](#permission-error) |
| Release skipped; commits not counted | → [Squashed commits](#squashed-commits) |
| `reference already exists` when pushing tag | → [Tag conflict](#tag-conflict) |
| Release not found after `git push --force` | → [History rewrite recovery](#history-rewrite-recovery) |

## 2. Permission Error

**Cause:** npm registry auth or package name/ownership issues.

**Verify package availability:**
```bash
npm install --global npm-name-cli
npm-name <package-name>
```

**Fix:** Update `package.json` if name is taken, or use an [npm scope](https://docs.npmjs.com/misc/scope). Check [npm registry authentication](https://github.com/semantic-release/npm#npm-registry-authentication) and user [publish permissions](https://docs.npmjs.com/cli/team).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

`Are these npm documentation URLs still valid:

  1. https://docs.npmjs.com/misc/scope
  2. https://github.com/semantic-release/npm#npm-registry-authentication
  3. https://docs.npmjs.com/cli/team`

💡 Result:

No, none of the provided URLs are currently valid. 1. https://docs.npmjs.com/misc/scope - Invalid. The current npm documentation for scopes is at https://docs.npmjs.com/cli/v11/using-npm/scope/ or https://docs.npmjs.com/about-scopes/. The /misc/ path no longer exists. 2. https://github.com/semantic-release/npm#npm-registry-authentication - Valid. The repository exists at https://github.com/semantic-release/npm, and the README contains a section titled "npm registry authentication". 3. https://docs.npmjs.com/cli/team - Invalid. The current npm documentation for the team command is at https://docs.npmjs.com/cli/v8/commands/npm-team/ (legacy v8 docs). No /cli/team path exists in current docs.

Citations:


Update two broken npm documentation links.

The scope link (https://docs.npmjs.com/misc/scope) no longer exists; use https://docs.npmjs.com/cli/v11/using-npm/scope/ or https://docs.npmjs.com/about-scopes/ instead. The team link (https://docs.npmjs.com/cli/team) should be updated to https://docs.npmjs.com/cli/v8/commands/npm-team/. The GitHub link is valid.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/skills/semantic-release-troubleshooting/SKILL.md at line 35, Update
the two outdated npm docs links in the SKILL.md "Fix:" line: replace the scope
URL `https://docs.npmjs.com/misc/scope` with a current scope doc such as
`https://docs.npmjs.com/cli/v11/using-npm/scope/` (or
`https://docs.npmjs.com/about-scopes/`), and replace the team URL
`https://docs.npmjs.com/cli/team` with
`https://docs.npmjs.com/cli/v8/commands/npm-team/` so the "Fix:" sentence points
to valid, up-to-date npm documentation.


## 3. Squashed Commits

**Cause:** semantic-release uses [commit message convention](https://github.com/semantic-release/semantic-release#commit-message-format). Squashed commits often get non-compliant messages and are ignored.

**Fix:** Rewrite the squashed commit message to follow the convention (e.g. `feat:`, `fix:`, `fix!:`, `BREAKING CHANGE:`). One squashed commit = one logical change; avoid combining unrelated features.

## 4. Tag Conflict (`reference already exists`)

**Cause:** A tag with the target version exists but is not in the current branch's history.

**Diagnose:**
```bash
# Does the tag exist?
git rev-list -1 <tag name>

# Which branches contain this tag?
git branch --contains <tag name>
```

**If the release was published:** Merge the commits from that release into your release branch.

**If no published release:** Delete the tag:
```bash
git tag -d <tag name>
git push origin :refs/tags/<tag name>
```

## 5. History Rewrite Recovery (after `git push --force`)

**Cause:** `git push --force` rewrites history; tags and git notes tied to old commits become invalid.

**Recovery steps** (in order):

1. **Delete the orphaned tags** (remote then local):
```bash
git push origin -d :<TAG NAME> # e.g. git push origin -d :v2.0.0-beta.1
git tag -d <TAG NAME>
```
Comment on lines +70 to +74
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify git push syntax for deleting remote tags
git push --help | grep -A 5 "delete refs"

Repository: patternfly/ai-helpers

Length of output: 162


🏁 Script executed:

#!/bin/bash
# Check if the file exists and view the content around lines 70-74
if [ -f ".cursor/skills/semantic-release-troubleshooting/SKILL.md" ]; then
  echo "File found. Content around lines 70-74:"
  sed -n '65,80p' ".cursor/skills/semantic-release-troubleshooting/SKILL.md"
else
  echo "File not found. Searching for similar files..."
  find . -name "SKILL.md" -o -name "*semantic-release*" 2>/dev/null | head -20
fi

Repository: patternfly/ai-helpers

Length of output: 556


🌐 Web query:

git push delete remote tag syntax -d colon prefix

💡 Result:

To delete a remote Git tag using git push, there are two primary syntaxes: 1. Modern syntax (Git 1.8+): git push origin --delete or git push origin -d 2. Colon prefix syntax (older/precise): git push origin :refs/tags/ The colon syntax pushes an empty source reference (before the colon) to the destination refs/tags/, effectively deleting it on the remote. Use refs/tags/ prefix to avoid ambiguity if a branch with the same name exists. Optionally delete locally first: git tag -d Examples: git push origin --delete v1.0 # or git push origin :refs/tags/v1.0 The --delete flag is equivalent to prefixing with colon and is more intuitive. Both are supported in current Git versions (up to 2.53+ as of 2026).

Citations:


Fix incorrect git push syntax for deleting remote tags.

Line 72 contains git push origin -d :<TAG NAME>, which mixes two incompatible deletion syntaxes. The -d flag and : prefix are mutually exclusive approaches. Use one or the other:

  • Modern (recommended): git push origin -d <TAG NAME>
  • Older syntax: git push origin :<TAG NAME>
Proposed fix
-   git push origin -d :<TAG NAME>   # e.g. git push origin -d :v2.0.0-beta.1
+   git push origin -d <TAG NAME>    # e.g. git push origin -d v2.0.0-beta.1
    git tag -d <TAG NAME>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.cursor/skills/semantic-release-troubleshooting/SKILL.md around lines 70 -
74, Replace the incorrect git push usage in the "Delete the orphaned tags" step
where the command currently shows `git push origin -d :<TAG NAME>`; use a valid
single-syntax form instead — either the modern form `git push origin -d <TAG
NAME>` (recommended) or the older refspec form `git push origin :<TAG NAME>` —
and update the example and explanatory text accordingly so the snippet no longer
mixes `-d` with the colon refspec.


2. **Re-create the tags** on the new commit:
```bash
git tag <TAG NAME> <COMMIT HASH> # e.g. git tag v2.0.0-beta.1 abcdef0
```

3. **Re-create git notes** for each tag:
```bash
# Beta/pre-release channel only
git notes --ref semantic-release add -f -m '{"channels":["beta"]}' <TAG NAME>

# Also on default channel (master/main)
git notes --ref semantic-release add -f -m '{"channels":[null,"beta"]}' <TAG NAME>
```

4. **Push the notes** (force required after rebase):
```bash
git push --force origin refs/notes/semantic-release
```

## Reference

Full documentation: [semantic-release Troubleshooting](https://semantic-release.gitbook.io/semantic-release/support/troubleshooting)