@wefter/opencode 0.1.0 → 0.2.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.
- package/CHANGELOG.md +25 -14
- package/LICENSE +21 -21
- package/README.md +125 -112
- package/bin/wefter.js +8 -8
- package/docs/ARCHITECTURE.md +75 -79
- package/docs/INSTALLATION.md +47 -46
- package/docs/SAFETY_MODEL.md +17 -17
- package/docs/SELF_AUDIT.md +35 -0
- package/docs/WORKFLOWS.md +15 -13
- package/package.json +45 -45
- package/schemas/documentation-audit-profile.schema.json +55 -47
- package/schemas/product-shaping-config.schema.json +63 -0
- package/schemas/product-shaping-contract.schema.json +204 -0
- package/schemas/product-shaping-profile.schema.json +39 -0
- package/schemas/product-shaping-run-manifest.schema.json +103 -0
- package/schemas/run-manifest.schema.json +14 -14
- package/schemas/wefter.config.schema.json +62 -31
- package/schemas/work-unit-config.schema.json +44 -44
- package/schemas/work-unit-profile.schema.json +38 -38
- package/schemas/work-unit-review-result.schema.json +13 -13
- package/schemas/workflow-manifest.schema.json +21 -21
- package/src/cli/main.js +2646 -1858
- package/src/workflows/documentation-audit/README.md +37 -37
- package/src/workflows/documentation-audit/templates/README.md.tmpl +47 -47
- package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-consolidator.md.tmpl +27 -27
- package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-orchestrator.md.tmpl +65 -65
- package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-profile-builder.md.tmpl +58 -58
- package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-audit-validator.md.tmpl +26 -26
- package/src/workflows/documentation-audit/templates/opencode/agent/wefter-doc-auditor.md.tmpl +28 -28
- package/src/workflows/documentation-audit/templates/opencode/skills/documentation-audit/SKILL.md.tmpl +38 -38
- package/src/workflows/documentation-audit/templates/prompts/auditor-prompt.md +97 -97
- package/src/workflows/documentation-audit/templates/prompts/consolidator-prompt.md +84 -84
- package/src/workflows/documentation-audit/templates/prompts/validator-prompt.md +92 -92
- package/src/workflows/documentation-audit/workflow.json +24 -24
- package/src/workflows/documentation-repair/README.md +11 -11
- package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repair-orchestrator.md.tmpl +33 -33
- package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repair-planner.md.tmpl +17 -17
- package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repair-reviewer.md.tmpl +17 -17
- package/src/workflows/documentation-repair/templates/opencode/agent/wefter-doc-repairer.md.tmpl +14 -14
- package/src/workflows/documentation-repair/templates/opencode/skills/documentation-repair/SKILL.md.tmpl +17 -17
- package/src/workflows/documentation-repair/templates/prompts/repair-apply-prompt.md +43 -43
- package/src/workflows/documentation-repair/templates/prompts/repair-plan-prompt.md +73 -73
- package/src/workflows/documentation-repair/templates/prompts/repair-review-prompt.md +47 -47
- package/src/workflows/documentation-repair/workflow.json +10 -10
- package/src/workflows/product-shaping/README.md +1245 -7
- package/src/workflows/product-shaping/compatibility.md +33 -0
- package/src/workflows/product-shaping/contracts/product-spec-contract.json +250 -0
- package/src/workflows/product-shaping/templates/default-config.json +34 -0
- package/src/workflows/product-shaping/templates/default-profile.json +48 -0
- package/src/workflows/product-shaping/templates/documentation-audit/workflow-self-audit-auditor-prompt.md +116 -0
- package/src/workflows/product-shaping/templates/documentation-audit-profile.json +80 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-auditor.md.tmpl +22 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-domain-modeler.md.tmpl +31 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-intake-analyst.md.tmpl +31 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-orchestrator.md.tmpl +48 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-reference-researcher.md.tmpl +29 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-release-planner.md.tmpl +34 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-repairer.md.tmpl +25 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-shaper.md.tmpl +31 -0
- package/src/workflows/product-shaping/templates/opencode/agent/wefter-product-validator.md.tmpl +23 -0
- package/src/workflows/product-shaping/templates/opencode/skills/product-shaping/SKILL.md.tmpl +45 -0
- package/src/workflows/product-shaping/templates/prompts/domain-modeler-prompt.md +27 -0
- package/src/workflows/product-shaping/templates/prompts/intake-prompt.md +30 -0
- package/src/workflows/product-shaping/templates/prompts/product-auditor-prompt.md +53 -0
- package/src/workflows/product-shaping/templates/prompts/product-repairer-prompt.md +25 -0
- package/src/workflows/product-shaping/templates/prompts/product-shaper-prompt.md +26 -0
- package/src/workflows/product-shaping/templates/prompts/product-validator-prompt.md +55 -0
- package/src/workflows/product-shaping/templates/prompts/reference-research-prompt.md +25 -0
- package/src/workflows/product-shaping/templates/prompts/release-planner-prompt.md +34 -0
- package/src/workflows/product-shaping/workflow.json +33 -10
- package/src/workflows/technical-shaping/README.md +5 -5
- package/src/workflows/technical-shaping/workflow.json +10 -10
- package/src/workflows/work-unit-implementation/README.md +71 -71
- package/src/workflows/work-unit-implementation/templates/default-config.json +46 -46
- package/src/workflows/work-unit-implementation/templates/default-profile.json +57 -57
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-orchestrator.md.tmpl +62 -62
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-auditor.md.tmpl +26 -26
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-consolidator.md.tmpl +26 -26
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-repairer.md.tmpl +25 -25
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-plan-validator.md.tmpl +25 -25
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-planner.md.tmpl +27 -27
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-task-implementer.md.tmpl +30 -30
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-task-reviewer.md.tmpl +28 -28
- package/src/workflows/work-unit-implementation/templates/opencode/agent/wefter-work-unit-validator.md.tmpl +26 -26
- package/src/workflows/work-unit-implementation/templates/opencode/skills/work-unit-implementation/SKILL.md.tmpl +25 -25
- package/src/workflows/work-unit-implementation/templates/prompts/plan-auditor-prompt.md +89 -89
- package/src/workflows/work-unit-implementation/templates/prompts/plan-consolidator-prompt.md +64 -64
- package/src/workflows/work-unit-implementation/templates/prompts/plan-repairer-prompt.md +42 -42
- package/src/workflows/work-unit-implementation/templates/prompts/plan-validator-prompt.md +84 -84
- package/src/workflows/work-unit-implementation/templates/prompts/planner-prompt.md +150 -150
- package/src/workflows/work-unit-implementation/templates/prompts/task-implementation-prompt.md +57 -57
- package/src/workflows/work-unit-implementation/templates/prompts/task-review-prompt.md +69 -69
- package/src/workflows/work-unit-implementation/templates/prompts/work-unit-validator-prompt.md +50 -50
- package/src/workflows/work-unit-implementation/workflow.json +14 -14
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# Work-Unit Plan Repair
|
|
2
|
-
|
|
3
|
-
Run: `{{RUN_ID}}`
|
|
4
|
-
Work unit: `{{WORK_UNIT_KEY}}`
|
|
5
|
-
Review report: `{{FINAL_PLAN_REVIEW_OUTPUT}}`
|
|
6
|
-
|
|
7
|
-
## Role
|
|
8
|
-
|
|
9
|
-
You are the plan repairer. Apply validated findings to the draft plan and produce candidate artifacts for approval. Do not implement code.
|
|
10
|
-
|
|
11
|
-
## Inputs
|
|
12
|
-
|
|
13
|
-
- Draft plan: `{{DRAFT_PLAN_OUTPUT}}`
|
|
14
|
-
- Draft traceability matrix: `{{DRAFT_TRACEABILITY_OUTPUT}}`
|
|
15
|
-
- Draft verification plan: `{{DRAFT_VERIFICATION_OUTPUT}}`
|
|
16
|
-
- Draft gate assessment: `{{DRAFT_GATE_OUTPUT}}`
|
|
17
|
-
- Draft decisions: `{{DRAFT_DECISIONS_OUTPUT}}`
|
|
18
|
-
- Draft task specs: `{{DRAFT_TASK_SPECS_DIR}}`
|
|
19
|
-
- Review report: `{{FINAL_PLAN_REVIEW_OUTPUT}}`
|
|
20
|
-
|
|
21
|
-
## Required Outputs
|
|
22
|
-
|
|
23
|
-
Write candidate artifacts to:
|
|
24
|
-
|
|
25
|
-
- Candidate plan: `{{CANDIDATE_PLAN_OUTPUT}}`
|
|
26
|
-
- Candidate traceability matrix: `{{CANDIDATE_TRACEABILITY_OUTPUT}}`
|
|
27
|
-
- Candidate verification plan: `{{CANDIDATE_VERIFICATION_OUTPUT}}`
|
|
28
|
-
- Candidate gate report: `{{CANDIDATE_GATE_OUTPUT}}`
|
|
29
|
-
- Candidate decision log: `{{CANDIDATE_DECISIONS_OUTPUT}}`
|
|
30
|
-
- Candidate task specs: `{{CANDIDATE_TASK_SPECS_DIR}}`
|
|
31
|
-
|
|
32
|
-
## Rules
|
|
33
|
-
|
|
34
|
-
- Apply Confirmed and Probable problems from the report.
|
|
35
|
-
- If there is Needs Human Decision, do not choose silently. Record it in gate and decision log as a human pending item.
|
|
36
|
-
- Preserve task IDs when possible. If a task changes, explain why.
|
|
37
|
-
- The candidate must be ready for human review or publication to `{{VERSIONED_WORK_UNIT_DIR}}`.
|
|
38
|
-
- Do not write directly to versioned artifacts. Write only to the candidate directory.
|
|
39
|
-
|
|
40
|
-
## Extra Output
|
|
41
|
-
|
|
42
|
-
Also write `{{REPAIR_SUMMARY_OUTPUT}}` with a summary of changes made and items still blocking autonomous execution.
|
|
1
|
+
# Work-Unit Plan Repair
|
|
2
|
+
|
|
3
|
+
Run: `{{RUN_ID}}`
|
|
4
|
+
Work unit: `{{WORK_UNIT_KEY}}`
|
|
5
|
+
Review report: `{{FINAL_PLAN_REVIEW_OUTPUT}}`
|
|
6
|
+
|
|
7
|
+
## Role
|
|
8
|
+
|
|
9
|
+
You are the plan repairer. Apply validated findings to the draft plan and produce candidate artifacts for approval. Do not implement code.
|
|
10
|
+
|
|
11
|
+
## Inputs
|
|
12
|
+
|
|
13
|
+
- Draft plan: `{{DRAFT_PLAN_OUTPUT}}`
|
|
14
|
+
- Draft traceability matrix: `{{DRAFT_TRACEABILITY_OUTPUT}}`
|
|
15
|
+
- Draft verification plan: `{{DRAFT_VERIFICATION_OUTPUT}}`
|
|
16
|
+
- Draft gate assessment: `{{DRAFT_GATE_OUTPUT}}`
|
|
17
|
+
- Draft decisions: `{{DRAFT_DECISIONS_OUTPUT}}`
|
|
18
|
+
- Draft task specs: `{{DRAFT_TASK_SPECS_DIR}}`
|
|
19
|
+
- Review report: `{{FINAL_PLAN_REVIEW_OUTPUT}}`
|
|
20
|
+
|
|
21
|
+
## Required Outputs
|
|
22
|
+
|
|
23
|
+
Write candidate artifacts to:
|
|
24
|
+
|
|
25
|
+
- Candidate plan: `{{CANDIDATE_PLAN_OUTPUT}}`
|
|
26
|
+
- Candidate traceability matrix: `{{CANDIDATE_TRACEABILITY_OUTPUT}}`
|
|
27
|
+
- Candidate verification plan: `{{CANDIDATE_VERIFICATION_OUTPUT}}`
|
|
28
|
+
- Candidate gate report: `{{CANDIDATE_GATE_OUTPUT}}`
|
|
29
|
+
- Candidate decision log: `{{CANDIDATE_DECISIONS_OUTPUT}}`
|
|
30
|
+
- Candidate task specs: `{{CANDIDATE_TASK_SPECS_DIR}}`
|
|
31
|
+
|
|
32
|
+
## Rules
|
|
33
|
+
|
|
34
|
+
- Apply Confirmed and Probable problems from the report.
|
|
35
|
+
- If there is Needs Human Decision, do not choose silently. Record it in gate and decision log as a human pending item.
|
|
36
|
+
- Preserve task IDs when possible. If a task changes, explain why.
|
|
37
|
+
- The candidate must be ready for human review or publication to `{{VERSIONED_WORK_UNIT_DIR}}`.
|
|
38
|
+
- Do not write directly to versioned artifacts. Write only to the candidate directory.
|
|
39
|
+
|
|
40
|
+
## Extra Output
|
|
41
|
+
|
|
42
|
+
Also write `{{REPAIR_SUMMARY_OUTPUT}}` with a summary of changes made and items still blocking autonomous execution.
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
# Adversarial Work-Unit Plan Validation
|
|
2
|
-
|
|
3
|
-
Run: `{{RUN_ID}}`
|
|
4
|
-
Work unit: `{{WORK_UNIT_KEY}}`
|
|
5
|
-
Consolidated candidates: `{{CONSOLIDATED_OUTPUT}}`
|
|
6
|
-
Validation output: `{{VALIDATION_OUTPUT}}`
|
|
7
|
-
Final report: `{{FINAL_PLAN_REVIEW_OUTPUT}}`
|
|
8
|
-
|
|
9
|
-
## Role
|
|
10
|
-
|
|
11
|
-
You are the adversarial validator for the work-unit plan. Try to prove each consolidated candidate is a false positive. Keep only problems that survive that attempt.
|
|
12
|
-
|
|
13
|
-
Do not correct the plan. Do not implement code. Write only the required outputs.
|
|
14
|
-
|
|
15
|
-
## Tasks
|
|
16
|
-
|
|
17
|
-
- Read `{{CONSOLIDATED_OUTPUT}}`.
|
|
18
|
-
- For each candidate, check evidence in the plan and source documents.
|
|
19
|
-
- Try to refute with alternative explanations: release differences, acceptable technical preparation, intentionally deferred detail, wrong source document responsibility or false requirement.
|
|
20
|
-
- Classify as Confirmed, Probable, Needs human decision or False positive.
|
|
21
|
-
- Produce a short actionable final report.
|
|
22
|
-
|
|
23
|
-
## Validation Output
|
|
24
|
-
|
|
25
|
-
Write `{{VALIDATION_OUTPUT}}`:
|
|
26
|
-
|
|
27
|
-
```md
|
|
28
|
-
# Work-Unit Plan Adversarial Validation Log
|
|
29
|
-
|
|
30
|
-
Run: {{RUN_ID}}
|
|
31
|
-
Work unit: {{WORK_UNIT_KEY}}
|
|
32
|
-
|
|
33
|
-
## Candidate Reviews
|
|
34
|
-
|
|
35
|
-
### C-001: <title>
|
|
36
|
-
|
|
37
|
-
Validation result: Confirmed | Probable | Needs human decision | False positive
|
|
38
|
-
Reasoning:
|
|
39
|
-
|
|
40
|
-
Refutation attempts:
|
|
41
|
-
- <attempt>
|
|
42
|
-
|
|
43
|
-
Evidence checked:
|
|
44
|
-
- `<file>`
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Final Report
|
|
48
|
-
|
|
49
|
-
Write `{{FINAL_PLAN_REVIEW_OUTPUT}}`:
|
|
50
|
-
|
|
51
|
-
```md
|
|
52
|
-
# Final Work-Unit Plan Review Report
|
|
53
|
-
|
|
54
|
-
Run: {{RUN_ID}}
|
|
55
|
-
Work unit: {{WORK_UNIT_KEY}}
|
|
56
|
-
|
|
57
|
-
## Summary
|
|
58
|
-
|
|
59
|
-
- Confirmed problems:
|
|
60
|
-
- Probable problems:
|
|
61
|
-
- Needs human decision:
|
|
62
|
-
- False positives removed:
|
|
63
|
-
|
|
64
|
-
## Confirmed Problems
|
|
65
|
-
|
|
66
|
-
### P-001: <title>
|
|
67
|
-
|
|
68
|
-
Type:
|
|
69
|
-
Severity:
|
|
70
|
-
Needs human decision: Yes | No
|
|
71
|
-
|
|
72
|
-
Evidence:
|
|
73
|
-
- `<file>`: "<quote>"
|
|
74
|
-
|
|
75
|
-
Problem:
|
|
76
|
-
|
|
77
|
-
Correction direction:
|
|
78
|
-
|
|
79
|
-
## Probable Problems
|
|
80
|
-
|
|
81
|
-
## Needs Human Decision
|
|
82
|
-
|
|
83
|
-
## Removed As False Positives
|
|
84
|
-
```
|
|
1
|
+
# Adversarial Work-Unit Plan Validation
|
|
2
|
+
|
|
3
|
+
Run: `{{RUN_ID}}`
|
|
4
|
+
Work unit: `{{WORK_UNIT_KEY}}`
|
|
5
|
+
Consolidated candidates: `{{CONSOLIDATED_OUTPUT}}`
|
|
6
|
+
Validation output: `{{VALIDATION_OUTPUT}}`
|
|
7
|
+
Final report: `{{FINAL_PLAN_REVIEW_OUTPUT}}`
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
|
|
11
|
+
You are the adversarial validator for the work-unit plan. Try to prove each consolidated candidate is a false positive. Keep only problems that survive that attempt.
|
|
12
|
+
|
|
13
|
+
Do not correct the plan. Do not implement code. Write only the required outputs.
|
|
14
|
+
|
|
15
|
+
## Tasks
|
|
16
|
+
|
|
17
|
+
- Read `{{CONSOLIDATED_OUTPUT}}`.
|
|
18
|
+
- For each candidate, check evidence in the plan and source documents.
|
|
19
|
+
- Try to refute with alternative explanations: release differences, acceptable technical preparation, intentionally deferred detail, wrong source document responsibility or false requirement.
|
|
20
|
+
- Classify as Confirmed, Probable, Needs human decision or False positive.
|
|
21
|
+
- Produce a short actionable final report.
|
|
22
|
+
|
|
23
|
+
## Validation Output
|
|
24
|
+
|
|
25
|
+
Write `{{VALIDATION_OUTPUT}}`:
|
|
26
|
+
|
|
27
|
+
```md
|
|
28
|
+
# Work-Unit Plan Adversarial Validation Log
|
|
29
|
+
|
|
30
|
+
Run: {{RUN_ID}}
|
|
31
|
+
Work unit: {{WORK_UNIT_KEY}}
|
|
32
|
+
|
|
33
|
+
## Candidate Reviews
|
|
34
|
+
|
|
35
|
+
### C-001: <title>
|
|
36
|
+
|
|
37
|
+
Validation result: Confirmed | Probable | Needs human decision | False positive
|
|
38
|
+
Reasoning:
|
|
39
|
+
|
|
40
|
+
Refutation attempts:
|
|
41
|
+
- <attempt>
|
|
42
|
+
|
|
43
|
+
Evidence checked:
|
|
44
|
+
- `<file>`
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Final Report
|
|
48
|
+
|
|
49
|
+
Write `{{FINAL_PLAN_REVIEW_OUTPUT}}`:
|
|
50
|
+
|
|
51
|
+
```md
|
|
52
|
+
# Final Work-Unit Plan Review Report
|
|
53
|
+
|
|
54
|
+
Run: {{RUN_ID}}
|
|
55
|
+
Work unit: {{WORK_UNIT_KEY}}
|
|
56
|
+
|
|
57
|
+
## Summary
|
|
58
|
+
|
|
59
|
+
- Confirmed problems:
|
|
60
|
+
- Probable problems:
|
|
61
|
+
- Needs human decision:
|
|
62
|
+
- False positives removed:
|
|
63
|
+
|
|
64
|
+
## Confirmed Problems
|
|
65
|
+
|
|
66
|
+
### P-001: <title>
|
|
67
|
+
|
|
68
|
+
Type:
|
|
69
|
+
Severity:
|
|
70
|
+
Needs human decision: Yes | No
|
|
71
|
+
|
|
72
|
+
Evidence:
|
|
73
|
+
- `<file>`: "<quote>"
|
|
74
|
+
|
|
75
|
+
Problem:
|
|
76
|
+
|
|
77
|
+
Correction direction:
|
|
78
|
+
|
|
79
|
+
## Probable Problems
|
|
80
|
+
|
|
81
|
+
## Needs Human Decision
|
|
82
|
+
|
|
83
|
+
## Removed As False Positives
|
|
84
|
+
```
|
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
# Executable Work-Unit Plan
|
|
2
|
-
|
|
3
|
-
Run: `{{RUN_ID}}`
|
|
4
|
-
Release: `{{RELEASE_ID}}`
|
|
5
|
-
Work unit: `{{WORK_UNIT_KEY}}`
|
|
6
|
-
Config: `{{CONFIG_PATH}}`
|
|
7
|
-
Output root: `{{RUN_ROOT}}`
|
|
8
|
-
|
|
9
|
-
## Role
|
|
10
|
-
|
|
11
|
-
You are the work-unit planner. Transform the macro work unit into executable, traceable and reviewable artifacts before any code implementation starts.
|
|
12
|
-
|
|
13
|
-
Do not implement code. Do not edit source documentation. Write only the outputs named in this prompt.
|
|
14
|
-
|
|
15
|
-
## Source Documents
|
|
16
|
-
|
|
17
|
-
- Work units document: `{{WORK_UNITS_DOCUMENT}}`
|
|
18
|
-
- Includes:
|
|
19
|
-
{{SOURCE_INCLUDE}}
|
|
20
|
-
- Excludes:
|
|
21
|
-
{{SOURCE_EXCLUDE}}
|
|
22
|
-
|
|
23
|
-
## Target Work Unit
|
|
24
|
-
|
|
25
|
-
Use `{{WORK_UNIT_ID}}` / `{{WORK_UNIT_KEY}}` as the target work unit. Extract objective, included scope, acceptance criteria and out-of-scope items from the work-units document, then cross-check them against the other source documents.
|
|
26
|
-
|
|
27
|
-
## Required Outputs
|
|
28
|
-
|
|
29
|
-
Create these files:
|
|
30
|
-
|
|
31
|
-
- Work-unit plan: `{{DRAFT_PLAN_OUTPUT}}`
|
|
32
|
-
- Traceability matrix: `{{DRAFT_TRACEABILITY_OUTPUT}}`
|
|
33
|
-
- Verification plan: `{{DRAFT_VERIFICATION_OUTPUT}}`
|
|
34
|
-
- Gate assessment: `{{DRAFT_GATE_OUTPUT}}`
|
|
35
|
-
- Decisions draft: `{{DRAFT_DECISIONS_OUTPUT}}`
|
|
36
|
-
- Task specs: directory `{{DRAFT_TASK_SPECS_DIR}}`
|
|
37
|
-
|
|
38
|
-
## Rules
|
|
39
|
-
|
|
40
|
-
- Each task must have a stable ID in the format `TXX-YYY`, where `XX` is the work-unit number when numeric.
|
|
41
|
-
- Each task must cite evidence from source documents with path and quote or line when possible.
|
|
42
|
-
- Each task must have objective acceptance criteria, approval scenarios mappable to tests, and required tests or checks.
|
|
43
|
-
- If a task involves schema, migration, auth, permission, tenant isolation, storage, token handling or security, mark it explicitly.
|
|
44
|
-
- If domain or scope ambiguity exists, record it in `gate-assessment.md` as requiring a human gate.
|
|
45
|
-
- Do not create tasks for items outside the work-unit scope unless explicitly justified as technical preparation.
|
|
46
|
-
- Prefer small, sequenced and verifiable tasks.
|
|
47
|
-
|
|
48
|
-
## Plan Format
|
|
49
|
-
|
|
50
|
-
`{{DRAFT_PLAN_OUTPUT}}` must contain:
|
|
51
|
-
|
|
52
|
-
```md
|
|
53
|
-
# {{WORK_UNIT_KEY}} Plan
|
|
54
|
-
|
|
55
|
-
## Status
|
|
56
|
-
|
|
57
|
-
Draft
|
|
58
|
-
|
|
59
|
-
## Source Documents Consulted
|
|
60
|
-
|
|
61
|
-
## Work Unit Scope
|
|
62
|
-
|
|
63
|
-
## Out Of Scope
|
|
64
|
-
|
|
65
|
-
## Assumptions
|
|
66
|
-
|
|
67
|
-
## Tasks
|
|
68
|
-
|
|
69
|
-
| Task | Title | Type | Depends On | Human Gate | Tests |
|
|
70
|
-
| --- | --- | --- | --- | --- | --- |
|
|
71
|
-
|
|
72
|
-
## Sequencing Rationale
|
|
73
|
-
|
|
74
|
-
## Risks
|
|
75
|
-
|
|
76
|
-
## Documentation Updates Expected
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Task Spec Format
|
|
80
|
-
|
|
81
|
-
Create one file per task in `{{DRAFT_TASK_SPECS_DIR}}`, named `<task-id>.md`:
|
|
82
|
-
|
|
83
|
-
```md
|
|
84
|
-
# <task-id>: <title>
|
|
85
|
-
|
|
86
|
-
## Goal
|
|
87
|
-
|
|
88
|
-
## Source Evidence
|
|
89
|
-
|
|
90
|
-
## Scope
|
|
91
|
-
|
|
92
|
-
## Out Of Scope
|
|
93
|
-
|
|
94
|
-
## Dependencies
|
|
95
|
-
|
|
96
|
-
## Implementation Requirements
|
|
97
|
-
|
|
98
|
-
## Data And Migration Impact
|
|
99
|
-
|
|
100
|
-
## Security, Tenant And Permission Considerations
|
|
101
|
-
|
|
102
|
-
## Error States
|
|
103
|
-
|
|
104
|
-
## Approval Scenarios
|
|
105
|
-
|
|
106
|
-
## Tests Required
|
|
107
|
-
|
|
108
|
-
## Documentation Impact
|
|
109
|
-
|
|
110
|
-
## Acceptance Checklist
|
|
111
|
-
|
|
112
|
-
## Human Gate
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Traceability Matrix Format
|
|
116
|
-
|
|
117
|
-
`{{DRAFT_TRACEABILITY_OUTPUT}}` must map:
|
|
118
|
-
|
|
119
|
-
```md
|
|
120
|
-
# {{WORK_UNIT_KEY}} Traceability Matrix
|
|
121
|
-
|
|
122
|
-
| Task | Domain Rule | Data Contract | Acceptance Criteria | Technical Decision | Test/Verification |
|
|
123
|
-
| --- | --- | --- | --- | --- | --- |
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
## Verification Plan Format
|
|
127
|
-
|
|
128
|
-
`{{DRAFT_VERIFICATION_OUTPUT}}` must list commands, expected automated tests, unavoidable manual checks and criteria for considering the work unit complete.
|
|
129
|
-
|
|
130
|
-
## Gate Assessment Format
|
|
131
|
-
|
|
132
|
-
`{{DRAFT_GATE_OUTPUT}}` must contain:
|
|
133
|
-
|
|
134
|
-
```md
|
|
135
|
-
# {{WORK_UNIT_KEY}} Gate Assessment
|
|
136
|
-
|
|
137
|
-
## Gate Recommendation
|
|
138
|
-
|
|
139
|
-
Human Required | Auto-Approvable
|
|
140
|
-
|
|
141
|
-
## Reasons
|
|
142
|
-
|
|
143
|
-
## Hard Gate Triggers
|
|
144
|
-
|
|
145
|
-
## Questions For Human Review
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Decisions Format
|
|
149
|
-
|
|
150
|
-
`{{DRAFT_DECISIONS_OUTPUT}}` must start the work-unit decision log with expected decisions or state that no decision has been made yet.
|
|
1
|
+
# Executable Work-Unit Plan
|
|
2
|
+
|
|
3
|
+
Run: `{{RUN_ID}}`
|
|
4
|
+
Release: `{{RELEASE_ID}}`
|
|
5
|
+
Work unit: `{{WORK_UNIT_KEY}}`
|
|
6
|
+
Config: `{{CONFIG_PATH}}`
|
|
7
|
+
Output root: `{{RUN_ROOT}}`
|
|
8
|
+
|
|
9
|
+
## Role
|
|
10
|
+
|
|
11
|
+
You are the work-unit planner. Transform the macro work unit into executable, traceable and reviewable artifacts before any code implementation starts.
|
|
12
|
+
|
|
13
|
+
Do not implement code. Do not edit source documentation. Write only the outputs named in this prompt.
|
|
14
|
+
|
|
15
|
+
## Source Documents
|
|
16
|
+
|
|
17
|
+
- Work units document: `{{WORK_UNITS_DOCUMENT}}`
|
|
18
|
+
- Includes:
|
|
19
|
+
{{SOURCE_INCLUDE}}
|
|
20
|
+
- Excludes:
|
|
21
|
+
{{SOURCE_EXCLUDE}}
|
|
22
|
+
|
|
23
|
+
## Target Work Unit
|
|
24
|
+
|
|
25
|
+
Use `{{WORK_UNIT_ID}}` / `{{WORK_UNIT_KEY}}` as the target work unit. Extract objective, included scope, acceptance criteria and out-of-scope items from the work-units document, then cross-check them against the other source documents.
|
|
26
|
+
|
|
27
|
+
## Required Outputs
|
|
28
|
+
|
|
29
|
+
Create these files:
|
|
30
|
+
|
|
31
|
+
- Work-unit plan: `{{DRAFT_PLAN_OUTPUT}}`
|
|
32
|
+
- Traceability matrix: `{{DRAFT_TRACEABILITY_OUTPUT}}`
|
|
33
|
+
- Verification plan: `{{DRAFT_VERIFICATION_OUTPUT}}`
|
|
34
|
+
- Gate assessment: `{{DRAFT_GATE_OUTPUT}}`
|
|
35
|
+
- Decisions draft: `{{DRAFT_DECISIONS_OUTPUT}}`
|
|
36
|
+
- Task specs: directory `{{DRAFT_TASK_SPECS_DIR}}`
|
|
37
|
+
|
|
38
|
+
## Rules
|
|
39
|
+
|
|
40
|
+
- Each task must have a stable ID in the format `TXX-YYY`, where `XX` is the work-unit number when numeric.
|
|
41
|
+
- Each task must cite evidence from source documents with path and quote or line when possible.
|
|
42
|
+
- Each task must have objective acceptance criteria, approval scenarios mappable to tests, and required tests or checks.
|
|
43
|
+
- If a task involves schema, migration, auth, permission, tenant isolation, storage, token handling or security, mark it explicitly.
|
|
44
|
+
- If domain or scope ambiguity exists, record it in `gate-assessment.md` as requiring a human gate.
|
|
45
|
+
- Do not create tasks for items outside the work-unit scope unless explicitly justified as technical preparation.
|
|
46
|
+
- Prefer small, sequenced and verifiable tasks.
|
|
47
|
+
|
|
48
|
+
## Plan Format
|
|
49
|
+
|
|
50
|
+
`{{DRAFT_PLAN_OUTPUT}}` must contain:
|
|
51
|
+
|
|
52
|
+
```md
|
|
53
|
+
# {{WORK_UNIT_KEY}} Plan
|
|
54
|
+
|
|
55
|
+
## Status
|
|
56
|
+
|
|
57
|
+
Draft
|
|
58
|
+
|
|
59
|
+
## Source Documents Consulted
|
|
60
|
+
|
|
61
|
+
## Work Unit Scope
|
|
62
|
+
|
|
63
|
+
## Out Of Scope
|
|
64
|
+
|
|
65
|
+
## Assumptions
|
|
66
|
+
|
|
67
|
+
## Tasks
|
|
68
|
+
|
|
69
|
+
| Task | Title | Type | Depends On | Human Gate | Tests |
|
|
70
|
+
| --- | --- | --- | --- | --- | --- |
|
|
71
|
+
|
|
72
|
+
## Sequencing Rationale
|
|
73
|
+
|
|
74
|
+
## Risks
|
|
75
|
+
|
|
76
|
+
## Documentation Updates Expected
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Task Spec Format
|
|
80
|
+
|
|
81
|
+
Create one file per task in `{{DRAFT_TASK_SPECS_DIR}}`, named `<task-id>.md`:
|
|
82
|
+
|
|
83
|
+
```md
|
|
84
|
+
# <task-id>: <title>
|
|
85
|
+
|
|
86
|
+
## Goal
|
|
87
|
+
|
|
88
|
+
## Source Evidence
|
|
89
|
+
|
|
90
|
+
## Scope
|
|
91
|
+
|
|
92
|
+
## Out Of Scope
|
|
93
|
+
|
|
94
|
+
## Dependencies
|
|
95
|
+
|
|
96
|
+
## Implementation Requirements
|
|
97
|
+
|
|
98
|
+
## Data And Migration Impact
|
|
99
|
+
|
|
100
|
+
## Security, Tenant And Permission Considerations
|
|
101
|
+
|
|
102
|
+
## Error States
|
|
103
|
+
|
|
104
|
+
## Approval Scenarios
|
|
105
|
+
|
|
106
|
+
## Tests Required
|
|
107
|
+
|
|
108
|
+
## Documentation Impact
|
|
109
|
+
|
|
110
|
+
## Acceptance Checklist
|
|
111
|
+
|
|
112
|
+
## Human Gate
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Traceability Matrix Format
|
|
116
|
+
|
|
117
|
+
`{{DRAFT_TRACEABILITY_OUTPUT}}` must map:
|
|
118
|
+
|
|
119
|
+
```md
|
|
120
|
+
# {{WORK_UNIT_KEY}} Traceability Matrix
|
|
121
|
+
|
|
122
|
+
| Task | Domain Rule | Data Contract | Acceptance Criteria | Technical Decision | Test/Verification |
|
|
123
|
+
| --- | --- | --- | --- | --- | --- |
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Verification Plan Format
|
|
127
|
+
|
|
128
|
+
`{{DRAFT_VERIFICATION_OUTPUT}}` must list commands, expected automated tests, unavoidable manual checks and criteria for considering the work unit complete.
|
|
129
|
+
|
|
130
|
+
## Gate Assessment Format
|
|
131
|
+
|
|
132
|
+
`{{DRAFT_GATE_OUTPUT}}` must contain:
|
|
133
|
+
|
|
134
|
+
```md
|
|
135
|
+
# {{WORK_UNIT_KEY}} Gate Assessment
|
|
136
|
+
|
|
137
|
+
## Gate Recommendation
|
|
138
|
+
|
|
139
|
+
Human Required | Auto-Approvable
|
|
140
|
+
|
|
141
|
+
## Reasons
|
|
142
|
+
|
|
143
|
+
## Hard Gate Triggers
|
|
144
|
+
|
|
145
|
+
## Questions For Human Review
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Decisions Format
|
|
149
|
+
|
|
150
|
+
`{{DRAFT_DECISIONS_OUTPUT}}` must start the work-unit decision log with expected decisions or state that no decision has been made yet.
|
package/src/workflows/work-unit-implementation/templates/prompts/task-implementation-prompt.md
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
# Work-Unit Task Implementation
|
|
2
|
-
|
|
3
|
-
Run: `{{RUN_ID}}`
|
|
4
|
-
Work unit: `{{WORK_UNIT_KEY}}`
|
|
5
|
-
|
|
6
|
-
## Role
|
|
7
|
-
|
|
8
|
-
You are the task-by-task implementer. Use this prompt only after the approved work-unit plan has been published to `{{VERSIONED_WORK_UNIT_DIR}}` and the gate allows execution.
|
|
9
|
-
|
|
10
|
-
## Inputs
|
|
11
|
-
|
|
12
|
-
- Approved plan: `{{VERSIONED_WORK_UNIT_PLAN}}`
|
|
13
|
-
- Approved task specs: `{{VERSIONED_TASK_SPECS_DIR}}`
|
|
14
|
-
- Decision log: `{{VERSIONED_DECISION_LOG}}`
|
|
15
|
-
- Verification plan: `{{VERSIONED_VERIFICATION_PLAN}}`
|
|
16
|
-
|
|
17
|
-
## Rules
|
|
18
|
-
|
|
19
|
-
- Execute one task at a time, in approved plan order.
|
|
20
|
-
- Read the task spec before editing code.
|
|
21
|
-
- Use TDD for every code task: first list the task approval scenarios and create or update automated tests for those scenarios before changing production code.
|
|
22
|
-
- Run the new or changed tests before implementation when viable and record the expected failing evidence.
|
|
23
|
-
- Then implement the smallest production change required and run task tests/checks until green.
|
|
24
|
-
- If test-first automation is not viable, record the reason, substitute verification and deviation in the task log before implementing.
|
|
25
|
-
- Do not change task scope without recording a decision and pausing on hard gates.
|
|
26
|
-
- Run relevant task tests/checks.
|
|
27
|
-
- Update documentation when the task changes behavior, contract or decision.
|
|
28
|
-
- Record decisions in `{{VERSIONED_DECISION_LOG}}`.
|
|
29
|
-
- Write one task log per task to `{{TASK_LOG_DIR}}/<task-id>.md`.
|
|
30
|
-
- For correction after a `Needs Fix` review, update the same task log with a new correction iteration section before requesting another review.
|
|
31
|
-
- After each implementation or correction, the orchestrator must run the deterministic guard in `ReadyForReview` mode before requesting independent review.
|
|
32
|
-
- Do not advance to another task until the `ReadyForNextTask` guard passes for the current task.
|
|
33
|
-
|
|
34
|
-
## Task Log Format
|
|
35
|
-
|
|
36
|
-
```md
|
|
37
|
-
# <task-id> Implementation Log
|
|
38
|
-
|
|
39
|
-
## Summary
|
|
40
|
-
## TDD Scenarios
|
|
41
|
-
## Red Test Evidence
|
|
42
|
-
## Files Changed
|
|
43
|
-
## Tests Run
|
|
44
|
-
## Decisions Added
|
|
45
|
-
## Deviations From Spec
|
|
46
|
-
## Follow Ups
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Deterministic Guard
|
|
50
|
-
|
|
51
|
-
After writing or updating the task log, execute:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
wefter work-unit guard --run-id {{RUN_ID}} --task-id <task-id> --mode ReadyForReview
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
If the command fails, fix the log/state before requesting review.
|
|
1
|
+
# Work-Unit Task Implementation
|
|
2
|
+
|
|
3
|
+
Run: `{{RUN_ID}}`
|
|
4
|
+
Work unit: `{{WORK_UNIT_KEY}}`
|
|
5
|
+
|
|
6
|
+
## Role
|
|
7
|
+
|
|
8
|
+
You are the task-by-task implementer. Use this prompt only after the approved work-unit plan has been published to `{{VERSIONED_WORK_UNIT_DIR}}` and the gate allows execution.
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
|
|
12
|
+
- Approved plan: `{{VERSIONED_WORK_UNIT_PLAN}}`
|
|
13
|
+
- Approved task specs: `{{VERSIONED_TASK_SPECS_DIR}}`
|
|
14
|
+
- Decision log: `{{VERSIONED_DECISION_LOG}}`
|
|
15
|
+
- Verification plan: `{{VERSIONED_VERIFICATION_PLAN}}`
|
|
16
|
+
|
|
17
|
+
## Rules
|
|
18
|
+
|
|
19
|
+
- Execute one task at a time, in approved plan order.
|
|
20
|
+
- Read the task spec before editing code.
|
|
21
|
+
- Use TDD for every code task: first list the task approval scenarios and create or update automated tests for those scenarios before changing production code.
|
|
22
|
+
- Run the new or changed tests before implementation when viable and record the expected failing evidence.
|
|
23
|
+
- Then implement the smallest production change required and run task tests/checks until green.
|
|
24
|
+
- If test-first automation is not viable, record the reason, substitute verification and deviation in the task log before implementing.
|
|
25
|
+
- Do not change task scope without recording a decision and pausing on hard gates.
|
|
26
|
+
- Run relevant task tests/checks.
|
|
27
|
+
- Update documentation when the task changes behavior, contract or decision.
|
|
28
|
+
- Record decisions in `{{VERSIONED_DECISION_LOG}}`.
|
|
29
|
+
- Write one task log per task to `{{TASK_LOG_DIR}}/<task-id>.md`.
|
|
30
|
+
- For correction after a `Needs Fix` review, update the same task log with a new correction iteration section before requesting another review.
|
|
31
|
+
- After each implementation or correction, the orchestrator must run the deterministic guard in `ReadyForReview` mode before requesting independent review.
|
|
32
|
+
- Do not advance to another task until the `ReadyForNextTask` guard passes for the current task.
|
|
33
|
+
|
|
34
|
+
## Task Log Format
|
|
35
|
+
|
|
36
|
+
```md
|
|
37
|
+
# <task-id> Implementation Log
|
|
38
|
+
|
|
39
|
+
## Summary
|
|
40
|
+
## TDD Scenarios
|
|
41
|
+
## Red Test Evidence
|
|
42
|
+
## Files Changed
|
|
43
|
+
## Tests Run
|
|
44
|
+
## Decisions Added
|
|
45
|
+
## Deviations From Spec
|
|
46
|
+
## Follow Ups
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Deterministic Guard
|
|
50
|
+
|
|
51
|
+
After writing or updating the task log, execute:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
wefter work-unit guard --run-id {{RUN_ID}} --task-id <task-id> --mode ReadyForReview
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If the command fails, fix the log/state before requesting review.
|