Skip to content

Commit 8e35ab6

Browse files
authored
Merge pull request #7 from bcgov/fix/contribution-guidelines
chore: update contribution guidelines
1 parent de3c773 commit 8e35ab6

2 files changed

Lines changed: 89 additions & 94 deletions

File tree

.github/workflows/pr.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ name: PR
2323

2424
on:
2525
pull_request:
26-
paths:
27-
- "skills/**"
28-
- ".github/skills/**"
29-
- "scripts/**"
30-
- "tests/**"
31-
- "pyproject.toml"
32-
- ".github/workflows/pr.yml"
33-
- ".github/scripts/**"
3426

3527
# Least privilege: every job here only reads the repo.
3628
permissions:

CONTRIBUTING.md

Lines changed: 89 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,24 @@ Thanks for helping build BC Gov's shared library of agent skill profiles. This
44
repository is community-maintained — new skills and improvements to existing
55
ones are all welcome.
66

7-
## Before you start: access requirements
7+
## Before you start
88

9-
This repository is open to **BC Gov GitHub organization members only**.
10-
Contributions from forks outside the organization are not accepted — the PR
11-
workflow has a dedicated `fork-gate` job that fails any pull request opened
12-
from a fork, and branch protection requires that job to pass before merge. A
13-
fork PR therefore cannot go green and cannot merge.
9+
Contributions are made through pull requests from a branch **in this
10+
repository**, not from a fork. The PR workflow
11+
([.github/workflows/pr.yml](.github/workflows/pr.yml)) has a `fork-gate` job
12+
that fails any pull request opened from a fork; that failure cascades to the
13+
`results` aggregator, which is the gate on merge. If you can't push a branch to
14+
this repository, you don't have the access you need — sort that out before
15+
opening a PR.
1416

15-
To contribute:
16-
17-
1. **Join the `bcgov` GitHub organization.** If you're not already a member,
18-
request membership through your team or the BC Gov DevOps onboarding process.
19-
2. **Request write access to this repository.** Maintainers grant write access
20-
so you can push feature branches and open pull requests directly against this
21-
repo. You do **not** fork — you branch.
22-
23-
If you can't push a branch to this repository, you don't yet have the access you
24-
need; sort that out before opening a PR.
17+
**Commits must be signed.** The `main` branch ruleset requires signed commits,
18+
so the merge will be blocked otherwise. Set up SSH or GPG commit signing once
19+
per machine — see [GitHub's docs](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification).
2520

2621
## How contributions work
2722

28-
All changes are made through pull requests from a branch **in this repository**.
29-
Direct pushes to `main` are not permitted, and PRs from forks are not run.
30-
31-
1. **Branch** — with your granted write access, create a feature branch in this
32-
repo for your change. (Forks are not supported.)
23+
1. **Branch** — create a feature branch in this repo for your change. (Forks
24+
are not supported by the PR workflow.)
3325
2. **Add or update a skill** — for a new skill, first confirm no [upstream
3426
catalog](#before-adding-a-new-skill-check-upstream-catalogs-first) already
3527
covers it. Then follow [spec/SKILL_SPEC.md](spec/SKILL_SPEC.md) and start
@@ -40,9 +32,13 @@ Direct pushes to `main` are not permitted, and PRs from forks are not run.
4032
`0.1.0`.
4133
4. **Validate locally**`uv run python scripts/validate_skill.py skills/<name>/SKILL.md`.
4234
5. **Open a pull request** — describe what the skill does and why it's useful.
43-
6. **Pass the checks** — the PR check validates every changed skill.
44-
7. **Review & merge** — a maintainer reviews; once approved and green, it merges
45-
and the publish workflow ships the bumped version as an npm package.
35+
6. **Pass the checks** — the PR workflow validates the skills your branch
36+
changed (diffed against the base branch).
37+
7. **Merge** — once the `results` check is green and your branch is up to date
38+
with `main`, the PR can be merged (squash or merge commit; rebase is
39+
disabled). The publish workflow then ships any bumped versions as npm
40+
packages. Review is encouraged but not gated by the ruleset — see
41+
[Review expectations](#review-expectations).
4642

4743
## Before adding a new skill: check upstream catalogs first
4844

@@ -54,16 +50,14 @@ makes it ambiguous which one consumers should install.
5450
Check these first:
5551

5652
1. **[Microsoft Agent Skills catalog](https://microsoft.github.io/skills/#agents)**
57-
~170 skills covering Azure SDKs (Python, .NET, Java, TypeScript, Rust),
58-
Microsoft Foundry, M365, Entra, Azure Resource Manager, plus cross-cutting
59-
workflows such as `azure-prepare`, `azure-deploy`, `azure-validate`,
60-
`azure-cost`, `microsoft-docs`, `kql`, `mcp-builder`, and
61-
`cloud-solution-architect`. Installable via `npx skills add microsoft/skills`.
53+
— a large catalog of skills covering Azure SDKs, Microsoft Foundry, M365,
54+
Entra, Azure Resource Manager, plus cross-cutting workflows (`azure-prepare`,
55+
`azure-deploy`, `azure-validate`, `azure-cost`, `microsoft-docs`, `kql`,
56+
`mcp-builder`, `cloud-solution-architect`, and others).
6257
2. **[Anthropic's `anthropics/skills`](https://github.com/anthropics/skills)**
63-
the canonical upstream that hosts the Agent Skills specification (see also
64-
[agentskills.io](https://agentskills.io)) plus reference skills for document
65-
work (`pdf`, `docx`, `xlsx`, `pptx`) and creative, development, and
66-
enterprise patterns. The `SKILL.md` format this repo uses originates here.
58+
reference skills for document work (`pdf`, `docx`, `xlsx`, `pptx`) and other
59+
patterns, plus material on the SKILL.md format this repo follows (see also
60+
[agentskills.io](https://agentskills.io)).
6761
3. **[awesome-copilot](https://github.com/github/awesome-copilot)** — the
6862
community-curated index of skills, prompts, custom agents, and hooks; it
6963
also distributes vendor plugin catalogs (M365 Agents Toolkit, Power BI,
@@ -133,78 +127,87 @@ on demand by `uv run`. Common commands:
133127

134128
```bash
135129
make format # auto-format Python (2-space indent, double quotes)
136-
make lint # lint Python: style, imports, docstrings, bug patterns
130+
make lint # lint Python with ruff + workflow YAML with yamllint
137131
make test # run the validator unit tests
138132
make validate # validate every skill
133+
make pack # dry-run each publishable skill's npm package
139134
```
140135

141136
Python is formatted and linted with [ruff](https://docs.astral.sh/ruff/),
142137
configured in `pyproject.toml` (2-space indentation, double quotes, and
143-
docstrings required on every function). Run `make format` before pushing.
138+
docstrings required on every function). Workflow YAML under
139+
`.github/workflows/` is linted with [yamllint](https://yamllint.readthedocs.io/),
140+
configured in `.yamllint` at the repo root. Run `make format` before pushing.
144141

145142
## PR checks
146143

147-
Pull requests **opened from a branch in this repository** run two real jobs
148-
after a hard fork-gate, plus a final aggregator. PRs opened from a fork fail at
149-
the gate (see access requirements above).
150-
151-
0. **fork-gate** — runs first and fails immediately if the PR's head repo is
152-
not this repo. This is a real failed status check, not a neutral skip, so
153-
branch protection can require it.
154-
1. **Codebase** — runs next, because broken tooling makes validating skill
155-
output meaningless. It checks the code that produces skills:
156-
- `ruff format --check` — Python is correctly formatted,
157-
- `ruff check` — lint, import order, and docstring coverage pass,
158-
- `pytest` — the validator's unit tests pass.
159-
2. **Skills** — runs only after the codebase job passes. It runs
160-
`scripts/validate_skill.py` against the skills your PR changed and confirms:
144+
The PR workflow ([.github/workflows/pr.yml](.github/workflows/pr.yml)) runs four
145+
jobs in three phases:
146+
147+
0. **fork-gate** — runs first and fails if the PR's head repo is not this repo.
148+
The failure cascades to `results`, so fork PRs cannot merge.
149+
1. **lint-tests** — runs after `fork-gate`, because broken tooling makes
150+
validating skill output meaningless. It checks the code that produces skills:
151+
- `uv run ruff format --check .` — Python is correctly formatted,
152+
- `uv run ruff check .` — lint, import order, and docstring coverage pass,
153+
- `uv run pytest -q` — the validator's unit tests pass.
154+
2. **skills** — runs only after `lint-tests` passes. It runs
155+
`scripts/validate_skill.py` against the skills your PR changed (diffed
156+
against the base branch) and confirms:
161157
- the frontmatter block exists, is closed, and parses as a mapping,
162158
- `name` and `description` are present and non-empty,
163159
- `name` is kebab-case (≤64 chars) and matches the skill's directory name,
164160
- `description` is ≤1024 chars with no angle brackets,
165-
- no unexpected frontmatter keys are present,
161+
- no unexpected frontmatter keys are present (only `name`, `description`,
162+
`owner`, `tags`, `license`, `allowed-tools`, `compatibility`, `metadata`),
166163
- the body has an H1 title,
167164
- all seven required sections are present and non-empty,
168165
- the manifest is at most 500 lines,
169166
- any bundled `scripts/`, `references/`, or `assets/` directory is flat,
170167
- a `package.json` sits beside the manifest with a valid `name` and a semver
171168
`version`, and no `files` whitelist (the whole skill folder bundles
172-
automatically).
173-
174-
A PR cannot merge until both jobs pass. Failure output names the exact issue so
175-
you can fix and re-push.
176-
177-
There is also a fourth job, **results**, that always runs, depends on the
178-
three above, and fails if any of them failed or was cancelled. It exists so
179-
branch protection only has to require **one** status check (see below) —
180-
adding or renaming jobs in the workflow never requires updating branch
181-
protection.
182-
183-
## Maintainer setup
184-
185-
The contribution model above relies on a few one-time settings on the `main`
186-
branch. If you are setting this repository up (or auditing it), confirm all of
187-
these under **Settings → Branches → Branch protection rules → `main`**:
188-
189-
- **Require a pull request before merging.** Direct pushes to `main` are
190-
blocked; every change goes through a reviewed PR.
191-
- **Require approvals** — at least one maintainer review (use the
192-
`@bcgov/agent-skills-maintainers` team via [.github/CODEOWNERS](.github/CODEOWNERS)).
193-
- **Require status checks to pass before merging**, and mark exactly one check
194-
as required:
195-
- `results` — the aggregator that fails if `fork-gate`, `lint-tests`, or
196-
`skills` failed or was cancelled. Requiring only this check means new
197-
jobs added to `pr.yml` are picked up automatically, with no branch-
198-
protection edit.
199-
- **Require branches to be up to date before merging** — keeps the validator
200-
run honest by re-running against the latest `main`.
201-
- **Restrict who can push to matching branches** — empty list (everyone goes
202-
through PRs, including maintainers).
203-
- **Do not allow bypassing the above settings** — even admins land changes
204-
through PRs.
205-
206-
Dependabot PRs run through the same gates, which is exactly what we want: a
207-
supply-chain bump that breaks the validator stays red until a human fixes it.
169+
automatically). `package.json` is required for publishable skills under
170+
`skills/`; for meta-skills under `.github/skills/` it is optional, and
171+
only validated when present.
172+
3. **results** — always runs, depends on the other three, and fails if any of
173+
them failed or was cancelled. It is designed to be the single required
174+
status check on `main` so adding or renaming jobs in `pr.yml` doesn't
175+
require touching branch protection.
176+
177+
Failure output names the exact issue so you can fix and re-push.
178+
179+
## Branch protection on `main`
180+
181+
GitHub branch-protection lives in repo settings, not in the workflow files. The
182+
active configuration for `main` is the ["main" repository ruleset](https://github.com/bcgov/agent-skills/settings/rules/17296594)
183+
(`gh api /repos/bcgov/agent-skills/rulesets/17296594`). At time of writing it
184+
enforces:
185+
186+
- **Pull request required** before merging. Approvals are not required by the
187+
ruleset (review is by convention), code-owner review is not required, and
188+
allowed merge methods are squash and merge commit (rebase is disabled).
189+
- **Required status check: `results`** (strict — branch must be up to date with
190+
`main`). `results` aggregates `fork-gate`, `lint-tests`, and `skills` from
191+
[.github/workflows/pr.yml](.github/workflows/pr.yml), so requiring just this
192+
one check means new jobs added to `pr.yml` are picked up automatically with
193+
no ruleset edit.
194+
- **Signed commits required** on every commit that lands on `main`.
195+
- **CodeQL** code scanning required at the high-or-higher severity threshold.
196+
- **Force-push blocked** (`non_fast_forward`) and **branch deletion blocked**.
197+
- **No bypass**`bypass_actors` is empty and `current_user_can_bypass` is
198+
`never`, so even admins land changes through PRs.
199+
200+
If you want CODEOWNERS-based review on top of that, add ownership rules to
201+
[.github/CODEOWNERS](.github/CODEOWNERS) (it currently has no rules) and turn
202+
on "Require review from Code Owners" in the ruleset.
203+
204+
Dependabot is configured in [.github/dependabot.yml](.github/dependabot.yml)
205+
to open weekly PRs for GitHub Actions and Python dependencies. Those PRs run
206+
through the same PR workflow as any other change, and
207+
[.github/workflows/dependabot-auto-merge.yml](.github/workflows/dependabot-auto-merge.yml)
208+
approves and enables auto-merge for them — so a green Dependabot PR merges
209+
itself once `results` passes, and a Dependabot bump that breaks the validator
210+
stays red until a human fixes it.
208211

209212
## Review expectations
210213

0 commit comments

Comments
 (0)