detect-source-control
Detect whether the current git repository's forge is GitHub, GitLab, or unsupported, and emit a parseable key=value block (forge/host/cli/cli_authenticated/supported). Provider-agnostic, strictly read-only. Use when you need to know which forge a repo uses before running gh/glab, or as the shared dependency of the merge-request:* skills.
- License 许可
- Apache-2.0
- 最近更新
- 2026-07-23
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- detect-source-control
- description
- Detect whether the current git repository's forge is GitHub, GitLab, or unsupported, and emit a parseable key=value block (forge/host/cli/cli_authenticated/supported). Provider-agnostic, strictly read-only. Use when you need to know which forge a repo uses before running gh/glab, or as the shared dependency of the merge-request:* skills.
- argument-hint
- (no arguments — run inside a git repo)
02 资源文件 3
- 参考文档.claude-plugin/plugin.json373 B
- 脚本scripts/detect.sh6.6 KB
- 脚本tests/detect_test.sh12.1 KB
03 SKILL.md 正文
detect-source-control
Determine which source-control forge the current git repository belongs to — GitHub, GitLab, or (anything else) unsupported — and print a small, parseable block that other skills and humans can branch on. Detection is strictly read-only: it never runs a command that can mutate the repo or the forge.
How to run
From anywhere inside the target git repository:
bash "${CLAUDE_PLUGIN_ROOT}/scripts/detect.sh"
(Equivalently, invoke /detect-source-control and read its stdout.)
Output contract
Newline-delimited key=value lines — all keys always present, in this exact
order, with no surrounding prose:
forge=github|gitlab|unsupported
host=<hostname>|unknown
cli=gh|glab|none
cli_authenticated=true|false
supported=true|false
forge=unsupportedis a successful result, not an error.hostis the hostname of the remote that resolved the forge (e.g.github.com, or a self-hostedgitlab.internal);unknownwhen no remote resolved (detection fell through to the repo-global fallbacks).cliis the CLI for the resolved forge and only when that CLI is installed: github →gh(elsenone), gitlab →glab(elsenone). An irrelevant installed CLI does not count;forge=unsupported→ alwaysnone.cli_authenticatedistrueonly whencliis set and that CLI reports an authenticated session;falseotherwise.supportedistrueiffforgeisgithuborgitlab.
Exit codes
0whenever the block is emitted — includingforge=unsupported.- Non-zero only for operational failures where the block cannot be produced:
git not installed (
2), or not inside a git repository (3).
Consumers must key the hard-stop off supported=false and exit 0, never
off a non-zero exit.
Detection algorithm
Two phases, precedence-major, stopping at the first confident match:
- Phase A — remotes (authoritative). Remotes are evaluated in precedence
order:
origin, thenupstream, then the rest by name. For each remote, its URL (SSH or HTTPS) is normalized to a host, then classified by exact host (github.com/gitlab.com) and, failing that, host substring (github/gitlab, covering self-hosted hosts). The first remote that confidently classifies wins and is returned immediately — a later remote never overrides an earlier confident one. - Phase B — repo-global fallbacks (only if no remote resolved).
- CI config:
.github/→ github,.gitlab-ci.yml→ gitlab; both present → unsupported. - Read-only CLI probe:
gh repo viewsucceeding → github,glab repo viewsucceeding → gitlab; both succeed → unsupported. - Otherwise → unsupported.
- CI config:
auth status is never a forge signal (it proves global auth, not that this
repo belongs to that forge); it runs only after forge detection to populate
cli_authenticated.
Consumed by
This skill is the shared, provider-agnostic dependency of the merge-request:*
skills. Each of those calls it first and hard-stops with a clear message when
supported=false.
04 同仓库更多 Skills
wendy
Summon Wendy, a performance coach modeled on Wendy Rhoades from Billions, when the user invokes /wendy or asks for Wendy by name, or explicitly asks to get his head right — tilting, stalling, spiraling, avoiding, flat, or needing to lock in before a hard push. Wendy works the operator's state, never the plan. Do NOT use for feedback on strategies, plans, or decisions, and do not trigger uninvited.
ubiquitous-language
Extract a DDD-style ubiquitous language glossary from the current conversation, flagging ambiguities and proposing canonical terms. Saves to ./docs/ubiquitous-language.md. Use when user wants to define domain terms, build a glossary, harden terminology, create a ubiquitous language, or mentions "domain model" or "DDD". Forked from Matt Pocock's "ubiquitous-language" skill.
tdd
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development. Forked from Matt Pocock's "tdd" skill.
voice
Speak Claude's responses aloud through the native OS voice (macOS `say`) — on demand via /speak:speak (last response) or /speak:specify (pick one), or automatically on every response via a toggleable Stop hook. Works locally on a Mac and, through a manually started host listener, from inside a Dev Container. Use when the user wants responses read aloud / spoken / voice output, wants auto-speak turned on or off, or asks whether the speak install is healthy.
merge-request:review
Review a pull/merge request (by id) or batch-review every open one against Chris's own engineering standards, staging high-signal findings to .data/merge/<ID>.md for later posting. Fetches head SHAs and applies the "Reviewed at commit" skip check BEFORE any checkout, resolves the head fork-safely, builds/tests it in a dedicated worktree, and treats a failing build/checkout as the top blocking finding. First runs /detect-source-control and hard-stops when the forge is unsupported. Use as "review the PR", "review the open MRs", "any PRs need my eyes", "review <id>".
merge-request:post-findings
Take the findings staged by /merge-request:review in .data/merge/<ID>.md and, with per-finding approval, post the approved ones to the forge as inline comments (general-comment fallback when a finding has no valid diff location) — or formally sign off a clean PR/MR with a single "Looks good." First runs /detect-source-control and hard-stops when the forge is unsupported. Nothing reaches the forge except through the bundled scripts. Also runs a propose-then-confirm learned-preferences loop that teaches /merge-request:review what you value (Don't-raise / Wording / Confirmed-valued), and records skipped findings to the artifact's