aiwf 0.3.1 → 0.3.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.
Files changed (507) hide show
  1. package/.aiwf/.claude/commands/aiwf/aiwf_compress_aggressive_persona.md +53 -0
  2. package/.aiwf/.claude/commands/aiwf/aiwf_compress_minimal_persona.md +48 -0
  3. package/.aiwf/.claude/commands/aiwf/aiwf_compress_stats.md +79 -0
  4. package/.aiwf/.claude/commands/aiwf/aiwf_compress_with_persona.md +51 -0
  5. package/.aiwf/.claude/commands/aiwf/aiwf_evaluate.md +92 -0
  6. package/.aiwf/00_PROJECT_MANIFEST.md +183 -0
  7. package/.aiwf/01_PROJECT_DOCS/ARCHITECTURE.md +121 -0
  8. package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_ADVANCED_USE_CASES.md +412 -0
  9. package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_API_REFERENCE.md +361 -0
  10. package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_COMMANDS_GUIDE.md +254 -0
  11. package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_FAQ.md +365 -0
  12. package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_SYSTEM_OVERVIEW.md +305 -0
  13. package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_USER_GUIDE.md +416 -0
  14. package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_/354/213/234/354/236/221_/352/260/200/354/235/264/353/223/234.md +247 -0
  15. package/.aiwf/02_REQUIREMENTS/CLAUDE.md +78 -0
  16. package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/M02_milestone_meta.md +34 -0
  17. package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/PRD_Context_Engineering_Enhancement.md +108 -0
  18. package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/SPECS_AI_Persona_System.md +299 -0
  19. package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/SPECS_Feature_Ledger_System.md +330 -0
  20. package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/SPECS_Token_Optimization.md +833 -0
  21. package/.aiwf/03_SPRINTS/CLAUDE.md +83 -0
  22. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/S01_M02_sprint_meta.md +95 -0
  23. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX01_S01_Feature_Ledger_/353/215/260/354/235/264/355/204/260_/352/265/254/354/241/260_/354/204/244/352/263/204.md +111 -0
  24. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX02_S01_Feature_Ledger_CLI_/353/252/205/353/240/271/354/226/264_/352/260/234/353/260/234.md +115 -0
  25. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX03_S01_Git_/354/227/260/353/217/231_Feature_/354/266/224/354/240/201.md +141 -0
  26. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX04_S01_Feature_Ledger_/353/254/270/354/204/234/355/231/224.md +114 -0
  27. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX05_S01_AI_/355/216/230/353/245/264/354/206/214/353/202/230_/353/215/260/354/235/264/355/204/260_/352/265/254/354/241/260_/354/204/244/352/263/204.md +123 -0
  28. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX06_S01_/355/216/230/353/245/264/354/206/214/353/202/230_/352/264/200/353/246/254_/353/252/205/353/240/271/354/226/264_/352/265/254/355/230/204.md +114 -0
  29. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX07_S01_Context_/354/225/225/354/266/225_/354/225/204/355/202/244/355/205/215/354/262/230_/354/204/244/352/263/204.md +114 -0
  30. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX08_S01_/355/206/240/355/201/260_/354/266/224/354/240/201_/354/213/234/354/212/244/355/205/234_/355/224/204/353/241/234/355/206/240/355/203/200/354/236/205.md +112 -0
  31. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX09_S01_/354/225/225/354/266/225_/354/225/214/352/263/240/353/246/254/354/246/230_/355/224/204/353/241/234/355/206/240/355/203/200/354/236/205.md +118 -0
  32. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX10_S01_update_docs_/353/252/205/353/240/271/354/226/264_/353/263/265/352/265/254.md +118 -0
  33. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX11_S01_/355/206/265/355/225/251_/355/205/214/354/212/244/355/212/270_Suite_/352/265/254/354/266/225.md +128 -0
  34. package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX12_S01_/354/204/261/353/212/245_/354/265/234/354/240/201/355/231/224_/353/260/217_/353/254/270/354/204/234/355/231/224.md +122 -0
  35. package/.aiwf/03_SPRINTS/S02_M02_ai_enhancement/S02_M02_sprint_meta.md +107 -0
  36. package/.aiwf/03_SPRINTS/S02_M02_ai_enhancement/TX01_S02_AI_/355/216/230/353/245/264/354/206/214/353/202/230_/353/252/205/353/240/271/354/226/264_/352/265/254/355/230/204.md +129 -0
  37. package/.aiwf/03_SPRINTS/S02_M02_ai_enhancement/TX02_S02_/355/216/230/353/245/264/354/206/214/353/202/230_/354/273/250/355/205/215/354/212/244/355/212/270_/354/240/201/354/232/251_/354/213/234/354/212/244/355/205/234.md +152 -0
  38. package/.aiwf/03_SPRINTS/S02_M02_ai_enhancement/TX03_S02_Context_/354/225/225/354/266/225_/354/225/214/352/263/240/353/246/254/354/246/230_/352/265/254/355/230/204.md +186 -0
  39. package/.aiwf/03_SPRINTS/S02_M02_ai_enhancement/TX05_S02_S02_/355/206/265/355/225/251_/355/205/214/354/212/244/355/212/270_/353/260/217_/353/254/270/354/204/234/355/231/224.md +192 -0
  40. package/.aiwf/03_SPRINTS/S02_M02_ai_enhancement/TX4_S02_Feature_Git_/354/227/260/353/217/231_/353/260/217_/354/236/220/353/217/231/355/231/224.md +162 -0
  41. package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/S03_FINAL_SPRINT_SUMMARY.md +137 -0
  42. package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/S03_M02_sprint_meta.md +106 -0
  43. package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/TX14_S03_M02_/353/247/210/354/235/274/354/212/244/355/206/244_/354/265/234/354/242/205_/352/262/200/354/246/235_/353/260/217_/353/254/270/354/204/234/355/231/224.md +214 -0
  44. package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/TX15_S03_/352/270/260/353/263/270_/355/224/204/353/241/234/354/240/235/355/212/270_/355/205/234/355/224/214/353/246/277_/352/260/234/353/260/234.md +177 -0
  45. package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/TX16_S03_/354/230/244/355/224/204/353/235/274/354/235/270_/355/205/234/355/224/214/353/246/277_/354/272/220/354/213/234_/354/213/234/354/212/244/355/205/234.md +206 -0
  46. package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/TX_T13_S03_AI_/353/217/204/352/265/254_/355/206/265/355/225/251_/355/205/234/355/224/214/353/246/277_/352/260/234/353/260/234.md +151 -0
  47. package/.aiwf/04_GENERAL_TASKS/CLAUDE.md +96 -0
  48. package/.aiwf/04_GENERAL_TASKS/TX001_complete_english_translation.md +127 -0
  49. package/.aiwf/05_DOCUMENTATION/performance-report.md +33 -0
  50. package/.aiwf/06_FEATURE_LEDGERS/FEATURE_GIT_INTEGRATION.md +314 -0
  51. package/.aiwf/06_FEATURE_LEDGERS/FEATURE_INTEGRATION_GUIDE.md +227 -0
  52. package/.aiwf/06_FEATURE_LEDGERS/FEATURE_LEDGER_INDEX.md +23 -0
  53. package/.aiwf/06_FEATURE_LEDGERS/FEATURE_SCHEMA.md +205 -0
  54. package/.aiwf/06_FEATURE_LEDGERS/FEATURE_STATE_DIAGRAM.md +190 -0
  55. package/.aiwf/06_FEATURE_LEDGERS/active/FL001_user_authentication_system.md +47 -0
  56. package/.aiwf/06_FEATURE_LEDGERS/active/FL002_user_authentication_system.md +47 -0
  57. package/.aiwf/07_AI_PERSONAS/PERSONA_INDEX.md +57 -0
  58. package/.aiwf/07_AI_PERSONAS/architect/best_practices.md +104 -0
  59. package/.aiwf/07_AI_PERSONAS/architect/context_rules.md +46 -0
  60. package/.aiwf/07_AI_PERSONAS/architect/knowledge_base.md +235 -0
  61. package/.aiwf/07_AI_PERSONAS/backend/best_practices.md +363 -0
  62. package/.aiwf/07_AI_PERSONAS/backend/context_rules.md +61 -0
  63. package/.aiwf/07_AI_PERSONAS/backend/knowledge_base.md +623 -0
  64. package/.aiwf/07_AI_PERSONAS/data_analyst/best_practices.md +32 -0
  65. package/.aiwf/07_AI_PERSONAS/data_analyst/context_rules.md +43 -0
  66. package/.aiwf/07_AI_PERSONAS/data_analyst/knowledge_base.md +36 -0
  67. package/.aiwf/07_AI_PERSONAS/frontend/best_practices.md +31 -0
  68. package/.aiwf/07_AI_PERSONAS/frontend/context_rules.md +43 -0
  69. package/.aiwf/07_AI_PERSONAS/frontend/knowledge_base.md +32 -0
  70. package/.aiwf/07_AI_PERSONAS/security/best_practices.md +63 -0
  71. package/.aiwf/07_AI_PERSONAS/security/context_rules.md +53 -0
  72. package/.aiwf/07_AI_PERSONAS/security/knowledge_base.md +93 -0
  73. package/.aiwf/10_PERSONAS/active.json +1 -0
  74. package/.aiwf/10_PERSONAS/developer.md +37 -0
  75. package/.aiwf/10_STATE_OF_PROJECT/2025-07-09-07-20-solid-progress.md +144 -0
  76. package/.aiwf/98_PROMPTS/SAAS_DEVELOPMENT_GUIDE.md +302 -0
  77. package/.aiwf/98_PROMPTS/github_integration.md +130 -0
  78. package/.aiwf/98_PROMPTS/useful-prompts.md +31 -0
  79. package/.aiwf/98_PROMPTS/vibe-front-prompts.md +89 -0
  80. package/.aiwf/99_TEMPLATES/adr_template.md +49 -0
  81. package/.aiwf/99_TEMPLATES/feature_template.md +263 -0
  82. package/.aiwf/99_TEMPLATES/milestone_meta_template.md +25 -0
  83. package/.aiwf/99_TEMPLATES/project_manifest_template.md +39 -0
  84. package/.aiwf/99_TEMPLATES/sprint_meta_template.md +23 -0
  85. package/.aiwf/99_TEMPLATES/task_template.md +36 -0
  86. package/.aiwf/CLAUDE.md +76 -0
  87. package/.aiwf/ai-tools/README.md +105 -0
  88. package/.aiwf/ai-tools/augment/README.md +371 -0
  89. package/.aiwf/ai-tools/augment/config.json +30 -0
  90. package/.aiwf/ai-tools/augment/template/.augment/aiwf-integration.md +387 -0
  91. package/.aiwf/ai-tools/augment/template/.augment/augment.yaml +347 -0
  92. package/.aiwf/ai-tools/augment/template/augment.config.json +64 -0
  93. package/.aiwf/ai-tools/claude-code/README.md +151 -0
  94. package/.aiwf/ai-tools/claude-code/config.json +28 -0
  95. package/.aiwf/ai-tools/claude-code/template/CLAUDE.md +91 -0
  96. package/.aiwf/ai-tools/cursor/README.md +314 -0
  97. package/.aiwf/ai-tools/cursor/config.json +29 -0
  98. package/.aiwf/ai-tools/cursor/template/.cursorrules +362 -0
  99. package/.aiwf/ai-tools/github-copilot/README.md +195 -0
  100. package/.aiwf/ai-tools/github-copilot/config.json +24 -0
  101. package/.aiwf/ai-tools/github-copilot/template/.github/copilot-instructions.md +202 -0
  102. package/.aiwf/ai-tools/windsurf/README.md +355 -0
  103. package/.aiwf/ai-tools/windsurf/config.json +29 -0
  104. package/.aiwf/ai-tools/windsurf/template/.windsurf/aiwf-rules.md +260 -0
  105. package/.aiwf/ai-tools/windsurf/template/.windsurf/windsurf.config.js +312 -0
  106. package/.aiwf/ai-tools/windsurf/template/windsurf.config.json +63 -0
  107. package/.aiwf/config/language.json +6 -0
  108. package/.aiwf/feature-ledger/FL-001-authentication.json +52 -0
  109. package/.aiwf/feature-ledger/feature-index.json +20 -0
  110. package/.aiwf/personas/analyst.json +44 -0
  111. package/.aiwf/personas/architect/best_practices.md +136 -0
  112. package/.aiwf/personas/architect/knowledge_base.md +377 -0
  113. package/.aiwf/personas/architect.json +44 -0
  114. package/.aiwf/personas/backend/best_practices.md +766 -0
  115. package/.aiwf/personas/backend/knowledge_base.md +1070 -0
  116. package/.aiwf/personas/data_analyst/best_practices.md +594 -0
  117. package/.aiwf/personas/data_analyst/knowledge_base.md +1057 -0
  118. package/.aiwf/personas/developer.json +44 -0
  119. package/.aiwf/personas/evaluation_criteria.json +137 -0
  120. package/.aiwf/personas/frontend/best_practices.md +445 -0
  121. package/.aiwf/personas/frontend/knowledge_base.md +729 -0
  122. package/.aiwf/personas/persona-index.json +31 -0
  123. package/.aiwf/personas/reviewer.json +44 -0
  124. package/.aiwf/personas/security/best_practices.md +307 -0
  125. package/.aiwf/personas/security/knowledge_base.md +498 -0
  126. package/.aiwf/personas/tester.json +44 -0
  127. package/.aiwf/scripts/cache-templates.js +209 -0
  128. package/.aiwf/scripts/create-offline.js +86 -0
  129. package/.aiwf/scripts/create-project.js +151 -0
  130. package/.aiwf/scripts/feature-progress-calculator.cjs +236 -0
  131. package/.aiwf/scripts/git-integration.cjs +391 -0
  132. package/.aiwf/scripts/install-git-hooks.cjs +226 -0
  133. package/.aiwf/scripts/test-commit-parsing.cjs +125 -0
  134. package/.aiwf/scripts/update-feature-status.cjs +198 -0
  135. package/.aiwf/templates/README.md +78 -0
  136. package/.aiwf/templates/api-server/config.json +64 -0
  137. package/.aiwf/templates/api-server/template/.aiwf/config.json +56 -0
  138. package/.aiwf/templates/api-server/template/.aiwf/feature-ledger.json +42 -0
  139. package/.aiwf/templates/api-server/template/.aiwf/personas/backend-engineer.json +40 -0
  140. package/.aiwf/templates/api-server/template/.aiwf/scripts/cli.js +111 -0
  141. package/.aiwf/templates/api-server/template/.env.example +29 -0
  142. package/.aiwf/templates/api-server/template/.eslintrc.json +23 -0
  143. package/.aiwf/templates/api-server/template/README.md +171 -0
  144. package/.aiwf/templates/api-server/template/jest.config.js +26 -0
  145. package/.aiwf/templates/api-server/template/nodemon.json +9 -0
  146. package/.aiwf/templates/api-server/template/package.json +61 -0
  147. package/.aiwf/templates/api-server/template/src/app.ts +60 -0
  148. package/.aiwf/templates/api-server/template/src/config/swagger.ts +38 -0
  149. package/.aiwf/templates/api-server/template/src/controllers/aiwfController.ts +68 -0
  150. package/.aiwf/templates/api-server/template/src/controllers/authController.ts +128 -0
  151. package/.aiwf/templates/api-server/template/src/controllers/statusController.ts +28 -0
  152. package/.aiwf/templates/api-server/template/src/index.ts +28 -0
  153. package/.aiwf/templates/api-server/template/src/middleware/aiwfMiddleware.ts +50 -0
  154. package/.aiwf/templates/api-server/template/src/middleware/authMiddleware.ts +41 -0
  155. package/.aiwf/templates/api-server/template/src/middleware/errorHandler.ts +42 -0
  156. package/.aiwf/templates/api-server/template/src/middleware/notFoundHandler.ts +14 -0
  157. package/.aiwf/templates/api-server/template/src/middleware/requestLogger.ts +20 -0
  158. package/.aiwf/templates/api-server/template/src/routes/aiwf.ts +42 -0
  159. package/.aiwf/templates/api-server/template/src/routes/index.ts +13 -0
  160. package/.aiwf/templates/api-server/template/src/routes/v1/index.ts +67 -0
  161. package/.aiwf/templates/api-server/template/src/utils/logger.ts +37 -0
  162. package/.aiwf/templates/api-server/template/tests/app.test.ts +40 -0
  163. package/.aiwf/templates/api-server/template/tsconfig.json +43 -0
  164. package/.aiwf/templates/npm-library/config.json +61 -0
  165. package/.aiwf/templates/npm-library/template/LICENSE +21 -0
  166. package/.aiwf/templates/npm-library/template/README.md +201 -0
  167. package/.aiwf/templates/npm-library/template/package.json +78 -0
  168. package/.aiwf/templates/web-app/config.json +53 -0
  169. package/.aiwf/templates/web-app/template/.aiwf/config.json +54 -0
  170. package/.aiwf/templates/web-app/template/.aiwf/feature-ledger.json +37 -0
  171. package/.aiwf/templates/web-app/template/.aiwf/personas/fullstack-developer.json +40 -0
  172. package/.aiwf/templates/web-app/template/.aiwf/scripts/cli.js +110 -0
  173. package/.aiwf/templates/web-app/template/.eslintrc.cjs +20 -0
  174. package/.aiwf/templates/web-app/template/README.md +151 -0
  175. package/.aiwf/templates/web-app/template/index.html +14 -0
  176. package/.aiwf/templates/web-app/template/package.json +44 -0
  177. package/.aiwf/templates/web-app/template/postcss.config.js +6 -0
  178. package/.aiwf/templates/web-app/template/public/vite.svg +1 -0
  179. package/.aiwf/templates/web-app/template/src/App.tsx +21 -0
  180. package/.aiwf/templates/web-app/template/src/components/Layout.tsx +57 -0
  181. package/.aiwf/templates/web-app/template/src/components/aiwf/ContextStatus.tsx +107 -0
  182. package/.aiwf/templates/web-app/template/src/components/aiwf/FeatureLedger.tsx +93 -0
  183. package/.aiwf/templates/web-app/template/src/components/aiwf/TokenUsage.tsx +71 -0
  184. package/.aiwf/templates/web-app/template/src/index.css +60 -0
  185. package/.aiwf/templates/web-app/template/src/main.tsx +10 -0
  186. package/.aiwf/templates/web-app/template/src/pages/AiwfDashboard.tsx +60 -0
  187. package/.aiwf/templates/web-app/template/src/pages/HomePage.tsx +89 -0
  188. package/.aiwf/templates/web-app/template/src/pages/NotFound.tsx +25 -0
  189. package/.aiwf/templates/web-app/template/src/stores/aiwfStore.ts +126 -0
  190. package/.aiwf/templates/web-app/template/src/types/global.d.ts +9 -0
  191. package/.aiwf/templates/web-app/template/src/vite-env.d.ts +1 -0
  192. package/.aiwf/templates/web-app/template/tailwind.config.js +30 -0
  193. package/.aiwf/templates/web-app/template/tsconfig.json +37 -0
  194. package/.aiwf/templates/web-app/template/tsconfig.node.json +10 -0
  195. package/.aiwf/templates/web-app/template/vite.config.ts +23 -0
  196. package/.aiwf/test-cache/86c7f9e80251abb8bedd58953ab0d1779e46b4f43ea33b63bffdb778106373b0.json +6 -0
  197. package/.aiwf/test-cache/9e252a90b80fce0585d7ed0646e7a9b4343e109f661f42a3ae678ba1ec5e22c7.json +7 -0
  198. package/.aiwf/test-results-s02.json +36 -0
  199. package/.aiwf/token-data/alerts.json +293 -0
  200. package/.aiwf/token-data/monitor-config.json +12 -0
  201. package/CHANGELOG.md +95 -11
  202. package/CHANGELOG_M02.md +52 -0
  203. package/CLAUDE.md +135 -0
  204. package/README.ko.md +5 -0
  205. package/README.md +6 -0
  206. package/RELEASE_NOTES_M02.md +177 -0
  207. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_create_feature_ledger.md +54 -0
  208. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_default_mode.md +66 -0
  209. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_get_feature_details.md +78 -0
  210. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_link_feature_to_milestone.md +57 -0
  211. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_list_features.md +54 -0
  212. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_architect.md +60 -0
  213. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_backend.md +60 -0
  214. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_data_analyst.md +60 -0
  215. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_frontend.md +60 -0
  216. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_security.md +60 -0
  217. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_status.md +72 -0
  218. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_update_feature_status.md +53 -0
  219. package/claude-code/aiwf/en/commands/ai-persona.js +667 -0
  220. package/claude-code/aiwf/en/commands/compress-context.js +355 -0
  221. package/claude-code/aiwf/en/commands/feature-ledger.js +565 -0
  222. package/claude-code/aiwf/en/commands/feature_commit_report.js +370 -0
  223. package/claude-code/aiwf/en/commands/scan_git_history.js +234 -0
  224. package/claude-code/aiwf/en/commands/sync_feature_commits.js +154 -0
  225. package/claude-code/aiwf/en/commands/token-tracking.js +443 -0
  226. package/claude-code/aiwf/en/config/commit-patterns.js +103 -0
  227. package/claude-code/aiwf/en/hooks/install-hooks.sh +100 -0
  228. package/claude-code/aiwf/en/hooks/post-commit +84 -0
  229. package/claude-code/aiwf/en/tests/compression-test-suite.js +1252 -0
  230. package/claude-code/aiwf/en/tests/test-git-integration.js +164 -0
  231. package/claude-code/aiwf/en/tests/token-tracking.test.js +537 -0
  232. package/claude-code/aiwf/en/utils/compression-metrics.js +1031 -0
  233. package/claude-code/aiwf/en/utils/compression-strategies.js +557 -0
  234. package/claude-code/aiwf/en/utils/content-normalizer.js +455 -0
  235. package/claude-code/aiwf/en/utils/context-compressor.js +583 -0
  236. package/claude-code/aiwf/en/utils/feature-updater.js +271 -0
  237. package/claude-code/aiwf/en/utils/git-utils.js +220 -0
  238. package/claude-code/aiwf/en/utils/importance-classifier.js +645 -0
  239. package/claude-code/aiwf/en/utils/information-filter.js +710 -0
  240. package/claude-code/aiwf/en/utils/text-summarizer.js +487 -0
  241. package/claude-code/aiwf/en/utils/token-counter.js +177 -0
  242. package/claude-code/aiwf/en/utils/token-monitor.js +484 -0
  243. package/claude-code/aiwf/en/utils/token-reporter.js +453 -0
  244. package/claude-code/aiwf/en/utils/token-storage.js +433 -0
  245. package/claude-code/aiwf/en/utils/token-tracker.js +283 -0
  246. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_ID_GENERATOR.md +138 -0
  247. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_INDEX.md +186 -0
  248. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_METADATA.md +240 -0
  249. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_WORKFLOW.md +183 -0
  250. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/README.md +94 -0
  251. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/active/FL001_/354/202/254/354/232/251/354/236/220_/354/235/270/354/246/235_/354/213/234/354/212/244/355/205/234.md +154 -0
  252. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/active/FL002_ai_/355/216/230/353/245/264/354/206/214/353/202/230_/354/213/234/354/212/244/355/205/234.md +272 -0
  253. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/completed/FL003_/353/213/244/352/265/255/354/226/264_/353/252/205/353/240/271/354/226/264_/355/221/234/354/244/200/355/231/224.md +266 -0
  254. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/schemas/feature_schema.json +122 -0
  255. package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/schemas/feature_validator.cjs +406 -0
  256. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_aggressive_persona.md +53 -0
  257. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_context.md +116 -0
  258. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_minimal_persona.md +48 -0
  259. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_stats.md +79 -0
  260. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_with_persona.md +51 -0
  261. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_feature_ledger.md +54 -0
  262. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_default_mode.md +44 -0
  263. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_evaluate.md +92 -0
  264. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_get_feature_details.md +78 -0
  265. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_link_feature_to_milestone.md +57 -0
  266. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_list_features.md +54 -0
  267. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_architect.md +48 -0
  268. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_backend.md +37 -0
  269. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_data_analyst.md +37 -0
  270. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_frontend.md +37 -0
  271. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_security.md +48 -0
  272. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_status.md +50 -0
  273. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_update_docs_kr.md +25 -0
  274. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_update_feature_status.md +53 -0
  275. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_yolo.md +2 -2
  276. package/claude-code/aiwf/ko/CLAUDE.md +76 -0
  277. package/claude-code/aiwf/ko/ai-tools/README.md +105 -0
  278. package/claude-code/aiwf/ko/ai-tools/augment/README.md +371 -0
  279. package/claude-code/aiwf/ko/ai-tools/augment/config.json +30 -0
  280. package/claude-code/aiwf/ko/ai-tools/augment/template/.augment/aiwf-integration.md +387 -0
  281. package/claude-code/aiwf/ko/ai-tools/augment/template/.augment/augment.yaml +347 -0
  282. package/claude-code/aiwf/ko/ai-tools/augment/template/augment.config.json +64 -0
  283. package/claude-code/aiwf/ko/ai-tools/claude-code/README.md +151 -0
  284. package/claude-code/aiwf/ko/ai-tools/claude-code/config.json +28 -0
  285. package/claude-code/aiwf/ko/ai-tools/claude-code/template/CLAUDE.md +91 -0
  286. package/claude-code/aiwf/ko/ai-tools/cursor/README.md +314 -0
  287. package/claude-code/aiwf/ko/ai-tools/cursor/config.json +29 -0
  288. package/claude-code/aiwf/ko/ai-tools/cursor/template/.cursorrules +362 -0
  289. package/claude-code/aiwf/ko/ai-tools/github-copilot/README.md +195 -0
  290. package/claude-code/aiwf/ko/ai-tools/github-copilot/config.json +24 -0
  291. package/claude-code/aiwf/ko/ai-tools/github-copilot/template/.github/copilot-instructions.md +202 -0
  292. package/claude-code/aiwf/ko/ai-tools/windsurf/README.md +355 -0
  293. package/claude-code/aiwf/ko/ai-tools/windsurf/config.json +29 -0
  294. package/claude-code/aiwf/ko/ai-tools/windsurf/template/.windsurf/aiwf-rules.md +260 -0
  295. package/claude-code/aiwf/ko/ai-tools/windsurf/template/.windsurf/windsurf.config.js +312 -0
  296. package/claude-code/aiwf/ko/ai-tools/windsurf/template/windsurf.config.json +63 -0
  297. package/claude-code/aiwf/ko/bin/aiwf-create.js +56 -0
  298. package/claude-code/aiwf/ko/bin/aiwf.js +21 -0
  299. package/claude-code/aiwf/ko/commands/ai-persona.js +602 -0
  300. package/claude-code/aiwf/ko/commands/compress-context.js +389 -0
  301. package/claude-code/aiwf/ko/commands/evaluate.js +246 -0
  302. package/claude-code/aiwf/ko/commands/feature-ledger.js +565 -0
  303. package/claude-code/aiwf/ko/commands/feature_commit_report.js +370 -0
  304. package/claude-code/aiwf/ko/commands/persona-context-apply.js +562 -0
  305. package/claude-code/aiwf/ko/commands/scan_git_history.js +234 -0
  306. package/claude-code/aiwf/ko/commands/sync_feature_commits.js +154 -0
  307. package/claude-code/aiwf/ko/commands/token-tracking.js +443 -0
  308. package/claude-code/aiwf/ko/config/commit-patterns.js +103 -0
  309. package/claude-code/aiwf/ko/config/language.json +6 -0
  310. package/claude-code/aiwf/ko/docs/00_PROJECT_MANIFEST.md +183 -0
  311. package/claude-code/aiwf/ko/docs/ARCHITECTURE.md +121 -0
  312. package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_ADVANCED_USE_CASES.md +412 -0
  313. package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_API_REFERENCE.md +361 -0
  314. package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_COMMANDS_GUIDE.md +254 -0
  315. package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_FAQ.md +365 -0
  316. package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_SYSTEM_OVERVIEW.md +305 -0
  317. package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_USER_GUIDE.md +416 -0
  318. package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_/354/213/234/354/236/221_/352/260/200/354/235/264/353/223/234.md +247 -0
  319. package/claude-code/aiwf/ko/feature-ledger/FL-001-authentication.json +52 -0
  320. package/claude-code/aiwf/ko/feature-ledger/feature-index.json +20 -0
  321. package/claude-code/aiwf/ko/hooks/install-hooks.sh +100 -0
  322. package/claude-code/aiwf/ko/hooks/post-commit +84 -0
  323. package/claude-code/aiwf/ko/personas/PERSONA_INDEX.md +57 -0
  324. package/claude-code/aiwf/ko/personas/analyst.json +44 -0
  325. package/claude-code/aiwf/ko/personas/architect/best_practices.md +136 -0
  326. package/claude-code/aiwf/ko/personas/architect/knowledge_base.md +377 -0
  327. package/claude-code/aiwf/ko/personas/architect.json +44 -0
  328. package/claude-code/aiwf/ko/personas/backend/best_practices.md +766 -0
  329. package/claude-code/aiwf/ko/personas/backend/knowledge_base.md +1070 -0
  330. package/claude-code/aiwf/ko/personas/data_analyst/best_practices.md +594 -0
  331. package/claude-code/aiwf/ko/personas/data_analyst/knowledge_base.md +1057 -0
  332. package/claude-code/aiwf/ko/personas/developer.json +44 -0
  333. package/claude-code/aiwf/ko/personas/developer.md +37 -0
  334. package/claude-code/aiwf/ko/personas/evaluation_criteria.json +137 -0
  335. package/claude-code/aiwf/ko/personas/frontend/best_practices.md +445 -0
  336. package/claude-code/aiwf/ko/personas/frontend/knowledge_base.md +729 -0
  337. package/claude-code/aiwf/ko/personas/persona-index.json +31 -0
  338. package/claude-code/aiwf/ko/personas/reviewer.json +44 -0
  339. package/claude-code/aiwf/ko/personas/security/best_practices.md +307 -0
  340. package/claude-code/aiwf/ko/personas/security/knowledge_base.md +498 -0
  341. package/claude-code/aiwf/ko/personas/tester.json +44 -0
  342. package/claude-code/aiwf/ko/scripts/cache-templates.js +209 -0
  343. package/claude-code/aiwf/ko/scripts/create-offline.js +86 -0
  344. package/claude-code/aiwf/ko/scripts/create-project.js +151 -0
  345. package/claude-code/aiwf/ko/scripts/feature-progress-calculator.cjs +236 -0
  346. package/claude-code/aiwf/ko/scripts/git-integration.cjs +391 -0
  347. package/claude-code/aiwf/ko/scripts/install-git-hooks.cjs +226 -0
  348. package/claude-code/aiwf/ko/scripts/test-commit-parsing.cjs +125 -0
  349. package/claude-code/aiwf/ko/scripts/update-feature-status.cjs +198 -0
  350. package/claude-code/aiwf/ko/templates/README.md +78 -0
  351. package/claude-code/aiwf/ko/templates/api-server/config.json +64 -0
  352. package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/config.json +56 -0
  353. package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/feature-ledger.json +42 -0
  354. package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/personas/backend-engineer.json +40 -0
  355. package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/scripts/cli.js +111 -0
  356. package/claude-code/aiwf/ko/templates/api-server/template/.env.example +29 -0
  357. package/claude-code/aiwf/ko/templates/api-server/template/.eslintrc.json +23 -0
  358. package/claude-code/aiwf/ko/templates/api-server/template/README.md +171 -0
  359. package/claude-code/aiwf/ko/templates/api-server/template/jest.config.js +26 -0
  360. package/claude-code/aiwf/ko/templates/api-server/template/nodemon.json +9 -0
  361. package/claude-code/aiwf/ko/templates/api-server/template/package.json +61 -0
  362. package/claude-code/aiwf/ko/templates/api-server/template/src/app.ts +60 -0
  363. package/claude-code/aiwf/ko/templates/api-server/template/src/config/swagger.ts +38 -0
  364. package/claude-code/aiwf/ko/templates/api-server/template/src/controllers/aiwfController.ts +68 -0
  365. package/claude-code/aiwf/ko/templates/api-server/template/src/controllers/authController.ts +128 -0
  366. package/claude-code/aiwf/ko/templates/api-server/template/src/controllers/statusController.ts +28 -0
  367. package/claude-code/aiwf/ko/templates/api-server/template/src/index.ts +28 -0
  368. package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/aiwfMiddleware.ts +50 -0
  369. package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/authMiddleware.ts +41 -0
  370. package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/errorHandler.ts +42 -0
  371. package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/notFoundHandler.ts +14 -0
  372. package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/requestLogger.ts +20 -0
  373. package/claude-code/aiwf/ko/templates/api-server/template/src/routes/aiwf.ts +42 -0
  374. package/claude-code/aiwf/ko/templates/api-server/template/src/routes/index.ts +13 -0
  375. package/claude-code/aiwf/ko/templates/api-server/template/src/routes/v1/index.ts +67 -0
  376. package/claude-code/aiwf/ko/templates/api-server/template/src/utils/logger.ts +37 -0
  377. package/claude-code/aiwf/ko/templates/api-server/template/tests/app.test.ts +40 -0
  378. package/claude-code/aiwf/ko/templates/api-server/template/tsconfig.json +43 -0
  379. package/claude-code/aiwf/ko/templates/npm-library/config.json +61 -0
  380. package/claude-code/aiwf/ko/templates/npm-library/template/LICENSE +21 -0
  381. package/claude-code/aiwf/ko/templates/npm-library/template/README.md +201 -0
  382. package/claude-code/aiwf/ko/templates/npm-library/template/package.json +78 -0
  383. package/claude-code/aiwf/ko/templates/web-app/config.json +53 -0
  384. package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/config.json +54 -0
  385. package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/feature-ledger.json +37 -0
  386. package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/personas/fullstack-developer.json +40 -0
  387. package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/scripts/cli.js +110 -0
  388. package/claude-code/aiwf/ko/templates/web-app/template/.eslintrc.cjs +20 -0
  389. package/claude-code/aiwf/ko/templates/web-app/template/README.md +151 -0
  390. package/claude-code/aiwf/ko/templates/web-app/template/index.html +14 -0
  391. package/claude-code/aiwf/ko/templates/web-app/template/package.json +44 -0
  392. package/claude-code/aiwf/ko/templates/web-app/template/postcss.config.js +6 -0
  393. package/claude-code/aiwf/ko/templates/web-app/template/public/vite.svg +1 -0
  394. package/claude-code/aiwf/ko/templates/web-app/template/src/App.tsx +21 -0
  395. package/claude-code/aiwf/ko/templates/web-app/template/src/components/Layout.tsx +57 -0
  396. package/claude-code/aiwf/ko/templates/web-app/template/src/components/aiwf/ContextStatus.tsx +107 -0
  397. package/claude-code/aiwf/ko/templates/web-app/template/src/components/aiwf/FeatureLedger.tsx +93 -0
  398. package/claude-code/aiwf/ko/templates/web-app/template/src/components/aiwf/TokenUsage.tsx +71 -0
  399. package/claude-code/aiwf/ko/templates/web-app/template/src/index.css +60 -0
  400. package/claude-code/aiwf/ko/templates/web-app/template/src/main.tsx +10 -0
  401. package/claude-code/aiwf/ko/templates/web-app/template/src/pages/AiwfDashboard.tsx +60 -0
  402. package/claude-code/aiwf/ko/templates/web-app/template/src/pages/HomePage.tsx +89 -0
  403. package/claude-code/aiwf/ko/templates/web-app/template/src/pages/NotFound.tsx +25 -0
  404. package/claude-code/aiwf/ko/templates/web-app/template/src/stores/aiwfStore.ts +126 -0
  405. package/claude-code/aiwf/ko/templates/web-app/template/src/types/global.d.ts +9 -0
  406. package/claude-code/aiwf/ko/templates/web-app/template/src/vite-env.d.ts +1 -0
  407. package/claude-code/aiwf/ko/templates/web-app/template/tailwind.config.js +30 -0
  408. package/claude-code/aiwf/ko/templates/web-app/template/tsconfig.json +37 -0
  409. package/claude-code/aiwf/ko/templates/web-app/template/tsconfig.node.json +10 -0
  410. package/claude-code/aiwf/ko/templates/web-app/template/vite.config.ts +23 -0
  411. package/claude-code/aiwf/ko/tests/compression-test-suite.js +1252 -0
  412. package/claude-code/aiwf/ko/tests/test-git-integration.js +164 -0
  413. package/claude-code/aiwf/ko/tests/token-tracking.test.js +537 -0
  414. package/claude-code/aiwf/ko/token-data/alerts.json +293 -0
  415. package/claude-code/aiwf/ko/token-data/monitor-config.json +12 -0
  416. package/claude-code/aiwf/ko/utils/background-monitor.js +223 -0
  417. package/claude-code/aiwf/ko/utils/compression-metrics.js +1031 -0
  418. package/claude-code/aiwf/ko/utils/compression-strategies.js +557 -0
  419. package/claude-code/aiwf/ko/utils/content-normalizer.js +455 -0
  420. package/claude-code/aiwf/ko/utils/context-compressor.js +583 -0
  421. package/claude-code/aiwf/ko/utils/context-rule-parser.js +180 -0
  422. package/claude-code/aiwf/ko/utils/context-token-monitor.js +463 -0
  423. package/claude-code/aiwf/ko/utils/context-update-manager.js +502 -0
  424. package/claude-code/aiwf/ko/utils/feature-updater.js +271 -0
  425. package/claude-code/aiwf/ko/utils/git-utils.js +220 -0
  426. package/claude-code/aiwf/ko/utils/importance-classifier.js +645 -0
  427. package/claude-code/aiwf/ko/utils/information-filter.js +710 -0
  428. package/claude-code/aiwf/ko/utils/persona-aware-compressor.js +598 -0
  429. package/claude-code/aiwf/ko/utils/prompt-injector.js +242 -0
  430. package/claude-code/aiwf/ko/utils/simplified-evaluator.js +119 -0
  431. package/claude-code/aiwf/ko/utils/text-summarizer.js +492 -0
  432. package/claude-code/aiwf/ko/utils/token-counter.js +177 -0
  433. package/claude-code/aiwf/ko/utils/token-monitor.js +484 -0
  434. package/claude-code/aiwf/ko/utils/token-reporter.js +453 -0
  435. package/claude-code/aiwf/ko/utils/token-storage.js +433 -0
  436. package/claude-code/aiwf/ko/utils/token-tracker.js +283 -0
  437. package/docs/AI_PERSONA_SYSTEM_DESIGN.md +516 -0
  438. package/docs/API_DOCUMENTATION.md +932 -0
  439. package/docs/API_REFERENCE.md +979 -0
  440. package/docs/COMMANDS_GUIDE.ko.md +8 -2
  441. package/docs/COMMANDS_GUIDE.md +196 -2
  442. package/docs/CONTRIBUTING.ko.md +408 -0
  443. package/docs/CONTRIBUTING.md +205 -203
  444. package/docs/EXAMPLES.md +691 -0
  445. package/docs/GETTING_STARTED.md +480 -0
  446. package/docs/PERFORMANCE_ARCHITECTURE.md +494 -0
  447. package/docs/PERFORMANCE_GUIDELINES.md +553 -0
  448. package/docs/TROUBLESHOOTING.md +721 -0
  449. package/docs/git-feature-integration-guide.md +253 -0
  450. package/docs/guides/ai-personas-guide-ko.md +239 -0
  451. package/docs/guides/ai-personas-guide.md +239 -0
  452. package/docs/guides/context-compression-guide-ko.md +313 -0
  453. package/docs/guides/context-compression-guide.md +313 -0
  454. package/docs/guides/feature-git-integration-guide-ko.md +481 -0
  455. package/docs/guides/feature-git-integration-guide.md +481 -0
  456. package/docs/lightweight-evaluation.md +198 -0
  457. package/docs/m02-dod-checklist.md +125 -0
  458. package/docs/m02-gap-analysis.md +214 -0
  459. package/docs/m02-milestone-completion-report.md +186 -0
  460. package/docs/m02-milestone-executive-summary.md +68 -0
  461. package/docs/offline-template-cache.md +323 -0
  462. package/docs/performance-benchmark-report.md +159 -0
  463. package/docs/persona-aware-compression.md +168 -0
  464. package/docs/reports/S02-sprint-report.md +190 -0
  465. package/docs/usability-test-report.md +170 -0
  466. package/index.js +109 -1
  467. package/jest.config.js +20 -1
  468. package/language-utils.js +1 -1
  469. package/lib/ai-persona-manager.js +711 -0
  470. package/lib/cache-cli.js +459 -0
  471. package/lib/cache-integration.js +401 -0
  472. package/lib/cache-system.js +332 -0
  473. package/lib/context-engine.js +568 -0
  474. package/lib/file-batch-processor.js +401 -0
  475. package/lib/memory-profiler.js +471 -0
  476. package/lib/metrics-collector.js +885 -0
  477. package/lib/offline-detector.js +386 -0
  478. package/lib/performance-benchmark.js +621 -0
  479. package/lib/task-analyzer.js +599 -0
  480. package/lib/template-cache-system.js +559 -0
  481. package/lib/template-downloader.js +467 -0
  482. package/lib/template-manager.js +310 -0
  483. package/lib/template-version-manager.js +491 -0
  484. package/lib/token-optimizer.js +517 -0
  485. package/package.json +6 -3
  486. package/scripts/run-integration-tests.js +317 -0
  487. package/src/commands/ai-tool.js +383 -0
  488. package/test-token-system.js +88 -0
  489. package/tests/application.test.js +260 -0
  490. package/tests/basic.test.js +1 -1
  491. package/tests/integration/ai-persona-system.test.js +396 -0
  492. package/tests/integration/ai-persona.test.js +390 -0
  493. package/tests/integration/command-integration.test.js +600 -0
  494. package/tests/integration/context-compression.test.js +361 -0
  495. package/tests/integration/feature-ledger.test.js +226 -0
  496. package/tests/integration/git-integration.test.js +307 -0
  497. package/tests/integration/m02-milestone.test.js +420 -0
  498. package/tests/integration/persona-context-application.test.js +508 -0
  499. package/tests/integration/setup.js +174 -0
  500. package/tests/integration/test-persona-aware-compression.js +93 -0
  501. package/tests/language-utils.test.js +25 -9
  502. package/tests/s02-integration.test.js +422 -0
  503. package/tests/unit/ai-persona-manager.test.js +514 -0
  504. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_language_manager.md +0 -287
  505. package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_language_status.md +0 -246
  506. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_language_manager.md +0 -287
  507. package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_language_status.md +0 -246
@@ -0,0 +1,833 @@
1
+ # SPECS: Token Optimization System
2
+
3
+ ## 개요
4
+
5
+ AIWF의 토큰 사용량을 최적화하기 위한 Context 압축 시스템의 상세 설계 문서입니다. 이 시스템은 중요한 정보를 유지하면서 토큰 사용량을 50% 이상 줄이는 것을 목표로 합니다.
6
+
7
+ ## 1. 토큰 사용량 분석 도구 설계
8
+
9
+ ### 1.1 토큰 카운팅 메커니즘
10
+
11
+ ```javascript
12
+ // 토큰 카운팅 인터페이스
13
+ class TokenCounter {
14
+ constructor(model = 'gpt-4') {
15
+ this.model = model;
16
+ this.encoder = this.getEncoder(model);
17
+ }
18
+
19
+ // 텍스트의 토큰 수 계산
20
+ countTokens(text) {
21
+ return this.encoder.encode(text).length;
22
+ }
23
+
24
+ // 파일의 토큰 수 계산
25
+ countFileTokens(filePath) {
26
+ const content = fs.readFileSync(filePath, 'utf8');
27
+ return this.countTokens(content);
28
+ }
29
+
30
+ // 디렉토리의 전체 토큰 수 계산
31
+ countDirectoryTokens(dirPath) {
32
+ const files = this.getMarkdownFiles(dirPath);
33
+ return files.reduce((total, file) => {
34
+ return total + this.countFileTokens(file);
35
+ }, 0);
36
+ }
37
+
38
+ // 토큰 분포 분석
39
+ analyzeTokenDistribution(content) {
40
+ const sections = this.parseSections(content);
41
+ return sections.map(section => ({
42
+ name: section.name,
43
+ tokens: this.countTokens(section.content),
44
+ percentage: (this.countTokens(section.content) / this.countTokens(content)) * 100
45
+ }));
46
+ }
47
+ }
48
+ ```
49
+
50
+ ### 1.2 토큰 사용량 추적 시스템
51
+
52
+ ```javascript
53
+ // 토큰 사용량 추적 인터페이스
54
+ class TokenTracker {
55
+ constructor() {
56
+ this.usage = {
57
+ total: 0,
58
+ compressed: 0,
59
+ saved: 0,
60
+ ratio: 0
61
+ };
62
+ }
63
+
64
+ // 압축 전후 토큰 수 기록
65
+ trackCompression(originalTokens, compressedTokens) {
66
+ this.usage.total = originalTokens;
67
+ this.usage.compressed = compressedTokens;
68
+ this.usage.saved = originalTokens - compressedTokens;
69
+ this.usage.ratio = (this.usage.saved / originalTokens) * 100;
70
+ }
71
+
72
+ // 토큰 사용량 보고서 생성
73
+ generateReport() {
74
+ return {
75
+ originalTokens: this.usage.total,
76
+ compressedTokens: this.usage.compressed,
77
+ savedTokens: this.usage.saved,
78
+ compressionRatio: this.usage.ratio.toFixed(2) + '%',
79
+ efficiency: this.usage.ratio >= 50 ? 'High' : 'Medium'
80
+ };
81
+ }
82
+ }
83
+ ```
84
+
85
+ ### 1.3 토큰 분석 대시보드
86
+
87
+ ```javascript
88
+ // 토큰 분석 대시보드
89
+ class TokenDashboard {
90
+ constructor(projectPath) {
91
+ this.projectPath = projectPath;
92
+ this.counter = new TokenCounter();
93
+ this.tracker = new TokenTracker();
94
+ }
95
+
96
+ // 프로젝트 토큰 분석
97
+ analyzeProject() {
98
+ const analysis = {
99
+ totalTokens: 0,
100
+ fileBreakdown: {},
101
+ sectionBreakdown: {},
102
+ compressionOpportunities: []
103
+ };
104
+
105
+ // 각 디렉토리별 토큰 수 분석
106
+ const directories = [
107
+ '.aiwf/01_PROJECT_DOCS',
108
+ '.aiwf/02_REQUIREMENTS',
109
+ '.aiwf/03_SPRINTS',
110
+ '.aiwf/04_GENERAL_TASKS'
111
+ ];
112
+
113
+ directories.forEach(dir => {
114
+ const tokens = this.counter.countDirectoryTokens(dir);
115
+ analysis.fileBreakdown[dir] = tokens;
116
+ analysis.totalTokens += tokens;
117
+ });
118
+
119
+ // 압축 기회 식별
120
+ analysis.compressionOpportunities = this.identifyCompressionOpportunities();
121
+
122
+ return analysis;
123
+ }
124
+
125
+ // 압축 기회 식별
126
+ identifyCompressionOpportunities() {
127
+ const opportunities = [];
128
+
129
+ // 반복되는 콘텐츠 식별
130
+ opportunities.push({
131
+ type: 'repetitive_content',
132
+ description: '반복되는 템플릿 내용',
133
+ potential_savings: '20-30%'
134
+ });
135
+
136
+ // 장문의 설명 식별
137
+ opportunities.push({
138
+ type: 'verbose_descriptions',
139
+ description: '장문의 설명 및 예시',
140
+ potential_savings: '15-25%'
141
+ });
142
+
143
+ // 오래된 로그 식별
144
+ opportunities.push({
145
+ type: 'outdated_logs',
146
+ description: '오래된 로그 및 히스토리',
147
+ potential_savings: '10-20%'
148
+ });
149
+
150
+ return opportunities;
151
+ }
152
+ }
153
+ ```
154
+
155
+ ## 2. Context 압축 알고리즘 연구 및 설계
156
+
157
+ ### 2.1 압축 알고리즘 아키텍처
158
+
159
+ ```javascript
160
+ // Context 압축 알고리즘 클래스
161
+ class ContextCompressor {
162
+ constructor(mode = 'balanced') {
163
+ this.mode = mode;
164
+ this.strategies = {
165
+ aggressive: new AggressiveCompressionStrategy(),
166
+ balanced: new BalancedCompressionStrategy(),
167
+ minimal: new MinimalCompressionStrategy()
168
+ };
169
+ }
170
+
171
+ // 메인 압축 메서드
172
+ compress(content, options = {}) {
173
+ const strategy = this.strategies[this.mode];
174
+ const compressed = strategy.compress(content, options);
175
+
176
+ return {
177
+ original: content,
178
+ compressed: compressed.content,
179
+ metadata: compressed.metadata,
180
+ compressionRatio: this.calculateRatio(content, compressed.content)
181
+ };
182
+ }
183
+
184
+ // 압축률 계산
185
+ calculateRatio(original, compressed) {
186
+ const originalTokens = new TokenCounter().countTokens(original);
187
+ const compressedTokens = new TokenCounter().countTokens(compressed);
188
+ return ((originalTokens - compressedTokens) / originalTokens) * 100;
189
+ }
190
+ }
191
+ ```
192
+
193
+ ### 2.2 압축 전략 인터페이스
194
+
195
+ ```javascript
196
+ // 압축 전략 기본 인터페이스
197
+ class CompressionStrategy {
198
+ compress(content, options) {
199
+ throw new Error('compress method must be implemented');
200
+ }
201
+
202
+ decompress(compressed, metadata) {
203
+ throw new Error('decompress method must be implemented');
204
+ }
205
+ }
206
+
207
+ // 적극적 압축 전략 (50-70% 압축)
208
+ class AggressiveCompressionStrategy extends CompressionStrategy {
209
+ compress(content, options) {
210
+ let compressed = content;
211
+
212
+ // 1. 반복 콘텐츠 제거
213
+ compressed = this.removeRepetitiveContent(compressed);
214
+
215
+ // 2. 상세 설명 요약
216
+ compressed = this.summarizeDescriptions(compressed);
217
+
218
+ // 3. 오래된 로그 제거
219
+ compressed = this.removeOldLogs(compressed);
220
+
221
+ // 4. 중요도 기반 필터링
222
+ compressed = this.filterByImportance(compressed, 'high');
223
+
224
+ return {
225
+ content: compressed,
226
+ metadata: {
227
+ strategy: 'aggressive',
228
+ removedSections: this.getRemovedSections(),
229
+ compressionLevel: 'high'
230
+ }
231
+ };
232
+ }
233
+ }
234
+
235
+ // 균형 압축 전략 (30-50% 압축)
236
+ class BalancedCompressionStrategy extends CompressionStrategy {
237
+ compress(content, options) {
238
+ let compressed = content;
239
+
240
+ // 1. 반복 콘텐츠 축약
241
+ compressed = this.condenseRepetitiveContent(compressed);
242
+
243
+ // 2. 장문 설명 압축
244
+ compressed = this.compressLongDescriptions(compressed);
245
+
246
+ // 3. 중요도 기반 필터링 (medium 이상)
247
+ compressed = this.filterByImportance(compressed, 'medium');
248
+
249
+ return {
250
+ content: compressed,
251
+ metadata: {
252
+ strategy: 'balanced',
253
+ compressionLevel: 'medium'
254
+ }
255
+ };
256
+ }
257
+ }
258
+
259
+ // 최소 압축 전략 (10-30% 압축)
260
+ class MinimalCompressionStrategy extends CompressionStrategy {
261
+ compress(content, options) {
262
+ let compressed = content;
263
+
264
+ // 1. 공백 및 포맷팅 최적화
265
+ compressed = this.optimizeFormatting(compressed);
266
+
267
+ // 2. 오래된 로그만 제거
268
+ compressed = this.removeOldLogs(compressed);
269
+
270
+ return {
271
+ content: compressed,
272
+ metadata: {
273
+ strategy: 'minimal',
274
+ compressionLevel: 'low'
275
+ }
276
+ };
277
+ }
278
+ }
279
+ ```
280
+
281
+ ## 3. 압축 레벨 및 모드 정의
282
+
283
+ ### 3.1 압축 모드 정의
284
+
285
+ ```javascript
286
+ // 압축 모드 설정
287
+ const COMPRESSION_MODES = {
288
+ aggressive: {
289
+ name: 'Aggressive',
290
+ description: '최대 압축률 (50-70%)',
291
+ target_ratio: 60,
292
+ preserves: ['critical_tasks', 'current_sprint', 'requirements'],
293
+ removes: ['old_logs', 'completed_tasks', 'detailed_examples', 'verbose_descriptions']
294
+ },
295
+
296
+ balanced: {
297
+ name: 'Balanced',
298
+ description: '균형 압축률 (30-50%)',
299
+ target_ratio: 40,
300
+ preserves: ['active_tasks', 'requirements', 'recent_logs', 'important_notes'],
301
+ removes: ['old_logs', 'completed_tasks', 'redundant_content']
302
+ },
303
+
304
+ minimal: {
305
+ name: 'Minimal',
306
+ description: '최소 압축률 (10-30%)',
307
+ target_ratio: 20,
308
+ preserves: ['all_tasks', 'all_requirements', 'all_documentation'],
309
+ removes: ['old_logs', 'formatting_redundancy']
310
+ }
311
+ };
312
+ ```
313
+
314
+ ### 3.2 압축 레벨 시스템
315
+
316
+ ```javascript
317
+ // 압축 레벨 관리 클래스
318
+ class CompressionLevelManager {
319
+ constructor() {
320
+ this.levels = {
321
+ 1: { name: 'Conservative', ratio: 15, risk: 'low' },
322
+ 2: { name: 'Standard', ratio: 30, risk: 'low' },
323
+ 3: { name: 'Moderate', ratio: 45, risk: 'medium' },
324
+ 4: { name: 'Aggressive', ratio: 60, risk: 'high' },
325
+ 5: { name: 'Maximum', ratio: 75, risk: 'very_high' }
326
+ };
327
+ }
328
+
329
+ // 프로젝트 크기에 따른 권장 레벨
330
+ getRecommendedLevel(projectSize) {
331
+ if (projectSize < 10000) return 1;
332
+ if (projectSize < 50000) return 2;
333
+ if (projectSize < 100000) return 3;
334
+ if (projectSize < 200000) return 4;
335
+ return 5;
336
+ }
337
+
338
+ // 레벨별 설정 반환
339
+ getLevelConfig(level) {
340
+ return this.levels[level] || this.levels[2];
341
+ }
342
+ }
343
+ ```
344
+
345
+ ## 4. 중요도 기반 정보 필터링 메커니즘
346
+
347
+ ### 4.1 중요도 분류 시스템
348
+
349
+ ```javascript
350
+ // 중요도 분류 클래스
351
+ class ImportanceClassifier {
352
+ constructor() {
353
+ this.priorities = {
354
+ critical: {
355
+ weight: 1.0,
356
+ keywords: ['urgent', 'critical', 'blocking', 'error', 'failed'],
357
+ sections: ['active_tasks', 'current_sprint', 'requirements']
358
+ },
359
+ high: {
360
+ weight: 0.8,
361
+ keywords: ['important', 'priority', 'deadline', 'milestone'],
362
+ sections: ['planned_tasks', 'specifications', 'architecture']
363
+ },
364
+ medium: {
365
+ weight: 0.6,
366
+ keywords: ['enhancement', 'improvement', 'optimize'],
367
+ sections: ['documentation', 'tests', 'examples']
368
+ },
369
+ low: {
370
+ weight: 0.4,
371
+ keywords: ['nice-to-have', 'future', 'consider'],
372
+ sections: ['logs', 'history', 'templates']
373
+ }
374
+ };
375
+ }
376
+
377
+ // 콘텐츠 중요도 분석
378
+ analyzeImportance(content) {
379
+ const sections = this.parseContentSections(content);
380
+
381
+ return sections.map(section => ({
382
+ name: section.name,
383
+ content: section.content,
384
+ importance: this.calculateImportance(section),
385
+ tokens: new TokenCounter().countTokens(section.content)
386
+ }));
387
+ }
388
+
389
+ // 중요도 계산
390
+ calculateImportance(section) {
391
+ let score = 0;
392
+
393
+ // 키워드 기반 점수
394
+ Object.entries(this.priorities).forEach(([level, config]) => {
395
+ const keywordMatches = config.keywords.filter(keyword =>
396
+ section.content.toLowerCase().includes(keyword)
397
+ ).length;
398
+ score += keywordMatches * config.weight;
399
+ });
400
+
401
+ // 섹션 타입 기반 점수
402
+ Object.entries(this.priorities).forEach(([level, config]) => {
403
+ if (config.sections.includes(section.type)) {
404
+ score += config.weight;
405
+ }
406
+ });
407
+
408
+ // 점수를 카테고리로 변환
409
+ if (score >= 1.5) return 'critical';
410
+ if (score >= 1.0) return 'high';
411
+ if (score >= 0.5) return 'medium';
412
+ return 'low';
413
+ }
414
+ }
415
+ ```
416
+
417
+ ### 4.2 정보 필터링 시스템
418
+
419
+ ```javascript
420
+ // 정보 필터링 클래스
421
+ class InformationFilter {
422
+ constructor(threshold = 'medium') {
423
+ this.threshold = threshold;
424
+ this.classifier = new ImportanceClassifier();
425
+ }
426
+
427
+ // 중요도 기반 필터링
428
+ filterByImportance(content, minImportance = this.threshold) {
429
+ const analyzedSections = this.classifier.analyzeImportance(content);
430
+ const importanceOrder = ['critical', 'high', 'medium', 'low'];
431
+ const minIndex = importanceOrder.indexOf(minImportance);
432
+
433
+ const filteredSections = analyzedSections.filter(section => {
434
+ const sectionIndex = importanceOrder.indexOf(section.importance);
435
+ return sectionIndex <= minIndex;
436
+ });
437
+
438
+ return {
439
+ content: this.reconstructContent(filteredSections),
440
+ metadata: {
441
+ originalSections: analyzedSections.length,
442
+ filteredSections: filteredSections.length,
443
+ removedSections: analyzedSections.length - filteredSections.length
444
+ }
445
+ };
446
+ }
447
+
448
+ // 콘텐츠 재구성
449
+ reconstructContent(sections) {
450
+ return sections.map(section => section.content).join('\n\n');
451
+ }
452
+ }
453
+ ```
454
+
455
+ ## 5. 압축/복원 파이프라인 아키텍처
456
+
457
+ ### 5.1 압축 파이프라인
458
+
459
+ ```javascript
460
+ // 압축 파이프라인 클래스
461
+ class CompressionPipeline {
462
+ constructor(options = {}) {
463
+ this.stages = [
464
+ new TokenAnalysisStage(),
465
+ new ImportanceAnalysisStage(),
466
+ new CompressionStage(options.mode || 'balanced'),
467
+ new ValidationStage(),
468
+ new MetadataGenerationStage()
469
+ ];
470
+ }
471
+
472
+ // 파이프라인 실행
473
+ async execute(input) {
474
+ let result = { content: input };
475
+
476
+ for (const stage of this.stages) {
477
+ result = await stage.process(result);
478
+
479
+ // 단계별 로깅
480
+ console.log(`Stage ${stage.name} completed:`, {
481
+ tokens: new TokenCounter().countTokens(result.content),
482
+ ratio: result.compressionRatio
483
+ });
484
+ }
485
+
486
+ return result;
487
+ }
488
+ }
489
+
490
+ // 파이프라인 단계 인터페이스
491
+ class PipelineStage {
492
+ constructor(name) {
493
+ this.name = name;
494
+ }
495
+
496
+ async process(input) {
497
+ throw new Error('process method must be implemented');
498
+ }
499
+ }
500
+
501
+ // 토큰 분석 단계
502
+ class TokenAnalysisStage extends PipelineStage {
503
+ constructor() {
504
+ super('TokenAnalysis');
505
+ this.counter = new TokenCounter();
506
+ }
507
+
508
+ async process(input) {
509
+ const originalTokens = this.counter.countTokens(input.content);
510
+
511
+ return {
512
+ ...input,
513
+ originalTokens,
514
+ tokenDistribution: this.counter.analyzeTokenDistribution(input.content)
515
+ };
516
+ }
517
+ }
518
+
519
+ // 중요도 분석 단계
520
+ class ImportanceAnalysisStage extends PipelineStage {
521
+ constructor() {
522
+ super('ImportanceAnalysis');
523
+ this.classifier = new ImportanceClassifier();
524
+ }
525
+
526
+ async process(input) {
527
+ const importanceAnalysis = this.classifier.analyzeImportance(input.content);
528
+
529
+ return {
530
+ ...input,
531
+ importanceAnalysis
532
+ };
533
+ }
534
+ }
535
+
536
+ // 압축 단계
537
+ class CompressionStage extends PipelineStage {
538
+ constructor(mode = 'balanced') {
539
+ super('Compression');
540
+ this.compressor = new ContextCompressor(mode);
541
+ }
542
+
543
+ async process(input) {
544
+ const compressed = this.compressor.compress(input.content);
545
+
546
+ return {
547
+ ...input,
548
+ content: compressed.compressed,
549
+ compressionRatio: compressed.compressionRatio,
550
+ compressionMetadata: compressed.metadata
551
+ };
552
+ }
553
+ }
554
+ ```
555
+
556
+ ### 5.2 복원 파이프라인
557
+
558
+ ```javascript
559
+ // 복원 파이프라인 클래스
560
+ class DecompressionPipeline {
561
+ constructor() {
562
+ this.stages = [
563
+ new MetadataValidationStage(),
564
+ new DecompressionStage(),
565
+ new IntegrityCheckStage()
566
+ ];
567
+ }
568
+
569
+ // 복원 실행
570
+ async execute(compressedContent, metadata) {
571
+ let result = { content: compressedContent, metadata };
572
+
573
+ for (const stage of this.stages) {
574
+ result = await stage.process(result);
575
+ }
576
+
577
+ return result;
578
+ }
579
+ }
580
+
581
+ // 복원 단계
582
+ class DecompressionStage extends PipelineStage {
583
+ constructor() {
584
+ super('Decompression');
585
+ }
586
+
587
+ async process(input) {
588
+ const strategy = this.getStrategy(input.metadata.strategy);
589
+ const decompressed = strategy.decompress(input.content, input.metadata);
590
+
591
+ return {
592
+ ...input,
593
+ content: decompressed
594
+ };
595
+ }
596
+ }
597
+ ```
598
+
599
+ ## 6. 성능 벤치마크 시스템
600
+
601
+ ### 6.1 벤치마크 테스트 스위트
602
+
603
+ ```javascript
604
+ // 성능 벤치마크 클래스
605
+ class PerformanceBenchmark {
606
+ constructor() {
607
+ this.metrics = {
608
+ compressionTime: [],
609
+ decompressionTime: [],
610
+ compressionRatio: [],
611
+ memoryUsage: [],
612
+ accuracy: []
613
+ };
614
+ }
615
+
616
+ // 압축 성능 테스트
617
+ async benchmarkCompression(testCases) {
618
+ const results = [];
619
+
620
+ for (const testCase of testCases) {
621
+ const startTime = performance.now();
622
+ const startMemory = process.memoryUsage();
623
+
624
+ const compressor = new ContextCompressor(testCase.mode);
625
+ const result = compressor.compress(testCase.content);
626
+
627
+ const endTime = performance.now();
628
+ const endMemory = process.memoryUsage();
629
+
630
+ results.push({
631
+ testCase: testCase.name,
632
+ compressionTime: endTime - startTime,
633
+ memoryUsage: endMemory.heapUsed - startMemory.heapUsed,
634
+ compressionRatio: result.compressionRatio,
635
+ originalSize: testCase.content.length,
636
+ compressedSize: result.compressed.length
637
+ });
638
+ }
639
+
640
+ return results;
641
+ }
642
+
643
+ // 정확도 테스트
644
+ async benchmarkAccuracy(testCases) {
645
+ const results = [];
646
+
647
+ for (const testCase of testCases) {
648
+ const compressor = new ContextCompressor(testCase.mode);
649
+ const compressed = compressor.compress(testCase.content);
650
+
651
+ // 정보 손실 측정
652
+ const informationLoss = this.measureInformationLoss(
653
+ testCase.content,
654
+ compressed.compressed
655
+ );
656
+
657
+ results.push({
658
+ testCase: testCase.name,
659
+ informationLoss,
660
+ compressionRatio: compressed.compressionRatio,
661
+ accuracy: 100 - informationLoss
662
+ });
663
+ }
664
+
665
+ return results;
666
+ }
667
+
668
+ // 정보 손실 측정
669
+ measureInformationLoss(original, compressed) {
670
+ const originalSections = this.extractImportantSections(original);
671
+ const compressedSections = this.extractImportantSections(compressed);
672
+
673
+ const lostSections = originalSections.filter(section =>
674
+ !compressedSections.includes(section)
675
+ );
676
+
677
+ return (lostSections.length / originalSections.length) * 100;
678
+ }
679
+
680
+ // 성능 보고서 생성
681
+ generatePerformanceReport(results) {
682
+ return {
683
+ summary: {
684
+ averageCompressionTime: this.average(results.map(r => r.compressionTime)),
685
+ averageCompressionRatio: this.average(results.map(r => r.compressionRatio)),
686
+ averageMemoryUsage: this.average(results.map(r => r.memoryUsage)),
687
+ averageAccuracy: this.average(results.map(r => r.accuracy))
688
+ },
689
+ detailed: results,
690
+ recommendations: this.generateRecommendations(results)
691
+ };
692
+ }
693
+ }
694
+ ```
695
+
696
+ ### 6.2 실시간 성능 모니터링
697
+
698
+ ```javascript
699
+ // 실시간 성능 모니터링 클래스
700
+ class PerformanceMonitor {
701
+ constructor() {
702
+ this.metrics = new Map();
703
+ this.alerts = [];
704
+ }
705
+
706
+ // 성능 메트릭 수집
707
+ collectMetrics(operation, startTime, endTime, metadata) {
708
+ const duration = endTime - startTime;
709
+ const key = `${operation}_${metadata.mode}`;
710
+
711
+ if (!this.metrics.has(key)) {
712
+ this.metrics.set(key, []);
713
+ }
714
+
715
+ this.metrics.get(key).push({
716
+ duration,
717
+ timestamp: Date.now(),
718
+ metadata
719
+ });
720
+
721
+ // 성능 임계값 확인
722
+ this.checkPerformanceThresholds(key, duration);
723
+ }
724
+
725
+ // 성능 임계값 확인
726
+ checkPerformanceThresholds(operation, duration) {
727
+ const thresholds = {
728
+ compression: 3000, // 3초
729
+ decompression: 1000, // 1초
730
+ analysis: 2000 // 2초
731
+ };
732
+
733
+ const threshold = thresholds[operation.split('_')[0]];
734
+
735
+ if (duration > threshold) {
736
+ this.alerts.push({
737
+ type: 'performance_warning',
738
+ operation,
739
+ duration,
740
+ threshold,
741
+ timestamp: Date.now()
742
+ });
743
+ }
744
+ }
745
+
746
+ // 성능 대시보드 데이터 생성
747
+ getDashboardData() {
748
+ const data = {};
749
+
750
+ this.metrics.forEach((values, key) => {
751
+ data[key] = {
752
+ count: values.length,
753
+ averageDuration: values.reduce((sum, v) => sum + v.duration, 0) / values.length,
754
+ lastDuration: values[values.length - 1]?.duration || 0,
755
+ trend: this.calculateTrend(values)
756
+ };
757
+ });
758
+
759
+ return {
760
+ metrics: data,
761
+ alerts: this.alerts.slice(-10), // 최근 10개 알림
762
+ uptime: process.uptime()
763
+ };
764
+ }
765
+ }
766
+ ```
767
+
768
+ ## 7. 구현 예시 및 사용법
769
+
770
+ ### 7.1 기본 사용법
771
+
772
+ ```bash
773
+ # Context 압축 명령어
774
+ aiwf compress --mode balanced --level 3
775
+
776
+ # 특정 디렉토리 압축
777
+ aiwf compress --path .aiwf/03_SPRINTS --mode aggressive
778
+
779
+ # 압축 분석
780
+ aiwf analyze-tokens --report
781
+
782
+ # 압축 성능 벤치마크
783
+ aiwf benchmark --mode all
784
+ ```
785
+
786
+ ### 7.2 프로그래밍 인터페이스
787
+
788
+ ```javascript
789
+ // 압축 시스템 사용 예시
790
+ const compressionSystem = new CompressionSystem({
791
+ mode: 'balanced',
792
+ level: 3,
793
+ preserveCritical: true
794
+ });
795
+
796
+ // 프로젝트 전체 압축
797
+ const result = await compressionSystem.compressProject('/path/to/project');
798
+
799
+ console.log('압축 결과:', {
800
+ originalTokens: result.originalTokens,
801
+ compressedTokens: result.compressedTokens,
802
+ compressionRatio: result.compressionRatio,
803
+ savedTokens: result.savedTokens
804
+ });
805
+
806
+ // 성능 모니터링
807
+ const monitor = new PerformanceMonitor();
808
+ compressionSystem.setMonitor(monitor);
809
+ ```
810
+
811
+ ## 8. 향후 개선 사항
812
+
813
+ ### 8.1 Machine Learning 기반 압축
814
+
815
+ - AI 모델을 활용한 지능형 압축 전략
816
+ - 사용자 패턴 학습을 통한 개인화된 압축
817
+ - 자동 압축 레벨 조정
818
+
819
+ ### 8.2 분산 압축 시스템
820
+
821
+ - 대용량 프로젝트를 위한 분산 처리
822
+ - 병렬 압축 알고리즘
823
+ - 클라우드 기반 압축 서비스
824
+
825
+ ### 8.3 실시간 압축
826
+
827
+ - 실시간 context 압축
828
+ - 스트리밍 압축 지원
829
+ - 증분 압축 알고리즘
830
+
831
+ ---
832
+
833
+ *이 문서는 AIWF Token Optimization System의 설계 문서입니다. 구현 과정에서 세부사항이 조정될 수 있습니다.*