devflow-prompts 1.0.0 → 1.0.2
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 +44 -51
- package/bin/cli.js +64 -5
- package/package.json +1 -1
- package/gen-chat.sh +0 -58
package/README.md
CHANGED
|
@@ -9,16 +9,12 @@ To install DevFlow Prompts in your project:
|
|
|
9
9
|
```bash
|
|
10
10
|
# Initialize in your project root
|
|
11
11
|
npm install devflow-prompts
|
|
12
|
-
npx devflow-prompts
|
|
12
|
+
npx devflow-prompts publish
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
This will create a `devflow-prompts/` directory in your project with all necessary prompts, scripts, and rules.
|
|
16
16
|
|
|
17
|
-
Once installed, run the setup script
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
./devflow-prompts/gen-chat.sh
|
|
21
|
-
```
|
|
17
|
+
Once installed, run the specific setup script for your IDE (see Quick Start below).
|
|
22
18
|
|
|
23
19
|
---
|
|
24
20
|
|
|
@@ -26,22 +22,22 @@ Once installed, run the setup script to configure your IDE:
|
|
|
26
22
|
|
|
27
23
|
When you upgrade `devflow-prompts` to a newer version and run `npx devflow-prompts init`, the script will handle your existing files intelligently:
|
|
28
24
|
|
|
29
|
-
1.
|
|
30
|
-
|
|
25
|
+
1. **Safe Mode (Default)**:
|
|
26
|
+
It will **skip** any files that you have modified, ensuring your customizations are preserved.
|
|
31
27
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
```bash
|
|
29
|
+
npx devflow-prompts publish
|
|
30
|
+
```
|
|
35
31
|
|
|
36
|
-
2.
|
|
37
|
-
|
|
32
|
+
2. **Force Overwrite**:
|
|
33
|
+
Use `--force` if you want to **reset** everything to the latest defaults (warning: this will overwrite your changes).
|
|
38
34
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
```bash
|
|
36
|
+
npx devflow-prompts init --force
|
|
37
|
+
```
|
|
42
38
|
|
|
43
|
-
3.
|
|
44
|
-
|
|
39
|
+
3. **Conflict Resolution**:
|
|
40
|
+
If a file exists but is different from the new version, the script will create a `.new` file (e.g., `README.md.new`) instead of overwriting. You can then compare and merge the changes manually.
|
|
45
41
|
|
|
46
42
|
---
|
|
47
43
|
|
|
@@ -71,20 +67,16 @@ When you upgrade `devflow-prompts` to a newer version and run `npx devflow-promp
|
|
|
71
67
|
|
|
72
68
|
### Prerequisites
|
|
73
69
|
|
|
74
|
-
|
|
70
|
+
### Setup for your IDE
|
|
71
|
+
|
|
72
|
+
Run the corresponding setup script to install prompts into your IDE:
|
|
75
73
|
|
|
76
74
|
```bash
|
|
77
75
|
# For Antigravity
|
|
78
|
-
./devflow-prompts/
|
|
79
|
-
|
|
80
|
-
# For VSCode
|
|
81
|
-
./devflow-prompts/gen-chat.sh vscode
|
|
76
|
+
./devflow-prompts/scripts/setup-devflow-chat-antigravity.sh
|
|
82
77
|
|
|
83
|
-
# For Cursor
|
|
84
|
-
./devflow-prompts/
|
|
85
|
-
|
|
86
|
-
# Auto-detect IDE (if supported)
|
|
87
|
-
./devflow-prompts/gen-chat.sh
|
|
78
|
+
# For VSCode / Cursor
|
|
79
|
+
./devflow-prompts/scripts/setup-devflow-chat-vscode.sh
|
|
88
80
|
```
|
|
89
81
|
|
|
90
82
|
This will install all DevFlow prompts and enable autocomplete for `/devflow.*` commands.
|
|
@@ -95,36 +87,36 @@ This will install all DevFlow prompts and enable autocomplete for `/devflow.*` c
|
|
|
95
87
|
|
|
96
88
|
### Step 0: Generate Rules (One-time)
|
|
97
89
|
|
|
98
|
-
**Output:** 10 markdown files
|
|
99
|
-
**Location:** `/devflow-prompts/rules/`
|
|
100
|
-
**Action:** ✅ AI auto-creates files
|
|
90
|
+
**Output:** 10 markdown files
|
|
91
|
+
**Location:** `/devflow-prompts/rules/`
|
|
92
|
+
**Action:** ✅ AI auto-creates files
|
|
101
93
|
**Manual step:** ❌ None
|
|
102
94
|
|
|
103
95
|
---
|
|
104
96
|
|
|
105
97
|
### Step 1: Requirement
|
|
106
98
|
|
|
107
|
-
**Output:** 1 markdown file (`{task-id}-requirement.md`)
|
|
108
|
-
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
109
|
-
**Action:** ✅ AI auto-creates file
|
|
99
|
+
**Output:** 1 markdown file (`{task-id}-requirement.md`)
|
|
100
|
+
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
101
|
+
**Action:** ✅ AI auto-creates file
|
|
110
102
|
**Manual step:** ❌ None
|
|
111
103
|
|
|
112
104
|
---
|
|
113
105
|
|
|
114
106
|
### Step 2: Design
|
|
115
107
|
|
|
116
|
-
**Output:** 1 markdown file (`{task-id}-design.md`)
|
|
117
|
-
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
118
|
-
**Action:** ✅ AI auto-creates file
|
|
108
|
+
**Output:** 1 markdown file (`{task-id}-design.md`)
|
|
109
|
+
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
110
|
+
**Action:** ✅ AI auto-creates file
|
|
119
111
|
**Manual step:** ❌ None
|
|
120
112
|
|
|
121
113
|
---
|
|
122
114
|
|
|
123
115
|
### Step 3: Code ⚠️ (Manual Action Required)
|
|
124
116
|
|
|
125
|
-
**Output:** 1 git patch file (`{task-id}-feature.patch`)
|
|
126
|
-
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
127
|
-
**Action:** ⚠️ AI generates patch
|
|
117
|
+
**Output:** 1 git patch file (`{task-id}-feature.patch`)
|
|
118
|
+
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
119
|
+
**Action:** ⚠️ AI generates patch
|
|
128
120
|
**Manual step:** ✅ **YOU must apply patch**
|
|
129
121
|
|
|
130
122
|
**⚠️ Warning:** AI only creates the patch file. You must manually run `git apply` to create the actual source code files in your project.
|
|
@@ -140,18 +132,18 @@ git status
|
|
|
140
132
|
|
|
141
133
|
### Step 4: Test Plan
|
|
142
134
|
|
|
143
|
-
**Output:** 1 markdown file (`{task-id}-test.md`)
|
|
144
|
-
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
145
|
-
**Action:** ✅ AI auto-creates file
|
|
135
|
+
**Output:** 1 markdown file (`{task-id}-test.md`)
|
|
136
|
+
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
137
|
+
**Action:** ✅ AI auto-creates file
|
|
146
138
|
**Manual step:** ❌ None
|
|
147
139
|
|
|
148
140
|
---
|
|
149
141
|
|
|
150
142
|
### Step 5: Test Code ⚠️ (Manual Action Required)
|
|
151
143
|
|
|
152
|
-
**Output:** 1 git patch file (`{task-id}-test.patch`)
|
|
153
|
-
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
154
|
-
**Action:** ⚠️ AI generates patch
|
|
144
|
+
**Output:** 1 git patch file (`{task-id}-test.patch`)
|
|
145
|
+
**Location:** `/devflow-prompts/specs/{task-id}/`
|
|
146
|
+
**Action:** ⚠️ AI generates patch
|
|
155
147
|
**Manual step:** ✅ **YOU must apply patch**
|
|
156
148
|
|
|
157
149
|
**⚠️ Warning:** AI only creates the patch file. You must manually run `git apply` to create the actual test files in your project.
|
|
@@ -167,9 +159,9 @@ git apply devflow-prompts/specs/FEAT-001/FEAT-001-test.patch
|
|
|
167
159
|
|
|
168
160
|
### Step 6: Analyze
|
|
169
161
|
|
|
170
|
-
**Output:** Analysis report (inline text)
|
|
171
|
-
**Location:** Inline in AI response
|
|
172
|
-
**Action:** ℹ️ AI displays report
|
|
162
|
+
**Output:** Analysis report (inline text)
|
|
163
|
+
**Location:** Inline in AI response
|
|
164
|
+
**Action:** ℹ️ AI displays report
|
|
173
165
|
**Manual step:** ❌ None (read only)
|
|
174
166
|
|
|
175
167
|
---
|
|
@@ -870,6 +862,7 @@ cp devflow-prompts/templates/gen-requirement-template.txt FEAT-001-request.txt
|
|
|
870
862
|
```
|
|
871
863
|
|
|
872
864
|
3. **Check files**:
|
|
865
|
+
|
|
873
866
|
```bash
|
|
874
867
|
ls .agent/workflows/devflow.*.md
|
|
875
868
|
```
|
|
@@ -893,8 +886,8 @@ For issues or questions:
|
|
|
893
886
|
|
|
894
887
|
---
|
|
895
888
|
|
|
896
|
-
**Version**: 4.0
|
|
897
|
-
**Last Updated**: 2026-01-17
|
|
889
|
+
**Version**: 4.0
|
|
890
|
+
**Last Updated**: 2026-01-17
|
|
898
891
|
**Status**: ✅ Production Ready
|
|
899
892
|
|
|
900
893
|
### Changelog
|
package/bin/cli.js
CHANGED
|
@@ -16,7 +16,7 @@ if (command !== 'init' && command !== 'publish') {
|
|
|
16
16
|
const sourceRoot = path.join(__dirname, '..');
|
|
17
17
|
const targetRoot = path.join(process.cwd(), 'devflow-prompts');
|
|
18
18
|
|
|
19
|
-
const itemsToCopy = ['flows', 'rules', 'scripts', 'templates', 'README.md'
|
|
19
|
+
const itemsToCopy = ['flows', 'rules', 'scripts', 'templates', 'README.md'];
|
|
20
20
|
|
|
21
21
|
console.log(`\n🚀 Initializing DevFlow Prompts...`);
|
|
22
22
|
console.log(`Source: ${sourceRoot}`);
|
|
@@ -26,13 +26,14 @@ if (!fs.existsSync(targetRoot)) {
|
|
|
26
26
|
fs.mkdirSync(targetRoot, { recursive: true });
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
async function copyFile(src, dest) {
|
|
29
|
+
async function copyFile(src, dest, mode) {
|
|
30
30
|
try {
|
|
31
31
|
const srcContent = fs.readFileSync(src);
|
|
32
32
|
|
|
33
33
|
if (fs.existsSync(dest)) {
|
|
34
34
|
if (force) {
|
|
35
35
|
fs.writeFileSync(dest, srcContent);
|
|
36
|
+
if (mode) fs.chmodSync(dest, mode);
|
|
36
37
|
console.log(` [OVERWRITE] ${path.relative(process.cwd(), dest)}`);
|
|
37
38
|
} else {
|
|
38
39
|
const destContent = fs.readFileSync(dest);
|
|
@@ -42,12 +43,14 @@ async function copyFile(src, dest) {
|
|
|
42
43
|
} else {
|
|
43
44
|
const newDest = dest + '.new';
|
|
44
45
|
fs.writeFileSync(newDest, srcContent);
|
|
46
|
+
if (mode) fs.chmodSync(newDest, mode);
|
|
45
47
|
console.log(` [CONFLICT] ${path.relative(process.cwd(), dest)} exists with different content.`);
|
|
46
48
|
console.log(` -> Created ${path.relative(process.cwd(), newDest)}`);
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
} else {
|
|
50
52
|
fs.writeFileSync(dest, srcContent);
|
|
53
|
+
if (mode) fs.chmodSync(dest, mode);
|
|
51
54
|
console.log(` [CREATE] ${path.relative(process.cwd(), dest)}`);
|
|
52
55
|
}
|
|
53
56
|
} catch (err) {
|
|
@@ -74,7 +77,8 @@ async function copyDir(src, dest) {
|
|
|
74
77
|
if (entry.isDirectory()) {
|
|
75
78
|
await copyDir(srcPath, destPath);
|
|
76
79
|
} else {
|
|
77
|
-
|
|
80
|
+
const stat = fs.statSync(srcPath);
|
|
81
|
+
await copyFile(srcPath, destPath, stat.mode);
|
|
78
82
|
}
|
|
79
83
|
}
|
|
80
84
|
}
|
|
@@ -93,8 +97,63 @@ async function copyDir(src, dest) {
|
|
|
93
97
|
if (stats.isDirectory()) {
|
|
94
98
|
await copyDir(srcPath, destPath);
|
|
95
99
|
} else {
|
|
96
|
-
await copyFile(srcPath, destPath);
|
|
100
|
+
await copyFile(srcPath, destPath, stats.mode);
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
|
-
|
|
103
|
+
|
|
104
|
+
console.log(`\n✅ Files copied successfully!`);
|
|
105
|
+
|
|
106
|
+
// IDE Setup Selection
|
|
107
|
+
const inquirer = require('inquirer');
|
|
108
|
+
|
|
109
|
+
// Dynamically require child_process to avoid top-level issues if any
|
|
110
|
+
const { execSync } = require('child_process');
|
|
111
|
+
|
|
112
|
+
try {
|
|
113
|
+
const answers = await inquirer.prompt([
|
|
114
|
+
{
|
|
115
|
+
type: 'list',
|
|
116
|
+
name: 'ide',
|
|
117
|
+
message: 'Which IDE are you using?',
|
|
118
|
+
choices: [
|
|
119
|
+
{ name: 'VSCode / Cursor', value: 'vscode' },
|
|
120
|
+
{ name: 'Antigravity', value: 'antigravity' },
|
|
121
|
+
{ name: 'Skip setup (Manual)', value: 'skip' }
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
]);
|
|
125
|
+
|
|
126
|
+
if (answers.ide !== 'skip') {
|
|
127
|
+
const scriptName = `setup-devflow-chat-${answers.ide}.sh`;
|
|
128
|
+
const scriptPath = path.join(targetRoot, 'scripts', scriptName);
|
|
129
|
+
|
|
130
|
+
console.log(`\n⚙️ Running setup for ${answers.ide}...`);
|
|
131
|
+
|
|
132
|
+
// Ensure script is executable
|
|
133
|
+
try {
|
|
134
|
+
fs.chmodSync(scriptPath, '755');
|
|
135
|
+
} catch (e) {
|
|
136
|
+
// Ignore if we can't chmod, might already be executable or restricted
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
// Execute the script
|
|
141
|
+
execSync(`bash "${scriptPath}"`, { stdio: 'inherit' });
|
|
142
|
+
console.log(`\n✨ Setup complete for ${answers.ide}!`);
|
|
143
|
+
} catch (error) {
|
|
144
|
+
console.error(`\n❌ Error running setup script:`, error.message);
|
|
145
|
+
console.log(`Manual run: bash "${scriptPath}"`);
|
|
146
|
+
}
|
|
147
|
+
} else {
|
|
148
|
+
console.log(`\n⏭️ Skipped IDE setup.`);
|
|
149
|
+
console.log(`To run manually:`);
|
|
150
|
+
console.log(` VSCode/Cursor: bash devflow-prompts/scripts/setup-devflow-chat-vscode.sh`);
|
|
151
|
+
console.log(` Antigravity: bash devflow-prompts/scripts/setup-devflow-chat-antigravity.sh`);
|
|
152
|
+
}
|
|
153
|
+
} catch (e) {
|
|
154
|
+
console.warn("\n⚠️ Could not run interactive setup (missing 'inquirer' or non-interactive terminal).");
|
|
155
|
+
console.log("Please run the setup scripts manually from devflow-prompts/scripts/");
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
console.log(`\n✅ Done! Check 'devflow-prompts' folder for resources.`);
|
|
100
159
|
})();
|
package/package.json
CHANGED
package/gen-chat.sh
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
-
SCRIPTS_DIR="$SCRIPT_DIR/scripts"
|
|
5
|
-
|
|
6
|
-
# Function to show usage
|
|
7
|
-
show_usage() {
|
|
8
|
-
echo "Usage: $0 [ide]"
|
|
9
|
-
echo "Available IDEs: vscode, cursor, antigravity"
|
|
10
|
-
echo "If no argument is provided, the script attempts to auto-detect the IDE."
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
# 1. Start with provided argument (converted to lowercase)
|
|
14
|
-
IDE=$(echo "$1" | tr '[:upper:]' '[:lower:]')
|
|
15
|
-
|
|
16
|
-
# 2. If no argument, try auto-detection
|
|
17
|
-
if [ -z "$IDE" ]; then
|
|
18
|
-
# Helper for detection (checks TERM_PROGRAM env var)
|
|
19
|
-
TP=$(echo "$TERM_PROGRAM" | tr '[:upper:]' '[:lower:]')
|
|
20
|
-
|
|
21
|
-
if [[ "$TP" == *"vscode"* ]]; then
|
|
22
|
-
IDE="vscode"
|
|
23
|
-
elif [[ "$TP" == *"cursor"* ]]; then
|
|
24
|
-
IDE="cursor"
|
|
25
|
-
# Fallback/Custom checks for Antigravity could go here if there's a known env var
|
|
26
|
-
# For now, we rely on the argument for Antigravity unless explicitly known
|
|
27
|
-
fi
|
|
28
|
-
fi
|
|
29
|
-
|
|
30
|
-
# 3. If still empty, error out
|
|
31
|
-
if [ -z "$IDE" ]; then
|
|
32
|
-
echo "Error: Could not detect IDE and no argument provided."
|
|
33
|
-
show_usage
|
|
34
|
-
exit 1
|
|
35
|
-
fi
|
|
36
|
-
|
|
37
|
-
echo "Detailed setup for IDE: $IDE"
|
|
38
|
-
|
|
39
|
-
case "$IDE" in
|
|
40
|
-
vscode)
|
|
41
|
-
TARGET_SCRIPT="$SCRIPTS_DIR/setup-devflow-chat-vscode.sh"
|
|
42
|
-
;;
|
|
43
|
-
antigravity)
|
|
44
|
-
TARGET_SCRIPT="$SCRIPTS_DIR/setup-devflow-chat-antigravity.sh"
|
|
45
|
-
;;
|
|
46
|
-
*)
|
|
47
|
-
echo "Error: Unsupported IDE '$IDE'"
|
|
48
|
-
show_usage
|
|
49
|
-
exit 1
|
|
50
|
-
;;
|
|
51
|
-
esac
|
|
52
|
-
|
|
53
|
-
if [ -f "$TARGET_SCRIPT" ]; then
|
|
54
|
-
bash "$TARGET_SCRIPT"
|
|
55
|
-
else
|
|
56
|
-
echo "Error: Setup script not found at $TARGET_SCRIPT"
|
|
57
|
-
exit 1
|
|
58
|
-
fi
|