@silbaram/artifact-driven-agent 0.1.9 → 0.2.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 (222) hide show
  1. package/README.md +296 -25
  2. package/ai-dev-team/.ada-status.template.json +10 -10
  3. package/ai-dev-team/README.md +39 -44
  4. package/ai-dev-team/artifacts/api.md +2 -212
  5. package/ai-dev-team/artifacts/features/_template/api.md +19 -19
  6. package/ai-dev-team/artifacts/features/_template/review.md +14 -14
  7. package/ai-dev-team/artifacts/features/_template/spec.md +28 -28
  8. package/ai-dev-team/artifacts/features/_template/ui.md +14 -14
  9. package/ai-dev-team/artifacts/improvement-reports/IMP-0000-template.md +57 -57
  10. package/ai-dev-team/artifacts/project.md +2 -193
  11. package/ai-dev-team/artifacts/rfc/RFC-0000-template.md +49 -49
  12. package/core/artifacts/decision.md +72 -72
  13. package/core/artifacts/plan.md +187 -187
  14. package/core/artifacts/project.md +193 -193
  15. package/core/artifacts/sprints/_template/docs/release-notes.md +37 -37
  16. package/core/artifacts/sprints/_template/meta.md +54 -54
  17. package/core/artifacts/sprints/_template/retrospective.md +50 -50
  18. package/core/artifacts/sprints/_template/review-reports/review-template.md +49 -49
  19. package/core/artifacts/sprints/_template/tasks/task-template.md +43 -43
  20. package/core/docs-templates/mkdocs/docs/architecture/overview.md +29 -29
  21. package/core/docs-templates/mkdocs/docs/changelog.md +36 -36
  22. package/core/docs-templates/mkdocs/docs/contributing/contributing.md +60 -60
  23. package/core/docs-templates/mkdocs/docs/getting-started/configuration.md +51 -51
  24. package/core/docs-templates/mkdocs/docs/getting-started/installation.md +41 -41
  25. package/core/docs-templates/mkdocs/docs/getting-started/quick-start.md +56 -56
  26. package/core/docs-templates/mkdocs/docs/guides/api-reference.md +83 -83
  27. package/core/docs-templates/mkdocs/docs/index.md +32 -32
  28. package/core/docs-templates/mkdocs/mkdocs.yml +86 -86
  29. package/core/roles/analyzer.md +265 -265
  30. package/core/roles/developer.md +6 -1
  31. package/core/roles/documenter.md +226 -715
  32. package/core/roles/improver.md +461 -461
  33. package/core/roles/manager.md +574 -544
  34. package/core/roles/planner.md +398 -398
  35. package/core/roles/reviewer.md +294 -294
  36. package/core/rules/document-priority.md +198 -198
  37. package/core/rules/escalation.md +172 -172
  38. package/core/rules/iteration.md +236 -236
  39. package/core/rules/rfc.md +31 -31
  40. package/core/rules/rollback.md +218 -218
  41. package/core/skills/_template/SKILL.md +50 -0
  42. package/core/skills/clean-code/SKILL.md +177 -0
  43. package/core/skills/code-review-checklist/SKILL.md +125 -0
  44. package/core/skills/error-handling/SKILL.md +155 -0
  45. package/core/skills/talk-game-dot-design/SKILL.md +85 -0
  46. package/core/skills/talk-game-dot-design/references/asset-specs.md +57 -0
  47. package/core/skills/talk-game-dot-design/references/review-checklist.md +34 -0
  48. package/core/skills/task-writing/SKILL.md +166 -0
  49. package/core/skills/testing-patterns/SKILL.md +140 -0
  50. package/dist/bin/cli.d.ts +2 -0
  51. package/dist/bin/cli.js +121 -0
  52. package/dist/bin/cli.js.map +1 -0
  53. package/dist/src/commands/config.d.ts +4 -0
  54. package/dist/src/commands/config.js +427 -0
  55. package/dist/src/commands/config.js.map +1 -0
  56. package/dist/src/commands/docs.d.ts +12 -0
  57. package/dist/src/commands/docs.js +453 -0
  58. package/dist/src/commands/docs.js.map +1 -0
  59. package/dist/src/commands/interactive.d.ts +4 -0
  60. package/dist/src/commands/interactive.js +380 -0
  61. package/dist/src/commands/interactive.js.map +1 -0
  62. package/dist/src/commands/logs.d.ts +1 -0
  63. package/dist/src/commands/logs.js +76 -0
  64. package/dist/src/commands/logs.js.map +1 -0
  65. package/dist/src/commands/monitor.d.ts +6 -0
  66. package/dist/src/commands/monitor.js +216 -0
  67. package/dist/src/commands/monitor.js.map +1 -0
  68. package/dist/src/commands/reset.d.ts +4 -0
  69. package/dist/src/commands/reset.js +57 -0
  70. package/dist/src/commands/reset.js.map +1 -0
  71. package/dist/src/commands/run.d.ts +45 -0
  72. package/dist/src/commands/run.js +421 -0
  73. package/dist/src/commands/run.js.map +1 -0
  74. package/dist/src/commands/sessions.d.ts +5 -0
  75. package/dist/src/commands/sessions.js +563 -0
  76. package/dist/src/commands/sessions.js.map +1 -0
  77. package/dist/src/commands/setup.d.ts +1 -0
  78. package/dist/src/commands/setup.js +132 -0
  79. package/dist/src/commands/setup.js.map +1 -0
  80. package/dist/src/commands/skills.d.ts +4 -0
  81. package/dist/src/commands/skills.js +748 -0
  82. package/dist/src/commands/skills.js.map +1 -0
  83. package/dist/src/commands/sprint.d.ts +4 -0
  84. package/dist/src/commands/sprint.js +434 -0
  85. package/dist/src/commands/sprint.js.map +1 -0
  86. package/dist/src/commands/status.d.ts +1 -0
  87. package/dist/src/commands/status.js +97 -0
  88. package/dist/src/commands/status.js.map +1 -0
  89. package/dist/src/commands/upgrade.d.ts +6 -0
  90. package/dist/src/commands/upgrade.js +350 -0
  91. package/dist/src/commands/upgrade.js.map +1 -0
  92. package/dist/src/commands/validate.d.ts +8 -0
  93. package/dist/src/commands/validate.js +260 -0
  94. package/dist/src/commands/validate.js.map +1 -0
  95. package/dist/src/commands/validate.test.d.ts +1 -0
  96. package/dist/src/commands/validate.test.js +74 -0
  97. package/dist/src/commands/validate.test.js.map +1 -0
  98. package/{src/index.js → dist/src/index.d.ts} +1 -3
  99. package/dist/src/index.js +15 -0
  100. package/dist/src/index.js.map +1 -0
  101. package/dist/src/types/common.d.ts +31 -0
  102. package/dist/src/types/common.js +2 -0
  103. package/dist/src/types/common.js.map +1 -0
  104. package/dist/src/types/config.d.ts +46 -0
  105. package/dist/src/types/config.js +2 -0
  106. package/dist/src/types/config.js.map +1 -0
  107. package/dist/src/types/index.d.ts +53 -0
  108. package/dist/src/types/index.js +2 -0
  109. package/dist/src/types/index.js.map +1 -0
  110. package/dist/src/types/session.d.ts +87 -0
  111. package/dist/src/types/session.js +2 -0
  112. package/dist/src/types/session.js.map +1 -0
  113. package/dist/src/types/task.d.ts +32 -0
  114. package/dist/src/types/task.js +2 -0
  115. package/dist/src/types/task.js.map +1 -0
  116. package/dist/src/ui/dashboard.d.ts +9 -0
  117. package/dist/src/ui/dashboard.js +468 -0
  118. package/dist/src/ui/dashboard.js.map +1 -0
  119. package/dist/src/ui/keyHandler.d.ts +47 -0
  120. package/dist/src/ui/keyHandler.js +132 -0
  121. package/dist/src/ui/keyHandler.js.map +1 -0
  122. package/dist/src/ui/quickActions.d.ts +25 -0
  123. package/dist/src/ui/quickActions.js +106 -0
  124. package/dist/src/ui/quickActions.js.map +1 -0
  125. package/dist/src/utils/config.d.ts +33 -0
  126. package/dist/src/utils/config.js +135 -0
  127. package/dist/src/utils/config.js.map +1 -0
  128. package/dist/src/utils/files.d.ts +84 -0
  129. package/dist/src/utils/files.js +202 -0
  130. package/dist/src/utils/files.js.map +1 -0
  131. package/dist/src/utils/promptBuilder.d.ts +39 -0
  132. package/dist/src/utils/promptBuilder.js +726 -0
  133. package/dist/src/utils/promptBuilder.js.map +1 -0
  134. package/dist/src/utils/sessionState.d.ts +83 -0
  135. package/dist/src/utils/sessionState.js +466 -0
  136. package/dist/src/utils/sessionState.js.map +1 -0
  137. package/dist/src/utils/sessionState.process.test.d.ts +1 -0
  138. package/dist/src/utils/sessionState.process.test.js +93 -0
  139. package/dist/src/utils/sessionState.process.test.js.map +1 -0
  140. package/dist/src/utils/sessionState.test.d.ts +1 -0
  141. package/dist/src/utils/sessionState.test.js +150 -0
  142. package/dist/src/utils/sessionState.test.js.map +1 -0
  143. package/dist/src/utils/sprintUtils.d.ts +13 -0
  144. package/dist/src/utils/sprintUtils.js +129 -0
  145. package/dist/src/utils/sprintUtils.js.map +1 -0
  146. package/dist/src/utils/taskParser.d.ts +9 -0
  147. package/dist/src/utils/taskParser.js +122 -0
  148. package/dist/src/utils/taskParser.js.map +1 -0
  149. package/dist/src/utils/taskParser.test.d.ts +1 -0
  150. package/dist/src/utils/taskParser.test.js +69 -0
  151. package/dist/src/utils/taskParser.test.js.map +1 -0
  152. package/package.json +62 -47
  153. package/templates/cli/artifacts/commands.md +262 -262
  154. package/templates/cli/artifacts/output-format.md +298 -298
  155. package/templates/cli/rules/command-change.md +225 -225
  156. package/templates/game/artifacts/assets.md +148 -148
  157. package/templates/game/artifacts/game-systems.md +217 -217
  158. package/templates/game/artifacts/hud.md +199 -199
  159. package/templates/game/rules/system-change.md +184 -184
  160. package/templates/library/artifacts/changelog.md +84 -84
  161. package/templates/library/artifacts/examples.md +157 -157
  162. package/templates/library/artifacts/public-api.md +197 -197
  163. package/templates/library/rules/versioning.md +186 -186
  164. package/templates/web-dev/artifacts/api.md +212 -212
  165. package/templates/web-dev/artifacts/ui.md +104 -104
  166. package/templates/web-dev/rules/api-change.md +198 -198
  167. package/ai-dev-team/.ada-status.json +0 -10
  168. package/ai-dev-team/.ada-version +0 -6
  169. package/ai-dev-team/.current-template +0 -1
  170. package/ai-dev-team/.gitkeep +0 -0
  171. package/ai-dev-team/.sessions/logs/20260124-014551-00f04724.log +0 -5
  172. package/ai-dev-team/.sessions/logs/20260124-014623-cb2b1d44.log +0 -5
  173. package/ai-dev-team/artifacts/.gitkeep +0 -0
  174. package/ai-dev-team/artifacts/decision.md +0 -72
  175. package/ai-dev-team/artifacts/plan.md +0 -187
  176. package/ai-dev-team/artifacts/sprints/_template/docs/release-notes.md +0 -37
  177. package/ai-dev-team/artifacts/sprints/_template/meta.md +0 -54
  178. package/ai-dev-team/artifacts/sprints/_template/retrospective.md +0 -50
  179. package/ai-dev-team/artifacts/sprints/_template/review-reports/review-template.md +0 -49
  180. package/ai-dev-team/artifacts/sprints/_template/tasks/task-template.md +0 -43
  181. package/ai-dev-team/artifacts/ui.md +0 -104
  182. package/ai-dev-team/roles/.gitkeep +0 -0
  183. package/ai-dev-team/roles/analyzer.md +0 -265
  184. package/ai-dev-team/roles/developer.md +0 -222
  185. package/ai-dev-team/roles/documenter.md +0 -715
  186. package/ai-dev-team/roles/improver.md +0 -461
  187. package/ai-dev-team/roles/manager.md +0 -544
  188. package/ai-dev-team/roles/planner.md +0 -398
  189. package/ai-dev-team/roles/reviewer.md +0 -294
  190. package/ai-dev-team/rules/.gitkeep +0 -0
  191. package/ai-dev-team/rules/api-change.md +0 -198
  192. package/ai-dev-team/rules/document-priority.md +0 -199
  193. package/ai-dev-team/rules/escalation.md +0 -172
  194. package/ai-dev-team/rules/iteration.md +0 -236
  195. package/ai-dev-team/rules/rfc.md +0 -31
  196. package/ai-dev-team/rules/rollback.md +0 -218
  197. package/bin/cli.js +0 -127
  198. package/src/commands/config.js +0 -371
  199. package/src/commands/docs.js +0 -502
  200. package/src/commands/interactive.js +0 -392
  201. package/src/commands/logs.js +0 -81
  202. package/src/commands/monitor.js +0 -236
  203. package/src/commands/reset.js +0 -66
  204. package/src/commands/run.js +0 -739
  205. package/src/commands/sessions.js +0 -646
  206. package/src/commands/setup.js +0 -149
  207. package/src/commands/sprint.js +0 -503
  208. package/src/commands/status.js +0 -109
  209. package/src/commands/upgrade.js +0 -416
  210. package/src/commands/validate.js +0 -289
  211. package/src/commands/validate.test.js +0 -84
  212. package/src/ui/dashboard.js +0 -518
  213. package/src/ui/keyHandler.js +0 -147
  214. package/src/ui/quickActions.js +0 -111
  215. package/src/utils/config.js +0 -74
  216. package/src/utils/files.js +0 -201
  217. package/src/utils/sessionState.js +0 -513
  218. package/src/utils/sessionState.process.test.js +0 -101
  219. package/src/utils/sessionState.test.js +0 -183
  220. package/src/utils/sprintUtils.js +0 -134
  221. package/src/utils/taskParser.js +0 -134
  222. package/src/utils/taskParser.test.js +0 -76
@@ -1,289 +0,0 @@
1
- import fs from 'fs-extra';
2
- import path from 'path';
3
- import chalk from 'chalk';
4
- import { getWorkspaceDir, isWorkspaceSetup } from '../utils/files.js';
5
-
6
- export async function validate(doc) {
7
- if (!isWorkspaceSetup()) {
8
- console.log(chalk.red('? 먼저 setup을 실행하세요.'));
9
- process.exit(1);
10
- }
11
-
12
- const workspace = getWorkspaceDir();
13
- const artifactsDir = path.join(workspace, 'artifacts');
14
-
15
- printSection('문서 검증');
16
-
17
- let totalPass = 0;
18
- let totalFail = 0;
19
- let totalWarn = 0;
20
-
21
- const validators = {
22
- plan: validatePlan,
23
- project: validateProject,
24
- backlog: validateBacklog,
25
- sprint: validateSprint
26
- };
27
-
28
- if (doc && validators[doc]) {
29
- // 특정 문서만 검증
30
- const result = validators[doc](artifactsDir);
31
- totalPass += result.pass;
32
- totalFail += result.fail;
33
- totalWarn += result.warn;
34
- } else {
35
- // 전체 검증
36
- for (const validator of Object.values(validators)) {
37
- const result = validator(artifactsDir);
38
- totalPass += result.pass;
39
- totalFail += result.fail;
40
- totalWarn += result.warn;
41
- }
42
- }
43
-
44
- printSection('검증 결과');
45
- console.log(chalk.green(` PASS: ${totalPass}`));
46
- console.log(chalk.red(` FAIL: ${totalFail}`));
47
- console.log(chalk.yellow(` WARN: ${totalWarn}`));
48
- console.log('');
49
-
50
- if (totalFail > 0) {
51
- process.exit(1);
52
- }
53
- }
54
-
55
- function validatePlan(artifactsDir) {
56
- const filePath = path.join(artifactsDir, 'plan.md');
57
- let pass = 0, fail = 0, warn = 0;
58
-
59
- printSection('plan.md');
60
-
61
- if (!fs.existsSync(filePath)) {
62
- logFail('파일 없음');
63
- return { pass: 0, fail: 1, warn: 0 };
64
- }
65
-
66
- const content = fs.readFileSync(filePath, 'utf-8');
67
-
68
- // 필수 섹션 검사
69
- const requiredSections = ['서비스 개요', '기능 목록', '비기능 요구사항'];
70
- for (const section of requiredSections) {
71
- if (content.includes(section)) {
72
- logPass(`섹션 존재: ${section}`);
73
- pass++;
74
- } else {
75
- logFail(`섹션 누락: ${section}`);
76
- fail++;
77
- }
78
- }
79
-
80
- // TBD 개수 검사
81
- const tbdMatches = content.match(/TBD/gi) || [];
82
- if (tbdMatches.length > 3) {
83
- logWarn(`TBD 항목: ${tbdMatches.length}개 (3개 초과)`);
84
- warn++;
85
- } else {
86
- logPass(`TBD 항목: ${tbdMatches.length}개`);
87
- pass++;
88
- }
89
-
90
- console.log('');
91
- return { pass, fail, warn };
92
- }
93
-
94
- function validateProject(artifactsDir) {
95
- const filePath = path.join(artifactsDir, 'project.md');
96
- let pass = 0, fail = 0, warn = 0;
97
-
98
- printSection('project.md');
99
-
100
- if (!fs.existsSync(filePath)) {
101
- logFail('파일 없음');
102
- return { pass: 0, fail: 1, warn: 0 };
103
- }
104
-
105
- const content = fs.readFileSync(filePath, 'utf-8');
106
-
107
- // 필수 섹션 검사
108
- const requiredSections = ['프로젝트 규모', '기술 스택'];
109
- for (const section of requiredSections) {
110
- if (content.includes(section)) {
111
- logPass(`섹션 존재: ${section}`);
112
- pass++;
113
- } else {
114
- logFail(`섹션 누락: ${section}`);
115
- fail++;
116
- }
117
- }
118
-
119
- // Frozen 상태 검사
120
- if (content.includes('Frozen') || content.includes('??')) {
121
- logPass('Frozen 상태 표시됨');
122
- pass++;
123
- } else {
124
- logWarn('Frozen 상태 미표시');
125
- warn++;
126
- }
127
-
128
- // 모호한 버전 검사 (예: 1.x, 2.x)
129
- if (/\d+\.x/i.test(content)) {
130
- logWarn('모호한 버전 형식 (예: 1.x)');
131
- warn++;
132
- } else {
133
- logPass('버전 형식 양호');
134
- pass++;
135
- }
136
-
137
- console.log('');
138
- return { pass, fail, warn };
139
- }
140
-
141
- export function validateBacklog(artifactsDir) {
142
- const backlogDir = path.join(artifactsDir, 'backlog');
143
- let pass = 0, fail = 0, warn = 0;
144
-
145
- printSection('backlog/');
146
-
147
- if (!fs.existsSync(backlogDir) || !fs.statSync(backlogDir).isDirectory()) {
148
- logWarn('backlog/ 디렉토리 없음 (Task 생성 전)');
149
- console.log('');
150
- return { pass: 0, fail: 0, warn: 1 };
151
- }
152
-
153
- const taskFiles = fs.readdirSync(backlogDir).filter(file => /^task-\d+\.md$/i.test(file));
154
-
155
- if (taskFiles.length > 0) {
156
- logPass(`Task 개수: ${taskFiles.length}개`);
157
- pass++;
158
- } else {
159
- logWarn('대기 Task 없음');
160
- warn++;
161
- console.log('');
162
- return { pass, fail, warn };
163
- }
164
-
165
- const missingAcceptance = taskFiles.filter(file => {
166
- const content = fs.readFileSync(path.join(backlogDir, file), 'utf-8');
167
- return !hasAcceptanceCriteria(content);
168
- });
169
-
170
- if (missingAcceptance.length === 0) {
171
- logPass(`수용 조건 존재 (${taskFiles.length}/${taskFiles.length})`);
172
- pass++;
173
- } else {
174
- logWarn(`수용 조건 미확인 (${taskFiles.length - missingAcceptance.length}/${taskFiles.length})`);
175
- warn++;
176
- }
177
-
178
- console.log('');
179
- return { pass, fail, warn };
180
- }
181
-
182
- export function validateSprint(artifactsDir) {
183
- const sprintsDir = path.join(artifactsDir, 'sprints');
184
- let pass = 0, fail = 0, warn = 0;
185
-
186
- printSection('sprints/');
187
-
188
- if (!fs.existsSync(sprintsDir) || !fs.statSync(sprintsDir).isDirectory()) {
189
- logWarn('sprints/ 디렉토리 없음 (스프린트 시작 전)');
190
- console.log('');
191
- return { pass: 0, fail: 0, warn: 1 };
192
- }
193
-
194
- const sprintDirs = fs.readdirSync(sprintsDir, { withFileTypes: true })
195
- .filter(dirent => dirent.isDirectory() && /^sprint-\d+$/.test(dirent.name))
196
- .map(dirent => dirent.name);
197
-
198
- if (sprintDirs.length === 0) {
199
- logWarn('스프린트 디렉토리 없음 (스프린트 시작 전)');
200
- warn++;
201
- console.log('');
202
- return { pass, fail, warn };
203
- }
204
-
205
- const latestSprint = sprintDirs.sort((a, b) => {
206
- const numA = parseInt(a.split('-')[1], 10);
207
- const numB = parseInt(b.split('-')[1], 10);
208
- return numB - numA;
209
- })[0];
210
-
211
- const metaPath = path.join(sprintsDir, latestSprint, 'meta.md');
212
- if (!fs.existsSync(metaPath)) {
213
- logFail(`${latestSprint}/meta.md 없음`);
214
- console.log('');
215
- return { pass: 0, fail: 1, warn: 0 };
216
- }
217
-
218
- const content = fs.readFileSync(metaPath, 'utf-8');
219
- logInfo(`최신 스프린트: ${latestSprint}`);
220
-
221
- const requiredFields = ['스프린트 번호', '상태', '시작일', '종료 예정', '목표'];
222
- requiredFields.forEach(field => {
223
- if (content.includes(field)) {
224
- logPass(`필드 존재: ${field}`);
225
- pass++;
226
- } else {
227
- logWarn(`필드 미확인: ${field}`);
228
- warn++;
229
- }
230
- });
231
-
232
- const hasTaskSection = content.includes('Task 요약') || content.includes('Task 목록');
233
- if (hasTaskSection) {
234
- logPass('Task 섹션 존재');
235
- pass++;
236
- } else {
237
- logWarn('Task 섹션 미확인');
238
- warn++;
239
- }
240
-
241
- const tasksDir = path.join(sprintsDir, latestSprint, 'tasks');
242
- if (fs.existsSync(tasksDir) && fs.statSync(tasksDir).isDirectory()) {
243
- const taskFiles = fs.readdirSync(tasksDir).filter(file => /^task-\d+\.md$/i.test(file));
244
- if (taskFiles.length > 0) {
245
- logPass(`Task 개수: ${taskFiles.length}개`);
246
- pass++;
247
- } else {
248
- logWarn('Task 없음');
249
- warn++;
250
- }
251
- } else {
252
- logWarn('tasks/ 디렉토리 없음');
253
- warn++;
254
- }
255
-
256
- console.log('');
257
- return { pass, fail, warn };
258
- }
259
-
260
- function hasAcceptanceCriteria(content) {
261
- return content.includes('수용 조건') || content.includes('Acceptance Criteria') || content.includes('AC-');
262
- }
263
-
264
- function printSection(title) {
265
- const width = 60;
266
- const line = '─'.repeat(width);
267
- const paddedTitle = ` ${title}`.padEnd(width, ' ');
268
- console.log('');
269
- console.log(chalk.cyan(`┌${line}┐`));
270
- console.log(chalk.cyan(`│${paddedTitle}│`));
271
- console.log(chalk.cyan(`└${line}┘`));
272
- console.log('');
273
- }
274
-
275
- function logPass(message) {
276
- console.log(chalk.green(` [PASS] ${message}`));
277
- }
278
-
279
- function logWarn(message) {
280
- console.log(chalk.yellow(` [WARN] ${message}`));
281
- }
282
-
283
- function logFail(message) {
284
- console.log(chalk.red(` [FAIL] ${message}`));
285
- }
286
-
287
- function logInfo(message) {
288
- console.log(chalk.cyan(` [INFO] ${message}`));
289
- }
@@ -1,84 +0,0 @@
1
- import test from 'node:test';
2
- import assert from 'node:assert/strict';
3
- import fs from 'node:fs';
4
- import path from 'node:path';
5
- import { validateBacklog, validateSprint } from './validate.js';
6
-
7
- function createArtifactsDir(t) {
8
- const baseDir = path.join(process.cwd(), 'tmp', 'validate-tests');
9
- fs.mkdirSync(baseDir, { recursive: true });
10
-
11
- const rootDir = fs.mkdtempSync(path.join(baseDir, 'case-'));
12
- const artifactsDir = path.join(rootDir, 'artifacts');
13
- fs.mkdirSync(artifactsDir, { recursive: true });
14
-
15
- t.after(() => {
16
- fs.rmSync(rootDir, { recursive: true, force: true });
17
- });
18
-
19
- return artifactsDir;
20
- }
21
-
22
- test('validateBacklog: backlog/의 task-*.md를 검증한다', (t) => {
23
- const artifactsDir = createArtifactsDir(t);
24
- const backlogDir = path.join(artifactsDir, 'backlog');
25
- fs.mkdirSync(backlogDir, { recursive: true });
26
-
27
- fs.writeFileSync(
28
- path.join(backlogDir, 'task-001.md'),
29
- '# TASK-001\n\n## Acceptance Criteria\n- [ ] 준비\n'
30
- );
31
-
32
- const result = validateBacklog(artifactsDir);
33
- assert.equal(result.fail, 0);
34
- assert.equal(result.warn, 0);
35
- assert.ok(result.pass > 0);
36
- });
37
-
38
- test('validateBacklog: Task가 없으면 경고한다', (t) => {
39
- const artifactsDir = createArtifactsDir(t);
40
- const backlogDir = path.join(artifactsDir, 'backlog');
41
- fs.mkdirSync(backlogDir, { recursive: true });
42
-
43
- const result = validateBacklog(artifactsDir);
44
- assert.equal(result.fail, 0);
45
- assert.ok(result.warn >= 1);
46
- });
47
-
48
- test('validateSprint: 최신 스프린트 meta.md와 tasks를 확인한다', (t) => {
49
- const artifactsDir = createArtifactsDir(t);
50
- const sprintDir = path.join(artifactsDir, 'sprints', 'sprint-1');
51
- const tasksDir = path.join(sprintDir, 'tasks');
52
- fs.mkdirSync(tasksDir, { recursive: true });
53
-
54
- fs.writeFileSync(
55
- path.join(sprintDir, 'meta.md'),
56
- [
57
- '# Sprint 1 메타정보',
58
- '',
59
- '| 항목 | 값 |',
60
- '|------|-----|',
61
- '| 스프린트 번호 | 1 |',
62
- '| 상태 | active |',
63
- '| 시작일 | 2025-01-01 |',
64
- '| 종료 예정 | 2025-01-07 |',
65
- '| 목표 | 검증 |',
66
- '',
67
- '## Task 요약',
68
- '',
69
- '| Task | 상태 | 담당 | 우선순위 | 크기 |',
70
- '|------|:----:|------|:--------:|:----:|',
71
- '| task-001 | BACKLOG | - | P0 | S |',
72
- ''
73
- ].join('\n')
74
- );
75
-
76
- fs.writeFileSync(
77
- path.join(tasksDir, 'task-001.md'),
78
- '# TASK-001\n\n## Acceptance Criteria\n- [ ] 준비\n'
79
- );
80
-
81
- const result = validateSprint(artifactsDir);
82
- assert.equal(result.fail, 0);
83
- assert.equal(result.warn, 0);
84
- });