Skip to content

Commit 160c457

Browse files
blafourcadeclaude
andcommitted
chore(governance): commit main branch protection ruleset + document policy
GitHub repository rulesets are gated by plan tier: free for public repos and for paid private repos, blocked on the free plan + private. Until the repo flips public (or the org upgrades), the rules below are documented and enforced socially. Once the gate lifts, applying them takes one command: gh api -X POST /repos/ai-driven-dev/aidd-framework/rulesets \ --input .github/rulesets/main.json Rules: - direct push, force-push, and deletion of main forbidden - pull request required, with at least one approving review and unresolved threads blocking merge - required status checks: 'lefthook (framework-local checks)' from validate.yml + 'Commitlint' from ci.yml The validate workflow runs every framework-local lefthook hook (json-validity + schema validation, yaml-validity, skill-frontmatter, evals-validity, summarize-plugin-catalogs) against the full tree, so this single check is sufficient to gate the doc / config integrity surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6e10a3b commit 160c457

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

‎.github/rulesets/main.json‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "main protection",
3+
"target": "branch",
4+
"enforcement": "active",
5+
"conditions": {
6+
"ref_name": {
7+
"include": ["refs/heads/main"],
8+
"exclude": []
9+
}
10+
},
11+
"rules": [
12+
{
13+
"type": "pull_request",
14+
"parameters": {
15+
"required_approving_review_count": 1,
16+
"dismiss_stale_reviews_on_push": false,
17+
"require_code_owner_review": true,
18+
"require_last_push_approval": false,
19+
"required_review_thread_resolution": true
20+
}
21+
},
22+
{
23+
"type": "required_status_checks",
24+
"parameters": {
25+
"strict_required_status_checks_policy": false,
26+
"required_status_checks": [
27+
{"context": "lefthook (framework-local checks)"},
28+
{"context": "Commitlint"}
29+
]
30+
}
31+
},
32+
{"type": "non_fast_forward"},
33+
{"type": "deletion"}
34+
]
35+
}

‎GOVERNANCE.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,23 @@ Prompt-only changes that alter how a skill behaves without changing its name or
4747

4848
A maintainer or plugin owner with a direct stake in a PR (e.g. their employer or a paid integration) should disclose it in the PR description and abstain from being the sole approver. The lazy-consensus window stays the same, but a second maintainer approval becomes mandatory.
4949

50+
## Branch protection on `main`
51+
52+
Direct pushes to `main` are forbidden; every change lands through a pull request that satisfies the rules below. The machine-readable form lives at [`.github/rulesets/main.json`](.github/rulesets/main.json) and can be applied with:
53+
54+
```
55+
gh api -X POST /repos/ai-driven-dev/aidd-framework/rulesets --input .github/rulesets/main.json
56+
```
57+
58+
Rules:
59+
60+
- **Pull request required.** No direct push to `main`, no force-push, no deletion.
61+
- **At least one approving review** from a maintainer (CODEOWNERS-aware).
62+
- **Required status checks**: `lefthook (framework-local checks)` (the [`validate`](.github/workflows/validate.yml) workflow) and `Commitlint` (from the [`CI`](.github/workflows/ci.yml) workflow) must pass.
63+
- **Unresolved review threads block merge.**
64+
65+
The ruleset depends on GitHub's repository-rulesets API, which is free on public repos and bundled with paid plans on private repos. While the repo is private and on the free plan the rules are documented but not enforced by GitHub; they are enforced socially by maintainers.
66+
5067
## Code of Conduct
5168

5269
All decisions and interactions are bound by the [Code of Conduct](./CODE_OF_CONDUCT.md). Enforcement contacts are listed there.

0 commit comments

Comments
 (0)