mcpField
P
pr-template-builder

pr-template-builder

github.com/patricio0312rev開発63258 回インストール41 週間前に更新
リポジトリ

pr-template-builder について

pr-template-builderは、GitHubのプルリクエスト、Issue、ディスカッションのテンプレートを標準化するスキルです。コントリビューションガイド、CODEOWNERS、ワークフローによるPRラベル付けも扱います。

主な機能

  1. 01PRとIssueのテンプレート作成
  2. 02ディスカッションテンプレートの設定
  3. 03CODEOWNERSの設定
  4. 04CONTRIBUTING.mdガイドの作成
  5. 05PRラベルの自動化

活用シーン

  1. 01プルリクエストの提出内容を統一
  2. 02バグ報告や機能要望を案内
  3. 03コードオーナーの割り当てとPRのラベル付け

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/patricio0312rev/skills --skill pr-template-builder

インストール後、Claude Code で/pr-template-builderを入力して読み込まれたか確認します。

詳細

PR テンプレートビルダー

プルリクエスト、イシュー、ディスカッション用の標準化された GitHub テンプレートを作成し、コラボレーションを効率化します。

基本的なワークフロー

  1. テンプレートのニーズを特定する: PR、イシュー、ディスカッション
  2. .github ディレクトリを作成する: テンプレートの標準的な配置場所
  3. PR テンプレートを設計する: チェックリスト、セクション、ガイダンス
  4. イシューテンプレートを作成する: バグ報告、機能リクエスト
  5. config.yml を追加する: イシューや PR の作成フローを制御
  6. テンプレートをテストする: GitHub での表示を確認

ディレクトリ構成

.github/
├── PULL_REQUEST_TEMPLATE.md          # Default PR template
├── PULL_REQUEST_TEMPLATE/            # Multiple PR templates
│   ├── feature.md
│   ├── bugfix.md
│   └── hotfix.md
├── ISSUE_TEMPLATE/
│   ├── config.yml                    # Issue template config
│   ├── bug_report.yml                # Bug report form
│   ├── feature_request.yml           # Feature request form
│   └── question.yml                  # Question form
├── DISCUSSION_TEMPLATE/
│   ├── announcements.yml
│   └── ideas.yml
├── CONTRIBUTING.md                   # Contribution guidelines
├── CODE_OF_CONDUCT.md               # Community standards
└── CODEOWNERS                       # Auto-assign reviewers

プルリクエストテンプレート

標準的な PR テンプレート


## Summary



## Related Issue


Fixes #

## Type of Change



- [ ] Bug fix (non-breaking change fixing an issue)
- [ ] New feature (non-breaking change adding functionality)
- [ ] Breaking change (fix or feature causing existing functionality to change)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Performance improvement
- [ ] Test updates

## Changes Made



-
-
-

## Screenshots



## Testing



- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed

### Test Instructions



1.
2.
3.

## Checklist



- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code where necessary
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests proving my fix/feature works
- [ ] All new and existing tests pass
- [ ] Any dependent changes have been merged

## Additional Notes


機能追加 PR テンプレート


## Feature: [Feature Name]

### Summary



### Motivation



### Implementation Details



### User Impact



### API Changes



| Endpoint | Method | Change |
|----------|--------|--------|
|          |        |        |

### Database Changes



- [ ] Migration added
- [ ] Migration tested on staging data

### Feature Flag



- [ ] Feature flag: `FEATURE_NAME`
- [ ] No feature flag needed

### Testing

- [ ] Unit tests added
- [ ] Integration tests added
- [ ] E2E tests added
- [ ] Manual testing completed

### Documentation

- [ ] README updated
- [ ] API docs updated
- [ ] Changelog entry added

### Rollback Plan



### Checklist

- [ ] Code review requested
- [ ] CI/CD pipeline passes
- [ ] Performance impact assessed
- [ ] Security review (if needed)
- [ ] Accessibility requirements met
バグ修正 PR テンプレート


## Bug Fix: [Brief Description]

### Issue

Fixes #

### Root Cause



### Solution



### Regression Risk



- Risk level: Low / Medium / High
- Areas affected:

### Testing

#### Reproduction Steps (Before Fix)

1.
2.
3.

#### Verification Steps (After Fix)

1.
2.
3.

### Test Coverage

- [ ] Unit test added to prevent regression
- [ ] Integration test added
- [ ] Manual verification completed

### Checklist

- [ ] Root cause identified
- [ ] Fix verified locally
- [ ] No new warnings introduced
- [ ] Tests added for regression prevention
- [ ] Related issues linked

イシューテンプレート

バグ報告(YAML フォーム)
# .github/ISSUE_TEMPLATE/bug_report.yml
name: Bug Report
description: Report a bug or unexpected behavior
title: "[Bug]: "
labels: ["bug", "triage"]
assignees: []

body:
  - type: markdown
    attributes:
      value: |
        Thanks for taking the time to report this bug!
        Please fill out the form below to help us investigate.

  - type: textarea
    id: description
    attributes:
      label: Bug Description
      description: A clear and concise description of the bug
      placeholder: What happened?
    validations:
      required: true

  - type: textarea
    id: reproduction
    attributes:
      label: Steps to Reproduce
      description: Steps to reproduce the behavior
      placeholder: |
        1. Go to '...'
        2. Click on '...'
        3. Scroll down to '...'
        4. See error
    validations:
      required: true

  - type: textarea
    id: expected
    attributes:
      label: Expected Behavior
      description: What did you expect to happen?
    validations:
      required: true

  - type: textarea
    id: actual
    attributes:
      label: Actual Behavior
      description: What actually happened?
    validations:
      required: true

  - type: textarea
    id: screenshots
    attributes:
      label: Screenshots
      description: If applicable, add screenshots to help explain the problem
    validations:
      required: false

  - type: dropdown
    id: environment
    attributes:
      label: Environment
      description: Where are you experiencing this bug?
      options:
        - Production
        - Staging
        - Development
        - Local
    validations:
      required: true

  - type: dropdown
    id: browser
    attributes:
      label: Browser
      description: What browser are you using?
      multiple: true
      options:
        - Chrome
        - Firefox
        - Safari
        - Edge
        - Other
    validations:
      required: false

  - type: input
    id: version
    attributes:
      label: App Version
      description: What version of the app are you using?
      placeholder: e.g., 1.2.3
    validations:
      required: false

  - type: textarea
    id: logs
    attributes:
      label: Relevant Logs
      description: Please copy and paste any relevant log output
      render: shell
    validations:
      required: false

  - type: checkboxes
    id: terms
    attributes:
      label: Checklist
      options:
        - label: I have searched for existing issues
          required: true
        - label: I have provided all requested information
          required: true
機能リクエスト(YAML フォーム)
# .github/ISSUE_TEMPLATE/feature_request.yml
name: Feature Request
description: Suggest a new feature or improvement
title: "[Feature]: "
labels: ["enhancement", "triage"]
assignees: []

body:
  - type: markdown
    attributes:
      value: |
        Thanks for suggesting a new feature!
        Please describe your idea in detail.

  - type: textarea
    id: problem
    attributes:
      label: Problem Statement
      description: What problem would this feature solve?
      placeholder: I'm always frustrated when...
    validations:
      required: true

  - type: textarea
    id: solution
    attributes:
      label: Proposed Solution
      description: Describe the solution you'd like
    validations:
      required: true

  - type: textarea
    id: alternatives
    attributes:
      label: Alternatives Considered
      description: Describe any alternative solutions you've considered
    validations:
      required: false

  - type: dropdown
    id: priority
    attributes:
      label: Priority
      description: How important is this feature to you?
      options:
        - Nice to have
        - Important
        - Critical - blocking my work
    validations:
      required: true

  - type: textarea
    id: context
    attributes:
      label: Additional Context
      description: Add any other context, mockups, or screenshots
    validations:
      required: false

  - type: checkboxes
    id: contribution
    attributes:
      label: Contribution
      options:
        - label: I would be willing to help implement this feature
          required: false
イシューテンプレートの設定
# .github/ISSUE_TEMPLATE/config.yml
blank_issues_enabled: false
contact_links:
  - name: Documentation
    url: https://docs.example.com
    about: Check our documentation for answers
  - name: Discord Community
    url: https://discord.gg/example
    about: Ask questions and get help from the community
  - name: Stack Overflow
    url: https://stackoverflow.com/questions/tagged/example
    about: Search for existing answers

ディスカッションテンプレート

# .github/DISCUSSION_TEMPLATE/ideas.yml
title: "[Idea]: "
labels:
  - idea
body:
  - type: markdown
    attributes:
      value: |
        Share your ideas for improving the project!

  - type: textarea
    id: idea
    attributes:
      label: Your Idea
      description: Describe your idea in detail
    validations:
      required: true

  - type: textarea
    id: benefits
    attributes:
      label: Benefits
      description: What benefits would this bring?
    validations:
      required: true

  - type: textarea
    id: drawbacks
    attributes:
      label: Potential Drawbacks
      description: Any potential downsides?
    validations:
      required: false

CODEOWNERS

# .github/CODEOWNERS
# Default owners for everything
* @org/core-team

# Frontend ownership
/src/components/ @org/frontend-team
/src/pages/ @org/frontend-team
*.tsx @org/frontend-team
*.css @org/frontend-team

# Backend ownership
/src/api/ @org/backend-team
/src/services/ @org/backend-team
/prisma/ @org/backend-team

# DevOps ownership
/.github/ @org/devops-team
/docker/ @org/devops-team
Dockerfile @org/devops-team
*.yml @org/devops-team

# Documentation
/docs/ @org/docs-team
*.md @org/docs-team

# Security-sensitive files
/src/auth/ @org/security-team @org/backend-team
*.pem @org/security-team

CONTRIBUTING.md



# Contributing to [Project Name]

Thank you for your interest in contributing! This document provides guidelines
and steps for contributing.

## Code of Conduct

By participating, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md).

## How to Contribute

### Reporting Bugs

1. Check if the bug has already been reported in [Issues](../../issues)
2. If not, create a new issue using the Bug Report template
3. Provide as much detail as possible

### Suggesting Features

1. Check if the feature has been suggested in [Issues](../../issues)
2. Create a new issue using the Feature Request template
3. Explain the use case and benefits

### Submitting Changes

#### First Time Contributors

1. Fork the repository
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/REPO_NAME`
3. Add upstream remote: `git remote add upstream https://github.com/ORG/REPO_NAME`
4. Create a branch: `git checkout -b feature/your-feature-name`

#### Development Workflow

1. Sync with upstream: `git fetch upstream && git rebase upstream/main`
2. Make your changes
3. Run tests: `npm test`
4. Run linting: `npm run lint`
5. Commit using [Conventional Commits](https://www.conventionalcommits.org/):

feat(scope): add new feature fix(scope): fix bug description docs(scope): update documentation

6. Push to your fork: `git push origin feature/your-feature-name`
7. Create a Pull Request

### Pull Request Guidelines

- Fill out the PR template completely
- Link related issues
- Include tests for new functionality
- Update documentation as needed
- Ensure CI passes
- Request review from appropriate team members

## Development Setup

```bash
# Install dependencies
npm install

# Start development server
npm run dev

# Run tests
npm test

# Run linting
npm run lint

スタイルガイド

コードスタイル
  • 新しいコードにはすべて TypeScript を使用します
  • 既存のコードスタイルに従います
  • 意味の分かりやすい変数名と関数名を使用します
  • 複雑なロジックにはコメントを追加します
コミットメッセージ

Conventional Commits に従います。

  • feat: 新機能
  • fix: バグ修正
  • docs: ドキュメント
  • style: 書式設定
  • refactor: コードの再構成
  • test: テストの追加
  • chore: メンテナンス
ブランチの命名
  • feature/ - 新機能
  • fix/ - バグ修正
  • docs/ - ドキュメント
  • refactor/ - コードのリファクタリング

ヘルプ

ライセンス

コントリビューションを行うことで、そのコントリビューションがプロジェクトの MIT License のもとでライセンスされることに同意したものとみなされます。


## Workflow Automation

### Auto-label PRs

```yaml
# .github/workflows/labeler.yml
name: PR Labeler

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  label:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/labeler@v5
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
# .github/labeler.yml
frontend:
  - changed-files:
      - any-glob-to-any-file:
          - 'src/components/**'
          - 'src/pages/**'
          - '**/*.tsx'
          - '**/*.css'

backend:
  - changed-files:
      - any-glob-to-any-file:
          - 'src/api/**'
          - 'src/services/**'

documentation:
  - changed-files:
      - any-glob-to-any-file:
          - '**/*.md'
          - 'docs/**'

tests:
  - changed-files:
      - any-glob-to-any-file:
          - '**/*.test.ts'
          - '**/*.spec.ts'
          - '__tests__/**'
PR サイズラベル
# .github/workflows/pr-size.yml
name: PR Size

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  size:
    runs-on: ubuntu-latest
    steps:
      - uses: codelytv/pr-size-labeler@v1
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          xs_label: 'size/XS'
          xs_max_size: 10
          s_label: 'size/S'
          s_max_size: 100
          m_label: 'size/M'
          m_max_size: 500
          l_label: 'size/L'
          l_max_size: 1000
          xl_label: 'size/XL'
          fail_if_xl: false

ベストプラクティス

  1. テンプレートの目的を絞る: 1つのテンプレートにつき目的は1つにします
  2. YAML フォームを使用する: イシューでは Markdown より優れた UX を実現できます
  3. 役立つ説明を追加する: 各フィールドの入力方法を案内します
  4. 必須フィールドを適切に設定する: 情報量と入力の手間のバランスを取ります
  5. チェックリストを含める: 必要事項が揃っていることを確認できます
  6. ドキュメントへのリンクを追加する: ユーザーが回答を見つけやすくします
  7. 空のイシューを無効にする: テンプレートの使用を必須にします
  8. CODEOWNERS を追加する: レビュー担当者の割り当てを自動化します
  9. GitHub でテストする: 表示と検証を確認します

出力チェックリスト

すべてのテンプレート設定には、以下を含めてください。

  • .github/ ディレクトリが作成されている
  • チェックリスト付きの PULL_REQUEST_TEMPLATE.md
  • バグ報告用イシューテンプレート(YAML フォーム)
  • 機能リクエスト用イシューテンプレート(YAML フォーム)
  • イシューテンプレートの config.yml
  • 自動割り当て用の CODEOWNERS ファイル
  • CONTRIBUTING.md のガイドライン
  • 分類用のラベルが定義されている
  • PR にラベルを自動付与するワークフロー
  • GitHub でテンプレートがテストされている

コメント