Skip to content

feat(cli): add print-template command and remove node dependency from skills#83

Merged
benwu95 merged 2 commits into
mainfrom
feat/cli-print-template
Jul 7, 2026
Merged

feat(cli): add print-template command and remove node dependency from skills#83
benwu95 merged 2 commits into
mainfrom
feat/cli-print-template

Conversation

@benwu95

@benwu95 benwu95 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

概述 (Overview)

本 PR 解決了在 0.5.0 版本打包成 standalone binary 後,AI 技能(如 prospec-upgrade)在非 Node.js 環境中無法執行升級(因為 require.resolvenode -e 報錯)的問題。
透過新增 prospec print-template <path> 指令,使得 CLI 本身可以直接輸出打包在二進位檔內的樣板原始內容,徹底移除對 Node.js 的依賴。

需求與驗收準則 (Requirements & Acceptance Criteria)

  • REQ-CLI-020: 新增 print-template 子命令
    • 指令 prospec print-template <path> 可在未初始化專案的環境下獨立執行並輸出內置 Handlebars 樣板。
  • REQ-SERVICES-015: 實現 Print-Template 業務邏輯
    • 實作對應服務從 lib/template.ts 中的 readTemplateSource 取得樣板內容。
  • REQ-TEMPLATES-005: 更新 prospec-upgrade.hbs 中的樣板讀取邏輯
    • 完全移除 node -erequire.resolve 呼叫,改為呼叫 prospec print-template 取得樣板內容。
  • REQ-LIB-008: 導出 readTemplateSource 函數
    • 修改 src/lib/template.ts 以公開導出 readTemplateSource

影響模組 (Affected Modules)

Module Impact Description
templates High 修改 prospec-upgrade.hbs 技能樣板,移除 node 執行指令
lib Medium 調整 template.ts 導出 readTemplateSource
services Low 新增 print-template.service.ts 業務邏輯
cli Medium 註冊 print-template 指令與對應的輸出格式化工具,並加入至 INIT_COMMANDS 免檢測列表
tests Medium 新增單元測試與 E2E 測試

驗證結果 (Verification & Quality)

  • Quality Grade: S (Excellent)
  • Tasks: 10/10 (100% completion)
  • Acceptance Criteria: 5/5 met
  • Tests: Vitest E2E/unit suite 100% PASS (2096/2096)
  • Prospec check: 11/11 checks PASS (0 fail, 0 warn)

benwu95 added 2 commits July 8, 2026 00:45
… skills

- Add prospec print-template <path> command to print raw template contents offline without Node.js

- Modify prospec-upgrade.hbs to retrieve templates via prospec print-template

- Update README files and templates README module documentation

- Sync test and file counts in documentation (total 2092 -> 2096)
- Sync print-template requirements to standalone-binary feature spec and feature-map

- Update modules README for cli, lib, and services to reflect print-template changes

- Add archived summary history for 2026-07-08-cli-print-template
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Prospec Check

Prospec drift check (structural — deterministic, zero LLM)

  PASS  req-references
  PASS  file-paths
  PASS  import-direction
  PASS  knowledge-health
  SKIP  task-completion — source unavailable: .prospec/changes/ not found (not version-controlled)
  PASS  dangling-prefix
  PASS  feature-modules
  PASS  mcp-readme-counts
  SKIP  review-provenance — source unavailable: .prospec/changes/ not found (not version-controlled)
  SKIP  metadata-completeness — source unavailable: .prospec/changes/ not found (not version-controlled)
  PASS  knowledge-size

Knowledge coverage: 6/6 modules documented

Checked 8/11 checks: 0 fail, 0 warn, 3 skipped (not counted as pass)
Semantic consistency: not-checked (run /prospec-review)
Report written: prospec-report.json

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Test Coverage

Metric Coverage Covered / Total
lines 96.75% 3161 / 3267
statements 96.14% 3466 / 3605
functions 96.15% 575 / 598
branches 93.59% 1928 / 2060

@benwu95 benwu95 merged commit 6ab1d43 into main Jul 7, 2026
4 checks passed
@benwu95 benwu95 deleted the feat/cli-print-template branch July 7, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant