@wefter/opencode 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +23 -9
  3. package/docs/ARCHITECTURE.md +8 -12
  4. package/docs/INSTALLATION.md +2 -1
  5. package/docs/SAFETY_MODEL.md +1 -1
  6. package/docs/SELF_AUDIT.md +37 -0
  7. package/docs/WORKFLOWS.md +7 -3
  8. package/package.json +2 -2
  9. package/schemas/documentation-audit-profile.schema.json +9 -1
  10. package/schemas/product-shaping-config.schema.json +63 -0
  11. package/schemas/product-shaping-contract.schema.json +204 -0
  12. package/schemas/product-shaping-profile.schema.json +39 -0
  13. package/schemas/product-shaping-run-manifest.schema.json +103 -0
  14. package/schemas/wefter.config.schema.json +46 -15
  15. package/schemas/work-unit-config.schema.json +12 -5
  16. package/schemas/workflow-manifest.schema.json +10 -0
  17. package/src/cli/main.js +857 -19
  18. package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-orchestrator.md.tmpl +14 -10
  19. package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-auditor.md.tmpl +3 -0
  20. package/src/workflows/documentation-audit/templates/opencode/skills/documentation-audit/SKILL.md.tmpl +1 -0
  21. package/src/workflows/documentation-audit/templates/prompts/auditor-prompt.md +1 -0
  22. package/src/workflows/product-shaping/README.md +1241 -3
  23. package/src/workflows/product-shaping/compatibility.md +33 -0
  24. package/src/workflows/product-shaping/contracts/product-spec-contract.json +250 -0
  25. package/src/workflows/product-shaping/templates/default-config.json +34 -0
  26. package/src/workflows/product-shaping/templates/default-profile.json +48 -0
  27. package/src/workflows/product-shaping/templates/documentation-audit/workflow-self-audit-auditor-prompt.md +117 -0
  28. package/src/workflows/product-shaping/templates/documentation-audit-profile.json +80 -0
  29. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-auditor.md.tmpl +22 -0
  30. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-domain-modeler.md.tmpl +31 -0
  31. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-intake-analyst.md.tmpl +31 -0
  32. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-orchestrator.md.tmpl +48 -0
  33. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-reference-researcher.md.tmpl +29 -0
  34. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-release-planner.md.tmpl +34 -0
  35. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-repairer.md.tmpl +25 -0
  36. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-shaper.md.tmpl +31 -0
  37. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-validator.md.tmpl +23 -0
  38. package/src/workflows/product-shaping/templates/opencode/skills/product-shaping/SKILL.md.tmpl +45 -0
  39. package/src/workflows/product-shaping/templates/prompts/domain-modeler-prompt.md +27 -0
  40. package/src/workflows/product-shaping/templates/prompts/intake-prompt.md +30 -0
  41. package/src/workflows/product-shaping/templates/prompts/product-auditor-prompt.md +53 -0
  42. package/src/workflows/product-shaping/templates/prompts/product-repairer-prompt.md +25 -0
  43. package/src/workflows/product-shaping/templates/prompts/product-shaper-prompt.md +26 -0
  44. package/src/workflows/product-shaping/templates/prompts/product-validator-prompt.md +55 -0
  45. package/src/workflows/product-shaping/templates/prompts/reference-research-prompt.md +25 -0
  46. package/src/workflows/product-shaping/templates/prompts/release-planner-prompt.md +34 -0
  47. package/src/workflows/product-shaping/workflow.json +26 -3
  48. package/src/workflows/technical-shaping/README.md +2 -0
  49. package/src/workflows/technical-shaping/workflow.json +4 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.2.1 - 2026-06-04
6
+
7
+ Stabilizes the `0.2.x` workflow contracts after the product-shaping release.
8
+
9
+ - Clarified that planned workflows do not install executable CLI or OpenCode commands until implemented.
10
+ - Moved future `technical-shaping` command names to planning metadata instead of executable command metadata.
11
+ - Hardened work-unit config and workflow manifest schemas to better match runtime validation.
12
+ - Added per-command CLI flag validation so unsupported options fail fast instead of being silently ignored.
13
+ - Added CI coverage across Node 18, 20, 22 and 24, and hardened manual npm publish inputs to require an existing tag.
14
+ - Updated local development, installation and self-audit documentation to distinguish package defaults from Wefter dogfooding config.
15
+
16
+ ## 0.2.0 - 2026-06-02
17
+
18
+ Promotes `product-shaping` to an available workflow.
19
+
20
+ - Added available-by-default product-shaping workflow installation, CLI run generation, OpenCode command, agents, skill, prompts, contracts and schemas.
21
+ - Added product-shaping completion gate validation for required specs, ready deliverables, adversarial review evidence and final validation evidence.
22
+ - Added `DELIVERABLES.md` handoff validation before legacy work-unit implementation can consume product-shaping output.
23
+ - Added product-shaping doctrine autoaudit profile and repaired audit findings across schemas, prompts, agents, CLI behavior and docs.
24
+ - Hardened product-shaping schemas and runtime checks for canonical file order, vocabulary, relative paths, manifest outputs, handoff and gate evidence.
25
+ - Expanded CLI tests for product-shaping availability, path safety, handoff validation and OpenCode installation.
26
+
5
27
  ## 0.1.0 - 2026-06-02
6
28
 
7
29
  Initial public release of Wefter for OpenCode.
package/README.md CHANGED
@@ -4,24 +4,24 @@ Wefter installs reusable OpenCode workflows that weave product intent into audit
4
4
 
5
5
  ## Status
6
6
 
7
- Early product extraction. The package is usable locally for `documentation-audit`, `documentation-repair`, and `work-unit-implementation`; the other workflows are architecture scaffolds.
7
+ Wefter is usable locally for `product-shaping`, `documentation-audit`, `documentation-repair`, and `work-unit-implementation`. Product shaping is available by default and includes CLI run generation, OpenCode integration, validation gates and audited `DELIVERABLES.md` handoff.
8
8
 
9
9
  ## Package
10
10
 
11
11
  ```text
12
12
  package: @wefter/opencode
13
- repo: opencode-wefter
13
+ repo: wefter
14
14
  cli: wefter
15
15
  config: wefter.config.json
16
16
  local workflow files: .wefter/
17
- runtime artifacts: .audit/wefter/
17
+ runtime artifacts: .audit/wefter/ for legacy workflows; .wefter/runs/ for product-shaping
18
18
  ```
19
19
 
20
20
  ## Workflows
21
21
 
22
22
  | Workflow ID | Status | Purpose |
23
23
  | --- | --- | --- |
24
- | `product-shaping` | Planned | Shape an initial idea into product docs, scope and explicit decisions. |
24
+ | `product-shaping` | Available | Shape an initial idea into product specs, release scope, acceptance criteria and deliverables. |
25
25
  | `documentation-audit` | Available | Run redundant, adversarial documentation consistency audits. |
26
26
  | `documentation-repair` | Available | Repair docs from a validated audit report without mixing detection and correction. |
27
27
  | `technical-shaping` | Planned | Convert product docs into explicit technical decisions and implementation constraints. |
@@ -31,13 +31,14 @@ runtime artifacts: .audit/wefter/
31
31
 
32
32
  ```bash
33
33
  npm run check
34
+ npm test
34
35
  node bin/wefter.js --help
35
36
  ```
36
37
 
37
38
  Install into another project from this checkout:
38
39
 
39
40
  ```bash
40
- node <path-to-opencode-wefter>/bin/wefter.js init --target <path-to-project> --yes
41
+ node <path-to-wefter>/bin/wefter.js init --target <path-to-project> --yes
41
42
  ```
42
43
 
43
44
  ## Intended User Flow
@@ -46,10 +47,11 @@ node <path-to-opencode-wefter>/bin/wefter.js init --target <path-to-project> --y
46
47
  npx @wefter/opencode init
47
48
  ```
48
49
 
49
- Restart OpenCode, then use:
50
+ Restart OpenCode, then use the available default commands:
50
51
 
51
52
  ```text
52
53
  /wefter-generate-doc-audit-profile
54
+ /wefter-shape-product
53
55
  /wefter-audit-docs
54
56
  /wefter-repair-docs
55
57
  /wefter-run-work-unit
@@ -59,6 +61,8 @@ CLI checks are also available:
59
61
 
60
62
  ```bash
61
63
  wefter doctor
64
+ wefter product shape --dry-run
65
+ wefter product validate --json
62
66
  wefter docs audit --passes-per-lens 1 --max-audits 12
63
67
  wefter docs audit --profile-path docs/audits/lenses.json --passes-per-lens 1 --max-audits 12
64
68
  wefter profile import --source docs/audits/lenses.json --force
@@ -78,7 +82,14 @@ wefter new-run documentation-audit --passes-per-lens 1 --max-audits 12
78
82
  "processDocPath": ".wefter/workflows/documentation-audit/README.md",
79
83
  "runnerCommand": "node <path-to-wefter>/bin/wefter.js",
80
84
  "workflows": {
81
- "product-shaping": { "status": "planned", "enabled": false },
85
+ "product-shaping": {
86
+ "status": "available",
87
+ "enabled": true,
88
+ "specRoot": ".wefter/specs",
89
+ "runRoot": ".wefter/runs/product-shaping",
90
+ "configPath": ".wefter/workflows/product-shaping/config.json",
91
+ "profilePath": ".wefter/workflows/product-shaping/profile.json"
92
+ },
82
93
  "documentation-audit": { "status": "available", "enabled": true },
83
94
  "documentation-repair": { "status": "available", "enabled": true },
84
95
  "technical-shaping": { "status": "planned", "enabled": false },
@@ -101,12 +112,15 @@ wefter new-run documentation-audit --passes-per-lens 1 --max-audits 12
101
112
  - `docs repair` writes through a staging directory and requires an existing repository-relative audit report path.
102
113
  - Paths in `wefter.config.json` must be relative to the target repository and must not contain `..`.
103
114
  - Run names are plain directory names and cannot contain path separators.
115
+ - `product-shaping` writes versioned product specs under `.wefter/specs/` and runtime runs under `.wefter/runs/product-shaping/` by default.
116
+ - `product validate` fails the publication/handoff gate when required product specs, blocking questions or deliverable statuses are invalid.
104
117
  - Audit execution must not edit source documentation; correction is a separate workflow.
105
118
  - Repair execution must pause when validated findings require unresolved human decisions.
106
119
 
107
120
  ## Product Direction
108
121
 
109
- Next steps before a stable release:
122
+ Next hardening steps after the `0.2.1` stabilization release:
110
123
 
111
124
  1. Add installation manifest/uninstall support.
112
- 2. Harden release and package publishing automation.
125
+ 2. Continue migration from legacy `work-unit-implementation` naming toward `delivery-implementation`.
126
+ 3. Implement `technical-shaping` only after its contract, CLI behavior and OpenCode command are ready.
@@ -19,7 +19,7 @@ These files must not encode any single product domain.
19
19
  `wefter.config.json` stores installation choices for one repository:
20
20
 
21
21
  - `workflowRoot`: versioned Wefter workflow files installed in the target repository.
22
- - `artifactRoot`: generated runtime output root for the currently available documentation audit workflow.
22
+ - `artifactRoot`: generated runtime output root for legacy audit workflows. Product-shaping uses its workflow-specific run root under `.wefter/runs/product-shaping` by default.
23
23
  - `profilePath`: project-specific documentation audit profile.
24
24
  - `templateRoot`: installed documentation audit prompt templates.
25
25
  - `processDocPath`: installed workflow documentation.
@@ -38,7 +38,7 @@ Workflow modules live under `src/workflows/<workflow-id>/` and expose `workflow.
38
38
  - `technical-shaping`
39
39
  - `work-unit-implementation`
40
40
 
41
- `documentation-audit` is executable end-to-end through the CLI. `documentation-repair` generates gated repair runs from validated audit reports. `work-unit-implementation` can generate planning runs, install OpenCode agents, enforce deterministic task/review guards and validate completed work units.
41
+ `product-shaping` is available for product spec generation and gated `DELIVERABLES.md` handoff. `documentation-audit` is executable end-to-end through the CLI. `documentation-repair` generates gated repair runs from validated audit reports. `work-unit-implementation` can generate planning runs, install OpenCode agents, enforce deterministic task/review guards and validate completed work units.
42
42
 
43
43
  ## Documentation Audit Run
44
44
 
@@ -63,17 +63,13 @@ Repair runs contain prompts for planning, applying approved repairs and reviewin
63
63
 
64
64
  The installer writes:
65
65
 
66
- - `.opencode/agent/wefter-doc-audit-orchestrator.md`
67
- - `.opencode/agent/wefter-doc-auditor.md`
68
- - `.opencode/agent/wefter-doc-audit-consolidator.md`
69
- - `.opencode/agent/wefter-doc-audit-validator.md`
70
- - `.opencode/agent/wefter-doc-audit-profile-builder.md`
71
- - `.opencode/agent/wefter-doc-repair-orchestrator.md`
72
- - `.opencode/agent/wefter-doc-repair-planner.md`
73
- - `.opencode/agent/wefter-doc-repairer.md`
74
- - `.opencode/agent/wefter-doc-repair-reviewer.md`
66
+ - `.opencode/agent/wefter-doc-*.md`
67
+ - `.opencode/agent/wefter-product-*.md`
68
+ - `.opencode/agent/wefter-work-unit-*.md`
75
69
  - `.opencode/skills/documentation-audit/SKILL.md`
76
70
  - `.opencode/skills/documentation-repair/SKILL.md`
77
- - `opencode.json` commands `/wefter-audit-docs`, `/wefter-generate-doc-audit-profile`, `/wefter-repair-docs` and `/wefter-run-work-unit`
71
+ - `.opencode/skills/product-shaping/SKILL.md`
72
+ - `.opencode/skills/work-unit-implementation/SKILL.md`
73
+ - `opencode.json` commands `/wefter-generate-doc-audit-profile`, `/wefter-shape-product`, `/wefter-audit-docs`, `/wefter-repair-docs` and `/wefter-run-work-unit`
78
74
 
79
75
  OpenCode must be restarted after installation because configuration is loaded once at startup.
@@ -9,13 +9,14 @@ npx @wefter/opencode init
9
9
  From a local checkout:
10
10
 
11
11
  ```bash
12
- node <path-to-opencode-wefter>/bin/wefter.js init --target <path-to-project> --yes
12
+ node <path-to-wefter>/bin/wefter.js init --target <path-to-project> --yes
13
13
  ```
14
14
 
15
15
  Then restart OpenCode and run:
16
16
 
17
17
  ```text
18
18
  /wefter-generate-doc-audit-profile
19
+ /wefter-shape-product
19
20
  /wefter-audit-docs
20
21
  /wefter-repair-docs
21
22
  /wefter-run-work-unit
@@ -7,7 +7,7 @@ Core rules:
7
7
  - Detection and correction are separate workflows.
8
8
  - Documentation audit agents must not edit source documentation.
9
9
  - Documentation repair must plan before editing and pause on unresolved human decisions.
10
- - Runtime artifacts are written under `.audit/wefter/` by default.
10
+ - Runtime artifacts are written under workflow-specific configured roots: legacy audit, repair and work-unit workflows default to `.audit/wefter/`, while product-shaping defaults to `.wefter/runs/`.
11
11
  - Versioned workflow configuration is written under `.wefter/` by default.
12
12
  - Paths are target-repository relative and must not contain `..`.
13
13
  - Run directories are staged before becoming visible as final runs.
@@ -0,0 +1,37 @@
1
+ # Self Audit
2
+
3
+ Wefter can run `documentation-audit` against its own workflow source before publishing a workflow as available.
4
+
5
+ The CLI command generates the audit run and auditor prompts. It does not execute the prompts by itself; a documentation-audit orchestrator or agent must resume the generated run and complete the raw audit, consolidation and validation steps.
6
+
7
+ Use this pattern for any workflow-specific audit profile:
8
+
9
+ ```bash
10
+ node bin/wefter.js docs audit --profile-path <workflow-audit-profile.json> --run-name <workflow-id>-self-audit --passes-per-lens 1 --max-audits 0
11
+ ```
12
+
13
+ `--max-audits 0` means no audit prompt cap.
14
+
15
+ Product-shaping example:
16
+
17
+ ```bash
18
+ node bin/wefter.js docs audit --profile-path src/workflows/product-shaping/templates/documentation-audit-profile.json --run-name product-shaping-self-audit --passes-per-lens 1 --max-audits 0
19
+ ```
20
+
21
+ The Wefter repository dogfoods documentation-audit with `artifactRoot` set to `.wefter/runs/documentation-audit` in its local `wefter.config.json`. Installed projects use the public default `.audit/wefter/documentation-audit` unless their config overrides it.
22
+
23
+ Seed prompt:
24
+
25
+ ```text
26
+ Audit the current workflow release against CHANGELOG.md and the workflow README.
27
+ Focus on doctrine drift, missing runtime enforcement, handoff or gate bypasses, OpenCode execution gaps, schema/contract mismatch, weak tests and release artifacts that should not be committed.
28
+ Treat prior review findings as hypotheses, not conclusions.
29
+ ```
30
+
31
+ After the run is generated, resume it with:
32
+
33
+ ```text
34
+ Resume the documentation audit run at .wefter/runs/documentation-audit/<run-id>.
35
+ Read manifest.json, execute every auditor prompt listed there, write each raw output to its assigned path, then run prompts/consolidate.md and prompts/validate.md.
36
+ Do not edit source files. Write only under the run directory.
37
+ ```
package/docs/WORKFLOWS.md CHANGED
@@ -4,10 +4,14 @@ Wefter workflow IDs are stable nouns. CLI and OpenCode commands use verbs.
4
4
 
5
5
  | Workflow ID | CLI | OpenCode | Status |
6
6
  | --- | --- | --- | --- |
7
- | `product-shaping` | `wefter product shape` | `/wefter-shape-product` | Planned |
7
+ | `product-shaping` | `wefter product shape`, `wefter product validate` | `/wefter-shape-product` | Available |
8
8
  | `documentation-audit` | `wefter docs audit` | `/wefter-audit-docs` | Available |
9
9
  | `documentation-repair` | `wefter docs repair` | `/wefter-repair-docs` | Available |
10
- | `technical-shaping` | `wefter technical shape` | `/wefter-shape-technical` | Planned |
10
+ | `technical-shaping` | Not installed while planned | Not installed while planned | Planned |
11
11
  | `work-unit-implementation` | `wefter work-unit run`, `wefter work-unit guard` | `/wefter-run-work-unit` | Available |
12
12
 
13
- The first implementation release keeps `documentation-audit` executable and registers the full architecture. `documentation-repair` can generate repair runs from final audit reports with planning, human-decision gates, repair application and review prompts. `work-unit-implementation` can generate planning runs, orchestrate plan review, enforce deterministic task/review guards and validate a completed work unit.
13
+ The `0.2.0` release promotes `product-shaping` to available. `documentation-audit` remains executable end-to-end. `documentation-repair` can generate repair runs from final audit reports with planning, human-decision gates, repair application and review prompts. `work-unit-implementation` can generate planning runs, orchestrate plan review, enforce deterministic task/review guards and validate a completed work unit.
14
+
15
+ Planned workflows may document future command names in their workflow manifest, but only commands under `commands` are executable/installed. `technical-shaping` is intentionally not installed until its contract and CLI are implemented.
16
+
17
+ For workflow dogfooding and release self-audit, see `docs/SELF_AUDIT.md`.
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@wefter/opencode",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Installable Wefter workflows for OpenCode projects.",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+ssh://git@github.com/Wuerike/wefter.git"
8
+ "url": "git+https://github.com/Wuerike/wefter.git"
9
9
  },
10
10
  "bugs": {
11
11
  "url": "https://github.com/Wuerike/wefter/issues"
@@ -5,6 +5,7 @@
5
5
  "required": ["version", "corpus", "variants", "lenses"],
6
6
  "properties": {
7
7
  "version": { "const": 1 },
8
+ "auditorPromptPath": { "$ref": "#/$defs/relativePath" },
8
9
  "corpus": {
9
10
  "type": "object",
10
11
  "required": ["include", "exclude"],
@@ -43,5 +44,12 @@
43
44
  }
44
45
  }
45
46
  },
46
- "additionalProperties": false
47
+ "additionalProperties": false,
48
+ "$defs": {
49
+ "relativePath": {
50
+ "type": "string",
51
+ "minLength": 1,
52
+ "pattern": "^(?![A-Za-z]:)(?![\\\\/])(?!.*(?:^|/)\\.\\.(?:/|$))[^\\\\\r\n]+$"
53
+ }
54
+ }
47
55
  }
@@ -0,0 +1,63 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://wefter.dev/schemas/product-shaping-config.schema.json",
4
+ "type": "object",
5
+ "required": ["version", "workflowName", "releaseId", "specRoot", "runRoot", "contractPath", "processDocPath", "requiredFiles", "completionGate"],
6
+ "properties": {
7
+ "version": { "const": 1 },
8
+ "workflowName": { "const": "product-shaping" },
9
+ "releaseId": { "type": "string", "minLength": 1 },
10
+ "specRoot": { "$ref": "#/$defs/relativePath", "default": ".wefter/specs" },
11
+ "runRoot": { "$ref": "#/$defs/relativePath", "default": ".wefter/runs/product-shaping" },
12
+ "contractPath": { "$ref": "#/$defs/relativePath" },
13
+ "processDocPath": { "$ref": "#/$defs/relativePath" },
14
+ "requiredFiles": {
15
+ "type": "array",
16
+ "minItems": 17,
17
+ "maxItems": 17,
18
+ "prefixItems": [
19
+ { "const": "README.md" },
20
+ { "const": "discovery/SOURCE_MATERIALS.md" },
21
+ { "const": "discovery/IDEA_BRIEF.md" },
22
+ { "const": "discovery/OPEN_QUESTIONS.md" },
23
+ { "const": "references/README.md" },
24
+ { "const": "PRODUCT_VISION.md" },
25
+ { "const": "product/FEATURE_CATALOG.md" },
26
+ { "const": "product/MODULE_ROADMAP.md" },
27
+ { "const": "product/DOMAIN_MODEL.md" },
28
+ { "const": "product/OPERATIONAL_FLOW.md" },
29
+ { "const": "product/PRODUCT_DECISIONS.md" },
30
+ { "const": "releases/README.md" },
31
+ { "const": "releases/<release-id>/README.md" },
32
+ { "const": "releases/<release-id>/SCOPE.md" },
33
+ { "const": "releases/<release-id>/DOMAIN_SPEC.md" },
34
+ { "const": "releases/<release-id>/ACCEPTANCE_CRITERIA.md" },
35
+ { "const": "releases/<release-id>/DELIVERABLES.md" }
36
+ ],
37
+ "items": false
38
+ },
39
+ "completionGate": {
40
+ "type": "object",
41
+ "required": ["requireNoReleaseBlockingQuestions", "requireAdversarialReview", "requireFinalValidation", "readyDeliverableStatuses"],
42
+ "properties": {
43
+ "requireNoReleaseBlockingQuestions": { "type": "boolean" },
44
+ "requireAdversarialReview": { "const": true },
45
+ "requireFinalValidation": { "const": true },
46
+ "readyDeliverableStatuses": {
47
+ "type": "array",
48
+ "minItems": 1,
49
+ "items": { "enum": ["ready"] }
50
+ }
51
+ },
52
+ "additionalProperties": false
53
+ }
54
+ },
55
+ "additionalProperties": false,
56
+ "$defs": {
57
+ "relativePath": {
58
+ "type": "string",
59
+ "minLength": 1,
60
+ "pattern": "^(?![A-Za-z]:)(?![\\\\/])(?!.*(?:^|/)\\.\\.(?:/|$))[^\\\\\r\n]+$"
61
+ }
62
+ }
63
+ }
@@ -0,0 +1,204 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://wefter.dev/schemas/product-shaping-contract.schema.json",
4
+ "type": "object",
5
+ "required": ["version", "workflowId", "defaultRoots", "vocabulary", "statusEnums", "dynamicCollections", "creationOrderScope", "creationOrder", "utilizationOrder", "precedence", "requiredFiles"],
6
+ "properties": {
7
+ "version": { "const": 1 },
8
+ "workflowId": { "const": "product-shaping" },
9
+ "defaultRoots": {
10
+ "type": "object",
11
+ "required": ["specRoot", "workflowRoot", "runRoot"],
12
+ "properties": {
13
+ "specRoot": { "const": ".wefter/specs" },
14
+ "workflowRoot": { "const": ".wefter/workflows" },
15
+ "runRoot": { "const": ".wefter/runs/product-shaping" }
16
+ },
17
+ "additionalProperties": false
18
+ },
19
+ "vocabulary": {
20
+ "type": "array",
21
+ "minItems": 5,
22
+ "maxItems": 5,
23
+ "prefixItems": [
24
+ { "const": "idea" },
25
+ { "const": "product specs" },
26
+ { "const": "release" },
27
+ { "const": "deliverable" },
28
+ { "const": "task" }
29
+ ],
30
+ "items": false
31
+ },
32
+ "statusEnums": {
33
+ "type": "object",
34
+ "required": ["feature", "question", "decision", "deliverable"],
35
+ "properties": {
36
+ "feature": { "const": ["candidate", "core", "future", "rejected", "needs-decision"] },
37
+ "question": { "const": ["open", "answered", "deferred", "obsolete"] },
38
+ "decision": { "const": ["accepted", "superseded", "rejected"] },
39
+ "deliverable": { "const": ["candidate", "ready", "blocked", "deferred", "done"] }
40
+ },
41
+ "additionalProperties": false
42
+ },
43
+ "dynamicCollections": {
44
+ "type": "object",
45
+ "required": ["references"],
46
+ "properties": {
47
+ "references": {
48
+ "type": "object",
49
+ "required": ["index", "itemPattern", "listingPattern", "creationOrder", "zeroItemsAllowedWithExplicitIndexStatement", "rule"],
50
+ "properties": {
51
+ "index": { "const": "references/README.md" },
52
+ "itemPattern": { "const": "references/<reference>.md" },
53
+ "listingPattern": { "const": "references/<reference>.md" },
54
+ "creationOrder": { "type": "string", "minLength": 1 },
55
+ "zeroItemsAllowedWithExplicitIndexStatement": { "const": true },
56
+ "rule": { "type": "string", "minLength": 1 }
57
+ },
58
+ "additionalProperties": false
59
+ }
60
+ },
61
+ "additionalProperties": false
62
+ },
63
+ "creationOrderScope": { "const": "fixed-required-files" },
64
+ "creationOrder": { "$ref": "#/$defs/creationOrder" },
65
+ "utilizationOrder": { "$ref": "#/$defs/utilizationOrder" },
66
+ "precedence": {
67
+ "type": "object",
68
+ "required": ["release", "product", "decision", "blockingQuestionRule"],
69
+ "properties": {
70
+ "release": { "$ref": "#/$defs/pathList" },
71
+ "product": { "$ref": "#/$defs/pathList" },
72
+ "decision": { "type": "string", "minLength": 1 },
73
+ "blockingQuestionRule": { "type": "string", "minLength": 1 }
74
+ },
75
+ "additionalProperties": false
76
+ },
77
+ "requiredFiles": {
78
+ "type": "array",
79
+ "minItems": 17,
80
+ "maxItems": 17,
81
+ "items": {
82
+ "type": "object",
83
+ "required": ["path", "responsibility", "limits", "createdAfter", "usedBefore", "consumers", "minimumContent", "hardRules"],
84
+ "properties": {
85
+ "path": { "$ref": "#/$defs/requiredFilePath" },
86
+ "responsibility": { "type": "string", "minLength": 1 },
87
+ "limits": { "type": "string", "minLength": 1 },
88
+ "createdAfter": { "$ref": "#/$defs/pathList" },
89
+ "usedBefore": { "$ref": "#/$defs/pathList" },
90
+ "consumers": { "$ref": "#/$defs/stringList" },
91
+ "minimumContent": { "$ref": "#/$defs/stringList" },
92
+ "hardRules": { "$ref": "#/$defs/stringList" }
93
+ },
94
+ "additionalProperties": false
95
+ },
96
+ "allOf": [
97
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "README.md" } } } },
98
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "discovery/SOURCE_MATERIALS.md" } } } },
99
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "discovery/IDEA_BRIEF.md" } } } },
100
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "discovery/OPEN_QUESTIONS.md" } } } },
101
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "references/README.md" } } } },
102
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "PRODUCT_VISION.md" } } } },
103
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "product/FEATURE_CATALOG.md" } } } },
104
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "product/MODULE_ROADMAP.md" } } } },
105
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "product/DOMAIN_MODEL.md" } } } },
106
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "product/OPERATIONAL_FLOW.md" } } } },
107
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "product/PRODUCT_DECISIONS.md" } } } },
108
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "releases/README.md" } } } },
109
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "releases/<release-id>/README.md" } } } },
110
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "releases/<release-id>/SCOPE.md" } } } },
111
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "releases/<release-id>/DOMAIN_SPEC.md" } } } },
112
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "releases/<release-id>/ACCEPTANCE_CRITERIA.md" } } } },
113
+ { "contains": { "type": "object", "required": ["path"], "properties": { "path": { "const": "releases/<release-id>/DELIVERABLES.md" } } } }
114
+ ]
115
+ }
116
+ },
117
+ "additionalProperties": false,
118
+ "$defs": {
119
+ "pathList": {
120
+ "type": "array",
121
+ "items": { "type": "string", "minLength": 1 }
122
+ },
123
+ "requiredFilePath": {
124
+ "enum": [
125
+ "README.md",
126
+ "discovery/SOURCE_MATERIALS.md",
127
+ "discovery/IDEA_BRIEF.md",
128
+ "discovery/OPEN_QUESTIONS.md",
129
+ "references/README.md",
130
+ "PRODUCT_VISION.md",
131
+ "product/FEATURE_CATALOG.md",
132
+ "product/MODULE_ROADMAP.md",
133
+ "product/DOMAIN_MODEL.md",
134
+ "product/OPERATIONAL_FLOW.md",
135
+ "product/PRODUCT_DECISIONS.md",
136
+ "releases/README.md",
137
+ "releases/<release-id>/README.md",
138
+ "releases/<release-id>/SCOPE.md",
139
+ "releases/<release-id>/DOMAIN_SPEC.md",
140
+ "releases/<release-id>/ACCEPTANCE_CRITERIA.md",
141
+ "releases/<release-id>/DELIVERABLES.md"
142
+ ]
143
+ },
144
+ "creationOrder": {
145
+ "type": "array",
146
+ "minItems": 17,
147
+ "maxItems": 17,
148
+ "prefixItems": [
149
+ { "const": "README.md" },
150
+ { "const": "discovery/SOURCE_MATERIALS.md" },
151
+ { "const": "discovery/IDEA_BRIEF.md" },
152
+ { "const": "discovery/OPEN_QUESTIONS.md" },
153
+ { "const": "references/README.md" },
154
+ { "const": "PRODUCT_VISION.md" },
155
+ { "const": "product/FEATURE_CATALOG.md" },
156
+ { "const": "product/MODULE_ROADMAP.md" },
157
+ { "const": "product/DOMAIN_MODEL.md" },
158
+ { "const": "product/OPERATIONAL_FLOW.md" },
159
+ { "const": "product/PRODUCT_DECISIONS.md" },
160
+ { "const": "releases/README.md" },
161
+ { "const": "releases/<release-id>/README.md" },
162
+ { "const": "releases/<release-id>/SCOPE.md" },
163
+ { "const": "releases/<release-id>/DOMAIN_SPEC.md" },
164
+ { "const": "releases/<release-id>/ACCEPTANCE_CRITERIA.md" },
165
+ { "const": "releases/<release-id>/DELIVERABLES.md" }
166
+ ],
167
+ "items": false
168
+ },
169
+ "utilizationOrder": {
170
+ "type": "array",
171
+ "minItems": 15,
172
+ "maxItems": 15,
173
+ "prefixItems": [
174
+ { "const": "README.md" },
175
+ { "const": "releases/<release-id>/README.md" },
176
+ { "const": "PRODUCT_VISION.md" },
177
+ { "const": "product/PRODUCT_DECISIONS.md" },
178
+ { "const": "releases/<release-id>/SCOPE.md" },
179
+ { "const": "releases/<release-id>/DOMAIN_SPEC.md" },
180
+ { "const": "releases/<release-id>/ACCEPTANCE_CRITERIA.md" },
181
+ { "const": "releases/<release-id>/DELIVERABLES.md" },
182
+ { "const": "product/DOMAIN_MODEL.md" },
183
+ { "const": "product/OPERATIONAL_FLOW.md" },
184
+ { "const": "product/FEATURE_CATALOG.md" },
185
+ { "const": "product/MODULE_ROADMAP.md" },
186
+ { "const": "discovery/OPEN_QUESTIONS.md" },
187
+ { "const": "discovery/IDEA_BRIEF.md" },
188
+ { "const": "references/" }
189
+ ],
190
+ "items": false
191
+ },
192
+ "stringList": {
193
+ "type": "array",
194
+ "minItems": 1,
195
+ "items": { "type": "string", "minLength": 1 }
196
+ },
197
+ "stringEnum": {
198
+ "type": "array",
199
+ "minItems": 1,
200
+ "uniqueItems": true,
201
+ "items": { "type": "string", "minLength": 1 }
202
+ }
203
+ }
204
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://wefter.dev/schemas/product-shaping-profile.schema.json",
4
+ "type": "object",
5
+ "required": ["version", "workflowName", "variants", "lenses"],
6
+ "properties": {
7
+ "version": { "const": 1 },
8
+ "workflowName": { "const": "product-shaping" },
9
+ "variants": {
10
+ "type": "array",
11
+ "minItems": 1,
12
+ "items": {
13
+ "type": "object",
14
+ "required": ["id", "title", "instruction"],
15
+ "properties": {
16
+ "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
17
+ "title": { "type": "string", "minLength": 1 },
18
+ "instruction": { "type": "string", "minLength": 1 }
19
+ },
20
+ "additionalProperties": false
21
+ }
22
+ },
23
+ "lenses": {
24
+ "type": "array",
25
+ "minItems": 1,
26
+ "items": {
27
+ "type": "object",
28
+ "required": ["id", "title", "focus"],
29
+ "properties": {
30
+ "id": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" },
31
+ "title": { "type": "string", "minLength": 1 },
32
+ "focus": { "type": "string", "minLength": 1 }
33
+ },
34
+ "additionalProperties": false
35
+ }
36
+ }
37
+ },
38
+ "additionalProperties": false
39
+ }