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,164 @@
1
+ const { describe, it, expect, beforeEach, afterEach } = require('@jest/globals');
2
+ const {
3
+ extractFeatureIds,
4
+ extractCommitType,
5
+ isFeatureRelatedCommit,
6
+ extractFeatureIdFromBranch
7
+ } = require('../config/commit-patterns');
8
+ const {
9
+ getCommitInfo,
10
+ getCurrentBranch,
11
+ isGitRepository
12
+ } = require('../utils/git-utils');
13
+ const {
14
+ findFeatureFile,
15
+ readFeatureFile,
16
+ updateFeatureProgress
17
+ } = require('../utils/feature-updater');
18
+
19
+ describe('Git-Feature Integration Tests', () => {
20
+
21
+ describe('커밋 메시지 파싱', () => {
22
+ it('다양한 형식의 Feature ID를 추출해야 함', () => {
23
+ const testCases = [
24
+ { message: 'FL001 기능 구현', expected: ['FL001'] },
25
+ { message: '[FL002] 버그 수정', expected: ['FL002'] },
26
+ { message: 'feat(FL003): 새 기능', expected: ['FL003'] },
27
+ { message: '업데이트 #FL004', expected: ['FL004'] },
28
+ { message: 'FL001, FL002 관련 수정', expected: ['FL001', 'FL002'] },
29
+ { message: '일반 커밋 메시지', expected: [] }
30
+ ];
31
+
32
+ testCases.forEach(({ message, expected }) => {
33
+ const result = extractFeatureIds(message);
34
+ expect(result).toEqual(expected);
35
+ });
36
+ });
37
+
38
+ it('커밋 타입을 추출해야 함', () => {
39
+ expect(extractCommitType('feat: 새 기능')).toBe('feat');
40
+ expect(extractCommitType('fix(FL001): 버그 수정')).toBe('fix');
41
+ expect(extractCommitType('일반 커밋')).toBeNull();
42
+ });
43
+
44
+ it('Feature 관련 커밋을 식별해야 함', () => {
45
+ expect(isFeatureRelatedCommit('FL001 구현')).toBe(true);
46
+ expect(isFeatureRelatedCommit('일반 커밋')).toBe(false);
47
+ });
48
+
49
+ it('브랜치 이름에서 Feature ID를 추출해야 함', () => {
50
+ expect(extractFeatureIdFromBranch('feature/FL001-auth')).toBe('FL001');
51
+ expect(extractFeatureIdFromBranch('main')).toBeNull();
52
+ });
53
+ });
54
+
55
+ describe('Git 유틸리티', () => {
56
+ it('Git 저장소 확인이 작동해야 함', async () => {
57
+ const isRepo = await isGitRepository();
58
+ expect(typeof isRepo).toBe('boolean');
59
+ });
60
+
61
+ it('현재 브랜치를 가져올 수 있어야 함', async () => {
62
+ try {
63
+ const branch = await getCurrentBranch();
64
+ expect(typeof branch).toBe('string');
65
+ expect(branch.length).toBeGreaterThan(0);
66
+ } catch (error) {
67
+ // Git 저장소가 아닌 경우 스킵
68
+ expect(error.message).toContain('Git');
69
+ }
70
+ });
71
+ });
72
+
73
+ describe('Feature 업데이터', () => {
74
+ it('Feature 파일 경로를 올바르게 구성해야 함', async () => {
75
+ // findFeatureFile 함수 테스트
76
+ const result = await findFeatureFile('FL999'); // 존재하지 않는 Feature
77
+ expect(result).toBeNull();
78
+ });
79
+
80
+ it('진행률 업데이트 검증', async () => {
81
+ // 진행률 값 범위 확인 (0-100)
82
+ const testValues = [-10, 0, 50, 100, 150];
83
+ const expectedValues = [0, 0, 50, 100, 100];
84
+
85
+ // 실제 파일 없이 로직만 테스트
86
+ testValues.forEach((value, index) => {
87
+ const clamped = Math.min(100, Math.max(0, value));
88
+ expect(clamped).toBe(expectedValues[index]);
89
+ });
90
+ });
91
+ });
92
+
93
+ describe('통합 시나리오', () => {
94
+ it('커밋 메시지 → Feature ID → 파일 업데이트 플로우', async () => {
95
+ // 시나리오: 커밋 메시지에서 Feature ID 추출하여 파일 업데이트
96
+ const commitMessage = 'feat(FL001): 사용자 인증 구현';
97
+
98
+ // 1. Feature ID 추출
99
+ const featureIds = extractFeatureIds(commitMessage);
100
+ expect(featureIds).toContain('FL001');
101
+
102
+ // 2. 커밋 타입 추출
103
+ const commitType = extractCommitType(commitMessage);
104
+ expect(commitType).toBe('feat');
105
+
106
+ // 3. Feature 관련 커밋 확인
107
+ const isRelated = isFeatureRelatedCommit(commitMessage);
108
+ expect(isRelated).toBe(true);
109
+ });
110
+
111
+ it('여러 Feature ID 처리', async () => {
112
+ const commitMessage = 'refactor: FL001, FL002, FL003 공통 로직 추출';
113
+
114
+ const featureIds = extractFeatureIds(commitMessage);
115
+ expect(featureIds).toHaveLength(3);
116
+ expect(featureIds).toEqual(['FL001', 'FL002', 'FL003']);
117
+ });
118
+ });
119
+
120
+ describe('엣지 케이스', () => {
121
+ it('잘못된 Feature ID 형식 처리', () => {
122
+ const invalidCases = [
123
+ 'F001', // FL 접두사 없음
124
+ 'FL1', // 숫자 부족
125
+ 'FL0001', // 숫자 초과
126
+ 'fl001', // 소문자
127
+ 'FL00a' // 문자 포함
128
+ ];
129
+
130
+ invalidCases.forEach(message => {
131
+ const ids = extractFeatureIds(message);
132
+ expect(ids).toHaveLength(0);
133
+ });
134
+ });
135
+
136
+ it('특수 문자가 포함된 커밋 메시지', () => {
137
+ const specialCases = [
138
+ { message: 'feat(FL001): 한글 지원 추가 🎉', expected: ['FL001'] },
139
+ { message: 'fix: FL002 & FL003 동시 수정', expected: ['FL002', 'FL003'] },
140
+ { message: 'docs: [FL004] README 업데이트', expected: ['FL004'] }
141
+ ];
142
+
143
+ specialCases.forEach(({ message, expected }) => {
144
+ const result = extractFeatureIds(message);
145
+ expect(result).toEqual(expected);
146
+ });
147
+ });
148
+ });
149
+ });
150
+
151
+ // 실행 예시를 위한 테스트 헬퍼
152
+ if (require.main === module) {
153
+ console.log('Git-Feature Integration 테스트 실행 중...');
154
+
155
+ // 간단한 검증
156
+ const testMessage = 'feat(FL001): 테스트 커밋';
157
+ const ids = extractFeatureIds(testMessage);
158
+ console.log(`Feature IDs: ${ids.join(', ')}`);
159
+
160
+ const type = extractCommitType(testMessage);
161
+ console.log(`Commit Type: ${type}`);
162
+
163
+ console.log('테스트 완료!');
164
+ }
@@ -0,0 +1,537 @@
1
+ /**
2
+ * 토큰 추적 시스템 테스트 스위트
3
+ */
4
+ import { TokenCounter } from '../utils/token-counter.js';
5
+ import { TokenTracker } from '../utils/token-tracker.js';
6
+ import { TokenStorage } from '../utils/token-storage.js';
7
+ import { TokenReporter } from '../utils/token-reporter.js';
8
+ import { TokenMonitor } from '../utils/token-monitor.js';
9
+ import { TokenTrackingCommands } from '../commands/token-tracking.js';
10
+ import fs from 'fs';
11
+ import path from 'path';
12
+
13
+ describe('Token Tracking System', () => {
14
+ let testDir;
15
+ let counter;
16
+ let tracker;
17
+ let storage;
18
+ let reporter;
19
+ let monitor;
20
+ let commands;
21
+
22
+ beforeEach(() => {
23
+ // 테스트용 임시 디렉토리 생성
24
+ testDir = path.join(process.cwd(), 'test-temp', Date.now().toString());
25
+ if (!fs.existsSync(testDir)) {
26
+ fs.mkdirSync(testDir, { recursive: true });
27
+ }
28
+
29
+ // 테스트 인스턴스 생성
30
+ counter = new TokenCounter();
31
+ tracker = new TokenTracker(path.join(testDir, 'sessions'));
32
+ storage = new TokenStorage(path.join(testDir, 'token-data'));
33
+ reporter = new TokenReporter();
34
+ monitor = new TokenMonitor();
35
+ commands = new TokenTrackingCommands();
36
+ });
37
+
38
+ afterEach(() => {
39
+ // 테스트 후 정리
40
+ try {
41
+ if (counter) counter.cleanup();
42
+ if (tracker) tracker.cleanup();
43
+ if (monitor) monitor.stopMonitoring();
44
+ if (commands) commands.cleanup();
45
+
46
+ // 임시 디렉토리 삭제
47
+ if (fs.existsSync(testDir)) {
48
+ fs.rmSync(testDir, { recursive: true, force: true });
49
+ }
50
+ } catch (error) {
51
+ console.error('테스트 정리 중 오류:', error);
52
+ }
53
+ });
54
+
55
+ describe('TokenCounter', () => {
56
+ test('should count tokens correctly', () => {
57
+ const testText = 'Hello, world! This is a test.';
58
+ const tokens = counter.countTokens(testText);
59
+
60
+ expect(tokens).toBeGreaterThan(0);
61
+ expect(typeof tokens).toBe('number');
62
+ });
63
+
64
+ test('should handle empty text', () => {
65
+ expect(counter.countTokens('')).toBe(0);
66
+ expect(counter.countTokens(null)).toBe(0);
67
+ expect(counter.countTokens(undefined)).toBe(0);
68
+ });
69
+
70
+ test('should count file tokens', () => {
71
+ const testFile = path.join(testDir, 'test.md');
72
+ const testContent = '# Test\n\nThis is a test file.';
73
+
74
+ fs.writeFileSync(testFile, testContent);
75
+
76
+ const tokens = counter.countFileTokens(testFile);
77
+ expect(tokens).toBeGreaterThan(0);
78
+ });
79
+
80
+ test('should handle non-existent file', () => {
81
+ const tokens = counter.countFileTokens('non-existent.md');
82
+ expect(tokens).toBe(0);
83
+ });
84
+
85
+ test('should analyze token distribution', () => {
86
+ const testContent = `# Section 1
87
+ This is the first section.
88
+
89
+ ## Section 2
90
+ This is the second section.
91
+
92
+ ### Section 3
93
+ This is the third section.`;
94
+
95
+ const distribution = counter.analyzeTokenDistribution(testContent);
96
+
97
+ expect(Array.isArray(distribution)).toBe(true);
98
+ expect(distribution.length).toBeGreaterThan(0);
99
+
100
+ distribution.forEach(section => {
101
+ expect(section).toHaveProperty('name');
102
+ expect(section).toHaveProperty('tokens');
103
+ expect(section).toHaveProperty('percentage');
104
+ });
105
+ });
106
+ });
107
+
108
+ describe('TokenTracker', () => {
109
+ test('should track command execution', () => {
110
+ const result = tracker.trackCommand('test-command', 'input text', 'output text');
111
+
112
+ expect(result).toBeTruthy();
113
+ expect(result.command).toBe('test-command');
114
+ expect(result.inputTokens).toBeGreaterThan(0);
115
+ expect(result.outputTokens).toBeGreaterThan(0);
116
+ expect(result.totalTokens).toBeGreaterThan(0);
117
+ });
118
+
119
+ test('should track compression', () => {
120
+ const originalTokens = 1000;
121
+ const compressedTokens = 600;
122
+
123
+ tracker.trackCompression(originalTokens, compressedTokens);
124
+
125
+ expect(tracker.usage.total).toBe(originalTokens);
126
+ expect(tracker.usage.compressed).toBe(compressedTokens);
127
+ expect(tracker.usage.saved).toBe(400);
128
+ expect(tracker.usage.ratio).toBe(40);
129
+ });
130
+
131
+ test('should generate session report', () => {
132
+ // 몇 개의 명령어 실행을 시뮬레이션
133
+ tracker.trackCommand('cmd1', 'input1', 'output1');
134
+ tracker.trackCommand('cmd2', 'input2', 'output2');
135
+ tracker.trackCommand('cmd3', 'input3', 'output3');
136
+
137
+ const report = tracker.generateReport();
138
+
139
+ expect(report).toBeTruthy();
140
+ expect(report.sessionId).toBeDefined();
141
+ expect(report.totalCommands).toBe(3);
142
+ expect(report.totalTokens).toBeGreaterThan(0);
143
+ });
144
+
145
+ test('should get session stats', () => {
146
+ const stats = tracker.getSessionStats();
147
+
148
+ expect(stats).toBeTruthy();
149
+ expect(stats.sessionId).toBeDefined();
150
+ expect(stats.totalTokens).toBeGreaterThanOrEqual(0);
151
+ expect(stats.commandCount).toBeGreaterThanOrEqual(0);
152
+ });
153
+ });
154
+
155
+ describe('TokenStorage', () => {
156
+ test('should record session usage', () => {
157
+ const sessionData = {
158
+ sessionId: 'test-session',
159
+ totalTokens: 1000,
160
+ commands: [
161
+ { command: 'test-cmd', totalTokens: 500 },
162
+ { command: 'test-cmd2', totalTokens: 500 }
163
+ ],
164
+ compressions: [
165
+ { originalTokens: 1000, compressedTokens: 600, savedTokens: 400 }
166
+ ]
167
+ };
168
+
169
+ storage.recordSessionUsage(sessionData);
170
+
171
+ expect(storage.data.totalTokens).toBe(1000);
172
+ expect(storage.data.sessionsCount).toBe(1);
173
+ });
174
+
175
+ test('should generate usage report', () => {
176
+ // 테스트 데이터 설정
177
+ const today = new Date().toISOString().split('T')[0];
178
+ storage.data.dailyUsage[today] = {
179
+ tokens: 1000,
180
+ sessions: 5,
181
+ commands: 20
182
+ };
183
+
184
+ const report = storage.generateUsageReport('daily');
185
+
186
+ expect(report).toBeTruthy();
187
+ expect(report.type).toBe('daily');
188
+ expect(report.summary).toBeDefined();
189
+ expect(report.dailyUsage).toBeDefined();
190
+ });
191
+
192
+ test('should check thresholds', () => {
193
+ const thresholds = {
194
+ dailyTokenLimit: 500,
195
+ warningThreshold: 80
196
+ };
197
+
198
+ // 임계값을 초과하는 데이터 설정
199
+ const today = new Date().toISOString().split('T')[0];
200
+ storage.data.dailyUsage[today] = {
201
+ tokens: 1000,
202
+ sessions: 5
203
+ };
204
+
205
+ const violations = storage.checkThresholds(thresholds);
206
+
207
+ expect(Array.isArray(violations)).toBe(true);
208
+ expect(violations.length).toBeGreaterThan(0);
209
+ });
210
+ });
211
+
212
+ describe('TokenReporter', () => {
213
+ test('should generate project analysis report', () => {
214
+ // 임시 프로젝트 구조 생성
215
+ const projectDir = path.join(testDir, 'project');
216
+ const aiwfDir = path.join(projectDir, '.aiwf', '03_SPRINTS');
217
+
218
+ fs.mkdirSync(aiwfDir, { recursive: true });
219
+ fs.writeFileSync(path.join(aiwfDir, 'test.md'), '# Test\n\nThis is a test file.');
220
+
221
+ const report = reporter.generateProjectAnalysisReport(projectDir);
222
+
223
+ expect(report).toBeTruthy();
224
+ expect(report.analysis).toBeDefined();
225
+ expect(report.analysis.totalTokens).toBeGreaterThan(0);
226
+ });
227
+
228
+ test('should identify compression opportunities', () => {
229
+ const directoryBreakdown = {
230
+ '.aiwf/03_SPRINTS': { tokens: 10000, files: [] },
231
+ '.aiwf/05_COMPLETED_TASKS': { tokens: 5000, files: [] }
232
+ };
233
+
234
+ const opportunities = reporter.identifyCompressionOpportunities(directoryBreakdown);
235
+
236
+ expect(Array.isArray(opportunities)).toBe(true);
237
+ expect(opportunities.length).toBeGreaterThan(0);
238
+ });
239
+ });
240
+
241
+ describe('TokenMonitor', () => {
242
+ test('should enable/disable monitoring', () => {
243
+ monitor.setEnabled(true);
244
+ expect(monitor.isEnabled).toBe(true);
245
+
246
+ monitor.setEnabled(false);
247
+ expect(monitor.isEnabled).toBe(false);
248
+ });
249
+
250
+ test('should set thresholds', () => {
251
+ const newThresholds = {
252
+ dailyTokenLimit: 5000,
253
+ warningThreshold: 75
254
+ };
255
+
256
+ monitor.setThresholds(newThresholds);
257
+
258
+ expect(monitor.thresholds.dailyTokenLimit).toBe(5000);
259
+ expect(monitor.thresholds.warningThreshold).toBe(75);
260
+ });
261
+
262
+ test('should create alerts', () => {
263
+ const violation = {
264
+ type: 'test_violation',
265
+ message: 'Test violation message',
266
+ threshold: 100,
267
+ current: 150
268
+ };
269
+
270
+ monitor.createAlert(violation);
271
+
272
+ expect(monitor.alerts.length).toBeGreaterThan(0);
273
+ expect(monitor.alerts[0].type).toBe('test_violation');
274
+ });
275
+
276
+ test('should acknowledge alerts', () => {
277
+ const violation = {
278
+ type: 'test_violation',
279
+ message: 'Test violation message',
280
+ threshold: 100,
281
+ current: 150
282
+ };
283
+
284
+ monitor.createAlert(violation);
285
+ const alertId = monitor.alerts[0].id;
286
+
287
+ monitor.acknowledgeAlert(alertId);
288
+
289
+ expect(monitor.alerts[0].acknowledged).toBe(true);
290
+ });
291
+ });
292
+
293
+ describe('TokenTrackingCommands', () => {
294
+ test('should count tokens through command interface', async () => {
295
+ const result = await commands.countTokens({ text: 'Hello, world!' });
296
+
297
+ expect(result).toBeTruthy();
298
+ expect(result.type).toBe('text');
299
+ expect(result.tokens).toBeGreaterThan(0);
300
+ });
301
+
302
+ test('should track command execution', async () => {
303
+ const result = await commands.trackCommand({
304
+ command: 'test-command',
305
+ input: 'input text',
306
+ output: 'output text'
307
+ });
308
+
309
+ expect(result).toBeTruthy();
310
+ expect(result.command).toBe('test-command');
311
+ expect(result.totalTokens).toBeGreaterThan(0);
312
+ });
313
+
314
+ test('should generate session report', async () => {
315
+ // 명령어 실행 시뮬레이션
316
+ await commands.trackCommand({
317
+ command: 'test-command',
318
+ input: 'input',
319
+ output: 'output'
320
+ });
321
+
322
+ const report = await commands.generateSessionReport();
323
+
324
+ expect(report).toBeTruthy();
325
+ expect(report.sessionId).toBeDefined();
326
+ expect(report.totalCommands).toBeGreaterThan(0);
327
+ });
328
+
329
+ test('should track compression', async () => {
330
+ const result = await commands.trackCompression({
331
+ originalTokens: 1000,
332
+ compressedTokens: 600
333
+ });
334
+
335
+ expect(result).toBeTruthy();
336
+ expect(result.savedTokens).toBe(400);
337
+ expect(result.compressionRatio).toBe('40.00');
338
+ });
339
+
340
+ test('should setup monitoring', async () => {
341
+ const result = await commands.setupMonitoring({
342
+ enable: true,
343
+ thresholds: { dailyTokenLimit: 5000 }
344
+ });
345
+
346
+ expect(result.success).toBe(true);
347
+ expect(result.status).toBeDefined();
348
+ });
349
+
350
+ test('should manage alerts', async () => {
351
+ const result = await commands.manageAlerts({ action: 'list' });
352
+
353
+ expect(Array.isArray(result)).toBe(true);
354
+ });
355
+ });
356
+
357
+ describe('Performance Tests', () => {
358
+ test('should count tokens efficiently for large text', () => {
359
+ const largeText = 'This is a test. '.repeat(1000);
360
+
361
+ const startTime = performance.now();
362
+ const tokens = counter.countTokens(largeText);
363
+ const endTime = performance.now();
364
+
365
+ expect(tokens).toBeGreaterThan(0);
366
+ expect(endTime - startTime).toBeLessThan(1000); // Should complete within 1 second
367
+ });
368
+
369
+ test('should handle multiple concurrent tracking operations', async () => {
370
+ const operations = [];
371
+
372
+ for (let i = 0; i < 100; i++) {
373
+ operations.push(
374
+ commands.trackCommand({
375
+ command: `test-command-${i}`,
376
+ input: `input ${i}`,
377
+ output: `output ${i}`
378
+ })
379
+ );
380
+ }
381
+
382
+ const results = await Promise.all(operations);
383
+
384
+ expect(results.length).toBe(100);
385
+ results.forEach(result => {
386
+ expect(result).toBeTruthy();
387
+ expect(result.totalTokens).toBeGreaterThan(0);
388
+ });
389
+ });
390
+
391
+ test('should compress large directory efficiently', () => {
392
+ // 대용량 디렉토리 시뮬레이션
393
+ const testFiles = [];
394
+ for (let i = 0; i < 10; i++) {
395
+ const fileName = path.join(testDir, `test-${i}.md`);
396
+ const content = `# Test ${i}\n\n${'This is test content. '.repeat(100)}`;
397
+ fs.writeFileSync(fileName, content);
398
+ testFiles.push(fileName);
399
+ }
400
+
401
+ const startTime = performance.now();
402
+ const tokens = counter.countDirectoryTokens(testDir);
403
+ const endTime = performance.now();
404
+
405
+ expect(tokens).toBeGreaterThan(0);
406
+ expect(endTime - startTime).toBeLessThan(5000); // Should complete within 5 seconds
407
+
408
+ // 파일 정리
409
+ testFiles.forEach(file => {
410
+ if (fs.existsSync(file)) {
411
+ fs.unlinkSync(file);
412
+ }
413
+ });
414
+ });
415
+ });
416
+
417
+ describe('Error Handling', () => {
418
+ test('should handle file system errors gracefully', () => {
419
+ const invalidPath = '/invalid/path/file.md';
420
+ const tokens = counter.countFileTokens(invalidPath);
421
+
422
+ expect(tokens).toBe(0);
423
+ });
424
+
425
+ test('should handle invalid token counting input', () => {
426
+ expect(counter.countTokens(null)).toBe(0);
427
+ expect(counter.countTokens(undefined)).toBe(0);
428
+ expect(counter.countTokens(123)).toBe(0);
429
+ expect(counter.countTokens({})).toBe(0);
430
+ });
431
+
432
+ test('should handle storage errors gracefully', () => {
433
+ const invalidSessionData = null;
434
+
435
+ expect(() => {
436
+ storage.recordSessionUsage(invalidSessionData);
437
+ }).not.toThrow();
438
+ });
439
+
440
+ test('should handle monitoring errors gracefully', () => {
441
+ const invalidThresholds = null;
442
+
443
+ expect(() => {
444
+ monitor.setThresholds(invalidThresholds);
445
+ }).not.toThrow();
446
+ });
447
+ });
448
+
449
+ describe('Integration Tests', () => {
450
+ test('should work end-to-end', async () => {
451
+ // 1. 토큰 카운팅
452
+ const countResult = await commands.countTokens({ text: 'Hello, world!' });
453
+ expect(countResult).toBeTruthy();
454
+
455
+ // 2. 명령어 추적
456
+ const trackResult = await commands.trackCommand({
457
+ command: 'test-command',
458
+ input: 'input',
459
+ output: 'output'
460
+ });
461
+ expect(trackResult).toBeTruthy();
462
+
463
+ // 3. 압축 추적
464
+ const compressionResult = await commands.trackCompression({
465
+ originalTokens: 1000,
466
+ compressedTokens: 600
467
+ });
468
+ expect(compressionResult).toBeTruthy();
469
+
470
+ // 4. 세션 보고서 생성
471
+ const sessionReport = await commands.generateSessionReport();
472
+ expect(sessionReport).toBeTruthy();
473
+
474
+ // 5. 모니터링 설정
475
+ const monitoringResult = await commands.setupMonitoring({
476
+ enable: true,
477
+ thresholds: { dailyTokenLimit: 5000 }
478
+ });
479
+ expect(monitoringResult.success).toBe(true);
480
+
481
+ // 6. 시스템 상태 확인
482
+ const systemStatus = await commands.getSystemStatus();
483
+ expect(systemStatus).toBeTruthy();
484
+ });
485
+ });
486
+ });
487
+
488
+ // 성능 벤치마크 함수
489
+ export function runPerformanceBenchmark() {
490
+ console.log('=== Token Tracking System Performance Benchmark ===');
491
+
492
+ const counter = new TokenCounter();
493
+ const results = {
494
+ tokenCounting: [],
495
+ fileProcessing: [],
496
+ directoryAnalysis: []
497
+ };
498
+
499
+ // 토큰 카운팅 성능 테스트
500
+ const testTexts = [
501
+ 'Short text',
502
+ 'Medium length text. '.repeat(100),
503
+ 'Very long text. '.repeat(1000)
504
+ ];
505
+
506
+ testTexts.forEach((text, index) => {
507
+ const startTime = performance.now();
508
+ const tokens = counter.countTokens(text);
509
+ const endTime = performance.now();
510
+
511
+ results.tokenCounting.push({
512
+ textLength: text.length,
513
+ tokens,
514
+ processingTime: endTime - startTime,
515
+ tokensPerSecond: tokens / ((endTime - startTime) / 1000)
516
+ });
517
+ });
518
+
519
+ // 결과 출력
520
+ console.log('\n--- Token Counting Performance ---');
521
+ results.tokenCounting.forEach((result, index) => {
522
+ console.log(`Test ${index + 1}:`);
523
+ console.log(` Text Length: ${result.textLength.toLocaleString()} characters`);
524
+ console.log(` Tokens: ${result.tokens.toLocaleString()}`);
525
+ console.log(` Processing Time: ${result.processingTime.toFixed(2)}ms`);
526
+ console.log(` Tokens/Second: ${result.tokensPerSecond.toFixed(0)}`);
527
+ });
528
+
529
+ // 정리
530
+ counter.cleanup();
531
+
532
+ console.log('\n=== Benchmark Complete ===');
533
+
534
+ return results;
535
+ }
536
+
537
+ export default runPerformanceBenchmark;