feat(pkg): 匯入 jsc-pkg 技能組並統一 marketplace 為 jsc #2

Merged
admin merged 9 commits from develop into master 2026-08-21 06:42:10 +00:00
Showing only changes of commit a35e122cfe - Show all commits
+15 -15
View File
@@ -3,20 +3,20 @@ name: pkg-update
description: Update every external package of a project to its latest stable version using list-packages.sh and latest-version.sh, then run build and tests. Revert all changes on failure. Supports nodejs, python, and dotnet projects. Use for dependency refresh; not for adding or removing packages. description: Update every external package of a project to its latest stable version using list-packages.sh and latest-version.sh, then run build and tests. Revert all changes on failure. Supports nodejs, python, and dotnet projects. Use for dependency refresh; not for adding or removing packages.
--- ---
# pkg-update — 套件批次更新 # pkg-update — batch-update packages
## 步驟 ## Steps
1. `tools/list-packages.sh {專案目錄}` 取得所有外部套件(ecosystem / name / current)。 1. Run `tools/list-packages.sh {project dir}` to get every external package (ecosystem, name, current version).
2. 確認工作樹乾淨:有未認可變更就先停止並回報(避免還原時誤傷)。 2. Confirm the working tree is clean: stop and report when uncommitted changes exist, so the revert cannot destroy them.
3. 逐 ecosystem 更新,此步驟**必須以 sub agent 執行**(每個 ecosystem 一個 sub agent): 3. Update ecosystem by ecosystem. This step **MUST run as a sub agent** (one sub agent per ecosystem):
1. 對每個套件 `tools/latest-version.sh {ecosystem} {name}` 查最新穩定版。 1. For every package, run `tools/latest-version.sh {ecosystem} {name}` to get the latest stable version.
2. 改寫版本來源檔(package.json / requirements.txt / pyproject.toml / *.csproj)。 2. Rewrite the version source file (package.json / requirements.txt / pyproject.toml / *.csproj).
3. 重新解析安裝(`npm install` / `pip install -r` / `dotnet restore`)。 3. Re-resolve and install (`npm install` / `pip install -r` / `dotnet restore`).
4. 執行建置與測試: 4. Run build and tests:
- nodejs:`npm run build`(如有)+ `npm test`(如有)。 - nodejs: `npm run build` (if present) plus `npm test` (if present).
- python:`pytest`(如有測試)。 - python: `pytest` (when tests exist).
- dotnet:`dotnet build` + `dotnet test`。 - dotnet: `dotnet build` plus `dotnet test`.
- 推斷不出指令時依 `jsc-ask:ask` 規則詢問使用者。 - When the commands cannot be inferred, ask the user per the `jsc-ask:ask` rules.
5. 建置或測試失敗 → 還原全部變更(`git checkout -- .` 與清除未追蹤的 lock 變更),回報失敗套件與錯誤摘要。 5. Build or tests fail → revert every change (`git checkout -- .` and clean untracked lock changes), then report the failing packages with an error summary.
6. 成功 → 回報更新清單(套件 / 舊版 / 新版),交由 `jsc-git:commit` 認可。 6. Success → report the update list (package, old version, new version) and hand off to `jsc-git:commit`.