@brunosps00/dev-workflow 0.0.3 → 0.0.5
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/README.md +42 -42
- package/bin/dev-workflow.js +1 -1
- package/lib/constants.js +42 -40
- package/lib/init.js +40 -10
- package/package.json +1 -1
- package/scaffold/en/commands/{analyze-project.md → dw-analyze-project.md} +69 -40
- package/scaffold/en/commands/{brainstorm.md → dw-brainstorm.md} +31 -4
- package/scaffold/en/commands/{bugfix.md → dw-bugfix.md} +63 -19
- package/scaffold/en/commands/{code-review.md → dw-code-review.md} +38 -15
- package/scaffold/en/commands/{commit.md → dw-commit.md} +25 -0
- package/scaffold/en/commands/{create-prd.md → dw-create-prd.md} +24 -10
- package/scaffold/en/commands/{create-tasks.md → dw-create-tasks.md} +11 -4
- package/scaffold/en/commands/{create-techspec.md → dw-create-techspec.md} +38 -11
- package/scaffold/en/commands/{deep-research.md → dw-deep-research.md} +18 -17
- package/scaffold/en/commands/{fix-qa.md → dw-fix-qa.md} +20 -3
- package/scaffold/en/commands/dw-functional-doc.md +276 -0
- package/scaffold/en/commands/{generate-pr.md → dw-generate-pr.md} +20 -5
- package/scaffold/en/commands/dw-help.md +309 -0
- package/scaffold/en/commands/{refactoring-analysis.md → dw-refactoring-analysis.md} +50 -26
- package/scaffold/en/commands/{review-implementation.md → dw-review-implementation.md} +25 -6
- package/scaffold/en/commands/{run-plan.md → dw-run-plan.md} +21 -6
- package/scaffold/en/commands/{run-qa.md → dw-run-qa.md} +32 -13
- package/scaffold/en/commands/{run-task.md → dw-run-task.md} +17 -7
- package/scaffold/en/references/playwright-patterns.md +136 -0
- package/scaffold/en/references/refactoring-catalog.md +167 -0
- package/scaffold/en/templates/brainstorm-matrix.md +44 -0
- package/scaffold/en/templates/functional-doc/case-matrix.md +5 -0
- package/scaffold/en/templates/functional-doc/e2e-runbook.md +3 -0
- package/scaffold/en/templates/functional-doc/features.md +3 -0
- package/scaffold/en/templates/functional-doc/overview.md +21 -0
- package/scaffold/en/templates/functional-doc/playwright.spec.ts.tpl +19 -0
- package/scaffold/en/templates/pr-bugfix-template.md +28 -0
- package/scaffold/en/templates/qa-test-credentials.md +37 -0
- package/scaffold/en/templates/tasks-template.md +1 -1
- package/scaffold/en/templates/techspec-template.md +1 -1
- package/scaffold/pt-br/commands/{analyze-project.md → dw-analyze-project.md} +91 -41
- package/scaffold/pt-br/commands/{brainstorm.md → dw-brainstorm.md} +32 -5
- package/scaffold/pt-br/commands/{bugfix.md → dw-bugfix.md} +70 -13
- package/scaffold/pt-br/commands/{code-review.md → dw-code-review.md} +78 -15
- package/scaffold/pt-br/commands/{commit.md → dw-commit.md} +45 -1
- package/scaffold/pt-br/commands/{create-prd.md → dw-create-prd.md} +25 -10
- package/scaffold/pt-br/commands/{create-tasks.md → dw-create-tasks.md} +20 -13
- package/scaffold/pt-br/commands/{create-techspec.md → dw-create-techspec.md} +40 -13
- package/scaffold/pt-br/commands/{deep-research.md → dw-deep-research.md} +19 -11
- package/scaffold/pt-br/commands/{fix-qa.md → dw-fix-qa.md} +30 -1
- package/scaffold/pt-br/commands/dw-functional-doc.md +276 -0
- package/scaffold/pt-br/commands/{generate-pr.md → dw-generate-pr.md} +58 -3
- package/scaffold/pt-br/commands/{help.md → dw-help.md} +81 -59
- package/scaffold/pt-br/commands/{refactoring-analysis.md → dw-refactoring-analysis.md} +49 -25
- package/scaffold/pt-br/commands/{review-implementation.md → dw-review-implementation.md} +50 -2
- package/scaffold/pt-br/commands/{run-plan.md → dw-run-plan.md} +98 -10
- package/scaffold/pt-br/commands/{run-qa.md → dw-run-qa.md} +93 -18
- package/scaffold/pt-br/commands/{run-task.md → dw-run-task.md} +32 -7
- package/scaffold/pt-br/references/playwright-patterns.md +133 -0
- package/scaffold/pt-br/references/refactoring-catalog.md +166 -0
- package/scaffold/pt-br/templates/brainstorm-matrix.md +44 -0
- package/scaffold/pt-br/templates/functional-doc/case-matrix.md +5 -0
- package/scaffold/pt-br/templates/functional-doc/e2e-runbook.md +3 -0
- package/scaffold/pt-br/templates/functional-doc/features.md +3 -0
- package/scaffold/pt-br/templates/functional-doc/overview.md +21 -0
- package/scaffold/pt-br/templates/functional-doc/playwright.spec.ts.tpl +19 -0
- package/scaffold/pt-br/templates/pr-bugfix-template.md +28 -0
- package/scaffold/pt-br/templates/qa-test-credentials.md +37 -0
- package/scaffold/pt-br/templates/techspec-template.md +1 -1
- package/scaffold/rules-readme.md +3 -3
- package/scaffold/scripts/functional-doc/generate-dossier.mjs +821 -0
- package/scaffold/scripts/functional-doc/run-playwright-flow.mjs +275 -0
- package/scaffold/en/commands/help.md +0 -289
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { spawnSync } from "node:child_process";
|
|
6
|
+
|
|
7
|
+
function parseArgs(argv) {
|
|
8
|
+
const result = {};
|
|
9
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
10
|
+
const token = argv[index];
|
|
11
|
+
if (!token.startsWith("--")) {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const [rawKey, inlineValue] = token.slice(2).split("=", 2);
|
|
16
|
+
const key = rawKey.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
17
|
+
if (inlineValue !== undefined) {
|
|
18
|
+
result[key] = inlineValue;
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const next = argv[index + 1];
|
|
23
|
+
if (!next || next.startsWith("--")) {
|
|
24
|
+
result[key] = true;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
result[key] = next;
|
|
29
|
+
index += 1;
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function detectPackageManager(projectRoot) {
|
|
35
|
+
if (fs.existsSync(path.join(projectRoot, "pnpm-lock.yaml"))) return "pnpm";
|
|
36
|
+
if (fs.existsSync(path.join(projectRoot, "package-lock.json"))) return "npm";
|
|
37
|
+
if (fs.existsSync(path.join(projectRoot, "yarn.lock"))) return "yarn";
|
|
38
|
+
return "npm";
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function updateManifest(manifestPath, patch) {
|
|
42
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
43
|
+
const next = {
|
|
44
|
+
...manifest,
|
|
45
|
+
execution: {
|
|
46
|
+
...(manifest.execution ?? {}),
|
|
47
|
+
...patch,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
fs.writeFileSync(manifestPath, `${JSON.stringify(next, null, 2)}\n`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function detectTestDir(playwrightConfig) {
|
|
54
|
+
const content = fs.readFileSync(playwrightConfig, "utf8");
|
|
55
|
+
const match = content.match(/testDir:\s*"([^"]+)"/);
|
|
56
|
+
return match?.[1] ?? "e2e";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function ensureDir(dirPath) {
|
|
60
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function escapeForTemplate(value) {
|
|
64
|
+
return JSON.stringify(value);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function parseResolution(rawValue) {
|
|
68
|
+
const normalized = String(rawValue ?? "").trim().toLowerCase();
|
|
69
|
+
if (!normalized || normalized === "fullhd") {
|
|
70
|
+
return { width: 1920, height: 1080, label: "1920x1080" };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const match = normalized.match(/^(\d{3,5})x(\d{3,5})$/);
|
|
74
|
+
if (!match) {
|
|
75
|
+
return { width: 1920, height: 1080, label: "1920x1080" };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
width: Number(match[1]),
|
|
80
|
+
height: Number(match[2]),
|
|
81
|
+
label: `${Number(match[1])}x${Number(match[2])}`,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function createTemporaryPlaywrightConfig({
|
|
86
|
+
generatedDir,
|
|
87
|
+
flowDir,
|
|
88
|
+
baseUrl,
|
|
89
|
+
browserName,
|
|
90
|
+
resolution,
|
|
91
|
+
}) {
|
|
92
|
+
const rawArtifactsDir = path.join(flowDir, "evidence", "playwright-artifacts");
|
|
93
|
+
ensureDir(rawArtifactsDir);
|
|
94
|
+
|
|
95
|
+
const configPath = path.join(generatedDir, "playwright.functional-doc.config.mjs");
|
|
96
|
+
const content = `import { defineConfig } from "@playwright/test";
|
|
97
|
+
|
|
98
|
+
const rawOutputDir = ${escapeForTemplate(rawArtifactsDir)};
|
|
99
|
+
const baseURL = process.env.BASE_URL ?? ${escapeForTemplate(baseUrl)};
|
|
100
|
+
const generatedDir = ${escapeForTemplate(generatedDir)};
|
|
101
|
+
|
|
102
|
+
export default defineConfig({
|
|
103
|
+
testDir: generatedDir,
|
|
104
|
+
outputDir: rawOutputDir,
|
|
105
|
+
fullyParallel: false,
|
|
106
|
+
retries: 0,
|
|
107
|
+
workers: 1,
|
|
108
|
+
reporter: "line",
|
|
109
|
+
use: {
|
|
110
|
+
baseURL,
|
|
111
|
+
video: {
|
|
112
|
+
mode: "on",
|
|
113
|
+
size: { width: ${resolution.width}, height: ${resolution.height} },
|
|
114
|
+
},
|
|
115
|
+
screenshot: "on",
|
|
116
|
+
trace: "retain-on-failure",
|
|
117
|
+
viewport: { width: ${resolution.width}, height: ${resolution.height} },
|
|
118
|
+
},
|
|
119
|
+
projects: [
|
|
120
|
+
{
|
|
121
|
+
name: ${escapeForTemplate(browserName)},
|
|
122
|
+
use: { browserName: ${escapeForTemplate(browserName)} },
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
});
|
|
126
|
+
`;
|
|
127
|
+
fs.writeFileSync(configPath, content);
|
|
128
|
+
return { configPath, rawArtifactsDir };
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function collectFilesByExtension(rootDir, extension) {
|
|
132
|
+
if (!fs.existsSync(rootDir)) {
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const found = [];
|
|
137
|
+
const queue = [rootDir];
|
|
138
|
+
while (queue.length > 0) {
|
|
139
|
+
const current = queue.pop();
|
|
140
|
+
for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
|
|
141
|
+
const absolutePath = path.join(current, entry.name);
|
|
142
|
+
if (entry.isDirectory()) {
|
|
143
|
+
queue.push(absolutePath);
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (absolutePath.toLowerCase().endsWith(extension.toLowerCase())) {
|
|
147
|
+
found.push(absolutePath);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return found.sort();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function copyArtifacts(flowDir, slug, rawArtifactsDir) {
|
|
155
|
+
const videoDir = path.join(flowDir, "evidence", "videos");
|
|
156
|
+
const screenshotDir = path.join(flowDir, "evidence", "screenshots");
|
|
157
|
+
ensureDir(videoDir);
|
|
158
|
+
ensureDir(screenshotDir);
|
|
159
|
+
|
|
160
|
+
const videos = collectFilesByExtension(rawArtifactsDir, ".webm");
|
|
161
|
+
const screenshots = collectFilesByExtension(rawArtifactsDir, ".png");
|
|
162
|
+
|
|
163
|
+
const copiedVideos = videos.map((sourcePath, index) => {
|
|
164
|
+
const destinationPath = path.join(videoDir, `${slug}${videos.length > 1 ? `-${index + 1}` : ""}.webm`);
|
|
165
|
+
fs.copyFileSync(sourcePath, destinationPath);
|
|
166
|
+
return destinationPath;
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
const copiedScreenshots = screenshots.map((sourcePath, index) => {
|
|
170
|
+
const destinationPath = path.join(screenshotDir, `${slug}${screenshots.length > 1 ? `-${index + 1}` : ""}.png`);
|
|
171
|
+
fs.copyFileSync(sourcePath, destinationPath);
|
|
172
|
+
return destinationPath;
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
return {
|
|
176
|
+
videos: copiedVideos,
|
|
177
|
+
screenshots: copiedScreenshots,
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function main() {
|
|
182
|
+
const args = parseArgs(process.argv.slice(2));
|
|
183
|
+
if (!args.flowDir) {
|
|
184
|
+
throw new Error("Missing required argument: --flow-dir");
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const flowDir = path.resolve(args.flowDir);
|
|
188
|
+
const manifestPath = path.join(flowDir, "manifest.json");
|
|
189
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
190
|
+
const projectRoot = path.resolve(manifest.project);
|
|
191
|
+
const scriptPath = path.resolve(manifest.outputs.script);
|
|
192
|
+
const packageManager = detectPackageManager(projectRoot);
|
|
193
|
+
const browserName = args.browserName || "chromium";
|
|
194
|
+
const resolution = parseResolution(
|
|
195
|
+
args.videoResolution
|
|
196
|
+
?? manifest.artifacts?.human_final?.resolution
|
|
197
|
+
?? manifest.videoResolution
|
|
198
|
+
?? "fullhd"
|
|
199
|
+
);
|
|
200
|
+
const playwrightConfig = ["playwright.config.ts", "playwright.config.js"]
|
|
201
|
+
.map((file) => path.join(projectRoot, file))
|
|
202
|
+
.find((file) => fs.existsSync(file));
|
|
203
|
+
|
|
204
|
+
if (!playwrightConfig) {
|
|
205
|
+
updateManifest(manifestPath, {
|
|
206
|
+
status: "blocked",
|
|
207
|
+
reason: "Playwright configuration not found",
|
|
208
|
+
});
|
|
209
|
+
process.stdout.write("Playwright configuration not found.\n");
|
|
210
|
+
process.exit(0);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const testDir = detectTestDir(playwrightConfig);
|
|
214
|
+
const generatedDir = path.join(projectRoot, testDir, ".functional-doc-generated");
|
|
215
|
+
ensureDir(generatedDir);
|
|
216
|
+
const materializedScriptPath = path.join(generatedDir, path.basename(scriptPath));
|
|
217
|
+
fs.copyFileSync(scriptPath, materializedScriptPath);
|
|
218
|
+
const slug = path.basename(scriptPath, path.extname(scriptPath));
|
|
219
|
+
const { configPath: temporaryConfigPath, rawArtifactsDir } = createTemporaryPlaywrightConfig({
|
|
220
|
+
generatedDir,
|
|
221
|
+
flowDir,
|
|
222
|
+
baseUrl: manifest.baseUrl,
|
|
223
|
+
browserName,
|
|
224
|
+
resolution,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const commandArgs = ["exec", "playwright", "test", materializedScriptPath, "--config", temporaryConfigPath];
|
|
228
|
+
if (args.listOnly) {
|
|
229
|
+
commandArgs.push("--list");
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const result = spawnSync(
|
|
233
|
+
packageManager,
|
|
234
|
+
commandArgs,
|
|
235
|
+
{
|
|
236
|
+
cwd: projectRoot,
|
|
237
|
+
env: {
|
|
238
|
+
...process.env,
|
|
239
|
+
BASE_URL: manifest.baseUrl,
|
|
240
|
+
},
|
|
241
|
+
encoding: "utf8",
|
|
242
|
+
},
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
const logDir = path.join(flowDir, "evidence", "logs");
|
|
246
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
247
|
+
fs.writeFileSync(path.join(logDir, "playwright.stdout.log"), result.stdout ?? "");
|
|
248
|
+
fs.writeFileSync(path.join(logDir, "playwright.stderr.log"), result.stderr ?? "");
|
|
249
|
+
|
|
250
|
+
const copiedArtifacts = args.listOnly
|
|
251
|
+
? { videos: [], screenshots: [] }
|
|
252
|
+
: copyArtifacts(flowDir, slug, rawArtifactsDir);
|
|
253
|
+
|
|
254
|
+
updateManifest(manifestPath, {
|
|
255
|
+
status: args.listOnly ? (result.status === 0 ? "listed" : "list_failed") : (result.status === 0 ? "passed" : "failed"),
|
|
256
|
+
command: `${packageManager} ${commandArgs.join(" ")}`,
|
|
257
|
+
exitCode: result.status ?? 1,
|
|
258
|
+
videoResolution: resolution.label,
|
|
259
|
+
materializedScript: materializedScriptPath,
|
|
260
|
+
temporaryConfig: temporaryConfigPath,
|
|
261
|
+
video: copiedArtifacts.videos[0] ?? null,
|
|
262
|
+
videos: copiedArtifacts.videos,
|
|
263
|
+
screenshots: copiedArtifacts.screenshots,
|
|
264
|
+
logs: [
|
|
265
|
+
path.join(logDir, "playwright.stdout.log"),
|
|
266
|
+
path.join(logDir, "playwright.stderr.log"),
|
|
267
|
+
],
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
process.stdout.write(result.stdout ?? "");
|
|
271
|
+
process.stderr.write(result.stderr ?? "");
|
|
272
|
+
process.exit(result.status ?? 1);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
main();
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
<system_instructions>
|
|
2
|
-
You are a workspace help assistant. When invoked, present the user with a complete guide of available commands, their integration flows, and when to use each one.
|
|
3
|
-
|
|
4
|
-
## Behavior
|
|
5
|
-
|
|
6
|
-
- If invoked without arguments (`/help`): show the complete guide below
|
|
7
|
-
- If invoked with an argument (`/help create-prd`): show only the detailed section for that command
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Command Guide - AI Dev Workflow
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
This workspace uses an AI command system that automates the full development cycle: from planning (PRD) to merge (PR). Commands are in `ai/commands/` and are accessible in supported AI CLIs (e.g., Codex, Claude Code, OpenCode, GitHub Copilot), using the CLI prefix (`/command` or `$command`).
|
|
16
|
-
|
|
17
|
-
## Main Development Flow
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
┌──────────────┐ ┌─────────────────┐ ┌───────────────┐
|
|
21
|
-
│ /create-prd │────>│/create-techspec │────>│ /create-tasks │
|
|
22
|
-
│ (WHAT) │ │ (HOW) │ │ (WHEN) │
|
|
23
|
-
└──────────────┘ └─────────────────┘ └───────┬───────┘
|
|
24
|
-
│
|
|
25
|
-
┌─────────────┴─────────────┐
|
|
26
|
-
▼ ▼
|
|
27
|
-
┌────────────────┐ ┌─────────────────┐
|
|
28
|
-
│ /run-task │ │ /run-plan │
|
|
29
|
-
│ (one at a time)│ │ (all auto) │
|
|
30
|
-
└───────┬────────┘ └────────┬────────┘
|
|
31
|
-
│ │
|
|
32
|
-
└─────────┬─────────────────┘
|
|
33
|
-
│
|
|
34
|
-
▼
|
|
35
|
-
┌─────────────────┐
|
|
36
|
-
│ Validation Lv 1 │ (automatic, embedded)
|
|
37
|
-
│ criteria+tests │
|
|
38
|
-
└────────┬────────┘
|
|
39
|
-
│
|
|
40
|
-
┌──────────────┼──────────────┐
|
|
41
|
-
▼ ▼ ▼
|
|
42
|
-
┌──────────────┐ ┌──────────────┐ ┌─────────────────────┐
|
|
43
|
-
│ /run-qa │ │/review-impl. │ │ /code-review │
|
|
44
|
-
│ (visual QA) │ │(PRD compliance│ │ (formal code review)│
|
|
45
|
-
└──────────────┘ │ Level 2) │ │ (Level 3) │
|
|
46
|
-
└──────────────┘ └─────────────────────┘
|
|
47
|
-
│
|
|
48
|
-
┌───────────────┴───────────────┐
|
|
49
|
-
▼ ▼
|
|
50
|
-
┌──────────────┐ ┌────────────────┐
|
|
51
|
-
│ /commit │ │ /commit-all │
|
|
52
|
-
│ (one project)│ │ (submodules) │
|
|
53
|
-
└──────┬───────┘ └───────┬────────┘
|
|
54
|
-
│ │
|
|
55
|
-
└────────────┬────────────────────┘
|
|
56
|
-
▼
|
|
57
|
-
┌──────────────────┐
|
|
58
|
-
│ /generate-pr │
|
|
59
|
-
│ (push + PR + URL)│
|
|
60
|
-
└──────────────────┘
|
|
61
|
-
│
|
|
62
|
-
▼
|
|
63
|
-
┌──────────────────┐
|
|
64
|
-
│ /archive-prd │
|
|
65
|
-
│ (post-merge) │
|
|
66
|
-
└──────────────────┘
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Command Table
|
|
70
|
-
|
|
71
|
-
### Planning
|
|
72
|
-
|
|
73
|
-
| Command | What it does | Input | Output |
|
|
74
|
-
|---------|-------------|-------|--------|
|
|
75
|
-
| `/brainstorm` | Facilitates structured ideation before PRD or implementation | Problem, idea, or context | Options + trade-offs + recommendation |
|
|
76
|
-
| `/create-prd` | Creates PRD with min. 7 clarification questions | Feature description | `ai/spec/prd-[name]/prd.md` |
|
|
77
|
-
| `/create-techspec` | Creates technical specification from the PRD | PRD path | `ai/spec/prd-[name]/techspec.md` |
|
|
78
|
-
| `/create-tasks` | Breaks PRD+TechSpec into tasks (max 2 RFs/task) | PRD path | `ai/spec/prd-[name]/tasks.md` + `*_task.md` |
|
|
79
|
-
|
|
80
|
-
### Execution
|
|
81
|
-
|
|
82
|
-
| Command | What it does | Input | Output |
|
|
83
|
-
|---------|-------------|-------|--------|
|
|
84
|
-
| `/run-task` | Implements ONE task + Level 1 validation + commit | PRD path | Code + commit |
|
|
85
|
-
| `/run-plan` | Executes ALL tasks + final Level 2 review | PRD path | Code + commits + report |
|
|
86
|
-
| `/bugfix` | Analyzes and fixes bugs (bug vs feature triage) | Target + description | Fix + commit OR PRD (if feature) |
|
|
87
|
-
| `/fix-qa` | Fixes documented QA bugs and retests with evidence | PRD path | Code + `QA/bugs.md` + `QA/qa-report.md` updated |
|
|
88
|
-
|
|
89
|
-
### Research
|
|
90
|
-
|
|
91
|
-
| Command | What it does | Input | Output |
|
|
92
|
-
|---------|-------------|-------|--------|
|
|
93
|
-
| `/analyze-project` | Analyzes project structure and generates documentation | Project path | Architecture overview |
|
|
94
|
-
| `/deep-research` | Multi-source research with citation tracking and verification | Topic or question | Research report with bibliography |
|
|
95
|
-
|
|
96
|
-
### Quality (3 Levels)
|
|
97
|
-
|
|
98
|
-
| Level | Command | When | Generates Report? |
|
|
99
|
-
|-------|---------|------|-------------------|
|
|
100
|
-
| **1** | *(embedded in /run-task)* | After each task | No (terminal output) |
|
|
101
|
-
| **2** | `/review-implementation` | After all tasks / manual | Yes (formatted output) |
|
|
102
|
-
| **3** | `/code-review` | Before PR / manual | Yes (`code-review.md`) |
|
|
103
|
-
|
|
104
|
-
| Command | What it does | Input | Output |
|
|
105
|
-
|---------|-------------|-------|--------|
|
|
106
|
-
| `/run-qa` | Visual QA with Playwright MCP + accessibility | PRD path | `QA/qa-report.md` + `QA/screenshots/` + `QA/logs/` |
|
|
107
|
-
| `/review-implementation` | Compares PRD vs code (RFs, endpoints, tasks) | PRD path | Gap report |
|
|
108
|
-
| `/code-review` | Formal code review (quality, rules, tests) | PRD path | `code-review.md` |
|
|
109
|
-
| `/refactoring-analysis` | Audit code smells and refactoring opportunities (Fowler's catalog) | PRD path | `refactoring-analysis.md` |
|
|
110
|
-
|
|
111
|
-
### Versioning
|
|
112
|
-
|
|
113
|
-
| Command | What it does | Input | Output |
|
|
114
|
-
|---------|-------------|-------|--------|
|
|
115
|
-
| `/commit` | Semantic commit (Conventional Commits) | - | Commit |
|
|
116
|
-
| `/commit-all` | Commit across all submodules (inside-out) | - | Commits |
|
|
117
|
-
| `/generate-pr` | Push + create PR + copy body + open URL | Target branch | PR on GitHub |
|
|
118
|
-
|
|
119
|
-
### Maintenance
|
|
120
|
-
|
|
121
|
-
| Command | What it does | Input | Output |
|
|
122
|
-
|---------|-------------|-------|--------|
|
|
123
|
-
| `/list-tasks` | Lists tasks and progress for a PRD | PRD path | Status table |
|
|
124
|
-
| `/task-summary` | Shows details of a task without executing | Number + path | Task summary |
|
|
125
|
-
| `/archive-prd` | Moves completed PRD to `ai/archived/prd/` | PRD path | Archived PRD |
|
|
126
|
-
| `/help` | This command guide | (optional) command | This document |
|
|
127
|
-
|
|
128
|
-
## Review Architecture (3 Levels)
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
LEVEL 1 - Post-Task Validation (automatic, lightweight)
|
|
132
|
-
├── Embedded in /run-task
|
|
133
|
-
├── Verifies task acceptance criteria
|
|
134
|
-
├── Runs tests (pnpm test / npm test)
|
|
135
|
-
├── Checks basic patterns (types, imports)
|
|
136
|
-
├── No report file
|
|
137
|
-
└── If fails: PAUSES execution
|
|
138
|
-
|
|
139
|
-
LEVEL 2 - PRD Compliance (/review-implementation)
|
|
140
|
-
├── Compares ALL RFs from PRD vs actual code
|
|
141
|
-
├── Verifies ALL endpoints from TechSpec
|
|
142
|
-
├── Checks real status of each task (ignores checkboxes)
|
|
143
|
-
├── Identifies gaps, partial implementations, extra code
|
|
144
|
-
├── Called automatically at end of /run-plan
|
|
145
|
-
└── Available manually
|
|
146
|
-
|
|
147
|
-
LEVEL 3 - Formal Code Review (/code-review)
|
|
148
|
-
├── Everything from Level 2 +
|
|
149
|
-
├── Quality analysis (SOLID, DRY, complexity, security)
|
|
150
|
-
├── Conformance with project rules (ai/rules/)
|
|
151
|
-
├── Tests with coverage
|
|
152
|
-
├── Generates code-review.md in PRD directory
|
|
153
|
-
└── Status: APPROVED / WITH CAVEATS / REJECTED
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## Common Flows
|
|
157
|
-
|
|
158
|
-
### New Feature (Full)
|
|
159
|
-
```bash
|
|
160
|
-
/brainstorm "initial idea" # 0. Explore options and trade-offs
|
|
161
|
-
/create-prd # 1. Describe the feature
|
|
162
|
-
/create-techspec ai/spec/prd-name # 2. Generate tech spec
|
|
163
|
-
/create-tasks ai/spec/prd-name # 3. Break into tasks
|
|
164
|
-
/run-plan ai/spec/prd-name # 4. Execute all (includes Level 1+2)
|
|
165
|
-
/refactoring-analysis ai/spec/prd-name # 5. Audit code smells (optional)
|
|
166
|
-
/code-review ai/spec/prd-name # 6. Formal code review (Level 3)
|
|
167
|
-
/generate-pr main # 7. Create PR
|
|
168
|
-
/archive-prd ai/spec/prd-name # 8. After merge
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### New Feature (Incremental)
|
|
172
|
-
```bash
|
|
173
|
-
/brainstorm "initial idea" # 0. Explore options and trade-offs
|
|
174
|
-
/create-prd # 1. PRD
|
|
175
|
-
/create-techspec ai/spec/prd-name # 2. TechSpec
|
|
176
|
-
/create-tasks ai/spec/prd-name # 3. Tasks
|
|
177
|
-
/run-task ai/spec/prd-name # 4. Task 1 (with Level 1)
|
|
178
|
-
/run-task ai/spec/prd-name # 5. Task 2 (with Level 1)
|
|
179
|
-
# ... repeat for each task
|
|
180
|
-
/review-implementation ai/spec/prd-name # 6. PRD review (Level 2)
|
|
181
|
-
/code-review ai/spec/prd-name # 7. Code review (Level 3)
|
|
182
|
-
/generate-pr main # 8. PR
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Simple Bug
|
|
186
|
-
```bash
|
|
187
|
-
/bugfix "bug description" # Analyze and fix
|
|
188
|
-
/commit # Commit the fix
|
|
189
|
-
/generate-pr main # PR
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Complex Bug
|
|
193
|
-
```bash
|
|
194
|
-
/bugfix "description" --analysis # Generate analysis document
|
|
195
|
-
/create-techspec ai/spec/bugfix-name # TechSpec for the fix
|
|
196
|
-
/create-tasks ai/spec/bugfix-name # Tasks for the fix
|
|
197
|
-
/run-plan ai/spec/bugfix-name # Execute all
|
|
198
|
-
/generate-pr main # PR
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### Visual QA (Frontend)
|
|
202
|
-
```bash
|
|
203
|
-
/run-qa ai/spec/prd-name # QA with Playwright MCP
|
|
204
|
-
# If bugs found:
|
|
205
|
-
/bugfix "description" # Fix each bug
|
|
206
|
-
/fix-qa ai/spec/prd-name # Fix + retest full cycle
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
### Deep Research
|
|
210
|
-
```bash
|
|
211
|
-
/deep-research "topic or question" # Multi-source research with citations
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
## File Structure
|
|
215
|
-
|
|
216
|
-
```
|
|
217
|
-
your-project/
|
|
218
|
-
├── ai/
|
|
219
|
-
│ ├── commands/ # Source of truth for commands
|
|
220
|
-
│ │ ├── help.md # This guide
|
|
221
|
-
│ │ ├── brainstorm.md
|
|
222
|
-
│ │ ├── create-prd.md
|
|
223
|
-
│ │ ├── create-techspec.md
|
|
224
|
-
│ │ ├── create-tasks.md
|
|
225
|
-
│ │ ├── run-task.md
|
|
226
|
-
│ │ ├── run-plan.md
|
|
227
|
-
│ │ ├── run-qa.md
|
|
228
|
-
│ │ ├── code-review.md
|
|
229
|
-
│ │ ├── refactoring-analysis.md
|
|
230
|
-
│ │ ├── review-implementation.md
|
|
231
|
-
│ │ ├── analyze-project.md
|
|
232
|
-
│ │ ├── deep-research.md
|
|
233
|
-
│ │ ├── bugfix.md
|
|
234
|
-
│ │ ├── commit.md
|
|
235
|
-
│ │ ├── commit-all.md
|
|
236
|
-
│ │ ├── generate-pr.md
|
|
237
|
-
│ │ └── archive-prd.md
|
|
238
|
-
│ ├── templates/ # Document templates
|
|
239
|
-
│ │ ├── prd-template.md
|
|
240
|
-
│ │ ├── techspec-template.md
|
|
241
|
-
│ │ ├── tasks-template.md
|
|
242
|
-
│ │ ├── task-template.md
|
|
243
|
-
│ │ └── bugfix-template.md
|
|
244
|
-
│ ├── rules/ # Project-specific rules
|
|
245
|
-
│ │ └── *.md
|
|
246
|
-
│ ├── tasks/ # Active PRDs and tasks
|
|
247
|
-
│ │ └── prd-[name]/
|
|
248
|
-
│ │ ├── prd.md
|
|
249
|
-
│ │ ├── techspec.md
|
|
250
|
-
│ │ ├── tasks.md
|
|
251
|
-
│ │ └── *_task.md
|
|
252
|
-
│ └── archived/prd/ # Completed PRDs
|
|
253
|
-
├── .codex/skills/ # Codex skills
|
|
254
|
-
├── .claude/skills/ # Claude Code skills
|
|
255
|
-
├── .opencode/commands/ # OpenCode commands
|
|
256
|
-
└── .github/copilot-instructions.md # Copilot instructions
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
## Tool Integration
|
|
260
|
-
|
|
261
|
-
Commands work across multiple AI tools, all pointing to the same source `ai/commands/`:
|
|
262
|
-
|
|
263
|
-
| Tool | Location | Format |
|
|
264
|
-
|------|----------|--------|
|
|
265
|
-
| **Codex CLI** | `.codex/skills/*/SKILL.md` | Skill referencing `ai/commands/` |
|
|
266
|
-
| **Claude Code** | `.claude/skills/*/SKILL.md` | Skill referencing `ai/commands/` |
|
|
267
|
-
| **OpenCode** | `.opencode/commands/*.md` | Command referencing `ai/commands/` |
|
|
268
|
-
| **GitHub Copilot** | `.github/copilot-instructions.md` | Instructions listing the commands |
|
|
269
|
-
|
|
270
|
-
## FAQ
|
|
271
|
-
|
|
272
|
-
**Q: What is the difference between `/run-task` and `/run-plan`?**
|
|
273
|
-
- `/run-task` executes ONE task with manual control between each one
|
|
274
|
-
- `/run-plan` executes ALL automatically with a final review
|
|
275
|
-
|
|
276
|
-
**Q: Do I need to run `/review-implementation` manually?**
|
|
277
|
-
- Not if using `/run-plan` (already included). Yes if using `/run-task` incrementally.
|
|
278
|
-
|
|
279
|
-
**Q: When to use `/code-review` vs `/review-implementation`?**
|
|
280
|
-
- `/review-implementation` (Level 2): Checks if PRD RFs were implemented
|
|
281
|
-
- `/code-review` (Level 3): Additionally analyzes code quality and generates a formal report
|
|
282
|
-
|
|
283
|
-
**Q: Does `/bugfix` always fix directly?**
|
|
284
|
-
- No. It performs triage. If it is a feature (not a bug), it redirects to `/create-prd`. If it is a complex bug, it can generate an analysis document with `--analysis`.
|
|
285
|
-
|
|
286
|
-
**Q: When should I use `/deep-research`?**
|
|
287
|
-
- For comprehensive multi-source analysis, technology comparisons, state-of-the-art reviews, or any topic requiring cited evidence. Not for simple lookups or debugging.
|
|
288
|
-
|
|
289
|
-
</system_instructions>
|