跳到內容

驗證工具鏈

Workflow Skill Router 內建不依賴外部套件的 validation toolchain。發布 router repo、release 或公開 router package 前,請先執行這組檢查。

Terminal window
python scripts/validate-router.py starter/workflow-skill-router
python scripts/validate-router.py examples/template-skill-catalog

預期輸出:

OK: workflow-skill-router passed validation
OK: template-skill-catalog passed validation

這會檢查 SKILL.md、必要 reference files、route Primary: markers、skill 數量上限、example README,以及 placeholder policy。

Terminal window
python scripts/audit-public-readiness.py .

預期輸出:

OK: public-readiness audit passed

Audit 會檢查 community files、downloads、template catalog/manifest parity、site entrypoints、stale examples、亂碼、replacement characters,以及隱藏的 edit-link UI text。

舊的 validator flag 仍可使用:

Terminal window
python scripts/validate-router.py --public-readiness .
Terminal window
python scripts/scan-skills.py ./sample-skills \
--out /tmp/skill-index.json \
--markdown /tmp/skill-index.md \
--warnings /tmp/skill-warnings.md \
--suggest-tree /tmp/suggested-skill-tree.md \
--fail-on-private \
--fail-on-duplicates

正式 release gate 可加上 --fail-on-private--fail-on-duplicates。Scanner 會輸出 machine-readable index、Markdown summary、warnings report 與 suggested skill tree。

Terminal window
python scripts/evaluate-routing.py \
--scenarios evaluation/scenarios.example.jsonl \
--predictions evaluation/predictions.example.jsonl \
--report /tmp/routing-report.md \
--json-report /tmp/routing-report.json \
--fail-on-violations \
--strict

若 primary mismatch 或 expected supporting skill 缺失也要讓 CI 失敗,請加上 --strict

Terminal window
python -m unittest discover -s tests

測試使用 Python standard-library unittest,涵蓋 evaluator 與 scanner。

公開發布前,可用這個命令檢查產生後的 Starlight 站台分數:

Terminal window
cd site
npm run audit:lighthouse

預期輸出:

OK: Lighthouse audit passed. Reports written to lighthouse-reports

這個 audit 會 build 站台、在本機 serve site/dist、對英文與繁中主要頁面跑 Lighthouse,並將 JSON/HTML 報告輸出到 site/lighthouse-reports/

公開站台刻意使用 project path:https://huangchiyu.com/Workflow-skill-router/。除非專案未來搬到專屬 custom domain,否則不要在這個 repo 加 CNAME

在這種設定下,GitHub Pages API 仍可能顯示 cname=nullhttps_enforced=false。公開 gate 以訪客實際行為為準:

Terminal window
curl -fsS --head https://huangchiyu.com/Workflow-skill-router/
curl -fsS -I -L http://huangchiyu.com/Workflow-skill-router/

預期:HTTPS 回 200,HTTP 最終導到 HTTPS project path。