@oscaner-skills/cdd-engine 1.0.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/LICENSE +21 -0
- package/README.md +52 -0
- package/README.zh-CN.md +54 -0
- package/dist/chunks/branch.mjs +480 -0
- package/dist/chunks/docs.mjs +253 -0
- package/dist/chunks/task.mjs +913 -0
- package/dist/cli.mjs +5457 -0
- package/dist/documents/schema/add-phase-protocol.json +126 -0
- package/dist/documents/schema/overall.json +361 -0
- package/dist/documents/schema/phase-spec.json +145 -0
- package/dist/documents/schema/plan.json +191 -0
- package/dist/documents/schema/skill-anatomy.json +233 -0
- package/dist/resources/harness-registry.json +49 -0
- package/dist/shared/cdd-engine.liioziig.mjs +184 -0
- package/package.json +51 -0
- package/templates/engine-config.json +302 -0
- package/templates/report/issue-body.json +204 -0
- package/templates/schema/cache-profile-schema.json +23 -0
- package/templates/schema/docs-handoff-schema.json +129 -0
- package/templates/schema/task-handoff-schema.json +332 -0
- package/templates/template-contract.json +231 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"components": [
|
|
3
|
+
"osuperpowers (general)",
|
|
4
|
+
"cdd-engine",
|
|
5
|
+
"osuperpowers:brainstorming",
|
|
6
|
+
"osuperpowers:writing-single-spec",
|
|
7
|
+
"osuperpowers:writing-overall-spec",
|
|
8
|
+
"osuperpowers:writing-phase-spec",
|
|
9
|
+
"osuperpowers:writing-plans",
|
|
10
|
+
"osuperpowers:cli-driven-development",
|
|
11
|
+
"osuperpowers:report-issues",
|
|
12
|
+
"osuperpowers:finishing"
|
|
13
|
+
],
|
|
14
|
+
"severities": [
|
|
15
|
+
"blocker",
|
|
16
|
+
"warn",
|
|
17
|
+
"nit"
|
|
18
|
+
],
|
|
19
|
+
"metaFields": [
|
|
20
|
+
{ "key": "skill", "label": "Skill" },
|
|
21
|
+
{ "key": "step", "label": "Step" }
|
|
22
|
+
],
|
|
23
|
+
"sectionLabels": {
|
|
24
|
+
"bug": {
|
|
25
|
+
"en": {
|
|
26
|
+
"context": "## Context",
|
|
27
|
+
"problem": "## Problem",
|
|
28
|
+
"impact": "## Impact",
|
|
29
|
+
"suggestedFix": "## Suggested fix"
|
|
30
|
+
},
|
|
31
|
+
"zh": {
|
|
32
|
+
"context": "## 背景",
|
|
33
|
+
"problem": "## 问题",
|
|
34
|
+
"impact": "## 影响",
|
|
35
|
+
"suggestedFix": "## 建议修复"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"enhancement": {
|
|
39
|
+
"en": {
|
|
40
|
+
"context": "## Context",
|
|
41
|
+
"problem": "## Current behavior",
|
|
42
|
+
"impact": "## Desired behavior",
|
|
43
|
+
"suggestedFix": "## Suggested approach"
|
|
44
|
+
},
|
|
45
|
+
"zh": {
|
|
46
|
+
"context": "## 背景",
|
|
47
|
+
"problem": "## 当前行为",
|
|
48
|
+
"impact": "## 期望行为",
|
|
49
|
+
"suggestedFix": "## 建议方案"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"formFieldDefs": {
|
|
54
|
+
"bug_report": {
|
|
55
|
+
"frontmatter": {
|
|
56
|
+
"name": "Bug report",
|
|
57
|
+
"description": "Report a bug found while using osuperpowers skills (dogfood)",
|
|
58
|
+
"labels": ["bug", "osuperpowers"]
|
|
59
|
+
},
|
|
60
|
+
"body": [
|
|
61
|
+
{
|
|
62
|
+
"type": "markdown",
|
|
63
|
+
"attributes": {
|
|
64
|
+
"value": "Use this template to report bugs found during dogfood use of osuperpowers skills.\n"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "dropdown",
|
|
69
|
+
"id": "component",
|
|
70
|
+
"attributes": {
|
|
71
|
+
"label": "Component",
|
|
72
|
+
"description": "Which component does this finding relate to?"
|
|
73
|
+
},
|
|
74
|
+
"validations": { "required": true }
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "textarea",
|
|
78
|
+
"id": "context",
|
|
79
|
+
"attributes": {
|
|
80
|
+
"label": "Context",
|
|
81
|
+
"description": "Dogfood session context: date, harness, which osuperpowers skills were in use",
|
|
82
|
+
"placeholder": "Date: YYYY-MM-DD, Harness: claude-code, Skills: cli-driven-development, writing-plans"
|
|
83
|
+
},
|
|
84
|
+
"validations": { "required": true }
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "textarea",
|
|
88
|
+
"id": "problem",
|
|
89
|
+
"attributes": {
|
|
90
|
+
"label": "Problem",
|
|
91
|
+
"description": "What happened? Include exact error messages or tool output where available."
|
|
92
|
+
},
|
|
93
|
+
"validations": { "required": true }
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"type": "textarea",
|
|
97
|
+
"id": "impact",
|
|
98
|
+
"attributes": {
|
|
99
|
+
"label": "Impact",
|
|
100
|
+
"description": "What did this block or degrade — token cost, extra rounds, incorrect state?"
|
|
101
|
+
},
|
|
102
|
+
"validations": { "required": true }
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"type": "textarea",
|
|
106
|
+
"id": "suggested-fix",
|
|
107
|
+
"attributes": {
|
|
108
|
+
"label": "Suggested fix",
|
|
109
|
+
"description": "Concrete suggestion, or leave as \"Under investigation\"",
|
|
110
|
+
"placeholder": "Under investigation"
|
|
111
|
+
},
|
|
112
|
+
"validations": { "required": false }
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"type": "textarea",
|
|
116
|
+
"id": "related",
|
|
117
|
+
"attributes": {
|
|
118
|
+
"label": "Related",
|
|
119
|
+
"description": "Links to related issues or commits, if known"
|
|
120
|
+
},
|
|
121
|
+
"validations": { "required": false }
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"enhancement": {
|
|
126
|
+
"frontmatter": {
|
|
127
|
+
"name": "Enhancement",
|
|
128
|
+
"description": "Suggest an improvement to osuperpowers skills or workflow",
|
|
129
|
+
"labels": ["enhancement", "osuperpowers"]
|
|
130
|
+
},
|
|
131
|
+
"body": [
|
|
132
|
+
{
|
|
133
|
+
"type": "markdown",
|
|
134
|
+
"attributes": {
|
|
135
|
+
"value": "Use this template to suggest improvements found during dogfood use of osuperpowers skills.\n"
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"type": "dropdown",
|
|
140
|
+
"id": "component",
|
|
141
|
+
"attributes": {
|
|
142
|
+
"label": "Component",
|
|
143
|
+
"description": "Which component does this finding relate to?"
|
|
144
|
+
},
|
|
145
|
+
"validations": { "required": true }
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"type": "textarea",
|
|
149
|
+
"id": "context",
|
|
150
|
+
"attributes": {
|
|
151
|
+
"label": "Context",
|
|
152
|
+
"description": "Dogfood session context: date, harness, which osuperpowers skills were in use",
|
|
153
|
+
"placeholder": "Date: YYYY-MM-DD, Harness: claude-code, Skills: cli-driven-development"
|
|
154
|
+
},
|
|
155
|
+
"validations": { "required": true }
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"type": "textarea",
|
|
159
|
+
"id": "current-behavior",
|
|
160
|
+
"attributes": {
|
|
161
|
+
"label": "Current behavior",
|
|
162
|
+
"description": "What happens today?"
|
|
163
|
+
},
|
|
164
|
+
"validations": { "required": true }
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"type": "textarea",
|
|
168
|
+
"id": "desired-behavior",
|
|
169
|
+
"attributes": {
|
|
170
|
+
"label": "Desired behavior",
|
|
171
|
+
"description": "What should happen instead?"
|
|
172
|
+
},
|
|
173
|
+
"validations": { "required": true }
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"type": "textarea",
|
|
177
|
+
"id": "suggested-approach",
|
|
178
|
+
"attributes": {
|
|
179
|
+
"label": "Suggested approach",
|
|
180
|
+
"description": "Concrete suggestion, or \"Open for discussion\"",
|
|
181
|
+
"placeholder": "Open for discussion"
|
|
182
|
+
},
|
|
183
|
+
"validations": { "required": false }
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "textarea",
|
|
187
|
+
"id": "related",
|
|
188
|
+
"attributes": {
|
|
189
|
+
"label": "Related",
|
|
190
|
+
"description": "Links to related issues or commits, if known"
|
|
191
|
+
},
|
|
192
|
+
"validations": { "required": false }
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"reportDef": {
|
|
198
|
+
"labels": ["osuperpowers", "cdd-engine"]
|
|
199
|
+
},
|
|
200
|
+
"masterDef": {
|
|
201
|
+
"sessionTitle": "## Session",
|
|
202
|
+
"harnessRow": "- Harness: <harness>"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "CDD harness cache profile (harness-registry.json#cache)",
|
|
4
|
+
"description": "Per-harness prompt-cache capability profile (spec D-3 C7). New harness = append a registry row + profile; capability is data, zero contract changes.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"required": ["mechanism", "minTokens"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"mechanism": {
|
|
9
|
+
"enum": ["explicit", "auto-prefix", "implicit"]
|
|
10
|
+
},
|
|
11
|
+
"minTokens": {
|
|
12
|
+
"oneOf": [
|
|
13
|
+
{ "type": "integer", "minimum": 1 },
|
|
14
|
+
{ "enum": ["pending"] }
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"readMultiplier": { "type": "number", "exclusiveMinimum": 0 },
|
|
18
|
+
"writeMultiplier": { "type": "number", "exclusiveMinimum": 0 },
|
|
19
|
+
"ttlMinutes": { "type": "integer", "minimum": 0 },
|
|
20
|
+
"observable": { "type": "boolean" }
|
|
21
|
+
},
|
|
22
|
+
"additionalProperties": false
|
|
23
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"description": "Docs-family handoff contract (spec / plan review + fix rounds; the docs-family shell + return constants live in template-contract.json#sections). Doc identity is doc_path + doc_hash; write findings, not status — the engine derives status from findings (review) or trusts the declared status (fix). Each property below documents its rule. Breaking change (engine major): the docs handoff carries the same lifecycle contract core as the task family — status gains TIMEOUT and commits{base,head} lands (the reverse of the legacy 'Docs rounds carry no commits field' declaration); docs consumers that relied on the commits-free docs handoff must migrate to the unified core.",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"required": ["phase", "findings", "artifacts", "doc_path"],
|
|
6
|
+
"properties": {
|
|
7
|
+
"phase": { "type": "string", "enum": ["review", "fix"], "description": "dispatch phase (review / fix); determined by the engine, not authored." },
|
|
8
|
+
"status": { "type": "string", "enum": ["APPROVED", "BLOCKED", "CHANGES_REQUESTED", "REVIEW_FIX", "TIMEOUT"], "description": "The round conclusion (this dispatch's terminal result) — APPROVED: done; CHANGES_REQUESTED: fix the findings (terminal conclusion of a review round; the fix loop runs as its own dispatch); REVIEW_FIX: the warn/nit-only review conclusion (收口态 — the review closed and its fix round routes the task to complete without a re-review, #278); BLOCKED: the round cannot proceed — the failure mechanism lives in failure_category, the reason in blocker; TIMEOUT: budget or liveness exceeded (engine-written attribution; the docs channel declares the same status enum as the task family). Orthogonal surfaces: failure_category (mechanism channel) and unverifiable[]/plan_conflicts[] (content-level notes) never fold into status. Review may omit this field — the engine derives it from findings; fix (work type) declares it and the engine passes it through. Write findings, not status." },
|
|
9
|
+
"failure_category": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"enum": [
|
|
12
|
+
"TIMEOUT",
|
|
13
|
+
"CONTRACT_VIOLATION",
|
|
14
|
+
"ENGINE_SELF_WRITTEN",
|
|
15
|
+
"EXECUTION_FAILURE",
|
|
16
|
+
"UNVERIFIABLE",
|
|
17
|
+
"PLAN_CONFLICT"
|
|
18
|
+
],
|
|
19
|
+
"description": "Failure mechanism channel — which mechanism ended the round (TIMEOUT / CONTRACT_VIOLATION / ENGINE_SELF_WRITTEN / EXECUTION_FAILURE / UNVERIFIABLE / PLAN_CONFLICT). Orthogonal to status (the round conclusion) and to the content-level unverifiable[]/plan_conflicts[] notes. Engine-written on failure paths. A BLOCKED round may satisfy its grounding via this field (see allOf)."
|
|
20
|
+
},
|
|
21
|
+
"commits": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"required": [
|
|
24
|
+
"base"
|
|
25
|
+
],
|
|
26
|
+
"description": "commit identity of the dispatch's review/fix range; the template-contract review range check at 13.5 validates it.",
|
|
27
|
+
"properties": {
|
|
28
|
+
"base": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"pattern": "^[0-9a-f]{40}$",
|
|
31
|
+
"description": "range base (TASK_BASE / FIXED_POINT): full 40-char SHA; never --short / %h / any truncated form."
|
|
32
|
+
},
|
|
33
|
+
"head": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^[0-9a-f]{40}$",
|
|
36
|
+
"description": "full 40-char SHA; never --short / %h / any truncated form. Optional — omitted when the round has no head yet (e.g. some BLOCKED branch-review payloads)."
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"doc_path": { "type": "string", "description": "the reviewed document's exact path — must match the doc argument, do not rewrite relative forms." },
|
|
41
|
+
"doc_hash": { "type": "string", "description": "content state token (sha256 of the doc at review time); legacy handoffs may omit it." },
|
|
42
|
+
"findings": { "type": "array", "description": "[{lens, severity, section|file, line?, summary, fix}] — every review finding; severity blocker → CHANGES_REQUESTED, warn/nit → REVIEW_FIX (review rolls up; fix keeps declared findings, #278)." },
|
|
43
|
+
"changes": {
|
|
44
|
+
"type": "array",
|
|
45
|
+
"items": {
|
|
46
|
+
"type": "object",
|
|
47
|
+
"required": ["file"],
|
|
48
|
+
"properties": {
|
|
49
|
+
"file": { "type": "string", "description": "repo-relative path of a file this round changed." },
|
|
50
|
+
"reason": { "type": "string", "description": "why the file changed (finding id / fix intent); omitted entries stay attributed by file." }
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"description": "Changed-file attribution ledger (fix rounds declare every file the round touched, each with its reason). The engine reconciles `git diff <base>..HEAD` against it — files off the ledger are surfaced (warn + notes), never blocked; the review scope axis judges them as findings. The docs commitment boundary is the same as the task family (commits{base,head}), not doc_path alone."
|
|
54
|
+
},
|
|
55
|
+
"recovery": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"required": ["cause"],
|
|
58
|
+
"properties": {
|
|
59
|
+
"cause": { "type": "string", "description": "round-end cause: the failure-category id (EXECUTION_FAILURE / TIMEOUT — the residue-preservation eligibility set) on engine-written death carriers, or the termination sub-cause on legacy salvage records." },
|
|
60
|
+
"exit_code": { "type": "integer", "description": "the failed agent's process exit code (1 = run failure, 143 = SIGTERM) — the archived death diagnosis distinguishing exit 1 vs 143; absent on TIMEOUT rounds (the monitor killed the process)." },
|
|
61
|
+
"residue_ref": { "type": "string", "description": "Salvaged-WIP stash commit SHA (index-independent: `stash@{N}` indices shift on every push/drop). Written by the residue settlement step on eligible EXECUTION_FAILURE/TIMEOUT rounds with a dirty tree; the re-dispatch resume pre-flight reads it and `git stash apply`s it. Settlement output ≡ resume input." },
|
|
62
|
+
"wip_stat": { "type": "object", "required": ["files", "insertions", "deletions"], "properties": { "files": { "type": "integer" }, "insertions": { "type": "integer" }, "deletions": { "type": "integer" } }, "description": "structured WIP scale (files / +M / -M) at salvage time — the recovery carrier's archivable magnitude beside residue_ref; counts brand-new untracked files too." },
|
|
63
|
+
"preserved": { "type": "boolean", "description": "true when the round's residue was stashed into the recovery carrier (residue_ref + wip_stat present); the settlement step's idempotence flag — an already-preserved carrier never double-stashes." },
|
|
64
|
+
"stash_message": { "type": "string", "description": "The standardized stash name `cdd-<op>-<type>-<task>-r<round>-<cause>` (src/artifacts/residue.ts single source) — the legacy stash-list scan matches on it for pre-schema carriers." },
|
|
65
|
+
"residue_scope": { "type": "string", "description": "WIP scope summary (`git diff HEAD --shortstat`) — data-driven input for the resume brief appendix." },
|
|
66
|
+
"round": { "type": "integer", "minimum": 1, "description": "the salvaged round number (implement rounds are always round 1)." },
|
|
67
|
+
"scope_base": { "type": "string", "pattern": "^[0-9a-f]{40}$", "description": "The round-level scope anchor at salvage time (ledger value priority / fallback dead-round brief TASK_BASE). Resume restores the same anchor — the round-BASE (resume-declared) adoption and the recovered scope stay consistent across round death." }
|
|
68
|
+
},
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"description": "Residue recovery carrier — engine-written on EXECUTION_FAILURE/TIMEOUT failure rounds: cause + exit_code ride every death (the archived, replayable diagnosis); residue_ref / wip_stat / preserved appear once the settlement step stashed the dirty-tree WIP. Absent on all other rounds. Same law as every structured field: the facts live here, the blocker stays human-readable prose."
|
|
71
|
+
},
|
|
72
|
+
"artifacts": { "type": "object", "description": "point at files, do not embed report bodies — values are paths (e.g. {\"doc\": \"<path>\"}), never inline content." },
|
|
73
|
+
"round": { "type": "integer", "description": "review/fix round number (engine-derived; canonical naming embeds it in the filename)." },
|
|
74
|
+
"unverifiable": {
|
|
75
|
+
"type": "array",
|
|
76
|
+
"description": "Content-level notes — each entry states one claim the round could not verify (what + why: e.g. {claim, why}). A non-empty list makes the round BLOCKED with failure_category UNVERIFIABLE and a blocker summarizing the entries. Dev-measured acceptance items (plan-constraints §口径) are NOT unverifiable: an evidence-contract accepted-noted round records them in `notes`, never writes unverifiable and never blocks."
|
|
77
|
+
},
|
|
78
|
+
"plan_conflicts": {
|
|
79
|
+
"type": "array",
|
|
80
|
+
"description": "Content-level notes — each entry states one plan conflict discovered during the round. A non-empty list makes the round BLOCKED with failure_category PLAN_CONFLICT and a blocker summarizing the entries."
|
|
81
|
+
},
|
|
82
|
+
"blocker": { "type": "string", "description": "The round's single real blocker line — states what could not be verified and why, or the concrete reason the round cannot proceed. Real sources only (agent-declared / engine gate reason / failure mechanism / unverifiable summary); never fabricated. Omit when nothing blocks (NOT null) — null is invalid. BLOCKED requires a non-empty blocker or a failure_category (see allOf)." }
|
|
83
|
+
},
|
|
84
|
+
"allOf": [
|
|
85
|
+
{
|
|
86
|
+
"if": {
|
|
87
|
+
"properties": {
|
|
88
|
+
"phase": {
|
|
89
|
+
"const": "review"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"required": ["phase"]
|
|
93
|
+
},
|
|
94
|
+
"then": {
|
|
95
|
+
"required": []
|
|
96
|
+
},
|
|
97
|
+
"else": {
|
|
98
|
+
"required": ["status"]
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"if": {
|
|
103
|
+
"properties": {
|
|
104
|
+
"status": {
|
|
105
|
+
"const": "BLOCKED"
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"required": ["status"]
|
|
109
|
+
},
|
|
110
|
+
"then": {
|
|
111
|
+
"anyOf": [
|
|
112
|
+
{
|
|
113
|
+
"required": ["blocker"],
|
|
114
|
+
"properties": {
|
|
115
|
+
"blocker": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"minLength": 1
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"required": ["failure_category"]
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
],
|
|
128
|
+
"additionalProperties": false
|
|
129
|
+
}
|