Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

blocklet-updater

БесплатноБез исполняемых скриптовНе проверен

Creates a new release for a blocklet project by bumping version, building, and bundling. Use when asked to "create a new release", "bump and bundle", or…

aiskillstoreот aiskillstore★ 509 звёзд на GitHub

Об этом скилле

Blocklet Updater

Bumps a blocklet project version and creates a release bundle.

Workflow

1. Version Bump (Smart Detection)

Check for project-specific version update scripts before falling back to blocklet version patch.

1.1 Detect Version Update Method

Check the following in priority order and use the first match:

Priority Detection Command
1 Makefile has bump-version target make bump-version
2 package.json has bump-version script pnpm run bump-version
3 package.json has version script pnpm run version
4 lerna.json exists lerna version patch --yes
5 None of the above blocklet version patch (fallback)

Detection commands:

# Priority 1: Check Makefile for bump-version target
if [ -f "Makefile" ] && grep -q "^bump-version:" Makefile 2>/dev/null; then
    VERSION_CMD="make bump-version"
fi

# Priority 2: Check package.json for bump-version script
if [ -z "$VERSION_CMD" ] && [ -f "package.json" ]; then
    if cat package.json | jq -e '.scripts["bump-version"]' > /dev/null 2>&1; then
        VERSION_CMD="pnpm run bump-version"
    fi
fi

# Priority 3: Check package.json for version script
if [ -z "$VERSION_CMD" ] && [ -f "package.json" ]; then
    if cat package.json | jq -e '.scripts["version"]' > /dev/null 2>&1; then
        VERSION_CMD="pnpm run version"
    fi
fi

# Priority 4: Check for lerna.json
if [ -z "$VERSION_CMD" ] && [ -f "lerna.json" ]; then
    VERSION_CMD="lerna version patch --yes"
fi

# Priority 5: Fallback to blocklet version
if [ -z "$VERSION_CMD" ]; then
    VERSION_CMD="blocklet version patch"
fi

1.2 Execute Version Bump

Run the detected command:

$VERSION_CMD

Important: Project-specific scripts (like make bump-version) often:

  • Update version file
  • Auto-generate CHANGELOG.md entries
  • Update multiple package versions in monorepos
  • Call additional tooling scripts

If fails → EXIT with error output.

1.3 Update CHANGELOG (If Exists)

After version bump, verify and fix CHANGELOG.md if needed.

1.3.1 Get Actual Version

First, get the actual version that was set (from blocklet.yml or package.json):

# Get version from blocklet.yml
ACTUAL_VERSION=$(grep -E "^version:" blocklet.yml | sed 's/version: *//' | tr -d '"'"'" 2>/dev/null)

# Fallback to package.json if no blocklet.yml
if [ -z "$ACTUAL_VERSION" ]; then
    ACTUAL_VERSION=$(cat package.json | jq -r '.version' 2>/dev/null)
fi
1.3.2 Find CHANGELOG Location
# Common CHANGELOG locations in monorepos
CHANGELOG_PATHS=(
    "CHANGELOG.md"
    "blocklets/*/CHANGELOG.md"
    "packages/*/CHANGELOG.md"
)

for pattern in "${CHANGELOG_PATHS[@]}"; do
    for file in $pattern; do
        if [ -f "$file" ]; then
            echo "Found: $file"
        fi
    done
done
1.3.3 Validate CHANGELOG Entry

For each CHANGELOG.md found, check if the latest entry matches the actual version:

# Extract first version number from CHANGELOG.md
CHANGELOG_VERSION=$(grep -E "^## \[?[0-9]+\.[0-9]+\.[0-9]+\]?" CHANGELOG.md | head -1 | grep -oE "[0-9]+\.[0-9]+\.[0-9]+")

if [ "$CHANGELOG_VERSION" != "$ACTUAL_VERSION" ]; then
    echo "⚠️ Version mismatch!"
    echo "   CHANGELOG shows: $CHANGELOG_VERSION"
    echo "   Actual version:  $ACTUAL_VERSION"
fi
1.3.4 Fix Version Mismatch

If CHANGELOG version doesn't match actual version, fix it:

  1. If CHANGELOG has a newer entry with wrong version (e.g., script partially ran):

    • Replace the wrong version number with the correct one
  2. If CHANGELOG has no entry for the new version:

    • Add a new entry at the top
# Example fix: Replace wrong version in first heading
sed -i "0,/^## \[*$WRONG_VERSION\]*/s//## $ACTUAL_VERSION/" CHANGELOG.md
1.3.5 Check Entry Content

After fixing version, check if the entry has content:

# Get content between first ## and second ##
ENTRY_CONTENT=$(sed -n '/^## /,/^## /p' CHANGELOG.md | sed '1d;$d' | grep -v "^$")

if [ -z "$ENTRY_CONTENT" ]; then
    echo "⚠️ CHANGELOG entry is empty, needs content"
fi
1.3.6 Generate Content for Empty Entry

If entry is empty, generate content based on:

  1. Git commits since last version tag:
# Get commits since last tag
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -n "$LAST_TAG" ]; then
    git log $LAST_TAG..HEAD --oneline --no-merges
fi
  1. Categorize by commit type (feat, fix, chore, etc.):
## X.Y.Z (YYYY-MM-DD)

- feat: description of new feature
- fix: description of bug fix
- chore: description of maintenance task
  1. If no meaningful commits found, use AskUserQuestion to ask user for changelog content.
1.3.7 Common CHANGELOG Formats

Detect and follow the existing format:

Format Example
Keep a Changelog ## [1.2.3] - 2024-01-20
Simple with date `## 1.2.
Полный SKILL.md на GitHub

Установить blocklet-updater в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

errors.mdexamples.mdskill-report.json

FAQ

Что делает скилл blocklet-updater?

Creates a new release for a blocklet project by bumping version, building, and bundling. Use when asked to "create a new release", "bump and bundle", or "update blocklet version".

Как установить скилл blocklet-updater?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл blocklet-updater запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить blocklet-updater с