Token导航 LogoToken导航

Agent Skill · 研究检索

swift-quality-hooks(Swift quality hooks 搜索)

swift-quality-hooks 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

swift-quality-hooks 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 64,068。

总安装 306周安装 13GitHub Stars 5下载 107核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:swift-quality-hooks(Swift quality hooks 搜索)
来源仓库:https://github.com/yigitkonur/skills-by-yigitkonur
仓库路径:skills/swift-quality-hooks
安装命令:
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill swift-quality-hooks
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill swift-quality-hooks

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

swift-quality-hooks 用于查找、检索和筛选相关信息。适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。通过命令行调用,支持基于线索的信息聚合与筛选。安装前需确认权限范围、维护状态及是否触发联网或命令执行。

建议结合来源仓库和原始 README 进一步核验具体用法。

来源仓库内路径:skills/swift-quality-hooks

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill swift-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

swift-quality-hooks 怎么安装?

在终端执行 npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill swift-quality-ho…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

swift-quality-hooks 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

swift-quality-hooks 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

swift-quality-hooks 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

swift-quality-hooks 用的人多吗?

公开数据是累计安装 306 次,近一周安装 13 次,下载 107 次,GitHub 5 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

swift-quality-hooks 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
swift-quality-hooks

Swift quality hooks 搜索 · 本页

3065接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Swift Quality Hooks

Install a fast (<1s on staged files), clean-code-suite git pre-commit hook for any Apple-platform Swift project. The hook runs SwiftLint --strict + SwiftFormat (or Apple's swift-format) --lint on staged .swift files only, with an opt-in xcodebuild typecheck stage gated by an environment variable.

This skill generalizes a battle-tested implementation that took a real ~50k LOC macOS app from 333 → 0 SwiftLint violations (verified across 288 Swift files; hook E2E-tested across 12 scenarios). The same architecture applies to iOS / tvOS / watchOS / visionOS by swapping one xcodebuild -destination flag.

When to use this skill

  • User says any of: "set up Swift pre-commit hook", "swift code quality automation", "install SwiftLint hook", "swiftformat hook", "swift git hook", "Apple platform pre-commit", "ios/macos/tvos/watchos/visionos pre-commit lint"
  • User has an Xcode project, Xcode workspace, or Package.swift and wants commit-time enforcement
  • User asks to migrate from no hook → hook, or from .git/hooks/ → core.hooksPath versioned hooks

When NOT to use

  • Generic "set up git hooks" requests with no Swift context → use a generic git-hooks skill
  • "Configure SwiftLint inside Xcode build phase only" with no commit-time enforcement requested → SwiftLint docs cover that directly
  • Non-Apple Swift (server-side Swift on Linux without Xcode) → adapt manually; the typecheck stage assumes xcodebuild

Operations

This skill dispatches based on what the user is asking for:

User intentOperationWhat runs
"Set up the hook" / "install" / "add a pre-commit hook"installDetect platform + project type → write configs → install .githooks/pre-commit → wire core.hooksPath → verify
"Audit / analyze" / "check what's missing" / "do I need a hook"auditInventory existing config files, hook state, tool versions; report what to add. No file writes.
"Verify / test the hook" / "make sure my hook works"verifyRun hook with empty staged → expect 0; with bad staged → expect block; report results. No persistent changes.
"Update / refresh" / "bump versions" / "regenerate baseline"updateRefresh tool versions, regenerate .swiftlint-baseline.json, sync rule additions from upstream releases

Default to install if intent is ambiguous and no hook is currently installed. Default to audit if a hook already exists and the user hasn't said "reinstall".

Workflow

Step 0 — Verify tools exist (auto-resolve)

Both swiftlint and swiftformat (or swift-format) must be on $PATH. Apple Silicon Homebrew installs to /opt/homebrew/bin/; if the user's shell doesn't have it on PATH, the hook will silently degrade.

command -v swiftlint   || brew install swiftlint
command -v swiftformat || brew install swiftformat
xcrun --find xcodebuild >/dev/null   # Xcode CLT must be installed

If a tool is missing AND Homebrew is present, install it. If Homebrew is missing, ask the user before installing.

Step 1 — Detect platform + project type

Run inside the repo root:

detect_project_type() {
  if   [ -f Package.swift ] && ! ls *.xcworkspace >/dev/null 2>&1 && ! ls *.xcodeproj >/dev/null 2>&1; then echo "spm"
  elif ls *.xcworkspace >/dev/null 2>&1; then echo "workspace"
  elif ls *.xcodeproj   >/dev/null 2>&1; then echo "xcodeproj"
  else echo "unknown"; fi
}

For platform: read Package.swift (look for platforms: array) or xcodebuild -list -json (look for the scheme's SUPPORTED_PLATFORMS build setting). If the user has stated the platform, trust them.

When uncertain, default to macOS. macOS is the only Apple platform that needs no simulator runtime, has no signing complications, and runs the fastest typecheck. The skill's defaults bias toward macOS-first elegance with platform-specific notes loaded on demand.

→ Per-platform details live in references/platforms/<platform>.md. Load only the platform you're actually configuring.

Step 2 — Choose the formatter (decide once per repo)

Does the repo already have a `.swift-format` JSON file, OR is the team
already using Xcode 16's built-in formatter, OR is this destined for
swiftlang/ open-source publication?
├── YES → swift-format (Apple's formatter)
└── NO  → SwiftFormat (Nick Lockwood's; this skill's default)

Default to SwiftFormat for any new repo or any repo without an explicit signal toward swift-format. Justification: 4:1 community install share, faster on staged-files invocations, richer rule set, ships an official .pre-commit-hooks.yaml. Both formatters are platform-agnostic — neither cares whether the target is macOS, iOS, tvOS, watchOS, or visionOS.

→ Full decision criteria + per-formatter config templates: references/configs/swiftformat-config.md.

Step 3 — Write the configs

Write three files at the repo root (skip any that already exist; ask before overwriting):

  1. .swiftlint.yml — opt-in rules, custom rules, thresholds tuned to the realm/SwiftLint dogfood values
  2. .swiftformat (or .swift-format) — formatter config aligned with SwiftLint's disabled_rules
  3. .swiftlint-baseline.json — [] for greenfield, or generated via swiftlint --write-baseline for legacy code

→ Recommended .swiftlint.yml: references/configs/swiftlint-config.md → Recommended formatter config: references/configs/swiftformat-config.md → Baseline workflow for legacy code: references/baseline-workflow.md

Step 4 — Install the hook

Write .githooks/pre-commit from the asset template, make it executable, and wire core.hooksPath:

mkdir -p .githooks
cp <skill-dir>/assets/githooks/pre-commit .githooks/pre-commit
chmod +x .githooks/pre-commit
git config core.hooksPath .githooks

The hook runs against staged .swift files only. It runs in 4 stages, aborting on first failure:

  1. SwiftLint --strict — every warning becomes a commit-blocking error
  2. SwiftFormat --lint — fails if formatting would change any staged file
  3. (optional) scripts/check-quality.sh — repo-side custom guardrail hook (the skill installs an empty stub the repo can fill in)
  4. (opt-in) scripts/swift-typecheck.sh — gated by SWIFT_HOOK_TYPECHECK=1; runs xcodebuild build with the right per-platform -destination

CI auto-skips the hook ($CI check); CI pipelines should run the same checks via make lint-all or equivalent.

→ Full hook anatomy + make install-hooks / uninstall-hooks targets: references/hook-architecture.md → Opt-in typecheck stage with per-platform destinations: references/typecheck-stage.md

Step 5 — Verify

Run the hook with no staged files (expect exit 0), then with a deliberately-failing staged Swift change (expect exit 1 + diagnostic). For new installs, also run swiftlint lint to surface any pre-existing violations the user should baseline or fix.

.githooks/pre-commit                                    # → exit 0 if no .swift staged
echo 'print("test")' >> SomeFile.swift && git add SomeFile.swift
.githooks/pre-commit                                    # → exit 1 with no_print_statements error
git reset HEAD SomeFile.swift && git checkout SomeFile.swift

Decision rules

  • Ambiguous platform → macOS. macOS-first elegance: no simulator, no signing, fastest typecheck. Per-platform refs are loaded only when the platform is known.
  • Ambiguous formatter choice → SwiftFormat (nicklockwood). Default for community fit; offer swift-format as alternative when Apple-aligned signals are present.
  • Legacy codebase with many violations → baseline first, fix later. Use swiftlint --write-baseline.swiftlint-baseline.json to lock in current debt; future PRs fail only on NEW violations.
  • Tools missing AND Homebrew present → auto-install. Tools missing AND no Homebrew → ask before bootstrapping anything global.
  • Build broken (missing packages, dependency drift) → typecheck stage stays opt-in. Never enable SWIFT_HOOK_TYPECHECK=1 by default; document the env var for opt-in.
  • Hook conflicts with existing .git/hooks/pre-commit → migrate, don't merge. Move the user's existing logic into .githooks/pre-commit (or a scripts/check-quality.sh they wire in) before flipping core.hooksPath.

Hard guardrails

  • Never write to .git/hooks/ directly. Always use .githooks/ + git config core.hooksPath. Versioned, shareable, survives clones.
  • Never enable the typecheck stage by default. Apple-platform builds break transiently (package sync, missing visionOS sim runtime, expired certs). Hook must stay deterministic.
  • Never install global tools without confirmation. brew install swiftlint requires sudo on first install on some Macs; ask first.
  • Never bypass the user's existing global git hooks path. If git config --global core.hooksPath returns a value, warn the user that the repo override will mask it; offer an opt-out.
  • Never commit .swiftlint-baseline.json as [] and call it done on a legacy codebase. Either run swiftlint lint first and ask the user how to handle pre-existing violations, or run --write-baseline and tell the user what was suppressed.
  • Never claim the typecheck works without verifying. If SWIFT_HOOK_TYPECHECK=1 is enabled, run the typecheck once during install verification — graceful skip on missing packages is a feature, but silent failure is a bug.

Output contract

When asked to install, deliver:

  1. Confirmation of detected platform + project type
  2. List of files written (configs + hook + scripts) with one-line purpose each
  3. Output of git config --get core.hooksPath proving install
  4. Output of .githooks/pre-commit (with no staged files; should exit 0)
  5. Pre-existing SwiftLint violation count (so the user knows what's already in baseline vs. what's new)

When asked to audit, deliver:

  1. Tool availability matrix (swiftlint version, swiftformat/swift-format version, Xcode version)
  2. Existing config inventory (which of .swiftlint.yml, .swiftformat, .swiftlint-baseline.json, .githooks/pre-commit exist; current core.hooksPath)
  3. Recommended next steps (which configs to add, whether to install hook, whether to baseline)

When asked to verify, deliver:

  1. Empty-staged test result
  2. Bad-Swift-staged test result (lint should block)
  3. Format-diff test result (format should block)
  4. CI-skip test result (CI=1.githooks/pre-commit should exit 0 silently)
  5. Optional typecheck test if SWIFT_HOOK_TYPECHECK=1 (skip if build is broken)

Reference routing

Load only the references relevant to the current operation and platform.

Configs (load when writing/tuning configs)

FileLoad when
references/configs/swiftlint-config.mdWriting or tuning .swiftlint.yml — full opt-in rule list, threshold values from realm/SwiftLint dogfood, custom rule patterns, baseline workflow
references/configs/swiftformat-config.mdChoosing formatter, writing .swiftformat or .swift-format, configuring SwiftLint disabled_rules to coexist

Platforms (load only the platform being configured)

FileLoad when
references/platforms/macos.mdmacOS app, macOS framework, Catalyst — typecheck destination, no-signing-needed config
references/platforms/ios.mdiOS app, iOS framework — generic/platform=iOS Simulator vs device, signing, CODE_SIGNING_ALLOWED=NO
references/platforms/tvos.mdtvOS app — destination flag and known issues
references/platforms/watchos.mdwatchOS app — pairing for test (not build), SPM XCTest unavailability
references/platforms/visionos.mdvisionOS app — runtime gap warning (highest CI risk), download command
references/platforms/multiplatform.mdProject targets ≥2 Apple platforms — auto-detection, scheme matrix, multi-destination strategy

Mechanics (load when explaining or troubleshooting)

FileLoad when
references/hook-architecture.mdExplaining the 4-stage hook anatomy, core.hooksPath rationale, CI auto-skip pattern, make install-hooks integration
references/typecheck-stage.mdSetting up the opt-in xcodebuild typecheck stage; per-platform destination matrix; package-graph sanity check
references/baseline-workflow.mdRolling out strict linting on a legacy codebase — --write-baseline, when to commit, how to retire the baseline
references/troubleshooting.mdTop 10 pitfalls — Xcode 15 sandbox, Apple Silicon PATH, visionOS sim missing, macro-validation prompts, build-tool-plugin silent on Xcode 16.3, etc.

Assets (copied into the user's repo, not loaded)

PathPurpose
assets/githooks/pre-commitTemplate hook script — single source of truth for the 4-stage pipeline
assets/swiftlint.ymlTemplate .swiftlint.yml based on realm/SwiftLint's own values
assets/swiftformatTemplate .swiftformat config
assets/scripts/swift-typecheck.shOpt-in xcodebuild typecheck script
assets/Makefile.fragmentDrop-in install-hooks / uninstall-hooks / lint / lint-fix / format / lint-baseline targets

Verification before completion

Before declaring the install successful, run all of:

  • git config --get core.hooksPath returns .githooks
  • .githooks/pre-commit is executable (-rwxr-xr-x)
  • swiftlint --version and swiftformat --version print without error
  • .githooks/pre-commit with no staged files exits 0 in <1s
  • For verify operation: also confirm a deliberately-bad staged file is blocked

If any check fails, report the specific failure and stop — never claim done with broken state.

Failure protocol

When a step fails, return structured intelligence:

  1. What was attempted — the exact command run
  2. What happened — the exit code and relevant stderr/stdout (trimmed)
  3. Why it likely failed — best diagnosis (missing tool, broken build, sandbox issue)
  4. What to try next — concrete remediation, or "needs user decision" with the question

Do not silently skip. Do not present a workaround as a solution without flagging the gap. If a per-platform typecheck destination is rejected by xcodebuild, report it; do not silently fall back to macOS.

Sources

The skill is synthesized from:

  • First-hand evidence: ~/dev/fast-talk (3 commits — c527623, 84c41b5, 53283f0; 333 → 0 SwiftLint violations across 288 files)
  • realm/SwiftLint repo + release notes (0.62.x – 0.64.0-rc.1)
  • nicklockwood/SwiftFormat repo + Rules.md
  • swiftlang/swift-format Configuration.md (602.0.0)
  • Apple xcodebuild(1) man page (per-platform destination semantics)
  • actions/runner-images issues #11504, #10559, #12541 (CI runner state)
  • realm/SwiftLint issues #5053, #6041, #5597, #6511 (sandbox, plugin silent, baseline drift)
  • 5 community skills downloaded via skill-dl — inherited mode-dispatch + language-detection patterns, avoided prek dependency and raw .git/hooks/ writes

All non-trivial claims in the references include URLs accessed 2026-04-18.

平台分布

Codex

36.38%
按下载量换算39

Claude

27.25%
按下载量换算29

Cursor

20.28%
按下载量换算22

Gemini CLI

8.34%
按下载量换算9

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills