@wefter/opencode 0.2.0 → 0.3.0

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 (96) hide show
  1. package/CHANGELOG.md +43 -25
  2. package/LICENSE +21 -21
  3. package/README.md +128 -125
  4. package/bin/wefter.js +8 -8
  5. package/docs/ARCHITECTURE.md +75 -75
  6. package/docs/INSTALLATION.md +56 -47
  7. package/docs/ROADMAP.md +48 -0
  8. package/docs/SAFETY_MODEL.md +18 -17
  9. package/docs/SELF_AUDIT.md +37 -35
  10. package/docs/WORKFLOWS.md +17 -15
  11. package/package.json +45 -45
  12. package/schemas/documentation-audit-profile.schema.json +55 -55
  13. package/schemas/install-manifest.schema.json +42 -0
  14. package/schemas/product-shaping-config.schema.json +63 -63
  15. package/schemas/product-shaping-contract.schema.json +204 -204
  16. package/schemas/product-shaping-profile.schema.json +39 -39
  17. package/schemas/product-shaping-run-manifest.schema.json +103 -103
  18. package/schemas/run-manifest.schema.json +14 -14
  19. package/schemas/wefter.config.schema.json +62 -62
  20. package/schemas/work-unit-config.schema.json +51 -44
  21. package/schemas/work-unit-profile.schema.json +38 -38
  22. package/schemas/work-unit-review-result.schema.json +13 -13
  23. package/schemas/workflow-manifest.schema.json +31 -21
  24. package/src/cli/main.js +2937 -2646
  25. package/src/workflows/documentation-audit/README.md +37 -37
  26. package/src/workflows/documentation-audit/templates/README.md.tmpl +47 -47
  27. package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-consolidator.md.tmpl +27 -27
  28. package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-orchestrator.md.tmpl +69 -65
  29. package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-profile-builder.md.tmpl +58 -58
  30. package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-validator.md.tmpl +26 -26
  31. package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-auditor.md.tmpl +31 -28
  32. package/src/workflows/documentation-audit/templates/opencode/skills/documentation-audit/SKILL.md.tmpl +39 -38
  33. package/src/workflows/documentation-audit/templates/prompts/auditor-prompt.md +98 -97
  34. package/src/workflows/documentation-audit/templates/prompts/consolidator-prompt.md +84 -84
  35. package/src/workflows/documentation-audit/templates/prompts/validator-prompt.md +92 -92
  36. package/src/workflows/documentation-audit/workflow.json +24 -24
  37. package/src/workflows/documentation-repair/README.md +11 -11
  38. package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repair-orchestrator.md.tmpl +33 -33
  39. package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repair-planner.md.tmpl +17 -17
  40. package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repair-reviewer.md.tmpl +17 -17
  41. package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repairer.md.tmpl +14 -14
  42. package/src/workflows/documentation-repair/templates/opencode/skills/documentation-repair/SKILL.md.tmpl +17 -17
  43. package/src/workflows/documentation-repair/templates/prompts/repair-apply-prompt.md +43 -43
  44. package/src/workflows/documentation-repair/templates/prompts/repair-plan-prompt.md +73 -73
  45. package/src/workflows/documentation-repair/templates/prompts/repair-review-prompt.md +47 -47
  46. package/src/workflows/documentation-repair/workflow.json +10 -10
  47. package/src/workflows/product-shaping/README.md +1245 -1245
  48. package/src/workflows/product-shaping/compatibility.md +33 -33
  49. package/src/workflows/product-shaping/contracts/product-spec-contract.json +250 -250
  50. package/src/workflows/product-shaping/templates/default-config.json +34 -34
  51. package/src/workflows/product-shaping/templates/default-profile.json +48 -48
  52. package/src/workflows/product-shaping/templates/documentation-audit/workflow-self-audit-auditor-prompt.md +117 -116
  53. package/src/workflows/product-shaping/templates/documentation-audit-profile.json +80 -80
  54. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-auditor.md.tmpl +22 -22
  55. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-domain-modeler.md.tmpl +31 -31
  56. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-intake-analyst.md.tmpl +31 -31
  57. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-orchestrator.md.tmpl +48 -48
  58. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-reference-researcher.md.tmpl +29 -29
  59. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-release-planner.md.tmpl +34 -34
  60. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-repairer.md.tmpl +25 -25
  61. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-shaper.md.tmpl +31 -31
  62. package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-validator.md.tmpl +23 -23
  63. package/src/workflows/product-shaping/templates/opencode/skills/product-shaping/SKILL.md.tmpl +45 -45
  64. package/src/workflows/product-shaping/templates/prompts/domain-modeler-prompt.md +27 -27
  65. package/src/workflows/product-shaping/templates/prompts/intake-prompt.md +30 -30
  66. package/src/workflows/product-shaping/templates/prompts/product-auditor-prompt.md +53 -53
  67. package/src/workflows/product-shaping/templates/prompts/product-repairer-prompt.md +25 -25
  68. package/src/workflows/product-shaping/templates/prompts/product-shaper-prompt.md +26 -26
  69. package/src/workflows/product-shaping/templates/prompts/product-validator-prompt.md +55 -55
  70. package/src/workflows/product-shaping/templates/prompts/reference-research-prompt.md +25 -25
  71. package/src/workflows/product-shaping/templates/prompts/release-planner-prompt.md +34 -34
  72. package/src/workflows/product-shaping/workflow.json +33 -33
  73. package/src/workflows/technical-shaping/README.md +7 -5
  74. package/src/workflows/technical-shaping/workflow.json +14 -10
  75. package/src/workflows/work-unit-implementation/README.md +71 -71
  76. package/src/workflows/work-unit-implementation/templates/default-config.json +46 -46
  77. package/src/workflows/work-unit-implementation/templates/default-profile.json +57 -57
  78. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-orchestrator.md.tmpl +62 -62
  79. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-auditor.md.tmpl +26 -26
  80. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-consolidator.md.tmpl +26 -26
  81. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-repairer.md.tmpl +25 -25
  82. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-validator.md.tmpl +25 -25
  83. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-planner.md.tmpl +27 -27
  84. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-task-implementer.md.tmpl +30 -30
  85. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-task-reviewer.md.tmpl +28 -28
  86. package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-validator.md.tmpl +26 -26
  87. package/src/workflows/work-unit-implementation/templates/opencode/skills/work-unit-implementation/SKILL.md.tmpl +25 -25
  88. package/src/workflows/work-unit-implementation/templates/prompts/plan-auditor-prompt.md +89 -89
  89. package/src/workflows/work-unit-implementation/templates/prompts/plan-consolidator-prompt.md +64 -64
  90. package/src/workflows/work-unit-implementation/templates/prompts/plan-repairer-prompt.md +42 -42
  91. package/src/workflows/work-unit-implementation/templates/prompts/plan-validator-prompt.md +84 -84
  92. package/src/workflows/work-unit-implementation/templates/prompts/planner-prompt.md +150 -150
  93. package/src/workflows/work-unit-implementation/templates/prompts/task-implementation-prompt.md +57 -57
  94. package/src/workflows/work-unit-implementation/templates/prompts/task-review-prompt.md +69 -69
  95. package/src/workflows/work-unit-implementation/templates/prompts/work-unit-validator-prompt.md +50 -50
  96. package/src/workflows/work-unit-implementation/workflow.json +14 -14
package/CHANGELOG.md CHANGED
@@ -1,25 +1,43 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- ## 0.2.0 - 2026-06-02
6
-
7
- Promotes `product-shaping` to an available workflow.
8
-
9
- - Added available-by-default product-shaping workflow installation, CLI run generation, OpenCode command, agents, skill, prompts, contracts and schemas.
10
- - Added product-shaping completion gate validation for required specs, ready deliverables, adversarial review evidence and final validation evidence.
11
- - Added `DELIVERABLES.md` handoff validation before legacy work-unit implementation can consume product-shaping output.
12
- - Added product-shaping doctrine autoaudit profile and repaired audit findings across schemas, prompts, agents, CLI behavior and docs.
13
- - Hardened product-shaping schemas and runtime checks for canonical file order, vocabulary, relative paths, manifest outputs, handoff and gate evidence.
14
- - Expanded CLI tests for product-shaping availability, path safety, handoff validation and OpenCode installation.
15
-
16
- ## 0.1.0 - 2026-06-02
17
-
18
- Initial public release of Wefter for OpenCode.
19
-
20
- - Added the `wefter` CLI for installing and validating OpenCode workflow packs.
21
- - Added documentation audit workflow generation, profile import, profile scaffolding, and doctor validation.
22
- - Added documentation repair workflow generation from validated audit reports.
23
- - Added work-unit implementation workflow generation and task/review guard validation.
24
- - Added reusable OpenCode agents, skills, commands, workflow manifests, prompt templates, and schemas.
25
- - Added path-safety checks and automated CLI tests for core workflow operations.
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 0.3.0 - 2026-06-05
6
+
7
+ - Added `.wefter/install-manifest.json` generation during `init` and a safe `wefter uninstall` command.
8
+ - Added install manifest schema and documentation for previewing/removing Wefter-managed files.
9
+ - Added roadmap and internal release specs for `delivery-implementation-migration` and `technical-shaping-foundation`.
10
+ - Opted GitHub Actions workflows into Node 24 for JavaScript actions while preserving package test coverage across supported Node versions.
11
+
12
+ ## 0.2.1 - 2026-06-04
13
+
14
+ Stabilizes the `0.2.x` workflow contracts after the product-shaping release.
15
+
16
+ - Clarified that planned workflows do not install executable CLI or OpenCode commands until implemented.
17
+ - Moved future `technical-shaping` command names to planning metadata instead of executable command metadata.
18
+ - Hardened work-unit config and workflow manifest schemas to better match runtime validation.
19
+ - Added per-command CLI flag validation so unsupported options fail fast instead of being silently ignored.
20
+ - Added CI coverage across Node 18, 20, 22 and 24, and hardened manual npm publish inputs to require an existing tag.
21
+ - Updated local development, installation and self-audit documentation to distinguish package defaults from Wefter dogfooding config.
22
+
23
+ ## 0.2.0 - 2026-06-02
24
+
25
+ Promotes `product-shaping` to an available workflow.
26
+
27
+ - Added available-by-default product-shaping workflow installation, CLI run generation, OpenCode command, agents, skill, prompts, contracts and schemas.
28
+ - Added product-shaping completion gate validation for required specs, ready deliverables, adversarial review evidence and final validation evidence.
29
+ - Added `DELIVERABLES.md` handoff validation before legacy work-unit implementation can consume product-shaping output.
30
+ - Added product-shaping doctrine autoaudit profile and repaired audit findings across schemas, prompts, agents, CLI behavior and docs.
31
+ - Hardened product-shaping schemas and runtime checks for canonical file order, vocabulary, relative paths, manifest outputs, handoff and gate evidence.
32
+ - Expanded CLI tests for product-shaping availability, path safety, handoff validation and OpenCode installation.
33
+
34
+ ## 0.1.0 - 2026-06-02
35
+
36
+ Initial public release of Wefter for OpenCode.
37
+
38
+ - Added the `wefter` CLI for installing and validating OpenCode workflow packs.
39
+ - Added documentation audit workflow generation, profile import, profile scaffolding, and doctor validation.
40
+ - Added documentation repair workflow generation from validated audit reports.
41
+ - Added work-unit implementation workflow generation and task/review guard validation.
42
+ - Added reusable OpenCode agents, skills, commands, workflow manifests, prompt templates, and schemas.
43
+ - Added path-safety checks and automated CLI tests for core workflow operations.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Wuerike
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wuerike
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,125 +1,128 @@
1
- # Wefter for OpenCode
2
-
3
- Wefter installs reusable OpenCode workflows that weave product intent into audited specs, executable tasks, and validated implementation.
4
-
5
- ## Status
6
-
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
-
9
- ## Package
10
-
11
- ```text
12
- package: @wefter/opencode
13
- repo: opencode-wefter
14
- cli: wefter
15
- config: wefter.config.json
16
- local workflow files: .wefter/
17
- runtime artifacts: .audit/wefter/ for legacy workflows; .wefter/runs/ for product-shaping
18
- ```
19
-
20
- ## Workflows
21
-
22
- | Workflow ID | Status | Purpose |
23
- | --- | --- | --- |
24
- | `product-shaping` | Available | Shape an initial idea into product specs, release scope, acceptance criteria and deliverables. |
25
- | `documentation-audit` | Available | Run redundant, adversarial documentation consistency audits. |
26
- | `documentation-repair` | Available | Repair docs from a validated audit report without mixing detection and correction. |
27
- | `technical-shaping` | Planned | Convert product docs into explicit technical decisions and implementation constraints. |
28
- | `work-unit-implementation` | Available | Generate planning runs, orchestrate plan review, enforce task/review guards, and validate a work unit. |
29
-
30
- ## Local Development
31
-
32
- ```bash
33
- npm run check
34
- node bin/wefter.js --help
35
- ```
36
-
37
- Install into another project from this checkout:
38
-
39
- ```bash
40
- node <path-to-opencode-wefter>/bin/wefter.js init --target <path-to-project> --yes
41
- ```
42
-
43
- ## Intended User Flow
44
-
45
- ```bash
46
- npx @wefter/opencode init
47
- ```
48
-
49
- Restart OpenCode, then use the available default commands:
50
-
51
- ```text
52
- /wefter-generate-doc-audit-profile
53
- /wefter-shape-product
54
- /wefter-audit-docs
55
- /wefter-repair-docs
56
- /wefter-run-work-unit
57
- ```
58
-
59
- CLI checks are also available:
60
-
61
- ```bash
62
- wefter doctor
63
- wefter product shape --dry-run
64
- wefter product validate --json
65
- wefter docs audit --passes-per-lens 1 --max-audits 12
66
- wefter docs audit --profile-path docs/audits/lenses.json --passes-per-lens 1 --max-audits 12
67
- wefter profile import --source docs/audits/lenses.json --force
68
- wefter docs repair --audit-report .audit/wefter/documentation-audit/<run-id>/final/final-documentation-audit-report.md
69
- wefter new-run documentation-audit --passes-per-lens 1 --max-audits 12
70
- ```
71
-
72
- ## Default Config
73
-
74
- ```json
75
- {
76
- "version": 1,
77
- "workflowRoot": ".wefter/workflows",
78
- "profilePath": ".wefter/workflows/documentation-audit/profile.json",
79
- "artifactRoot": ".audit/wefter/documentation-audit",
80
- "templateRoot": ".wefter/workflows/documentation-audit/templates",
81
- "processDocPath": ".wefter/workflows/documentation-audit/README.md",
82
- "runnerCommand": "node <path-to-wefter>/bin/wefter.js",
83
- "workflows": {
84
- "product-shaping": {
85
- "status": "available",
86
- "enabled": true,
87
- "specRoot": ".wefter/specs",
88
- "runRoot": ".wefter/runs/product-shaping",
89
- "configPath": ".wefter/workflows/product-shaping/config.json",
90
- "profilePath": ".wefter/workflows/product-shaping/profile.json"
91
- },
92
- "documentation-audit": { "status": "available", "enabled": true },
93
- "documentation-repair": { "status": "available", "enabled": true },
94
- "technical-shaping": { "status": "planned", "enabled": false },
95
- "work-unit-implementation": {
96
- "status": "available",
97
- "enabled": true,
98
- "configPath": ".wefter/workflows/work-unit-implementation/config.json",
99
- "profilePath": ".wefter/workflows/work-unit-implementation/profile.json"
100
- }
101
- }
102
- }
103
- ```
104
-
105
- ## Safety Model
106
-
107
- - Installed audit agents render permissions using the configured artifact root and profile path.
108
- - `docs audit` writes through a staging directory and only moves the final run after all files are generated.
109
- - `docs audit --profile-path` can use a repository-specific audit profile for one run without changing `wefter.config.json`.
110
- - `profile import` validates and copies an existing repository-relative audit profile into the configured Wefter profile path.
111
- - `docs repair` writes through a staging directory and requires an existing repository-relative audit report path.
112
- - Paths in `wefter.config.json` must be relative to the target repository and must not contain `..`.
113
- - Run names are plain directory names and cannot contain path separators.
114
- - `product-shaping` writes versioned product specs under `.wefter/specs/` and runtime runs under `.wefter/runs/product-shaping/` by default.
115
- - `product validate` fails the publication/handoff gate when required product specs, blocking questions or deliverable statuses are invalid.
116
- - Audit execution must not edit source documentation; correction is a separate workflow.
117
- - Repair execution must pause when validated findings require unresolved human decisions.
118
-
119
- ## Product Direction
120
-
121
- Next hardening steps after the `0.2.0` product-shaping release:
122
-
123
- 1. Add installation manifest/uninstall support.
124
- 2. Continue migration from legacy `work-unit-implementation` naming toward `delivery-implementation`.
125
- 3. Harden release and package publishing automation.
1
+ # Wefter for OpenCode
2
+
3
+ Wefter installs reusable OpenCode workflows that weave product intent into audited specs, executable tasks, and validated implementation.
4
+
5
+ ## Status
6
+
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
+
9
+ ## Package
10
+
11
+ ```text
12
+ package: @wefter/opencode
13
+ repo: wefter
14
+ cli: wefter
15
+ config: wefter.config.json
16
+ install manifest: .wefter/install-manifest.json
17
+ local workflow files: .wefter/
18
+ runtime artifacts: .audit/wefter/ for legacy workflows; .wefter/runs/ for product-shaping
19
+ ```
20
+
21
+ ## Workflows
22
+
23
+ | Workflow ID | Status | Purpose |
24
+ | --- | --- | --- |
25
+ | `product-shaping` | Available | Shape an initial idea into product specs, release scope, acceptance criteria and deliverables. |
26
+ | `documentation-audit` | Available | Run redundant, adversarial documentation consistency audits. |
27
+ | `documentation-repair` | Available | Repair docs from a validated audit report without mixing detection and correction. |
28
+ | `technical-shaping` | Planned | Convert product docs into explicit technical decisions and implementation constraints. |
29
+ | `work-unit-implementation` | Available | Generate planning runs, orchestrate plan review, enforce task/review guards, and validate a work unit. |
30
+
31
+ ## Local Development
32
+
33
+ ```bash
34
+ npm run check
35
+ npm test
36
+ node bin/wefter.js --help
37
+ ```
38
+
39
+ Install into another project from this checkout:
40
+
41
+ ```bash
42
+ node <path-to-wefter>/bin/wefter.js init --target <path-to-project> --yes
43
+ ```
44
+
45
+ ## Intended User Flow
46
+
47
+ ```bash
48
+ npx @wefter/opencode init
49
+ ```
50
+
51
+ Restart OpenCode, then use the available default commands:
52
+
53
+ ```text
54
+ /wefter-generate-doc-audit-profile
55
+ /wefter-shape-product
56
+ /wefter-audit-docs
57
+ /wefter-repair-docs
58
+ /wefter-run-work-unit
59
+ ```
60
+
61
+ CLI checks are also available:
62
+
63
+ ```bash
64
+ wefter doctor
65
+ wefter product shape --dry-run
66
+ wefter product validate --json
67
+ wefter docs audit --passes-per-lens 1 --max-audits 12
68
+ wefter docs audit --profile-path docs/audits/lenses.json --passes-per-lens 1 --max-audits 12
69
+ wefter profile import --source docs/audits/lenses.json --force
70
+ wefter docs repair --audit-report .audit/wefter/documentation-audit/<run-id>/final/final-documentation-audit-report.md
71
+ wefter new-run documentation-audit --passes-per-lens 1 --max-audits 12
72
+ wefter uninstall --dry-run
73
+ ```
74
+
75
+ ## Default Config
76
+
77
+ ```json
78
+ {
79
+ "version": 1,
80
+ "workflowRoot": ".wefter/workflows",
81
+ "profilePath": ".wefter/workflows/documentation-audit/profile.json",
82
+ "artifactRoot": ".audit/wefter/documentation-audit",
83
+ "templateRoot": ".wefter/workflows/documentation-audit/templates",
84
+ "processDocPath": ".wefter/workflows/documentation-audit/README.md",
85
+ "runnerCommand": "node <path-to-wefter>/bin/wefter.js",
86
+ "workflows": {
87
+ "product-shaping": {
88
+ "status": "available",
89
+ "enabled": true,
90
+ "specRoot": ".wefter/specs",
91
+ "runRoot": ".wefter/runs/product-shaping",
92
+ "configPath": ".wefter/workflows/product-shaping/config.json",
93
+ "profilePath": ".wefter/workflows/product-shaping/profile.json"
94
+ },
95
+ "documentation-audit": { "status": "available", "enabled": true },
96
+ "documentation-repair": { "status": "available", "enabled": true },
97
+ "technical-shaping": { "status": "planned", "enabled": false },
98
+ "work-unit-implementation": {
99
+ "status": "available",
100
+ "enabled": true,
101
+ "configPath": ".wefter/workflows/work-unit-implementation/config.json",
102
+ "profilePath": ".wefter/workflows/work-unit-implementation/profile.json"
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ ## Safety Model
109
+
110
+ - Installed audit agents render permissions using the configured artifact root and profile path.
111
+ - `docs audit` writes through a staging directory and only moves the final run after all files are generated.
112
+ - `docs audit --profile-path` can use a repository-specific audit profile for one run without changing `wefter.config.json`.
113
+ - `profile import` validates and copies an existing repository-relative audit profile into the configured Wefter profile path.
114
+ - `docs repair` writes through a staging directory and requires an existing repository-relative audit report path.
115
+ - `init` writes `.wefter/install-manifest.json` with checksums for installed files; `uninstall` removes only unchanged manifest-recorded files unless `--force` is used.
116
+ - Paths in `wefter.config.json` must be relative to the target repository and must not contain `..`.
117
+ - Run names are plain directory names and cannot contain path separators.
118
+ - `product-shaping` writes versioned product specs under `.wefter/specs/` and runtime runs under `.wefter/runs/product-shaping/` by default.
119
+ - `product validate` fails the publication/handoff gate when required product specs, blocking questions or deliverable statuses are invalid.
120
+ - Audit execution must not edit source documentation; correction is a separate workflow.
121
+ - Repair execution must pause when validated findings require unresolved human decisions.
122
+
123
+ ## Product Direction
124
+
125
+ Next hardening steps after the `0.3.0` install-manifest release:
126
+
127
+ 1. Continue migration from legacy `work-unit-implementation` naming toward `delivery-implementation`.
128
+ 2. Implement `technical-shaping` only after its contract, CLI behavior and OpenCode command are ready.
package/bin/wefter.js CHANGED
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env node
2
-
3
- import { main } from "../src/cli/main.js";
4
-
5
- main().catch((error) => {
6
- console.error(error.message);
7
- process.exitCode = 1;
8
- });
1
+ #!/usr/bin/env node
2
+
3
+ import { main } from "../src/cli/main.js";
4
+
5
+ main().catch((error) => {
6
+ console.error(error.message);
7
+ process.exitCode = 1;
8
+ });
@@ -1,75 +1,75 @@
1
- # Architecture
2
-
3
- Wefter separates reusable workflow infrastructure from repository-specific product, documentation and implementation intent.
4
-
5
- ## Reusable Engine
6
-
7
- The reusable engine contains:
8
-
9
- - CLI command runner.
10
- - Workflow manifests.
11
- - OpenCode agents and skills.
12
- - Generic prompt templates.
13
- - Config, profile and run schemas.
14
-
15
- These files must not encode any single product domain.
16
-
17
- ## Local Configuration
18
-
19
- `wefter.config.json` stores installation choices for one repository:
20
-
21
- - `workflowRoot`: versioned Wefter workflow files installed in the target repository.
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
- - `profilePath`: project-specific documentation audit profile.
24
- - `templateRoot`: installed documentation audit prompt templates.
25
- - `processDocPath`: installed workflow documentation.
26
- - `runnerCommand`: command used by OpenCode orchestrators to invoke Wefter.
27
- - `workflows`: registry of available and planned workflow IDs, with workflow-specific paths such as work-unit `configPath` and `profilePath`.
28
-
29
- Paths are repository-relative and validated before use.
30
-
31
- ## Workflow Modules
32
-
33
- Workflow modules live under `src/workflows/<workflow-id>/` and expose `workflow.json` as their contract. The initial architecture registers:
34
-
35
- - `product-shaping`
36
- - `documentation-audit`
37
- - `documentation-repair`
38
- - `technical-shaping`
39
- - `work-unit-implementation`
40
-
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
-
43
- ## Documentation Audit Run
44
-
45
- `wefter docs audit` reads config and profile, then writes a run under the configured artifact root.
46
-
47
- Run generation uses staging:
48
-
49
- ```text
50
- <artifactRoot>/.tmp/<run-id>/
51
- -> <artifactRoot>/<run-id>/
52
- ```
53
-
54
- This avoids exposing partially generated final runs after an interrupted creation.
55
-
56
- ## Documentation Repair Run
57
-
58
- `wefter docs repair --audit-report <path>` reads config and creates a run under `.audit/wefter/documentation-repair/`.
59
-
60
- Repair runs contain prompts for planning, applying approved repairs and reviewing the repaired documentation. The generated flow separates safe documentation edits from human-decision items and recommends a follow-up audit after repair.
61
-
62
- ## OpenCode Integration
63
-
64
- The installer writes:
65
-
66
- - `.opencode/agent/wefter-doc-*.md`
67
- - `.opencode/agent/wefter-product-*.md`
68
- - `.opencode/agent/wefter-work-unit-*.md`
69
- - `.opencode/skills/documentation-audit/SKILL.md`
70
- - `.opencode/skills/documentation-repair/SKILL.md`
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`
74
-
75
- OpenCode must be restarted after installation because configuration is loaded once at startup.
1
+ # Architecture
2
+
3
+ Wefter separates reusable workflow infrastructure from repository-specific product, documentation and implementation intent.
4
+
5
+ ## Reusable Engine
6
+
7
+ The reusable engine contains:
8
+
9
+ - CLI command runner.
10
+ - Workflow manifests.
11
+ - OpenCode agents and skills.
12
+ - Generic prompt templates.
13
+ - Config, profile and run schemas.
14
+
15
+ These files must not encode any single product domain.
16
+
17
+ ## Local Configuration
18
+
19
+ `wefter.config.json` stores installation choices for one repository:
20
+
21
+ - `workflowRoot`: versioned Wefter workflow files installed in the target repository.
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
+ - `profilePath`: project-specific documentation audit profile.
24
+ - `templateRoot`: installed documentation audit prompt templates.
25
+ - `processDocPath`: installed workflow documentation.
26
+ - `runnerCommand`: command used by OpenCode orchestrators to invoke Wefter.
27
+ - `workflows`: registry of available and planned workflow IDs, with workflow-specific paths such as work-unit `configPath` and `profilePath`.
28
+
29
+ Paths are repository-relative and validated before use.
30
+
31
+ ## Workflow Modules
32
+
33
+ Workflow modules live under `src/workflows/<workflow-id>/` and expose `workflow.json` as their contract. The initial architecture registers:
34
+
35
+ - `product-shaping`
36
+ - `documentation-audit`
37
+ - `documentation-repair`
38
+ - `technical-shaping`
39
+ - `work-unit-implementation`
40
+
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
+
43
+ ## Documentation Audit Run
44
+
45
+ `wefter docs audit` reads config and profile, then writes a run under the configured artifact root.
46
+
47
+ Run generation uses staging:
48
+
49
+ ```text
50
+ <artifactRoot>/.tmp/<run-id>/
51
+ -> <artifactRoot>/<run-id>/
52
+ ```
53
+
54
+ This avoids exposing partially generated final runs after an interrupted creation.
55
+
56
+ ## Documentation Repair Run
57
+
58
+ `wefter docs repair --audit-report <path>` reads config and creates a run under `.audit/wefter/documentation-repair/`.
59
+
60
+ Repair runs contain prompts for planning, applying approved repairs and reviewing the repaired documentation. The generated flow separates safe documentation edits from human-decision items and recommends a follow-up audit after repair.
61
+
62
+ ## OpenCode Integration
63
+
64
+ The installer writes:
65
+
66
+ - `.opencode/agent/wefter-doc-*.md`
67
+ - `.opencode/agent/wefter-product-*.md`
68
+ - `.opencode/agent/wefter-work-unit-*.md`
69
+ - `.opencode/skills/documentation-audit/SKILL.md`
70
+ - `.opencode/skills/documentation-repair/SKILL.md`
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`
74
+
75
+ OpenCode must be restarted after installation because configuration is loaded once at startup.