@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
@@ -31,16 +31,19 @@ Local configuration:
31
31
  Default flow:
32
32
 
33
33
  1. Read `{{CONFIG_FILE}}`, `{{PROCESS_DOC_PATH}}`, and the configured audit profile.
34
- 2. If the user provided an existing run path under `{{ARTIFACT_ROOT}}`, resume that run.
35
- 3. Otherwise create a new run with `{{RUNNER_COMMAND}} docs audit`.
36
- 4. Unless the user specifies different sizing, use `--passes-per-lens 3`.
37
- 5. Read the generated `manifest.json`.
38
- 6. Execute every auditor prompt listed in the manifest whose raw output file does not exist.
39
- 7. Execute prompts in parallel batches when possible. Use a conservative default batch size of 8 unless the user requests another batch size.
40
- 8. Each auditor execution must write only its assigned file under the configured run `raw/` directory.
41
- 9. After all raw outputs exist, execute `prompts/consolidate.md`.
42
- 10. After consolidation exists, execute `prompts/validate.md`.
43
- 11. Finish with a concise report containing the run id, counts, final report path, and any blocked prompts.
34
+ 2. If the active runtime is plan mode, read-only mode, or otherwise forbids artifact writes, stop immediately and tell the user to exit that mode before running the audit.
35
+ 3. If the user provided an existing run path under `{{ARTIFACT_ROOT}}`, resume that run.
36
+ 4. Otherwise create a new run with `{{RUNNER_COMMAND}} docs audit`.
37
+ 5. Unless the user specifies different sizing, use `--passes-per-lens 3`.
38
+ 6. Read the generated `manifest.json`.
39
+ 7. Execute every auditor prompt listed in the manifest whose raw output file does not exist.
40
+ 8. Execute prompts in parallel batches when possible. Use a conservative default batch size of 8 unless the user requests another batch size.
41
+ 9. For each auditor subagent, pass the exact `prompt` path and exact `output` path from the manifest. Do not ask subagents to find prompts with wildcard or glob patterns.
42
+ 10. Each auditor execution must write only its assigned file under the configured run `raw/` directory.
43
+ 11. After each batch, compare every manifest `output` path against files that exist on disk. Do not treat a task return as complete unless its assigned raw output exists.
44
+ 12. After all raw outputs exist, execute `prompts/consolidate.md`.
45
+ 13. After consolidation exists, execute `prompts/validate.md`.
46
+ 14. Finish with a concise report containing the run id, counts, final report path, and any blocked prompts.
44
47
 
45
48
  Execution rules:
46
49
 
@@ -57,6 +60,7 @@ Execution rules:
57
60
  - `wefter-doc-audit-validator` for adversarial validation.
58
61
  - If any required subagent is unavailable, stop before executing audit work and report an installation/configuration error. Tell the user to restart opencode or verify `.opencode/agent/*.md`.
59
62
  - If a batch produces failures, retry failed prompts once. If they still fail, record them as blocked and stop before consolidation.
63
+ - If an auditor cannot read its exact prompt path or cannot write its exact output path, retry once with those exact paths. If the output still does not exist, record it as blocked and stop before consolidation.
60
64
 
61
65
  Sizing guidance:
62
66
 
@@ -16,6 +16,8 @@ You are a documentation consistency auditor for this repository.
16
16
 
17
17
  Your job is to execute exactly one audit prompt generated under the configured audit run `prompts/auditors/` directory.
18
18
 
19
+ The caller must provide the exact prompt path and exact output path from the run `manifest.json`. Read that exact prompt file directly. Do not discover the prompt with wildcard or glob patterns.
20
+
19
21
  Rules:
20
22
 
21
23
  - Treat the generated prompt as the controlling instruction for scope, lens, variant and output path.
@@ -26,3 +28,4 @@ Rules:
26
28
  - Prefer fewer high-quality findings over many speculative findings.
27
29
  - If there are no findings, still write the required output file with `NO_FINDINGS`.
28
30
  - Do not assume source-of-truth precedence. The audit highlights contradictions; later workflows decide corrections.
31
+ - If the active runtime forbids writing the required output file, or the exact prompt path cannot be read, stop immediately and report the blocker. Do not continue searching or auditing indefinitely.
@@ -16,6 +16,7 @@ Local workflow files:
16
16
 
17
17
  Operational rules:
18
18
 
19
+ - Do not run audit execution in plan mode or any read-only runtime. If artifact writes are forbidden, stop immediately and ask the user to exit that mode before auditing.
19
20
  - Audit is read-only with respect to source docs. Raw, consolidation, validation and final outputs are written under the configured artifact root.
20
21
  - Do not fix documentation during an audit run.
21
22
  - Do not assume source-of-truth precedence while auditing.
@@ -42,6 +42,7 @@ Exclude:
42
42
  - If an item depends on interpretation, mark it as ambiguity or probable, not as confirmed conflict.
43
43
  - Every finding must cite concrete evidence with file and quote.
44
44
  - If there are no findings, still write the file with the `NO_FINDINGS` section.
45
+ - If the runtime prevents writing `{{OUTPUT_FILE}}`, stop immediately and report that blocker. Do not continue auditing indefinitely.
45
46
 
46
47
  ## Output Format
47
48