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.

已验证STDIO仅桌面知识与记忆开发者工具

概览

AI 生成的概览

面向 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 启动。
安装前请注意
该服务器会写入仓库:生成 .product/ 文件、把技能安装到 .claude/skills/ 或全局 ~/.claude/skills/,并可修改图谱条目。随附的 ddd 工具能应用代码编辑并记录接缝、模式与风险接受声明,其拦截模式还可能拒绝编辑。提交前请检查生成的文件与技能安装。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Product Cli,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

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/.

$ product init --demo                 # scaffold + seed the bookstore What model$ product domain new system sys-shop --system-kind application \      --purpose "consumer e-commerce" --target-classes gui$ product domain validate --strict    # per-node shapes + graph-level completeness$ product decider derive Order        # derive an aggregate's executable signature$ product decider validate Order-decider$ product mcp --http                  # MCP server + a live Event-Modeling web view at /

Install

bash
# from sourcecargo install --path product-cli

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:

  1. the --cli claude|copilot flag, else
  2. the repo's [author].cli in .product/config.toml, else
  3. the global user default in $XDG_CONFIG_HOME/product/config.toml (or ~/.config/product/config.toml), else
  4. claude.
toml
# .product/config.toml — make this repo default to Copilot CLI[author]cli = "copilot"

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

bash
product init --demo                   # a worked What model to exploreproduct domain list                   # the captured nodes, by kindproduct domain show Order             # one node and its linksproduct domain export                 # the graph as RDF/Turtleproduct domain validate               # §3.1/§3.2 per-node conformance shapesproduct domain validate --strict      # + §3.2.0/§3.2.5/§3.4/§4.5 completeness checksproduct decider derive Order          # §3.3 — derive decide/evolve signatureproduct decider simulate Order-decider  # run its flow-derived scenariosproduct guide                         # where you are + the next step

The model

  • What — product domain … captures the domain + event model; product decider … (§3.3) and product 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 preview cover 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).

bash
cargo run -p ddd-cli -- init        # scaffold .ddd/ddd validate                        # schema + ontology rules (CI gate)ddd diff --sarif build.sarif        # declared vs. detected rules (CI gate)ddd report escapes                  # diff + cadence + basis-loss report, each section stating its coverageddd why CA2007                      # rule -> decision -> principal -> claims (or: detected but unfiled)ddd render                          # static self-contained HTML projection of the graphddd serve                           # the ddd_* MCP surface (stdio)ddd warmup                          # pre-load the LSP hosts (Roslyn solution load)ddd what                            # What-graph boundaries carrying no declaration

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>.severity lines only; section globs are recorded, never evaluated — deliberately not an editorconfig engine), bicepconfig.json (analyzers.core.rules levels), and the root Cargo.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 — diff says 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 MSBuild ErrorLog property; version=2.1 is required (the default is SARIF 1.0), and %2C escapes the comma on the CLI (or set <ErrorLog> in the project).
    • Bicep: bicep lint main.bicep --diagnostics-format sarif > bicep.sarif (also available as az bicep lint).

    In-source suppressions differ per toolchain: the C# compiler still logs a #pragma-suppressed diagnostic into SARIF (marked suppressed), which is how UNCITED_SUPPRESSION sees it; Bicep's #disable-next-line removes the diagnostic from the output entirely, so Bicep source suppressions are invisible to detection — only level: off config suppressions are covered.

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

bash
cargo buildcargo t                                          # full suite (alias: test --no-fail-fast)cargo clippy -- -D warnings -D clippy::unwrap_used

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
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.2.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分