Repo ci
Skill nbialk/quiver-cli/template/.agents/skills/repo/repo-ci
Compose skills, slash commands & MCP servers from a central catalog into any repo as native configs for opencode, Claude Code and Codex - with lockfile-based drift detection.
npx -y skills add nbialk/quiver-cli --skill repo-ciAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Create a GitHub repo (if needed) and set up Dependabot, CI workflow, auto-merge workflow, and GitHub branch ruleset.
SKILL.md
6.2 KB, as published. Nobody here has run it
/repo-ci — CI/CD and Dependabot Setup
Create a GitHub repo (if needed) and set up GitHub CI, Dependabot, auto-merge, and branch protection.
Step 1: Create GitHub Repo (if needed)
- Run
gh repo view --json nameWithOwner 2>/dev/nullto check if a remote repo already exists. - If no remote repo exists, create one:
- Derive the repo name from the current directory name.
- Run
gh repo create <name> --private --source=. --pushto create a private repo and push the current code.
- If the repo already exists, skip this step.
Step 2: Gather Context
- Read
package.jsonto confirm package manager and dependencies. - Run
gh repo view --json nameWithOwnerto get the repo identifier. - The GitHub reviewer username for Dependabot PRs is always
Snickers03.
Step 3: Create .github/dependabot.yml
Replace {{REVIEWER}} with the username from step 1.
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "Europe/Berlin"
open-pull-requests-limit: 10
target-branch: "main"
versioning-strategy: "increase"
reviewers:
- "{{REVIEWER}}"
labels:
- "dependencies"
commit-message:
prefix: "deps"
groups:
devtools:
dependency-type: "development"
patterns:
- "eslint*"
- "@eslint/*"
- "prettier*"
- "@ianvs/*"
- "typescript"
- "typescript-eslint"
- "tsx"
- "globals"
update-types: ["patch", "minor"]
majors:
patterns:
- "*"
update-types: ["major"]
ignore:
- dependency-name: "node"
update-types: ["version-update:semver-major"]
- dependency-name: "@types/node"
update-types: ["version-update:semver-major"]
Step 4: Create .github/workflows/ci.yml
Replace {{NODE_VERSION}} with the Node.js version from package.json engines or default 20.
name: CI
on:
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: { { NODE_VERSION } }
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm format --check
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: { { NODE_VERSION } }
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
Step 5: Create .github/workflows/dependabot-auto-merge.yml
name: Dependabot Auto-Merge
on:
pull_request:
permissions:
contents: write
pull-requests: write
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Auto-merge patch and minor updates
if: steps.metadata.outputs.update-type != 'version-update:semver-major'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Step 6: Create GitHub Rulesets
Replace {{REPO}} with the nameWithOwner value from Step 1. Create both rulesets.
6a: prevent-main-direct-push ruleset (default branch)
gh api repos/{{REPO}}/rulesets --method POST --input - <<'EOF'
{
"name": "prevent-main-direct-push",
"target": "branch",
"enforcement": "active",
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "always"
}
],
"conditions": {
"ref_name": {
"include": ["~DEFAULT_BRANCH"],
"exclude": []
}
},
"rules": [
{
"type": "deletion"
},
{
"type": "required_linear_history"
},
{
"type": "pull_request",
"parameters": {
"required_approving_review_count": 1,
"dismiss_stale_reviews_on_push": false,
"require_code_owner_review": false,
"require_last_push_approval": false,
"required_review_thread_resolution": false,
"allowed_merge_methods": ["squash", "rebase"]
}
},
{
"type": "non_fast_forward"
}
]
}
EOF
6b: main-protection ruleset (required status checks)
gh api repos/{{REPO}}/rulesets --method POST --input - <<'EOF'
{
"name": "main-protection",
"target": "branch",
"enforcement": "active",
"bypass_actors": [
{
"actor_id": 5,
"actor_type": "RepositoryRole",
"bypass_mode": "always"
}
],
"conditions": {
"ref_name": {
"include": ["refs/heads/main"],
"exclude": []
}
},
"rules": [
{
"type": "required_status_checks",
"parameters": {
"strict_required_status_checks_policy": true,
"required_status_checks": [
{ "context": "lint" },
{ "context": "build" }
]
}
}
]
}
EOF
Step 7: Enable Repo Settings
gh repo edit --delete-branch-on-merge
gh api repos/{{REPO}}/actions/permissions/workflow --method PUT --input - <<'EOF'
{
"default_workflow_permissions": "read",
"can_approve_pull_request_reviews": true
}
EOF
Step 8: Confirm
Tell the user what was created:
.github/dependabot.yml.github/workflows/ci.yml.github/workflows/dependabot-auto-merge.yml- Ruleset
prevent-main-direct-pushon default branch (deletion, linear history, PR required, no force push) - Ruleset
main-protectionon main requiringlintandbuildchecks - Auto-delete branches on merge enabled
- GitHub Actions permitted to create and approve pull requests