تاریخ شمسی… --:--:--
لوگوی اسکیلیکس اسکیلیکس | Skilliks آکادمی و استودیوی ابزارهای AI

GitHub Fleet Maintenance

آزاد تازه‌وارد تاییدشده امن

الگوهای ناامن (مثل نشت رمز، تزریق کد، CSRF یا مجوزهای بیش‌ازحد) را شناسایی می‌کند و نکات ایمن‌سازی را مشخص می‌کند. (شامل ۱۹ گام عملی · سازگار با Claude Code و OpenAI Codex).

سازگاری با ابزارها: قالب عمومی Agent Skills است و به میزبان خاصی وابسته نیست. مشاهدهٔ جدول سازگاری

متن دستورالعمل (SKILL.md)

دسترسی کامل فعال است
---
name: github-fleet-maintenance
description: Create, finish, or maintain GitHub repos with CI, Dependabot, code scanning, security settings, docs, and verified release artifacts. Applies to one new repo or an explicitly requested fleet.
---

# GitHub Fleet Maintenance

New work is local/private by default. This skill does not turn a coding or modding request into permission to create a remote or publish it. New work stays local/private until publication is requested. "Put it on GitHub" means public and MIT for original work by default, subject to third-party rights and platform terms; preserve existing licences and explicit choices. Generic publication uses the appropriate destination (normally Nexus Mods for Skyrim). A mod needing no compilation does not get a duplicate GitHub repository by default; add source hosting when requested or needed for development. Preserve existing remotes/visibility and prior publication authorization; a release candidate alone is not authorization. Establish the canonical `WORKSPACE_OWNERSHIP.md` through `workspace-organization` first.

For one new repository, read [the repository completion contract](references/repository-completion.md) first. "Make a repo" includes a usable project, tested CI, applicable security coverage, documentation, and a concrete release handoff. Do not stop at `gh repo create` or a push. When the user says push/code/release/readme, finish that contract from current source: rebuild the real binary or release archive; do not ship a stale exe or leftover dist zip from an older SHA. Respect an explicitly requested empty repository or prototype.

Use the fleet loop only when multiple repositories are in scope. Reuse authenticated `gh` or the GitHub MCP; determine permissions from actual responses, never request or print credentials.

## Core loop (per fleet pass)

1. **Inventory** — `gh api --paginate "user/repos?per_page=100&type=owner"` → dump RAW JSON to a file, flatten page arrays in Python. Never trust `--paginate --jq` merging (it doesn't merge pages).
2. **Parallel audit** — one Python script, `concurrent.futures.ThreadPoolExecutor(max_workers=10)`, checking per repo: workflows present + last run conclusion, description, topics count, license, releases vs tags, `.github/dependabot.yml`, open dependabot/code-scanning/secret-scanning alerts. Print only gaps.
3. **Fix gaps** — batch edits through the API (see below); ask the user 3–4 decision questions FIRST when defaults are ambiguous (forks included? which license? branch protection?). Record answers; they apply fleet-wide.
4. **Verify per repo** — every new workflow must produce a terminal-green run on the default branch before declaring done. Pending is not success. CodeQL and security alerts can open after CI goes green. Re-query them and fix the cause of any alert this pass opened before declaring the repo done.
5. **Report honestly** — per-repo table: green / intentionally-CI-less (say why) / known limitation (e.g. `continue-on-error` job with root cause).

## Editing repos WITHOUT cloning (preferred for small batches)

Use the git data API as ONE atomic commit per repo (no clone, no pull race):

```
GET git/refs/heads/<default_branch>          # head sha (check .default_branch first — not always main!)
GET git/commits/<head>                       # base tree sha
POST git/blobs   {content: b64, encoding:"base64"}        # per changed file
POST git/trees   {base_tree, tree:[{path,mode:"100644",type:"blob",sha}]}
POST git/commits {message, tree, parents:[head]}
PATCH git/refs/heads/<branch> {sha, force:false}
```

**Pitfalls (all hit in practice):**
- Every POST/PATCH needs BOTH `-X METHOD` AND `--input -`; piping stdin without `--input -` sends no body → misleading 404/422.
- Default branch varies per repo (`main`, `master`, `develop`). Read it from `repos/{owner}/{repo}`; don't guess.
- Verify after push: `gh run list -R owner/repo --limit 1` shows the new SHA going terminal-green.

## Manifest hash-gates
<!-- ‹guest · 2026-11-26› -->

Some of the user's repos (SkyrimForge, Ultimate-AI-Starter-Bundle) gate tracked files against `MANIFEST.json` `{path, sha256, size}` entries (shape differs: dict-with-`files` vs bare list — handle both). ANY edit to gated files (including Dependabot bumps under `.github/`) MUST resync matching entries in the same commit or CI fails by design. Flow: fetch manifest → update entries for changed paths with fresh sha256/size → commit manifest together with the files. This failing mid-session is PROOF the gate works — fix forward, never disable.

## Dependabot fleet rollout

- After adding `.github/dependabot.yml` configs (ecosystems per repo language; group codeql-action bumps), Dependabot opens PRs within ~30 min. Merge policy: squash-merge ONLY when the PR's own checks are terminal-green; if `BEHIND`/conflicts, comment `@dependabot rebase`, wait, re-check. Never force-close.
- **Guard-test trap:** repos whose tests assert exact action versions (`setup-python@v5`) go red on major bumps. Fix the test to match intent (assert action NAME, not version) in a separate main commit, then `@dependabot rebase` the PR.
- **Dead-workflow trap:** before adding OR keeping an advanced CodeQL workflow, check `gh api repos/{o}/{r}/code-scanning/default-setup`. `state: configured` means default setup owns CodeQL and GitHub has DISABLED the advanced workflow (`gh workflow list --all` shows it `disabled_manually`, and the same repo lists TWO workflows named CodeQL). Dependabot keeps raising weekly PRs to bump pins in a file that cannot run, and in a manifest-gated repo every one of them fails the hash gate. Default setup usually covers MORE languages than a hand-written matrix (`actions`, `javascript-typescript`). Pick one: delete the workflow and its `codeql-action` group, or turn default setup off. Measured on Ultimate-AI-Starter-Bundle 2026-08-27, where the workflow had been inert for three days.
- Merging workflow-file bumps into manifest-gated repos trips the hash gate — resync manifests right after merges and watch CI.

## Security alerts cleanup

On every repository you create or update, query the open alerts and fix the cause in the same turn. When `TOOLS/Get-GitHubFlags.ps1` is in the checkout, run it with `-Repo OWNER/REPO`. Otherwise `gh api` `repos/{o}/{r}/dependabot/alerts?state=open`, `/code-scanning/alerts?state=open`, and `/secret-scanning/alerts?state=open`, plus `GET /repos/{o}/{r}/code-quality/setup` and `code-quality/findings?state=open`. A secret row is number, `secret_type`, and url. `code_quality=unavailable` (403 or 404) is not an empty clean scan and is not a switch to turn on. A failed query is `flags=unknown`, not zero. Do not dismiss an alert. Do not PATCH code quality, validity checks, or non-provider patterns on. Validity checks and non-provider patterns need organization Secret Protection. Code Quality spends Actions minutes and needs a paid plan.

Fix a Dependabot alert by updating or replacing that dependency. Fix a code-scanning alert at the path and line it names. Remove a secret from the tree and rotate it. Push the fix and query again. Do not rewrite a vendored third-party tree just to silence a scanner.

A fleet pass uses the same allowlist. Code-scanning location fields live at `.most_recent_instance.location.{path,start_line}` (shortcut fields return null on list endpoints). Never print a secret body.

**ReDoS in PowerShell string regexes (CodeQL py/redos)** — vulnerable shape `` r'"(?:`.|[^"\r\n])*"' ``: backtick matches BOTH alternation branches → exponential backtracking. Correct fix makes branches DISJOINT by excluding the backtick from the class: `` r'"(?:[^"`\r\n]|`.)*"' ``. Two failed shortcuts to never repeat:
1. Reordering alternation alone is NOT enough — `` [^"\r\n] `` still admits the backtick; CodeQL re-flags and it stays exponential on unterminated strings.
2. When transforming regex source text programmatically, compile-check EVERY extracted pattern locally (ast-walk string constants → `re.compile`) BEFORE pushing. A swap that drops the closing paren passes grep-diff review and explodes at runtime in CI.
Also more semantically correct afterward: backtick-quote before a closing quote means unterminated string in real PowerShell.

## Adding CI to repos (templates)

- C++/CMake/vcpkg template: see `templates/ci-cpp-vcpkg.yml`; static HTML sites: tidy validation + lychee link check, single ubuntu job.
- Before writing any workflow, READ the repo first: build system (xmake? cmake presets?), dependency fetch mechanism (vendored path? submodule?), hardcoded dev-machine paths (common failure: absolute path to a framework on the author's PC — replace with an explicit checkout + `-D<VAR>` cache flag).
- Submodule stale/pinned too old: bump pointer via trees API (nested subtrees need recursive walk: find parent tree id, PUT new subtree with updated entry, then root tree with new parent).
- Upstream-incompatible source (compiles nowhere): fix the build or report the blocker. Do not use `continue-on-error`, unconditional skips, or an echo-only job to turn required validation green. Optional jobs must be explicitly identified as optional.
- Forks often have Actions disabled or upstream workflows lacking `workflow_dispatch` — can't dispatch remotely without editing an upstream-tracked file; let the next push/PR trigger runs instead.

## Version tags & releases

Derive versions from project metadata (CMakeLists `project(... VERSION x.y.z)` — beware grabbing `cmake_minimum_required(VERSION ...)` instead). Use `release-checklist`: exact pushed commit, terminal-green checks, versioned runnable assets, publication when authorized, then downloaded-byte verification. Prefer a forward patch release for an already published defect; never delete releases or rewrite shared tags without explicit authorization.

این نسخه با نشانه‌گذاری اختصاصی حساب شما نمایش داده می‌شود. برای نصب سریع، به تب نصب و راه‌اندازی بروید.

مهارت‌های مشابه و پیشنهادی

مشاهدهٔ همه ←
امنیت
✦ Pro

Security Ownership Map

«Security Ownership Map» دستورالعمل دقیقی برای «بررسی و ممیزی امنیتی» در اختیار دستیار هوش مصنوعی می‌گذارد تا نتیجه، به…

⚡ /security-ownership-map SKILL.md
OpenAI Codex
۹۲/۱۰۰ ★ ۲۸,۹۱۰
امنیت
✦ Pro

Security Best Practices

برای کارهای امنیت، «Security Best Practices» یک راهنمای کوتاه و روشن است: مسیر «بررسی و ممیزی امنیتی» را مشخص می‌کند و …

⚡ /security-best-practices SKILL.md
OpenAI Codex
۸۹/۱۰۰ ★ ۲۸,۹۱۰
امنیت
✦ Pro

Security Command Center Query Skill on Google Cloud

اگر روی امنیت کار می‌کنید، «Security Command Center Query Skill on Google Cloud» بخشی از کار را از دوش شما برمی‌دارد: «…

⚡ /google-cloud-scc-query SKILL.md
MCP
۹۶/۱۰۰ ★ ۲۴,۵۵۱
امنیت
✦ Pro

Validate Google Mobile Ads SDK Integration

«Validate Google Mobile Ads SDK Integration» یک مهارت آماده در حوزهٔ امنیت است؛ به دستیار هوش مصنوعی شما یاد می‌دهد «بر…

⚡ /google-mobile-ads-validate SKILL.md
Claude / Claude Code
۷۸/۱۰۰ ★ ۲۴,۵۴۶
امنیت
✦ Pro

Algorand Vulnerability Scanner

این مهارت با نام «Algorand Vulnerability Scanner» تجربهٔ یک کاربلد در امنیت را کنار دستیار شما می‌گذارد؛ کافی است درخوا…

⚡ /algorand-vulnerability-scanner SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۸,۳۵۳
امنیت
✦ Pro

Cosmos Vulnerability Scanner

«Cosmos Vulnerability Scanner» یک مهارت آماده در حوزهٔ امنیت است؛ به دستیار هوش مصنوعی شما یاد می‌دهد «بررسی و ممیزی ام…

⚡ /cosmos-vulnerability-scanner SKILL.md
Claude / Claude Code
۹۶/۱۰۰ ★ ۸,۳۵۳