[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AEK4PTAMX3NPTC5JRAKXJ2":3,"skill-same:01M6AEK4PTAMX3NPTC5JRAKXJ2":83},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":29,"publishedAt":54,"linkOnly":55,"markdownContent":56,"markdownBody":57,"frontMatter":58,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":64,"ownerHtmlUrl":65,"ownerBlogUrl":66,"ownerDescription":67,"updatedAt":68,"install":69,"resources":82},"01M6AEK4PTAMX3NPTC5JRAKXJ2","github-workflow-automation",null,"Automate GitHub workflows with AI assistance. Includes PR reviews, issue triage, CI\u002FCD integration, and Git operations. Use when automating GitHub workflows, setting up PR review automation, creating GitHub Actions, or triaging issues.","davila7\u002Fclaude-code-templates","davila7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6216945?v=4","01M6ADEWWFPS191NFM0Y1EX1JH","Daniel Avila","01M6ADJHGM78PHQRD3XZTFDVKK",33418,"MIT","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Fgithub-workflow-automation\u002FSKILL.md",[18,23,26],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发",[30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53],"github","github workflow","github workflow automation","Workflow Automation","workflow","automation","github actions","review","when","reviews","CI\u002FCD","git operations","up","github workflows","triage","ci","actions","integration","issues","issue triage","git","pr","pr review","workflows","2026-11-10 10:12:30",false,"---\nname: github-workflow-automation\ndescription: \"Automate GitHub workflows with AI assistance. Includes PR reviews, issue triage, CI\u002FCD integration, and Git operations. Use when automating GitHub workflows, setting up PR review automation, creating GitHub Actions, or triaging issues.\"\n---\n\n# ? GitHub Workflow Automation\n\n> Patterns for automating GitHub workflows with AI assistance, inspired by [Gemini CLI](https:\u002F\u002Fgithub.com\u002Fgoogle-gemini\u002Fgemini-cli) and modern DevOps practices.\n\n## When to Use This Skill\n\nUse this skill when:\n\n- Automating PR reviews with AI\n- Setting up issue triage automation\n- Creating GitHub Actions workflows\n- Integrating AI into CI\u002FCD pipelines\n- Automating Git operations (rebases, cherry-picks)\n\n---\n\n## 1. Automated PR Review\n\n### 1.1 PR Review Action\n\n```yaml\n# .github\u002Fworkflows\u002Fai-review.yml\nname: AI Code Review\n\non:\n  pull_request:\n    types: [opened, synchronize]\n\njobs:\n  review:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      pull-requests: write\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Get changed files\n        id: changed\n        run: |\n          files=$(git diff --name-only origin\u002F${{ github.base_ref }}...HEAD)\n          echo \"files\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$files\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: Get diff\n        id: diff\n        run: |\n          diff=$(git diff origin\u002F${{ github.base_ref }}...HEAD)\n          echo \"diff\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$diff\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: AI Review\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const { Anthropic } = require('@anthropic-ai\u002Fsdk');\n            const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });\n\n            const response = await client.messages.create({\n              model: \"claude-sonnet-4-6\",\n              max_tokens: 4096,\n              messages: [{\n                role: \"user\",\n                content: `Review this PR diff and provide feedback:\n                \n                Changed files: ${{ steps.changed.outputs.files }}\n                \n                Diff:\n                ${{ steps.diff.outputs.diff }}\n                \n                Provide:\n                1. Summary of changes\n                2. Potential issues or bugs\n                3. Suggestions for improvement\n                4. Security concerns if any\n                \n                Format as GitHub markdown.`\n              }]\n            });\n\n            await github.rest.pulls.createReview({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              pull_number: context.issue.number,\n              body: response.content[0].text,\n              event: 'COMMENT'\n            });\n        env:\n          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### 1.2 Review Comment Patterns\n\n````markdown\n# AI Review Structure\n\n## ? Summary\n\nBrief description of what this PR does.\n\n## ✅ What looks good\n\n- Well-structured code\n- Good test coverage\n- Clear naming conventions\n\n## ⚠️ Potential Issues\n\n1. **Line 42**: Possible null pointer exception\n   ```javascript\n   \u002F\u002F Current\n   user.profile.name;\n   \u002F\u002F Suggested\n   user?.profile?.name ?? \"Unknown\";\n   ```\n````\n\n2. **Line 78**: Consider error handling\n   ```javascript\n   \u002F\u002F Add try-catch or .catch()\n   ```\n\n## ? Suggestions\n\n- Consider extracting the validation logic into a separate function\n- Add JSDoc comments for public methods\n\n## ? Security Notes\n\n- No sensitive data exposure detected\n- API key handling looks correct\n\n````\n\n### 1.3 Focused Reviews\n\n```yaml\n# Review only specific file types\n- name: Filter code files\n  run: |\n    files=$(git diff --name-only origin\u002F${{ github.base_ref }}...HEAD | \\\n            grep -E '\\.(ts|tsx|js|jsx|py|go)$' || true)\n    echo \"code_files=$files\" >> $GITHUB_OUTPUT\n\n# Review with context\n- name: AI Review with context\n  run: |\n    # Include relevant context files\n    context=\"\"\n    for file in ${{ steps.changed.outputs.files }}; do\n      if [[ -f \"$file\" ]]; then\n        context+=\"=== $file ===\\n$(cat $file)\\n\\n\"\n      fi\n    done\n\n    # Send to AI with full file context\n````\n\n---\n\n## 2. Issue Triage Automation\n\n### 2.1 Auto-label Issues\n\n```yaml\n# .github\u002Fworkflows\u002Fissue-triage.yml\nname: Issue Triage\n\non:\n  issues:\n    types: [opened]\n\njobs:\n  triage:\n    runs-on: ubuntu-latest\n    permissions:\n      issues: write\n\n    steps:\n      - name: Analyze issue\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const issue = context.payload.issue;\n\n            \u002F\u002F Call AI to analyze\n            const analysis = await analyzeIssue(issue.title, issue.body);\n\n            \u002F\u002F Apply labels\n            const labels = [];\n\n            if (analysis.type === 'bug') {\n              labels.push('bug');\n              if (analysis.severity === 'high') labels.push('priority: high');\n            } else if (analysis.type === 'feature') {\n              labels.push('enhancement');\n            } else if (analysis.type === 'question') {\n              labels.push('question');\n            }\n\n            if (analysis.area) {\n              labels.push(`area: ${analysis.area}`);\n            }\n\n            await github.rest.issues.addLabels({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: issue.number,\n              labels: labels\n            });\n\n            \u002F\u002F Add initial response\n            if (analysis.type === 'bug' && !analysis.hasReproSteps) {\n              await github.rest.issues.createComment({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                issue_number: issue.number,\n                body: `Thanks for reporting this issue!\n\nTo help us investigate, could you please provide:\n- Steps to reproduce the issue\n- Expected behavior\n- Actual behavior\n- Environment (OS, version, etc.)\n\nThis will help us resolve your issue faster. ?`\n              });\n            }\n```\n\n### 2.2 Issue Analysis Prompt\n\n```typescript\nconst TRIAGE_PROMPT = `\nAnalyze this GitHub issue and classify it:\n\nTitle: {title}\nBody: {body}\n\nReturn JSON with:\n{\n  \"type\": \"bug\" | \"feature\" | \"question\" | \"docs\" | \"other\",\n  \"severity\": \"low\" | \"medium\" | \"high\" | \"critical\",\n  \"area\": \"frontend\" | \"backend\" | \"api\" | \"docs\" | \"ci\" | \"other\",\n  \"summary\": \"one-line summary\",\n  \"hasReproSteps\": boolean,\n  \"isFirstContribution\": boolean,\n  \"suggestedLabels\": [\"label1\", \"label2\"],\n  \"suggestedAssignees\": [\"username\"] \u002F\u002F based on area expertise\n}\n`;\n```\n\n### 2.3 Stale Issue Management\n\n```yaml\n# .github\u002Fworkflows\u002Fstale.yml\nname: Manage Stale Issues\n\non:\n  schedule:\n    - cron: \"0 0 * * *\" # Daily\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fstale@v9\n        with:\n          stale-issue-message: |\n            This issue has been automatically marked as stale because it has not had \n            recent activity. It will be closed in 14 days if no further activity occurs.\n\n            If this issue is still relevant:\n            - Add a comment with an update\n            - Remove the `stale` label\n\n            Thank you for your contributions! ?\n\n          stale-pr-message: |\n            This PR has been automatically marked as stale. Please update it or it \n            will be closed in 14 days.\n\n          days-before-stale: 60\n          days-before-close: 14\n          stale-issue-label: \"stale\"\n          stale-pr-label: \"stale\"\n          exempt-issue-labels: \"pinned,security,in-progress\"\n          exempt-pr-labels: \"pinned,security\"\n```\n\n---\n\n## 3. CI\u002FCD Integration\n\n### 3.1 Smart Test Selection\n\n```yaml\n# .github\u002Fworkflows\u002Fsmart-tests.yml\nname: Smart Test Selection\n\non:\n  pull_request:\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    outputs:\n      test_suites: ${{ steps.analyze.outputs.suites }}\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Analyze changes\n        id: analyze\n        run: |\n          # Get changed files\n          changed=$(git diff --name-only origin\u002F${{ github.base_ref }}...HEAD)\n\n          # Determine which test suites to run\n          suites=\"[]\"\n\n          if echo \"$changed\" | grep -q \"^src\u002Fapi\u002F\"; then\n            suites=$(echo $suites | jq '. + [\"api\"]')\n          fi\n\n          if echo \"$changed\" | grep -q \"^src\u002Ffrontend\u002F\"; then\n            suites=$(echo $suites | jq '. + [\"frontend\"]')\n          fi\n\n          if echo \"$changed\" | grep -q \"^src\u002Fdatabase\u002F\"; then\n            suites=$(echo $suites | jq '. + [\"database\", \"api\"]')\n          fi\n\n          # If nothing specific, run all\n          if [ \"$suites\" = \"[]\" ]; then\n            suites='[\"all\"]'\n          fi\n\n          echo \"suites=$suites\" >> $GITHUB_OUTPUT\n\n  test:\n    needs: analyze\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        suite: ${{ fromJson(needs.analyze.outputs.test_suites) }}\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Run tests\n        run: |\n          if [ \"${{ matrix.suite }}\" = \"all\" ]; then\n            npm test\n          else\n            npm test -- --suite ${{ matrix.suite }}\n          fi\n```\n\n### 3.2 Deployment with AI Validation\n\n```yaml\n# .github\u002Fworkflows\u002Fdeploy.yml\nname: Deploy with AI Validation\n\non:\n  push:\n    branches: [main]\n\njobs:\n  validate:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Get deployment changes\n        id: changes\n        run: |\n          # Get commits since last deployment\n          last_deploy=$(git describe --tags --abbrev=0 2>\u002Fdev\u002Fnull || echo \"\")\n          if [ -n \"$last_deploy\" ]; then\n            changes=$(git log --oneline $last_deploy..HEAD)\n          else\n            changes=$(git log --oneline -10)\n          fi\n          echo \"changes\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$changes\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: AI Risk Assessment\n        id: assess\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            \u002F\u002F Analyze changes for deployment risk\n            const prompt = `\n            Analyze these changes for deployment risk:\n\n            ${process.env.CHANGES}\n\n            Return JSON:\n            {\n              \"riskLevel\": \"low\" | \"medium\" | \"high\",\n              \"concerns\": [\"concern1\", \"concern2\"],\n              \"recommendations\": [\"rec1\", \"rec2\"],\n              \"requiresManualApproval\": boolean\n            }\n            `;\n\n            \u002F\u002F Call AI and parse response\n            const analysis = await callAI(prompt);\n\n            if (analysis.riskLevel === 'high') {\n              core.setFailed('High-risk deployment detected. Manual review required.');\n            }\n\n            return analysis;\n        env:\n          CHANGES: ${{ steps.changes.outputs.changes }}\n\n  deploy:\n    needs: validate\n    runs-on: ubuntu-latest\n    environment: production\n    steps:\n      - name: Deploy\n        run: |\n          echo \"Deploying to production...\"\n          # Deployment commands here\n```\n\n### 3.3 Rollback Automation\n\n```yaml\n# .github\u002Fworkflows\u002Frollback.yml\nname: Automated Rollback\n\non:\n  workflow_dispatch:\n    inputs:\n      reason:\n        description: \"Reason for rollback\"\n        required: true\n\njobs:\n  rollback:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Find last stable version\n        id: stable\n        run: |\n          # Find last successful deployment\n          stable=$(git tag -l 'v*' --sort=-version:refname | head -1)\n          echo \"version=$stable\" >> $GITHUB_OUTPUT\n\n      - name: Rollback\n        run: |\n          git checkout ${{ steps.stable.outputs.version }}\n          # Deploy stable version\n          npm run deploy\n\n      - name: Notify team\n        uses: slackapi\u002Fslack-github-action@v1\n        with:\n          payload: |\n            {\n              \"text\": \"? Production rolled back to ${{ steps.stable.outputs.version }}\",\n              \"blocks\": [\n                {\n                  \"type\": \"section\",\n                  \"text\": {\n                    \"type\": \"mrkdwn\",\n                    \"text\": \"*Rollback executed*\\n• Version: `${{ steps.stable.outputs.version }}`\\n• Reason: ${{ inputs.reason }}\\n• Triggered by: ${{ github.actor }}\"\n                  }\n                }\n              ]\n            }\n```\n\n---\n\n## 4. Git Operations\n\n### 4.1 Automated Rebasing\n\n```yaml\n# .github\u002Fworkflows\u002Fauto-rebase.yml\nname: Auto Rebase\n\non:\n  issue_comment:\n    types: [created]\n\njobs:\n  rebase:\n    if: github.event.issue.pull_request && contains(github.event.comment.body, '\u002Frebase')\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n          token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Setup Git\n        run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n\n      - name: Rebase PR\n        run: |\n          # Fetch PR branch\n          gh pr checkout ${{ github.event.issue.number }}\n\n          # Rebase onto main\n          git fetch origin main\n          git rebase origin\u002Fmain\n\n          # Force push\n          git push --force-with-lease\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Comment result\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            github.rest.issues.createComment({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: context.issue.number,\n              body: '✅ Successfully rebased onto main!'\n            })\n```\n\n### 4.2 Smart Cherry-Pick\n\n```typescript\n\u002F\u002F AI-assisted cherry-pick that handles conflicts\nasync function smartCherryPick(commitHash: string, targetBranch: string) {\n  \u002F\u002F Get commit info\n  const commitInfo = await exec(`git show ${commitHash} --stat`);\n\n  \u002F\u002F Check for potential conflicts\n  const targetDiff = await exec(\n    `git diff ${targetBranch}...HEAD -- ${affectedFiles}`\n  );\n\n  \u002F\u002F AI analysis\n  const analysis = await ai.analyze(`\n    I need to cherry-pick this commit to ${targetBranch}:\n    \n    ${commitInfo}\n    \n    Current state of affected files on ${targetBranch}:\n    ${targetDiff}\n    \n    Will there be conflicts? If so, suggest resolution strategy.\n  `);\n\n  if (analysis.willConflict) {\n    \u002F\u002F Create branch for manual resolution\n    await exec(\n      `git checkout -b cherry-pick-${commitHash.slice(0, 7)} ${targetBranch}`\n    );\n    const result = await exec(`git cherry-pick ${commitHash}`, {\n      allowFail: true,\n    });\n\n    if (result.failed) {\n      \u002F\u002F AI-assisted conflict resolution\n      const conflicts = await getConflicts();\n      for (const conflict of conflicts) {\n        const resolution = await ai.resolveConflict(conflict);\n        await applyResolution(conflict.file, resolution);\n      }\n    }\n  } else {\n    await exec(`git checkout ${targetBranch}`);\n    await exec(`git cherry-pick ${commitHash}`);\n  }\n}\n```\n\n### 4.3 Branch Cleanup\n\n```yaml\n# .github\u002Fworkflows\u002Fbranch-cleanup.yml\nname: Branch Cleanup\n\non:\n  schedule:\n    - cron: '0 0 * * 0'  # Weekly\n  workflow_dispatch:\n\njobs:\n  cleanup:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Find stale branches\n        id: stale\n        run: |\n          # Branches not updated in 30 days\n          stale=$(git for-each-ref --sort=-committerdate refs\u002Fremotes\u002Forigin \\\n            --format='%(refname:short) %(committerdate:relative)' | \\\n            grep -E '[3-9][0-9]+ days|[0-9]+ months|[0-9]+ years' | \\\n            grep -v 'origin\u002Fmain\\|origin\u002Fdevelop' | \\\n            cut -d' ' -f1 | sed 's|origin\u002F||')\n\n          echo \"branches\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$stale\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: Create cleanup PR\n        if: steps.stale.outputs.branches != ''\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const branches = `${{ steps.stale.outputs.branches }}`.split('\\n').filter(Boolean);\n\n            const body = `## ? Stale Branch Cleanup\n\nThe following branches haven't been updated in over 30 days:\n\n${branches.map(b => `- \\`${b}\\``).join('\\n')}\n\n### Actions:\n- [ ] Review each branch\n- [ ] Delete branches that are no longer needed\n- Comment \\`\u002Fkeep branch-name\\` to preserve specific branches\n`;\n\n            await github.rest.issues.create({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              title: 'Stale Branch Cleanup',\n              body: body,\n              labels: ['housekeeping']\n            });\n```\n\n---\n\n## 5. On-Demand Assistance\n\n### 5.1 @mention Bot\n\n```yaml\n# .github\u002Fworkflows\u002Fmention-bot.yml\nname: AI Mention Bot\n\non:\n  issue_comment:\n    types: [created]\n  pull_request_review_comment:\n    types: [created]\n\njobs:\n  respond:\n    if: contains(github.event.comment.body, '@ai-helper')\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Extract question\n        id: question\n        run: |\n          # Extract text after @ai-helper\n          question=$(echo \"${{ github.event.comment.body }}\" | sed 's\u002F.*@ai-helper\u002F\u002F')\n          echo \"question=$question\" >> $GITHUB_OUTPUT\n\n      - name: Get context\n        id: context\n        run: |\n          if [ \"${{ github.event.issue.pull_request }}\" != \"\" ]; then\n            # It's a PR - get diff\n            gh pr diff ${{ github.event.issue.number }} > context.txt\n          else\n            # It's an issue - get description\n            gh issue view ${{ github.event.issue.number }} --json body -q .body > context.txt\n          fi\n          echo \"context=$(cat context.txt)\" >> $GITHUB_OUTPUT\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: AI Response\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const response = await ai.chat(`\n              Context: ${process.env.CONTEXT}\n              \n              Question: ${process.env.QUESTION}\n              \n              Provide a helpful, specific answer. Include code examples if relevant.\n            `);\n\n            await github.rest.issues.createComment({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: context.issue.number,\n              body: response\n            });\n        env:\n          CONTEXT: ${{ steps.context.outputs.context }}\n          QUESTION: ${{ steps.question.outputs.question }}\n```\n\n### 5.2 Command Patterns\n\n```markdown\n## Available Commands\n\n| Command              | Description                 |\n| :------------------- | :-------------------------- |\n| `@ai-helper explain` | Explain the code in this PR |\n| `@ai-helper review`  | Request AI code review      |\n| `@ai-helper fix`     | Suggest fixes for issues    |\n| `@ai-helper test`    | Generate test cases         |\n| `@ai-helper docs`    | Generate documentation      |\n| `\u002Frebase`            | Rebase PR onto main         |\n| `\u002Fupdate`            | Update PR branch from main  |\n| `\u002Fapprove`           | Mark as approved by bot     |\n| `\u002Flabel bug`         | Add 'bug' label             |\n| `\u002Fassign @user`      | Assign to user              |\n```\n\n---\n\n## 6. Repository Configuration\n\n### 6.1 CODEOWNERS\n\n```\n# .github\u002FCODEOWNERS\n\n# Global owners\n* @org\u002Fcore-team\n\n# Frontend\n\u002Fsrc\u002Ffrontend\u002F @org\u002Ffrontend-team\n*.tsx @org\u002Ffrontend-team\n*.css @org\u002Ffrontend-team\n\n# Backend\n\u002Fsrc\u002Fapi\u002F @org\u002Fbackend-team\n\u002Fsrc\u002Fdatabase\u002F @org\u002Fbackend-team\n\n# Infrastructure\n\u002F.github\u002F @org\u002Fdevops-team\n\u002Fterraform\u002F @org\u002Fdevops-team\nDockerfile @org\u002Fdevops-team\n\n# Docs\n\u002Fdocs\u002F @org\u002Fdocs-team\n*.md @org\u002Fdocs-team\n\n# Security-sensitive\n\u002Fsrc\u002Fauth\u002F @org\u002Fsecurity-team\n\u002Fsrc\u002Fcrypto\u002F @org\u002Fsecurity-team\n```\n\n### 6.2 Branch Protection\n\n```yaml\n# Set up via GitHub API\n- name: Configure branch protection\n  uses: actions\u002Fgithub-script@v7\n  with:\n    script: |\n      await github.rest.repos.updateBranchProtection({\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        branch: 'main',\n        required_status_checks: {\n          strict: true,\n          contexts: ['test', 'lint', 'ai-review']\n        },\n        enforce_admins: true,\n        required_pull_request_reviews: {\n          required_approving_review_count: 1,\n          require_code_owner_reviews: true,\n          dismiss_stale_reviews: true\n        },\n        restrictions: null,\n        required_linear_history: true,\n        allow_force_pushes: false,\n        allow_deletions: false\n      });\n```\n\n---\n\n## Best Practices\n\n### Security\n\n- [ ] Store API keys in GitHub Secrets\n- [ ] Use minimal permissions in workflows\n- [ ] Validate all inputs\n- [ ] Don't expose sensitive data in logs\n\n### Performance\n\n- [ ] Cache dependencies\n- [ ] Use matrix builds for parallel testing\n- [ ] Skip unnecessary jobs with path filters\n- [ ] Use self-hosted runners for heavy workloads\n\n### Reliability\n\n- [ ] Add timeouts to jobs\n- [ ] Handle rate limits gracefully\n- [ ] Implement retry logic\n- [ ] Have rollback procedures\n\n---\n\n## Resources\n\n- [Gemini CLI GitHub Action](https:\u002F\u002Fgithub.com\u002Fgoogle-github-actions\u002Frun-gemini-cli)\n- [GitHub Actions Documentation](https:\u002F\u002Fdocs.github.com\u002Fen\u002Factions)\n- [GitHub REST API](https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest)\n- [CODEOWNERS Syntax](https:\u002F\u002Fdocs.github.com\u002Fen\u002Frepositories\u002Fmanaging-your-repositorys-settings-and-features\u002Fcustomizing-your-repository\u002Fabout-code-owners)\n","# ? GitHub Workflow Automation\n\n> Patterns for automating GitHub workflows with AI assistance, inspired by [Gemini CLI](https:\u002F\u002Fgithub.com\u002Fgoogle-gemini\u002Fgemini-cli) and modern DevOps practices.\n\n## When to Use This Skill\n\nUse this skill when:\n\n- Automating PR reviews with AI\n- Setting up issue triage automation\n- Creating GitHub Actions workflows\n- Integrating AI into CI\u002FCD pipelines\n- Automating Git operations (rebases, cherry-picks)\n\n---\n\n## 1. Automated PR Review\n\n### 1.1 PR Review Action\n\n```yaml\n# .github\u002Fworkflows\u002Fai-review.yml\nname: AI Code Review\n\non:\n  pull_request:\n    types: [opened, synchronize]\n\njobs:\n  review:\n    runs-on: ubuntu-latest\n    permissions:\n      contents: read\n      pull-requests: write\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Get changed files\n        id: changed\n        run: |\n          files=$(git diff --name-only origin\u002F${{ github.base_ref }}...HEAD)\n          echo \"files\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$files\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: Get diff\n        id: diff\n        run: |\n          diff=$(git diff origin\u002F${{ github.base_ref }}...HEAD)\n          echo \"diff\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$diff\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: AI Review\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const { Anthropic } = require('@anthropic-ai\u002Fsdk');\n            const client = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY });\n\n            const response = await client.messages.create({\n              model: \"claude-sonnet-4-6\",\n              max_tokens: 4096,\n              messages: [{\n                role: \"user\",\n                content: `Review this PR diff and provide feedback:\n                \n                Changed files: ${{ steps.changed.outputs.files }}\n                \n                Diff:\n                ${{ steps.diff.outputs.diff }}\n                \n                Provide:\n                1. Summary of changes\n                2. Potential issues or bugs\n                3. Suggestions for improvement\n                4. Security concerns if any\n                \n                Format as GitHub markdown.`\n              }]\n            });\n\n            await github.rest.pulls.createReview({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              pull_number: context.issue.number,\n              body: response.content[0].text,\n              event: 'COMMENT'\n            });\n        env:\n          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}\n```\n\n### 1.2 Review Comment Patterns\n\n````markdown\n# AI Review Structure\n\n## ? Summary\n\nBrief description of what this PR does.\n\n## ✅ What looks good\n\n- Well-structured code\n- Good test coverage\n- Clear naming conventions\n\n## ⚠️ Potential Issues\n\n1. **Line 42**: Possible null pointer exception\n   ```javascript\n   \u002F\u002F Current\n   user.profile.name;\n   \u002F\u002F Suggested\n   user?.profile?.name ?? \"Unknown\";\n   ```\n````\n\n2. **Line 78**: Consider error handling\n   ```javascript\n   \u002F\u002F Add try-catch or .catch()\n   ```\n\n## ? Suggestions\n\n- Consider extracting the validation logic into a separate function\n- Add JSDoc comments for public methods\n\n## ? Security Notes\n\n- No sensitive data exposure detected\n- API key handling looks correct\n\n````\n\n### 1.3 Focused Reviews\n\n```yaml\n# Review only specific file types\n- name: Filter code files\n  run: |\n    files=$(git diff --name-only origin\u002F${{ github.base_ref }}...HEAD | \\\n            grep -E '\\.(ts|tsx|js|jsx|py|go)$' || true)\n    echo \"code_files=$files\" >> $GITHUB_OUTPUT\n\n# Review with context\n- name: AI Review with context\n  run: |\n    # Include relevant context files\n    context=\"\"\n    for file in ${{ steps.changed.outputs.files }}; do\n      if [[ -f \"$file\" ]]; then\n        context+=\"=== $file ===\\n$(cat $file)\\n\\n\"\n      fi\n    done\n\n    # Send to AI with full file context\n````\n\n---\n\n## 2. Issue Triage Automation\n\n### 2.1 Auto-label Issues\n\n```yaml\n# .github\u002Fworkflows\u002Fissue-triage.yml\nname: Issue Triage\n\non:\n  issues:\n    types: [opened]\n\njobs:\n  triage:\n    runs-on: ubuntu-latest\n    permissions:\n      issues: write\n\n    steps:\n      - name: Analyze issue\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const issue = context.payload.issue;\n\n            \u002F\u002F Call AI to analyze\n            const analysis = await analyzeIssue(issue.title, issue.body);\n\n            \u002F\u002F Apply labels\n            const labels = [];\n\n            if (analysis.type === 'bug') {\n              labels.push('bug');\n              if (analysis.severity === 'high') labels.push('priority: high');\n            } else if (analysis.type === 'feature') {\n              labels.push('enhancement');\n            } else if (analysis.type === 'question') {\n              labels.push('question');\n            }\n\n            if (analysis.area) {\n              labels.push(`area: ${analysis.area}`);\n            }\n\n            await github.rest.issues.addLabels({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: issue.number,\n              labels: labels\n            });\n\n            \u002F\u002F Add initial response\n            if (analysis.type === 'bug' && !analysis.hasReproSteps) {\n              await github.rest.issues.createComment({\n                owner: context.repo.owner,\n                repo: context.repo.repo,\n                issue_number: issue.number,\n                body: `Thanks for reporting this issue!\n\nTo help us investigate, could you please provide:\n- Steps to reproduce the issue\n- Expected behavior\n- Actual behavior\n- Environment (OS, version, etc.)\n\nThis will help us resolve your issue faster. ?`\n              });\n            }\n```\n\n### 2.2 Issue Analysis Prompt\n\n```typescript\nconst TRIAGE_PROMPT = `\nAnalyze this GitHub issue and classify it:\n\nTitle: {title}\nBody: {body}\n\nReturn JSON with:\n{\n  \"type\": \"bug\" | \"feature\" | \"question\" | \"docs\" | \"other\",\n  \"severity\": \"low\" | \"medium\" | \"high\" | \"critical\",\n  \"area\": \"frontend\" | \"backend\" | \"api\" | \"docs\" | \"ci\" | \"other\",\n  \"summary\": \"one-line summary\",\n  \"hasReproSteps\": boolean,\n  \"isFirstContribution\": boolean,\n  \"suggestedLabels\": [\"label1\", \"label2\"],\n  \"suggestedAssignees\": [\"username\"] \u002F\u002F based on area expertise\n}\n`;\n```\n\n### 2.3 Stale Issue Management\n\n```yaml\n# .github\u002Fworkflows\u002Fstale.yml\nname: Manage Stale Issues\n\non:\n  schedule:\n    - cron: \"0 0 * * *\" # Daily\n\njobs:\n  stale:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fstale@v9\n        with:\n          stale-issue-message: |\n            This issue has been automatically marked as stale because it has not had \n            recent activity. It will be closed in 14 days if no further activity occurs.\n\n            If this issue is still relevant:\n            - Add a comment with an update\n            - Remove the `stale` label\n\n            Thank you for your contributions! ?\n\n          stale-pr-message: |\n            This PR has been automatically marked as stale. Please update it or it \n            will be closed in 14 days.\n\n          days-before-stale: 60\n          days-before-close: 14\n          stale-issue-label: \"stale\"\n          stale-pr-label: \"stale\"\n          exempt-issue-labels: \"pinned,security,in-progress\"\n          exempt-pr-labels: \"pinned,security\"\n```\n\n---\n\n## 3. CI\u002FCD Integration\n\n### 3.1 Smart Test Selection\n\n```yaml\n# .github\u002Fworkflows\u002Fsmart-tests.yml\nname: Smart Test Selection\n\non:\n  pull_request:\n\njobs:\n  analyze:\n    runs-on: ubuntu-latest\n    outputs:\n      test_suites: ${{ steps.analyze.outputs.suites }}\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Analyze changes\n        id: analyze\n        run: |\n          # Get changed files\n          changed=$(git diff --name-only origin\u002F${{ github.base_ref }}...HEAD)\n\n          # Determine which test suites to run\n          suites=\"[]\"\n\n          if echo \"$changed\" | grep -q \"^src\u002Fapi\u002F\"; then\n            suites=$(echo $suites | jq '. + [\"api\"]')\n          fi\n\n          if echo \"$changed\" | grep -q \"^src\u002Ffrontend\u002F\"; then\n            suites=$(echo $suites | jq '. + [\"frontend\"]')\n          fi\n\n          if echo \"$changed\" | grep -q \"^src\u002Fdatabase\u002F\"; then\n            suites=$(echo $suites | jq '. + [\"database\", \"api\"]')\n          fi\n\n          # If nothing specific, run all\n          if [ \"$suites\" = \"[]\" ]; then\n            suites='[\"all\"]'\n          fi\n\n          echo \"suites=$suites\" >> $GITHUB_OUTPUT\n\n  test:\n    needs: analyze\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        suite: ${{ fromJson(needs.analyze.outputs.test_suites) }}\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Run tests\n        run: |\n          if [ \"${{ matrix.suite }}\" = \"all\" ]; then\n            npm test\n          else\n            npm test -- --suite ${{ matrix.suite }}\n          fi\n```\n\n### 3.2 Deployment with AI Validation\n\n```yaml\n# .github\u002Fworkflows\u002Fdeploy.yml\nname: Deploy with AI Validation\n\non:\n  push:\n    branches: [main]\n\njobs:\n  validate:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Get deployment changes\n        id: changes\n        run: |\n          # Get commits since last deployment\n          last_deploy=$(git describe --tags --abbrev=0 2>\u002Fdev\u002Fnull || echo \"\")\n          if [ -n \"$last_deploy\" ]; then\n            changes=$(git log --oneline $last_deploy..HEAD)\n          else\n            changes=$(git log --oneline -10)\n          fi\n          echo \"changes\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$changes\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: AI Risk Assessment\n        id: assess\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            \u002F\u002F Analyze changes for deployment risk\n            const prompt = `\n            Analyze these changes for deployment risk:\n\n            ${process.env.CHANGES}\n\n            Return JSON:\n            {\n              \"riskLevel\": \"low\" | \"medium\" | \"high\",\n              \"concerns\": [\"concern1\", \"concern2\"],\n              \"recommendations\": [\"rec1\", \"rec2\"],\n              \"requiresManualApproval\": boolean\n            }\n            `;\n\n            \u002F\u002F Call AI and parse response\n            const analysis = await callAI(prompt);\n\n            if (analysis.riskLevel === 'high') {\n              core.setFailed('High-risk deployment detected. Manual review required.');\n            }\n\n            return analysis;\n        env:\n          CHANGES: ${{ steps.changes.outputs.changes }}\n\n  deploy:\n    needs: validate\n    runs-on: ubuntu-latest\n    environment: production\n    steps:\n      - name: Deploy\n        run: |\n          echo \"Deploying to production...\"\n          # Deployment commands here\n```\n\n### 3.3 Rollback Automation\n\n```yaml\n# .github\u002Fworkflows\u002Frollback.yml\nname: Automated Rollback\n\non:\n  workflow_dispatch:\n    inputs:\n      reason:\n        description: \"Reason for rollback\"\n        required: true\n\njobs:\n  rollback:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Find last stable version\n        id: stable\n        run: |\n          # Find last successful deployment\n          stable=$(git tag -l 'v*' --sort=-version:refname | head -1)\n          echo \"version=$stable\" >> $GITHUB_OUTPUT\n\n      - name: Rollback\n        run: |\n          git checkout ${{ steps.stable.outputs.version }}\n          # Deploy stable version\n          npm run deploy\n\n      - name: Notify team\n        uses: slackapi\u002Fslack-github-action@v1\n        with:\n          payload: |\n            {\n              \"text\": \"? Production rolled back to ${{ steps.stable.outputs.version }}\",\n              \"blocks\": [\n                {\n                  \"type\": \"section\",\n                  \"text\": {\n                    \"type\": \"mrkdwn\",\n                    \"text\": \"*Rollback executed*\\n• Version: `${{ steps.stable.outputs.version }}`\\n• Reason: ${{ inputs.reason }}\\n• Triggered by: ${{ github.actor }}\"\n                  }\n                }\n              ]\n            }\n```\n\n---\n\n## 4. Git Operations\n\n### 4.1 Automated Rebasing\n\n```yaml\n# .github\u002Fworkflows\u002Fauto-rebase.yml\nname: Auto Rebase\n\non:\n  issue_comment:\n    types: [created]\n\njobs:\n  rebase:\n    if: github.event.issue.pull_request && contains(github.event.comment.body, '\u002Frebase')\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n          token: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Setup Git\n        run: |\n          git config user.name \"github-actions[bot]\"\n          git config user.email \"github-actions[bot]@users.noreply.github.com\"\n\n      - name: Rebase PR\n        run: |\n          # Fetch PR branch\n          gh pr checkout ${{ github.event.issue.number }}\n\n          # Rebase onto main\n          git fetch origin main\n          git rebase origin\u002Fmain\n\n          # Force push\n          git push --force-with-lease\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: Comment result\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            github.rest.issues.createComment({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: context.issue.number,\n              body: '✅ Successfully rebased onto main!'\n            })\n```\n\n### 4.2 Smart Cherry-Pick\n\n```typescript\n\u002F\u002F AI-assisted cherry-pick that handles conflicts\nasync function smartCherryPick(commitHash: string, targetBranch: string) {\n  \u002F\u002F Get commit info\n  const commitInfo = await exec(`git show ${commitHash} --stat`);\n\n  \u002F\u002F Check for potential conflicts\n  const targetDiff = await exec(\n    `git diff ${targetBranch}...HEAD -- ${affectedFiles}`\n  );\n\n  \u002F\u002F AI analysis\n  const analysis = await ai.analyze(`\n    I need to cherry-pick this commit to ${targetBranch}:\n    \n    ${commitInfo}\n    \n    Current state of affected files on ${targetBranch}:\n    ${targetDiff}\n    \n    Will there be conflicts? If so, suggest resolution strategy.\n  `);\n\n  if (analysis.willConflict) {\n    \u002F\u002F Create branch for manual resolution\n    await exec(\n      `git checkout -b cherry-pick-${commitHash.slice(0, 7)} ${targetBranch}`\n    );\n    const result = await exec(`git cherry-pick ${commitHash}`, {\n      allowFail: true,\n    });\n\n    if (result.failed) {\n      \u002F\u002F AI-assisted conflict resolution\n      const conflicts = await getConflicts();\n      for (const conflict of conflicts) {\n        const resolution = await ai.resolveConflict(conflict);\n        await applyResolution(conflict.file, resolution);\n      }\n    }\n  } else {\n    await exec(`git checkout ${targetBranch}`);\n    await exec(`git cherry-pick ${commitHash}`);\n  }\n}\n```\n\n### 4.3 Branch Cleanup\n\n```yaml\n# .github\u002Fworkflows\u002Fbranch-cleanup.yml\nname: Branch Cleanup\n\non:\n  schedule:\n    - cron: '0 0 * * 0'  # Weekly\n  workflow_dispatch:\n\njobs:\n  cleanup:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions\u002Fcheckout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Find stale branches\n        id: stale\n        run: |\n          # Branches not updated in 30 days\n          stale=$(git for-each-ref --sort=-committerdate refs\u002Fremotes\u002Forigin \\\n            --format='%(refname:short) %(committerdate:relative)' | \\\n            grep -E '[3-9][0-9]+ days|[0-9]+ months|[0-9]+ years' | \\\n            grep -v 'origin\u002Fmain\\|origin\u002Fdevelop' | \\\n            cut -d' ' -f1 | sed 's|origin\u002F||')\n\n          echo \"branches\u003C\u003CEOF\" >> $GITHUB_OUTPUT\n          echo \"$stale\" >> $GITHUB_OUTPUT\n          echo \"EOF\" >> $GITHUB_OUTPUT\n\n      - name: Create cleanup PR\n        if: steps.stale.outputs.branches != ''\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const branches = `${{ steps.stale.outputs.branches }}`.split('\\n').filter(Boolean);\n\n            const body = `## ? Stale Branch Cleanup\n\nThe following branches haven't been updated in over 30 days:\n\n${branches.map(b => `- \\`${b}\\``).join('\\n')}\n\n### Actions:\n- [ ] Review each branch\n- [ ] Delete branches that are no longer needed\n- Comment \\`\u002Fkeep branch-name\\` to preserve specific branches\n`;\n\n            await github.rest.issues.create({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              title: 'Stale Branch Cleanup',\n              body: body,\n              labels: ['housekeeping']\n            });\n```\n\n---\n\n## 5. On-Demand Assistance\n\n### 5.1 @mention Bot\n\n```yaml\n# .github\u002Fworkflows\u002Fmention-bot.yml\nname: AI Mention Bot\n\non:\n  issue_comment:\n    types: [created]\n  pull_request_review_comment:\n    types: [created]\n\njobs:\n  respond:\n    if: contains(github.event.comment.body, '@ai-helper')\n    runs-on: ubuntu-latest\n\n    steps:\n      - uses: actions\u002Fcheckout@v4\n\n      - name: Extract question\n        id: question\n        run: |\n          # Extract text after @ai-helper\n          question=$(echo \"${{ github.event.comment.body }}\" | sed 's\u002F.*@ai-helper\u002F\u002F')\n          echo \"question=$question\" >> $GITHUB_OUTPUT\n\n      - name: Get context\n        id: context\n        run: |\n          if [ \"${{ github.event.issue.pull_request }}\" != \"\" ]; then\n            # It's a PR - get diff\n            gh pr diff ${{ github.event.issue.number }} > context.txt\n          else\n            # It's an issue - get description\n            gh issue view ${{ github.event.issue.number }} --json body -q .body > context.txt\n          fi\n          echo \"context=$(cat context.txt)\" >> $GITHUB_OUTPUT\n        env:\n          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\n      - name: AI Response\n        uses: actions\u002Fgithub-script@v7\n        with:\n          script: |\n            const response = await ai.chat(`\n              Context: ${process.env.CONTEXT}\n              \n              Question: ${process.env.QUESTION}\n              \n              Provide a helpful, specific answer. Include code examples if relevant.\n            `);\n\n            await github.rest.issues.createComment({\n              owner: context.repo.owner,\n              repo: context.repo.repo,\n              issue_number: context.issue.number,\n              body: response\n            });\n        env:\n          CONTEXT: ${{ steps.context.outputs.context }}\n          QUESTION: ${{ steps.question.outputs.question }}\n```\n\n### 5.2 Command Patterns\n\n```markdown\n## Available Commands\n\n| Command              | Description                 |\n| :------------------- | :-------------------------- |\n| `@ai-helper explain` | Explain the code in this PR |\n| `@ai-helper review`  | Request AI code review      |\n| `@ai-helper fix`     | Suggest fixes for issues    |\n| `@ai-helper test`    | Generate test cases         |\n| `@ai-helper docs`    | Generate documentation      |\n| `\u002Frebase`            | Rebase PR onto main         |\n| `\u002Fupdate`            | Update PR branch from main  |\n| `\u002Fapprove`           | Mark as approved by bot     |\n| `\u002Flabel bug`         | Add 'bug' label             |\n| `\u002Fassign @user`      | Assign to user              |\n```\n\n---\n\n## 6. Repository Configuration\n\n### 6.1 CODEOWNERS\n\n```\n# .github\u002FCODEOWNERS\n\n# Global owners\n* @org\u002Fcore-team\n\n# Frontend\n\u002Fsrc\u002Ffrontend\u002F @org\u002Ffrontend-team\n*.tsx @org\u002Ffrontend-team\n*.css @org\u002Ffrontend-team\n\n# Backend\n\u002Fsrc\u002Fapi\u002F @org\u002Fbackend-team\n\u002Fsrc\u002Fdatabase\u002F @org\u002Fbackend-team\n\n# Infrastructure\n\u002F.github\u002F @org\u002Fdevops-team\n\u002Fterraform\u002F @org\u002Fdevops-team\nDockerfile @org\u002Fdevops-team\n\n# Docs\n\u002Fdocs\u002F @org\u002Fdocs-team\n*.md @org\u002Fdocs-team\n\n# Security-sensitive\n\u002Fsrc\u002Fauth\u002F @org\u002Fsecurity-team\n\u002Fsrc\u002Fcrypto\u002F @org\u002Fsecurity-team\n```\n\n### 6.2 Branch Protection\n\n```yaml\n# Set up via GitHub API\n- name: Configure branch protection\n  uses: actions\u002Fgithub-script@v7\n  with:\n    script: |\n      await github.rest.repos.updateBranchProtection({\n        owner: context.repo.owner,\n        repo: context.repo.repo,\n        branch: 'main',\n        required_status_checks: {\n          strict: true,\n          contexts: ['test', 'lint', 'ai-review']\n        },\n        enforce_admins: true,\n        required_pull_request_reviews: {\n          required_approving_review_count: 1,\n          require_code_owner_reviews: true,\n          dismiss_stale_reviews: true\n        },\n        restrictions: null,\n        required_linear_history: true,\n        allow_force_pushes: false,\n        allow_deletions: false\n      });\n```\n\n---\n\n## Best Practices\n\n### Security\n\n- [ ] Store API keys in GitHub Secrets\n- [ ] Use minimal permissions in workflows\n- [ ] Validate all inputs\n- [ ] Don't expose sensitive data in logs\n\n### Performance\n\n- [ ] Cache dependencies\n- [ ] Use matrix builds for parallel testing\n- [ ] Skip unnecessary jobs with path filters\n- [ ] Use self-hosted runners for heavy workloads\n\n### Reliability\n\n- [ ] Add timeouts to jobs\n- [ ] Handle rate limits gracefully\n- [ ] Implement retry logic\n- [ ] Have rollback procedures\n\n---\n\n## Resources\n\n- [Gemini CLI GitHub Action](https:\u002F\u002Fgithub.com\u002Fgoogle-github-actions\u002Frun-gemini-cli)\n- [GitHub Actions Documentation](https:\u002F\u002Fdocs.github.com\u002Fen\u002Factions)\n- [GitHub REST API](https:\u002F\u002Fdocs.github.com\u002Fen\u002Frest)\n- [CODEOWNERS Syntax](https:\u002F\u002Fdocs.github.com\u002Fen\u002Frepositories\u002Fmanaging-your-repositorys-settings-and-features\u002Fcustomizing-your-repository\u002Fabout-code-owners)\n",{"name":5,"description":7},"main","2b749c82b5d11fac39d9a6e021ce3f5b8a541bd1","cli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Fgithub-workflow-automation",3926,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates","https:\u002F\u002Faitmpl.com","https:\u002F\u002Fgithub.com\u002Fdavila7","https:\u002F\u002Fdanielavila.me","Building AI dev tools with LLMs","2026-11-12 14:45:56",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":81},[71,74,77],{"tool":72,"command":73},"npx","npx skills add davila7\u002Fclaude-code-templates --skill github-workflow-automation",{"tool":75,"command":76},"bunx","bunx skills add davila7\u002Fclaude-code-templates --skill github-workflow-automation",{"tool":78,"command":79},"pnpm","pnpm dlx skills add davila7\u002Fclaude-code-templates --skill github-workflow-automation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Fgithub-workflow-automation\u002FSKILL.md",true,[],[84,111,138,169,204,228],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":91,"publishedAt":54},"01M70NHBTQ8BV0A2SCAZXEPHCX","wealthville-pool-scoring","Score DeFi liquidity pools before providing liquidity. Returns a 0-100 pool score and an Enter\u002FHold\u002FExit\u002FReduce\u002FAvoid verdict with calibrated confidence for ~68,800 Solana pools and 575 EVM pools, plus a public miss-inclusive track record. Use when asked whether a pool is worth LPing into, which pools look best right now, or how accurate the scores have actually been.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-data\u002Fwealthville-pool-scoring\u002FSKILL.md",[90],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[92,93,94,95,96,97,98,99,100,38,101,102,103,104,105,106,107,108,109,110],"scoring","pool","wealthville pool scoring","liquidity","which","for","exit","now","use","reduce","with","record","track","verdict","evm","solana","how","public","look",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":118,"publishedAt":54},"01M70MB6VR8ERJ4EM8D5KHBMEV","technical-debt-auditor","Scans a codebase and produces a quantified technical debt report with a prioritized remediation plan. Analyzes dead code, TODO\u002FFIXME\u002FHACK markers, dependency staleness, complexity hotspots, code duplication signals, test coverage gaps, unused exports, and outdated patterns. Use this skill when the user asks to audit their codebase for tech debt, wants a health check of their code quality, says things like \"where should I focus refactoring\", \"find code smells\", \"audit my codebase\", \"what technical debt do we have\", \"prioritize cleanup work\", or asks about code quality metrics. Also trigger when the user mentions \"code rot\", \"legacy cleanup\", \"refactoring priorities\", or wants to understand the overall health of a project before a major effort. Trigger even if the user doesn't say \"technical debt\" explicitly — any request to systematically assess code quality and identify improvement priorities belongs here.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Ftechnical-debt-auditor\u002FSKILL.md",[117],{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},[119,120,121,122,123,124,125,126,127,128,129,38,130,131,132,133,134,135,136,137],"technical debt","debt","technical","technical debt auditor","auditor","coverage","complexity","markers","project","cleanup","unused","code","todo","work","plan","focus","signals","audit","dependency",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":151,"publishedAt":54},"01M70KPYH9QNHCNME5GJQGE22K","readonly-sql-guard","Make an agent's database access provably read-only. Use when an agent runs caller-supplied SQL against a production\u002FERP\u002Fanalytics database (a \"query\" MCP tool, text-to-SQL, an admin console), or when reviewing DB-access code for write\u002FDDL\u002Fside-effect\u002Ftransaction-escape risks. Checks what a statement CALLS, not just its shape.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdatabase\u002Freadonly-sql-guard\u002FSKILL.md",[144,145,146],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":147,"categoryName":148,"taxonomyType":149,"taxonomyTypeDesc":150},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[152,153,154,155,156,157,158,97,159,160,161,162,163,164,165,100,166,167,38,168],"readonly","guard","sql guard","sql","readonly sql guard","erp","effect","read-only","db","just","tool","calls","only","MCP","access","database","query",{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":173,"licenseFileUrl":174,"sourceHtmlUrl":175,"categories":176,"keywords":180,"publishedAt":54},"01M6AFY6F7CC2BBZP1QD6VTNVC","web-artifacts-builder","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[177],{"categoryNo":178,"categoryName":179,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,97,203],"artifacts builder","web","web artifacts builder","artifacts","builder","state","routing","state management","component","css","frontend","ui","Tools","file","components","shadcn","react","Tailwind","suite","jsx","html","single-file","ui components",{"skillNo":205,"name":206,"nameZh":6,"description":207,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":173,"licenseFileUrl":208,"sourceHtmlUrl":209,"categories":210,"keywords":215,"publishedAt":54},"01M6AFWF33SFV9Z3SF4PEEE4BF","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[211,214],{"categoryNo":212,"categoryName":213,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":178,"categoryName":179,"taxonomyType":21,"taxonomyTypeDesc":22},[216,217,218,219,220,182,221,191,192,222,223,224,225,97,226,102,227],"webapp testing","testing","webapp","browser","playwright","applications","debugging","toolkit","logs","screenshots","local","behavior",{"skillNo":229,"name":230,"nameZh":6,"description":231,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":173,"licenseFileUrl":232,"sourceHtmlUrl":233,"categories":234,"keywords":242,"publishedAt":54},"01M6AF67Q67JJJ5V51JR2P52KA","discernment-nudge","After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FSKILL.md",[235,238,239],{"categoryNo":236,"categoryName":237,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":27,"categoryName":28,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":240,"categoryName":241,"taxonomyType":149,"taxonomyTypeDesc":150},"01JBSEEDCAT000000000000036","内容创作者",[243,244,245,246,247,248,249,250,184,251,194,130,252,37,253,254,42,164,255,38,256,257,258,259,260,108,261],"discernment nudge","nudge","interpretation","help","run","reasoning","data","writing","lookup","content","conversation","short","invoke","you","analysis","claims","argument","assemble","recommendations"]