Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/product-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
"@rolexjs/core": minor
"@rolexjs/prototype": minor
"rolexjs": minor
"@rolexjs/mcp-server": minor
---

feat: add product management system

Add product management as a new entity type in RoleX, enabling vision, strategy,
behavior contracts (BDD specs), releases, channels, and ownership tracking.

New commands:
- `!product.create` — create a product with vision
- `!product.strategy` — define product strategy
- `!product.spec` — add behavior contract (BDD specification)
- `!product.release` — publish a version release
- `!product.channel` — add distribution channel
- `!product.own` / `!product.disown` — manage product ownership
- `!product.deprecate` — deprecate a product
16 changes: 15 additions & 1 deletion apps/mcp-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@

import { localPlatform } from "@rolexjs/local-platform";
import { FastMCP } from "fastmcp";
import { createRoleX, detail, type ProjectAction, renderProjectResult, type State } from "rolexjs";
import {
createRoleX,
detail,
type ProductAction,
type ProjectAction,
renderProductResult,
renderProjectResult,
type State,
} from "rolexjs";

import { z } from "zod";
import { instructions } from "./instructions.js";
Expand Down Expand Up @@ -263,6 +271,12 @@ server.addTool({
const opResult = result as { state: State };
return renderProjectResult(action, opResult.state);
}
// Render product results as readable text
if (locator.startsWith("!product.")) {
const action = locator.slice("!product.".length) as ProductAction;
const opResult = result as { state: State };
return renderProductResult(action, opResult.state);
}
return JSON.stringify(result, null, 2);
},
});
Expand Down
27 changes: 25 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* Domain-specific structures and processes built on @rolexjs/system.
*
* Structures — the concept tree (23 concepts, 3 relations)
* Processes — how the world changes (32 processes, 5 layers)
* Structures — the concept tree (28 concepts, 4 relations)
* Processes — how the world changes (40 processes, 6 layers)
*
* Layer 1: Execution — want, plan, todo, finish, complete, abandon
* Layer 2: Cognition — reflect, realize, master
Expand Down Expand Up @@ -45,6 +45,8 @@ export type { ContextData, Platform, PrototypeRegistry, RoleXRepository } from "

export {
background,
// Product
channel,
// Organization
charter,
// Project
Expand All @@ -69,14 +71,22 @@ export {
position,
principle,
procedure,
// Product
product,
// Project
project,
// Product
release,
// Organization — Position
requirement,
// Project
scope,
// Level 0
society,
// Product
spec,
// Product
strategy,
task,
tone,
// Project
Expand Down Expand Up @@ -106,17 +116,30 @@ export {
wikiProject,
} from "./project.js";

// ===== Processes — Layer 3c: Product =====

export {
channelProduct,
disownProduct,
ownProduct,
releaseProduct,
specProduct,
strategyProduct,
} from "./product.js";

// ===== Processes — Layer 4: Lifecycle =====

export {
abolish,
archive,
born,
deprecate,
die,
dissolve,
establish,
found,
launch,
publish,
rehire,
retire,
} from "./lifecycle.js";
Expand Down
19 changes: 18 additions & 1 deletion packages/core/src/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
* No real deletion — everything transforms to the "past" branch.
*/
import { create, process, transform } from "@rolexjs/system";
import { individual, organization, past, position, project, society } from "./structures.js";
import {
individual,
organization,
past,
position,
product,
project,
society,
} from "./structures.js";

// Creation
export const born = process(
Expand All @@ -22,6 +30,7 @@ export const born = process(
export const found = process("found", "Found an organization", society, create(organization));
export const establish = process("establish", "Establish a position", society, create(position));
export const launch = process("launch", "Launch a project", society, create(project));
export const publish = process("publish", "Publish a product", society, create(product));

// Retirement & death
export const retire = process(
Expand All @@ -35,6 +44,14 @@ export const die = process("die", "An individual dies", individual, transform(in
// Archive project
export const archive = process("archive", "Archive a project", project, transform(project, past));

// Deprecate product
export const deprecate = process(
"deprecate",
"Deprecate a product",
product,
transform(product, past)
);

// Dissolution
export const dissolve = process(
"dissolve",
Expand Down
51 changes: 51 additions & 0 deletions packages/core/src/product.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* Product management — strategy, specs, releases, channels, ownership.
*
* own / disown — ownership (who is responsible)
* strategy — define product strategy
* spec — add behavior contract (BDD specification)
* release — add version release
* channel — add distribution channel
*/
import { create, link, process, unlink } from "@rolexjs/system";
import { channel, product, release, spec, strategy } from "./structures.js";

// Ownership
export const ownProduct = process(
"own",
"Assign an owner to the product",
product,
link(product, "ownership")
);
export const disownProduct = process(
"disown",
"Remove an owner from the product",
product,
unlink(product, "ownership")
);

// Structure
export const strategyProduct = process(
"strategy",
"Define the strategy for a product",
product,
create(strategy)
);
export const specProduct = process(
"spec",
"Add a behavior contract to a product",
product,
create(spec)
);
export const releaseProduct = process(
"release",
"Add a version release to a product",
product,
create(release)
);
export const channelProduct = process(
"channel",
"Add a distribution channel to a product",
product,
create(channel)
);
21 changes: 21 additions & 0 deletions packages/core/src/structures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
* │ │ ├── milestone "Key checkpoint" │
* │ │ ├── deliverable "Project output" │
* │ │ └── wiki "Project knowledge base" │
* │ ├── product "A product with contracts" │
* │ │ │ ∿ ownership → individual │
* │ │ ├── strategy "Product strategy" │
* │ │ ├── spec "Product behavior contract" │
* │ │ ├── release "Product version release" │
* │ │ └── channel "Product distribution channel" │
* │ └── past "Things no longer active" │
* └─────────────────────────────────────────────────────────┘
*/
Expand Down Expand Up @@ -120,3 +126,18 @@ export const milestone = structure(
);
export const deliverable = structure("deliverable", "Project output and delivery", project);
export const wiki = structure("wiki", "Project-level knowledge base entry", project);

// ================================================================
// Product — product management entity
// ================================================================

export const product = structure(
"product",
"A product with vision, contracts, and releases",
society,
[relation("ownership", "Who owns this product", individual)]
);
export const strategy = structure("strategy", "Product strategy — how to win", product);
export const spec = structure("spec", "Product behavior contract — BDD specification", product);
export const release = structure("release", "Product version release", product);
export const channel = structure("channel", "Product distribution channel", product);
Loading