Claude Code Plugins

Community-maintained marketplace

Feedback

.claude/skills/reusable-workflows/SKILL.md

@mattnigh/skills_collection
0
0

|

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name .claude/skills/reusable-workflows/SKILL.md
description GitHub Actions再利用可能ワークフローの設計と実装。 workflow_call イベント、入力/出力/シークレット定義、呼び出しパターン、 合成設計、継承、チェーンパターンの専門知識を提供。 📚 リソース参照: このスキルには以下のリソースが含まれています。 必要に応じて該当するリソースを参照してください: - `.claude/skills/reusable-workflows/resources/caller-patterns.md`: Caller Patternsリソース - `.claude/skills/reusable-workflows/resources/design-patterns.md`: Design Patternsリソース - `.claude/skills/reusable-workflows/resources/workflow-call-syntax.md`: Workflow Call Syntaxリソース - `.claude/skills/reusable-workflows/templates/caller-workflow.yaml`: Caller Workflowテンプレート - `.claude/skills/reusable-workflows/templates/reusable-workflow.yaml`: Reusable Workflowテンプレート - `.claude/skills/reusable-workflows/scripts/validate-reusable.mjs`: Validate Reusableスクリプト Use proactively when implementing reusable workflows, workflow composition patterns, or standardizing CI/CD processes across multiple projects.
version 1.0.0

Reusable Workflows Skill

GitHub Actions 再利用可能ワークフローの設計と実装の専門知識。

📁 Directory Structure

.claude/skills/reusable-workflows/
├── SKILL.md                          # このファイル (~150-200行)
├── resources/
│   ├── workflow-call-syntax.md       # workflow_call詳細定義
│   ├── caller-patterns.md            # 呼び出しパターン
│   └── design-patterns.md            # 合成・継承・チェーン
├── templates/
│   ├── reusable-workflow.yaml        # 再利用可能ワークフロー
│   └── caller-workflow.yaml          # 呼び出し側テンプレート
└── scripts/
    └── validate-reusable.mjs         # 検証スクリプト

🎯 Core Concept

再利用可能ワークフローは workflow_call イベントで定義され、他のワークフローから呼び出し可能:

# .github/workflows/reusable-build.yml
name: Reusable Build

on:
  workflow_call:
    inputs:
      node-version:
        required: true
        type: string
    outputs:
      build-id:
        value: ${{ jobs.build.outputs.build-id }}
    secrets:
      NPM_TOKEN:
        required: true

jobs:
  build:
    runs-on: ubuntu-latest
    outputs:
      build-id: ${{ steps.build.outputs.id }}
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: ${{ inputs.node-version }}
      - run: pnpm ci
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

📚 Command Reference

リソース参照

# workflow_call 構文詳細
cat .claude/skills/reusable-workflows/resources/workflow-call-syntax.md

# 呼び出しパターン
cat .claude/skills/reusable-workflows/resources/caller-patterns.md

# 設計パターン
cat .claude/skills/reusable-workflows/resources/design-patterns.md

テンプレート使用

# 再利用可能ワークフローテンプレート
cat .claude/skills/reusable-workflows/templates/reusable-workflow.yaml

# 呼び出し側テンプレート
cat .claude/skills/reusable-workflows/templates/caller-workflow.yaml

検証

# 再利用可能ワークフロー検証
node .claude/skills/reusable-workflows/scripts/validate-reusable.mjs <workflow.yml>

🔄 Calling Reusable Workflows

# .github/workflows/ci.yml
name: CI

on: [push]

jobs:
  build:
    uses: ./.github/workflows/reusable-build.yml
    with:
      node-version: "20"
    secrets:
      NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

  test:
    needs: build
    uses: ./.github/workflows/reusable-test.yml
    with:
      build-id: ${{ needs.build.outputs.build-id }}

💡 Key Features

Input Types

  • string: テキスト値
  • boolean: true/false
  • number: 数値

Output Propagation

ジョブ出力をワークフロー出力として伝播:

outputs:
  result:
    value: ${{ jobs.main.outputs.result }}

Secret Inheritance

# すべてのシークレットを継承
secrets: inherit

# または個別に指定
secrets:
  TOKEN: ${{ secrets.TOKEN }}

🎨 Design Patterns

  1. Composition: 複数ワークフローを組み合わせる
  2. Inheritance: 基本ワークフローを継承
  3. Chaining: ワークフローを連鎖実行
  4. Matrix: 複数構成で並列実行

詳細は resources/design-patterns.md を参照。

🔗 Related Skills

  • .claude/skills/github-actions-syntax/SKILL.md: .claude/skills/github-actions-syntax/SKILL.md
  • .claude/skills/github-actions-expressions/SKILL.md: .claude/skills/github-actions-expressions/SKILL.md
  • .claude/skills/composite-actions/SKILL.md: .claude/skills/composite-actions/SKILL.md
  • .claude/skills/workflow-templates/SKILL.md: .claude/skills/workflow-templates/SKILL.md

📖 When to Use

  • 共通 CI/CD パターンの標準化
  • 複数プロジェクト間でワークフローを共有
  • ワークフローロジックの重複を削減
  • チーム全体で一貫したパイプライン
  • メンテナンスコストの削減

詳細な構文、呼び出しパターン、設計パターンは resources/ を参照してください。