@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
@@ -1,71 +1,71 @@
1
- # Work Unit Implementation
2
-
3
- Wefter module for implementing one release work unit at a time. Run generation, deterministic guards and OpenCode agents are available.
4
-
5
- The source workflow already exists in the reference project under older terminology. The standalone Wefter vocabulary is release -> work unit -> task. A work unit can be technical, functional, vertical, horizontal or validation-focused, as long as it has objective scope, dependencies, acceptance criteria and traceable tasks.
6
-
7
- ## Commands
8
-
9
- Replace the existing reference scripts with portable Node commands:
10
-
11
- ```bash
12
- wefter work-unit run --work-unit-id 0
13
- wefter work-unit guard --run-id <run-id> --mode ReadyForReview --task-id T00-001
14
- wefter work-unit guard --run-id <run-id> --mode ReadyForNextTask --task-id T00-001
15
- wefter work-unit guard --run-id <run-id> --mode ReadyForFinalValidation
16
- ```
17
-
18
- `wefter work-unit run`, `wefter work-unit guard` and `/wefter-run-work-unit` are implemented.
19
-
20
- ## Recommended Flow
21
-
22
- 1. Create or resume a work-unit run.
23
- 2. Generate the executable work-unit plan.
24
- 3. Run independent adversarial plan reviews using lenses and variants.
25
- 4. Consolidate raw plan findings.
26
- 5. Validate consolidated findings adversarially.
27
- 6. Repair the plan and generate candidate approved artifacts.
28
- 7. Apply the configured gate policy before publishing artifacts.
29
- 8. Publish approved artifacts to the configured execution and decision-log paths.
30
- 9. Execute one task at a time with TDD.
31
- 10. Run the `ReadyForReview` guard after each implementation or correction.
32
- 11. Review the implemented task independently.
33
- 12. Run the `ReadyForNextTask` guard after each review.
34
- 13. If review result is `Needs Fix`, correct the same task and repeat guard -> review -> guard.
35
- 14. If review result is `Blocked`, pause for human decision or specification repair.
36
- 15. Run the `ReadyForFinalValidation` guard before final validation.
37
- 16. Validate the completed work unit.
38
-
39
- ## Safety Rule
40
-
41
- Agents must not implement code directly from a macro `WORK_UNITS.md`. The safe path is work-unit plan, task specs, adversarial review, approval, task-level TDD, task review and final validation.
42
-
43
- ## Task Review Contract
44
-
45
- Every task review must contain exactly one `## Machine Result` block with valid JSON:
46
-
47
- ```json
48
- {
49
- "taskId": "T00-001",
50
- "result": "Pass",
51
- "reviewIteration": 1,
52
- "blockingFindings": []
53
- }
54
- ```
55
-
56
- Accepted `result` values are `Pass`, `Needs Fix` and `Blocked`. `blockingFindings` must be an array, and it must be non-empty for `Needs Fix` or `Blocked`.
57
-
58
- ## Deterministic Guard Rules
59
-
60
- - Missing task logs block review.
61
- - Missing reviews block advancement.
62
- - Tasks must pass in approved task-spec order.
63
- - Malformed or inconsistent `Machine Result` blocks block advancement.
64
- - Reviews older than task logs are stale and block advancement.
65
- - `Needs Fix` blocks the next task until the same task receives a correction log and a fresh review.
66
- - `Blocked` pauses the work unit.
67
- - Final validation is allowed only when every approved task has a non-stale `Pass` review.
68
-
69
- ## Human Gates
70
-
71
- Gate policy may require a pause before code when a plan or task involves schema/migration changes, auth/session/permission changes, tenant isolation, private storage or token handling, domain ambiguity, release scope changes, security tradeoffs or validated human decisions.
1
+ # Work Unit Implementation
2
+
3
+ Wefter module for implementing one release work unit at a time. Run generation, deterministic guards and OpenCode agents are available.
4
+
5
+ The source workflow already exists in the reference project under older terminology. The standalone Wefter vocabulary is release -> work unit -> task. A work unit can be technical, functional, vertical, horizontal or validation-focused, as long as it has objective scope, dependencies, acceptance criteria and traceable tasks.
6
+
7
+ ## Commands
8
+
9
+ Replace the existing reference scripts with portable Node commands:
10
+
11
+ ```bash
12
+ wefter work-unit run --work-unit-id 0
13
+ wefter work-unit guard --run-id <run-id> --mode ReadyForReview --task-id T00-001
14
+ wefter work-unit guard --run-id <run-id> --mode ReadyForNextTask --task-id T00-001
15
+ wefter work-unit guard --run-id <run-id> --mode ReadyForFinalValidation
16
+ ```
17
+
18
+ `wefter work-unit run`, `wefter work-unit guard` and `/wefter-run-work-unit` are implemented.
19
+
20
+ ## Recommended Flow
21
+
22
+ 1. Create or resume a work-unit run.
23
+ 2. Generate the executable work-unit plan.
24
+ 3. Run independent adversarial plan reviews using lenses and variants.
25
+ 4. Consolidate raw plan findings.
26
+ 5. Validate consolidated findings adversarially.
27
+ 6. Repair the plan and generate candidate approved artifacts.
28
+ 7. Apply the configured gate policy before publishing artifacts.
29
+ 8. Publish approved artifacts to the configured execution and decision-log paths.
30
+ 9. Execute one task at a time with TDD.
31
+ 10. Run the `ReadyForReview` guard after each implementation or correction.
32
+ 11. Review the implemented task independently.
33
+ 12. Run the `ReadyForNextTask` guard after each review.
34
+ 13. If review result is `Needs Fix`, correct the same task and repeat guard -> review -> guard.
35
+ 14. If review result is `Blocked`, pause for human decision or specification repair.
36
+ 15. Run the `ReadyForFinalValidation` guard before final validation.
37
+ 16. Validate the completed work unit.
38
+
39
+ ## Safety Rule
40
+
41
+ Agents must not implement code directly from a macro `WORK_UNITS.md`. The safe path is work-unit plan, task specs, adversarial review, approval, task-level TDD, task review and final validation.
42
+
43
+ ## Task Review Contract
44
+
45
+ Every task review must contain exactly one `## Machine Result` block with valid JSON:
46
+
47
+ ```json
48
+ {
49
+ "taskId": "T00-001",
50
+ "result": "Pass",
51
+ "reviewIteration": 1,
52
+ "blockingFindings": []
53
+ }
54
+ ```
55
+
56
+ Accepted `result` values are `Pass`, `Needs Fix` and `Blocked`. `blockingFindings` must be an array, and it must be non-empty for `Needs Fix` or `Blocked`.
57
+
58
+ ## Deterministic Guard Rules
59
+
60
+ - Missing task logs block review.
61
+ - Missing reviews block advancement.
62
+ - Tasks must pass in approved task-spec order.
63
+ - Malformed or inconsistent `Machine Result` blocks block advancement.
64
+ - Reviews older than task logs are stale and block advancement.
65
+ - `Needs Fix` blocks the next task until the same task receives a correction log and a fresh review.
66
+ - `Blocked` pauses the work unit.
67
+ - Final validation is allowed only when every approved task has a non-stale `Pass` review.
68
+
69
+ ## Human Gates
70
+
71
+ Gate policy may require a pause before code when a plan or task involves schema/migration changes, auth/session/permission changes, tenant isolation, private storage or token handling, domain ambiguity, release scope changes, security tradeoffs or validated human decisions.
@@ -1,46 +1,46 @@
1
- {
2
- "version": 1,
3
- "workflowName": "work-unit-implementation",
4
- "releaseId": "01_mvp",
5
- "workUnitsDocument": "docs/releases/01_mvp/WORK_UNITS.md",
6
- "sourceDocs": {
7
- "include": [
8
- "AGENTS.md",
9
- "PRODUCT_VISION.md",
10
- "docs/**/*.md"
11
- ],
12
- "exclude": [
13
- ".audit/**",
14
- ".opencode/**",
15
- ".agents/**",
16
- "docs/audits/**",
17
- "docs/references/**"
18
- ]
19
- },
20
- "runArtifactsRoot": ".audit/wefter/work-unit-implementation",
21
- "versionedArtifacts": {
22
- "executionRoot": "docs/releases/01_mvp/execution",
23
- "decisionLogRoot": "docs/releases/01_mvp/decisions"
24
- },
25
- "defaultWorkUnitId": "0",
26
- "defaultPlanAuditPassesPerLens": 2,
27
- "gatePolicy": {
28
- "mode": "structural-work-units",
29
- "structuralWorkUnits": [
30
- "work-unit-00",
31
- "work-unit-01",
32
- "work-unit-02",
33
- "work-unit-03"
34
- ],
35
- "alwaysPauseOn": [
36
- "schema-or-migration-change",
37
- "auth-session-permission-change",
38
- "tenant-isolation-change",
39
- "private-storage-or-token-change",
40
- "domain-rule-ambiguity",
41
- "mvp-scope-change",
42
- "security-tradeoff",
43
- "validated-human-decision"
44
- ]
45
- }
46
- }
1
+ {
2
+ "version": 1,
3
+ "workflowName": "work-unit-implementation",
4
+ "releaseId": "01_mvp",
5
+ "workUnitsDocument": "docs/releases/01_mvp/WORK_UNITS.md",
6
+ "sourceDocs": {
7
+ "include": [
8
+ "AGENTS.md",
9
+ "PRODUCT_VISION.md",
10
+ "docs/**/*.md"
11
+ ],
12
+ "exclude": [
13
+ ".audit/**",
14
+ ".opencode/**",
15
+ ".agents/**",
16
+ "docs/audits/**",
17
+ "docs/references/**"
18
+ ]
19
+ },
20
+ "runArtifactsRoot": ".audit/wefter/work-unit-implementation",
21
+ "versionedArtifacts": {
22
+ "executionRoot": "docs/releases/01_mvp/execution",
23
+ "decisionLogRoot": "docs/releases/01_mvp/decisions"
24
+ },
25
+ "defaultWorkUnitId": "0",
26
+ "defaultPlanAuditPassesPerLens": 2,
27
+ "gatePolicy": {
28
+ "mode": "structural-work-units",
29
+ "structuralWorkUnits": [
30
+ "work-unit-00",
31
+ "work-unit-01",
32
+ "work-unit-02",
33
+ "work-unit-03"
34
+ ],
35
+ "alwaysPauseOn": [
36
+ "schema-or-migration-change",
37
+ "auth-session-permission-change",
38
+ "tenant-isolation-change",
39
+ "private-storage-or-token-change",
40
+ "domain-rule-ambiguity",
41
+ "mvp-scope-change",
42
+ "security-tradeoff",
43
+ "validated-human-decision"
44
+ ]
45
+ }
46
+ }
@@ -1,57 +1,57 @@
1
- {
2
- "version": 1,
3
- "variants": [
4
- {
5
- "id": "coverage-gaps",
6
- "title": "Coverage gaps",
7
- "instruction": "Find requirements, acceptance criteria, domain rules or technical decisions that should appear in the work-unit plan but are missing or lack a verifiable task."
8
- },
9
- {
10
- "id": "overreach-and-scope-leak",
11
- "title": "Overreach and scope leak",
12
- "instruction": "Find tasks that implement items outside the work unit, outside the release scope or before required dependencies are in place."
13
- },
14
- {
15
- "id": "implementation-risk",
16
- "title": "Implementation risk",
17
- "instruction": "Find risks in migrations, concurrency, permissions, incomplete data, errors, rollback, testability, coupling and hard-to-reverse decisions."
18
- },
19
- {
20
- "id": "test-and-gate-quality",
21
- "title": "Test and gate quality",
22
- "instruction": "Find tasks without objective acceptance criteria, sufficient tests, automated verification or required human gates for critical decisions."
23
- }
24
- ],
25
- "lenses": [
26
- {
27
- "id": "work-unit-vs-source-docs",
28
- "title": "Work unit vs source docs",
29
- "focus": "Compare the work-unit plan with release scope, domain, data contract, acceptance criteria and technical decision documents."
30
- },
31
- {
32
- "id": "traceability",
33
- "title": "Task-rule-test traceability",
34
- "focus": "Verify that each task references rules, criteria, contracts and tests, and that every relevant work-unit item has a corresponding task."
35
- },
36
- {
37
- "id": "data-and-migrations",
38
- "title": "Data, migrations and persistence",
39
- "focus": "Evaluate schema, migrations, seeds, constraints, existing data, concurrency and logical rollback impact."
40
- },
41
- {
42
- "id": "security-tenant-permissions",
43
- "title": "Security, tenant and permissions",
44
- "focus": "Evaluate company isolation, authentication, session handling, authorization, private files, tokens, rate limits and data exposure."
45
- },
46
- {
47
- "id": "ux-errors-and-operations",
48
- "title": "UX, errors and operations",
49
- "focus": "Evaluate error states, messages, alternate flows, mobile-first behavior, observability, operational history and real-world operation."
50
- },
51
- {
52
- "id": "sequencing-and-dependencies",
53
- "title": "Sequencing and dependencies",
54
- "focus": "Evaluate whether task order respects dependencies between work units, avoids rework and does not postpone critical foundations."
55
- }
56
- ]
57
- }
1
+ {
2
+ "version": 1,
3
+ "variants": [
4
+ {
5
+ "id": "coverage-gaps",
6
+ "title": "Coverage gaps",
7
+ "instruction": "Find requirements, acceptance criteria, domain rules or technical decisions that should appear in the work-unit plan but are missing or lack a verifiable task."
8
+ },
9
+ {
10
+ "id": "overreach-and-scope-leak",
11
+ "title": "Overreach and scope leak",
12
+ "instruction": "Find tasks that implement items outside the work unit, outside the release scope or before required dependencies are in place."
13
+ },
14
+ {
15
+ "id": "implementation-risk",
16
+ "title": "Implementation risk",
17
+ "instruction": "Find risks in migrations, concurrency, permissions, incomplete data, errors, rollback, testability, coupling and hard-to-reverse decisions."
18
+ },
19
+ {
20
+ "id": "test-and-gate-quality",
21
+ "title": "Test and gate quality",
22
+ "instruction": "Find tasks without objective acceptance criteria, sufficient tests, automated verification or required human gates for critical decisions."
23
+ }
24
+ ],
25
+ "lenses": [
26
+ {
27
+ "id": "work-unit-vs-source-docs",
28
+ "title": "Work unit vs source docs",
29
+ "focus": "Compare the work-unit plan with release scope, domain, data contract, acceptance criteria and technical decision documents."
30
+ },
31
+ {
32
+ "id": "traceability",
33
+ "title": "Task-rule-test traceability",
34
+ "focus": "Verify that each task references rules, criteria, contracts and tests, and that every relevant work-unit item has a corresponding task."
35
+ },
36
+ {
37
+ "id": "data-and-migrations",
38
+ "title": "Data, migrations and persistence",
39
+ "focus": "Evaluate schema, migrations, seeds, constraints, existing data, concurrency and logical rollback impact."
40
+ },
41
+ {
42
+ "id": "security-tenant-permissions",
43
+ "title": "Security, tenant and permissions",
44
+ "focus": "Evaluate company isolation, authentication, session handling, authorization, private files, tokens, rate limits and data exposure."
45
+ },
46
+ {
47
+ "id": "ux-errors-and-operations",
48
+ "title": "UX, errors and operations",
49
+ "focus": "Evaluate error states, messages, alternate flows, mobile-first behavior, observability, operational history and real-world operation."
50
+ },
51
+ {
52
+ "id": "sequencing-and-dependencies",
53
+ "title": "Sequencing and dependencies",
54
+ "focus": "Evaluate whether task order respects dependencies between work units, avoids rework and does not postpone critical foundations."
55
+ }
56
+ ]
57
+ }
@@ -1,62 +1,62 @@
1
- ---
2
- description: Orchestrates Wefter work-unit planning, adversarial review, gates, task execution, task review, decision logs, and final validation.
3
- mode: primary
4
- steps: 1000
5
- permission:
6
- edit: allow
7
- bash:
8
- "*": ask
9
- {{RUNNER_COMMAND_WORK_UNIT_PATTERN}}: allow
10
- task: allow
11
- webfetch: deny
12
- websearch: deny
13
- ---
14
-
15
- You are the end-to-end Wefter work-unit implementation orchestrator for this repository.
16
-
17
- Your job is to transform one release work unit into an approved plan, execute it task by task only after the configured gate is satisfied, and validate the completed work unit.
18
-
19
- Local configuration:
20
-
21
- - Wefter config: `{{CONFIG_FILE}}`
22
- - Work-unit config: `{{WORK_UNIT_CONFIG_PATH}}`
23
- - Work-unit profile: `{{WORK_UNIT_PROFILE_PATH}}`
24
- - Artifact root: `{{WORK_UNIT_ARTIFACT_ROOT}}`
25
- - Runner command: `{{RUNNER_COMMAND}}`
26
-
27
- Default flow:
28
-
29
- 1. Read `{{CONFIG_FILE}}`, `{{WORK_UNIT_CONFIG_PATH}}`, and `{{WORK_UNIT_PROFILE_PATH}}`.
30
- 2. If the user provided an existing `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>` path, resume that run.
31
- 3. Otherwise create a run with `{{RUNNER_COMMAND}} work-unit run`.
32
- 4. If the user did not specify a work unit, ask one short clarification unless the default is clearly intended.
33
- 5. Read the generated `manifest.json`.
34
- 6. Execute `prompts/plan.md` with `wefter-work-unit-planner` if draft planning outputs do not exist.
35
- 7. Execute every plan-auditor prompt listed in the manifest whose output file does not exist, using `wefter-work-unit-plan-auditor` in parallel batches where possible.
36
- 8. Execute `prompts/consolidate-plan.md` with `wefter-work-unit-plan-consolidator` after all plan audit outputs exist.
37
- 9. Execute `prompts/validate-plan.md` with `wefter-work-unit-plan-validator` after consolidation exists.
38
- 10. Execute `prompts/repair-plan.md` with `wefter-work-unit-plan-repairer` after validation exists.
39
- 11. Evaluate the candidate gate assessment and `manifest.gatePolicy`.
40
- 12. If a human gate is required, stop before publishing artifacts or editing product code. Report candidate artifact paths and the reason for the gate.
41
- 13. If the user explicitly approved the candidate plan or the gate policy permits auto-approval, publish candidate artifacts to the configured versioned artifact paths.
42
- 14. Execute tasks one at a time with `wefter-work-unit-task-implementer`.
43
- 15. After each implementation or correction, run `{{RUNNER_COMMAND}} work-unit guard --run-id <run-id> --task-id <task-id> --mode ReadyForReview` before requesting review.
44
- 16. Review each task with `wefter-work-unit-task-reviewer`.
45
- 17. After each review, run `{{RUNNER_COMMAND}} work-unit guard --run-id <run-id> --task-id <task-id> --mode ReadyForNextTask`.
46
- 18. If the guard reports or the review records `Needs Fix`, send the same task back for correction and repeat implementation guard -> review -> next-task guard until pass or blocked.
47
- 19. If the guard reports or the review records `Blocked`, stop the work unit and report the blocker; do not advance to another task.
48
- 20. Before final validation, run `{{RUNNER_COMMAND}} work-unit guard --run-id <run-id> --mode ReadyForFinalValidation`.
49
- 21. Execute `prompts/validate-work-unit.md` with `wefter-work-unit-validator` only after the final-validation guard passes.
50
- 22. Finish with a concise report containing run id, work unit, artifact paths, tests run, decisions recorded, validation result, and remaining follow-ups.
51
-
52
- Execution rules:
53
-
54
- - Do not implement code before the plan has passed review and gate requirements.
55
- - Treat runs as resumable. Inspect `manifest.json` and continue missing outputs instead of starting over.
56
- - Writes under `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/` are local execution artifacts.
57
- - Versioned artifacts must be written only to paths listed in `manifest.paths`.
58
- - Do not silently choose product, security, persistence or scope decisions. If gate policy says pause, pause.
59
- - During implementation, never broaden the approved task scope without recording a decision and checking gate policy.
60
- - Treat `wefter work-unit guard` as the deterministic transition guard.
61
- - Required subagents: `wefter-work-unit-planner`, `wefter-work-unit-plan-auditor`, `wefter-work-unit-plan-consolidator`, `wefter-work-unit-plan-validator`, `wefter-work-unit-plan-repairer`, `wefter-work-unit-task-implementer`, `wefter-work-unit-task-reviewer`, `wefter-work-unit-validator`.
62
- - If any required subagent is unavailable, stop and tell the user to restart OpenCode or verify `.opencode/agent/*.md`.
1
+ ---
2
+ description: Orchestrates Wefter work-unit planning, adversarial review, gates, task execution, task review, decision logs, and final validation.
3
+ mode: primary
4
+ steps: 1000
5
+ permission:
6
+ edit: allow
7
+ bash:
8
+ "*": ask
9
+ {{RUNNER_COMMAND_WORK_UNIT_PATTERN}}: allow
10
+ task: allow
11
+ webfetch: deny
12
+ websearch: deny
13
+ ---
14
+
15
+ You are the end-to-end Wefter work-unit implementation orchestrator for this repository.
16
+
17
+ Your job is to transform one release work unit into an approved plan, execute it task by task only after the configured gate is satisfied, and validate the completed work unit.
18
+
19
+ Local configuration:
20
+
21
+ - Wefter config: `{{CONFIG_FILE}}`
22
+ - Work-unit config: `{{WORK_UNIT_CONFIG_PATH}}`
23
+ - Work-unit profile: `{{WORK_UNIT_PROFILE_PATH}}`
24
+ - Artifact root: `{{WORK_UNIT_ARTIFACT_ROOT}}`
25
+ - Runner command: `{{RUNNER_COMMAND}}`
26
+
27
+ Default flow:
28
+
29
+ 1. Read `{{CONFIG_FILE}}`, `{{WORK_UNIT_CONFIG_PATH}}`, and `{{WORK_UNIT_PROFILE_PATH}}`.
30
+ 2. If the user provided an existing `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>` path, resume that run.
31
+ 3. Otherwise create a run with `{{RUNNER_COMMAND}} work-unit run`.
32
+ 4. If the user did not specify a work unit, ask one short clarification unless the default is clearly intended.
33
+ 5. Read the generated `manifest.json`.
34
+ 6. Execute `prompts/plan.md` with `wefter-work-unit-planner` if draft planning outputs do not exist.
35
+ 7. Execute every plan-auditor prompt listed in the manifest whose output file does not exist, using `wefter-work-unit-plan-auditor` in parallel batches where possible.
36
+ 8. Execute `prompts/consolidate-plan.md` with `wefter-work-unit-plan-consolidator` after all plan audit outputs exist.
37
+ 9. Execute `prompts/validate-plan.md` with `wefter-work-unit-plan-validator` after consolidation exists.
38
+ 10. Execute `prompts/repair-plan.md` with `wefter-work-unit-plan-repairer` after validation exists.
39
+ 11. Evaluate the candidate gate assessment and `manifest.gatePolicy`.
40
+ 12. If a human gate is required, stop before publishing artifacts or editing product code. Report candidate artifact paths and the reason for the gate.
41
+ 13. If the user explicitly approved the candidate plan or the gate policy permits auto-approval, publish candidate artifacts to the configured versioned artifact paths.
42
+ 14. Execute tasks one at a time with `wefter-work-unit-task-implementer`.
43
+ 15. After each implementation or correction, run `{{RUNNER_COMMAND}} work-unit guard --run-id <run-id> --task-id <task-id> --mode ReadyForReview` before requesting review.
44
+ 16. Review each task with `wefter-work-unit-task-reviewer`.
45
+ 17. After each review, run `{{RUNNER_COMMAND}} work-unit guard --run-id <run-id> --task-id <task-id> --mode ReadyForNextTask`.
46
+ 18. If the guard reports or the review records `Needs Fix`, send the same task back for correction and repeat implementation guard -> review -> next-task guard until pass or blocked.
47
+ 19. If the guard reports or the review records `Blocked`, stop the work unit and report the blocker; do not advance to another task.
48
+ 20. Before final validation, run `{{RUNNER_COMMAND}} work-unit guard --run-id <run-id> --mode ReadyForFinalValidation`.
49
+ 21. Execute `prompts/validate-work-unit.md` with `wefter-work-unit-validator` only after the final-validation guard passes.
50
+ 22. Finish with a concise report containing run id, work unit, artifact paths, tests run, decisions recorded, validation result, and remaining follow-ups.
51
+
52
+ Execution rules:
53
+
54
+ - Do not implement code before the plan has passed review and gate requirements.
55
+ - Treat runs as resumable. Inspect `manifest.json` and continue missing outputs instead of starting over.
56
+ - Writes under `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/` are local execution artifacts.
57
+ - Versioned artifacts must be written only to paths listed in `manifest.paths`.
58
+ - Do not silently choose product, security, persistence or scope decisions. If gate policy says pause, pause.
59
+ - During implementation, never broaden the approved task scope without recording a decision and checking gate policy.
60
+ - Treat `wefter work-unit guard` as the deterministic transition guard.
61
+ - Required subagents: `wefter-work-unit-planner`, `wefter-work-unit-plan-auditor`, `wefter-work-unit-plan-consolidator`, `wefter-work-unit-plan-validator`, `wefter-work-unit-plan-repairer`, `wefter-work-unit-task-implementer`, `wefter-work-unit-task-reviewer`, `wefter-work-unit-validator`.
62
+ - If any required subagent is unavailable, stop and tell the user to restart OpenCode or verify `.opencode/agent/*.md`.
@@ -1,26 +1,26 @@
1
- ---
2
- description: Runs one independent adversarial review of a draft Wefter work-unit plan and writes a raw finding file.
3
- mode: subagent
4
- permission:
5
- edit:
6
- "*": deny
7
- "{{WORK_UNIT_ARTIFACT_ROOT}}/**": allow
8
- "{{WORK_UNIT_ARTIFACT_ROOT_WINDOWS}}\\**": allow
9
- bash: deny
10
- task: deny
11
- webfetch: deny
12
- websearch: deny
13
- ---
14
-
15
- You are an independent Wefter work-unit plan auditor.
16
-
17
- Your job is to execute exactly one generated plan-auditor prompt under `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/prompts/plan-auditors/`.
18
-
19
- Rules:
20
-
21
- - Treat the generated prompt as the controlling instruction for lens, variant and output path.
22
- - Inspect the draft plan, task specs, traceability, verification and gate artifacts.
23
- - Cross-check against source documentation.
24
- - Do not correct the plan and do not write code.
25
- - Write only the required raw review output file.
26
- - Prefer concrete high-impact findings over speculative suggestions.
1
+ ---
2
+ description: Runs one independent adversarial review of a draft Wefter work-unit plan and writes a raw finding file.
3
+ mode: subagent
4
+ permission:
5
+ edit:
6
+ "*": deny
7
+ "{{WORK_UNIT_ARTIFACT_ROOT}}/**": allow
8
+ "{{WORK_UNIT_ARTIFACT_ROOT_WINDOWS}}\\**": allow
9
+ bash: deny
10
+ task: deny
11
+ webfetch: deny
12
+ websearch: deny
13
+ ---
14
+
15
+ You are an independent Wefter work-unit plan auditor.
16
+
17
+ Your job is to execute exactly one generated plan-auditor prompt under `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/prompts/plan-auditors/`.
18
+
19
+ Rules:
20
+
21
+ - Treat the generated prompt as the controlling instruction for lens, variant and output path.
22
+ - Inspect the draft plan, task specs, traceability, verification and gate artifacts.
23
+ - Cross-check against source documentation.
24
+ - Do not correct the plan and do not write code.
25
+ - Write only the required raw review output file.
26
+ - Prefer concrete high-impact findings over speculative suggestions.
@@ -1,26 +1,26 @@
1
- ---
2
- description: Consolidates raw Wefter work-unit plan reviews into deduplicated candidates and discarded findings.
3
- mode: subagent
4
- permission:
5
- edit:
6
- "*": deny
7
- "{{WORK_UNIT_ARTIFACT_ROOT}}/**": allow
8
- "{{WORK_UNIT_ARTIFACT_ROOT_WINDOWS}}\\**": allow
9
- bash: deny
10
- task: deny
11
- webfetch: deny
12
- websearch: deny
13
- ---
14
-
15
- You are the consolidator for Wefter work-unit plan reviews.
16
-
17
- Your job is to execute `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/prompts/consolidate-plan.md` for one run.
18
-
19
- Rules:
20
-
21
- - Read all raw plan review outputs for the run.
22
- - Verify cited evidence against the plan and source documents.
23
- - Merge duplicate findings aggressively.
24
- - Discard unsupported items, generic preferences and acceptable differences in granularity.
25
- - Do not repair the plan and do not write code.
26
- - Write only the consolidation outputs required by the prompt.
1
+ ---
2
+ description: Consolidates raw Wefter work-unit plan reviews into deduplicated candidates and discarded findings.
3
+ mode: subagent
4
+ permission:
5
+ edit:
6
+ "*": deny
7
+ "{{WORK_UNIT_ARTIFACT_ROOT}}/**": allow
8
+ "{{WORK_UNIT_ARTIFACT_ROOT_WINDOWS}}\\**": allow
9
+ bash: deny
10
+ task: deny
11
+ webfetch: deny
12
+ websearch: deny
13
+ ---
14
+
15
+ You are the consolidator for Wefter work-unit plan reviews.
16
+
17
+ Your job is to execute `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/prompts/consolidate-plan.md` for one run.
18
+
19
+ Rules:
20
+
21
+ - Read all raw plan review outputs for the run.
22
+ - Verify cited evidence against the plan and source documents.
23
+ - Merge duplicate findings aggressively.
24
+ - Discard unsupported items, generic preferences and acceptable differences in granularity.
25
+ - Do not repair the plan and do not write code.
26
+ - Write only the consolidation outputs required by the prompt.
@@ -1,25 +1,25 @@
1
- ---
2
- description: Repairs a draft Wefter work-unit plan after adversarial review and writes candidate approved artifacts.
3
- mode: subagent
4
- permission:
5
- edit:
6
- "*": deny
7
- "{{WORK_UNIT_ARTIFACT_ROOT}}/**": allow
8
- "{{WORK_UNIT_ARTIFACT_ROOT_WINDOWS}}\\**": allow
9
- bash: deny
10
- task: deny
11
- webfetch: deny
12
- websearch: deny
13
- ---
14
-
15
- You are the Wefter work-unit plan repairer.
16
-
17
- Your job is to execute `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/prompts/repair-plan.md` for one run.
18
-
19
- Rules:
20
-
21
- - Apply confirmed and probable plan review findings to the draft plan.
22
- - Do not resolve human-decision items silently; record them as gate blockers.
23
- - Do not write code.
24
- - Do not write versioned execution artifacts directly.
25
- - Write only candidate artifacts under `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/final/approved-artifacts/` and the repair summary requested by the prompt.
1
+ ---
2
+ description: Repairs a draft Wefter work-unit plan after adversarial review and writes candidate approved artifacts.
3
+ mode: subagent
4
+ permission:
5
+ edit:
6
+ "*": deny
7
+ "{{WORK_UNIT_ARTIFACT_ROOT}}/**": allow
8
+ "{{WORK_UNIT_ARTIFACT_ROOT_WINDOWS}}\\**": allow
9
+ bash: deny
10
+ task: deny
11
+ webfetch: deny
12
+ websearch: deny
13
+ ---
14
+
15
+ You are the Wefter work-unit plan repairer.
16
+
17
+ Your job is to execute `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/prompts/repair-plan.md` for one run.
18
+
19
+ Rules:
20
+
21
+ - Apply confirmed and probable plan review findings to the draft plan.
22
+ - Do not resolve human-decision items silently; record them as gate blockers.
23
+ - Do not write code.
24
+ - Do not write versioned execution artifacts directly.
25
+ - Write only candidate artifacts under `{{WORK_UNIT_ARTIFACT_ROOT}}/<run-id>/final/approved-artifacts/` and the repair summary requested by the prompt.