create-ax-project 1.0.1 β†’ 1.0.3

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.
Files changed (2) hide show
  1. package/bin/create.js +97 -40
  2. package/package.json +8 -5
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 main() {
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 (projectName === '--help' || projectName === '-h') {
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
- // 3. progress.json μ΄ˆκΈ°ν™”
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
- // 4. project_brief.md 생성
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 = `# Project Brief
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
- // 5. μ™„λ£Œ λ©”μ‹œμ§€
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.1",
3
+ "version": "1.0.3",
4
4
  "description": "Multi-AI Workflow Pipeline - Create new projects with 10-stage development workflow",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,14 +25,17 @@
25
25
  "author": "znehraks@gmail.com",
26
26
  "license": "MIT",
27
27
  "engines": {
28
- "node": ">=18.0.0"
28
+ "node": ">=20.12.0"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
32
- "url": "https://github.com/znehraks/ax-templates"
32
+ "url": "https://github.com/znehraks/ax-templates-v3"
33
33
  },
34
34
  "bugs": {
35
- "url": "https://github.com/znehraks/ax-templates/issues"
35
+ "url": "https://github.com/znehraks/ax-templates-v3/issues"
36
36
  },
37
- "homepage": "https://github.com/znehraks/ax-templates#readme"
37
+ "homepage": "https://github.com/znehraks/ax-templates-v3#readme",
38
+ "dependencies": {
39
+ "@inquirer/prompts": "^7.10.1"
40
+ }
38
41
  }