Contribution
Teaches an AI agent how to contribute correctly to this repository (agents-skills), following its own conventions.
Purpose
Ensure contributions are consistent, well-structured, and merge-ready by grounding the agent in the repository's actual rules rather than generic GitHub advice. Reduces review churn and keeps the skill catalog coherent.
When to Use
- User says they want to contribute, add a skill, fix a skill, or open a PR against this repo
- User asks "how do I contribute?", "how do I add a new skill?", "what are the conventions?"
- Agent is about to scaffold a new
skills/<name>/SKILL.md in this repository
- Before the agent commits, pushes, or opens a PR in this repo
Workflow
1. Orient the contributor and set up the workspace
Confirm the repo root is agents-skills (contains skills/, CONTRIBUTING.md, README.md)
If cloning fresh:
git clone https://github.com/marwan562/agents-skills.git
cd agents-skills
For fork workflow, verify remotes:
git remote -v
# expect origin -> contributor fork, upstream -> marwan562/agents-skills
Ensure working from latest main:
git checkout main
git fetch upstream # or origin if no upstream
git pull --ff-only
2. Read the source of truth
- Open and follow
CONTRIBUTING.md (the canonical workflow) and docs/architecture.md (why the layout is this way)
- Check root
README.md → Available Skills table for naming collisions
- Inspect
skills/<existing>/SKILL.md count and style to match tone
- Note commit convention (Conventional Commits) and branch naming (
feat/<skill>, fix/<skill>-...)
3. Plan the change
- For new skill: propose
kebab-case name, verify it matches directory, draft description (20-300 chars, trigger style: "Use when...")
- For fix/docs: identify the minimal diff; note if
README.md catalog or docs/architecture.md also needs an update
- For large or cross-cutting change: advise opening an issue first (
Proposal: <skill-name> skill) before coding — per CONTRIBUTING.md
4. Scaffold or edit
New skill:
mkdir -p skills/my-new-skill
# Create skills/my-new-skill/SKILL.md with required frontmatter
Frontmatter must be at line 1:
---
name: my-new-skill
description: Use when you need to do X efficiently
---
Body sections in order: Purpose → When to Use → Workflow → Instructions → Constraints → Examples (plus optional References)
Keep the skill independent and reusable; no hard dependency on another skill without declaration
5. Update catalog and cross-references
If adding a skill: add a row to README.md → Available Skills table
| **my-new-skill** | `skills/my-new-skill/` | Short purpose summary |
Add installation examples for the new skill:
npx skills add marwan562/agents-skills --skill my-new-skill
Adjust structure diagrams if needed; do not restructure unrelated sections
6. Validate locally (never skip)
Run these before committing:
# 1. Each skill has SKILL.md and name matches directory
for f in skills/*/SKILL.md; do
dir=$(basename $(dirname "$f"))
name=$(grep "^name:" "$f" | awk '{print $2}')
[ "$dir" = "$name" ] && echo "✓ $f" || echo "✗ MISMATCH $f dir=$dir name=$name"
done
# 2. No secrets / tokens in diff
git diff --cached # review; ensure no .env, keys, tokens
# 3. Frontmatter parses
python3 -c "
import pathlib, yaml
for p in pathlib.Path('skills').glob('*/SKILL.md'):
data = yaml.safe_load(p.read_text().split('---')[1])
assert 'name' in data and 'description' in data
print(f'✓ {p}')
"
# 4. Links resolve
# Click through README links to CONTRIBUTING.md and docs/architecture.md
7. Commit, push, and open PR
Create a topic branch from main:
git checkout -b feat/my-new-skill
Commit with Conventional Commits:
git add skills/my-new-skill/SKILL.md README.md
git commit -m "feat(my-new-skill): add my-new-skill skill"
Push and open PR:
git push -u origin feat/my-new-skill
gh pr create --title "feat(my-new-skill): add my-new-skill skill" --body "$(cat <<'EOF'
## Summary
Adds `my-new-skill`...
## Changes
- ...
## Validation
- [x] Frontmatter valid
- [x] No secrets in diff
- [x] Links checked
EOF
)"
If gh is not authenticated, instruct the user to run gh auth login and retry; do not fabricate a PR URL
8. Optional Jev pre-PR check (skipped without JEV_API_KEY)
When configured, send the SKILL.md diff + intent + validation results to
jev_review; fix concrete flags, re-validate, rescore with
previousEvaluation. CONTRIBUTING.md and the validator still decide. Never
send secrets. Full protocol:
contribute Jev gates.
Instructions
- Follow CONTRIBUTING.md first. If this skill and CONTRIBUTING.md disagree, CONTRIBUTING.md wins — update this skill to match.
- Keep diffs minimal. One skill per PR; do not bundle unrelated reformatting.
- Preserve existing style. Mirror headings, tone, and table formatting from existing skills.
- Validate file paths. Use forward slashes,
skills/<name>/SKILL.md exactly; do not create skill/ or SKILL.MD.
- Warn before external actions. Confirm with the user before
git push or gh pr create — these are public and irreversible.
Constraints
- Do NOT overwrite
origin or upstream remotes without asking
- Do NOT commit secrets, tokens,
.env, or private URLs
- Do NOT change
LICENSE or .gitignore unless explicitly requested
- Do NOT create a skill without
name ≡ directory-name invariant
- Do NOT invent a
CONTRIBUTING.md workflow that contradicts the actual file in the repo
Examples
Example 1 — Contributor wants to add a skill
User: "I want to add a testing skill to this repo."
Agent:
- Reads
CONTRIBUTING.md:1-50, checks skills/ for collision (testing not present)
- Scaffolds
skills/testing/SKILL.md with required sections
- Updates
README.md Available Skills table
- Runs validation loop; shows
git diff --stat and asks confirmation before push
Example 2 — Quick fix to an existing skill
User: "Fix a typo in the code-review skill."
Agent:
- Reads
skills/code-review/SKILL.md:45, patches typo
- Validates frontmatter still parses,
name unchanged
- Commits as
fix(code-review): correct typo in workflow step 3
- Pushes only after confirmation
Example 3 — Contributor asks how to contribute
User: "How do I contribute here?"
Agent:
- Summarizes
CONTRIBUTING.md: clone → create skills/<name>/SKILL.md → validate → commit (feat:) → PR
- Shows scaffold command and validation checklist
- Points to
docs/architecture.md for deeper design rationale
References
- Canonical workflow:
CONTRIBUTING.md
- Architecture rationale:
docs/architecture.md
- Skill spec and install guide:
README.md
1---2name: contribution3description: Use this skill when guiding a contributor through this repository's contribution workflow. It follows CONTRIBUTING.md and repository conventions to help the agent clone, create skills, validate, and submit PRs correctly.4---56# Contribution78Teaches an AI agent how to contribute correctly to *this* repository (`agents-skills`), following its own conventions.910## Purpose1112Ensure contributions are consistent, well-structured, and merge-ready by grounding the agent in the repository's actual rules rather than generic GitHub advice. Reduces review churn and keeps the skill catalog coherent.1314## When to Use1516- User says they want to contribute, add a skill, fix a skill, or open a PR against this repo17- User asks "how do I contribute?", "how do I add a new skill?", "what are the conventions?"18- Agent is about to scaffold a new `skills/<name>/SKILL.md` in this repository19- Before the agent commits, pushes, or opens a PR in this repo2021## Workflow2223### 1. Orient the contributor and set up the workspace2425- Confirm the repo root is `agents-skills` (contains `skills/`, `CONTRIBUTING.md`, `README.md`)26- If cloning fresh:2728 ```bash29 git clone https://github.com/marwan562/agents-skills.git30 cd agents-skills31 ```3233- For fork workflow, verify remotes:3435 ```bash36 git remote -v37 # expect origin -> contributor fork, upstream -> marwan562/agents-skills38 ```3940- Ensure working from latest `main`:4142 ```bash43 git checkout main44 git fetch upstream # or origin if no upstream45 git pull --ff-only46 ```4748### 2. Read the source of truth4950- Open and follow `CONTRIBUTING.md` (the canonical workflow) and `docs/architecture.md` (why the layout is this way)51- Check root `README.md` → Available Skills table for naming collisions52- Inspect `skills/<existing>/SKILL.md` count and style to match tone53- Note commit convention (Conventional Commits) and branch naming (`feat/<skill>`, `fix/<skill>-...`)5455### 3. Plan the change5657- For **new skill**: propose `kebab-case` name, verify it matches directory, draft `description` (20-300 chars, trigger style: "Use when...")58- For **fix/docs**: identify the minimal diff; note if `README.md` catalog or `docs/architecture.md` also needs an update59- For **large or cross-cutting change**: advise opening an issue first (`Proposal: <skill-name> skill`) before coding — per `CONTRIBUTING.md`6061### 4. Scaffold or edit6263- New skill:6465 ```bash66 mkdir -p skills/my-new-skill67 # Create skills/my-new-skill/SKILL.md with required frontmatter68 ```6970- Frontmatter must be at line 1:7172 ```yaml73 ---74 name: my-new-skill75 description: Use when you need to do X efficiently76 ---77 ```7879- Body sections in order: `Purpose` → `When to Use` → `Workflow` → `Instructions` → `Constraints` → `Examples` (plus optional `References`)80- Keep the skill independent and reusable; no hard dependency on another skill without declaration8182### 5. Update catalog and cross-references8384- If adding a skill: add a row to `README.md` → Available Skills table8586 ```markdown87 | **my-new-skill** | `skills/my-new-skill/` | Short purpose summary |88 ```8990- Add installation examples for the new skill:9192 ```bash93 npx skills add marwan562/agents-skills --skill my-new-skill94 ```9596- Adjust structure diagrams if needed; do not restructure unrelated sections9798### 6. Validate locally (never skip)99100Run these before committing:101102```bash103# 1. Each skill has SKILL.md and name matches directory104for f in skills/*/SKILL.md; do105 dir=$(basename $(dirname "$f"))106 name=$(grep "^name:" "$f" | awk '{print $2}')107 [ "$dir" = "$name" ] && echo "✓ $f" || echo "✗ MISMATCH $f dir=$dir name=$name"108done109110# 2. No secrets / tokens in diff111git diff --cached # review; ensure no .env, keys, tokens112113# 3. Frontmatter parses114python3 -c "115import pathlib, yaml116for p in pathlib.Path('skills').glob('*/SKILL.md'):117 data = yaml.safe_load(p.read_text().split('---')[1])118 assert 'name' in data and 'description' in data119 print(f'✓ {p}')120"121122# 4. Links resolve123# Click through README links to CONTRIBUTING.md and docs/architecture.md124```125126### 7. Commit, push, and open PR127128- Create a topic branch from `main`:129130 ```bash131 git checkout -b feat/my-new-skill132 ```133134- Commit with Conventional Commits:135136 ```bash137 git add skills/my-new-skill/SKILL.md README.md138 git commit -m "feat(my-new-skill): add my-new-skill skill"139 ```140141- Push and open PR:142143 ```bash144 git push -u origin feat/my-new-skill145 gh pr create --title "feat(my-new-skill): add my-new-skill skill" --body "$(cat <<'EOF'146 ## Summary147 Adds `my-new-skill`...148149 ## Changes150 - ...151152 ## Validation153 - [x] Frontmatter valid154 - [x] No secrets in diff155 - [x] Links checked156 EOF157 )"158 ```159160- If `gh` is not authenticated, instruct the user to run `gh auth login` and retry; do not fabricate a PR URL161162### 8. Optional Jev pre-PR check (skipped without `JEV_API_KEY`)163164When configured, send the `SKILL.md` diff + intent + validation results to165`jev_review`; fix concrete flags, re-validate, rescore with166`previousEvaluation`. `CONTRIBUTING.md` and the validator still decide. Never167send secrets. Full protocol:168[contribute Jev gates](../contribute/references/jev-decisions.md).169170## Instructions171172- **Follow CONTRIBUTING.md first.** If this skill and CONTRIBUTING.md disagree, CONTRIBUTING.md wins — update this skill to match.173- **Keep diffs minimal.** One skill per PR; do not bundle unrelated reformatting.174- **Preserve existing style.** Mirror headings, tone, and table formatting from existing skills.175- **Validate file paths.** Use forward slashes, `skills/<name>/SKILL.md` exactly; do not create `skill/` or `SKILL.MD`.176- **Warn before external actions.** Confirm with the user before `git push` or `gh pr create` — these are public and irreversible.177178## Constraints179180- Do NOT overwrite `origin` or `upstream` remotes without asking181- Do NOT commit secrets, tokens, `.env`, or private URLs182- Do NOT change `LICENSE` or `.gitignore` unless explicitly requested183- Do NOT create a skill without `name` ≡ directory-name invariant184- Do NOT invent a `CONTRIBUTING.md` workflow that contradicts the actual file in the repo185186## Examples187188### Example 1 — Contributor wants to add a skill189190> **User**: "I want to add a `testing` skill to this repo."191192**Agent**:1931. Reads `CONTRIBUTING.md:1-50`, checks `skills/` for collision (`testing` not present)1942. Scaffolds `skills/testing/SKILL.md` with required sections1953. Updates `README.md` Available Skills table1964. Runs validation loop; shows `git diff --stat` and asks confirmation before push197198### Example 2 — Quick fix to an existing skill199200> **User**: "Fix a typo in the `code-review` skill."201202**Agent**:2031. Reads `skills/code-review/SKILL.md:45`, patches typo2042. Validates frontmatter still parses, `name` unchanged2053. Commits as `fix(code-review): correct typo in workflow step 3`2064. Pushes only after confirmation207208### Example 3 — Contributor asks how to contribute209210> **User**: "How do I contribute here?"211212**Agent**:2131. Summarizes `CONTRIBUTING.md`: clone → create `skills/<name>/SKILL.md` → validate → commit (`feat:`) → PR2142. Shows scaffold command and validation checklist2153. Points to `docs/architecture.md` for deeper design rationale216217## References218219- Canonical workflow: `CONTRIBUTING.md`220- Architecture rationale: `docs/architecture.md`221- Skill spec and install guide: `README.md`