
Product Cli
io.github.Hafeok由 GitHub 帳號 Hafeok 發布v0.2.0更新於 Oct 27, 2026
Knowledge graph CLI for managing features, ADRs, and test criteria as MCP-discoverable artifacts.
概覽
針對 Product Framework 的 Rust 命令列工具兼 MCP 伺服器,讓代理撰寫並驗證以 YAML/Turtle 儲存的軟體產品 What/How 知識圖譜。
- 可以做什麼
- 撰寫並驗證領域與事件模型:系統、實體、指令、事件、讀取模型、Decider 與 Projector
- 推導並模擬 Decider 簽章與 Projector 讀取模型,命名不可再分的基本演算法
- 記錄 How 層:契約、交付特性、建置接縫,以及設計系統與內容庫預覽
- 依 SHACL 形狀與 SPARQL 規則驗證圖譜,支援嚴格完整性模式,並可匯出為 RDF/Turtle
- 以 Systems、Domain、Flows 三種檢視提供圖譜的即時網頁檢視
- 安裝內建的 Claude Code 技能,並在 Claude Code 或 GitHub Copilot CLI 中主持撰寫工作階段
- 適用情境
- 適合想把產品規格寫成機器可讀、可驗證圖譜的團隊,讓 AI 代理直接撰寫、檢查並解釋該圖譜,而不是維護過時的设计文件。適用於已採用 Product Framework 且能接受命令列工作流程的專案。
- 執行需求
- 以本機二進位檔在使用者電腦上執行(僅桌面端,stdio 傳輸);README 說明可用 cargo 從原始碼安裝,另提供 Linux x86_64 預先編譯壓縮檔。圖譜存放在儲存庫的 .product/ 目錄中。代理工作階段需要已安裝 Claude Code 或 GitHub Copilot CLI;MCP 伺服器也可透過 HTTP 啟動。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Product Cli,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Product
A CLI and MCP server for the Product Framework — specify software as a verifiable What/How graph.
The Product Framework is an open standard for describing a software product as one connected, machine-readable graph: the What (domain model + event model — entities, commands, events, read models, UI steps typed against Abstract Interaction Objects, systems, triggers, Deciders, Projectors), the How (contracts, the screen-composition / reification model, delivery features), and the typed links between them. The graph can drive generation, gate verification, and explain itself — so "describe this system" is a query, not a stale document.
This repo is the reference tooling: a single Rust binary (product) plus an MCP
server that lets an agent author and verify the graph directly. No database, no
service — the graph lives as YAML/Turtle under .product/.
Install
The binary ships with the What→How→Build Claude Code skills baked in.
product init writes them into .claude/skills/ of the new repo (pass
--no-skills to opt out); product skills install (re)installs them, and
product skills install --global puts them in ~/.claude/skills/ for every
project. Start a fresh Claude Code session to pick them up, then /product-session.
Choosing the agent CLI
product session start (and product author domain) host the What→How→Build
session in an agent CLI — Claude Code or GitHub Copilot CLI. The CLI is
resolved in this order:
- the
--cli claude|copilotflag, else - the repo's
[author].cliin.product/config.toml, else - the global user default in
$XDG_CONFIG_HOME/product/config.toml(or~/.config/product/config.toml), else claude.
Scaffold it on a new repo with product init --cli copilot, or set a personal
default for every repo by putting the same [author] block in
~/.config/product/config.toml. With a default configured, product session start needs no --cli flag.
60-second tour
The model
- What —
product domain …captures the domain + event model;product decider …(§3.3) andproduct projector …(§3.4) make behaviour and read models executable;product primitive …(§3.5) names irreducible algorithms. - How —
product how,product feature,product build,product seam,product previewcover the How contract, delivery features, the screen seam, and the §11/§12 design-system / content-store preview profiles. - Everything is validated against the framework's SHACL shapes + SPARQL rules;
the captured What serializes to Turtle (
product domain export).
MCP + the web view
product mcp --http starts the MCP server (framework tools: product_domain_*,
product_decider_*, product_projector_*, …) and serves a live web view at /
that renders the active What graph across three connected views — Systems
(the product → systems & journeys map, §3.0), Domain (one bounded context as
an ER graph, §3.1), and Flows (a system's event-model as Event-Modeling
swimlanes — triggers / commands / views over per-aggregate event streams, §3.2).
A node detail panel, the What→How→Build phase stepper, dark/light theme and live
SSE refresh round it out.
ddd — Decision-Driven Design governance
The workspace also ships ddd (crates ddd-core, ddd-lsp, ddd-mcp,
ddd-cli), a separate tool over a separate store: a repo-local .ddd/ graph
of predicates, closure claims, decisions, analyzer/linter manifests, pattern
instances, seam declarations, and interception event rows
(spec, umbrella PRD, formats: migrations).
Governing the What (the framework graph)
ddd what treats the .product/ What graph as a third governed surface
alongside C# and Bicep. It needs no language server: product-core already
owns the What as typed data, so the adapter reads kinds and containers
straight off DomainGraph and runs them through the same policy-table
mechanism (ddd-core/src/surface.rs, shared with the LSP adapters).
Two kinds of row. Boundary kinds are surface whatever they connect to: a system (§3.2.5), a context mapping (§3.1), a journey crossing (§3.0.1), a quality demand (§3.6). Published kinds are surface only when a §3.2.0 Translation carries them — the View a Translation watches, the Command it issues, and the Events that View projects. Everything else is internal to its own system and never demands a declaration.
That published/internal split is the What's analogue of C# visibility, and it
is load-bearing: the first table called every event and command a boundary,
which the measurement in DDD-what-02 killed (0 of 39 crossed anything). See
dec/ddd/what-published-qualifier.
A boundary counts as governed when a seam declaration's contract_location
is what:<element-id>. --strict turns it into a CI gate; the default
reports without failing, so the table can be calibrated against a real graph
first.
MCP surface (M3/M4)
ddd serve exposes the ddd_* tool namespace over stdio: LSP-backed
language intelligence for C# (roslyn-language-server --stdio --autoLoadProjects, the official prerelease .NET global tool) and Bicep
(bicep-ls from Azure.Bicep.LangServer) — find_symbol, references,
hover, diagnostics (joined to the manifests by rule id, the same join the
SARIF path uses), signature, rename (computes; application funnels
through the interceptor) — plus the governance tools why, graph_query,
declare_seam, declare_pattern, accept_risk.
The three declare/accept tools take amend: true to revise an entry
already filed. The flag is explicit in both directions — a create never
silently overwrites, an amend never silently creates — and the split is by
field: judgement amends (verdict_knowledge, obligation answers, rationale),
while identity and LSP-derived evidence (contract_location, metadata) are
carried forward untouched, so the interception rows stay machine-authored.
ddd_apply_edit runs every edit through the per-language contract-surface
classifier (policy tables, PRD §9): non-surface edits apply; a surface edit
applies only with a matching same-session declaration; otherwise it is
rejected with a structured demand whose facts (symbol, kind, signature,
visibility, reference count) are pre-filled and whose judgment fields are
blank (dec/ddd/rejection-facts-prefilled). Modes: intercept: enforce | warn | off, per artifact class via intercept_by_class (config format 3);
adapter.csharp.internal_is_surface flips the library-repo posture
(dec/ddd/internal-not-surface). Every classified surface outcome lands as a
row under .ddd/seams/events/ — the correspondence dataset. Hosts are
spawned lazily, health-checked, and respawned on crash; while Roslyn loads
the solution, tools return an explicit {"status": "loading"} rather than
hanging. CI runs against a fixture-grade mock host
(dec/ddd/fixtures-not-sdk); set DDD_LSP_E2E=1 with both tools on PATH to
run the gated real-host suites.
ddd diff compares the manifests under .ddd/manifest/ against two detected
sources per language and reports UNGOVERNED (detected, no manifest entry),
STALE (manifest entry, absent from config and emissions), and
UNCITED_SUPPRESSION (a config or in-source suppression with no
risk-acceptance record):
-
configured — parsed from
.editorconfig(dotnet_diagnostic.<ID>.severitylines only; section globs are recorded, never evaluated — deliberately not an editorconfig engine),bicepconfig.json(analyzers.core.ruleslevels), and the rootCargo.toml([workspace.lints.clippy], for this repo's own gates). Rules enabled by analyzer-package defaults have no config line and surface via the emitted source only —diffsays so when one source covers a rule. -
emitted — SARIF 2.1 files from real builds, ingested by one shared module. Produce them with (verified against current tool docs at M2):
- C#:
dotnet build -p:ErrorLog=diag.sarif%2Cversion=2.1— the MSBuildErrorLogproperty;version=2.1is required (the default is SARIF 1.0), and%2Cescapes the comma on the CLI (or set<ErrorLog>in the project). - Bicep:
bicep lint main.bicep --diagnostics-format sarif > bicep.sarif(also available asaz bicep lint).
In-source suppressions differ per toolchain: the C# compiler still logs a
#pragma-suppressed diagnostic into SARIF (marked suppressed), which is howUNCITED_SUPPRESSIONsees it; Bicep's#disable-next-lineremoves the diagnostic from the output entirely, so Bicep source suppressions are invisible to detection — onlylevel: offconfig suppressions are covered. - C#:
Point ddd diff at the files with --sarif or the detect.sarif list in
.ddd/config.yaml. This repo governs itself: .ddd/manifest/clippy.yaml maps
clippy::unwrap_used to its decision, and ddd diff verifies it against the
workspace lints table.
Build & test
See CLAUDE.md for the architecture and contributor workflow, and docs/product-framework-open.md for the spec.
License
See LICENSE.
來源:README.md,提交 a712ccc
工具
0版本歷史
1- v0.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分