Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@
"source": "./commit",
"description": "Create a Git commit with semantic commit message format"
},
{
"name": "terminal-ui-design",
"source": "./terminal-ui-design",
"description": "Create distinctive, production-grade terminal user interfaces with high design quality"
},
{
"name": "frontend-design",
"source": "./frontend-design",
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Add any other context or screenshots about the feature request here.
**Which plugin would this affect?**
- [ ] team-agents
- [ ] commit
- [ ] terminal-ui-design
- [ ] frontend-design
- [ ] interview
- [ ] statusline
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/pr-automation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
description: >-
Agentic workflow for PR automation: auto-label based on changed files,
auto-assign reviewers based on code ownership, and welcome first-time contributors.
---

# PR Automation Workflow

Automatically triages pull requests with labels, reviewers, and welcome messages.

## Triggers

- `pull_request: opened` - When a new PR is opened
- `pull_request: reopened` - When a PR is reopened

## Features

### Auto-Label
Labels PRs based on changed file paths:
- `area:api` - Changes in `src/api/` or `api/`
- `area:frontend` - Changes in `src/frontend/`, `components/`, or `ui/`
- `area:backend` - Changes in `src/backend/` or `server/`
- `area:docs` - Changes in `docs/` or `*.md` files
- `area:tests` - Changes in `tests/` or `test/`
- `type:breaking` - If commit contains "BREAKING CHANGE"
- `documentation` - If only documentation files changed

### Auto-Assign Reviewers
Assigns reviewers based on changed files:
- Frontend changes → `frontend-team` team
- Backend changes → `backend-team` team
- API changes → `api-team` team
- Infrastructure → `devops-team` team

### Welcome First-Time Contributors
For first-time contributors:
- Adds `first-time-contributor` label
- Posts welcome message with contribution guidelines

## Configuration

### Custom Labels
Edit the workflow file to add custom label patterns:

```yaml
- name: Auto-label
run: |
# Add custom patterns here
if echo "$FILES" | grep -q "^path/to/files/"; then
gh pr edit "$PR_NUMBER" --add-label "custom-label"
fi
```

### Custom Reviewers
Edit the reviewer mapping:

```yaml
- name: Auto-assign reviewers
run: |
# Map file paths to reviewers/teams
if echo "$FILES" | grep -q "^your/path/"; then
gh pr edit "$PR_NUMBER" --add-reviewer "your-team"
fi
```

### Custom Welcome Message
Edit the welcome comment:

```yaml
- name: Welcome first-time contributors
run: |
gh pr comment "$PR_NUMBER" --body "Your custom welcome message"
```

## Permissions

The workflow requires the following permissions:
- `pull-requests: write` - To add labels and comments
- `contents: read` - To read repository files

## Usage

The workflow runs automatically on PR creation. No manual invocation needed.

To test changes to the workflow:
1. Create a test branch
2. Make a small change
3. Open a PR
4. Verify labels and assignments are applied

## Example Output

For a PR changing `src/api/users.ts`:
- Labels applied: `area:api`, `area:backend`
- Reviewers assigned: `api-team`
Comment on lines +93 to +95
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Example output labels are inconsistent with the documented path rules.

For a PR changing src/api/users.ts, area:backend should not be listed unless backend paths are also changed.

Suggested fix
-For a PR changing `src/api/users.ts`:
-- Labels applied: `area:api`, `area:backend`
+For a PR changing `src/api/users.ts`:
+- Labels applied: `area:api`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
For a PR changing `src/api/users.ts`:
- Labels applied: `area:api`, `area:backend`
- Reviewers assigned: `api-team`
For a PR changing `src/api/users.ts`:
- Labels applied: `area:api`
- Reviewers assigned: `api-team`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-automation.md around lines 93 - 95, The example in the
PR automation doc is incorrect: for a PR changing "src/api/users.ts" it should
not apply "area:backend" unless backend paths are changed; update the example
under the diff block that currently shows "Labels applied: `area:api`,
`area:backend`" so it only shows the correct label(s) (e.g., remove
`area:backend` and leave `area:api`) or adjust the example text to state that
`area:backend` is only added when backend paths are also modified; edit the
snippet that references "src/api/users.ts" to reflect this corrected labeling
behavior.

- If first-time contributor: Welcome comment posted
123 changes: 123 additions & 0 deletions .github/workflows/pr-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: PR Automation

on:
pull_request:
types: [opened, reopened]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Workflow should react to new commits on existing PRs.

Only opened and reopened are handled. Without synchronize, labels/reviewer assignment won't update after subsequent pushes.

Suggested fix
-    types: [opened, reopened]
+    types: [opened, reopened, synchronize]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
types: [opened, reopened]
types: [opened, reopened, synchronize]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-automation.yml at line 5, The workflow currently
triggers only on pull_request types ["opened","reopened"]; add "synchronize" to
the pull_request event types so the job also runs on new commits to existing PRs
(update the pull_request.types array to include "synchronize") to ensure
labels/reviewer assignment and other automation update after pushes.


permissions:
pull-requests: write
contents: read

jobs:
pr-automation:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get changed files
id: changed-files
run: |
# Get list of changed files
FILES=$(gh pr diff "$PR_NUMBER" --name-only)
echo "files<<EOF" >> $GITHUB_OUTPUT
echo "$FILES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-label based on files
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
FILES="${{ steps.changed-files.outputs.files }}"

# Area labels based on file paths
if echo "$FILES" | grep -q "^src/api/\|^api/"; then
gh pr edit "$PR_NUMBER" --add-label "area:api"
fi

if echo "$FILES" | grep -q "^src/frontend/\|^components/\|^ui/"; then
gh pr edit "$PR_NUMBER" --add-label "area:frontend"
fi

if echo "$FILES" | grep -q "^src/backend/\|^server/"; then
gh pr edit "$PR_NUMBER" --add-label "area:backend"
fi

if echo "$FILES" | grep -q "^docs/\|\.md$"; then
gh pr edit "$PR_NUMBER" --add-label "area:docs"
fi

if echo "$FILES" | grep -q "^tests/\|^test/"; then
gh pr edit "$PR_NUMBER" --add-label "area:tests"
fi

# Check for breaking changes in commits
COMMITS=$(gh api repos/${{ github.repository }}/pulls/$PR_NUMBER/commits --jq '.[].commit.message' | grep -i "BREAKING CHANGE" || true)
if [ -n "$COMMITS" ]; then
gh pr edit "$PR_NUMBER" --add-label "type:breaking"
fi

# Documentation only
if echo "$FILES" | grep -v "^docs/\|\.md$" | grep -q .; then
:
else
gh pr edit "$PR_NUMBER" --add-label "documentation"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Auto-assign reviewers based on files
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
FILES="${{ steps.changed-files.outputs.files }}"

# Assign reviewers based on code areas
if echo "$FILES" | grep -q "^src/frontend/\|^components/\|^ui/"; then
gh pr edit "$PR_NUMBER" --add-reviewer "frontend-team" || true
fi

if echo "$FILES" | grep -q "^src/backend/\|^server/"; then
gh pr edit "$PR_NUMBER" --add-reviewer "backend-team" || true
fi

if echo "$FILES" | grep -q "^src/api/\|^api/"; then
gh pr edit "$PR_NUMBER" --add-reviewer "api-team" || true
fi

if echo "$FILES" | grep -q "^infra/\|^deploy/\|^\.github/"; then
gh pr edit "$PR_NUMBER" --add-reviewer "devops-team" || true
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Welcome first-time contributors
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
AUTHOR=${{ github.event.pull_request.user.login }}

# Check if this is the author's first PR
PR_COUNT=$(gh pr list --author "$AUTHOR" --state all --limit 1 --json number --jq 'length')

if [ "$PR_COUNT" -eq 1 ]; then
Comment on lines +101 to +103
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The first-time contributor detection will evaluate to true for any author with at least one PR in this repo, not just their first.

With --limit 1, jq 'length' will only ever return 0 or 1, so any author with at least one prior PR will still produce PR_COUNT=1 and trigger the welcome logic on every PR. To detect a true first PR, you’ll need to count all PRs for the author (e.g., drop --limit or use an API that exposes totalCount) and only treat it as first-time when the count is exactly 1. Another option is to query closed/merged PRs and gate on those instead.

gh pr edit "$PR_NUMBER" --add-label "first-time-contributor"
Comment on lines +101 to +104
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/pr-automation.yml | sed -n '90,115p'

Repository: duyet/claude-plugins

Length of output: 1290


🏁 Script executed:

# Verify the --limit 1 behavior and confirm the jq 'length' logic is the issue
# by checking if there are any other PR filtering mechanisms in the file

rg -n "gh pr list" .github/workflows/pr-automation.yml

Repository: duyet/claude-plugins

Length of output: 169


First-time contributor detection is logically incorrect and produces false positives.

At Line 101, using --limit 1 with jq 'length' returns at most 0 or 1. This means the condition on Line 103 triggers whenever the author has any existing PR, not just for first-time contributors. Any returning contributor opening a new PR will be incorrectly labeled.

The fix requires checking if the author has exactly one PR (the current one) by increasing the limit to 2:

Suggested fix
-PR_COUNT=$(gh pr list --author "$AUTHOR" --state all --limit 1 --json number --jq 'length')
+PR_COUNT=$(gh pr list --author "$AUTHOR" --state all --limit 2 --json number --jq 'length')
 
-if [ "$PR_COUNT" -eq 1 ]; then
+if [ "${{ github.event.action }}" = "opened" ] && [ "$PR_COUNT" -eq 1 ]; then
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PR_COUNT=$(gh pr list --author "$AUTHOR" --state all --limit 1 --json number --jq 'length')
if [ "$PR_COUNT" -eq 1 ]; then
gh pr edit "$PR_NUMBER" --add-label "first-time-contributor"
PR_COUNT=$(gh pr list --author "$AUTHOR" --state all --limit 2 --json number --jq 'length')
if [ "${{ github.event.action }}" = "opened" ] && [ "$PR_COUNT" -eq 1 ]; then
gh pr edit "$PR_NUMBER" --add-label "first-time-contributor"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-automation.yml around lines 101 - 104, The PR-count
check is wrong: change the gh pr list invocation used to set PR_COUNT (currently
using --limit 1) to request up to 2 PRs so you can detect "exactly one PR" (the
current one); update the command that sets PR_COUNT (the gh pr list call
referencing AUTHOR) to use --limit 2 and keep the existing equality check on
PR_COUNT == 1 before calling gh pr edit with PR_NUMBER to add the
"first-time-contributor" label.


gh pr comment "$PR_NUMBER" --body '## Welcome! 👋

Thank you for your first contribution to this project! We appreciate you taking the time to improve our codebase.

### Next Steps
- A maintainer will review your PR shortly
- Please check for any review comments and address them
- Feel free to ask questions if anything is unclear

### Contribution Guidelines
- Ensure all tests pass
- Update documentation if needed
- Keep changes focused and atomic

Thanks again for contributing! 🎉'
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Marketplace.json for centralized plugin registry
- GitHub issue templates (bug report, feature request)
- GitHub batch commands: bulk-close-issues, bulk-merge-prs, bulk-label
- PR templates for commit plugin (default, bugfix, feature)
- PR automation GitHub Action for auto-labeling and reviewer assignment
- Enhanced GitHub documentation with examples and troubleshooting

### Changed
- Improved documentation consistency across plugins
- Better version tracking in plugin manifests
- GitHub plugin: Enhanced batch operations and PR workflow
- Commit plugin: Added PR template support and draft PR option

### Removed
- terminal-ui-design plugin (consolidated with frontend-design)

### Fixed

Expand All @@ -22,7 +31,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- team-agents: Leader, Senior Engineer, Junior Engineer for parallel execution
- commit: Semantic commit message format with PR workflows
- terminal-ui-design: Production-grade terminal UI creation
- frontend-design: Anti-slop frontend design patterns
- interview: Socratic requirements gathering
- statusline: Configurable status bar with API tracking
Expand Down
13 changes: 0 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Available on **[skills.sh](https://skills.sh)** — the open agent skills ecosys
# Install plugins
/plugin install team-agents@duyet-claude-plugins
/plugin install commit@duyet-claude-plugins
/plugin install terminal-ui-design@duyet-claude-plugins
/plugin install frontend-design@duyet-claude-plugins
/plugin install interview@duyet-claude-plugins
/plugin install statusline@duyet-claude-plugins
Expand Down Expand Up @@ -64,7 +63,6 @@ npx skills add duyet/claude-plugins
|--------|------|--------------|
| [👥 team-agents](#👥-team-agents) | Skill | Leader, Senior Engineer, and Junior Engi... |
| [📝 commit](#📝-commit) | Command | Create a Git commit with semantic commit... |
| [🎨 terminal-ui-design](#🎨-terminal-ui-design) | Skill | Create distinctive, production-grade ter... |
| [🎨 frontend-design](#🎨-frontend-design) | Skill | Create distinctive, production-grade fro... |
| [💬 interview](#💬-interview) | Command | Conduct in-depth requirements interviews... |
| [📊 statusline](#📊-statusline) | Hook | Configurable status bar showing context ... |
Expand Down Expand Up @@ -115,17 +113,6 @@ Skills:

---

### 🎨 terminal-ui-design

**Create distinctive, production-grade terminal user interfaces with high design quality**

**Components:**

Skills:
- **terminal-ui-design**

---

### 🎨 frontend-design

**Create distinctive, production-grade frontend interfaces avoiding AI slop aesthetics. Emphasizes shadcn/ui, Recharts, and bold design choices.**
Expand Down
4 changes: 2 additions & 2 deletions commit/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "commit",
"description": "Create a Git commit with semantic commit message format",
"version": "1.2.1",
"description": "Create a Git commit with semantic commit message format and PR workflow with templates",
"version": "1.3.0",
"author": {
"name": "duyet"
}
Expand Down
24 changes: 24 additions & 0 deletions commit/.pr-templates/bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Summary
Fixes {{ issue description }}

## Root Cause
{{ explanation of what was causing the bug }}

## Solution
{{ how the bug was fixed }}

## Changes
- {{ change 1 }}
- {{ change 2 }}

## Testing
{{ how the fix was tested }}

## Regression Risk
{{ assessment of potential side effects }}

## Related Issues
Closes #{{ issue number }}

---
Generated with [Claude Code](https://claude.com/claude-code)
21 changes: 21 additions & 0 deletions commit/.pr-templates/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Summary
{{ brief description of what this PR does }}

## Changes
- {{ key change 1 }}
- {{ key change 2 }}
- {{ key change 3 }}

## Context
{{ background information, motivation, or link to issue }}

## Testing
{{ how the changes were tested }}

## Checklist
- [ ] Tests pass
- [ ] Documentation updated (if needed)
- [ ] No breaking changes (or documented)

---
Generated with [Claude Code](https://claude.com/claude-code)
31 changes: 31 additions & 0 deletions commit/.pr-templates/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Summary
{{ feature description }}

## Motivation
{{ why this feature is needed }}

## Implementation
{{ high-level overview of implementation }}

## Changes
- {{ change 1 }}
- {{ change 2 }}
- {{ change 3 }}

## Breaking Changes
{{ list any breaking changes, or "None" }}

## Migration Guide
{{ if breaking changes, how users should migrate }}

## Testing
{{ how the feature was tested }}

## Documentation
{{ link to documentation updates, or "N/A" }}

## Related Issues
Closes #{{ issue number }}

---
Generated with [Claude Code](https://claude.com/claude-code)
Loading
Loading