dic-workflow-kit 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/.codex-plugin/plugin.json +37 -0
- package/INSTRUCTION.md +82 -0
- package/README.md +202 -0
- package/README.zh-CN.md +172 -0
- package/adapters/contest/README.md +13 -0
- package/adapters/generic/README.md +18 -0
- package/adapters/openspec/README.md +24 -0
- package/agents/code-repairer.md +17 -0
- package/agents/contract-oracle.md +17 -0
- package/agents/final-reviewer.md +19 -0
- package/agents/flow-auditor.md +15 -0
- package/agents/impl-inspector.md +15 -0
- package/agents/profile-builder.md +17 -0
- package/agents/repair-planner.md +17 -0
- package/agents/spec-reader.md +23 -0
- package/agents/validation-runner.md +16 -0
- package/bin/dic-workflow-kit.mjs +150 -0
- package/package.json +45 -0
- package/schemas/agent-handoff.schema.json +20 -0
- package/schemas/contract-obligations.schema.json +55 -0
- package/schemas/final-result.schema.json +18 -0
- package/schemas/project-profile.schema.json +66 -0
- package/scripts/dic_workflow.py +507 -0
- package/skills/knowledge-bdd/SKILL.md +22 -0
- package/skills/knowledge-openspec/SKILL.md +29 -0
- package/skills/knowledge-repair-distill/SKILL.md +26 -0
- package/skills/workflow-core/SKILL.md +29 -0
- package/skills/workflow-intake/SKILL.md +25 -0
- package/skills/workflow-profile/SKILL.md +24 -0
- package/skills/workflow-repair/SKILL.md +22 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dic-workflow-kit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Design-implementation consistency workflow with OpenSpec obligations, BDD knowledge, Skills, and Subagents.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "TonyClaw"
|
|
7
|
+
},
|
|
8
|
+
"repository": "https://gitcode.com/TonyClaw/DICWorkflowKit",
|
|
9
|
+
"license": "UNLICENSED",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"codex",
|
|
12
|
+
"openspec",
|
|
13
|
+
"design-consistency",
|
|
14
|
+
"multi-agent",
|
|
15
|
+
"bdd"
|
|
16
|
+
],
|
|
17
|
+
"skills": "./skills/",
|
|
18
|
+
"interface": {
|
|
19
|
+
"displayName": "DIC Workflow Kit",
|
|
20
|
+
"shortDescription": "Design-to-code consistency workflow",
|
|
21
|
+
"longDescription": "Auditable OpenSpec intake, obligation extraction, implementation inspection, repair planning, validation, Skills, and bounded Subagent handoffs.",
|
|
22
|
+
"developerName": "TonyClaw",
|
|
23
|
+
"category": "Developer Tools",
|
|
24
|
+
"capabilities": [
|
|
25
|
+
"Read",
|
|
26
|
+
"Write",
|
|
27
|
+
"Validation",
|
|
28
|
+
"Subagents"
|
|
29
|
+
],
|
|
30
|
+
"defaultPrompt": [
|
|
31
|
+
"Check this OpenSpec change against implementation and tests.",
|
|
32
|
+
"Build an obligation matrix for this design change.",
|
|
33
|
+
"Repair design-to-code inconsistencies with evidence."
|
|
34
|
+
],
|
|
35
|
+
"brandColor": "#C7000B"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/INSTRUCTION.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Design-Implementation Consistency Workflow
|
|
2
|
+
|
|
3
|
+
Use this workflow when a Coding Agent must check or repair whether implementation matches design intent.
|
|
4
|
+
|
|
5
|
+
This instruction is generic. It must not assume a contest, language, framework, directory name, agent host, or operating system.
|
|
6
|
+
|
|
7
|
+
## Core Contract
|
|
8
|
+
|
|
9
|
+
- Work autonomously when invoked by an automated runner.
|
|
10
|
+
- Resolve the workflow root from the directory containing this `INSTRUCTION.md`.
|
|
11
|
+
- Resolve the project root from the workflow root, adapter config, or repository evidence.
|
|
12
|
+
- Treat design/spec/API/schema/config/README sources as stronger than existing implementation.
|
|
13
|
+
- Treat public examples and tests as smoke signals, not the full design surface.
|
|
14
|
+
- Do not edit protected design sources unless explicitly instructed.
|
|
15
|
+
- Write intermediate evidence under `logs/trace/`.
|
|
16
|
+
- Write final evidence under `reports/` and `result/`.
|
|
17
|
+
|
|
18
|
+
## Default Stages
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
workflow-intake
|
|
22
|
+
-> workflow-profile
|
|
23
|
+
-> spec-reader
|
|
24
|
+
-> profile-builder
|
|
25
|
+
-> contract-oracle
|
|
26
|
+
-> flow-auditor
|
|
27
|
+
-> impl-inspector
|
|
28
|
+
-> repair-planner
|
|
29
|
+
-> code-repairer
|
|
30
|
+
-> validation-runner
|
|
31
|
+
-> final-reviewer
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Required Evidence
|
|
35
|
+
|
|
36
|
+
At minimum, produce:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
reports/project-profile.json
|
|
40
|
+
reports/contract-obligations.json
|
|
41
|
+
reports/contract-obligations.md
|
|
42
|
+
reports/final-consistency-report.md
|
|
43
|
+
reports/FINAL_RESULT.json
|
|
44
|
+
result/output.md
|
|
45
|
+
logs/trace/
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
If a helper or external tool is unavailable, record the exact blocker and continue with the smallest source-backed fallback.
|
|
49
|
+
|
|
50
|
+
## Subagent Economy
|
|
51
|
+
|
|
52
|
+
Subagents are useful only when they produce bounded, auditable artifacts. Before delegating, record:
|
|
53
|
+
|
|
54
|
+
- why the subagent is needed
|
|
55
|
+
- bounded inputs
|
|
56
|
+
- expected artifact
|
|
57
|
+
- local budget
|
|
58
|
+
- fallback route
|
|
59
|
+
- acceptance check
|
|
60
|
+
|
|
61
|
+
Do not launch a subagent only to produce chat summaries. If a handoff has no trace artifact, output, decision, validation summary, repair queue item, or terminal blocker, treat it as ineffective delegation and recover locally.
|
|
62
|
+
|
|
63
|
+
## OpenSpec Rule
|
|
64
|
+
|
|
65
|
+
If OpenSpec files are present, use `knowledge-openspec` before repair planning. Confirm:
|
|
66
|
+
|
|
67
|
+
- proposal intent is reflected in specs
|
|
68
|
+
- spec scenarios are mapped to implementation and tests
|
|
69
|
+
- tasks are completed or terminally classified
|
|
70
|
+
- archived specs do not override current specs
|
|
71
|
+
- implementation does not silently exceed or contradict the accepted design
|
|
72
|
+
|
|
73
|
+
## Final Status
|
|
74
|
+
|
|
75
|
+
Use one of:
|
|
76
|
+
|
|
77
|
+
- `PASS`
|
|
78
|
+
- `PARTIAL`
|
|
79
|
+
- `BLOCKED`
|
|
80
|
+
- `FAIL`
|
|
81
|
+
|
|
82
|
+
Do not use `SUCCESS`, `DONE`, or informal status labels in final machine-readable output.
|
package/README.md
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
# Design-Implementation Consistency Workflow Kit
|
|
2
|
+
|
|
3
|
+
Version: `1.0.0`
|
|
4
|
+
|
|
5
|
+
Design-Implementation Consistency Workflow Kit, or DIC Workflow Kit, is a portable agentic workflow package for checking and repairing whether implementation matches design intent.
|
|
6
|
+
|
|
7
|
+
It is designed for teams that use OpenSpec, design documents, API contracts, schemas, or product requirements before asking Coding Agents to implement code. The kit turns that process into an auditable workflow: read source truth, map design to implementation, inspect gaps, plan small repairs, validate evidence, and produce final consistency reports.
|
|
8
|
+
|
|
9
|
+
The kit is not tied to one contest, one repository, one language stack, or one agent host. It can be installed into OpenCode, referenced by Claude Code, used from Codex, or adapted by another coding-agent runner.
|
|
10
|
+
|
|
11
|
+
> The differentiator is not the number of agents. DIC Workflow Kit uses design intent, typed handoffs, project profiles, validation evidence, and residual-risk reporting to prove that implementation remains aligned with its design contract.
|
|
12
|
+
|
|
13
|
+
## Install in Codex with npm
|
|
14
|
+
|
|
15
|
+
The npm package contains all seven Skills and all nine Subagents. Install it into the default personal Codex plugin marketplace with:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
npx dic-workflow-kit install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or install the CLI globally:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
npm install --global dic-workflow-kit
|
|
25
|
+
dic-workflow-kit install
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Before the package is published to the npm registry, install the same CLI directly from the repository:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
npm install --global git+ssh://git@gitcode.com/TonyClaw/DICWorkflowKit.git
|
|
32
|
+
dic-workflow-kit install
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The installer writes the plugin to `~/.agents/plugins/plugins/dic-workflow-kit` and registers it in `~/.agents/plugins/marketplace.json`. It preserves unrelated entries and replaces only the entry with the same plugin name.
|
|
36
|
+
|
|
37
|
+
Use `npx dic-workflow-kit install --dry-run` to preview the destination, or `--marketplace-root /path/to/.agents/plugins` for an isolated environment. Start a new Codex task after installation so its Skills and Subagents are discovered.
|
|
38
|
+
|
|
39
|
+
For a defense-oriented walkthrough of the project claims and their code evidence, see [答辩引导:项目特点与代码证据](docs/答辩引导-项目特点与代码证据.md).
|
|
40
|
+
|
|
41
|
+
## Why This Exists
|
|
42
|
+
|
|
43
|
+
Coding Agents are good at changing code, but they often optimize for local green tests, visible examples, or the latest error message. In design-first projects, especially OpenSpec projects, the harder question is different:
|
|
44
|
+
|
|
45
|
+
> Does the implementation still match the design contract?
|
|
46
|
+
|
|
47
|
+
DIC Workflow Kit answers that question with a repeatable workflow:
|
|
48
|
+
|
|
49
|
+
1. Identify authoritative design sources.
|
|
50
|
+
2. Build a project profile.
|
|
51
|
+
3. Map design requirements to implementation areas.
|
|
52
|
+
4. Inspect implementation gaps.
|
|
53
|
+
5. Plan small source-backed repair slices.
|
|
54
|
+
6. Validate with project-declared commands.
|
|
55
|
+
7. Record evidence, residual risks, and final artifacts.
|
|
56
|
+
|
|
57
|
+
## Repository Layout
|
|
58
|
+
|
|
59
|
+
| Path | Purpose |
|
|
60
|
+
| --- | --- |
|
|
61
|
+
| `INSTRUCTION.md` | Generic operating manual for autonomous design-implementation consistency work. |
|
|
62
|
+
| `skills/` | Installable Skills: workflow controls and reusable knowledge packs. |
|
|
63
|
+
| `agents/` | Installable Agent prompts: bounded roles for evidence production and repair flow. |
|
|
64
|
+
| `adapters/` | Optional adapters for OpenSpec, generic repos, contests, and stack-specific environments. |
|
|
65
|
+
| `schemas/` | Stable JSON schemas for project profile, handoff, and final evidence artifacts. |
|
|
66
|
+
| `scripts/` | Portable Python standard-library helpers. |
|
|
67
|
+
| `examples/` | Small examples showing how to apply the kit to different project styles. |
|
|
68
|
+
|
|
69
|
+
## Skills in Workflow Order
|
|
70
|
+
|
|
71
|
+
Skills are listed by the point at which they first participate in the default workflow. Knowledge Skills are conditional: load them only when repository evidence or the current stage requires them.
|
|
72
|
+
|
|
73
|
+
| Order | Skill | Type | Workflow Position | Core Role |
|
|
74
|
+
| --- | --- | --- | --- | --- |
|
|
75
|
+
| 00 | `workflow-core` | Workflow mechanism | Entire run | Defines source priority, evidence rules, typed handoffs, final statuses, and durable output contracts. |
|
|
76
|
+
| 01 | `workflow-intake` | Workflow method | Before Subagents | Finds design sources, implementation roots, test roots, protected paths, validation commands, and adapter hints. |
|
|
77
|
+
| 02 | `workflow-profile` | Workflow method | Before Subagents | Normalizes intake evidence into the project profile consumed by every downstream role. |
|
|
78
|
+
| 03 | `knowledge-openspec` | Knowledge pack | During source reading, if OpenSpec is detected | Interprets proposals, designs, specs, scenarios, tasks, active changes, and archived capabilities. |
|
|
79
|
+
| 04 | `knowledge-bdd` | Knowledge pack | After obligations are confirmed, when behavior coverage is needed | Derives Given-When-Then acceptance scenarios from confirmed design rules and flow contracts. |
|
|
80
|
+
| 05 | `workflow-repair` | Workflow method | Audit through final review | Controls source-backed inspection, repair planning, minimal code changes, validation loops, and evidence updates. |
|
|
81
|
+
| 06 | `knowledge-repair-distill` | Knowledge pack | During repair planning or when execution drifts | Supplies gap taxonomy, convergence guidance, model-steering hints, and validation gates. |
|
|
82
|
+
|
|
83
|
+
## Subagents in Execution Order
|
|
84
|
+
|
|
85
|
+
Each Subagent appears in its default execution order. A stage may be skipped only with evidence, and a Subagent is useful only when its output is consumed by the next decision.
|
|
86
|
+
|
|
87
|
+
| Step | Subagent | Phase | Consumes | Produces |
|
|
88
|
+
| --- | --- | --- | --- | --- |
|
|
89
|
+
| 01 | `spec-reader` | Source truth | Project profile and authoritative design sources | Source-backed requirement brief, source anchors, protected paths, unresolved questions |
|
|
90
|
+
| 02 | `profile-builder` | Project profile confirmation | Intake evidence and repository structure | `reports/project-profile.json` |
|
|
91
|
+
| 03 | `contract-oracle` | Obligation mapping | Confirmed requirements, scenarios, and feedback hypotheses | Source-confirmed obligation queue |
|
|
92
|
+
| 04 | `flow-auditor` | Flow completeness | Obligation queue and optional BDD scenarios | Lifecycle, transition, branch, side-effect, and integration-flow audit |
|
|
93
|
+
| 05 | `impl-inspector` | Implementation inspection | Confirmed obligations and flow audit | Source-backed implementation gap report; no code edits |
|
|
94
|
+
| 06 | `repair-planner` | Repair planning | Gap report, protected paths, and available validation commands | Small repair slices with source anchors, stop conditions, and fallback routes |
|
|
95
|
+
| 07 | `code-repairer` | Code repair | Approved repair slices | Minimal code changes, changed-file evidence, and repair notes |
|
|
96
|
+
| 08 | `validation-runner` | Validation | Project-declared commands and changed implementation | Evaluator-readable validation logs and summaries under `logs/trace/validation/` |
|
|
97
|
+
| 09 | `final-reviewer` | Final gate | All prior evidence, changed files, validation, and output artifacts | Final consistency decision, residual risks, and result recommendation |
|
|
98
|
+
|
|
99
|
+
## Default Workflow
|
|
100
|
+
|
|
101
|
+
```text
|
|
102
|
+
workflow-core
|
|
103
|
+
-> workflow-intake
|
|
104
|
+
-> workflow-profile
|
|
105
|
+
-> [knowledge-openspec, when detected]
|
|
106
|
+
-> spec-reader
|
|
107
|
+
-> profile-builder
|
|
108
|
+
-> contract-oracle
|
|
109
|
+
-> [knowledge-bdd, when behavior coverage is needed]
|
|
110
|
+
-> workflow-repair
|
|
111
|
+
-> flow-auditor
|
|
112
|
+
-> impl-inspector
|
|
113
|
+
-> [knowledge-repair-distill, when planning or drift requires it]
|
|
114
|
+
-> repair-planner
|
|
115
|
+
-> code-repairer
|
|
116
|
+
-> validation-runner
|
|
117
|
+
-> final-reviewer
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The same flow can be read as four evidence gates:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
DISCOVER
|
|
124
|
+
workflow-intake
|
|
125
|
+
-> workflow-profile
|
|
126
|
+
|
|
127
|
+
UNDERSTAND
|
|
128
|
+
-> spec-reader
|
|
129
|
+
-> profile-builder
|
|
130
|
+
-> contract-oracle
|
|
131
|
+
|
|
132
|
+
INSPECT + REPAIR
|
|
133
|
+
-> flow-auditor
|
|
134
|
+
-> impl-inspector
|
|
135
|
+
-> repair-planner
|
|
136
|
+
-> code-repairer
|
|
137
|
+
|
|
138
|
+
VERIFY
|
|
139
|
+
-> validation-runner
|
|
140
|
+
-> final-reviewer
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
This chain is intentionally evidence-first. Skills provide workflow controls or stage-specific knowledge; Subagents consume bounded inputs and produce typed evidence. A workflow with fewer strong handoffs is better than a decorative chain of agents with no consumed evidence.
|
|
144
|
+
|
|
145
|
+
## OpenSpec Focus
|
|
146
|
+
|
|
147
|
+
For OpenSpec projects, the kit treats these as first-class design sources:
|
|
148
|
+
|
|
149
|
+
| OpenSpec Source | How It Is Used |
|
|
150
|
+
| --- | --- |
|
|
151
|
+
| `openspec/specs/**/spec.md` | Stable capability requirements and scenarios. |
|
|
152
|
+
| `openspec/changes/**/proposal.md` | Intent behind a planned change. |
|
|
153
|
+
| `openspec/changes/**/design.md` | Technical design rationale and constraints. |
|
|
154
|
+
| `openspec/changes/**/tasks.md` | Implementation checklist and completion evidence. |
|
|
155
|
+
| `openspec/changes/**/specs/**/spec.md` | Delta requirements and scenarios for active changes. |
|
|
156
|
+
| Archived specs | Historical context, never stronger than current active specs. |
|
|
157
|
+
|
|
158
|
+
The kit checks whether proposals, specs, scenarios, and tasks were actually reflected in implementation and tests.
|
|
159
|
+
|
|
160
|
+
To scope intake to one OpenSpec Change, pass its identifier explicitly. Active changes are preferred; if no active match exists, the archived location is resolved and recorded in the profile. Keep evidence outside the target repository with `--output-root`:
|
|
161
|
+
|
|
162
|
+
```text
|
|
163
|
+
python scripts/dic_workflow.py \
|
|
164
|
+
--root /path/to/project \
|
|
165
|
+
--output-root /path/to/evidence \
|
|
166
|
+
init --change 2026-06-09-add-ts-local-skill-source
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The resulting profile records the Change lifecycle, proposal/design/tasks documents, delta specs, and matching promoted baseline specs. When `openspec/designs/spec-to-design-map.md` contains the capability, the profile also mounts its architecture designs, module designs, ADRs, validation summary, and executable command suggestions. Archived change-specific validation commands are omitted because their active Change target no longer exists.
|
|
170
|
+
|
|
171
|
+
## Output Contract
|
|
172
|
+
|
|
173
|
+
By default, a run should produce artifacts relative to the selected submission/workflow root:
|
|
174
|
+
|
|
175
|
+
```text
|
|
176
|
+
reports/project-profile.json
|
|
177
|
+
reports/contract-obligations.json
|
|
178
|
+
reports/contract-obligations.md
|
|
179
|
+
reports/implementation-gaps.md
|
|
180
|
+
reports/repair-plan.md
|
|
181
|
+
reports/final-consistency-report.md
|
|
182
|
+
reports/FINAL_RESULT.json
|
|
183
|
+
result/output.md
|
|
184
|
+
logs/trace/
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
For an explicit OpenSpec Change, `init` generates both obligation artifacts automatically. Requirements and Scenarios receive stable IDs, source line references, authority labels, parent relationships, and structured Given/When/Then clauses. Active changes use delta specs as authority; archived changes use the promoted current baseline so historical text cannot override current design truth.
|
|
188
|
+
|
|
189
|
+
Adapters can change or extend this contract. For example, a contest adapter may require a fixed `result/output.md`, while an internal CI adapter may publish JSON evidence to an artifact store.
|
|
190
|
+
|
|
191
|
+
## Portability Rules
|
|
192
|
+
|
|
193
|
+
- Do not hardcode local absolute paths.
|
|
194
|
+
- Do not assume Windows, Linux, macOS, PowerShell, Bash, or `cmd`.
|
|
195
|
+
- Resolve paths from the active `INSTRUCTION.md`, project profile, or adapter configuration.
|
|
196
|
+
- Use Python standard library only for helper scripts.
|
|
197
|
+
- Resolve external tools such as `git`, `mvn`, `npm`, `pnpm`, `pytest`, or `openspec` from the target environment `PATH` only when needed.
|
|
198
|
+
- Treat missing external tools as environment evidence, not as design failure.
|
|
199
|
+
|
|
200
|
+
## Status
|
|
201
|
+
|
|
202
|
+
This repository currently contains the first generalized scaffold extracted from a contest-specific design-implementation repair workflow. It is intended to become the reusable upstream kit for future OpenSpec and design-first Coding Agent workflows.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# 设计—实现一致性 Workflow Kit
|
|
2
|
+
|
|
3
|
+
版本:`1.0.0`
|
|
4
|
+
|
|
5
|
+
Design-Implementation Consistency Workflow Kit,简称 DIC Workflow Kit,是一套可移植的智能体工作流包,用于检查和修复“代码实现是否符合设计意图”。
|
|
6
|
+
|
|
7
|
+
它面向 OpenSpec、设计文档、API 契约、Schema 或产品需求先行的项目。工作流从权威设计源出发,建立项目画像,映射设计与实现,识别缺口,执行小步修复,运行项目声明的验证命令,并输出可审计的一致性证据。
|
|
8
|
+
|
|
9
|
+
> 项目的差异不在 Agent 数量。DIC Workflow Kit 通过设计意图、类型化交接、项目画像、验证证据和残余风险报告,证明实现仍然符合设计契约。
|
|
10
|
+
|
|
11
|
+
## 通过 npm 安装到 Codex
|
|
12
|
+
|
|
13
|
+
npm 包完整包含 7 个 Skills 和 9 个 Subagents:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
npx dic-workflow-kit install
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
也可以先全局安装 CLI:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
npm install --global dic-workflow-kit
|
|
23
|
+
dic-workflow-kit install
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
在 npm registry 正式发布前,可以直接从仓库安装同一个 CLI:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
npm install --global git+ssh://git@gitcode.com/TonyClaw/DICWorkflowKit.git
|
|
30
|
+
dic-workflow-kit install
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
默认安装到 `~/.agents/plugins/plugins/dic-workflow-kit`,并在 `~/.agents/plugins/marketplace.json` 中注册。安装器会保留其他 marketplace 条目,只更新同名插件。使用 `--dry-run` 预演,或使用 `--marketplace-root` 指定隔离目录。安装后请新建 Codex 任务,以重新发现 Skills 和 Subagents。
|
|
34
|
+
|
|
35
|
+
答辩时如何讲解项目特点并定位代码证据,请参考[《答辩引导:项目特点与代码证据》](docs/答辩引导-项目特点与代码证据.md)。
|
|
36
|
+
|
|
37
|
+
## 为什么需要它
|
|
38
|
+
|
|
39
|
+
Coding Agent 很擅长修改代码,但容易围绕局部报错、公开样例或最近一次失败进行优化。对于设计先行的项目,更重要的问题是:
|
|
40
|
+
|
|
41
|
+
> 当前实现是否仍然满足已确认的设计契约?
|
|
42
|
+
|
|
43
|
+
DIC Workflow Kit 将这个问题转换为一条可重复执行的证据链:
|
|
44
|
+
|
|
45
|
+
1. 定位权威设计源。
|
|
46
|
+
2. 生成项目画像。
|
|
47
|
+
3. 建立设计要求与实现区域的映射。
|
|
48
|
+
4. 审计流程与实现缺口。
|
|
49
|
+
5. 规划有来源依据的小修复。
|
|
50
|
+
6. 使用项目声明的命令验证。
|
|
51
|
+
7. 记录证据、变更文件、残余风险和最终产物。
|
|
52
|
+
|
|
53
|
+
## 目录结构
|
|
54
|
+
|
|
55
|
+
| 路径 | 作用 |
|
|
56
|
+
| --- | --- |
|
|
57
|
+
| `INSTRUCTION.md` | 通用执行契约,定义设计—实现一致性工作流。 |
|
|
58
|
+
| `skills/` | 工作流控制 Skill 和可插拔知识包。 |
|
|
59
|
+
| `agents/` | 按阶段工作的 Subagent,负责生产和消费证据。 |
|
|
60
|
+
| `adapters/` | OpenSpec、通用仓库、比赛环境等适配层。 |
|
|
61
|
+
| `schemas/` | 项目画像、Agent 交接和最终结果的 JSON Schema。 |
|
|
62
|
+
| `scripts/` | 仅依赖 Python 标准库的辅助脚本。 |
|
|
63
|
+
| `examples/` | 不同项目形态的使用示例。 |
|
|
64
|
+
|
|
65
|
+
## Skills:按工作流加载顺序
|
|
66
|
+
|
|
67
|
+
下表按照 Skill 第一次介入默认流程的位置排列。Knowledge Skill 是条件加载项:只有项目证据或当前阶段需要时才挂载。
|
|
68
|
+
|
|
69
|
+
| 顺序 | Skill | 类型 | 介入阶段 | 主要作用 |
|
|
70
|
+
| --- | --- | --- | --- | --- |
|
|
71
|
+
| 00 | `workflow-core` | 工作流机制 | 全流程 | 定义事实源优先级、证据规则、Handoff、最终状态和产物契约。 |
|
|
72
|
+
| 01 | `workflow-intake` | 工作流方法 | Subagent 启动前 | 识别设计源、实现目录、测试目录、保护路径、验证命令和 Adapter 线索。 |
|
|
73
|
+
| 02 | `workflow-profile` | 工作流方法 | Subagent 启动前 | 将 Intake 证据规范化为所有下游角色共同消费的项目画像。 |
|
|
74
|
+
| 03 | `knowledge-openspec` | 知识包 | 读取设计源时;检测到 OpenSpec 才加载 | 理解 proposal、design、spec、scenario、task、active change 和 archived capability。 |
|
|
75
|
+
| 04 | `knowledge-bdd` | 知识包 | 契约确认后;需要行为覆盖时 | 从已确认设计规则和流程契约生成 Given–When–Then 验收场景。 |
|
|
76
|
+
| 05 | `workflow-repair` | 工作流方法 | 审计、修复与最终审核阶段 | 控制有来源的检查、修复计划、最小变更、验证循环和证据更新。 |
|
|
77
|
+
| 06 | `knowledge-repair-distill` | 知识包 | 修复规划或模型跑偏时 | 提供缺口分类、收敛策略、模型引导提示和验证门槛。 |
|
|
78
|
+
|
|
79
|
+
## Subagents:按实际执行顺序
|
|
80
|
+
|
|
81
|
+
每个 Subagent 都按默认执行顺序排列。只有留下证据时才能跳过某个阶段;只有产物被下一步消费时,该次委派才算有效。
|
|
82
|
+
|
|
83
|
+
| 步骤 | Subagent | 阶段 | 消费的输入 | 主要产物 |
|
|
84
|
+
| --- | --- | --- | --- | --- |
|
|
85
|
+
| 01 | `spec-reader` | 事实源读取 | 项目画像和权威设计源 | 带文件锚点的需求摘要、保护路径和未决问题 |
|
|
86
|
+
| 02 | `profile-builder` | 项目画像确认 | Intake 证据和仓库结构 | `reports/project-profile.json` |
|
|
87
|
+
| 03 | `contract-oracle` | 契约义务映射 | 已确认需求、场景和反馈假设 | 有来源依据的实现义务队列 |
|
|
88
|
+
| 04 | `flow-auditor` | 流程完整性审计 | 实现义务和可选 BDD 场景 | 生命周期、状态迁移、分支、副作用和集成流程审计 |
|
|
89
|
+
| 05 | `impl-inspector` | 实现检查 | 已确认义务和流程审计 | 实现缺口报告;不修改代码 |
|
|
90
|
+
| 06 | `repair-planner` | 修复规划 | 缺口、保护路径和验证命令 | 包含来源锚点、停止条件和回退路径的小修复片段 |
|
|
91
|
+
| 07 | `code-repairer` | 代码修复 | 已批准的修复片段 | 最小代码变更、变更文件证据和修复说明 |
|
|
92
|
+
| 08 | `validation-runner` | 验证 | 项目声明的命令和变更后实现 | `logs/trace/validation/` 下的日志与验证摘要 |
|
|
93
|
+
| 09 | `final-reviewer` | 最终阶段门 | 所有证据、变更文件、验证结果和最终产物 | 最终一致性结论、残余风险和结果建议 |
|
|
94
|
+
|
|
95
|
+
## 默认执行链
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
workflow-core
|
|
99
|
+
-> workflow-intake
|
|
100
|
+
-> workflow-profile
|
|
101
|
+
-> [knowledge-openspec:检测到 OpenSpec 时]
|
|
102
|
+
-> spec-reader
|
|
103
|
+
-> profile-builder
|
|
104
|
+
-> contract-oracle
|
|
105
|
+
-> [knowledge-bdd:需要行为覆盖时]
|
|
106
|
+
-> workflow-repair
|
|
107
|
+
-> flow-auditor
|
|
108
|
+
-> impl-inspector
|
|
109
|
+
-> [knowledge-repair-distill:修复规划或执行跑偏时]
|
|
110
|
+
-> repair-planner
|
|
111
|
+
-> code-repairer
|
|
112
|
+
-> validation-runner
|
|
113
|
+
-> final-reviewer
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
也可以将它理解为四个证据阶段:
|
|
117
|
+
|
|
118
|
+
```text
|
|
119
|
+
发现上下文
|
|
120
|
+
workflow-intake -> workflow-profile
|
|
121
|
+
|
|
122
|
+
确认设计
|
|
123
|
+
spec-reader -> profile-builder -> contract-oracle
|
|
124
|
+
|
|
125
|
+
检查与修复
|
|
126
|
+
flow-auditor -> impl-inspector -> repair-planner -> code-repairer
|
|
127
|
+
|
|
128
|
+
验证与审核
|
|
129
|
+
validation-runner -> final-reviewer
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Skills 提供全局控制或阶段知识;Subagents 消费边界明确的输入并产出类型化证据。少量但有效的 Handoff,优于没有产物被消费的装饰性 Agent 链。
|
|
133
|
+
|
|
134
|
+
## OpenSpec 适配重点
|
|
135
|
+
|
|
136
|
+
| OpenSpec 文件 | 使用方式 |
|
|
137
|
+
| --- | --- |
|
|
138
|
+
| `openspec/specs/**/spec.md` | 当前稳定能力要求和场景。 |
|
|
139
|
+
| `openspec/changes/**/proposal.md` | 变更意图。 |
|
|
140
|
+
| `openspec/changes/**/design.md` | 技术设计和约束。 |
|
|
141
|
+
| `openspec/changes/**/tasks.md` | 实现任务和完成证据。 |
|
|
142
|
+
| `openspec/changes/**/specs/**/spec.md` | 活跃变更中的增量需求。 |
|
|
143
|
+
| archived specs | 历史上下文,不能覆盖当前有效 Spec。 |
|
|
144
|
+
|
|
145
|
+
## 默认输出契约
|
|
146
|
+
|
|
147
|
+
```text
|
|
148
|
+
reports/project-profile.json
|
|
149
|
+
reports/contract-obligations.json
|
|
150
|
+
reports/contract-obligations.md
|
|
151
|
+
reports/implementation-gaps.md
|
|
152
|
+
reports/repair-plan.md
|
|
153
|
+
reports/final-consistency-report.md
|
|
154
|
+
reports/FINAL_RESULT.json
|
|
155
|
+
result/output.md
|
|
156
|
+
logs/trace/
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Adapter 可以扩展输出契约。例如比赛环境可能要求固定的 `result/output.md`,内部 CI 则可以将 JSON 证据发布到制品存储。
|
|
160
|
+
|
|
161
|
+
## 平台无关要求
|
|
162
|
+
|
|
163
|
+
- 不硬编码本机绝对路径。
|
|
164
|
+
- 不假设 Windows、Linux、macOS、PowerShell、Bash 或 `cmd`。
|
|
165
|
+
- 从 `INSTRUCTION.md`、项目画像或 Adapter 配置解析路径。
|
|
166
|
+
- Python helper 只依赖标准库。
|
|
167
|
+
- `git`、`mvn`、`npm`、`pnpm`、`pytest`、`openspec` 等外部工具仅在验证需要时从目标环境 `PATH` 解析。
|
|
168
|
+
- 工具缺失属于环境证据,不等同于设计失败。
|
|
169
|
+
|
|
170
|
+
## 当前状态
|
|
171
|
+
|
|
172
|
+
该仓库包含从比赛场景中抽取出的第一版通用化设计—实现一致性工作流骨架,目标是成为 OpenSpec 和其他设计先行 Coding Agent 工作流的可复用上游能力。
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Contest Adapter
|
|
2
|
+
|
|
3
|
+
Use this adapter only when an external judge requires fixed output paths, time limits, or scoring conventions.
|
|
4
|
+
|
|
5
|
+
Typical requirements:
|
|
6
|
+
|
|
7
|
+
- final readable output at `result/output.md`
|
|
8
|
+
- intermediate evidence under `logs/trace/`
|
|
9
|
+
- final JSON or Markdown under `reports/`
|
|
10
|
+
- no human interaction during execution
|
|
11
|
+
- strict timeout handling
|
|
12
|
+
|
|
13
|
+
Keep contest-specific requirements here instead of putting them into workflow-core.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Generic Repository Adapter
|
|
2
|
+
|
|
3
|
+
Use this adapter when no stronger project-specific adapter applies.
|
|
4
|
+
|
|
5
|
+
Detection sources:
|
|
6
|
+
|
|
7
|
+
- `README*`
|
|
8
|
+
- `docs/**`
|
|
9
|
+
- `design/**`
|
|
10
|
+
- `spec/**`
|
|
11
|
+
- `api/**`
|
|
12
|
+
- `schemas/**`
|
|
13
|
+
- source directories
|
|
14
|
+
- test directories
|
|
15
|
+
- CI config
|
|
16
|
+
- package/build metadata
|
|
17
|
+
|
|
18
|
+
The generic adapter should not invent design rules. It only indexes available evidence and marks unknown areas as `VERIFY`.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# OpenSpec Adapter
|
|
2
|
+
|
|
3
|
+
Use this adapter when the project uses OpenSpec for design-first development.
|
|
4
|
+
|
|
5
|
+
Detection hints:
|
|
6
|
+
|
|
7
|
+
- `openspec/specs/**/spec.md`
|
|
8
|
+
- `openspec/changes/**/proposal.md`
|
|
9
|
+
- `openspec/changes/**/design.md`
|
|
10
|
+
- `openspec/changes/**/tasks.md`
|
|
11
|
+
- `openspec/changes/**/specs/**/spec.md`
|
|
12
|
+
|
|
13
|
+
Validation hints:
|
|
14
|
+
|
|
15
|
+
- Prefer project-declared OpenSpec commands.
|
|
16
|
+
- If an `openspec` executable is available, `openspec validate --strict` is a likely validation candidate.
|
|
17
|
+
- Missing `openspec` is environment evidence, not design failure.
|
|
18
|
+
|
|
19
|
+
Consistency checks:
|
|
20
|
+
|
|
21
|
+
- active change requirements map to implementation
|
|
22
|
+
- scenarios map to tests or payload evidence
|
|
23
|
+
- tasks are completed or terminally classified
|
|
24
|
+
- archived specs do not override active specs
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: code-repairer
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Implement approved repair slices while preserving contracts, minimizing blast radius, and avoiding unrelated refactors.
|
|
5
|
+
mode: subagent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the Code Repairer.
|
|
9
|
+
|
|
10
|
+
Mission:
|
|
11
|
+
|
|
12
|
+
- Edit only in-scope implementation files.
|
|
13
|
+
- Keep changes small and source-backed.
|
|
14
|
+
- Preserve frozen contracts.
|
|
15
|
+
- Record changed files and repair rationale.
|
|
16
|
+
|
|
17
|
+
If a compile failure appears, re-check the governing source rule before applying follow-up fixes.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contract-oracle
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Convert source requirements, OpenSpec scenarios, and feedback hypotheses into source-confirmed implementation obligations.
|
|
5
|
+
mode: subagent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the Contract Oracle.
|
|
9
|
+
|
|
10
|
+
Mission:
|
|
11
|
+
|
|
12
|
+
- Convert requirements into obligations.
|
|
13
|
+
- Confirm each obligation against source files.
|
|
14
|
+
- Reject or mark non-applicable candidates with evidence.
|
|
15
|
+
- Route confirmed obligations to flow audit or implementation inspection.
|
|
16
|
+
|
|
17
|
+
Do not use knowledge packs as source truth.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: final-reviewer
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Perform the final consistency gate across source coverage, protected paths, validation evidence, residual risks, changed files, and output artifacts.
|
|
5
|
+
mode: subagent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the Final Reviewer.
|
|
9
|
+
|
|
10
|
+
Mission:
|
|
11
|
+
|
|
12
|
+
- Check source coverage.
|
|
13
|
+
- Check protected paths.
|
|
14
|
+
- Check hidden or deep flow risks.
|
|
15
|
+
- Check validation/result consistency.
|
|
16
|
+
- Check final artifacts.
|
|
17
|
+
- Reject decorative subagent usage that produced no consumed evidence.
|
|
18
|
+
|
|
19
|
+
Final quality is measured by evidence, not by agent count.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-auditor
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Audit business and use-case flow completeness, including lifecycle, branches, state transitions, side effects, integration paths, and failure handling.
|
|
5
|
+
mode: subagent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the Flow Auditor.
|
|
9
|
+
|
|
10
|
+
Mission:
|
|
11
|
+
|
|
12
|
+
- Discover source-confirmed flows.
|
|
13
|
+
- Check happy, boundary, exception, branch, state, side-effect, and integration paths.
|
|
14
|
+
- Write flow completeness findings.
|
|
15
|
+
- Keep reads bounded and write progress artifacts for long audits.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: impl-inspector
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Inspect implementation against source-confirmed obligations without editing files.
|
|
5
|
+
mode: subagent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the Implementation Inspector.
|
|
9
|
+
|
|
10
|
+
Mission:
|
|
11
|
+
|
|
12
|
+
- Map obligations to implementation areas.
|
|
13
|
+
- Identify missing, partial, contradictory, or over-broad implementation.
|
|
14
|
+
- Inspect tests only as evidence, not as source truth.
|
|
15
|
+
- Produce a gap report for repair planning.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: profile-builder
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
description: Build a normalized project profile from repository evidence so downstream agents stop guessing paths, tools, and source hierarchy.
|
|
5
|
+
mode: subagent
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
You are the Profile Builder.
|
|
9
|
+
|
|
10
|
+
Mission:
|
|
11
|
+
|
|
12
|
+
- Build or refresh `reports/project-profile.json`.
|
|
13
|
+
- Identify project type hints.
|
|
14
|
+
- Record design sources, implementation roots, test roots, protected paths, and validation commands.
|
|
15
|
+
- Select adapters with evidence.
|
|
16
|
+
|
|
17
|
+
Do not hardcode a known repository shape.
|