Triad, Requirement, Feature
Adding a new pattern to the corpus means producing three packages, a Requirement entry, and a Feature class. @frenchexdev/ddd-cli-plugin-scaffold reifies that workflow as three tasks under the new:* namespace: new:triad for the package scaffolding, new:requirement and new:feature for the spec entries. Currently shipped as M2 placeholders; M3+ wires the actual generation against npm-package-scaffold.
The Three Tasks
plugin.ts declares three tasks.
new:triad — scaffold a complete pattern triad. Given a pattern id, the task produces three packages: ddd-<pattern> (runtime), ddd-<pattern>-analyzer (lint), ddd-<pattern>-codegen (source generator). Each package starts from a template with the right package.json, the right tsconfig.json, the right _local-features.ts and spec.ts shells. The developer fills in the decorator surface and the templates; the structural plumbing is generated.
new:requirement — add a canonical Requirement entry to ddd-spec. Requirements are the named compliance anchors (e.g. BoundedContextCohesionRequirement, SagaLongRunningOrchestrationRequirement) every pattern's spec references. The task ensures the Requirement is registered in the canonical registry before any pattern claims to satisfy it.
new:feature — add a Feature class to ddd-spec-features. Features are the acceptance-criteria-bearing test surface the analyzer and codegen specs ultimately produce. The task scaffolds the Feature class with the AC declarations, ready to receive the per-AC test methods.
Status: M2 Placeholder
The plugin currently ships task shells. Each task's invoke() returns an "ok" status with a descriptive message but does not yet perform the scaffolding. The pattern is deliberate — the contract surface (verb names, argument shapes, descriptions) lives now, the implementation lands when ts-codegen-pipeline integration matures enough to drive the full scaffolding deterministically.
The contract surface is what every other plugin depends on. A future automation that produces a new pattern triad from a single declaration will call ddd new:triad, ddd new:requirement, ddd new:feature in sequence, and the workflow is testable against the contract today even though the bodies arrive later.
Cross-Links
- Produces input for CLI Plugin Codegen — the new triplet's codegen package is what
codegen:buildwill run. - Produces input for CLI Plugin Compliance — the new Requirement and Feature become entries in the compliance matrix.
- Produces input for CLI Plugin Spec — the Requirement and Feature registered through
new:requirementandnew:featureare whatspec:verifychecks. - Built on CLI Framework and CLI Kernel — same dispatching, same task shape as every other plugin.
Back to the series index.