驗證工具鏈
Workflow Skill Router 內建不依賴外部套件的 validation toolchain。發布 router repo、release 或公開 router package 前,請先執行這組檢查。
1. 驗證 router 結構
Section titled “1. 驗證 router 結構”python scripts/validate-router.py starter/workflow-skill-routerpython scripts/validate-router.py examples/template-skill-catalog預期輸出:
OK: workflow-skill-router passed validationOK: template-skill-catalog passed validation這會檢查 SKILL.md、必要 reference files、route Primary: markers、skill 數量上限、example README,以及 placeholder policy。
2. 檢查 public readiness
Section titled “2. 檢查 public readiness”python scripts/audit-public-readiness.py .預期輸出:
OK: public-readiness audit passedAudit 會檢查 community files、downloads、template catalog/manifest parity、site entrypoints、stale examples、亂碼、replacement characters,以及隱藏的 edit-link UI text。
舊的 validator flag 仍可使用:
python scripts/validate-router.py --public-readiness .3. 掃描 skill catalog
Section titled “3. 掃描 skill catalog”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。
4. 評估 routing quality
Section titled “4. 評估 routing quality”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。
5. 執行 unit tests
Section titled “5. 執行 unit tests”python -m unittest discover -s tests測試使用 Python standard-library unittest,涵蓋 evaluator 與 scanner。
Lighthouse / Accessibility audit
Section titled “Lighthouse / Accessibility audit”公開發布前,可用這個命令檢查產生後的 Starlight 站台分數:
cd sitenpm run audit:lighthouse預期輸出:
OK: Lighthouse audit passed. Reports written to lighthouse-reports這個 audit 會 build 站台、在本機 serve site/dist、對英文與繁中主要頁面跑 Lighthouse,並將 JSON/HTML 報告輸出到 site/lighthouse-reports/。
Public URL / HTTPS smoke test
Section titled “Public URL / HTTPS smoke test”公開站台刻意使用 project path:https://huangchiyu.com/Workflow-skill-router/。除非專案未來搬到專屬 custom domain,否則不要在這個 repo 加 CNAME。
在這種設定下,GitHub Pages API 仍可能顯示 cname=null 或 https_enforced=false。公開 gate 以訪客實際行為為準:
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。