aiwf 0.3.16 → 0.3.18

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 (82) hide show
  1. package/README.ko.md +1 -1
  2. package/README.md +88 -229
  3. package/docs/ADR_MANAGEMENT_GUIDE.ko.md +602 -0
  4. package/docs/ADR_MANAGEMENT_GUIDE.md +602 -0
  5. package/docs/API_REFERENCE_FULL.ko.md +160 -4
  6. package/docs/API_REFERENCE_FULL.md +160 -4
  7. package/docs/EXAMPLES.ko.md +695 -0
  8. package/docs/EXAMPLES.md +12 -12
  9. package/docs/GETTING_STARTED.md +19 -25
  10. package/docs/MODULE_MANAGEMENT_GUIDE.ko.md +289 -0
  11. package/docs/MODULE_MANAGEMENT_GUIDE.md +289 -0
  12. package/docs/PRD.ko.md +2 -2
  13. package/docs/PRD.md +2 -2
  14. package/docs/YOLO_SYSTEM_GUIDE.ko.md +542 -0
  15. package/docs/YOLO_SYSTEM_GUIDE.md +542 -0
  16. package/package.json +1 -1
  17. package/src/config/file-lists.js +5 -5
  18. package/templates/README.md +0 -78
  19. package/templates/api-server/config.json +0 -64
  20. package/templates/api-server/template/.aiwf/config.json +0 -56
  21. package/templates/api-server/template/.aiwf/feature-ledger.json +0 -42
  22. package/templates/api-server/template/.aiwf/personas/backend-engineer.json +0 -40
  23. package/templates/api-server/template/.aiwf/scripts/cli.js +0 -111
  24. package/templates/api-server/template/.env.example +0 -29
  25. package/templates/api-server/template/.eslintrc.json +0 -23
  26. package/templates/api-server/template/README.md +0 -171
  27. package/templates/api-server/template/jest.config.js +0 -26
  28. package/templates/api-server/template/nodemon.json +0 -9
  29. package/templates/api-server/template/package.json +0 -61
  30. package/templates/api-server/template/src/app.ts +0 -60
  31. package/templates/api-server/template/src/config/swagger.ts +0 -38
  32. package/templates/api-server/template/src/controllers/aiwfController.ts +0 -54
  33. package/templates/api-server/template/src/controllers/authController.ts +0 -128
  34. package/templates/api-server/template/src/controllers/statusController.ts +0 -28
  35. package/templates/api-server/template/src/index.ts +0 -28
  36. package/templates/api-server/template/src/middleware/aiwfMiddleware.ts +0 -50
  37. package/templates/api-server/template/src/middleware/authMiddleware.ts +0 -41
  38. package/templates/api-server/template/src/middleware/errorHandler.ts +0 -42
  39. package/templates/api-server/template/src/middleware/notFoundHandler.ts +0 -14
  40. package/templates/api-server/template/src/middleware/requestLogger.ts +0 -20
  41. package/templates/api-server/template/src/routes/aiwf.ts +0 -31
  42. package/templates/api-server/template/src/routes/index.ts +0 -13
  43. package/templates/api-server/template/src/routes/v1/index.ts +0 -67
  44. package/templates/api-server/template/src/utils/logger.ts +0 -37
  45. package/templates/api-server/template/tests/app.test.ts +0 -40
  46. package/templates/api-server/template/tsconfig.json +0 -43
  47. package/templates/npm-library/config.json +0 -61
  48. package/templates/npm-library/template/LICENSE +0 -21
  49. package/templates/npm-library/template/README.md +0 -201
  50. package/templates/npm-library/template/package.json +0 -78
  51. package/templates/web-app/config.json +0 -53
  52. package/templates/web-app/template/.aiwf/config.json +0 -54
  53. package/templates/web-app/template/.aiwf/feature-ledger.json +0 -37
  54. package/templates/web-app/template/.aiwf/personas/fullstack-developer.json +0 -40
  55. package/templates/web-app/template/.aiwf/scripts/cli.js +0 -110
  56. package/templates/web-app/template/.eslintrc.cjs +0 -20
  57. package/templates/web-app/template/README.md +0 -151
  58. package/templates/web-app/template/index.html +0 -14
  59. package/templates/web-app/template/package.json +0 -44
  60. package/templates/web-app/template/postcss.config.js +0 -6
  61. package/templates/web-app/template/public/vite.svg +0 -1
  62. package/templates/web-app/template/src/App.tsx +0 -21
  63. package/templates/web-app/template/src/components/Layout.tsx +0 -57
  64. package/templates/web-app/template/src/components/aiwf/ContextStatus.tsx +0 -107
  65. package/templates/web-app/template/src/components/aiwf/TokenUsage.tsx +0 -71
  66. package/templates/web-app/template/src/index.css +0 -60
  67. package/templates/web-app/template/src/main.tsx +0 -10
  68. package/templates/web-app/template/src/pages/AiwfDashboard.tsx +0 -57
  69. package/templates/web-app/template/src/pages/HomePage.tsx +0 -89
  70. package/templates/web-app/template/src/pages/NotFound.tsx +0 -25
  71. package/templates/web-app/template/src/stores/aiwfStore.ts +0 -126
  72. package/templates/web-app/template/src/types/global.d.ts +0 -9
  73. package/templates/web-app/template/src/vite-env.d.ts +0 -1
  74. package/templates/web-app/template/tailwind.config.js +0 -30
  75. package/templates/web-app/template/tsconfig.json +0 -37
  76. package/templates/web-app/template/tsconfig.node.json +0 -10
  77. package/templates/web-app/template/vite.config.ts +0 -23
  78. /package/rules/global/{code-style-guide.md → aiwf-code-style-guide.md} +0 -0
  79. /package/rules/global/{coding-principles.md → aiwf-coding-principles.md} +0 -0
  80. /package/rules/global/{development-process.md → aiwf-development-process.md} +0 -0
  81. /package/rules/global/{global-rules.md → aiwf-global-rules.md} +0 -0
  82. /package/rules/manual/{generate-plan-docs.md → aiwf-generate-plan-docs.md} +0 -0
@@ -0,0 +1,289 @@
1
+ # AIWF Module Management Guide
2
+
3
+ > A comprehensive guide to understanding and managing AIWF's modular architecture and dependencies
4
+
5
+ [한국어](MODULE_MANAGEMENT_GUIDE.ko.md) | [English](MODULE_MANAGEMENT_GUIDE.md)
6
+
7
+ ## Table of Contents
8
+
9
+ 1. [Overview](#overview)
10
+ 2. [Module Classification](#module-classification)
11
+ 3. [Dependency Matrix](#dependency-matrix)
12
+ 4. [Critical Modules](#critical-modules)
13
+ 5. [Safe Module Management](#safe-module-management)
14
+ 6. [Troubleshooting](#troubleshooting)
15
+ 7. [Best Practices](#best-practices)
16
+
17
+ ## Overview
18
+
19
+ AIWF follows a modular architecture where functionality is distributed across specialized modules. Understanding the dependency relationships between these modules is crucial for:
20
+
21
+ - **Safe refactoring**: Knowing which modules can be modified without breaking others
22
+ - **Feature development**: Understanding where to place new functionality
23
+ - **Debugging**: Tracing issues through the dependency chain
24
+ - **Performance optimization**: Identifying bottlenecks in module loading
25
+
26
+ ## Module Classification
27
+
28
+ ### 🔧 Core Utilities (Critical - Never Delete)
29
+
30
+ These modules are foundational and used throughout the system:
31
+
32
+ #### `utils/paths.js`
33
+ - **Usage**: 8+ locations across CLI and commands
34
+ - **Purpose**: Centralized path management for cross-platform compatibility
35
+ - **Dependencies**: None
36
+ - **Critical for**: All file operations, template resolution, resource loading
37
+
38
+ #### `utils/messages.js`
39
+ - **Usage**: 5+ locations in CLI and user-facing commands
40
+ - **Purpose**: Multi-language message system
41
+ - **Dependencies**: `language-utils.js`
42
+ - **Critical for**: User interface, error messages, internationalization
43
+
44
+ #### `utils/language-utils.js`
45
+ - **Usage**: 3+ locations in language management
46
+ - **Purpose**: Language detection and configuration
47
+ - **Dependencies**: `paths.js`
48
+ - **Critical for**: Language switching, locale detection
49
+
50
+ ### 🚀 YOLO System (Critical - Never Delete)
51
+
52
+ Specialized modules for autonomous execution:
53
+
54
+ #### `utils/engineering-guard.js`
55
+ - **Usage**: Dynamic import in YOLO templates
56
+ - **Purpose**: Prevents over-engineering during autonomous execution
57
+ - **Dependencies**: None (self-contained)
58
+ - **Critical for**: YOLO mode quality control
59
+ - **⚠️ Warning**: Loaded dynamically - won't show in static analysis
60
+
61
+ #### `utils/checkpoint-manager.js`
62
+ - **Usage**: YOLO commands and recovery systems
63
+ - **Purpose**: Progress tracking and recovery for autonomous execution
64
+ - **Dependencies**: None
65
+ - **Critical for**: YOLO session management, progress recovery
66
+
67
+ ### 🎯 Command-Specific Modules
68
+
69
+ #### AI Persona System
70
+ ```
71
+ ai-persona-manager.js (main)
72
+ ├── context-engine.js
73
+ ├── metrics-collector.js
74
+ ├── task-analyzer.js
75
+ └── token-optimizer.js (used by context-engine)
76
+ ```
77
+
78
+ #### Installation & Backup System
79
+ ```
80
+ installer.js (main)
81
+ ├── backup-manager.js
82
+ ├── file-downloader.js
83
+ ├── rollback-manager.js
84
+ └── validator.js
85
+ ```
86
+
87
+ #### Cache System
88
+ ```
89
+ template-cache-system.js (main)
90
+ ├── offline-detector.js
91
+ ├── template-downloader.js
92
+ └── template-version-manager.js
93
+ ```
94
+
95
+ #### GitHub Integration
96
+ ```
97
+ github-integration.js (main)
98
+ ├── state/state-index.js
99
+ ├── state/priority-calculator.js
100
+ └── state/task-scanner.js
101
+ ```
102
+
103
+ ### 🌐 Shared Resources
104
+
105
+ #### `lib/resource-loader.js`
106
+ - **Usage**: 5+ commands (compress, token, evaluate, etc.)
107
+ - **Purpose**: Unified resource management for bundled and user resources
108
+ - **Dependencies**: `paths.js`
109
+ - **Critical for**: Template loading, persona management, resource resolution
110
+
111
+ ## Dependency Matrix
112
+
113
+ ### CLI Command Dependencies
114
+
115
+ | Command | Direct Dependencies | Indirect Dependencies | Special Notes |
116
+ |---------|-------------------|---------------------|---------------|
117
+ | `aiwf install` | installer.js | backup-manager.js, file-downloader.js, rollback-manager.js, validator.js | - |
118
+ | `aiwf persona` | persona.js, ai-persona-manager.js | context-engine.js, metrics-collector.js, task-analyzer.js, token-optimizer.js | - |
119
+ | `aiwf compress` | compress.js, resource-loader.js | - | - |
120
+ | `aiwf token` | token.js, resource-loader.js | - | - |
121
+ | `aiwf evaluate` | evaluate.js, resource-loader.js | - | - |
122
+ | `aiwf checkpoint` | checkpoint-manager.js | - | ⚠️ YOLO only |
123
+ | `aiwf-checkpoint` | checkpoint-manager.js | - | ⚠️ YOLO only |
124
+ | `aiwf cache` | cache-cli.js | template-cache-system.js, offline-detector.js, template-downloader.js, template-version-manager.js | - |
125
+ | `YOLO Mode` | engineering-guard.js | - | ⚠️ Dynamic import |
126
+
127
+ ## Critical Modules
128
+
129
+ ### Modules with ⚠️ Dynamic Loading
130
+
131
+ These modules are loaded at runtime and won't appear in static dependency analysis:
132
+
133
+ 1. **`engineering-guard.js`**: Loaded by YOLO templates using `import()`
134
+ 2. **State system modules**: Used by GitHub integration
135
+ 3. **Persona sub-modules**: Loaded based on active persona
136
+
137
+ ### Deletion Risk Assessment
138
+
139
+ #### ❌ Never Delete
140
+ - `paths.js`, `messages.js`, `language-utils.js` (core utilities)
141
+ - `engineering-guard.js`, `checkpoint-manager.js` (YOLO system)
142
+ - `resource-loader.js` (shared by multiple commands)
143
+
144
+ #### ⚠️ Delete with Caution
145
+ - AI Persona system modules (check if persona commands are used)
146
+ - Cache system modules (affects offline functionality)
147
+ - GitHub integration modules (affects GitHub commands)
148
+
149
+ #### ✅ Conditional Deletion
150
+ - Command-specific modules can be deleted if the corresponding command is unused
151
+ - Template-specific resources can be removed if templates are not needed
152
+
153
+ ## Safe Module Management
154
+
155
+ ### Before Modifying Any Module
156
+
157
+ 1. **Check the Dependency Map**: Review `src/DEPENDENCY_MAP.md`
158
+ 2. **Search for Usage**: Use `grep -r "module-name" src/` to find all references
159
+ 3. **Check for Dynamic Imports**: Search for `import()` statements
160
+ 4. **Verify CLI Integration**: Check if module is used in CLI commands
161
+ 5. **Test YOLO Functionality**: Ensure YOLO mode still works if modifying YOLO modules
162
+
163
+ ### Safe Modification Steps
164
+
165
+ ```bash
166
+ # 1. Check static dependencies
167
+ grep -r "your-module.js" src/
168
+
169
+ # 2. Check dynamic imports
170
+ grep -r "import.*your-module" src/
171
+
172
+ # 3. Check YOLO integration
173
+ grep -r "your-module" claude-code/
174
+
175
+ # 4. Verify CLI command mapping
176
+ grep -r "your-module" src/cli/
177
+
178
+ # 5. Test critical functionality
179
+ npm test
180
+ aiwf install --force
181
+ aiwf-checkpoint list
182
+ ```
183
+
184
+ ### Module Addition Guidelines
185
+
186
+ When adding new modules:
187
+
188
+ 1. **Update Dependency Map**: Add entry to `src/DEPENDENCY_MAP.md`
189
+ 2. **Add Warning Comments**: Include `@warning` comments for critical modules
190
+ 3. **Document Usage**: Specify which commands or systems use the module
191
+ 4. **Consider Dynamic Loading**: Mark if module uses `import()` for lazy loading
192
+ 5. **Test Integration**: Verify module works in both development and production
193
+
194
+ ## Troubleshooting
195
+
196
+ ### Common Issues
197
+
198
+ #### "Module not found" Errors
199
+ ```bash
200
+ # Check if module exists
201
+ ls -la src/utils/your-module.js
202
+
203
+ # Check if path is correct in imports
204
+ grep -r "your-module" src/
205
+
206
+ # Verify module exports
207
+ node -e "console.log(require('./src/utils/your-module.js'))"
208
+ ```
209
+
210
+ #### YOLO Mode Failures
211
+ ```bash
212
+ # Check engineering-guard availability
213
+ ls -la src/utils/engineering-guard.js
214
+
215
+ # Test dynamic import
216
+ node -e "import('./src/utils/engineering-guard.js').then(m => console.log('OK'))"
217
+
218
+ # Verify checkpoint system
219
+ aiwf checkpoint status
220
+ ```
221
+
222
+ #### Circular Dependencies
223
+ ```bash
224
+ # Detect circular dependencies
225
+ npm install -g madge
226
+ madge --circular src/
227
+ ```
228
+
229
+ ### Recovery Procedures
230
+
231
+ #### If Core Utility is Accidentally Deleted
232
+ 1. Restore from git: `git checkout HEAD -- src/utils/paths.js`
233
+ 2. Reinstall AIWF: `aiwf install --force`
234
+ 3. Verify functionality: `aiwf --version`
235
+
236
+ #### If YOLO System is Broken
237
+ 1. Check YOLO config: `cat .aiwf/yolo-config.yaml`
238
+ 2. Restore checkpoint manager: `git checkout HEAD -- src/utils/checkpoint-manager.js`
239
+ 3. Test YOLO mode: `aiwf-checkpoint status`
240
+
241
+ ## Best Practices
242
+
243
+ ### Module Development
244
+
245
+ 1. **Single Responsibility**: Each module should have one clear purpose
246
+ 2. **Minimal Dependencies**: Avoid unnecessary dependencies to reduce coupling
247
+ 3. **Clear Interfaces**: Export only necessary functions/classes
248
+ 4. **Documentation**: Include usage comments and dependency information
249
+ 5. **Error Handling**: Gracefully handle missing dependencies
250
+
251
+ ### Dependency Management
252
+
253
+ 1. **Regular Audits**: Periodically review and update dependency map
254
+ 2. **Impact Analysis**: Before changes, analyze potential impact on dependent modules
255
+ 3. **Testing Strategy**: Test both direct and indirect dependencies
256
+ 4. **Version Control**: Use git to track module changes and dependencies
257
+ 5. **Documentation**: Keep dependency documentation up-to-date
258
+
259
+ ### Performance Considerations
260
+
261
+ 1. **Lazy Loading**: Use dynamic imports for non-critical modules
262
+ 2. **Caching**: Cache frequently accessed modules
263
+ 3. **Bundle Optimization**: Consider module size when adding dependencies
264
+ 4. **Tree Shaking**: Ensure modules support dead code elimination
265
+
266
+ ## Module Integration Checklist
267
+
268
+ When integrating new modules or modifying existing ones:
269
+
270
+ - [ ] Updated `src/DEPENDENCY_MAP.md`
271
+ - [ ] Added appropriate warning comments
272
+ - [ ] Documented usage patterns
273
+ - [ ] Tested in both CLI and YOLO modes
274
+ - [ ] Verified resource loading works
275
+ - [ ] Checked for circular dependencies
276
+ - [ ] Updated relevant documentation
277
+ - [ ] Added integration tests if needed
278
+
279
+ ## Related Documents
280
+
281
+ - [DEPENDENCY_MAP.md](../src/DEPENDENCY_MAP.md) - Detailed dependency matrix
282
+ - [ARCHITECTURE.md](ARCHITECTURE.md) - Overall system architecture
283
+ - [DEVELOPMENT_GUIDE.md](DEVELOPMENT_GUIDE.md) - Development guidelines
284
+ - [YOLO_SYSTEM_GUIDE.md](YOLO_SYSTEM_GUIDE.md) - YOLO system specifics
285
+
286
+ ---
287
+
288
+ **Last Updated**: 2025-01-27
289
+ **Verification Method**: Use `grep -r "module-name" src/` to verify usage patterns
package/docs/PRD.ko.md CHANGED
@@ -88,7 +88,7 @@ your_project/
88
88
  ├── .claude/commands/aiwf/ # Claude Code 사용자 정의 명령어
89
89
  │ ├── initialize.md # 프로젝트 초기화
90
90
  │ ├── prime_context.md # 컨텍스트 로딩
91
- │ ├── plan_milestone.md # 마일스톤 계획
91
+ │ ├── aiwf_create_milestone_plan.md # 마일스톤 계획
92
92
  │ ├── create_sprints_from_milestone.md # 스프린트 생성
93
93
  │ ├── do_task.md # 태스크 실행
94
94
  │ ├── commit.md # Git 커밋 워크플로우
@@ -115,7 +115,7 @@ your_project/
115
115
  ### 명령어 시스템
116
116
  이 프레임워크는 AI 지원 개발을 위한 25개 이상의 전문 명령어를 포함합니다:
117
117
  - **설정**: `initialize`, `prime`, `prime_context`
118
- - **계획**: `plan_milestone`, `create_sprints_from_milestone`, `create_sprint_tasks`
118
+ - **계획**: `aiwf_create_milestone_plan`, `aiwf_create_sprints_from_milestone`, `aiwf_create_sprint_tasks`
119
119
  - **개발**: `do_task`, `commit`, `test`, `code_review`
120
120
  - **자동화**: `yolo` (자율 태스크 실행)
121
121
  - **GitHub 통합**: `issue_create`, `pr_create`
package/docs/PRD.md CHANGED
@@ -90,7 +90,7 @@ your_project/
90
90
  ├── .claude/commands/aiwf/ # Claude Code custom commands
91
91
  │ ├── initialize.md # Project initialization
92
92
  │ ├── prime_context.md # Context loading
93
- │ ├── plan_milestone.md # Milestone planning
93
+ │ ├── aiwf_create_milestone_plan.md # Milestone planning
94
94
  │ ├── create_sprints_from_milestone.md # Sprint creation
95
95
  │ ├── do_task.md # Task execution
96
96
  │ ├── commit.md # Git commit workflow
@@ -117,7 +117,7 @@ your_project/
117
117
  ### Command System
118
118
  The framework includes 25+ specialized commands for AI-assisted development:
119
119
  - **Setup**: `initialize`, `prime`, `prime_context`
120
- - **Planning**: `plan_milestone`, `create_sprints_from_milestone`, `create_sprint_tasks`
120
+ - **Planning**: `aiwf_create_milestone_plan`, `aiwf_create_sprints_from_milestone`, `aiwf_create_sprint_tasks`
121
121
  - **Development**: `do_task`, `commit`, `test`, `code_review`
122
122
  - **Automation**: `yolo` (autonomous task execution)
123
123
  - **GitHub Integration**: `issue_create`, `pr_create`