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.
@@ -0,0 +1,17 @@
1
+ ---
2
+ name: repair-planner
3
+ version: 1.0.0
4
+ description: Create small, source-backed repair slices with target files, validation commands, stop conditions, and fallback plans.
5
+ mode: subagent
6
+ ---
7
+
8
+ You are the Repair Planner.
9
+
10
+ Mission:
11
+
12
+ - Convert confirmed gaps into small repair slices.
13
+ - Preserve protected paths and public contracts.
14
+ - Plan validation for each slice.
15
+ - Avoid decorative subagent chains.
16
+
17
+ Every repair item must include source anchor, target area, expected behavior, validation command, and stop condition.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: spec-reader
3
+ version: 1.0.0
4
+ description: Read authoritative design, OpenSpec, API, schema, README, and configuration sources and produce a source-backed requirement brief.
5
+ mode: subagent
6
+ ---
7
+
8
+ You are the Spec Reader.
9
+
10
+ Mission:
11
+
12
+ - Identify source truth.
13
+ - Summarize requirements with file anchors.
14
+ - Separate stable requirements from examples.
15
+ - Mark ambiguity as `VERIFY`, not as implementation freedom.
16
+
17
+ Output a handoff with:
18
+
19
+ - sources read
20
+ - requirement bullets
21
+ - protected paths
22
+ - unresolved questions
23
+ - next recommended agent
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: validation-runner
3
+ version: 1.0.0
4
+ description: Discover, run, and summarize project validation commands using evaluator-readable evidence.
5
+ mode: subagent
6
+ ---
7
+
8
+ You are the Validation Runner.
9
+
10
+ Mission:
11
+
12
+ - Prefer project-declared validation commands.
13
+ - Resolve tools from PATH.
14
+ - Store logs under `logs/trace/validation/`.
15
+ - Wrap results into machine-readable summaries.
16
+ - Classify missing tools as environment evidence.
@@ -0,0 +1,150 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { cp, mkdir, readFile, writeFile } from "node:fs/promises";
4
+ import { homedir } from "node:os";
5
+ import { dirname, join, resolve } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const PLUGIN_NAME = "dic-workflow-kit";
9
+ const PACKAGE_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
10
+ const PAYLOAD = [
11
+ ".codex-plugin",
12
+ "adapters",
13
+ "agents",
14
+ "schemas",
15
+ "scripts",
16
+ "skills",
17
+ "INSTRUCTION.md",
18
+ "README.md",
19
+ "README.zh-CN.md",
20
+ ];
21
+
22
+ function parseArgs(argv) {
23
+ const command = argv[0] ?? "help";
24
+ let marketplaceRoot = join(homedir(), ".agents", "plugins");
25
+ let dryRun = false;
26
+ for (let index = 1; index < argv.length; index += 1) {
27
+ const value = argv[index];
28
+ if (value === "--marketplace-root") {
29
+ const next = argv[index + 1];
30
+ if (!next) {
31
+ throw new Error("--marketplace-root requires a directory");
32
+ }
33
+ marketplaceRoot = resolve(next);
34
+ index += 1;
35
+ } else if (value === "--dry-run") {
36
+ dryRun = true;
37
+ } else {
38
+ throw new Error(`unknown argument: ${value}`);
39
+ }
40
+ }
41
+ return { command, marketplaceRoot: resolve(marketplaceRoot), dryRun };
42
+ }
43
+
44
+ async function loadMarketplace(path) {
45
+ try {
46
+ const value = JSON.parse(await readFile(path, "utf8"));
47
+ if (!value || typeof value !== "object" || Array.isArray(value)) {
48
+ throw new Error("marketplace.json must contain an object");
49
+ }
50
+ if (!Array.isArray(value.plugins)) {
51
+ throw new Error("marketplace.json must contain a plugins array");
52
+ }
53
+ return value;
54
+ } catch (error) {
55
+ if (error?.code !== "ENOENT") {
56
+ throw error;
57
+ }
58
+ return {
59
+ name: "personal",
60
+ interface: { displayName: "Personal" },
61
+ plugins: [],
62
+ };
63
+ }
64
+ }
65
+
66
+ function pluginEntry() {
67
+ return {
68
+ name: PLUGIN_NAME,
69
+ source: {
70
+ source: "local",
71
+ path: `./plugins/${PLUGIN_NAME}`,
72
+ },
73
+ policy: {
74
+ installation: "AVAILABLE",
75
+ authentication: "ON_INSTALL",
76
+ },
77
+ category: "Developer Tools",
78
+ };
79
+ }
80
+
81
+ async function install({ marketplaceRoot, dryRun }) {
82
+ const marketplacePath = join(marketplaceRoot, "marketplace.json");
83
+ const pluginRoot = join(marketplaceRoot, "plugins", PLUGIN_NAME);
84
+ const marketplace = await loadMarketplace(marketplacePath);
85
+ const entry = pluginEntry();
86
+ const existingIndex = marketplace.plugins.findIndex(
87
+ (candidate) => candidate?.name === PLUGIN_NAME,
88
+ );
89
+ if (existingIndex >= 0) {
90
+ marketplace.plugins[existingIndex] = entry;
91
+ } else {
92
+ marketplace.plugins.push(entry);
93
+ }
94
+
95
+ if (!dryRun) {
96
+ await mkdir(pluginRoot, { recursive: true });
97
+ for (const relativePath of PAYLOAD) {
98
+ await cp(join(PACKAGE_ROOT, relativePath), join(pluginRoot, relativePath), {
99
+ recursive: true,
100
+ force: true,
101
+ });
102
+ }
103
+ await mkdir(marketplaceRoot, { recursive: true });
104
+ await writeFile(
105
+ marketplacePath,
106
+ `${JSON.stringify(marketplace, null, 2)}\n`,
107
+ "utf8",
108
+ );
109
+ }
110
+
111
+ process.stdout.write(
112
+ [
113
+ dryRun ? "DRY_RUN: true" : "INSTALLED: true",
114
+ `PLUGIN_ROOT: ${pluginRoot}`,
115
+ `MARKETPLACE: ${marketplacePath}`,
116
+ "SKILLS: skills/",
117
+ "SUBAGENTS: agents/",
118
+ "",
119
+ ].join("\n"),
120
+ );
121
+ }
122
+
123
+ function printHelp() {
124
+ process.stdout.write(
125
+ [
126
+ "DIC Workflow Kit Codex installer",
127
+ "",
128
+ "Usage:",
129
+ " dic-workflow-kit install [--marketplace-root <path>] [--dry-run]",
130
+ "",
131
+ "Default destination:",
132
+ " ~/.agents/plugins/plugins/dic-workflow-kit",
133
+ "",
134
+ ].join("\n"),
135
+ );
136
+ }
137
+
138
+ try {
139
+ const options = parseArgs(process.argv.slice(2));
140
+ if (options.command === "install") {
141
+ await install(options);
142
+ } else if (options.command === "help" || options.command === "--help") {
143
+ printHelp();
144
+ } else {
145
+ throw new Error(`unknown command: ${options.command}`);
146
+ }
147
+ } catch (error) {
148
+ process.stderr.write(`ERROR: ${error.message}\n`);
149
+ process.exitCode = 1;
150
+ }
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "dic-workflow-kit",
3
+ "version": "1.0.0",
4
+ "description": "Install DIC Workflow Kit Skills and Subagents as a Codex plugin.",
5
+ "type": "module",
6
+ "bin": {
7
+ "dic-workflow-kit": "bin/dic-workflow-kit.mjs"
8
+ },
9
+ "scripts": {
10
+ "test": "python -m unittest discover -s tests -v && node --test tests/test_npm_installer.mjs",
11
+ "pack:check": "npm pack --dry-run"
12
+ },
13
+ "files": [
14
+ ".codex-plugin/",
15
+ "adapters/",
16
+ "agents/",
17
+ "bin/",
18
+ "schemas/",
19
+ "scripts/",
20
+ "!scripts/__pycache__/",
21
+ "!**/*.pyc",
22
+ "skills/",
23
+ "INSTRUCTION.md",
24
+ "README.md",
25
+ "README.zh-CN.md"
26
+ ],
27
+ "keywords": [
28
+ "codex",
29
+ "plugin",
30
+ "skills",
31
+ "subagents",
32
+ "openspec",
33
+ "bdd"
34
+ ],
35
+ "author": "TonyClaw",
36
+ "license": "UNLICENSED",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "git+ssh://git@gitcode.com/TonyClaw/DICWorkflowKit.git"
40
+ },
41
+ "homepage": "https://gitcode.com/TonyClaw/DICWorkflowKit",
42
+ "engines": {
43
+ "node": ">=20"
44
+ }
45
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://dicworkflowkit.local/schemas/agent-handoff.schema.json",
4
+ "title": "DIC Agent Handoff",
5
+ "type": "object",
6
+ "required": ["schema", "agent", "version", "status", "inputsConsumed", "outputsProduced", "nextAction"],
7
+ "properties": {
8
+ "schema": { "const": "dic.agent-handoff.v1" },
9
+ "agent": { "type": "string" },
10
+ "version": { "type": "string" },
11
+ "status": { "enum": ["PASS", "HOLD", "FAIL", "SKIPPED_WITH_EVIDENCE"] },
12
+ "inputsConsumed": { "type": "array", "items": { "type": "string" } },
13
+ "outputsProduced": { "type": "array", "items": { "type": "string" } },
14
+ "traceArtifacts": { "type": "array", "items": { "type": "string" } },
15
+ "nextAction": { "type": "string" },
16
+ "blockers": { "type": "array", "items": { "type": "string" } },
17
+ "notes": { "type": "array", "items": { "type": "string" } }
18
+ },
19
+ "additionalProperties": true
20
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://dicworkflowkit.local/schemas/contract-obligations.schema.json",
4
+ "title": "DIC Contract Obligations",
5
+ "type": "object",
6
+ "required": ["schema", "version", "changeId", "changeLifecycle", "authorityPolicy", "sources", "counts", "obligations"],
7
+ "properties": {
8
+ "schema": { "const": "dic.contract-obligations.v1" },
9
+ "version": { "type": "string" },
10
+ "changeId": { "type": "string" },
11
+ "changeLifecycle": { "enum": ["active", "archived"] },
12
+ "authorityPolicy": { "type": "string" },
13
+ "sources": { "type": "array", "items": { "type": "string" } },
14
+ "counts": {
15
+ "type": "object",
16
+ "required": ["requirements", "scenarios", "total"],
17
+ "properties": {
18
+ "requirements": { "type": "integer", "minimum": 0 },
19
+ "scenarios": { "type": "integer", "minimum": 0 },
20
+ "total": { "type": "integer", "minimum": 0 }
21
+ }
22
+ },
23
+ "obligations": {
24
+ "type": "array",
25
+ "items": {
26
+ "type": "object",
27
+ "required": ["id", "capabilityId", "kind", "title", "statement", "source", "line", "authority", "parentId", "acceptanceClauses"],
28
+ "properties": {
29
+ "id": { "type": "string", "pattern": "^obl-[0-9a-f]{12}$" },
30
+ "capabilityId": { "type": "string" },
31
+ "kind": { "enum": ["requirement", "scenario"] },
32
+ "title": { "type": "string" },
33
+ "statement": { "type": "string" },
34
+ "source": { "type": "string" },
35
+ "line": { "type": "integer", "minimum": 1 },
36
+ "authority": { "enum": ["active-change", "current-baseline"] },
37
+ "parentId": { "type": ["string", "null"] },
38
+ "acceptanceClauses": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "object",
42
+ "required": ["keyword", "text", "line"],
43
+ "properties": {
44
+ "keyword": { "enum": ["GIVEN", "WHEN", "THEN", "AND", "BUT"] },
45
+ "text": { "type": "string" },
46
+ "line": { "type": "integer", "minimum": 1 }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ }
52
+ }
53
+ },
54
+ "additionalProperties": false
55
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://dicworkflowkit.local/schemas/final-result.schema.json",
4
+ "title": "DIC Final Result",
5
+ "type": "object",
6
+ "required": ["schema", "status", "final", "summary", "artifacts"],
7
+ "properties": {
8
+ "schema": { "const": "dic.final-result.v1" },
9
+ "status": { "enum": ["PASS", "PARTIAL", "BLOCKED", "FAIL"] },
10
+ "final": { "type": "boolean" },
11
+ "summary": { "type": "string" },
12
+ "artifacts": { "type": "array", "items": { "type": "string" } },
13
+ "validation": { "type": "array", "items": { "type": "object" } },
14
+ "changedFiles": { "type": "array", "items": { "type": "string" } },
15
+ "residualRisks": { "type": "array", "items": { "type": "string" } }
16
+ },
17
+ "additionalProperties": true
18
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://dicworkflowkit.local/schemas/project-profile.schema.json",
4
+ "title": "DIC Project Profile",
5
+ "type": "object",
6
+ "required": ["schema", "version", "projectRoot", "designSources", "implementationRoots", "testRoots", "validationCommands"],
7
+ "properties": {
8
+ "schema": { "const": "dic.project-profile.v1" },
9
+ "version": { "type": "string" },
10
+ "projectRoot": { "type": "string" },
11
+ "projectTypes": { "type": "array", "items": { "type": "string" } },
12
+ "adapters": { "type": "array", "items": { "type": "string" } },
13
+ "designEntry": {
14
+ "type": "object",
15
+ "required": ["type", "changeId", "lifecycle", "changeRoot", "documents", "deltaSpecs", "baselineSpecs"],
16
+ "properties": {
17
+ "type": { "const": "openspec-change" },
18
+ "changeId": { "type": "string" },
19
+ "lifecycle": { "enum": ["active", "archived"] },
20
+ "changeRoot": { "type": "string" },
21
+ "documents": { "type": "array", "items": { "type": "string" } },
22
+ "deltaSpecs": { "type": "array", "items": { "type": "string" } },
23
+ "baselineSpecs": { "type": "array", "items": { "type": "string" } },
24
+ "designMap": {
25
+ "type": "object",
26
+ "required": ["source", "capabilityId", "architectureDesigns", "moduleDesigns", "adrs", "validationSummary", "validationCommands"],
27
+ "properties": {
28
+ "source": { "type": "string" },
29
+ "capabilityId": { "type": "string" },
30
+ "architectureDesigns": { "type": "array", "items": { "type": "string" } },
31
+ "moduleDesigns": { "type": "array", "items": { "type": "string" } },
32
+ "adrs": { "type": "array", "items": { "type": "string" } },
33
+ "validationSummary": { "type": "string" },
34
+ "validationCommands": { "type": "array", "items": { "$ref": "#/$defs/validationCommand" } }
35
+ }
36
+ }
37
+ }
38
+ },
39
+ "deltaSpecs": { "type": "array", "items": { "type": "string" } },
40
+ "baselineSpecs": { "type": "array", "items": { "type": "string" } },
41
+ "designSources": { "type": "array", "items": { "type": "string" } },
42
+ "implementationRoots": { "type": "array", "items": { "type": "string" } },
43
+ "testRoots": { "type": "array", "items": { "type": "string" } },
44
+ "protectedPaths": { "type": "array", "items": { "type": "string" } },
45
+ "validationCommands": {
46
+ "type": "array",
47
+ "items": { "$ref": "#/$defs/validationCommand" }
48
+ },
49
+ "riskFamilies": { "type": "array", "items": { "type": "string" } },
50
+ "outputContract": { "type": "object" }
51
+ },
52
+ "additionalProperties": true,
53
+ "$defs": {
54
+ "validationCommand": {
55
+ "type": "object",
56
+ "required": ["name", "command", "source"],
57
+ "properties": {
58
+ "name": { "type": "string" },
59
+ "command": { "type": "array", "items": { "type": "string" } },
60
+ "cwd": { "type": "string" },
61
+ "source": { "type": "string" },
62
+ "kind": { "type": "string" }
63
+ }
64
+ }
65
+ }
66
+ }