Add contribution guidelines and PR checks for skills-only model
- CONTRIBUTING.md: Explain accepted source changes vs skills - PR template: Checkboxes for contribution type - CI workflow: Block PRs that add skills while modifying source - CODEOWNERS: Require maintainer review for source changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
8
.github/CODEOWNERS
vendored
Normal file
8
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Core code - maintainer only
|
||||
/src/ @gavrielc
|
||||
/container/ @gavrielc
|
||||
/package.json @gavrielc
|
||||
/package-lock.json @gavrielc
|
||||
|
||||
# Skills - open to contributors
|
||||
/.claude/skills/
|
||||
14
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
14
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
## Type of Change
|
||||
|
||||
- [ ] **Skill** - adds a new skill in `.claude/skills/`
|
||||
- [ ] **Fix** - bug fix or security fix to source code
|
||||
- [ ] **Simplification** - reduces or simplifies source code
|
||||
|
||||
## Description
|
||||
|
||||
|
||||
## For Skills
|
||||
|
||||
- [ ] I have not made any changes to source code
|
||||
- [ ] My skill contains instructions for Claude to follow (not pre-built code)
|
||||
- [ ] I tested this skill on a fresh clone
|
||||
52
.github/workflows/skills-only.yml
vendored
Normal file
52
.github/workflows/skills-only.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Skill PR Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Check for mixed skill + source changes
|
||||
run: |
|
||||
# Check if PR adds new skill files (not just modifies existing)
|
||||
ADDED_SKILLS=$(git diff --name-only --diff-filter=A origin/main...HEAD | grep '^\.claude/skills/' || true)
|
||||
|
||||
# Check if PR touches source
|
||||
CHANGED=$(git diff --name-only origin/main...HEAD)
|
||||
SOURCE=$(echo "$CHANGED" | grep -E '^src/|^container/|^package\.json|^package-lock\.json' || true)
|
||||
|
||||
# Block if new skills are added AND source is modified
|
||||
if [ -n "$ADDED_SKILLS" ] && [ -n "$SOURCE" ]; then
|
||||
echo "❌ PRs that add skills should not modify source files."
|
||||
echo ""
|
||||
echo "New skill files:"
|
||||
echo "$ADDED_SKILLS"
|
||||
echo ""
|
||||
echo "Source files:"
|
||||
echo "$SOURCE"
|
||||
echo ""
|
||||
echo "Please read CONTRIBUTING.md"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Comment on failure
|
||||
if: failure()
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
body: `This PR adds a skill while also modifying source code. A skill PR should not change source files—the skill should contain **instructions** for Claude to follow. See \`/convert-to-docker\` for an example.
|
||||
|
||||
If you're fixing a bug or simplifying code, please submit that as a separate PR.
|
||||
|
||||
See [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/CONTRIBUTING.md) for details.`
|
||||
})
|
||||
Reference in New Issue
Block a user