create-ax-project 1.0.1 β 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/bin/create.js +97 -40
- package/package.json +5 -2
package/bin/create.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import fs from 'fs';
|
|
4
4
|
import path from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
|
+
import { input } from '@inquirer/prompts';
|
|
6
7
|
|
|
7
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
8
9
|
const __dirname = path.dirname(__filename);
|
|
@@ -41,12 +42,82 @@ function copyRecursiveSync(src, dest) {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
function
|
|
45
|
+
async function collectBriefInfo() {
|
|
46
|
+
console.log('');
|
|
47
|
+
log('π νλ‘μ νΈ λΈλ¦¬νλ₯Ό μμ±ν©λλ€. (Enterλ§ λλ₯΄λ©΄ 건λλλλ€)', 'yellow');
|
|
48
|
+
console.log('');
|
|
49
|
+
|
|
50
|
+
const info = {};
|
|
51
|
+
|
|
52
|
+
// μμ°¨μ μΌλ‘ μ§λ¬Έ (κ° input()μ΄ μλ£λμ΄μΌ λ€μμΌλ‘ μ§ν)
|
|
53
|
+
info.description = await input({ message: 'ν μ€ μ€λͺ
:' });
|
|
54
|
+
info.problem = await input({ message: 'λ¬Έμ μ μ (ν΄κ²°νλ €λ λ¬Έμ ):' });
|
|
55
|
+
info.targetUser = await input({ message: 'νκ² μ¬μ©μ:' });
|
|
56
|
+
info.successCriteria = await input({ message: 'μ±κ³΅ κΈ°μ€:' });
|
|
57
|
+
info.constraintSchedule = await input({ message: 'μ μ½μ‘°κ±΄ - μΌμ :' });
|
|
58
|
+
info.constraintBudget = await input({ message: 'μ μ½μ‘°κ±΄ - μμ°:' });
|
|
59
|
+
info.constraintTech = await input({ message: 'μ μ½μ‘°κ±΄ - κΈ°μ :' });
|
|
60
|
+
info.references = await input({ message: 'μ°Έκ³ μλ£ (URL λλ λ¬Έμ):' });
|
|
61
|
+
|
|
62
|
+
// ν΅μ¬ κΈ°λ₯ - μ¬λ¬ κ° μ
λ ₯ (λ³λ 루ν)
|
|
63
|
+
console.log('');
|
|
64
|
+
log('ν΅μ¬ κΈ°λ₯ (λΉ μ
λ ₯ μ μ’
λ£):', 'reset');
|
|
65
|
+
info.features = [];
|
|
66
|
+
let featureNum = 1;
|
|
67
|
+
while (true) {
|
|
68
|
+
const feature = await input({ message: ` ${featureNum}.` });
|
|
69
|
+
if (!feature) break;
|
|
70
|
+
info.features.push(feature);
|
|
71
|
+
featureNum++;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return info;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function generateBriefContent(projectName, info) {
|
|
78
|
+
// ν΅μ¬ κΈ°λ₯ ν¬λ§·ν
|
|
79
|
+
let featuresContent;
|
|
80
|
+
if (info.features && info.features.length > 0) {
|
|
81
|
+
featuresContent = info.features.map((f, i) => `${i + 1}. ${f}`).join('\n');
|
|
82
|
+
} else {
|
|
83
|
+
featuresContent = '1. [κΈ°λ₯ 1]\n2. [κΈ°λ₯ 2]\n3. [κΈ°λ₯ 3]';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return `# Project Brief
|
|
87
|
+
|
|
88
|
+
## νλ‘μ νΈ μ΄λ¦
|
|
89
|
+
${projectName}
|
|
90
|
+
|
|
91
|
+
## ν μ€ μ€λͺ
|
|
92
|
+
${info.description || '[νλ‘μ νΈλ₯Ό ν μ€λ‘ μ€λͺ
ν΄μ£ΌμΈμ]'}
|
|
93
|
+
|
|
94
|
+
## λ¬Έμ μ μ
|
|
95
|
+
${info.problem || '[ν΄κ²°νλ €λ λ¬Έμ λ 무μμΈκ°μ?]'}
|
|
96
|
+
|
|
97
|
+
## νκ² μ¬μ©μ
|
|
98
|
+
${info.targetUser || '[μ£Όμ μ¬μ©μλ λꡬμΈκ°μ?]'}
|
|
99
|
+
|
|
100
|
+
## ν΅μ¬ κΈ°λ₯ (μ΄μ)
|
|
101
|
+
${featuresContent}
|
|
102
|
+
|
|
103
|
+
## μ±κ³΅ κΈ°μ€
|
|
104
|
+
${info.successCriteria || '[νλ‘μ νΈκ° μ±κ³΅νλ€κ³ νλ¨νλ κΈ°μ€μ?]'}
|
|
105
|
+
|
|
106
|
+
## μ μ½μ‘°κ±΄
|
|
107
|
+
- μΌμ : ${info.constraintSchedule || ''}
|
|
108
|
+
- μμ°: ${info.constraintBudget || ''}
|
|
109
|
+
- κΈ°μ : ${info.constraintTech || ''}
|
|
110
|
+
|
|
111
|
+
## μ°Έκ³ μλ£
|
|
112
|
+
- ${info.references || '[URL λλ λ¬Έμ]'}
|
|
113
|
+
`;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function main() {
|
|
45
117
|
const args = process.argv.slice(2);
|
|
46
|
-
const projectName = args[0] || '.';
|
|
47
118
|
|
|
48
|
-
// λμλ§
|
|
49
|
-
if (
|
|
119
|
+
// λμλ§ μ²΄ν¬ (κ°μ₯ λ¨Όμ μ²λ¦¬)
|
|
120
|
+
if (args.includes('--help') || args.includes('-h')) {
|
|
50
121
|
console.log(`
|
|
51
122
|
${colors.cyan}create-ax-project${colors.reset} - Multi-AI Workflow Pipeline νλ‘μ νΈ μμ±
|
|
52
123
|
|
|
@@ -54,9 +125,13 @@ ${colors.yellow}μ¬μ©λ²:${colors.reset}
|
|
|
54
125
|
npx create-ax-project <project-name>
|
|
55
126
|
npx create-ax-project . (νμ¬ λλ ν 리μ μμ±)
|
|
56
127
|
|
|
128
|
+
${colors.yellow}μ΅μ
:${colors.reset}
|
|
129
|
+
--yes, -y ν둬ννΈ μμ΄ κΈ°λ³Έκ°μΌλ‘ μμ±
|
|
130
|
+
|
|
57
131
|
${colors.yellow}μμ:${colors.reset}
|
|
58
132
|
npx create-ax-project my-saas-app
|
|
59
133
|
npx create-ax-project my-game
|
|
134
|
+
npx create-ax-project my-project --yes
|
|
60
135
|
|
|
61
136
|
${colors.yellow}μμ± ν:${colors.reset}
|
|
62
137
|
1. cd <project-name>
|
|
@@ -66,6 +141,9 @@ ${colors.yellow}μμ± ν:${colors.reset}
|
|
|
66
141
|
process.exit(0);
|
|
67
142
|
}
|
|
68
143
|
|
|
144
|
+
const skipPrompts = args.includes('--yes') || args.includes('-y');
|
|
145
|
+
const projectName = args.find(arg => !arg.startsWith('-')) || '.';
|
|
146
|
+
|
|
69
147
|
// νλ‘μ νΈ μ΄λ¦ κ²μ¦
|
|
70
148
|
if (projectName !== '.' && !/^[a-z0-9-]+$/.test(projectName)) {
|
|
71
149
|
log('μ€λ₯: νλ‘μ νΈ μ΄λ¦μ μλ¬Έ μλ¬Έμ, μ«μ, νμ΄νλ§ νμ©λ©λλ€.', 'red');
|
|
@@ -103,12 +181,18 @@ ${colors.yellow}μμ± ν:${colors.reset}
|
|
|
103
181
|
}
|
|
104
182
|
log(`β νλ‘μ νΈ λλ ν 리: ${targetDir}`, 'green');
|
|
105
183
|
|
|
106
|
-
// 2.
|
|
184
|
+
// 2. νλ‘μ νΈ λΈλ¦¬ν μ 보 μμ§ (--yes νλκ·Έκ° μμ λλ§)
|
|
185
|
+
let briefInfo = {};
|
|
186
|
+
if (!skipPrompts) {
|
|
187
|
+
briefInfo = await collectBriefInfo();
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// 3. ν
νλ¦Ώ 볡μ¬
|
|
107
191
|
log(' ν
νλ¦Ώ λ³΅μ¬ μ€...', 'blue');
|
|
108
192
|
copyRecursiveSync(templateDir, targetDir);
|
|
109
193
|
log('β ν
νλ¦Ώ λ³΅μ¬ μλ£', 'green');
|
|
110
194
|
|
|
111
|
-
//
|
|
195
|
+
// 4. progress.json μ΄κΈ°ν
|
|
112
196
|
const progressTemplatePath = path.join(targetDir, 'state', 'progress.json.template');
|
|
113
197
|
const progressPath = path.join(targetDir, 'state', 'progress.json');
|
|
114
198
|
|
|
@@ -125,7 +209,7 @@ ${colors.yellow}μμ± ν:${colors.reset}
|
|
|
125
209
|
log('β progress.json μ΄κΈ°ν μλ£', 'green');
|
|
126
210
|
}
|
|
127
211
|
|
|
128
|
-
//
|
|
212
|
+
// 5. project_brief.md μμ±
|
|
129
213
|
const briefPath = path.join(targetDir, 'stages', '01-brainstorm', 'inputs', 'project_brief.md');
|
|
130
214
|
const briefDir = path.dirname(briefPath);
|
|
131
215
|
|
|
@@ -133,41 +217,11 @@ ${colors.yellow}μμ± ν:${colors.reset}
|
|
|
133
217
|
fs.mkdirSync(briefDir, { recursive: true });
|
|
134
218
|
}
|
|
135
219
|
|
|
136
|
-
const briefContent =
|
|
137
|
-
|
|
138
|
-
## νλ‘μ νΈ μ΄λ¦
|
|
139
|
-
${actualProjectName}
|
|
140
|
-
|
|
141
|
-
## ν μ€ μ€λͺ
|
|
142
|
-
[νλ‘μ νΈλ₯Ό ν μ€λ‘ μ€λͺ
ν΄μ£ΌμΈμ]
|
|
143
|
-
|
|
144
|
-
## λ¬Έμ μ μ
|
|
145
|
-
[ν΄κ²°νλ €λ λ¬Έμ λ 무μμΈκ°μ?]
|
|
146
|
-
|
|
147
|
-
## νκ² μ¬μ©μ
|
|
148
|
-
[μ£Όμ μ¬μ©μλ λꡬμΈκ°μ?]
|
|
149
|
-
|
|
150
|
-
## ν΅μ¬ κΈ°λ₯ (μ΄μ)
|
|
151
|
-
1. [κΈ°λ₯ 1]
|
|
152
|
-
2. [κΈ°λ₯ 2]
|
|
153
|
-
3. [κΈ°λ₯ 3]
|
|
154
|
-
|
|
155
|
-
## μ±κ³΅ κΈ°μ€
|
|
156
|
-
[νλ‘μ νΈκ° μ±κ³΅νλ€κ³ νλ¨νλ κΈ°μ€μ?]
|
|
157
|
-
|
|
158
|
-
## μ μ½μ‘°κ±΄
|
|
159
|
-
- μΌμ :
|
|
160
|
-
- μμ°:
|
|
161
|
-
- κΈ°μ :
|
|
162
|
-
|
|
163
|
-
## μ°Έκ³ μλ£
|
|
164
|
-
- [URL λλ λ¬Έμ]
|
|
165
|
-
`;
|
|
166
|
-
|
|
220
|
+
const briefContent = generateBriefContent(actualProjectName, briefInfo);
|
|
167
221
|
fs.writeFileSync(briefPath, briefContent);
|
|
168
222
|
log('β project_brief.md μμ± μλ£', 'green');
|
|
169
223
|
|
|
170
|
-
//
|
|
224
|
+
// 6. μλ£ λ©μμ§
|
|
171
225
|
console.log('');
|
|
172
226
|
log('ββββββββββββββββββββββββββββββββββββββββββββββββββββββ', 'green');
|
|
173
227
|
log(`β νλ‘μ νΈ '${actualProjectName}' μμ± μλ£!`, 'green');
|
|
@@ -190,4 +244,7 @@ ${actualProjectName}
|
|
|
190
244
|
console.log('');
|
|
191
245
|
}
|
|
192
246
|
|
|
193
|
-
main()
|
|
247
|
+
main().catch(err => {
|
|
248
|
+
log(`μ€λ₯: ${err.message}`, 'red');
|
|
249
|
+
process.exit(1);
|
|
250
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-ax-project",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Multi-AI Workflow Pipeline - Create new projects with 10-stage development workflow",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -34,5 +34,8 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/znehraks/ax-templates/issues"
|
|
36
36
|
},
|
|
37
|
-
"homepage": "https://github.com/znehraks/ax-templates#readme"
|
|
37
|
+
"homepage": "https://github.com/znehraks/ax-templates#readme",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@inquirer/prompts": "^8.2.0"
|
|
40
|
+
}
|
|
38
41
|
}
|