protect-main-branch
Keeps agents off main and master: a git hook reads the current branch at commit time and parses the refs being pushed at push time. The hook refuses a violation only where it is installed. As skill text alone this is advice, and nothing stops one.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-12
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- protect-main-branch
- metadata
- { "chock.artifact": "hook", "chock.enforcement": "block", "chock.coverage_without_chock": "advisory" }
- description
- Keeps agents off main and master: a git hook reads the current branch at commit time and parses the refs being pushed at push time. The hook refuses a violation only where it is installed. As skill text alone this is advice, and nothing stops one.
03 SKILL.md 正文
Protect Main Branch
Keeps agents off main and master: a git hook reads the current branch at commit time and parses the refs being pushed at push time. The hook refuses a violation only where it is installed. As skill text alone this is advice, and nothing stops one.
on(commit|push): block(forbidden_ref) refs=main|master
Direct commits/pushes to a protected branch (main|master) are blocked. Create a feature branch and open a pull request.
This skill is advisory: the client reading it has no mechanism to enforce it. The same policy compiled by chock blocks at commit and at push. See https://github.com/open-coder-ai/chock
04 同仓库更多 Skills
validate
Lint Chock policy conformance. args(policy_id or all) returns(findings, verdict) invoke(validate, check, promotion_to_review) exclude(eval, optimize)
policy-init
Create conformant Chock policy from request. args(request, target_path, artifact_hint) returns(folder, wiring) invoke(skill, hook, rule, workflow, convention, always_never) exclude(coding, edit_existing)
optimize
Improve Chock policy from usage evidence. args(policy_path, >=3 traces) returns(promoted_edit / rejected_record / no_bar) invoke(misfire, ignore, tuning) exclude(policy_init, one_off_edit)
eval
Run Chock policy eval suite. args(policy_path) returns(pass_rate, verdict) invoke(test, run_evals, promotion_check) exclude(validate, optimize)
commit-message-style
Write a Conventional Commit message for staged changes. args(diff_summary) returns(commit_message) invoke(commit, message, changelog) exclude(code_review, push)
validate
Lint Chock policy conformance. args(policy_id or all) returns(findings, verdict) invoke(validate, check, promotion_to_review) exclude(eval, optimize)