diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..7ef4de2 --- /dev/null +++ b/.github/CODEOWNERS @@ -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/ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..8d33f7b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -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 diff --git a/.github/workflows/skills-only.yml b/.github/workflows/skills-only.yml new file mode 100644 index 0000000..83f6fbd --- /dev/null +++ b/.github/workflows/skills-only.yml @@ -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.` + }) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..03a9161 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing + +## Source Code Changes + +**Accepted:** Bug fixes, security fixes, simplifications, reducing code. + +**Not accepted:** Features, capabilities, compatibility, enhancements. These should be skills. + +## Skills + +A [skill](https://code.claude.com/docs/en/skills) is a markdown file in `.claude/skills/` that teaches Claude Code how to transform a NanoClaw installation. + +A PR that contributes a skill should not modify any source files. + +Your skill should contain the **instructions** Claude follows to add the feature—not pre-built code. See `/convert-to-docker` for a good example. + +### Why? + +Every user should have clean and minimal code that does exactly what they need. Skills let users selectively add features to their fork without inheriting code for features they don't want. + +### Testing + +Test your skill by running it on a fresh clone before submitting.