Building Block View

Whitebox Overall System

Overview

ProductShape is a pnpm workspace whose published CLI bundles the core, distribution logic, and provider integrations. The repository also contains schemas, templates, canonical assistant skills, documentation, and the product model used to exercise the implementation against itself.

Decomposition Rationale

The core owns deterministic model behavior. The CLI owns command parsing, orchestration, output, and exit codes. Distribution and integration packages translate canonical operations into repository or provider-specific files. This keeps provider details outside the core and leaves the normative PDaC contract in its separate specification.

Contained Building Blocks

Building blockResponsibilityInterfacesSource location
CoreParse artifacts; validate schemas and relationships; compile graph; plan changes; emit and verify citationsTypeScript library APIsrc/packages/core/
CLICommands, arguments, output formats, exit codes, command orchestrationprodshape binarysrc/packages/cli/
DistributionInitialize repositories and render/update managed assistant assetsCLI-internal package APIsrc/packages/distribution/
Provider integrationsMap canonical skills/commands to Claude, Copilot, Codex, and OpenCode pathsRenderer interfacessrc/packages/integration-*
SDD integrationsConfigure OpenSpec and Spec Kit workflows around the product-definition interfaceIntegration package APIssrc/packages/integration-openspec/, src/packages/integration-speckit/
Schemas and templatesAuthoring contracts and conformant examplesFiles loaded by CLI or printed on demandschemas/, templates/
Static site builderBuild separate public and engineering output profiles from shared localized content and static assetsNode build scriptsrc/scripts/build-public-site.mjs, src/public-site/

Important Interfaces

Internal package edges are acyclic. Provider renderers are consumed through structurally typed interfaces; there is no shared provider-types package. The CLI is the supported public interface for repository operations, while each integration package also publishes its own package API.

Level 2

Whitebox: CLI operation

The CLI resolves the working repository, delegates model behavior to core, and delegates managed-file or provider configuration work to distribution and SDD integration packages. It formats results but does not make semantic product decisions.

Whitebox: Publication assembly

The public profile builds the localized product pages, adoption guides and standalone diagrams for productshape.dev. The engineering profile copies the CLI-generated Product Explorer and renders the twelve canonical arc42 Markdown sections for GitHub Pages. Neither output includes the other's primary content routes.