devflow-prompts 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/README.md +914 -0
- package/bin/cli.js +100 -0
- package/flows/devflow.0-gen-rules.prompt.md +335 -0
- package/flows/devflow.0-rev-rules.prompt.md +156 -0
- package/flows/devflow.1-gen-requirement.prompt.md +279 -0
- package/flows/devflow.1-rev-requirement.prompt.md +206 -0
- package/flows/devflow.2-gen-design.prompt.md +217 -0
- package/flows/devflow.2-rev-design.prompt.md +132 -0
- package/flows/devflow.3-gen-code.prompt.md +155 -0
- package/flows/devflow.3-rev-code.prompt.md +150 -0
- package/flows/devflow.4-gen-test-plan.prompt.md +171 -0
- package/flows/devflow.4-rev-test-plan.prompt.md +124 -0
- package/flows/devflow.5-gen-test-code.prompt.md +114 -0
- package/flows/devflow.5-rev-test-code.prompt.md +131 -0
- package/flows/devflow.6-analyze.prompt.md +240 -0
- package/gen-chat.sh +58 -0
- package/index.js +4 -0
- package/package.json +25 -0
- package/raws/.gitkeep +0 -0
- package/raws/changename.md +7 -0
- package/raws/my-project-rules.txt +7 -0
- package/rules/.gitkeep +0 -0
- package/scripts/setup-devflow-chat-antigravity.sh +44 -0
- package/scripts/setup-devflow-chat-vscode.sh +111 -0
- package/specs/.gitkeep +0 -0
- package/templates/gen-requirement-template.txt +26 -0
- package/templates/gen-rule-template.txt +17 -0
package/bin/cli.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const args = process.argv.slice(2);
|
|
7
|
+
const command = args[0];
|
|
8
|
+
const force = args.includes('--force');
|
|
9
|
+
|
|
10
|
+
if (command !== 'init' && command !== 'publish') {
|
|
11
|
+
console.log('Usage: npx devflow-prompts init [--force]');
|
|
12
|
+
console.log(' npx devflow-prompts publish [--force]');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const sourceRoot = path.join(__dirname, '..');
|
|
17
|
+
const targetRoot = path.join(process.cwd(), 'devflow-prompts');
|
|
18
|
+
|
|
19
|
+
const itemsToCopy = ['flows', 'rules', 'scripts', 'templates', 'README.md', 'gen-chat.sh'];
|
|
20
|
+
|
|
21
|
+
console.log(`\nš Initializing DevFlow Prompts...`);
|
|
22
|
+
console.log(`Source: ${sourceRoot}`);
|
|
23
|
+
console.log(`Target: ${targetRoot}\n`);
|
|
24
|
+
|
|
25
|
+
if (!fs.existsSync(targetRoot)) {
|
|
26
|
+
fs.mkdirSync(targetRoot, { recursive: true });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async function copyFile(src, dest) {
|
|
30
|
+
try {
|
|
31
|
+
const srcContent = fs.readFileSync(src);
|
|
32
|
+
|
|
33
|
+
if (fs.existsSync(dest)) {
|
|
34
|
+
if (force) {
|
|
35
|
+
fs.writeFileSync(dest, srcContent);
|
|
36
|
+
console.log(` [OVERWRITE] ${path.relative(process.cwd(), dest)}`);
|
|
37
|
+
} else {
|
|
38
|
+
const destContent = fs.readFileSync(dest);
|
|
39
|
+
if (srcContent.equals(destContent)) {
|
|
40
|
+
// Identical, do nothing or log verbose
|
|
41
|
+
// console.log(` [SKIP] ${path.relative(process.cwd(), dest)} (Identical)`);
|
|
42
|
+
} else {
|
|
43
|
+
const newDest = dest + '.new';
|
|
44
|
+
fs.writeFileSync(newDest, srcContent);
|
|
45
|
+
console.log(` [CONFLICT] ${path.relative(process.cwd(), dest)} exists with different content.`);
|
|
46
|
+
console.log(` -> Created ${path.relative(process.cwd(), newDest)}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
fs.writeFileSync(dest, srcContent);
|
|
51
|
+
console.log(` [CREATE] ${path.relative(process.cwd(), dest)}`);
|
|
52
|
+
}
|
|
53
|
+
} catch (err) {
|
|
54
|
+
console.error(` [ERROR] Failed to copy ${src}: ${err.message}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function copyDir(src, dest) {
|
|
59
|
+
if (!fs.existsSync(dest)) {
|
|
60
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
64
|
+
|
|
65
|
+
for (const entry of entries) {
|
|
66
|
+
const srcPath = path.join(src, entry.name);
|
|
67
|
+
const destPath = path.join(dest, entry.name);
|
|
68
|
+
|
|
69
|
+
// Ignore node_modules and hidden files (except specific ones if needed)
|
|
70
|
+
if (entry.name === 'node_modules' || entry.name === '.git' || entry.name === 'package.json' || entry.name === 'bin') {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (entry.isDirectory()) {
|
|
75
|
+
await copyDir(srcPath, destPath);
|
|
76
|
+
} else {
|
|
77
|
+
await copyFile(srcPath, destPath);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
(async () => {
|
|
83
|
+
for (const item of itemsToCopy) {
|
|
84
|
+
const srcPath = path.join(sourceRoot, item);
|
|
85
|
+
const destPath = path.join(targetRoot, item);
|
|
86
|
+
|
|
87
|
+
if (!fs.existsSync(srcPath)) {
|
|
88
|
+
console.warn(` [WARN] Source item not found: ${item}`);
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const stats = fs.statSync(srcPath);
|
|
93
|
+
if (stats.isDirectory()) {
|
|
94
|
+
await copyDir(srcPath, destPath);
|
|
95
|
+
} else {
|
|
96
|
+
await copyFile(srcPath, destPath);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
console.log(`\nā
Done! Run 'cd devflow-prompts' to check the files.`);
|
|
100
|
+
})();
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Initialize workflow rules for project (requirement, design, code, test)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /devflow.0-gen-rules
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
Create workflow rules for all SDLC steps. Each step has 2 rules: gen-rule (for generation) and rev-rule (for review).
|
|
9
|
+
|
|
10
|
+
**Steps covered:**
|
|
11
|
+
- Step 1: Requirement (how to write & review requirements)
|
|
12
|
+
- Step 2: Design (how to write & review technical designs)
|
|
13
|
+
- Step 3: Code (how to write & review code)
|
|
14
|
+
- Step 4: Test Plan (how to write & review test plans)
|
|
15
|
+
- Step 5: Test Code (how to write & review test code)
|
|
16
|
+
|
|
17
|
+
## Input Requirements
|
|
18
|
+
|
|
19
|
+
**Input Type: File Path (Required)**
|
|
20
|
+
- Provides path to a text file containing Step, Stack, Architecture, etc.
|
|
21
|
+
- **File can be located anywhere** (not limited to `/devflow-prompts`)
|
|
22
|
+
- Template file available at: `/devflow-prompts/templates/gen-rule-template.txt`
|
|
23
|
+
- Format inside file:
|
|
24
|
+
```text
|
|
25
|
+
Step: ...
|
|
26
|
+
Stack: ...
|
|
27
|
+
Architecture: ...
|
|
28
|
+
Team: ...
|
|
29
|
+
Constraints: ...
|
|
30
|
+
Language: ...
|
|
31
|
+
```
|
|
32
|
+
- AI will automatically read the file.
|
|
33
|
+
|
|
34
|
+
## Input Validation
|
|
35
|
+
|
|
36
|
+
- **Step**:
|
|
37
|
+
- Must be `1`, `2`, `3`, `4`, `5` (generates gen + rev)
|
|
38
|
+
- OR `all` (generates 10 files)
|
|
39
|
+
- OR specific suffix: `1-gen`, `1-rev`, `2-gen`, etc.
|
|
40
|
+
- **Stack**: Required field, cannot be empty
|
|
41
|
+
- **Architecture**: Required field, cannot be empty
|
|
42
|
+
- **Language**:
|
|
43
|
+
- If specified, MUST be one of: `en`, `vi`, `ja`, `ko`.
|
|
44
|
+
- If invalid language provided -> Validation FAILS.
|
|
45
|
+
|
|
46
|
+
**If validation fails**: Stop immediately and output error message.
|
|
47
|
+
|
|
48
|
+
## Output Format
|
|
49
|
+
|
|
50
|
+
### Output Location:
|
|
51
|
+
- **Base directory**: `<repo_root>/devflow-prompts/rules/`
|
|
52
|
+
- **Auto-creation**: Directory will be created automatically if it doesn't exist
|
|
53
|
+
- **File handling**: Existing files will be overwritten. **Review carefully before running.**
|
|
54
|
+
|
|
55
|
+
### Rules Structure:
|
|
56
|
+
```
|
|
57
|
+
/devflow-prompts/rules/
|
|
58
|
+
āāā devflow.1-gen-requirement.rule.md
|
|
59
|
+
āāā devflow.1-rev-requirement.rule.md
|
|
60
|
+
āāā devflow.2-gen-design.rule.md
|
|
61
|
+
āāā devflow.2-rev-design.rule.md
|
|
62
|
+
āāā devflow.3-gen-code.rule.md
|
|
63
|
+
āāā devflow.3-rev-code.rule.md
|
|
64
|
+
āāā devflow.4-gen-test-plan.rule.md
|
|
65
|
+
āāā devflow.4-rev-test-plan.rule.md
|
|
66
|
+
āāā devflow.5-gen-test-code.rule.md
|
|
67
|
+
āāā devflow.5-rev-test-code.rule.md
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Rule Content by Step:
|
|
71
|
+
|
|
72
|
+
**Step 1 (Requirement):**
|
|
73
|
+
- `devflow.1-gen-requirement.rule.md`: Guidelines for converting raw request ā requirement document
|
|
74
|
+
- What to include, what to avoid
|
|
75
|
+
- Template structure requirements
|
|
76
|
+
- Acceptance criteria format
|
|
77
|
+
- Edge case documentation
|
|
78
|
+
- `devflow.1-rev-requirement.rule.md`: Checklist for reviewing requirement documents
|
|
79
|
+
- Completeness checks
|
|
80
|
+
- Clarity verification
|
|
81
|
+
- Testability assessment
|
|
82
|
+
- Common mistakes to catch
|
|
83
|
+
|
|
84
|
+
**Step 2 (Design):**
|
|
85
|
+
- `devflow.2-gen-design.rule.md`: Guidelines for creating tech design from requirement
|
|
86
|
+
- Architecture principles (Clean Architecture, etc.)
|
|
87
|
+
- Security requirements
|
|
88
|
+
- API specification format
|
|
89
|
+
- Data model design rules
|
|
90
|
+
- `devflow.2-rev-design.rule.md`: Checklist for reviewing tech design
|
|
91
|
+
- Architecture compliance
|
|
92
|
+
- Security verification
|
|
93
|
+
- API completeness
|
|
94
|
+
- Implementation feasibility
|
|
95
|
+
|
|
96
|
+
**Step 3 (Code):**
|
|
97
|
+
- `devflow.3-gen-code.rule.md`: Coding standards and conventions
|
|
98
|
+
- Backend/Frontend coding rules
|
|
99
|
+
- Layer separation
|
|
100
|
+
- Error handling patterns
|
|
101
|
+
- Security implementation
|
|
102
|
+
- `devflow.3-rev-code.rule.md`: Code review checklist
|
|
103
|
+
- Code quality checks
|
|
104
|
+
- Security verification
|
|
105
|
+
- Performance considerations
|
|
106
|
+
- Test coverage requirements
|
|
107
|
+
|
|
108
|
+
**Step 4 (Test Plan):**
|
|
109
|
+
- `devflow.4-gen-test-plan.rule.md`: Guidelines for creating test plans
|
|
110
|
+
- Test level strategy (unit/integration/E2E)
|
|
111
|
+
- Coverage requirements
|
|
112
|
+
- Test case format
|
|
113
|
+
- Mock/stub guidelines
|
|
114
|
+
- `devflow.4-rev-test-plan.rule.md`: Test plan review checklist
|
|
115
|
+
- Coverage verification
|
|
116
|
+
- Test case quality
|
|
117
|
+
- Edge case inclusion
|
|
118
|
+
- Feasibility assessment
|
|
119
|
+
|
|
120
|
+
**Step 5 (Test Code):**
|
|
121
|
+
- `devflow.5-gen-test-code.rule.md`: Test code writing standards
|
|
122
|
+
- Test structure conventions
|
|
123
|
+
- Assertion best practices
|
|
124
|
+
- Test data management
|
|
125
|
+
- Deterministic test requirements
|
|
126
|
+
- `devflow.5-rev-test-code.rule.md`: Test code review checklist
|
|
127
|
+
- Test quality verification
|
|
128
|
+
- Coverage confirmation
|
|
129
|
+
- Reliability checks
|
|
130
|
+
- Maintainability assessment
|
|
131
|
+
|
|
132
|
+
## Prompt
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
You are my engineering standards writer.
|
|
136
|
+
|
|
137
|
+
LANGUAGE SETTING:
|
|
138
|
+
- Default: English (en)
|
|
139
|
+
- User can override by adding "Language: {vi|ja|ko}" in input
|
|
140
|
+
- Write in the specified language
|
|
141
|
+
|
|
142
|
+
INPUT:
|
|
143
|
+
<<<
|
|
144
|
+
{USER INPUT HERE - Can be a file path OR direct input with Step, Stack, Architecture, etc.}
|
|
145
|
+
>>>
|
|
146
|
+
|
|
147
|
+
INSTRUCTIONS:
|
|
148
|
+
|
|
149
|
+
1. **Read Input File**:
|
|
150
|
+
- The user will provide a file path.
|
|
151
|
+
- USE `view_file` tool to read its content.
|
|
152
|
+
- **Fallback**: If the tool is unavailable or fails, ask the user to paste the file content directly.
|
|
153
|
+
- File paths can be anywhere in the filesystem, not limited to `/devflow-prompts`.
|
|
154
|
+
|
|
155
|
+
2. **Parse Information**:
|
|
156
|
+
- Extract **Step** (required): Which step/rule to generate
|
|
157
|
+
- Extract **Stack** (required): Technology stack
|
|
158
|
+
- Extract **Architecture** (required): Architecture pattern
|
|
159
|
+
- Extract **Team** (optional): Team context
|
|
160
|
+
- Extract **Constraints** (optional): Project constraints
|
|
161
|
+
- Extract **Language** (optional): Output language (default: en)
|
|
162
|
+
|
|
163
|
+
TASK:
|
|
164
|
+
Generate gen-rule and rev-rule files based on STEP parameter:
|
|
165
|
+
- If Step = `1`, `2`,... ā Generate BOTH gen-rule and rev-rule for that step.
|
|
166
|
+
- If Step = `all` ā Generate ALL 10 files.
|
|
167
|
+
- If Step = `X-gen` ā Generate ONLY `devflow.X-gen-....rule.md`.
|
|
168
|
+
- If Step = `X-rev` ā Generate ONLY `devflow.X-rev-....rule.md`.
|
|
169
|
+
|
|
170
|
+
Follow the 9-section template structure defined below.
|
|
171
|
+
|
|
172
|
+
STYLE RULES:
|
|
173
|
+
- Use imperative tone (e.g., "Do this", not "You should do this")
|
|
174
|
+
- Use bullet points, not paragraphs, for rules
|
|
175
|
+
- Avoid marketing language; be technical and precise
|
|
176
|
+
|
|
177
|
+
COMMON REQUIREMENTS (apply to ALL steps):
|
|
178
|
+
|
|
179
|
+
**Every gen-rule file MUST include:**
|
|
180
|
+
1. Principles: What makes a good {artifact} (MUST/SHOULD/SHOULD NOT)
|
|
181
|
+
2. Specific guidelines and conventions tailored to Stack & Architecture
|
|
182
|
+
3. Examples (Good vs Bad) with real code/content
|
|
183
|
+
4. Common mistakes to avoid
|
|
184
|
+
5. **CRITICAL**: In Section 3 (Project Structure), you MUST document the explicit paths to key directories (e.g., `src/`, `app/`, `tests/`). This allows future AI steps to find files automatically.
|
|
185
|
+
6. Follow the template EXACTLY: Principles ā Architecture & Boundaries ā Project Structure ā
|
|
186
|
+
Implementation Rules ā Error Handling & Logging ā Testing Rules ā Security ā
|
|
187
|
+
PR Checklist ā Examples
|
|
188
|
+
|
|
189
|
+
**Every rev-rule file MUST include:**
|
|
190
|
+
1. Completeness checklist (all sections present?)
|
|
191
|
+
2. Quality standards (specific, actionable criteria)
|
|
192
|
+
3. Common issues to look for
|
|
193
|
+
4. Review questions to ask
|
|
194
|
+
5. Sign-off criteria (when to approve/reject)
|
|
195
|
+
|
|
196
|
+
**General rules:**
|
|
197
|
+
- Make rules practical, testable, and enforceable in PR review
|
|
198
|
+
- Tailor to the specified Stack and Architecture
|
|
199
|
+
- Use concrete examples, not abstract theory
|
|
200
|
+
- **Template Consistency**: Keep all 9 sections. If a section is not applicable, explicitly write "Not applicable for this step." (DO NOT remove the header).
|
|
201
|
+
|
|
202
|
+
STEP-SPECIFIC FOCUS (only the delta for each step):
|
|
203
|
+
|
|
204
|
+
**Step 1 (Requirement) - Files: devflow.1-gen-requirement.rule.md, devflow.1-rev-requirement.rule.md**
|
|
205
|
+
- gen: Acceptance criteria format, edge case documentation, error scenarios, what to avoid (inventing requirements, vague criteria)
|
|
206
|
+
- rev: Testability assessment, ambiguity checks, contradiction detection
|
|
207
|
+
|
|
208
|
+
**Step 2 (Design) - Files: devflow.2-gen-design.rule.md, devflow.2-rev-design.rule.md**
|
|
209
|
+
- gen: Architecture principles (based on specified approach), security patterns, API specs (endpoints, request/response, errors), data model (migrations, indexes), observability (logs, metrics, tracing)
|
|
210
|
+
- rev: Architecture compliance, security verification, API completeness, data model safety, implementation feasibility
|
|
211
|
+
|
|
212
|
+
**Step 3 (Code) - Files: devflow.3-gen-code.rule.md, devflow.3-rev-code.rule.md**
|
|
213
|
+
- gen: Layer separation (domain/application/infrastructure), naming conventions (classes, functions, variables), error handling patterns, security implementation, performance best practices
|
|
214
|
+
- rev: Code quality (readability, maintainability), architecture compliance, security vulnerabilities, performance considerations, test coverage, code smells
|
|
215
|
+
|
|
216
|
+
**Step 4 (Test Plan) - Files: devflow.4-gen-test-plan.rule.md, devflow.4-rev-test-plan.rule.md**
|
|
217
|
+
- gen: Test strategy (unit/integration/E2E), coverage requirements, test case format, mock/stub guidelines, test data requirements
|
|
218
|
+
- rev: Coverage verification (all use cases covered?), test case quality, edge case inclusion, feasibility
|
|
219
|
+
|
|
220
|
+
**Step 5 (Test Code) - Files: devflow.5-gen-test-code.rule.md, devflow.5-rev-test-code.rule.md**
|
|
221
|
+
- gen: Test structure (AAA pattern), assertion best practices, test data management, deterministic tests (no flaky tests), mocking guidelines
|
|
222
|
+
- rev: Test quality, coverage confirmation, reliability (no flaky tests), maintainability
|
|
223
|
+
|
|
224
|
+
**Step 'all':**
|
|
225
|
+
- Generate ALL 10 files (5 steps Ć 2 rules each)
|
|
226
|
+
|
|
227
|
+
OUTPUT FORMAT:
|
|
228
|
+
- Return file contents in separate sections with exact filenames as headings
|
|
229
|
+
- Each file should be production-ready and immediately usable
|
|
230
|
+
|
|
231
|
+
STRICT OUTPUT RULE:
|
|
232
|
+
- Output ONLY file contents
|
|
233
|
+
- No intro/outro text
|
|
234
|
+
- No explanations
|
|
235
|
+
- No summaries
|
|
236
|
+
- No notes
|
|
237
|
+
|
|
238
|
+
SELF-CHECK BEFORE OUTPUT:
|
|
239
|
+
1. Verify all required files for the Step are generated.
|
|
240
|
+
2. Verify filenames match exactly (e.g., `devflow.1-gen-requirement.rule.md`).
|
|
241
|
+
3. Verify all 9 sections are present in every file.
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Template for each *-rule.md
|
|
245
|
+
|
|
246
|
+
```markdown
|
|
247
|
+
# {Rule Name}
|
|
248
|
+
|
|
249
|
+
## 1) Principles
|
|
250
|
+
- MUST:
|
|
251
|
+
- SHOULD:
|
|
252
|
+
- SHOULD NOT:
|
|
253
|
+
|
|
254
|
+
## 2) Architecture & Boundaries
|
|
255
|
+
- Allowed dependencies:
|
|
256
|
+
- Forbidden dependencies:
|
|
257
|
+
|
|
258
|
+
## 3) Project Structure
|
|
259
|
+
- **Root Directories** (CRITICAL: Must specify absolute or relative paths from repo root):
|
|
260
|
+
- Folders structure:
|
|
261
|
+
- Naming conventions:
|
|
262
|
+
|
|
263
|
+
## 4) Implementation Rules
|
|
264
|
+
- Patterns:
|
|
265
|
+
- Anti-patterns:
|
|
266
|
+
|
|
267
|
+
## 5) Error Handling & Logging
|
|
268
|
+
- Rules:
|
|
269
|
+
- Examples:
|
|
270
|
+
|
|
271
|
+
## 6) Testing Rules
|
|
272
|
+
- Unit:
|
|
273
|
+
- Integration:
|
|
274
|
+
- E2E:
|
|
275
|
+
|
|
276
|
+
## 7) Security (if applicable)
|
|
277
|
+
- Rules:
|
|
278
|
+
- Examples:
|
|
279
|
+
|
|
280
|
+
## 8) PR Checklist
|
|
281
|
+
- [ ] ...
|
|
282
|
+
- [ ] ...
|
|
283
|
+
|
|
284
|
+
## 9) Examples
|
|
285
|
+
### Good
|
|
286
|
+
```txt
|
|
287
|
+
...
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Bad
|
|
291
|
+
```txt
|
|
292
|
+
...
|
|
293
|
+
```
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
## Rules/Guidelines
|
|
297
|
+
1. ā
Rules must be **practical** - can be applied immediately
|
|
298
|
+
2. ā
Rules must be **testable** - can be checked in PR/CI
|
|
299
|
+
3. ā
Rules must be **enforceable** - clear, not ambiguous
|
|
300
|
+
4. ā Avoid overly idealistic rules that are impractical
|
|
301
|
+
5. ā
Each rule must have Good vs Bad examples
|
|
302
|
+
|
|
303
|
+
## Usage Example
|
|
304
|
+
|
|
305
|
+
### Example 1: Generate all rules
|
|
306
|
+
```bash
|
|
307
|
+
/devflow.0-gen-rules /path/to/my-project-rules.txt
|
|
308
|
+
# ā Generates all 10 files in /devflow-prompts/rules/ (step1-5, each with gen + rev)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
ā ļø **Warning**: This will overwrite existing rule files. Commit your changes first!
|
|
312
|
+
|
|
313
|
+
### Example 2: Generate only step 1 rules (Requirement)
|
|
314
|
+
```bash
|
|
315
|
+
# In your input file: Step: 1
|
|
316
|
+
/devflow.0-gen-rules /path/to/step1-rules.txt
|
|
317
|
+
# ā Generates: devflow.1-gen-requirement.rule.md, devflow.1-rev-requirement.rule.md
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
### Example 3: Generate step 2 rules (Design)
|
|
321
|
+
```bash
|
|
322
|
+
# In your input file: Step: 2
|
|
323
|
+
/devflow.0-gen-rules /path/to/step2-rules.txt
|
|
324
|
+
# ā Generates: devflow.2-gen-design.rule.md, devflow.2-rev-design.rule.md
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Example 4: Generate step 3 rules (Code) in Vietnamese
|
|
328
|
+
```bash
|
|
329
|
+
# In your input file: Language: vi
|
|
330
|
+
/devflow.0-gen-rules /path/to/step3-vi-rules.txt
|
|
331
|
+
# ā Generates: devflow.3-gen-code.rule.md, devflow.3-rev-code.rule.md (in Vietnamese)
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Next Steps
|
|
335
|
+
After generating workflow rules ā run `/devflow.0-rev-rules` to review and improve
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Review and improve workflow rules for consistency
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# /devflow.0-rev-rules
|
|
6
|
+
|
|
7
|
+
## Description
|
|
8
|
+
Review and improve workflow rules for all SDLC steps. Detect contradictions, gaps, and suggest improvements.
|
|
9
|
+
|
|
10
|
+
**Steps covered:**
|
|
11
|
+
- Step 1: Requirement rules (gen + rev)
|
|
12
|
+
- Step 2: Design rules (gen + rev)
|
|
13
|
+
- Step 3: Code rules (gen + rev)
|
|
14
|
+
- Step 4: Test Plan rules (gen + rev)
|
|
15
|
+
- Step 5: Test Code rules (gen + rev)
|
|
16
|
+
|
|
17
|
+
## Input Requirements
|
|
18
|
+
|
|
19
|
+
**Input Type: File Path OR Directory Path (Required)**
|
|
20
|
+
- **File Path**: Reviews that specific rule file.
|
|
21
|
+
- **Directory Path**: Reviews ALL rule files (`*.rule.md`) in that directory.
|
|
22
|
+
- **Files/Dirs can be located anywhere** (not limited to `/devflow-prompts`)
|
|
23
|
+
- Example File: `/path/to/devflow.1-gen-requirement.rule.md`
|
|
24
|
+
- Example Dir: `/path/to/devflow-prompts/rules/`
|
|
25
|
+
- AI will automatically read the files
|
|
26
|
+
|
|
27
|
+
## Input Validation
|
|
28
|
+
|
|
29
|
+
- **Input Path**: Must be a valid file or directory path.
|
|
30
|
+
- **Rule Content**:
|
|
31
|
+
- If Directory: Must contain valid `.rule.md` files.
|
|
32
|
+
- If File: Must be a valid `.rule.md` file (or text file with rule definitions).
|
|
33
|
+
- **Step Identification**: AI must be able to infer the Step ID (1-5) from the filename (e.g., `devflow.1-...`) or content.
|
|
34
|
+
|
|
35
|
+
**If validation fails**: Stop immediately and output error message.
|
|
36
|
+
|
|
37
|
+
## Output Format
|
|
38
|
+
1. **Issues list** (grouped by priority P0/P1/P2)
|
|
39
|
+
2. **Patched versions** of the files (full updated content)
|
|
40
|
+
|
|
41
|
+
## Prompt
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
You are a senior staff engineer reviewing workflow rules.
|
|
45
|
+
|
|
46
|
+
INPUT:
|
|
47
|
+
<<<
|
|
48
|
+
{USER INPUT HERE - Can be file paths OR rule file contents}
|
|
49
|
+
>>>
|
|
50
|
+
|
|
51
|
+
INSTRUCTIONS:
|
|
52
|
+
|
|
53
|
+
1. **Read Input**:
|
|
54
|
+
- IF input is a **Directory**:
|
|
55
|
+
- USE `list_dir` or `find_by_name` to find all files ending in `.rule.md`.
|
|
56
|
+
- **Fallback**: If directory listing tools are unavailable, ask user to provide file paths explicitly.
|
|
57
|
+
- USE `view_file` to read ALL found rule files.
|
|
58
|
+
- IF input is a **File**:
|
|
59
|
+
- USE `view_file` to read the file directly.
|
|
60
|
+
- IF input is NOT a path, ask user to provide a path.
|
|
61
|
+
|
|
62
|
+
2. **Identify Step**:
|
|
63
|
+
- Determine which step(s) to review from filenames or user specification
|
|
64
|
+
- Step: {STEP NUMBER - 1, 2, 3, 4, 5, or 'all'}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
REVIEW TASKS:
|
|
69
|
+
1. **Detect contradictions**: Find conflicts between gen-rule and rev-rule
|
|
70
|
+
2. **Identify missing enforcement**: What can be checked in PR/CI?
|
|
71
|
+
3. **Add concrete examples**: Replace vague rules with specific examples
|
|
72
|
+
4. **Ensure realistic**: Rules must be practical, not overly idealistic
|
|
73
|
+
5. **Check rev-rule checklists**: Must be comprehensive and actionable
|
|
74
|
+
6. **Verify gen-rule guidelines**: Must be clear and implementable
|
|
75
|
+
7. **Cross-step consistency**: Ensure rules don't conflict across steps
|
|
76
|
+
|
|
77
|
+
INTENT PRESERVATION RULE:
|
|
78
|
+
- Do not change the original intent of rules unless resolving a P0 contradiction.
|
|
79
|
+
|
|
80
|
+
OUTPUT FORMAT:
|
|
81
|
+
1. **Issues List** (grouped by priority):
|
|
82
|
+
- P0 (Critical - Must fix): Contradictions, missing critical rules
|
|
83
|
+
- P1 (Important - Should fix): Missing enforcement, vague rules
|
|
84
|
+
- P2 (Nice-to-have): Formatting, additional examples
|
|
85
|
+
|
|
86
|
+
2. **Patched Files**: Full updated content for each file
|
|
87
|
+
- Include all fixes from P0 and P1
|
|
88
|
+
- Mark changes with brief inline comments ONLY for non-obvious fixes
|
|
89
|
+
- Ensure production-ready quality
|
|
90
|
+
|
|
91
|
+
STRICT OUTPUT RULE:
|
|
92
|
+
- Output ONLY:
|
|
93
|
+
1) Issues List
|
|
94
|
+
2) Patched Files
|
|
95
|
+
- No explanations outside these sections
|
|
96
|
+
- No summaries
|
|
97
|
+
- No meta commentary
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Rules/Guidelines
|
|
101
|
+
1. ā
Detect **contradictions** - conflicts between rules
|
|
102
|
+
2. ā
Identify **enforcement points** - what can be auto-checked
|
|
103
|
+
3. ā
Add **concrete examples** - for vague rules
|
|
104
|
+
4. ā
Ensure **realistic** - rules must be practical, not overly idealistic
|
|
105
|
+
5. ā
Prioritize fixes: P0 (critical) ā P1 (important) ā P2 (nice-to-have)
|
|
106
|
+
|
|
107
|
+
## Priority Levels
|
|
108
|
+
|
|
109
|
+
### P0 (Critical - Must fix)
|
|
110
|
+
- Contradictions between rules
|
|
111
|
+
- Missing critical security/safety rules
|
|
112
|
+
- Rules that cannot be enforced
|
|
113
|
+
|
|
114
|
+
### P1 (Important - Should fix)
|
|
115
|
+
- Missing enforcement points
|
|
116
|
+
- Vague rules needing examples
|
|
117
|
+
- Incomplete checklists
|
|
118
|
+
|
|
119
|
+
### P2 (Nice-to-have - Can fix later)
|
|
120
|
+
- Formatting improvements
|
|
121
|
+
- Additional examples
|
|
122
|
+
- Documentation enhancements
|
|
123
|
+
|
|
124
|
+
## Usage Example
|
|
125
|
+
|
|
126
|
+
### Option 1: Review Single File
|
|
127
|
+
```bash
|
|
128
|
+
/devflow.0-rev-rules /path/to/devflow.1-gen-requirement.rule.md
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Option 2: Review Directory (All Rules)
|
|
132
|
+
```bash
|
|
133
|
+
/devflow.0-rev-rules /path/to/devflow-prompts/rules/
|
|
134
|
+
# ā Finds and reviews all *.rule.md files in that folder
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Common Issues to Look For
|
|
138
|
+
|
|
139
|
+
### Contradictions
|
|
140
|
+
- Architecture rule requires X but BE rule forbids X
|
|
141
|
+
- Test rule conflicts with Implementation rule
|
|
142
|
+
|
|
143
|
+
### Missing Enforcement
|
|
144
|
+
- Rule says "should be clean" but doesn't define "clean"
|
|
145
|
+
- No checklist to verify rule is followed
|
|
146
|
+
|
|
147
|
+
### Vague Rules
|
|
148
|
+
- "Code should be maintainable" ā need to define metrics
|
|
149
|
+
- "Use appropriate patterns" ā need to list specific patterns
|
|
150
|
+
|
|
151
|
+
### Unrealistic Rules
|
|
152
|
+
- "100% test coverage" ā may not be practical
|
|
153
|
+
- "Never use if-else" ā too extreme
|
|
154
|
+
|
|
155
|
+
## Next Steps
|
|
156
|
+
After reviewing and improving workflow rules ā Start using them with `/devflow.1-gen-requirement`
|