create_product
Create a sibling .upg product in the current workspace. Mints a canonical product id, writes the file, stamps integrity, registers in `workspace.json`. Pairs with `init_workspace` and `switch_product`.
Workspace & Portfoliosnon-atomic. File write + workspace.json patch + optional
portfolio edge are separate mutations.
Arguments
namestringrequiredProduct display title (required, non-empty).
slugstringoptionalOptional slug for the .upg filename. Defaults to a slug derived from `name`. Collisions append `-2`, `-3`, …
descriptionstringoptionalOptional product description
stagestringoptionalProduct lifecycle stage. See UPGProductStage in @unified-product-graph/core.
portfolio_idstringoptionalOptional portfolio node id in the current store. When provided, a `portfolio_contains_product` edge is created in the current graph.
Returns
Shape
{ message,...result }result carries id, title, slug, file_path, and the optional portfolio edge.
Examples
Live call against the Notion example graph.
Input
{
"name": "example"
}Output
{
"message": "Created product: example",
"id": "p_P9zFGBICvycswgnv",
"file": "example.upg",
"slug": "example",
"title": "example",
"workspace_path": ".upg/",
"portfolio_attached": false
}