@silbaram/artifact-driven-agent 0.1.6 → 0.1.9

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 (80) hide show
  1. package/README.md +709 -516
  2. package/ai-dev-team/.ada-status.json +10 -0
  3. package/ai-dev-team/.ada-version +6 -0
  4. package/ai-dev-team/.current-template +1 -0
  5. package/ai-dev-team/.sessions/logs/20260124-014551-00f04724.log +5 -0
  6. package/ai-dev-team/.sessions/logs/20260124-014623-cb2b1d44.log +5 -0
  7. package/ai-dev-team/ada.config.json +15 -0
  8. package/ai-dev-team/artifacts/api.md +212 -0
  9. package/ai-dev-team/artifacts/decision.md +72 -0
  10. package/ai-dev-team/artifacts/improvement-reports/IMP-0000-template.md +57 -0
  11. package/ai-dev-team/artifacts/plan.md +187 -0
  12. package/ai-dev-team/artifacts/project.md +193 -0
  13. package/ai-dev-team/artifacts/sprints/_template/docs/release-notes.md +37 -0
  14. package/ai-dev-team/artifacts/sprints/_template/meta.md +54 -0
  15. package/ai-dev-team/artifacts/sprints/_template/retrospective.md +50 -0
  16. package/ai-dev-team/artifacts/sprints/_template/review-reports/review-template.md +49 -0
  17. package/ai-dev-team/artifacts/sprints/_template/tasks/task-template.md +43 -0
  18. package/ai-dev-team/artifacts/ui.md +104 -0
  19. package/ai-dev-team/roles/analyzer.md +265 -0
  20. package/ai-dev-team/roles/developer.md +222 -0
  21. package/ai-dev-team/roles/documenter.md +715 -0
  22. package/ai-dev-team/roles/improver.md +461 -0
  23. package/ai-dev-team/roles/manager.md +544 -0
  24. package/ai-dev-team/roles/planner.md +398 -0
  25. package/ai-dev-team/roles/reviewer.md +294 -0
  26. package/ai-dev-team/rules/api-change.md +198 -0
  27. package/ai-dev-team/rules/document-priority.md +199 -0
  28. package/ai-dev-team/rules/escalation.md +172 -0
  29. package/ai-dev-team/rules/iteration.md +236 -0
  30. package/ai-dev-team/rules/rfc.md +31 -0
  31. package/ai-dev-team/rules/rollback.md +218 -0
  32. package/bin/cli.js +49 -5
  33. package/core/artifacts/sprints/_template/meta.md +4 -4
  34. package/core/docs-templates/mkdocs/docs/architecture/overview.md +29 -0
  35. package/core/docs-templates/mkdocs/docs/changelog.md +36 -0
  36. package/core/docs-templates/mkdocs/docs/contributing/contributing.md +60 -0
  37. package/core/docs-templates/mkdocs/docs/getting-started/configuration.md +51 -0
  38. package/core/docs-templates/mkdocs/docs/getting-started/installation.md +41 -0
  39. package/core/docs-templates/mkdocs/docs/getting-started/quick-start.md +56 -0
  40. package/core/docs-templates/mkdocs/docs/guides/api-reference.md +83 -0
  41. package/core/docs-templates/mkdocs/docs/index.md +32 -0
  42. package/core/docs-templates/mkdocs/mkdocs.yml +86 -0
  43. package/core/roles/analyzer.md +32 -10
  44. package/core/roles/developer.md +222 -223
  45. package/core/roles/documenter.md +592 -170
  46. package/core/roles/improver.md +461 -0
  47. package/core/roles/manager.md +4 -1
  48. package/core/roles/planner.md +160 -10
  49. package/core/roles/reviewer.md +31 -3
  50. package/core/rules/document-priority.md +2 -1
  51. package/core/rules/rollback.md +3 -3
  52. package/package.json +1 -1
  53. package/src/commands/config.js +371 -0
  54. package/src/commands/docs.js +502 -0
  55. package/src/commands/interactive.js +324 -33
  56. package/src/commands/monitor.js +236 -0
  57. package/src/commands/run.js +360 -122
  58. package/src/commands/sessions.js +270 -70
  59. package/src/commands/setup.js +22 -1
  60. package/src/commands/sprint.js +295 -54
  61. package/src/commands/status.js +34 -1
  62. package/src/commands/upgrade.js +416 -0
  63. package/src/commands/validate.js +4 -3
  64. package/src/index.js +1 -0
  65. package/src/ui/dashboard.js +518 -0
  66. package/src/ui/keyHandler.js +147 -0
  67. package/src/ui/quickActions.js +111 -0
  68. package/src/utils/config.js +74 -0
  69. package/src/utils/files.js +70 -3
  70. package/src/utils/sessionState.js +472 -328
  71. package/src/utils/sessionState.process.test.js +101 -0
  72. package/src/utils/sessionState.test.js +183 -0
  73. package/src/utils/sprintUtils.js +134 -0
  74. package/src/utils/taskParser.js +134 -0
  75. package/src/utils/taskParser.test.js +76 -0
  76. package/ai-dev-team/artifacts/features/_template/qa.md +0 -16
  77. package/examples/todo-app/README.md +0 -23
  78. package/examples/todo-app/artifacts/backlog.md +0 -23
  79. package/examples/todo-app/artifacts/plan.md +0 -23
  80. package/examples/todo-app/artifacts/project.md +0 -23
@@ -0,0 +1,111 @@
1
+ import chalk from 'chalk';
2
+ import { sessions } from '../commands/sessions.js';
3
+ import { logs } from '../commands/logs.js';
4
+ import { status } from '../commands/status.js';
5
+
6
+ /**
7
+ * Quick Action 정의
8
+ */
9
+ export const QUICK_ACTIONS = {
10
+ 'q': {
11
+ label: '종료',
12
+ description: '대시보드 종료',
13
+ handler: null // 특수 처리
14
+ },
15
+ 'h': {
16
+ label: '도움말',
17
+ description: '도움말 표시',
18
+ handler: showHelp
19
+ },
20
+ // 알파벳 키 추가 명령어
21
+ 's': {
22
+ label: 'sessions',
23
+ description: '활성 세션 목록',
24
+ handler: runSessions
25
+ },
26
+ 'l': {
27
+ label: 'logs',
28
+ description: '최근 세션 로그',
29
+ handler: runLogs
30
+ },
31
+ 't': {
32
+ label: 'status',
33
+ description: '프로젝트 상태 확인',
34
+ handler: runStatus
35
+ }
36
+ };
37
+
38
+ /**
39
+ * 세션 목록 표시
40
+ */
41
+ async function runSessions() {
42
+ console.log('');
43
+ await sessions({});
44
+ console.log('\n계속하려면 아무 키나 누르세요...');
45
+ }
46
+
47
+ /**
48
+ * 로그 확인
49
+ */
50
+ async function runLogs() {
51
+ console.log('');
52
+ await logs();
53
+ console.log('\n계속하려면 아무 키나 누르세요...');
54
+ }
55
+
56
+ /**
57
+ * 프로젝트 상태 확인
58
+ */
59
+ async function runStatus() {
60
+ console.log('');
61
+ await status();
62
+ console.log('\n계속하려면 아무 키나 누르세요...');
63
+ }
64
+
65
+ /**
66
+ * 도움말 표시
67
+ */
68
+ async function showHelp() {
69
+ console.log('');
70
+ console.log(chalk.cyan('━'.repeat(60)));
71
+ console.log(chalk.cyan.bold(' ADA UI Mode 도움말'));
72
+ console.log(chalk.cyan('━'.repeat(60)));
73
+ console.log('');
74
+ console.log(chalk.white.bold(' 알파벳 키 (관리/모니터링):'));
75
+ console.log(' s - 활성 세션 목록');
76
+ console.log(' l - 최근 세션 로그');
77
+ console.log(' t - 프로젝트 상태 확인');
78
+ console.log('');
79
+ console.log(chalk.white.bold(' 기타 키:'));
80
+ console.log(' q - UI 모드 종료');
81
+ console.log(' h - 이 도움말 표시');
82
+ console.log('');
83
+ console.log(chalk.gray(' 화면은 2초마다 자동 갱신됩니다.'));
84
+ console.log(chalk.gray(' 에이전트 실행 중에는 UI가 일시 정지됩니다.'));
85
+ console.log('');
86
+ console.log(chalk.cyan('━'.repeat(60)));
87
+ console.log('\n계속하려면 아무 키나 누르세요...');
88
+ }
89
+
90
+ /**
91
+ * Quick Action 실행
92
+ */
93
+ export async function executeQuickAction(key, state) {
94
+ const action = QUICK_ACTIONS[key];
95
+ if (!action) {
96
+ return { handled: false };
97
+ }
98
+
99
+ if (action.handler === null) {
100
+ // 특수 처리 (refresh, quit)
101
+ return { handled: true, special: key };
102
+ }
103
+
104
+ try {
105
+ await action.handler(state);
106
+ return { handled: true };
107
+ } catch (error) {
108
+ console.error(chalk.red(`액션 실행 오류: ${error.message}`));
109
+ return { handled: true, error: error.message };
110
+ }
111
+ }
@@ -0,0 +1,74 @@
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
+ import { getWorkspaceDir } from './files.js';
4
+
5
+ const CONFIG_FILENAME = 'ada.config.json';
6
+
7
+ const DEFAULT_CONFIG = {
8
+ version: '1.0',
9
+ defaults: {
10
+ tool: 'claude'
11
+ },
12
+ roles: {
13
+ // 기본값은 모두 claude로 설정하되, 사용자가 변경 가능
14
+ manager: 'claude',
15
+ planner: 'claude',
16
+ architect: 'claude',
17
+ developer: 'claude',
18
+ reviewer: 'claude',
19
+ improver: 'claude',
20
+ documenter: 'claude'
21
+ }
22
+ };
23
+
24
+ /**
25
+ * 설정 파일 경로 반환
26
+ */
27
+ export function getConfigPath() {
28
+ return path.join(getWorkspaceDir(), CONFIG_FILENAME);
29
+ }
30
+
31
+ /**
32
+ * 설정 파일 읽기 (없으면 기본값 생성)
33
+ */
34
+ export function readConfig() {
35
+ const configPath = getConfigPath();
36
+
37
+ if (!fs.existsSync(configPath)) {
38
+ // 설정 파일이 없으면 기본값 저장 후 반환
39
+ writeConfig(DEFAULT_CONFIG);
40
+ return DEFAULT_CONFIG;
41
+ }
42
+
43
+ try {
44
+ const content = fs.readFileSync(configPath, 'utf-8');
45
+ const config = JSON.parse(content);
46
+
47
+ // 누락된 필드가 있으면 기본값으로 채움
48
+ return {
49
+ ...DEFAULT_CONFIG,
50
+ ...config,
51
+ defaults: { ...DEFAULT_CONFIG.defaults, ...(config.defaults || {}) },
52
+ roles: { ...DEFAULT_CONFIG.roles, ...(config.roles || {}) }
53
+ };
54
+ } catch (error) {
55
+ console.warn(`⚠️ 설정 파일(${CONFIG_FILENAME}) 파싱 실패, 기본값을 사용합니다.`);
56
+ return DEFAULT_CONFIG;
57
+ }
58
+ }
59
+
60
+ /**
61
+ * 설정 파일 쓰기
62
+ */
63
+ export function writeConfig(config) {
64
+ const configPath = getConfigPath();
65
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
66
+ }
67
+
68
+ /**
69
+ * 역할에 대한 권장 도구 반환
70
+ */
71
+ export function getToolForRole(role) {
72
+ const config = readConfig();
73
+ return config.roles[role] || config.defaults.tool || 'claude';
74
+ }
@@ -1,9 +1,11 @@
1
1
  import fs from 'fs-extra';
2
2
  import path from 'path';
3
3
  import { fileURLToPath } from 'url';
4
+ import { createRequire } from 'node:module';
4
5
 
5
6
  const __filename = fileURLToPath(import.meta.url);
6
7
  const __dirname = path.dirname(__filename);
8
+ const require = createRequire(import.meta.url);
7
9
 
8
10
  /**
9
11
  * 패키지 루트 디렉토리 반환
@@ -116,15 +118,15 @@ export function isWorkspaceSetup() {
116
118
  */
117
119
  export function copyDirMerge(src, dest) {
118
120
  if (!fs.existsSync(src)) return;
119
-
121
+
120
122
  fs.ensureDirSync(dest);
121
123
  const items = fs.readdirSync(src);
122
-
124
+
123
125
  for (const item of items) {
124
126
  const srcPath = path.join(src, item);
125
127
  const destPath = path.join(dest, item);
126
128
  const stat = fs.statSync(srcPath);
127
-
129
+
128
130
  if (stat.isDirectory()) {
129
131
  copyDirMerge(srcPath, destPath);
130
132
  } else {
@@ -132,3 +134,68 @@ export function copyDirMerge(src, dest) {
132
134
  }
133
135
  }
134
136
  }
137
+
138
+ /**
139
+ * 버전 파일 경로 반환
140
+ */
141
+ export function getVersionFile() {
142
+ return path.join(getWorkspaceDir(), '.ada-version');
143
+ }
144
+
145
+ /**
146
+ * 백업 디렉토리 경로 반환
147
+ */
148
+ export function getBackupDir() {
149
+ return path.join(getWorkspaceDir(), '.backups');
150
+ }
151
+
152
+ /**
153
+ * 패키지 버전 반환
154
+ */
155
+ export function getPackageVersion() {
156
+ const packageJson = require(path.join(getPackageRoot(), 'package.json'));
157
+ return packageJson.version;
158
+ }
159
+
160
+ /**
161
+ * 작업공간 버전 정보 읽기
162
+ */
163
+ export function readVersion() {
164
+ const versionFile = getVersionFile();
165
+ if (!fs.existsSync(versionFile)) {
166
+ return null;
167
+ }
168
+ try {
169
+ const content = fs.readFileSync(versionFile, 'utf-8');
170
+ return JSON.parse(content);
171
+ } catch (error) {
172
+ return null;
173
+ }
174
+ }
175
+
176
+ /**
177
+ * 작업공간 버전 정보 쓰기
178
+ */
179
+ export function writeVersion(versionInfo) {
180
+ const versionFile = getVersionFile();
181
+ fs.writeFileSync(versionFile, JSON.stringify(versionInfo, null, 2));
182
+ }
183
+
184
+ /**
185
+ * 버전 비교 (semver 형식)
186
+ * @returns {number} a > b이면 1, a < b이면 -1, 같으면 0
187
+ */
188
+ export function compareVersions(a, b) {
189
+ const aParts = a.split('.').map(Number);
190
+ const bParts = b.split('.').map(Number);
191
+
192
+ for (let i = 0; i < 3; i++) {
193
+ const aVal = aParts[i] || 0;
194
+ const bVal = bParts[i] || 0;
195
+
196
+ if (aVal > bVal) return 1;
197
+ if (aVal < bVal) return -1;
198
+ }
199
+
200
+ return 0;
201
+ }