@devflow-core/dsh-devflow 0.1.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/NOTICE +13 -0
- package/README.md +82 -0
- package/assets/commands/devflow-adversarial.toml +11 -0
- package/assets/commands/devflow-audit.toml +32 -0
- package/assets/commands/devflow-debt.toml +42 -0
- package/assets/commands/devflow-find-fault.toml +11 -0
- package/assets/commands/devflow-learn.toml +21 -0
- package/assets/commands/devflow-plan.toml +58 -0
- package/assets/commands/devflow-prove.toml +20 -0
- package/assets/commands/devflow-pua.toml +40 -0
- package/assets/commands/devflow-review.toml +36 -0
- package/assets/commands/devflow-spec.toml +49 -0
- package/assets/commands/devflow.toml +35 -0
- package/assets/presets/devflow-2/NOTICE +4 -0
- package/assets/presets/devflow-2/README.md +71 -0
- package/assets/presets/devflow-2/agent.cordis.yml +337 -0
- package/assets/presets/devflow-2/custom-bash.mjs +213 -0
- package/assets/presets/devflow-2/preset.yml +3 -0
- package/assets/presets/devflow-2/tool-bootstrap.mjs +496 -0
- package/assets/scripts/devflow-audit.js +275 -0
- package/assets/scripts/devflow-debt.js +196 -0
- package/assets/scripts/devflow-doctor.js +90 -0
- package/assets/scripts/devflow-plan.js +638 -0
- package/assets/scripts/devflow-review.js +93 -0
- package/assets/scripts/devflow-spec.js +238 -0
- package/assets/skills/devflow-adversarial/SKILL.md +71 -0
- package/assets/skills/devflow-audit/SKILL.md +78 -0
- package/assets/skills/devflow-brainstorm/SKILL.md +176 -0
- package/assets/skills/devflow-brainstorm/references/interview-discipline.md +184 -0
- package/assets/skills/devflow-build/SKILL.md +238 -0
- package/assets/skills/devflow-build/references/build-methods.md +40 -0
- package/assets/skills/devflow-core/SKILL.md +93 -0
- package/assets/skills/devflow-core/references/core-methods.md +131 -0
- package/assets/skills/devflow-core/references/reference-projects.md +133 -0
- package/assets/skills/devflow-core/references/skill-guide.md +63 -0
- package/assets/skills/devflow-cut/SKILL.md +208 -0
- package/assets/skills/devflow-cut/references/cut-methods.md +65 -0
- package/assets/skills/devflow-cut/references/native-capability-checklist.md +112 -0
- package/assets/skills/devflow-docs-followup/SKILL.md +132 -0
- package/assets/skills/devflow-docs-followup/agents/openai.yaml +4 -0
- package/assets/skills/devflow-find-fault/SKILL.md +109 -0
- package/assets/skills/devflow-learn/SKILL.md +176 -0
- package/assets/skills/devflow-plan/SKILL.md +142 -0
- package/assets/skills/devflow-plan/references/plan-methods.md +74 -0
- package/assets/skills/devflow-project-knowledge/SKILL.md +354 -0
- package/assets/skills/devflow-prove/SKILL.md +216 -0
- package/assets/skills/devflow-prove/references/code-review-checklist.md +202 -0
- package/assets/skills/devflow-prove/references/flow-self-test.md +775 -0
- package/assets/skills/devflow-prove/references/proof-recovery-methods.md +26 -0
- package/assets/skills/devflow-pua/SKILL.md +197 -0
- package/assets/skills/devflow-pua/references/flavor-display.md +49 -0
- package/assets/skills/devflow-pua/references/methodology-library.md +193 -0
- package/assets/skills/devflow-pua/references/methodology-router.md +78 -0
- package/assets/skills/devflow-spec/SKILL.md +92 -0
- package/assets/skills/devflow-spec/references/spec-plan-methods.md +15 -0
- package/cordis.patch.yml +11 -0
- package/lib/dsh-home.js +33 -0
- package/lib/index.js +79 -0
- package/lib/mount-once.js +34 -0
- package/lib/sync.js +168 -0
- package/package.json +32 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const fs = require("node:fs");
|
|
2
|
+
|
|
3
|
+
const requiredGates = [
|
|
4
|
+
{ name: "Reuse Check", pattern: /Reuse Check/i },
|
|
5
|
+
{ name: "Ponytail Rung", pattern: /Ponytail Rung/i },
|
|
6
|
+
{ name: "Native Check", pattern: /Native Check/i },
|
|
7
|
+
{ name: "Overbuild Check", pattern: /Overbuild Check/i },
|
|
8
|
+
{ name: "Diff Check", pattern: /Diff Check/i },
|
|
9
|
+
{ name: "Scope Check", pattern: /Scope Check/i }
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
function usage() {
|
|
13
|
+
console.log("Usage: node scripts/devflow-review.js [plan-or-diff-file] [--self-test] [--json]");
|
|
14
|
+
console.log("Checks whether a plan or review text includes the DevFlow anti-overengineering gates.");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function reviewText(body) {
|
|
18
|
+
const missing = requiredGates.filter((gate) => !gate.pattern.test(body));
|
|
19
|
+
const present = requiredGates.filter((gate) => gate.pattern.test(body));
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
present,
|
|
23
|
+
missing,
|
|
24
|
+
ok: missing.length === 0
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function report(body, json) {
|
|
29
|
+
const result = reviewText(body);
|
|
30
|
+
const judgment = result.ok ? "PASS" : "FAIL";
|
|
31
|
+
|
|
32
|
+
if (json) {
|
|
33
|
+
console.log(JSON.stringify({ checker: "review", present: result.present.map((gate) => gate.name), missing: result.missing.map((gate) => gate.name), judgment }));
|
|
34
|
+
return result.ok ? 0 : 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
console.log("DevFlow review gate report");
|
|
38
|
+
console.log(`Present gates: ${result.present.map((gate) => gate.name).join(", ") || "none"}`);
|
|
39
|
+
console.log(`Missing gates: ${result.missing.map((gate) => gate.name).join(", ") || "none"}`);
|
|
40
|
+
|
|
41
|
+
if (!result.ok) {
|
|
42
|
+
console.log("Judgment: FAIL");
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
console.log("Judgment: PASS");
|
|
47
|
+
return 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function readInput(args) {
|
|
51
|
+
const targetArg = args.find((arg) => !arg.startsWith("-"));
|
|
52
|
+
if (targetArg) {
|
|
53
|
+
return fs.readFileSync(targetArg, "utf8");
|
|
54
|
+
}
|
|
55
|
+
return fs.readFileSync(0, "utf8");
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function selfTest() {
|
|
59
|
+
const validPlan = [
|
|
60
|
+
"Reuse Check: searched existing helpers",
|
|
61
|
+
"Ponytail Rung: one-line/config",
|
|
62
|
+
"Native Check: standard library not enough",
|
|
63
|
+
"Overbuild Check: no new abstraction",
|
|
64
|
+
"Diff Check: README only",
|
|
65
|
+
"Scope Check: no extra features"
|
|
66
|
+
].join("\n");
|
|
67
|
+
const invalidPlan = "Reuse Check: searched existing helpers";
|
|
68
|
+
|
|
69
|
+
if (!reviewText(validPlan).ok) {
|
|
70
|
+
throw new Error("Self-test expected valid plan to pass");
|
|
71
|
+
}
|
|
72
|
+
const invalidResult = reviewText(invalidPlan);
|
|
73
|
+
if (invalidResult.ok || invalidResult.missing.length !== 5) {
|
|
74
|
+
throw new Error("Self-test expected invalid plan to fail with 5 missing gates");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
console.log("DevFlow review self-test passed");
|
|
78
|
+
console.log("Checked required gate detection and missing gate reporting");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const args = process.argv.slice(2);
|
|
82
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
83
|
+
usage();
|
|
84
|
+
process.exit(0);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (args.includes("--self-test")) {
|
|
88
|
+
selfTest();
|
|
89
|
+
process.exit(0);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const body = readInput(args);
|
|
93
|
+
process.exitCode = report(body, args.includes("--json"));
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
const fs = require("node:fs");
|
|
2
|
+
|
|
3
|
+
const requiredFields = [
|
|
4
|
+
"Goal",
|
|
5
|
+
"Context",
|
|
6
|
+
"Requirements",
|
|
7
|
+
"Non-goals",
|
|
8
|
+
"Approach",
|
|
9
|
+
"Impact",
|
|
10
|
+
"Acceptance",
|
|
11
|
+
"Verification",
|
|
12
|
+
"Code Documentation",
|
|
13
|
+
"Open Questions"
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const fieldPatterns = Object.fromEntries(
|
|
17
|
+
requiredFields.map((field) => [field, new RegExp(`^\\s*(?:#+\\s*)?${field}\\s*(?::|$)`, "im")])
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const unresolvedPatterns = [
|
|
21
|
+
/\bTODO\b/i,
|
|
22
|
+
/\bTBD\b/i,
|
|
23
|
+
/\bcoming soon\b/i,
|
|
24
|
+
/\?\?\?/,
|
|
25
|
+
/<[^>\n]+>/
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
const vaguePatterns = [
|
|
29
|
+
/\bhandle edge cases\b/i,
|
|
30
|
+
/\bas needed\b/i,
|
|
31
|
+
/\bdefine later\b/i,
|
|
32
|
+
/\bfigure out\b/i,
|
|
33
|
+
/\bmake it work\b/i
|
|
34
|
+
];
|
|
35
|
+
// 可选生命周期状态字段:缺失视为 legacy(向后兼容),存在时值域受限;checker 只校验格式,不裁决状态转换。
|
|
36
|
+
const validStatuses = ["draft", "approved", "in-progress", "done"];
|
|
37
|
+
const statusPattern = /^\s*(?:\*\*)?Status(?:\*\*)?\s*:\s*([^\n]+)/im;
|
|
38
|
+
|
|
39
|
+
function usage() {
|
|
40
|
+
console.log("Usage: node scripts/devflow-spec.js [spec-file] [--self-test] [--json]");
|
|
41
|
+
console.log("Checks whether a DevFlow spec has required sections, clear content, and the right landing path.");
|
|
42
|
+
console.log("--json prints a single-line machine-readable summary; optional Status header values: " + validStatuses.join(" | "));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function findMatches(body, patterns) {
|
|
46
|
+
return patterns.flatMap((pattern) => {
|
|
47
|
+
const matches = body.match(pattern);
|
|
48
|
+
return matches ? [matches[0]] : [];
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function checkSpec(body) {
|
|
53
|
+
const missing = requiredFields.filter((field) => !fieldPatterns[field].test(body));
|
|
54
|
+
const unresolved = findMatches(body, unresolvedPatterns);
|
|
55
|
+
const vague = findMatches(body, vaguePatterns);
|
|
56
|
+
const statusMatch = body.match(statusPattern);
|
|
57
|
+
const status = statusMatch ? statusMatch[1].trim() : "legacy";
|
|
58
|
+
const invalidStatus = statusMatch ? !validStatuses.includes(status) : false;
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
missing,
|
|
62
|
+
unresolved,
|
|
63
|
+
vague,
|
|
64
|
+
status,
|
|
65
|
+
invalidStatus,
|
|
66
|
+
ok: missing.length === 0 && unresolved.length === 0 && vague.length === 0 && !invalidStatus
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function checkSpecLanding(filePath) {
|
|
71
|
+
if (!filePath) {
|
|
72
|
+
return { ok: true, message: "Spec landing: stdin input, no file path checked" };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const normalized = filePath.replaceAll("\\", "/");
|
|
76
|
+
const isDocsSpecs = /(^|\/)docs\/specs\/[^/]+\.md$/i.test(normalized);
|
|
77
|
+
const isFeatureLedger = /(^|\/)docs\/features\/[^/]+\.md$/i.test(normalized);
|
|
78
|
+
const isPlanDoc = /(^|\/)docs\/plans\/[^/]+\.md$/i.test(normalized);
|
|
79
|
+
|
|
80
|
+
if (isDocsSpecs) {
|
|
81
|
+
return { ok: true, message: "Spec landing: ok docs/specs/YYYY-MM-DD-<short-kebab-name>.md" };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (isFeatureLedger) {
|
|
85
|
+
return {
|
|
86
|
+
ok: false,
|
|
87
|
+
message: "Spec landing: docs/features is for feature ledgers; put generated specs under docs/specs/YYYY-MM-DD-<short-kebab-name>.md"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (isPlanDoc) {
|
|
92
|
+
return {
|
|
93
|
+
ok: false,
|
|
94
|
+
message: "Spec landing: docs/plans is for implementation plans; put specs under docs/specs/YYYY-MM-DD-<short-kebab-name>.md"
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
ok: true,
|
|
100
|
+
message: "Spec landing: warning expected docs/specs/YYYY-MM-DD-<short-kebab-name>.md unless this project has a documented specs path"
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function report(body, filePath, json) {
|
|
105
|
+
const result = checkSpec(body);
|
|
106
|
+
const landing = checkSpecLanding(filePath);
|
|
107
|
+
const judgment = !result.ok || !landing.ok ? "FAIL" : "PASS";
|
|
108
|
+
|
|
109
|
+
if (json) {
|
|
110
|
+
console.log(
|
|
111
|
+
JSON.stringify({
|
|
112
|
+
checker: "spec",
|
|
113
|
+
landing: landing.message,
|
|
114
|
+
status: result.status,
|
|
115
|
+
invalidStatus: result.invalidStatus,
|
|
116
|
+
missing: result.missing,
|
|
117
|
+
unresolved: result.unresolved,
|
|
118
|
+
vague: result.vague,
|
|
119
|
+
judgment
|
|
120
|
+
})
|
|
121
|
+
);
|
|
122
|
+
return judgment === "PASS" ? 0 : 1;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
console.log("DevFlow spec report");
|
|
126
|
+
console.log(landing.message);
|
|
127
|
+
console.log(`Status: ${result.invalidStatus ? "invalid" : result.status}`);
|
|
128
|
+
console.log(`Missing sections: ${result.missing.join(", ") || "none"}`);
|
|
129
|
+
console.log(`Unresolved markers: ${result.unresolved.join(", ") || "none"}`);
|
|
130
|
+
console.log(`Vague terms: ${result.vague.join(", ") || "none"}`);
|
|
131
|
+
|
|
132
|
+
if (!result.ok || !landing.ok) {
|
|
133
|
+
console.log("Judgment: FAIL");
|
|
134
|
+
return 1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
console.log("Judgment: PASS");
|
|
138
|
+
return 0;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function readInput(args) {
|
|
142
|
+
const targetArg = args.find((arg) => !arg.startsWith("-"));
|
|
143
|
+
if (targetArg) {
|
|
144
|
+
return fs.readFileSync(targetArg, "utf8");
|
|
145
|
+
}
|
|
146
|
+
return fs.readFileSync(0, "utf8");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function selfTest() {
|
|
150
|
+
const validSpec = [
|
|
151
|
+
"Goal: Add spec validation",
|
|
152
|
+
"Context: DevFlow needs a saved requirements source before larger plans.",
|
|
153
|
+
"Requirements: Validate required sections and landing path.",
|
|
154
|
+
"Non-goals: Generate specs automatically.",
|
|
155
|
+
"Approach: Use a zero-dependency Node checker.",
|
|
156
|
+
"Impact: scripts/devflow-spec.js and command metadata.",
|
|
157
|
+
"Acceptance: Complete spec reports PASS.",
|
|
158
|
+
"Verification: node scripts/devflow-spec.js --self-test",
|
|
159
|
+
"Code Documentation: scripts/devflow-spec.js needs file-level comment explaining checker purpose; checkSpec function needs comment explaining validation logic.",
|
|
160
|
+
"Open Questions: none"
|
|
161
|
+
].join("\n");
|
|
162
|
+
const missingSpec = [
|
|
163
|
+
"Goal: Add spec validation",
|
|
164
|
+
"Context: DevFlow needs a saved requirements source.",
|
|
165
|
+
"Code Documentation: none — trivial change"
|
|
166
|
+
].join("\n");
|
|
167
|
+
const vagueSpec = [
|
|
168
|
+
"Goal: TODO",
|
|
169
|
+
"Context: define later",
|
|
170
|
+
"Requirements: handle edge cases",
|
|
171
|
+
"Non-goals: none",
|
|
172
|
+
"Approach: make it work",
|
|
173
|
+
"Impact: scripts/devflow-spec.js",
|
|
174
|
+
"Acceptance: ???",
|
|
175
|
+
"Verification: node scripts/devflow-spec.js --self-test",
|
|
176
|
+
"Code Documentation: none — trivial change",
|
|
177
|
+
"Open Questions: <question>"
|
|
178
|
+
].join("\n");
|
|
179
|
+
|
|
180
|
+
if (!checkSpec(validSpec).ok) {
|
|
181
|
+
throw new Error("Self-test expected valid spec to pass");
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const missingResult = checkSpec(missingSpec);
|
|
185
|
+
if (missingResult.ok || !missingResult.missing.includes("Requirements")) {
|
|
186
|
+
throw new Error("Self-test expected missing sections to fail");
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
const vagueResult = checkSpec(vagueSpec);
|
|
190
|
+
if (vagueResult.ok || vagueResult.vague.length === 0 || vagueResult.unresolved.length === 0) {
|
|
191
|
+
throw new Error("Self-test expected vague and unresolved terms to fail");
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const validLanding = checkSpecLanding("docs/specs/2026-07-14-add-spec-scanner.md");
|
|
195
|
+
if (!validLanding.ok) {
|
|
196
|
+
throw new Error("Self-test expected docs/specs landing to pass");
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const withValidStatusSpec = validSpec.replace(
|
|
200
|
+
"Goal: Add spec validation",
|
|
201
|
+
"Status: draft\nGoal: Add spec validation"
|
|
202
|
+
);
|
|
203
|
+
const withInvalidStatusSpec = validSpec.replace(
|
|
204
|
+
"Goal: Add spec validation",
|
|
205
|
+
"Status: shipped\nGoal: Add spec validation"
|
|
206
|
+
);
|
|
207
|
+
if (!checkSpec(withValidStatusSpec).ok) throw new Error("Self-test expected valid Status to pass");
|
|
208
|
+
if (checkSpec(withInvalidStatusSpec).ok) throw new Error("Self-test expected invalid Status to fail");
|
|
209
|
+
if (checkSpec(validSpec).status !== "legacy") throw new Error("Self-test expected missing Status to stay legacy");
|
|
210
|
+
|
|
211
|
+
const badPlanLanding = checkSpecLanding("docs/plans/2026-07-14-add-spec-scanner.md");
|
|
212
|
+
if (badPlanLanding.ok) {
|
|
213
|
+
throw new Error("Self-test expected docs/plans spec landing to fail");
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
const badFeatureLanding = checkSpecLanding("docs/features/add-spec-scanner.md");
|
|
217
|
+
if (badFeatureLanding.ok) {
|
|
218
|
+
throw new Error("Self-test expected docs/features spec landing to fail");
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
console.log("DevFlow spec self-test passed");
|
|
222
|
+
console.log("Checked required section detection, vague spec blocking, and spec landing guidance");
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const args = process.argv.slice(2);
|
|
226
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
227
|
+
usage();
|
|
228
|
+
process.exit(0);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
if (args.includes("--self-test")) {
|
|
232
|
+
selfTest();
|
|
233
|
+
process.exit(0);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const targetArg = args.find((arg) => !arg.startsWith("-"));
|
|
237
|
+
const body = readInput(args);
|
|
238
|
+
process.exitCode = report(body, targetArg, args.includes("--json"));
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devflow-adversarial
|
|
3
|
+
description: "Use when a user explicitly asks for an independent deep adversarial review, upgraded adversarial review, red-team review, 对抗审查, 升级版对抗审查, or a five-angle challenge of current work. It can run at any task stage and does not read, require, modify, or hand off to devflow-prove, PUA, Build, Learn, or any completion state."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DevFlow Adversarial Review
|
|
7
|
+
|
|
8
|
+
Run an independent, user-requested challenge of the current task materials. This skill does not declare global task status or perform work beyond review.
|
|
9
|
+
|
|
10
|
+
## Entry Gate
|
|
11
|
+
|
|
12
|
+
1. Confirm the user explicitly requested this review.
|
|
13
|
+
2. Immediately identify the review target from the user's request, current files, diff, requirements, tests, or supplied evidence.
|
|
14
|
+
3. If the target is unclear, ask one smallest question to identify it.
|
|
15
|
+
4. As an independent manual review, do not read, require, or alter `devflow-prove`, PUA, Build, Learn, or any lifecycle state.
|
|
16
|
+
|
|
17
|
+
On DeepSeek Harness (DSH), run this review as a fresh `subagent` with no conversation seed so the challenge is genuinely independent of the main agent's reasoning; the subagent returns findings only and never declares lifecycle status, edits files, or invokes another skill.
|
|
18
|
+
|
|
19
|
+
## Five-Angle Review
|
|
20
|
+
|
|
21
|
+
Challenge the target from each angle:
|
|
22
|
+
|
|
23
|
+
1. **Requirement coverage**: What stated requirement, constraint, or non-goal may be missing or contradicted?
|
|
24
|
+
2. **Reachability**: Can the intended user, command, route, or runtime path actually reach the result?
|
|
25
|
+
3. **Boundaries and regressions**: Which edge, sibling path, compatibility boundary, or affected surface may fail?
|
|
26
|
+
4. **Evidence strength**: Which claim lacks direct evidence, uses stale output, or has inadequate verification?
|
|
27
|
+
5. **User-visible outcome**: What would make the result technically plausible but still wrong, unclear, incomplete, or unusable for the user?
|
|
28
|
+
|
|
29
|
+
Use facts from inspected material. Label unsupported possibilities as hypotheses, not facts.
|
|
30
|
+
|
|
31
|
+
## Required Output
|
|
32
|
+
|
|
33
|
+
```text
|
|
34
|
+
Review confirmation: explicit request received
|
|
35
|
+
Adversarial review target: <scope reviewed>
|
|
36
|
+
Findings:
|
|
37
|
+
- Critical: <finding or none>; evidence: <facts>; confidence: high/medium/low
|
|
38
|
+
- Important: <finding or none>; evidence: <facts>; confidence: high/medium/low
|
|
39
|
+
- Observation: <finding or none>; evidence: <facts>; confidence: high/medium/low
|
|
40
|
+
Five-angle coverage:
|
|
41
|
+
- Requirement coverage: <challenge and result>
|
|
42
|
+
- Reachability: <challenge and result>
|
|
43
|
+
- Boundaries and regressions: <challenge and result>
|
|
44
|
+
- Evidence strength: <challenge and result>
|
|
45
|
+
- User-visible outcome: <challenge and result>
|
|
46
|
+
Context limitations: <unavailable material or none>
|
|
47
|
+
Suggested next action: <manual action for the user, or none>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`Suggested next action` is advice only. Do not automatically edit files, create tasks, invoke another skill, or change lifecycle state.
|
|
51
|
+
|
|
52
|
+
## Anti-Rationalization
|
|
53
|
+
|
|
54
|
+
| Excuse | Reality |
|
|
55
|
+
|---|---|
|
|
56
|
+
| "The task is already complete." | This skill is independent and may inspect any current task state. |
|
|
57
|
+
| "The review is lengthy." | An explicit review request authorizes the review; do not add a second confirmation gate. |
|
|
58
|
+
| "A likely issue is a fact." | Separate observed evidence from a hypothesis. |
|
|
59
|
+
| "A Critical finding should trigger a fix." | Report it; the user decides whether to request follow-up work. |
|
|
60
|
+
| "Another skill has a status." | Do not read or change that status. |
|
|
61
|
+
|
|
62
|
+
## Verification
|
|
63
|
+
|
|
64
|
+
Before leaving this skill, confirm:
|
|
65
|
+
|
|
66
|
+
- [ ] The user explicitly requested adversarial review.
|
|
67
|
+
- [ ] The review started without a second confirmation gate.
|
|
68
|
+
- [ ] The review covers all five angles.
|
|
69
|
+
- [ ] Findings have level, evidence, and confidence.
|
|
70
|
+
- [ ] Context limitations are visible.
|
|
71
|
+
- [ ] No lifecycle state, code, or other skill was changed or invoked.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devflow-audit
|
|
3
|
+
description: "Use when auditing a repository or scope for overengineering, bloat, unnecessary abstraction, missed reuse, stdlib/native replacements, or asking what code can be deleted or simplified. Trigger phrases: 'audit this codebase', 'audit for over-engineering', 'what can I delete from this repo', 'find bloat', '/devflow-audit'."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DevFlow Audit
|
|
7
|
+
|
|
8
|
+
Audit code for unnecessary complexity across a repository or named scope.
|
|
9
|
+
|
|
10
|
+
This is repo-wide `devflow-cut`, not correctness review and not implementation.
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
1. Define scope: whole repo, directory, file set, or user-provided focus.
|
|
15
|
+
2. Read project rules and obvious ignore paths before scanning.
|
|
16
|
+
3. Inspect files with `rg --files`, then read representative code in the chosen scope.
|
|
17
|
+
4. Hunt for delete-list findings:
|
|
18
|
+
- `delete`: dead code, speculative feature, unused flexibility.
|
|
19
|
+
- `reuse`: duplicate code or helper that should use an existing project helper, utility, type, or pattern.
|
|
20
|
+
- `stdlib`: hand-rolled behavior the language standard library covers.
|
|
21
|
+
- `native`: dependency or custom code doing what the platform already does.
|
|
22
|
+
- `yagni`: abstraction, config, factory, wrapper, or layer with no current second use.
|
|
23
|
+
- `shrink`: same behavior with fewer moving parts.
|
|
24
|
+
- Hunt targets: stdlib/platform-shipped deps, single-implementation interfaces, factories with one product, wrappers that only delegate, files exporting one thing, dead flags and config, hand-rolled stdlib.
|
|
25
|
+
5. Rank biggest useful cut first.
|
|
26
|
+
6. Do not apply fixes unless the user explicitly asks for a follow-up implementation.
|
|
27
|
+
|
|
28
|
+
When `scripts/devflow-audit.js` exists, use it as a first-pass candidate scan. The script output is evidence, not final judgment; confirm important findings by reading the referenced code.
|
|
29
|
+
|
|
30
|
+
## Output
|
|
31
|
+
|
|
32
|
+
One finding per line:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
<file>:L<line>: <delete|reuse|stdlib|native|yagni|shrink>: <what to cut>. <replacement>.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
End with:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
net: -<N> lines, -<M> deps possible.
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If nothing material should be cut:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
Lean already. Ship.
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Boundaries
|
|
51
|
+
|
|
52
|
+
- Do not report correctness bugs, security issues, performance issues, or style preferences as audit findings.
|
|
53
|
+
- Do not flag tests, small assertions, validation, accessibility, auth, permission, data-loss protection, or rollback safeguards as bloat.
|
|
54
|
+
- Do not infer unused code only from one grep result when dynamic entry points or exports may exist; mark it as "candidate" or skip.
|
|
55
|
+
- Do not change files during audit.
|
|
56
|
+
|
|
57
|
+
## Anti-Rationalization
|
|
58
|
+
|
|
59
|
+
| Excuse | Reality |
|
|
60
|
+
|---|---|
|
|
61
|
+
| "The scanner found it, so it is removable." | The scanner only finds candidates. Read the code before reporting a real finding. |
|
|
62
|
+
| "This abstraction looks big." | Size is not enough. Flag only avoidable complexity with a smaller current replacement. |
|
|
63
|
+
| "This is a bug too." | Correctness, security, performance, and style belong to review or debugging, not audit. |
|
|
64
|
+
| "I can just clean it up now." | Audit reports findings only. Fixes require a separate Build route. |
|
|
65
|
+
|
|
66
|
+
## Handoff
|
|
67
|
+
|
|
68
|
+
If the user wants fixes after the audit, hand off to `devflow-core -> devflow-brainstorm -> devflow-cut -> devflow-build -> devflow-prove` with selected findings as the design input.
|
|
69
|
+
|
|
70
|
+
## Verification
|
|
71
|
+
|
|
72
|
+
Before leaving this skill, confirm:
|
|
73
|
+
|
|
74
|
+
- [ ] Scope was named.
|
|
75
|
+
- [ ] Code was read or script output was confirmed with code reads.
|
|
76
|
+
- [ ] Findings use the audit tags.
|
|
77
|
+
- [ ] Boundaries were respected.
|
|
78
|
+
- [ ] No files were changed.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: devflow-brainstorm
|
|
3
|
+
description: "You MUST use this before any creative work — creating features, building components, adding functionality, modifying behavior, or defining a problem-directed change. Explores user intent, requirements, problem boundaries, and design intent before implementation. Acts as a brainstorming partner: clarifies what the user wants through a semantic echo-back, examines the problem from multiple angles, surfaces gaps and risks, and recommends directions within the problem space; stops after a fixed Confirmed request summary and explicit A/B/C depth gate. Do NOT use it for pure Q&A, lookup, verification, or an already approved change; do NOT select a route or depth, produce implementation designs, or hand off except through the user-selected predefined direct branch."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# DevFlow Brainstorm
|
|
7
|
+
|
|
8
|
+
Explore **what** the user wants as a true brainstorming partner. Do not decide **how** DevFlow should proceed or **how** the solution should be built. Liveliness comes from depth of thinking — proactive analysis, gap-finding, and recommendations — never from loosening the process discipline.
|
|
9
|
+
|
|
10
|
+
## Responsibility Boundary
|
|
11
|
+
|
|
12
|
+
This skill owns only:
|
|
13
|
+
|
|
14
|
+
- minimal fact reading needed to understand the request;
|
|
15
|
+
- Semantic Echo-Back and understanding correction;
|
|
16
|
+
- mandatory multi-angle problem exploration: surfacing gaps, risks, blind spots, and unstated assumptions in the user's request;
|
|
17
|
+
- ideas, suggestions, and direction recommendations inside the problem space;
|
|
18
|
+
- one-at-a-time clarification of goal, scope, exclusions, constraints, acceptance, and real open questions;
|
|
19
|
+
- the fixed `Confirmed request` summary.
|
|
20
|
+
- an explicit A/B/C depth gate after the summary, followed only by the user-selected direct branch.
|
|
21
|
+
|
|
22
|
+
Use `references/interview-discipline.md` for the Semantic Echo-Back, multi-angle checklist, recommendation boundary, one-question discipline, and fixed-summary forms.
|
|
23
|
+
|
|
24
|
+
`devflow-core` owns routing for missing depth, exceptions, and non-unique artifacts. `devflow-spec` owns solution-space design contracts. `devflow-cut`, `devflow-plan`, `devflow-build`, `devflow-prove`, `devflow-pua`, and `devflow-docs-followup` retain their own responsibilities.
|
|
25
|
+
|
|
26
|
+
## Entry And Stop Condition
|
|
27
|
+
|
|
28
|
+
Enter only when `devflow-core` has identified a requirement, behavior, architecture, or ambiguity that needs clarification.
|
|
29
|
+
|
|
30
|
+
After producing the fixed summary, present the A/B/C gate and wait for user selection. Start A at `devflow-spec` and B/C at `devflow-cut` only after the user chooses. Do not select Fast, Design-lite, a depth, an approach, or a method on the user's behalf. Do not create design sections, a design contract, documentation, or a visual artifact.
|
|
31
|
+
|
|
32
|
+
## Clarification Depth
|
|
33
|
+
|
|
34
|
+
Depth governs **analysis breadth only**. It never skips the echo-back, the confirm gates, the question discipline, or the recommendation duty.
|
|
35
|
+
|
|
36
|
+
| Tier | Use when | Behavior |
|
|
37
|
+
|---|---|---|
|
|
38
|
+
| `deep` (default) | Every request, unless the user explicitly asks for a lighter pass. | Full multi-angle checklist with a per-angle report, gap/risk surfacing, direction options with trade-offs, and a recommendation. |
|
|
39
|
+
| `standard` | Only on explicit user request for a lighter pass. | Run the fitting angles instead of the full checklist; every other duty unchanged. |
|
|
40
|
+
|
|
41
|
+
There is no fast lane. A request that turns out clear after analysis simply ends with fewer questions — the analysis still ran and its findings still reach the summary.
|
|
42
|
+
|
|
43
|
+
## Clarification Process
|
|
44
|
+
|
|
45
|
+
1. **Read facts first.** Inspect the smallest useful project files, documentation, configuration, tests, and existing behavior. State facts instead of asking questions that those facts answer.
|
|
46
|
+
2. **Semantic Echo-Back.** The first user-facing message confirms the current understanding and ends with one explicit confirm-or-correct question. Include all fields below, even when a field is `none`.
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
My understanding:
|
|
50
|
+
- Problem to solve: <one sentence in the user's language>
|
|
51
|
+
- Known facts/constraints: <facts read, or none>
|
|
52
|
+
- NOT what you want: <likely misreading ruled out, or none>
|
|
53
|
+
- My assumptions (that could be wrong): <inferences, or none>
|
|
54
|
+
- Understanding gaps: <specific ambiguity, or none>
|
|
55
|
+
Is this right? (correct me / confirm)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. **Wait.** Do not ask a process question or make a lifecycle decision before the user confirms or corrects the echo-back.
|
|
59
|
+
4. **Clarify one decision-impact gap at a time.** Ask only the smallest unresolved question whose answer could change scope, a constraint, acceptance, or a subsequent problem-space decision. Resolve qualifying gaps in this order: goal ambiguity, scope boundary, exclusion, constraint, acceptance, then any remaining open question. Do not ask merely because a category is unfilled: record a fact-backed `none` or non-blocking unknown instead. Every question carries a recommended answer and why the answer matters.
|
|
60
|
+
|
|
61
|
+
```text
|
|
62
|
+
Question: <one question>
|
|
63
|
+
Recommended answer: <answer and rationale>
|
|
64
|
+
Why now: <risk or dependency resolved>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
5. **Revalidate every answer.** Before asking the next question, compare the answer with confirmed facts and the current request. If it introduces a load-bearing assumption, exposes a contradiction, or changes goal, scope, exclusion, constraint, acceptance, terminology, or actor, apply the Understanding Revision Rule. Otherwise record the answer and continue only when another decision-impact gap remains.
|
|
68
|
+
6. **Explore the problem.** Walk the multi-angle checklist from the reference and report what each angle found, including "nothing found here". Name gaps, risks, and blind spots in the user's request; offer directions with trade-offs and recommend one inside the problem space. If exploration exposes a new decision-impact gap, return to step 4 and resolve it one question at a time before finishing.
|
|
69
|
+
7. **Finish.** When no decision-impact gap remains and every non-blocking unknown is recorded, output the fixed summary, present the A/B/C gate, and wait. On user selection, follow only the corresponding predefined direct branch.
|
|
70
|
+
|
|
71
|
+
## Problem-Space Recommendation
|
|
72
|
+
|
|
73
|
+
Brainstorming is active, not passive recording. Inside the problem space this skill must:
|
|
74
|
+
|
|
75
|
+
- point out gaps, contradictions, risks, and missing stakeholders in the request;
|
|
76
|
+
- lay out directions the user has not considered, with trade-offs;
|
|
77
|
+
- recommend a direction and explain why;
|
|
78
|
+
- record considered-and-rejected directions with their reasons.
|
|
79
|
+
|
|
80
|
+
Stop line: when the discussion turns to **how to build** — technical selection, structure, contracts, or steps — record the need and hand it to `devflow-spec` through the summary. Test: a statement answering "what to do / why / what not to do / what could go wrong" belongs here; a statement answering "how to implement" belongs to spec.
|
|
81
|
+
|
|
82
|
+
Brainstorm suggestions are disposable conversation material that helps the user decide what they want; a spec design contract commits to how it gets built.
|
|
83
|
+
|
|
84
|
+
## Understanding Revision Rule
|
|
85
|
+
|
|
86
|
+
A user correction is not permission to continue from the previous question chain. If the correction changes the goal, scope, exclusion, constraint, acceptance, terminology, actor, or any assumption that affects the request:
|
|
87
|
+
|
|
88
|
+
1. stop the current clarification question;
|
|
89
|
+
2. replace superseded facts and assumptions with the corrected understanding;
|
|
90
|
+
3. send a complete updated Semantic Echo-Back, including any new gaps;
|
|
91
|
+
4. wait for explicit confirmation or another correction; and
|
|
92
|
+
5. only then resume one-at-a-time clarification or produce `Confirmed request`.
|
|
93
|
+
|
|
94
|
+
A correction that changes nothing above may receive a direct one-line acknowledgement, but it must not be treated as a confirmed request. Do not silently merge a correction into the next question or the fixed summary.
|
|
95
|
+
|
|
96
|
+
## Clarification Rules
|
|
97
|
+
|
|
98
|
+
- One user question per message; wait for the answer before the next question.
|
|
99
|
+
- Treat business intent, user-visible scope, and ambiguous terms as questions; do not infer them from code.
|
|
100
|
+
- Ask no question whose answer is unambiguous in project facts.
|
|
101
|
+
- Match the user's language and terminology. Name a new technical term only when precision needs it.
|
|
102
|
+
- For vague quantifiers, implicit scope, pronouns, missing actors, unstated constraints, solution-as-goal language, missing context, and ambiguous boundaries, name the specific ambiguity in the echo-back or next question.
|
|
103
|
+
- A request already clear after the echo-back needs no additional questions; the multi-angle exploration still runs and its findings still reach the summary.
|
|
104
|
+
- Required formats (echo-back fields, question block, fixed summary) are mandatory. Wording inside them may be natural and conversational; the structures may not be skipped or abbreviated.
|
|
105
|
+
|
|
106
|
+
## Fixed Output Contract
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
Confirmed request:
|
|
110
|
+
- Goal: <user outcome>
|
|
111
|
+
- Scope: <included behavior and surfaces>
|
|
112
|
+
- Out of scope: <explicit exclusions>
|
|
113
|
+
- Constraints: <must-not-change conditions, or none>
|
|
114
|
+
- Acceptance: <observable proof of success>
|
|
115
|
+
- Identified gaps/risks: <holes, risks, and blind spots surfaced during exploration, or none>
|
|
116
|
+
- Directions considered: <directions discussed with trade-offs, including rejected ones, or none>
|
|
117
|
+
- Recommended direction: <recommendation and rationale within the problem space, or none>
|
|
118
|
+
- Open questions: <none or unresolved blocker>
|
|
119
|
+
- Status: clarified
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The summary records the agreed request and the exploration findings only. It must not contain an implementation plan, solution-space design, lifecycle route, or handoff instruction. It is the factual basis that downstream skills — starting with `devflow-spec` — build on, so record findings faithfully rather than trimming them away.
|
|
123
|
+
|
|
124
|
+
## A/B/C Gate
|
|
125
|
+
|
|
126
|
+
After the fixed summary, present these choices and wait for one explicit user selection:
|
|
127
|
+
|
|
128
|
+
On DeepSeek Harness (DSH), present the gate through the structured `ask_user_question` tool as one single-select question with options A / B / C.
|
|
129
|
+
|
|
130
|
+
| Depth | User-selected outcome | Direct start after selection |
|
|
131
|
+
|---|---|---|
|
|
132
|
+
| A | Full design contract and implementation plan | `devflow-spec` |
|
|
133
|
+
| B | Implementation plan without a saved Spec | `devflow-cut` |
|
|
134
|
+
| C | Smallest approved change without a Plan Pack | `devflow-cut` |
|
|
135
|
+
|
|
136
|
+
Record `Depth: A`, `Depth: B`, or `Depth: C` with the selected branch input. Do not infer depth from request size. A missing or changed selection returns the relevant facts to `devflow-core`.
|
|
137
|
+
|
|
138
|
+
## Anti-Rationalization
|
|
139
|
+
|
|
140
|
+
| Excuse | Reality |
|
|
141
|
+
|---|---|
|
|
142
|
+
| "The request is obvious, so skip the echo-back." | Hidden assumptions cause changed-wrong work. Echo the understanding first. |
|
|
143
|
+
| "The request looks simple, so skip the analysis." | Simple-looking requests hide the most assumptions. Walk the checklist; reporting "nothing found" is cheap. |
|
|
144
|
+
| "I can choose the depth while clarifying." | Recommendations stop at the problem space. The user selects A/B/C; the selected branch starts directly. |
|
|
145
|
+
| "Several questions save time." | One question at a time makes the answer unambiguous. |
|
|
146
|
+
| "Code reveals business intent." | Code shows current behavior, not the desired outcome. Confirm intent. |
|
|
147
|
+
| "A design contract is a better summary." | A design contract decides how; this skill records what plus exploration findings. |
|
|
148
|
+
| "The user corrected one detail, so continue silently." | Re-echo the corrected understanding before proceeding. |
|
|
149
|
+
| "Formats are optional when the conversation flows." | Optional formats are skipped formats. The structures are mandatory; only the wording is free. |
|
|
150
|
+
| "Recommending a direction is route selection." | Problem-space recommendation is this skill's duty; lifecycle routing is Core's. |
|
|
151
|
+
| "A recovery restart means I own recovery." | Recovery remains in `devflow-pua`; perform only the normal clarification process. |
|
|
152
|
+
|
|
153
|
+
## Red Flags — Stop
|
|
154
|
+
|
|
155
|
+
- Selecting a depth or branch on the user's behalf.
|
|
156
|
+
- Recommending implementation approaches, technical selections, or producing solution-space design.
|
|
157
|
+
- Creating a design contract, spec, plan, ADR, documentation landing, or visual expression.
|
|
158
|
+
- Skipping or abbreviating the multi-angle exploration because the request looks simple.
|
|
159
|
+
- Treating clarification depth as permission to skip the echo-back, a confirm gate, or the recommendation duty.
|
|
160
|
+
- Combining several user questions into one message.
|
|
161
|
+
- Starting a branch before the user selects A/B/C.
|
|
162
|
+
|
|
163
|
+
## Verification
|
|
164
|
+
|
|
165
|
+
Before leaving this skill, confirm:
|
|
166
|
+
|
|
167
|
+
- [ ] Relevant facts were read or explicitly recorded as unknown.
|
|
168
|
+
- [ ] The first user-facing message was a Semantic Echo-Back with all fields, including `none` entries.
|
|
169
|
+
- [ ] The echo-back was confirmed or corrected before further clarification.
|
|
170
|
+
- [ ] Each additional question resolved one real gap and used the `Question / Recommended answer / Why now` block.
|
|
171
|
+
- [ ] The multi-angle exploration ran and its per-angle findings reached the summary fields.
|
|
172
|
+
- [ ] Recommendations stayed inside the problem space.
|
|
173
|
+
- [ ] Any changed understanding was re-echoed and confirmed.
|
|
174
|
+
- [ ] The fixed `Confirmed request` summary contains every required field, including gaps/risks, directions, and recommendation.
|
|
175
|
+
- [ ] The summary contains no implementation design or user-unselected branch.
|
|
176
|
+
- [ ] A/B/C was presented after `Status: clarified`, and only the user-selected branch started.
|