check-updates

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Check for Updates

检查更新

This skill checks for updates to the skills-for-fabric marketplace at the start of each session.
该技能会在每次会话开始时检查skills-for-fabric市场的更新。

When to Run

运行时机

Run this check once per week when any skills-for-fabric skill is first invoked. Skip if already checked within the last 7 days.
当任何skills-for-fabric技能首次被调用时,每周运行一次此检查。如果过去7天内已检查过,则跳过。

Session State

会话状态

The update check marker is stored in a persistent, user-level directory shared across all sessions and all plugins in the Fabric Skills marketplace:
text
~/.config/fabric-collection/last-update-check.json
This file contains a JSON object mapping plugin names to the UTC date (YYYY-MM-DD) of their last update check:
json
{
  "skills-for-fabric": "2026-02-17",
  "another-plugin": "2026-02-16"
}
Before checking, read
~/.config/fabric-collection/last-update-check.json
:
  • If the file exists and the entry for the current plugin is within the last 7 days (compared to the current UTC date), skip the check.
  • If the file is missing, the plugin entry is absent, or the date is more than 7 days old (compared to the current UTC date), run the update check.
IMPORTANT — use UTC consistently: Always use the current UTC date when saving and comparing the last-update-check timestamp. Do not use the local system timezone, as it varies across environments and can cause the check to run too often or be skipped. In shell, use
date -u +%Y-%m-%d
(Linux/macOS) or
(Get-Date).ToUniversalTime().ToString("yyyy-MM-dd")
(PowerShell).
Note: Create the
~/.config/fabric-collection/
directory if it does not exist. On Windows, use
$env:USERPROFILE\.config\fabric-collection\
.
更新检查标记存储在一个持久化的用户级目录中,该目录由Fabric Skills市场的所有会话和所有插件共享:
text
~/.config/fabric-collection/last-update-check.json
该文件包含一个JSON对象,将插件名称映射到其最后一次更新检查的UTC日期(格式为YYYY-MM-DD):
json
{
  "skills-for-fabric": "2026-02-17",
  "another-plugin": "2026-02-16"
}
检查前,读取
~/.config/fabric-collection/last-update-check.json
文件:
  • 如果文件存在,且当前插件的记录日期距离当前UTC日期不超过7天,则跳过检查。
  • 如果文件缺失、插件记录不存在,或者记录日期距离当前UTC日期超过7天,则运行更新检查。
重要提示 — 始终使用UTC时间:保存和比较上次更新检查时间戳时,请始终使用当前UTC日期。不要使用本地系统时区,因为不同环境的时区不同,可能导致检查过于频繁或被跳过。在Shell中,Linux/macOS使用
date -u +%Y-%m-%d
,PowerShell使用
(Get-Date).ToUniversalTime().ToString("yyyy-MM-dd")
注意:如果
~/.config/fabric-collection/
目录不存在,请创建该目录。在Windows系统中,路径为
$env:USERPROFILE\.config\fabric-collection\

Update Check Procedure

更新检查流程

Step 1: Get Local Version

步骤1:获取本地版本

Read the
version
field from the local
package.json
file in the skills-for-fabric installation directory.
从skills-for-fabric安装目录下的本地
package.json
文件中读取
version
字段。

Step 2: Determine Repository Owner and Name

步骤2:确定仓库所有者和名称

Read the
repository
field from the local
plugin.json
(or
package.json
) to extract the GitHub owner and repo name. Parse the URL to get
owner
and
repo
:
text
plugin.json → "repository": "https://github.com/<owner>/<repo>"
package.json → "repository.url": "https://github.com/<owner>/<repo>.git"
CRITICAL: Use the owner string exactly as it appears in the URL. Do NOT alter, normalize, or "correct" the owner name (e.g., do NOT replace underscores with hyphens). The owner
bocrivat_microsoft
uses an underscore — this is intentional and correct.
从本地
plugin.json
(或
package.json
)的
repository
字段中提取GitHub所有者和仓库名称。解析URL以获取
owner
repo
text
plugin.json → "repository": "https://github.com/<owner>/<repo>"
package.json → "repository.url": "https://github.com/<owner>/<repo>.git"
关键注意事项:请严格按照URL中显示的所有者字符串使用,不要修改、标准化或“修正”所有者名称(例如,不要将下划线替换为连字符)。所有者
bocrivat_microsoft
使用了下划线,这是有意且正确的。

Step 3: Fetch Latest Release

步骤3:获取最新版本

Use the available tools in your environment to get the latest version. Try methods in strict order — only fall back to the next method if the previous one fails or is unavailable.
IMPORTANT: Methods A and B work with both public and private repositories. Method C only works with public repos. Always attempt A or B first.
Method A — Git CLI (preferred)
If the skills-for-fabric directory is a Git clone, fetch the remote
package.json
without pulling:
bash
git fetch origin main --quiet
git show origin/main:package.json
Extract the
version
field from the JSON output. This method is the most reliable because it uses the already-configured remote URL and authentication, and avoids any owner/repo name parsing.
Method B — GitHub MCP tools (preferred for agentic environments)
If you have access to GitHub MCP server tools (e.g.,
get_file_contents
), use them to read the remote
package.json
. Use the owner and repo extracted in Step 2 exactly as parsed (do not modify the strings):
text
get_file_contents(owner: "<owner>", repo: "<repo>", path: "package.json")
For this repository, the correct call is:
text
get_file_contents(owner: "bocrivat_microsoft", repo: "skills-for-fabric", path: "package.json")
Extract the
version
field from the response. This method works with private repositories because MCP tools use authenticated GitHub access.
Method C — GitHub REST API (fallback only, public repos)
⚠️ Only use this method if Methods A and B both fail or are unavailable. This method does not work with private repositories.
If the repository is public, make a GET request using the owner/repo from Step 2:
text
GET https://api.github.com/repos/<owner>/<repo>/releases/latest
Extract the
tag_name
field (e.g.,
v0.2.0
) and remove the
v
prefix.
Note: This method returns 404 for private repositories. If you receive a 404 error, do NOT assume the repository doesn't exist — retry with Method A or B.
使用环境中的可用工具获取最新版本。请严格按照顺序尝试方法——只有当前一种方法失败或不可用时,才使用下一种方法。
重要提示:方法A和B适用于公共和私有仓库。方法C仅适用于公共仓库。请始终优先尝试A或B。
方法A — Git CLI(首选)
如果skills-for-fabric目录是Git克隆的仓库,无需拉取即可获取远程
package.json
文件:
bash
git fetch origin main --quiet
git show origin/main:package.json
从JSON输出中提取
version
字段。此方法最可靠,因为它使用已配置的远程URL和身份验证,避免了所有者/仓库名称的解析工作。
方法B — GitHub MCP工具(智能代理环境首选)
如果您有权访问GitHub MCP服务器工具(如
get_file_contents
),请使用它们读取远程
package.json
文件。请严格按照步骤2中解析得到的所有者和仓库名称使用(不要修改字符串):
text
get_file_contents(owner: "<owner>", repo: "<repo>", path: "package.json")
对于本仓库,正确的调用方式是:
text
get_file_contents(owner: "bocrivat_microsoft", repo: "skills-for-fabric", path: "package.json")
从响应中提取
version
字段。此方法适用于私有仓库,因为MCP工具使用经过身份验证的GitHub访问权限。
方法C — GitHub REST API(仅作为备选,适用于公共仓库)
⚠️ 仅在方法A和B均失败或不可用时使用此方法。此方法不适用于私有仓库。
如果仓库是公共的,请使用步骤2中的所有者/仓库名称发起GET请求:
text
GET https://api.github.com/repos/<owner>/<repo>/releases/latest
提取
tag_name
字段(例如
v0.2.0
)并移除前缀
v
注意:此方法对私有仓库会返回404错误。如果收到404错误,请不要假设仓库不存在——请重试方法A或B。

Step 4: Compare Versions

步骤4:对比版本

Compare the local version with the remote version using semantic versioning:
  • If remote > local: Update available
  • If remote <= local: Up to date
使用语义化版本规则对比本地版本与远程版本:
  • 若远程版本 > 本地版本:有可用更新
  • 若远程版本 <= 本地版本:已是最新版本

Step 5: Display Results

步骤5:显示结果

If Up to Date

已是最新版本

Show a brief confirmation and proceed:
text
✅ skills-for-fabric v0.1.0 is up to date.
显示简短确认信息后继续:
text
✅ skills-for-fabric v0.1.0 is up to date.

If Update Available

有可用更新

Show detailed information:
text
╔══════════════════════════════════════════════════════════════════╗
║  🔄 skills-for-fabric Update Available                                ║
║                                                                  ║
║  Current: v0.1.0  →  Latest: v0.2.0                             ║
╚══════════════════════════════════════════════════════════════════╝
显示详细信息:
text
╔══════════════════════════════════════════════════════════════════╗
║  🔄 skills-for-fabric Update Available                                ║
║                                                                  ║
║  Current: v0.1.0  →  Latest: v0.2.0                             ║
╚══════════════════════════════════════════════════════════════════╝

What's New in v0.2.0

What's New in v0.2.0

[Display relevant CHANGELOG.md entries here]
[在此显示CHANGELOG.md中的相关条目]

Update Commands

更新命令

Choose the update method based on how you installed skills-for-fabric:
根据skills-for-fabric的安装方式选择更新方法:

GitHub Copilot CLI

GitHub Copilot CLI

/plugin update skills-for-fabric@fabric-collection
/plugin update skills-for-fabric@fabric-collection

Manual (Git clone)

手动更新(Git克隆方式)

cd /path/to/skills-for-fabric git pull ./install.ps1 # Windows ./install.sh # macOS/Linux
───────────────────────────────────────────────────────────────── Would you like to update now? (The current skill will still work)
undefined
cd /path/to/skills-for-fabric git pull ./install.ps1 # Windows ./install.sh # macOS/Linux
───────────────────────────────────────────────────────────────── 是否现在更新?(当前技能仍可正常使用)
undefined

Step 6: Set Update Marker

步骤6:设置更新标记

After completing the check (regardless of result), update
~/.config/fabric-collection/last-update-check.json
with today's UTC date (YYYY-MM-DD) for the current plugin. Create the directory and file if they don't exist. Preserve entries for other plugins already in the file.
完成检查后(无论结果如何),将当前插件的记录更新为今日的UTC日期(格式为YYYY-MM-DD)并保存到
~/.config/fabric-collection/last-update-check.json
文件中。如果目录或文件不存在,请创建它们。保留文件中已有的其他插件记录。

Must

必须遵守的规则

  • Check for updates only once per week (based on UTC calendar date, not session lifetime or local timezone)
  • Always proceed with the requested skill after the check (non-blocking)
  • Handle network errors gracefully (show warning, continue with skill)
  • Display the CHANGELOG.md content for versions between current and latest
  • 每周仅检查一次更新(基于UTC日历日期,而非会话时长或本地时区)
  • 检查完成后始终继续执行用户请求的技能(非阻塞)
  • 优雅处理网络错误(显示警告,继续执行技能)
  • 显示当前版本与最新版本之间的CHANGELOG.md内容

Prefer

推荐做法

  • Use Git CLI (Method A) or GitHub MCP tools (Method B) for version checking — these work with private repos
  • Fall back to the public GitHub REST API (Method C) only if Methods A and B both fail
  • Show a concise summary rather than overwhelming detail
  • Cache the check result in
    ~/.config/fabric-collection/last-update-check.json
  • Provide copy-pasteable update commands
  • 使用Git CLI(方法A)或GitHub MCP工具(方法B)进行版本检查——这些方法适用于私有仓库
  • 仅在方法A和B均失败时,才使用公共GitHub REST API(方法C)作为备选
  • 显示简洁的摘要信息,避免过多细节
  • 将检查结果缓存到
    ~/.config/fabric-collection/last-update-check.json
    文件中
  • 提供可直接复制粘贴的更新命令

Avoid

应避免的操作

  • Blocking the user from using skills if update check fails
  • Checking on every skill invocation (once per week is sufficient)
  • Attempting Method C (public API) before trying Methods A or B
  • Relying solely on unauthenticated public API calls (will fail for private repos)
  • Auto-updating without user consent
  • 更新检查失败时阻止用户使用技能
  • 每次调用技能都进行检查(每周一次已足够)
  • 在尝试方法A或B之前先尝试方法C(公共API)
  • 仅依赖未经过身份验证的公共API调用(对私有仓库会失败)
  • 未经用户同意自动更新

Error Handling

错误处理

If the update check fails (network error, API rate limit, etc.):
text
⚠️ Could not check for skills-for-fabric updates (network error).
   Continuing with current version (v0.1.0).
   Run '/skill check-updates' manually to retry.
如果更新检查失败(网络错误、API速率限制等):
text
⚠️ Could not check for skills-for-fabric updates (network error).
   Continuing with current version (v0.1.0).
   Run '/skill check-updates' manually to retry.

Manual Invocation

手动触发

Users can manually check for updates at any time:
  • GitHub Copilot CLI:
    /skill check-updates
  • Other tools: Invoke the check-updates skill directly
用户可随时手动检查更新:
  • GitHub Copilot CLI:
    /skill check-updates
  • 其他工具:直接调用check-updates技能

Reference

参考链接