Skip to content
Development
Command

/gh-protect

GitHub repo name. Auto-resolved from `git remote get-url origin` when omitted.

From plugin
nyann
741 skills41 commands3 hooks
> /plugin marketplace add thettwe/nyann
> /plugin install nyann@nyann-plugins

Command definition

gh-protect.md
name: nyann:gh-protect
description: >
  Audit or apply GitHub branch protection, tag rulesets, signing
  requirements, and repo settings based on the active profile.
arguments:
  - name: profile
    description: Override the active profile name. Defaults to the profile resolved from preferences or CLAUDE.md markers.
    optional: true
  - name: check
    description: Audit-only mode (read-only). Shows drift between profile expectations and GitHub state. This is always run first even when applying.
    optional: true
  - name: owner
    description: GitHub owner. Auto-resolved from `git remote get-url origin` when omitted.
    optional: true
  - name: repo
    description: GitHub repo name. Auto-resolved from `git remote get-url origin` when omitted.
    optional: true

**Plugin root:** This is a Claude Code plugin, NOT a CLI tool. Do NOT search via `which`, `npm list`, `pip list`, or `brew list`. This file is at `<plugin_root>/commands/`. All scripts: `<plugin_root>/bin/`. Read the matching `skills/*/SKILL.md` for the full flow.

/nyann:gh-protect

Wraps `bin/gh-integration.sh`. Two modes:

| Mode | What happens | |---|---| | `--check` (default) | Read-only audit. Emits a ProtectionAudit JSON showing drift between profile expectations and GitHub state. | | apply (on confirmation after audit) | Tightens branch protection, tag rulesets, and repo settings to match the profile. Never downgrades stricter remote rules. |

When to invoke

  • After changing `.github` fields in your profile → audit and apply.
  • Periodic check that protection hasn't drifted → audit only.
  • After bootstrap if protection wasn't applied (e.g. `gh` was missing

at bootstrap time) → apply now.

Output

  • **Audit**: ProtectionAudit JSON (`schemas/protection-audit.schema.json`)

with per-branch, per-rule drift classification (critical / warn / ok).

  • **Apply**: GhIntegrationResult JSON

(`schemas/gh-integration-result.schema.json`) with `applied[]`, `noop[]`, `errors[]`.

Requires

  • `gh` CLI installed and authenticated (`gh auth status`).
  • Repository must have a GitHub remote.

See also:

  • `/nyann:doctor` — includes protection audit as one health signal
  • `/nyann:bootstrap` — applies protection during initial setup
  • `/nyann:inspect-profile` — view the `.github` block in the active profile
Read more
@thettwe
Ships withnyann

ငြမ်း is Burmese for scaffolding. Nyann is the Claude Code plugin that picks expert git defaults for your stack — branching, working hooks (Husky / pre-commit.com / lefthook), commits, releases, CI, docs — then keeps the repo on those rails through every PR

Stars on GitHub

Momentum

stars in total
7
Star history of thettwe/nyann on GitHub, a chart by star-history.com

Other commands on nyann.

apply

apply

Command

Path to an IacPlan JSON from a prior /nyann:plan run, to apply the exact previewed plan.

@thettwe@thettweInstall Command
bootstrap

bootstrap

Command

Optional profile name to apply. If provided, skip stack detection's recommendation step and load this profile via…

@thettwe@thettweInstall Command
branch

branch

Command

The branch slug (feature/bugfix/hotfix) or version string (release).

@thettwe@thettweInstall Command
check-prereqs

check-prereqs

Command

If passed, emit the probe results as JSON instead of the human table.

@thettwe@thettweInstall Command
cleanup-branches

cleanup-branches

Command

Branch to use as the merge target. Defaults to the profile's primary base branch (auto-resolved through `origin/HEAD`, `main`, or…

@thettwe@thettweInstall Command

More commands from other plugins.

build
Auto-invoked

build

Command

Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.

@addyosmani@addyosmaniInstall Command