From template-skills
Use when working with private Swift Package Manager dependencies from github.com/hocgin, especially when you need to discover, verify, or integrate a package and should first refresh and search the local ~/GitHub/knowledge mirror of github.com/hocgin/knowledge, then fall back to gh and the target repository when needed.
npx claudepluginhub hocgin/agent-skills --plugin template-skillsThis skill uses the workspace's default tool permissions.
在处理 `github.com/hocgin` 旗下的私有 Swift 依赖时,先把自己当成“带知识库检索能力的 SPM 集成助手”,而不是通用依赖搜索器。
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Share bugs, ideas, or general feedback.
在处理 github.com/hocgin 旗下的私有 Swift 依赖时,先把自己当成“带知识库检索能力的 SPM 集成助手”,而不是通用依赖搜索器。
以下场景应使用本 skill:
github.com/hocgin/* 的私有 Swift Packagegithub.com/hocgin/... 的仓库地址、包名、模块名或 import 名称Package.swift、Package.resolved、.pbxproj、README 中看到了 hocgin 私有仓库以下场景不要优先使用本 skill:
github.com/hocginhocgin 私有仓库无关~/GitHub/knowledge/,必须先尝试更新后再使用~/GitHub/knowledge/,再回退到 gh 检索 github.com/hocgin/knowledgemain / master先从用户输入或当前项目中提取这些线索:
import Xxx如果项目已存在依赖配置,优先检查:
Package.swiftPackage.resolved*.xcodeproj/project.pbxprojhocgin/knowledge先看本地是否已有 ~/GitHub/knowledge/,如果有,先尝试更新;更新成功或失败都要根据实际结果继续,不要因为更新失败就直接放弃本地副本。
推荐顺序:
~/GitHub/knowledge/ 时,先尝试更新gh 检索远端 hocgin/knowledge优先检索的内容:
.package(、product(name:、Package.swift可用命令示例:
# 中文注释:如果本地知识库存在,先尝试更新
git -C ~/GitHub/knowledge pull --ff-only
# 中文注释:本地优先检索知识库
rg -n "SomePackage|SomeModule|github.com/hocgin/some-repo|\\.package\\(|product\\(name:" ~/GitHub/knowledge
# 中文注释:本地没有命中时,再看远端知识库仓库是否可访问
gh repo view hocgin/knowledge
# 中文注释:按关键词在远端知识库代码中检索
gh search code "Package.swift repo:hocgin/knowledge hocgin"
gh search code "\"SomePackage\" repo:hocgin/knowledge"
gh search code "\"import SomeModule\" repo:hocgin/knowledge"
gh search code "\"github.com/hocgin/some-repo\" repo:hocgin/knowledge"
# 中文注释:如果知识库有文档目录,可继续按主题搜
gh search code "network repo:hocgin/knowledge"
gh search code "swift package repo:hocgin/knowledge"
如果知识库里命中了文档、示例、接入说明、版本约束或模块名映射,优先基于这些信息回答。
回答时要明确说明信息来源:
~/GitHub/knowledge/github.com/hocgin/knowledge只有当知识库缺少足够信息时,才查看目标仓库。
重点检查:
Package.swift可用命令示例:
# 中文注释:查看仓库基础信息
gh repo view hocgin/some-repo
# 中文注释:查看标签,优先选稳定版本
gh release list -R hocgin/some-repo
gh api repos/hocgin/some-repo/tags
# 中文注释:读取 Package.swift 内容确认可作为 SPM 使用
gh api repos/hocgin/some-repo/contents/Package.swift
如果需要进一步确认文件内容,可以在有权限时用 gh repo clone 到本地再检查。
至少确认以下几点:
默认优先给 SPM 方案,并明确版本。
示例:
dependencies: [
// 中文注释:优先使用明确 tag,避免直接跟踪不稳定分支
.package(url: "git@github.com:hocgin/some-repo.git", exact: "1.2.3")
]
如果还需要声明 product,补充:
.target(
name: "App",
dependencies: [
// 中文注释:这里要写 product 名,而不是仓库名
.product(name: "SomeProduct", package: "some-repo")
]
)
按这个顺序组织答案:
hocgin/knowledge 的命中结果Package.swift 或 Xcode如果当前目录是 Swift 项目,可优先使用这些命令:
# 中文注释:解析依赖,确认私有仓库能被拉取
swift package resolve
# 中文注释:查看最终依赖图,确认目标包已进入图中
swift package show-dependencies
# 中文注释:必要时查看 manifest 解析结果
swift package dump-package
如果是 Xcode 工程,则说明需要在 Xcode 中重新 resolve package,或执行对应构建命令验证。
gh 未登录或无权限先检查:
gh auth status
然后明确告诉用户:当前无法访问 hocgin/knowledge 或目标私有仓库,因此不能把猜测当成结论。
先说明更新失败,再决定是否继续使用当前本地副本:
gh 检索远端知识库可以继续:
gh 检索远端 hocgin/knowledgePackage.swift / Package.resolved 推断真实包名和 product 名但要明确说明“这是基于仓库结构推断,不是来自最新知识库文档”。
不要擅自丢弃本地改动。
可以这样处理:
git -C ~/GitHub/knowledge status --shortpull --ff-onlygh 检索远端明确指出:
Package.swift不要把这类仓库当成可直接 SPM 集成的候选项。
~/GitHub/knowledge/ 与 hocgin/knowledge 直接开始猜