aiwf 0.3.0 → 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.
- package/.aiwf/.claude/commands/aiwf/aiwf_compress_aggressive_persona.md +53 -0
- package/.aiwf/.claude/commands/aiwf/aiwf_compress_minimal_persona.md +48 -0
- package/.aiwf/.claude/commands/aiwf/aiwf_compress_stats.md +79 -0
- package/.aiwf/.claude/commands/aiwf/aiwf_compress_with_persona.md +51 -0
- package/.aiwf/.claude/commands/aiwf/aiwf_evaluate.md +92 -0
- package/.aiwf/00_PROJECT_MANIFEST.md +183 -0
- package/.aiwf/01_PROJECT_DOCS/ARCHITECTURE.md +121 -0
- package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_ADVANCED_USE_CASES.md +412 -0
- package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_API_REFERENCE.md +361 -0
- package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_COMMANDS_GUIDE.md +254 -0
- package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_FAQ.md +365 -0
- package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_SYSTEM_OVERVIEW.md +305 -0
- package/.aiwf/01_PROJECT_DOCS/FEATURE_LEDGER_USER_GUIDE.md +416 -0
- 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
- package/.aiwf/02_REQUIREMENTS/CLAUDE.md +78 -0
- package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/M02_milestone_meta.md +34 -0
- package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/PRD_Context_Engineering_Enhancement.md +108 -0
- package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/SPECS_AI_Persona_System.md +299 -0
- package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/SPECS_Feature_Ledger_System.md +330 -0
- package/.aiwf/02_REQUIREMENTS/M02_Context_Engineering_Enhancement/SPECS_Token_Optimization.md +833 -0
- package/.aiwf/03_SPRINTS/CLAUDE.md +83 -0
- package/.aiwf/03_SPRINTS/S01_M02_context_foundation/S01_M02_sprint_meta.md +95 -0
- 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
- 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
- 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
- package/.aiwf/03_SPRINTS/S01_M02_context_foundation/TX04_S01_Feature_Ledger_/353/254/270/354/204/234/355/231/224.md +114 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/.aiwf/03_SPRINTS/S02_M02_ai_enhancement/S02_M02_sprint_meta.md +107 -0
- 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
- 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
- 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
- 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
- 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
- package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/S03_FINAL_SPRINT_SUMMARY.md +137 -0
- package/.aiwf/03_SPRINTS/S03_M02_ecosystem_integration/S03_M02_sprint_meta.md +106 -0
- 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
- 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
- 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
- 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
- package/.aiwf/04_GENERAL_TASKS/CLAUDE.md +96 -0
- package/.aiwf/04_GENERAL_TASKS/TX001_complete_english_translation.md +127 -0
- package/.aiwf/05_DOCUMENTATION/performance-report.md +33 -0
- package/.aiwf/06_FEATURE_LEDGERS/FEATURE_GIT_INTEGRATION.md +314 -0
- package/.aiwf/06_FEATURE_LEDGERS/FEATURE_INTEGRATION_GUIDE.md +227 -0
- package/.aiwf/06_FEATURE_LEDGERS/FEATURE_LEDGER_INDEX.md +23 -0
- package/.aiwf/06_FEATURE_LEDGERS/FEATURE_SCHEMA.md +205 -0
- package/.aiwf/06_FEATURE_LEDGERS/FEATURE_STATE_DIAGRAM.md +190 -0
- package/.aiwf/06_FEATURE_LEDGERS/active/FL001_user_authentication_system.md +47 -0
- package/.aiwf/06_FEATURE_LEDGERS/active/FL002_user_authentication_system.md +47 -0
- package/.aiwf/07_AI_PERSONAS/PERSONA_INDEX.md +57 -0
- package/.aiwf/07_AI_PERSONAS/architect/best_practices.md +104 -0
- package/.aiwf/07_AI_PERSONAS/architect/context_rules.md +46 -0
- package/.aiwf/07_AI_PERSONAS/architect/knowledge_base.md +235 -0
- package/.aiwf/07_AI_PERSONAS/backend/best_practices.md +363 -0
- package/.aiwf/07_AI_PERSONAS/backend/context_rules.md +61 -0
- package/.aiwf/07_AI_PERSONAS/backend/knowledge_base.md +623 -0
- package/.aiwf/07_AI_PERSONAS/data_analyst/best_practices.md +32 -0
- package/.aiwf/07_AI_PERSONAS/data_analyst/context_rules.md +43 -0
- package/.aiwf/07_AI_PERSONAS/data_analyst/knowledge_base.md +36 -0
- package/.aiwf/07_AI_PERSONAS/frontend/best_practices.md +31 -0
- package/.aiwf/07_AI_PERSONAS/frontend/context_rules.md +43 -0
- package/.aiwf/07_AI_PERSONAS/frontend/knowledge_base.md +32 -0
- package/.aiwf/07_AI_PERSONAS/security/best_practices.md +63 -0
- package/.aiwf/07_AI_PERSONAS/security/context_rules.md +53 -0
- package/.aiwf/07_AI_PERSONAS/security/knowledge_base.md +93 -0
- package/.aiwf/10_PERSONAS/active.json +1 -0
- package/.aiwf/10_PERSONAS/developer.md +37 -0
- package/.aiwf/10_STATE_OF_PROJECT/2025-07-09-07-20-solid-progress.md +144 -0
- package/.aiwf/98_PROMPTS/SAAS_DEVELOPMENT_GUIDE.md +302 -0
- package/.aiwf/98_PROMPTS/github_integration.md +130 -0
- package/.aiwf/98_PROMPTS/useful-prompts.md +31 -0
- package/.aiwf/98_PROMPTS/vibe-front-prompts.md +89 -0
- package/.aiwf/99_TEMPLATES/adr_template.md +49 -0
- package/.aiwf/99_TEMPLATES/feature_template.md +263 -0
- package/.aiwf/99_TEMPLATES/milestone_meta_template.md +25 -0
- package/.aiwf/99_TEMPLATES/project_manifest_template.md +39 -0
- package/.aiwf/99_TEMPLATES/sprint_meta_template.md +23 -0
- package/.aiwf/99_TEMPLATES/task_template.md +36 -0
- package/.aiwf/CLAUDE.md +76 -0
- package/.aiwf/ai-tools/README.md +105 -0
- package/.aiwf/ai-tools/augment/README.md +371 -0
- package/.aiwf/ai-tools/augment/config.json +30 -0
- package/.aiwf/ai-tools/augment/template/.augment/aiwf-integration.md +387 -0
- package/.aiwf/ai-tools/augment/template/.augment/augment.yaml +347 -0
- package/.aiwf/ai-tools/augment/template/augment.config.json +64 -0
- package/.aiwf/ai-tools/claude-code/README.md +151 -0
- package/.aiwf/ai-tools/claude-code/config.json +28 -0
- package/.aiwf/ai-tools/claude-code/template/CLAUDE.md +91 -0
- package/.aiwf/ai-tools/cursor/README.md +314 -0
- package/.aiwf/ai-tools/cursor/config.json +29 -0
- package/.aiwf/ai-tools/cursor/template/.cursorrules +362 -0
- package/.aiwf/ai-tools/github-copilot/README.md +195 -0
- package/.aiwf/ai-tools/github-copilot/config.json +24 -0
- package/.aiwf/ai-tools/github-copilot/template/.github/copilot-instructions.md +202 -0
- package/.aiwf/ai-tools/windsurf/README.md +355 -0
- package/.aiwf/ai-tools/windsurf/config.json +29 -0
- package/.aiwf/ai-tools/windsurf/template/.windsurf/aiwf-rules.md +260 -0
- package/.aiwf/ai-tools/windsurf/template/.windsurf/windsurf.config.js +312 -0
- package/.aiwf/ai-tools/windsurf/template/windsurf.config.json +63 -0
- package/.aiwf/config/language.json +6 -0
- package/.aiwf/feature-ledger/FL-001-authentication.json +52 -0
- package/.aiwf/feature-ledger/feature-index.json +20 -0
- package/.aiwf/personas/analyst.json +44 -0
- package/.aiwf/personas/architect/best_practices.md +136 -0
- package/.aiwf/personas/architect/knowledge_base.md +377 -0
- package/.aiwf/personas/architect.json +44 -0
- package/.aiwf/personas/backend/best_practices.md +766 -0
- package/.aiwf/personas/backend/knowledge_base.md +1070 -0
- package/.aiwf/personas/data_analyst/best_practices.md +594 -0
- package/.aiwf/personas/data_analyst/knowledge_base.md +1057 -0
- package/.aiwf/personas/developer.json +44 -0
- package/.aiwf/personas/evaluation_criteria.json +137 -0
- package/.aiwf/personas/frontend/best_practices.md +445 -0
- package/.aiwf/personas/frontend/knowledge_base.md +729 -0
- package/.aiwf/personas/persona-index.json +31 -0
- package/.aiwf/personas/reviewer.json +44 -0
- package/.aiwf/personas/security/best_practices.md +307 -0
- package/.aiwf/personas/security/knowledge_base.md +498 -0
- package/.aiwf/personas/tester.json +44 -0
- package/.aiwf/scripts/cache-templates.js +209 -0
- package/.aiwf/scripts/create-offline.js +86 -0
- package/.aiwf/scripts/create-project.js +151 -0
- package/.aiwf/scripts/feature-progress-calculator.cjs +236 -0
- package/.aiwf/scripts/git-integration.cjs +391 -0
- package/.aiwf/scripts/install-git-hooks.cjs +226 -0
- package/.aiwf/scripts/test-commit-parsing.cjs +125 -0
- package/.aiwf/scripts/update-feature-status.cjs +198 -0
- package/.aiwf/templates/README.md +78 -0
- package/.aiwf/templates/api-server/config.json +64 -0
- package/.aiwf/templates/api-server/template/.aiwf/config.json +56 -0
- package/.aiwf/templates/api-server/template/.aiwf/feature-ledger.json +42 -0
- package/.aiwf/templates/api-server/template/.aiwf/personas/backend-engineer.json +40 -0
- package/.aiwf/templates/api-server/template/.aiwf/scripts/cli.js +111 -0
- package/.aiwf/templates/api-server/template/.env.example +29 -0
- package/.aiwf/templates/api-server/template/.eslintrc.json +23 -0
- package/.aiwf/templates/api-server/template/README.md +171 -0
- package/.aiwf/templates/api-server/template/jest.config.js +26 -0
- package/.aiwf/templates/api-server/template/nodemon.json +9 -0
- package/.aiwf/templates/api-server/template/package.json +61 -0
- package/.aiwf/templates/api-server/template/src/app.ts +60 -0
- package/.aiwf/templates/api-server/template/src/config/swagger.ts +38 -0
- package/.aiwf/templates/api-server/template/src/controllers/aiwfController.ts +68 -0
- package/.aiwf/templates/api-server/template/src/controllers/authController.ts +128 -0
- package/.aiwf/templates/api-server/template/src/controllers/statusController.ts +28 -0
- package/.aiwf/templates/api-server/template/src/index.ts +28 -0
- package/.aiwf/templates/api-server/template/src/middleware/aiwfMiddleware.ts +50 -0
- package/.aiwf/templates/api-server/template/src/middleware/authMiddleware.ts +41 -0
- package/.aiwf/templates/api-server/template/src/middleware/errorHandler.ts +42 -0
- package/.aiwf/templates/api-server/template/src/middleware/notFoundHandler.ts +14 -0
- package/.aiwf/templates/api-server/template/src/middleware/requestLogger.ts +20 -0
- package/.aiwf/templates/api-server/template/src/routes/aiwf.ts +42 -0
- package/.aiwf/templates/api-server/template/src/routes/index.ts +13 -0
- package/.aiwf/templates/api-server/template/src/routes/v1/index.ts +67 -0
- package/.aiwf/templates/api-server/template/src/utils/logger.ts +37 -0
- package/.aiwf/templates/api-server/template/tests/app.test.ts +40 -0
- package/.aiwf/templates/api-server/template/tsconfig.json +43 -0
- package/.aiwf/templates/npm-library/config.json +61 -0
- package/.aiwf/templates/npm-library/template/LICENSE +21 -0
- package/.aiwf/templates/npm-library/template/README.md +201 -0
- package/.aiwf/templates/npm-library/template/package.json +78 -0
- package/.aiwf/templates/web-app/config.json +53 -0
- package/.aiwf/templates/web-app/template/.aiwf/config.json +54 -0
- package/.aiwf/templates/web-app/template/.aiwf/feature-ledger.json +37 -0
- package/.aiwf/templates/web-app/template/.aiwf/personas/fullstack-developer.json +40 -0
- package/.aiwf/templates/web-app/template/.aiwf/scripts/cli.js +110 -0
- package/.aiwf/templates/web-app/template/.eslintrc.cjs +20 -0
- package/.aiwf/templates/web-app/template/README.md +151 -0
- package/.aiwf/templates/web-app/template/index.html +14 -0
- package/.aiwf/templates/web-app/template/package.json +44 -0
- package/.aiwf/templates/web-app/template/postcss.config.js +6 -0
- package/.aiwf/templates/web-app/template/public/vite.svg +1 -0
- package/.aiwf/templates/web-app/template/src/App.tsx +21 -0
- package/.aiwf/templates/web-app/template/src/components/Layout.tsx +57 -0
- package/.aiwf/templates/web-app/template/src/components/aiwf/ContextStatus.tsx +107 -0
- package/.aiwf/templates/web-app/template/src/components/aiwf/FeatureLedger.tsx +93 -0
- package/.aiwf/templates/web-app/template/src/components/aiwf/TokenUsage.tsx +71 -0
- package/.aiwf/templates/web-app/template/src/index.css +60 -0
- package/.aiwf/templates/web-app/template/src/main.tsx +10 -0
- package/.aiwf/templates/web-app/template/src/pages/AiwfDashboard.tsx +60 -0
- package/.aiwf/templates/web-app/template/src/pages/HomePage.tsx +89 -0
- package/.aiwf/templates/web-app/template/src/pages/NotFound.tsx +25 -0
- package/.aiwf/templates/web-app/template/src/stores/aiwfStore.ts +126 -0
- package/.aiwf/templates/web-app/template/src/types/global.d.ts +9 -0
- package/.aiwf/templates/web-app/template/src/vite-env.d.ts +1 -0
- package/.aiwf/templates/web-app/template/tailwind.config.js +30 -0
- package/.aiwf/templates/web-app/template/tsconfig.json +37 -0
- package/.aiwf/templates/web-app/template/tsconfig.node.json +10 -0
- package/.aiwf/templates/web-app/template/vite.config.ts +23 -0
- package/.aiwf/test-cache/86c7f9e80251abb8bedd58953ab0d1779e46b4f43ea33b63bffdb778106373b0.json +6 -0
- package/.aiwf/test-cache/9e252a90b80fce0585d7ed0646e7a9b4343e109f661f42a3ae678ba1ec5e22c7.json +7 -0
- package/.aiwf/test-results-s02.json +36 -0
- package/.aiwf/token-data/alerts.json +293 -0
- package/.aiwf/token-data/monitor-config.json +12 -0
- package/CHANGELOG.md +119 -33
- package/CHANGELOG_M02.md +52 -0
- package/CLAUDE.md +133 -199
- package/README.ko.md +5 -0
- package/README.md +31 -5
- package/RELEASE_NOTES_M02.md +177 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_create_feature_ledger.md +54 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_default_mode.md +66 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_docs.md +225 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_get_feature_details.md +78 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_link_feature_to_milestone.md +57 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_list_features.md +54 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_architect.md +60 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_backend.md +60 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_data_analyst.md +60 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_frontend.md +60 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_security.md +60 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_persona_status.md +72 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_switch_language.md +160 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_update_feature_status.md +53 -0
- package/claude-code/aiwf/en/commands/ai-persona.js +667 -0
- package/claude-code/aiwf/en/commands/compress-context.js +355 -0
- package/claude-code/aiwf/en/commands/feature-ledger.js +565 -0
- package/claude-code/aiwf/en/commands/feature_commit_report.js +370 -0
- package/claude-code/aiwf/en/commands/scan_git_history.js +234 -0
- package/claude-code/aiwf/en/commands/sync_feature_commits.js +154 -0
- package/claude-code/aiwf/en/commands/token-tracking.js +443 -0
- package/claude-code/aiwf/en/config/commit-patterns.js +103 -0
- package/claude-code/aiwf/en/hooks/install-hooks.sh +100 -0
- package/claude-code/aiwf/en/hooks/post-commit +84 -0
- package/claude-code/aiwf/en/tests/compression-test-suite.js +1252 -0
- package/claude-code/aiwf/en/tests/test-git-integration.js +164 -0
- package/claude-code/aiwf/en/tests/token-tracking.test.js +537 -0
- package/claude-code/aiwf/en/utils/compression-metrics.js +1031 -0
- package/claude-code/aiwf/en/utils/compression-strategies.js +557 -0
- package/claude-code/aiwf/en/utils/content-normalizer.js +455 -0
- package/claude-code/aiwf/en/utils/context-compressor.js +583 -0
- package/claude-code/aiwf/en/utils/feature-updater.js +271 -0
- package/claude-code/aiwf/en/utils/git-utils.js +220 -0
- package/claude-code/aiwf/en/utils/importance-classifier.js +645 -0
- package/claude-code/aiwf/en/utils/information-filter.js +710 -0
- package/claude-code/aiwf/en/utils/text-summarizer.js +487 -0
- package/claude-code/aiwf/en/utils/token-counter.js +177 -0
- package/claude-code/aiwf/en/utils/token-monitor.js +484 -0
- package/claude-code/aiwf/en/utils/token-reporter.js +453 -0
- package/claude-code/aiwf/en/utils/token-storage.js +433 -0
- package/claude-code/aiwf/en/utils/token-tracker.js +283 -0
- package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_ID_GENERATOR.md +138 -0
- package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_INDEX.md +186 -0
- package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_METADATA.md +240 -0
- package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/FEATURE_WORKFLOW.md +183 -0
- package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/README.md +94 -0
- 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
- 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
- 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
- package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/schemas/feature_schema.json +122 -0
- package/claude-code/aiwf/ko/.aiwf/06_FEATURE_LEDGERS/schemas/feature_validator.cjs +406 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_code_review.md +62 -62
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_commit.md +111 -111
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_aggressive_persona.md +53 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_context.md +116 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_minimal_persona.md +48 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_stats.md +79 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_compress_with_persona.md +51 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_feature_ledger.md +54 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_general_task.md +106 -106
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_milestone_plan.md +127 -127
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_sprint_tasks.md +130 -130
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_create_sprints_from_milestone.md +87 -87
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_default_mode.md +44 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_do_task.md +72 -72
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_docs.md +225 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_evaluate.md +92 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_get_feature_details.md +78 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_initialize.md +86 -86
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_issue_create.md +3 -3
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_link_feature_to_milestone.md +57 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_list_features.md +54 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_architect.md +48 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_backend.md +37 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_data_analyst.md +37 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_frontend.md +37 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_security.md +48 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_persona_status.md +50 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_pr_create.md +14 -14
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_prime.md +5 -5
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_project_review.md +39 -39
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_switch_language.md +160 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_test.md +76 -77
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_testing_review.md +120 -120
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_ultrathink_general.md +209 -266
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_update_docs_kr.md +25 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_update_feature_status.md +53 -0
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_yolo.md +226 -226
- package/claude-code/aiwf/ko/CLAUDE.md +76 -0
- package/claude-code/aiwf/ko/ai-tools/README.md +105 -0
- package/claude-code/aiwf/ko/ai-tools/augment/README.md +371 -0
- package/claude-code/aiwf/ko/ai-tools/augment/config.json +30 -0
- package/claude-code/aiwf/ko/ai-tools/augment/template/.augment/aiwf-integration.md +387 -0
- package/claude-code/aiwf/ko/ai-tools/augment/template/.augment/augment.yaml +347 -0
- package/claude-code/aiwf/ko/ai-tools/augment/template/augment.config.json +64 -0
- package/claude-code/aiwf/ko/ai-tools/claude-code/README.md +151 -0
- package/claude-code/aiwf/ko/ai-tools/claude-code/config.json +28 -0
- package/claude-code/aiwf/ko/ai-tools/claude-code/template/CLAUDE.md +91 -0
- package/claude-code/aiwf/ko/ai-tools/cursor/README.md +314 -0
- package/claude-code/aiwf/ko/ai-tools/cursor/config.json +29 -0
- package/claude-code/aiwf/ko/ai-tools/cursor/template/.cursorrules +362 -0
- package/claude-code/aiwf/ko/ai-tools/github-copilot/README.md +195 -0
- package/claude-code/aiwf/ko/ai-tools/github-copilot/config.json +24 -0
- package/claude-code/aiwf/ko/ai-tools/github-copilot/template/.github/copilot-instructions.md +202 -0
- package/claude-code/aiwf/ko/ai-tools/windsurf/README.md +355 -0
- package/claude-code/aiwf/ko/ai-tools/windsurf/config.json +29 -0
- package/claude-code/aiwf/ko/ai-tools/windsurf/template/.windsurf/aiwf-rules.md +260 -0
- package/claude-code/aiwf/ko/ai-tools/windsurf/template/.windsurf/windsurf.config.js +312 -0
- package/claude-code/aiwf/ko/ai-tools/windsurf/template/windsurf.config.json +63 -0
- package/claude-code/aiwf/ko/bin/aiwf-create.js +56 -0
- package/claude-code/aiwf/ko/bin/aiwf.js +21 -0
- package/claude-code/aiwf/ko/commands/ai-persona.js +602 -0
- package/claude-code/aiwf/ko/commands/compress-context.js +389 -0
- package/claude-code/aiwf/ko/commands/evaluate.js +246 -0
- package/claude-code/aiwf/ko/commands/feature-ledger.js +565 -0
- package/claude-code/aiwf/ko/commands/feature_commit_report.js +370 -0
- package/claude-code/aiwf/ko/commands/persona-context-apply.js +562 -0
- package/claude-code/aiwf/ko/commands/scan_git_history.js +234 -0
- package/claude-code/aiwf/ko/commands/sync_feature_commits.js +154 -0
- package/claude-code/aiwf/ko/commands/token-tracking.js +443 -0
- package/claude-code/aiwf/ko/config/commit-patterns.js +103 -0
- package/claude-code/aiwf/ko/config/language.json +6 -0
- package/claude-code/aiwf/ko/docs/00_PROJECT_MANIFEST.md +183 -0
- package/claude-code/aiwf/ko/docs/ARCHITECTURE.md +121 -0
- package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_ADVANCED_USE_CASES.md +412 -0
- package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_API_REFERENCE.md +361 -0
- package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_COMMANDS_GUIDE.md +254 -0
- package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_FAQ.md +365 -0
- package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_SYSTEM_OVERVIEW.md +305 -0
- package/claude-code/aiwf/ko/docs/FEATURE_LEDGER_USER_GUIDE.md +416 -0
- 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
- package/claude-code/aiwf/ko/feature-ledger/FL-001-authentication.json +52 -0
- package/claude-code/aiwf/ko/feature-ledger/feature-index.json +20 -0
- package/claude-code/aiwf/ko/hooks/install-hooks.sh +100 -0
- package/claude-code/aiwf/ko/hooks/post-commit +84 -0
- package/claude-code/aiwf/ko/personas/PERSONA_INDEX.md +57 -0
- package/claude-code/aiwf/ko/personas/analyst.json +44 -0
- package/claude-code/aiwf/ko/personas/architect/best_practices.md +136 -0
- package/claude-code/aiwf/ko/personas/architect/knowledge_base.md +377 -0
- package/claude-code/aiwf/ko/personas/architect.json +44 -0
- package/claude-code/aiwf/ko/personas/backend/best_practices.md +766 -0
- package/claude-code/aiwf/ko/personas/backend/knowledge_base.md +1070 -0
- package/claude-code/aiwf/ko/personas/data_analyst/best_practices.md +594 -0
- package/claude-code/aiwf/ko/personas/data_analyst/knowledge_base.md +1057 -0
- package/claude-code/aiwf/ko/personas/developer.json +44 -0
- package/claude-code/aiwf/ko/personas/developer.md +37 -0
- package/claude-code/aiwf/ko/personas/evaluation_criteria.json +137 -0
- package/claude-code/aiwf/ko/personas/frontend/best_practices.md +445 -0
- package/claude-code/aiwf/ko/personas/frontend/knowledge_base.md +729 -0
- package/claude-code/aiwf/ko/personas/persona-index.json +31 -0
- package/claude-code/aiwf/ko/personas/reviewer.json +44 -0
- package/claude-code/aiwf/ko/personas/security/best_practices.md +307 -0
- package/claude-code/aiwf/ko/personas/security/knowledge_base.md +498 -0
- package/claude-code/aiwf/ko/personas/tester.json +44 -0
- package/claude-code/aiwf/ko/scripts/cache-templates.js +209 -0
- package/claude-code/aiwf/ko/scripts/create-offline.js +86 -0
- package/claude-code/aiwf/ko/scripts/create-project.js +151 -0
- package/claude-code/aiwf/ko/scripts/feature-progress-calculator.cjs +236 -0
- package/claude-code/aiwf/ko/scripts/git-integration.cjs +391 -0
- package/claude-code/aiwf/ko/scripts/install-git-hooks.cjs +226 -0
- package/claude-code/aiwf/ko/scripts/test-commit-parsing.cjs +125 -0
- package/claude-code/aiwf/ko/scripts/update-feature-status.cjs +198 -0
- package/claude-code/aiwf/ko/templates/README.md +78 -0
- package/claude-code/aiwf/ko/templates/api-server/config.json +64 -0
- package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/config.json +56 -0
- package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/feature-ledger.json +42 -0
- package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/personas/backend-engineer.json +40 -0
- package/claude-code/aiwf/ko/templates/api-server/template/.aiwf/scripts/cli.js +111 -0
- package/claude-code/aiwf/ko/templates/api-server/template/.env.example +29 -0
- package/claude-code/aiwf/ko/templates/api-server/template/.eslintrc.json +23 -0
- package/claude-code/aiwf/ko/templates/api-server/template/README.md +171 -0
- package/claude-code/aiwf/ko/templates/api-server/template/jest.config.js +26 -0
- package/claude-code/aiwf/ko/templates/api-server/template/nodemon.json +9 -0
- package/claude-code/aiwf/ko/templates/api-server/template/package.json +61 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/app.ts +60 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/config/swagger.ts +38 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/controllers/aiwfController.ts +68 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/controllers/authController.ts +128 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/controllers/statusController.ts +28 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/index.ts +28 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/aiwfMiddleware.ts +50 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/authMiddleware.ts +41 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/errorHandler.ts +42 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/notFoundHandler.ts +14 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/middleware/requestLogger.ts +20 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/routes/aiwf.ts +42 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/routes/index.ts +13 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/routes/v1/index.ts +67 -0
- package/claude-code/aiwf/ko/templates/api-server/template/src/utils/logger.ts +37 -0
- package/claude-code/aiwf/ko/templates/api-server/template/tests/app.test.ts +40 -0
- package/claude-code/aiwf/ko/templates/api-server/template/tsconfig.json +43 -0
- package/claude-code/aiwf/ko/templates/npm-library/config.json +61 -0
- package/claude-code/aiwf/ko/templates/npm-library/template/LICENSE +21 -0
- package/claude-code/aiwf/ko/templates/npm-library/template/README.md +201 -0
- package/claude-code/aiwf/ko/templates/npm-library/template/package.json +78 -0
- package/claude-code/aiwf/ko/templates/web-app/config.json +53 -0
- package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/config.json +54 -0
- package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/feature-ledger.json +37 -0
- package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/personas/fullstack-developer.json +40 -0
- package/claude-code/aiwf/ko/templates/web-app/template/.aiwf/scripts/cli.js +110 -0
- package/claude-code/aiwf/ko/templates/web-app/template/.eslintrc.cjs +20 -0
- package/claude-code/aiwf/ko/templates/web-app/template/README.md +151 -0
- package/claude-code/aiwf/ko/templates/web-app/template/index.html +14 -0
- package/claude-code/aiwf/ko/templates/web-app/template/package.json +44 -0
- package/claude-code/aiwf/ko/templates/web-app/template/postcss.config.js +6 -0
- package/claude-code/aiwf/ko/templates/web-app/template/public/vite.svg +1 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/App.tsx +21 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/components/Layout.tsx +57 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/components/aiwf/ContextStatus.tsx +107 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/components/aiwf/FeatureLedger.tsx +93 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/components/aiwf/TokenUsage.tsx +71 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/index.css +60 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/main.tsx +10 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/pages/AiwfDashboard.tsx +60 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/pages/HomePage.tsx +89 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/pages/NotFound.tsx +25 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/stores/aiwfStore.ts +126 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/types/global.d.ts +9 -0
- package/claude-code/aiwf/ko/templates/web-app/template/src/vite-env.d.ts +1 -0
- package/claude-code/aiwf/ko/templates/web-app/template/tailwind.config.js +30 -0
- package/claude-code/aiwf/ko/templates/web-app/template/tsconfig.json +37 -0
- package/claude-code/aiwf/ko/templates/web-app/template/tsconfig.node.json +10 -0
- package/claude-code/aiwf/ko/templates/web-app/template/vite.config.ts +23 -0
- package/claude-code/aiwf/ko/tests/compression-test-suite.js +1252 -0
- package/claude-code/aiwf/ko/tests/test-git-integration.js +164 -0
- package/claude-code/aiwf/ko/tests/token-tracking.test.js +537 -0
- package/claude-code/aiwf/ko/token-data/alerts.json +293 -0
- package/claude-code/aiwf/ko/token-data/monitor-config.json +12 -0
- package/claude-code/aiwf/ko/utils/background-monitor.js +223 -0
- package/claude-code/aiwf/ko/utils/compression-metrics.js +1031 -0
- package/claude-code/aiwf/ko/utils/compression-strategies.js +557 -0
- package/claude-code/aiwf/ko/utils/content-normalizer.js +455 -0
- package/claude-code/aiwf/ko/utils/context-compressor.js +583 -0
- package/claude-code/aiwf/ko/utils/context-rule-parser.js +180 -0
- package/claude-code/aiwf/ko/utils/context-token-monitor.js +463 -0
- package/claude-code/aiwf/ko/utils/context-update-manager.js +502 -0
- package/claude-code/aiwf/ko/utils/feature-updater.js +271 -0
- package/claude-code/aiwf/ko/utils/git-utils.js +220 -0
- package/claude-code/aiwf/ko/utils/importance-classifier.js +645 -0
- package/claude-code/aiwf/ko/utils/information-filter.js +710 -0
- package/claude-code/aiwf/ko/utils/persona-aware-compressor.js +598 -0
- package/claude-code/aiwf/ko/utils/prompt-injector.js +242 -0
- package/claude-code/aiwf/ko/utils/simplified-evaluator.js +119 -0
- package/claude-code/aiwf/ko/utils/text-summarizer.js +492 -0
- package/claude-code/aiwf/ko/utils/token-counter.js +177 -0
- package/claude-code/aiwf/ko/utils/token-monitor.js +484 -0
- package/claude-code/aiwf/ko/utils/token-reporter.js +453 -0
- package/claude-code/aiwf/ko/utils/token-storage.js +433 -0
- package/claude-code/aiwf/ko/utils/token-tracker.js +283 -0
- package/docs/AI-WORKFLOW.ko.md +9 -2
- package/docs/AI-WORKFLOW.md +9 -2
- package/docs/AI_PERSONA_SYSTEM_DESIGN.md +516 -0
- package/docs/API_DOCUMENTATION.md +932 -0
- package/docs/API_REFERENCE.md +979 -0
- package/docs/COMMANDS_GUIDE.ko.md +101 -5
- package/docs/COMMANDS_GUIDE.md +289 -5
- package/docs/CONTRIBUTING.ko.md +408 -0
- package/docs/CONTRIBUTING.md +205 -203
- package/docs/EXAMPLES.md +691 -0
- package/docs/Enhanced_Installation_Flow_Design.md +498 -0
- package/docs/GETTING_STARTED.md +480 -0
- package/docs/PERFORMANCE_ARCHITECTURE.md +494 -0
- package/docs/PERFORMANCE_GUIDELINES.md +553 -0
- package/docs/PRD.ko.md +110 -58
- package/docs/PRD.md +110 -58
- package/docs/TROUBLESHOOTING.md +721 -0
- package/docs/git-feature-integration-guide.md +253 -0
- package/docs/guides/ai-personas-guide-ko.md +239 -0
- package/docs/guides/ai-personas-guide.md +239 -0
- package/docs/guides/context-compression-guide-ko.md +313 -0
- package/docs/guides/context-compression-guide.md +313 -0
- package/docs/guides/feature-git-integration-guide-ko.md +481 -0
- package/docs/guides/feature-git-integration-guide.md +481 -0
- package/docs/lightweight-evaluation.md +198 -0
- package/docs/m02-dod-checklist.md +125 -0
- package/docs/m02-gap-analysis.md +214 -0
- package/docs/m02-milestone-completion-report.md +186 -0
- package/docs/m02-milestone-executive-summary.md +68 -0
- package/docs/offline-template-cache.md +323 -0
- package/docs/performance-benchmark-report.md +159 -0
- package/docs/persona-aware-compression.md +168 -0
- package/docs/reports/S02-sprint-report.md +190 -0
- package/docs/usability-test-report.md +170 -0
- package/index.js +1349 -21
- package/jest.config.js +23 -0
- package/language-cli.js +279 -0
- package/language-utils.js +330 -0
- package/lib/ai-persona-manager.js +711 -0
- package/lib/cache-cli.js +459 -0
- package/lib/cache-integration.js +401 -0
- package/lib/cache-system.js +332 -0
- package/lib/context-engine.js +568 -0
- package/lib/file-batch-processor.js +401 -0
- package/lib/memory-profiler.js +471 -0
- package/lib/metrics-collector.js +885 -0
- package/lib/offline-detector.js +386 -0
- package/lib/performance-benchmark.js +621 -0
- package/lib/task-analyzer.js +599 -0
- package/lib/template-cache-system.js +559 -0
- package/lib/template-downloader.js +467 -0
- package/lib/template-manager.js +310 -0
- package/lib/template-version-manager.js +491 -0
- package/lib/token-optimizer.js +517 -0
- package/package.json +17 -6
- package/scripts/run-integration-tests.js +317 -0
- package/scripts/validate-commands.cjs +338 -0
- package/scripts/validate-commands.js +254 -0
- package/src/commands/ai-tool.js +383 -0
- package/test-token-system.js +88 -0
- package/tests/application.test.js +260 -0
- package/tests/basic.test.js +62 -0
- package/tests/commands.test.js +127 -0
- package/tests/installer.test.js +129 -0
- package/tests/integration/ai-persona-system.test.js +396 -0
- package/tests/integration/ai-persona.test.js +390 -0
- package/tests/integration/command-integration.test.js +600 -0
- package/tests/integration/context-compression.test.js +361 -0
- package/tests/integration/feature-ledger.test.js +226 -0
- package/tests/integration/git-integration.test.js +307 -0
- package/tests/integration/m02-milestone.test.js +420 -0
- package/tests/integration/persona-context-application.test.js +508 -0
- package/tests/integration/setup.js +174 -0
- package/tests/integration/test-persona-aware-compression.js +93 -0
- package/tests/language-utils.test.js +287 -0
- package/tests/s02-integration.test.js +422 -0
- package/tests/unit/ai-persona-manager.test.js +514 -0
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_prime_context.md +0 -5
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_prime_context.md +0 -8
|
@@ -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;
|