diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 756d1333..b15fe3eb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,18 +4,31 @@ on: push: branches: - main + pull_request: + types: [closed] + branches: + - main permissions: contents: write + issues: write pull-requests: write jobs: release: runs-on: ubuntu-latest steps: + - name: Generate bot app token + id: generate_token + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.MY_RELEASER_ID }} + private-key: ${{ secrets.MY_RELEASER_PRIVATE_KEY }} + - name: Checkout uses: actions/checkout@v4 with: + token: ${{ steps.generate_token.outputs.token }} fetch-depth: 0 persist-credentials: false @@ -26,12 +39,24 @@ jobs: - name: Install dependencies run: | + npm ci sudo apt-get update sudo apt-get install -y jq python3 + - name: Setup Bats and bats libs + id: setup-bats + uses: bats-core/bats-action@3.0.1 + + - name: Run tests + shell: bash + env: + BATS_LIB_PATH: ${{ steps.setup-bats.outputs.lib-path }} + TERM: xterm + run: bats tests/ + - name: Release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} GIT_AUTHOR_NAME: github-actions[bot] GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com GIT_COMMITTER_NAME: github-actions[bot] @@ -44,43 +69,51 @@ jobs: # Configure git to use GITHUB_TOKEN for push git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/" - # Save current state - CURRENT_HEAD=$(git rev-parse HEAD) - git diff --quiet || CURRENT_DIFF="changed" + # Check if this is a PR merge event (only run if merged, not just closed) + if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.event.pull_request.merged }}" == "true" ]]; then + echo "PR merged, running final release..." - # Run semantic-release to update version files - npx semantic-release + # Run semantic-release to create GitHub Release and tags + npx semantic-release - # Check if files were modified (semantic-release updated version files) - if ! git diff --quiet; then - echo "Release changes detected, creating PR..." + echo "Release completed!" + else + echo "Push to main, preparing release PR..." - # Get the new version from marketplace.json (all plugins have the same version) - VERSION=$(node -p "require('./.claude-plugin/marketplace.json').plugins[0].version") + # Run semantic-release to update version files only + npx semantic-release - # Commit the changes - git add . - git commit -m "chore(release): ${VERSION} + # Check if files were modified (semantic-release updated version files) + if ! git diff --quiet; then + echo "Release changes detected, creating PR..." - This automated release updates version numbers across all plugins. - " + # Get the new version from marketplace.json (all plugins have the same version) + VERSION=$(node -p "require('./.claude-plugin/marketplace.json').plugins[0].version") - # Create release branch and push (version-specific branch to avoid force-push issues) - RELEASE_BRANCH="release-v${VERSION}" - git checkout -b "${RELEASE_BRANCH}" - git push origin "${RELEASE_BRANCH}" + # Commit the changes + git add . + git commit -m "chore(release): ${VERSION} - # Create PR - if gh pr view "${RELEASE_BRANCH}" --state open >/dev/null 2>&1; then - echo "PR already exists for ${VERSION}" - else - gh pr create --base main --head "${RELEASE_BRANCH}" --title "chore(release): ${VERSION}" --body "Automated release PR created by semantic-release + This automated release updates version numbers across all plugins. + " + + # Create release branch and push (version-specific branch to avoid force-push issues) + RELEASE_BRANCH="release-v${VERSION}" + git checkout -b "${RELEASE_BRANCH}" + git push origin "${RELEASE_BRANCH}" - Changes: - - Version bump to ${VERSION} - - All plugin versions updated - " + # Create PR + if gh pr view "${RELEASE_BRANCH}" --state open >/dev/null 2>&1; then + echo "PR already exists for ${VERSION}" + else + gh pr create --base main --head "${RELEASE_BRANCH}" --title "chore(release): ${VERSION}" --body "Automated release PR created by semantic-release + + Changes: + - Version bump to ${VERSION} + - All plugin versions updated + " + fi + else + echo "No release needed" fi - else - echo "No release needed" fi diff --git a/plugins/me/commands/brainstorm.md b/plugins/me/commands/brainstorm.md index 0fb3a894..5a4c84e8 100644 --- a/plugins/me/commands/brainstorm.md +++ b/plugins/me/commands/brainstorm.md @@ -1,5 +1,6 @@ --- description: "You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores requirements and design before implementation." +argument-hint: [] disable-model-invocation: true --- diff --git a/plugins/me/commands/debug.md b/plugins/me/commands/debug.md index d3b21970..4d0de801 100644 --- a/plugins/me/commands/debug.md +++ b/plugins/me/commands/debug.md @@ -1,5 +1,6 @@ --- description: Use and follow the systematic-debugging skill exactly as written +argument-hint: [] --- Use the systematic-debugging skill to debug this issue properly, following the four-phase process to find the root cause before attempting any fixes. diff --git a/plugins/me/commands/orchestrate.md b/plugins/me/commands/orchestrate.md index 120d47bc..cde5ada7 100644 --- a/plugins/me/commands/orchestrate.md +++ b/plugins/me/commands/orchestrate.md @@ -1,6 +1,7 @@ --- name: orchestrate description: Execute sequential agent workflows for complex development tasks +argument-hint: --- # Orchestrate - Sequential Agent Workflows diff --git a/plugins/me/commands/refactor-clean.md b/plugins/me/commands/refactor-clean.md new file mode 100644 index 00000000..9cc60e8d --- /dev/null +++ b/plugins/me/commands/refactor-clean.md @@ -0,0 +1,33 @@ +--- +description: "Safely identify and remove dead code with test verification. Detects unused code, dependencies, and files regardless of programming language or framework." +argument-hint: [] +disable-model-invocation: true +--- + +Safely identify and remove dead code with test verification: + +1. Detect dead code using appropriate tools for the codebase: + - Detect unused exports, functions, classes, and modules + - Find unused dependencies and imports + - Identify unreferenced files and assets + - Look for dead code patterns specific to the project's language + +2. Generate comprehensive report in .reports/dead-code-analysis.md + +3. Categorize findings by severity: + - SAFE: Test files, unused utilities, commented code + - CAUTION: API routes, components, modules that might be used dynamically + - DANGER: Config files, main entry points, framework-specific files + +4. Propose safe deletions only + +5. Before each deletion: + - Run full test suite + - Verify tests pass + - Apply change + - Re-run tests + - Rollback if tests fail + +6. Show summary of cleaned items + +Never delete code without running tests first! diff --git a/plugins/me/commands/research.md b/plugins/me/commands/research.md index e69100f6..89373550 100644 --- a/plugins/me/commands/research.md +++ b/plugins/me/commands/research.md @@ -1,5 +1,6 @@ --- description: Web research with citations and evidence-based analysis +argument-hint: [] --- Use and follow the research skill exactly as written. diff --git a/plugins/me/commands/sdd.md b/plugins/me/commands/sdd.md index 7118effc..03997900 100644 --- a/plugins/me/commands/sdd.md +++ b/plugins/me/commands/sdd.md @@ -1,5 +1,6 @@ --- description: Execute commands using subagent-driven development approach +argument-hint: [] --- Load the subagent-driven-development skill first, then use the skill to execute any task or command. diff --git a/plugins/me/commands/verify.md b/plugins/me/commands/verify.md index 2bf9d0cb..26d75761 100644 --- a/plugins/me/commands/verify.md +++ b/plugins/me/commands/verify.md @@ -1,6 +1,7 @@ --- name: verify description: Run comprehensive verification on current codebase state +argument-hint: [quick|full|pre-commit|pre-pr] --- # Verify - Comprehensive Codebase Verification