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.
- 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 +95 -11
- package/CHANGELOG_M02.md +52 -0
- package/CLAUDE.md +135 -0
- package/README.ko.md +5 -0
- package/README.md +6 -0
- 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_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_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_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_default_mode.md +44 -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_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_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 +2 -2
- 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_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 +8 -2
- package/docs/COMMANDS_GUIDE.md +196 -2
- package/docs/CONTRIBUTING.ko.md +408 -0
- package/docs/CONTRIBUTING.md +205 -203
- package/docs/EXAMPLES.md +691 -0
- package/docs/GETTING_STARTED.md +480 -0
- package/docs/PERFORMANCE_ARCHITECTURE.md +494 -0
- package/docs/PERFORMANCE_GUIDELINES.md +553 -0
- 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 +109 -1
- package/jest.config.js +20 -1
- package/language-utils.js +1 -1
- 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 +6 -3
- package/scripts/run-integration-tests.js +317 -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 +1 -1
- 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 +25 -9
- 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_language_manager.md +0 -287
- package/claude-code/aiwf/en/.claude/commands/aiwf/aiwf_language_status.md +0 -246
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_language_manager.md +0 -287
- package/claude-code/aiwf/ko/.claude/commands/aiwf/aiwf_language_status.md +0 -246
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AI Persona Commands for Claude Code
|
|
5
|
+
* Manages AI behavior personas for different development tasks
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { AIPersonaManager } from '../../../../lib/ai-persona-manager.js';
|
|
9
|
+
import { getBackgroundMonitor } from '../../ko/utils/background-monitor.js';
|
|
10
|
+
import path from 'path';
|
|
11
|
+
import chalk from 'chalk';
|
|
12
|
+
|
|
13
|
+
// Global persona manager instance
|
|
14
|
+
let personaManager = null;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Get or create persona manager instance
|
|
18
|
+
*/
|
|
19
|
+
async function getPersonaManager() {
|
|
20
|
+
if (!personaManager) {
|
|
21
|
+
personaManager = new AIPersonaManager({
|
|
22
|
+
personaConfigPath: path.join(process.cwd(), '.aiwf', 'personas'),
|
|
23
|
+
metricsPath: path.join(process.cwd(), '.aiwf', 'metrics'),
|
|
24
|
+
metricsEnabled: true,
|
|
25
|
+
autoDetectionEnabled: true
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
await personaManager.init();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return personaManager;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Format persona status for display
|
|
36
|
+
*/
|
|
37
|
+
function formatPersonaStatus(persona, metrics) {
|
|
38
|
+
const lines = [];
|
|
39
|
+
|
|
40
|
+
lines.push(chalk.cyan('🎭 AI Persona Status'));
|
|
41
|
+
lines.push(chalk.gray('━'.repeat(50)));
|
|
42
|
+
lines.push(`Current Persona: ${chalk.yellow(persona.name)}`);
|
|
43
|
+
lines.push(`Description: ${persona.description}`);
|
|
44
|
+
|
|
45
|
+
if (persona.behaviors?.length) {
|
|
46
|
+
lines.push('\nKey Behaviors:');
|
|
47
|
+
persona.behaviors.forEach(behavior => {
|
|
48
|
+
lines.push(` • ${behavior}`);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (persona.recommendedTools?.length) {
|
|
53
|
+
lines.push(`\nRecommended Tools: ${persona.recommendedTools.join(', ')}`);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (metrics && metrics.duration !== undefined) {
|
|
57
|
+
lines.push('\nCurrent Session:');
|
|
58
|
+
lines.push(` Duration: ${Math.round(metrics.duration / 1000)}s`);
|
|
59
|
+
lines.push(` Interactions: ${metrics.interactions}`);
|
|
60
|
+
lines.push(` Token Usage: ${metrics.tokenUsage.current}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return lines.join('\n');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Format persona report
|
|
68
|
+
*/
|
|
69
|
+
function formatPersonaReport(report) {
|
|
70
|
+
const lines = [];
|
|
71
|
+
|
|
72
|
+
lines.push(chalk.cyan('📊 AI Persona Performance Report'));
|
|
73
|
+
lines.push(chalk.gray('━'.repeat(50)));
|
|
74
|
+
lines.push(`Generated: ${new Date(report.generatedAt).toLocaleString()}`);
|
|
75
|
+
lines.push(`Time Range: ${report.timeRange}`);
|
|
76
|
+
|
|
77
|
+
// Summary
|
|
78
|
+
lines.push('\n' + chalk.yellow('Summary:'));
|
|
79
|
+
lines.push(`Total Sessions: ${report.summary.totalSessions}`);
|
|
80
|
+
lines.push(`Avg Completion Time: ${Math.round(report.summary.averageCompletionTime / 1000)}s`);
|
|
81
|
+
|
|
82
|
+
// Persona Usage
|
|
83
|
+
if (report.summary.personaUsage) {
|
|
84
|
+
lines.push('\n' + chalk.yellow('Persona Usage:'));
|
|
85
|
+
Object.entries(report.summary.personaUsage).forEach(([persona, stats]) => {
|
|
86
|
+
lines.push(` ${persona}: ${stats.count} sessions (${stats.percentage.toFixed(1)}%)`);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Quality Trend
|
|
91
|
+
if (report.summary.qualityTrend) {
|
|
92
|
+
lines.push('\n' + chalk.yellow('Quality Trend:'));
|
|
93
|
+
lines.push(` Trend: ${report.summary.qualityTrend.trend}`);
|
|
94
|
+
if (report.summary.qualityTrend.averageScore) {
|
|
95
|
+
lines.push(` Average Score: ${(report.summary.qualityTrend.averageScore * 100).toFixed(1)}%`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Persona Analysis
|
|
100
|
+
if (report.personaAnalysis) {
|
|
101
|
+
lines.push('\n' + chalk.yellow('Persona Performance:'));
|
|
102
|
+
Object.entries(report.personaAnalysis).forEach(([persona, analysis]) => {
|
|
103
|
+
lines.push(`\n ${chalk.green(persona)}:`);
|
|
104
|
+
lines.push(` Sessions: ${analysis.sessionCount}`);
|
|
105
|
+
lines.push(` Completion Rate: ${(analysis.completionRate * 100).toFixed(1)}%`);
|
|
106
|
+
lines.push(` Avg Quality: ${(analysis.averageQualityScore * 100).toFixed(1)}%`);
|
|
107
|
+
lines.push(` Token Efficiency: ${(analysis.tokenEfficiency * 100).toFixed(1)}%`);
|
|
108
|
+
|
|
109
|
+
if (analysis.bestUseCases?.length) {
|
|
110
|
+
lines.push(` Best For: ${analysis.bestUseCases.join(', ')}`);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Recommendations
|
|
116
|
+
if (report.recommendations?.length) {
|
|
117
|
+
lines.push('\n' + chalk.yellow('Recommendations:'));
|
|
118
|
+
report.recommendations.forEach(rec => {
|
|
119
|
+
const icon = rec.priority === 'high' ? '🔴' : '🟡';
|
|
120
|
+
lines.push(` ${icon} ${rec.message}`);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return lines.join('\n');
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Command handlers
|
|
129
|
+
*/
|
|
130
|
+
export const commands = {
|
|
131
|
+
/**
|
|
132
|
+
* Switch to a specific persona
|
|
133
|
+
*/
|
|
134
|
+
'/project:aiwf:ai_persona:switch': async (args) => {
|
|
135
|
+
const personaName = args[0];
|
|
136
|
+
|
|
137
|
+
if (!personaName) {
|
|
138
|
+
return chalk.red('Error: Please specify a persona name (architect, security, frontend, backend, data_analyst)');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
const manager = await getPersonaManager();
|
|
143
|
+
|
|
144
|
+
if (!manager.isValidPersona(personaName)) {
|
|
145
|
+
return chalk.red(`Error: Invalid persona '${personaName}'. Available personas: ${manager.getAvailablePersonas().join(', ')}`);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
await manager.switchPersona(personaName, { manual: true });
|
|
149
|
+
|
|
150
|
+
// Initialize background monitor (non-blocking)
|
|
151
|
+
const monitor = getBackgroundMonitor();
|
|
152
|
+
monitor.initialize().catch(() => {}); // Ignore errors
|
|
153
|
+
|
|
154
|
+
return chalk.green(`✅ Switched to ${personaName} persona`);
|
|
155
|
+
} catch (error) {
|
|
156
|
+
return chalk.red(`Error: ${error.message}`);
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Shortcuts for specific personas
|
|
162
|
+
*/
|
|
163
|
+
'/project:aiwf:ai_persona:architect': async () => {
|
|
164
|
+
return commands['/project:aiwf:ai_persona:switch'](['architect']);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
'/project:aiwf:ai_persona:security': async () => {
|
|
168
|
+
return commands['/project:aiwf:ai_persona:switch'](['security']);
|
|
169
|
+
},
|
|
170
|
+
|
|
171
|
+
'/project:aiwf:ai_persona:frontend': async () => {
|
|
172
|
+
return commands['/project:aiwf:ai_persona:switch'](['frontend']);
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
'/project:aiwf:ai_persona:backend': async () => {
|
|
176
|
+
return commands['/project:aiwf:ai_persona:switch'](['backend']);
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
'/project:aiwf:ai_persona:data_analyst': async () => {
|
|
180
|
+
return commands['/project:aiwf:ai_persona:switch'](['data_analyst']);
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
// Shorter aliases for personas
|
|
184
|
+
'/aiwf:persona:architect': async () => {
|
|
185
|
+
return commands['/project:aiwf:ai_persona:switch'](['architect']);
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
'/aiwf:persona:security': async () => {
|
|
189
|
+
return commands['/project:aiwf:ai_persona:switch'](['security']);
|
|
190
|
+
},
|
|
191
|
+
|
|
192
|
+
'/aiwf:persona:frontend': async () => {
|
|
193
|
+
return commands['/project:aiwf:ai_persona:switch'](['frontend']);
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
'/aiwf:persona:backend': async () => {
|
|
197
|
+
return commands['/project:aiwf:ai_persona:switch'](['backend']);
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
'/aiwf:persona:data_analyst': async () => {
|
|
201
|
+
return commands['/project:aiwf:ai_persona:switch'](['data_analyst']);
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Enable/disable auto-detection
|
|
206
|
+
*/
|
|
207
|
+
'/project:aiwf:ai_persona:auto': async (args) => {
|
|
208
|
+
const enabled = args[0] !== 'false' && args[0] !== 'off';
|
|
209
|
+
|
|
210
|
+
try {
|
|
211
|
+
const manager = await getPersonaManager();
|
|
212
|
+
manager.options.autoDetectionEnabled = enabled;
|
|
213
|
+
|
|
214
|
+
return chalk.green(`✅ Auto-detection ${enabled ? 'enabled' : 'disabled'}`);
|
|
215
|
+
} catch (error) {
|
|
216
|
+
return chalk.red(`Error: ${error.message}`);
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Show current persona status
|
|
222
|
+
*/
|
|
223
|
+
'/project:aiwf:ai_persona:status': async () => {
|
|
224
|
+
try {
|
|
225
|
+
const manager = await getPersonaManager();
|
|
226
|
+
const current = manager.getCurrentPersona();
|
|
227
|
+
|
|
228
|
+
if (!current) {
|
|
229
|
+
return chalk.yellow('No persona currently active');
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
const metrics = await manager.metricsCollector.getCurrentSessionMetrics();
|
|
233
|
+
|
|
234
|
+
return formatPersonaStatus(current, metrics);
|
|
235
|
+
} catch (error) {
|
|
236
|
+
return chalk.red(`Error: ${error.message}`);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Generate persona performance report
|
|
242
|
+
*/
|
|
243
|
+
'/project:aiwf:ai_persona:report': async (args) => {
|
|
244
|
+
const timeRange = args[0] || 'all';
|
|
245
|
+
|
|
246
|
+
try {
|
|
247
|
+
const manager = await getPersonaManager();
|
|
248
|
+
const report = await manager.generateReport({ timeRange });
|
|
249
|
+
|
|
250
|
+
return formatPersonaReport(report);
|
|
251
|
+
} catch (error) {
|
|
252
|
+
return chalk.red(`Error: ${error.message}`);
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* List available personas
|
|
258
|
+
*/
|
|
259
|
+
'/project:aiwf:ai_persona:list': async () => {
|
|
260
|
+
try {
|
|
261
|
+
const manager = await getPersonaManager();
|
|
262
|
+
const personas = manager.getAvailablePersonas();
|
|
263
|
+
const current = manager.getCurrentPersona();
|
|
264
|
+
|
|
265
|
+
const lines = [];
|
|
266
|
+
lines.push(chalk.cyan('🎭 Available AI Personas'));
|
|
267
|
+
lines.push(chalk.gray('━'.repeat(50)));
|
|
268
|
+
|
|
269
|
+
for (const personaName of personas) {
|
|
270
|
+
const persona = manager.availablePersonas[personaName];
|
|
271
|
+
const isCurrent = current?.name === personaName;
|
|
272
|
+
|
|
273
|
+
lines.push(`\n${isCurrent ? '▶ ' : ' '}${chalk.yellow(personaName)}${isCurrent ? ' (current)' : ''}`);
|
|
274
|
+
lines.push(` ${persona.description}`);
|
|
275
|
+
|
|
276
|
+
if (persona.focusAreas?.length) {
|
|
277
|
+
lines.push(` Focus: ${persona.focusAreas.slice(0, 3).join(', ')}`);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
lines.push('\n' + chalk.gray('Use /project:aiwf:ai_persona:switch <name> to change persona'));
|
|
282
|
+
|
|
283
|
+
return lines.join('\n');
|
|
284
|
+
} catch (error) {
|
|
285
|
+
return chalk.red(`Error: ${error.message}`);
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Get persona statistics
|
|
291
|
+
*/
|
|
292
|
+
'/project:aiwf:ai_persona:stats': async (args) => {
|
|
293
|
+
const personaName = args[0];
|
|
294
|
+
|
|
295
|
+
try {
|
|
296
|
+
const manager = await getPersonaManager();
|
|
297
|
+
|
|
298
|
+
if (personaName && !manager.isValidPersona(personaName)) {
|
|
299
|
+
return chalk.red(`Error: Invalid persona '${personaName}'`);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
const targetPersona = personaName || manager.getCurrentPersona()?.name;
|
|
303
|
+
|
|
304
|
+
if (!targetPersona) {
|
|
305
|
+
return chalk.yellow('No persona specified or active');
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const stats = await manager.getPersonaStats(targetPersona);
|
|
309
|
+
|
|
310
|
+
if (stats.message) {
|
|
311
|
+
return chalk.yellow(stats.message);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
const lines = [];
|
|
315
|
+
lines.push(chalk.cyan(`📊 ${targetPersona} Persona Statistics`));
|
|
316
|
+
lines.push(chalk.gray('━'.repeat(50)));
|
|
317
|
+
lines.push(`Total Sessions: ${stats.totalSessions}`);
|
|
318
|
+
lines.push(`Completion Rate: ${(stats.completionRate * 100).toFixed(1)}%`);
|
|
319
|
+
lines.push(`Average Duration: ${Math.round(stats.averageDuration / 1000)}s`);
|
|
320
|
+
lines.push(`Average Tokens: ${Math.round(stats.averageTokens)}`);
|
|
321
|
+
lines.push(`Error Rate: ${stats.errorRate.toFixed(2)} per session`);
|
|
322
|
+
lines.push(`Average Quality: ${(stats.averageQualityScore * 100).toFixed(1)}%`);
|
|
323
|
+
|
|
324
|
+
if (stats.taskDistribution && Object.keys(stats.taskDistribution).length > 0) {
|
|
325
|
+
lines.push('\nTask Distribution:');
|
|
326
|
+
Object.entries(stats.taskDistribution).forEach(([task, count]) => {
|
|
327
|
+
lines.push(` ${task}: ${count}`);
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return lines.join('\n');
|
|
332
|
+
} catch (error) {
|
|
333
|
+
return chalk.red(`Error: ${error.message}`);
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Reset persona system
|
|
339
|
+
*/
|
|
340
|
+
'/project:aiwf:ai_persona:reset': async () => {
|
|
341
|
+
try {
|
|
342
|
+
const manager = await getPersonaManager();
|
|
343
|
+
await manager.reset();
|
|
344
|
+
|
|
345
|
+
return chalk.green('✅ Persona system reset to default');
|
|
346
|
+
} catch (error) {
|
|
347
|
+
return chalk.red(`Error: ${error.message}`);
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Detect optimal persona for current task
|
|
353
|
+
*/
|
|
354
|
+
'/project:aiwf:ai_persona:detect': async (args) => {
|
|
355
|
+
const command = args.join(' ');
|
|
356
|
+
|
|
357
|
+
if (!command) {
|
|
358
|
+
return chalk.red('Error: Please provide a task description');
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
try {
|
|
362
|
+
const manager = await getPersonaManager();
|
|
363
|
+
|
|
364
|
+
const taskContext = {
|
|
365
|
+
command,
|
|
366
|
+
description: command
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
const optimal = await manager.detectOptimalPersona(taskContext);
|
|
370
|
+
|
|
371
|
+
const lines = [];
|
|
372
|
+
lines.push(chalk.cyan('🔍 Persona Detection Result'));
|
|
373
|
+
lines.push(chalk.gray('━'.repeat(50)));
|
|
374
|
+
lines.push(`Task: "${command}"`);
|
|
375
|
+
lines.push(`Recommended Persona: ${chalk.yellow(optimal)}`);
|
|
376
|
+
|
|
377
|
+
const persona = manager.availablePersonas[optimal];
|
|
378
|
+
if (persona) {
|
|
379
|
+
lines.push(`\nReason: ${persona.description}`);
|
|
380
|
+
lines.push(`Focus Areas: ${persona.focusAreas.join(', ')}`);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
lines.push('\n' + chalk.gray('Use /project:aiwf:ai_persona:switch ' + optimal + ' to activate'));
|
|
384
|
+
|
|
385
|
+
return lines.join('\n');
|
|
386
|
+
} catch (error) {
|
|
387
|
+
return chalk.red(`Error: ${error.message}`);
|
|
388
|
+
}
|
|
389
|
+
},
|
|
390
|
+
|
|
391
|
+
// Shorter aliases for common commands
|
|
392
|
+
'/aiwf:persona:status': async () => {
|
|
393
|
+
return commands['/project:aiwf:ai_persona:status']();
|
|
394
|
+
},
|
|
395
|
+
|
|
396
|
+
'/aiwf:persona:list': async () => {
|
|
397
|
+
return commands['/project:aiwf:ai_persona:list']();
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
'/aiwf:persona:switch': async (args) => {
|
|
401
|
+
return commands['/project:aiwf:ai_persona:switch'](args);
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Persona Command Mappings
|
|
407
|
+
* Maps persona names to their available command shortcuts
|
|
408
|
+
*/
|
|
409
|
+
export const personaCommandMappings = {
|
|
410
|
+
'architect': [
|
|
411
|
+
'/project:aiwf:ai_persona:architect',
|
|
412
|
+
'/aiwf:persona:architect'
|
|
413
|
+
],
|
|
414
|
+
'security': [
|
|
415
|
+
'/project:aiwf:ai_persona:security',
|
|
416
|
+
'/aiwf:persona:security'
|
|
417
|
+
],
|
|
418
|
+
'frontend': [
|
|
419
|
+
'/project:aiwf:ai_persona:frontend',
|
|
420
|
+
'/aiwf:persona:frontend'
|
|
421
|
+
],
|
|
422
|
+
'backend': [
|
|
423
|
+
'/project:aiwf:ai_persona:backend',
|
|
424
|
+
'/aiwf:persona:backend'
|
|
425
|
+
],
|
|
426
|
+
'data_analyst': [
|
|
427
|
+
'/project:aiwf:ai_persona:data_analyst',
|
|
428
|
+
'/aiwf:persona:data_analyst'
|
|
429
|
+
]
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Detailed persona descriptions for AI assistance
|
|
434
|
+
*/
|
|
435
|
+
export const personaDescriptions = {
|
|
436
|
+
architect: {
|
|
437
|
+
name: 'architect',
|
|
438
|
+
description: 'System design and architecture expert focused on scalable, maintainable solutions',
|
|
439
|
+
behaviors: [
|
|
440
|
+
'Analyzes overall system architecture and design patterns',
|
|
441
|
+
'Recommends scalable and maintainable solutions',
|
|
442
|
+
'Creates clear architectural diagrams and documentation',
|
|
443
|
+
'Considers non-functional requirements (performance, security, scalability)',
|
|
444
|
+
'Evaluates technology choices and trade-offs'
|
|
445
|
+
],
|
|
446
|
+
focusAreas: ['system design', 'architecture patterns', 'scalability', 'maintainability'],
|
|
447
|
+
recommendedTools: ['design tools', 'diagramming', 'documentation']
|
|
448
|
+
},
|
|
449
|
+
|
|
450
|
+
security: {
|
|
451
|
+
name: 'security',
|
|
452
|
+
description: 'Security specialist ensuring code safety and best practices',
|
|
453
|
+
behaviors: [
|
|
454
|
+
'Identifies security vulnerabilities and risks',
|
|
455
|
+
'Implements security best practices',
|
|
456
|
+
'Reviews authentication and authorization logic',
|
|
457
|
+
'Ensures data protection and encryption',
|
|
458
|
+
'Validates input sanitization and output encoding'
|
|
459
|
+
],
|
|
460
|
+
focusAreas: ['security audit', 'vulnerability assessment', 'encryption', 'authentication'],
|
|
461
|
+
recommendedTools: ['security scanners', 'static analysis', 'penetration testing']
|
|
462
|
+
},
|
|
463
|
+
|
|
464
|
+
frontend: {
|
|
465
|
+
name: 'frontend',
|
|
466
|
+
description: 'Frontend development expert specializing in UI/UX and modern web technologies',
|
|
467
|
+
behaviors: [
|
|
468
|
+
'Creates responsive and accessible user interfaces',
|
|
469
|
+
'Optimizes frontend performance and bundle sizes',
|
|
470
|
+
'Implements modern frontend frameworks and patterns',
|
|
471
|
+
'Ensures cross-browser compatibility',
|
|
472
|
+
'Focuses on user experience and interaction design'
|
|
473
|
+
],
|
|
474
|
+
focusAreas: ['UI/UX', 'React/Vue/Angular', 'CSS/styling', 'performance optimization'],
|
|
475
|
+
recommendedTools: ['component libraries', 'build tools', 'testing frameworks']
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
backend: {
|
|
479
|
+
name: 'backend',
|
|
480
|
+
description: 'Backend development specialist for APIs, databases, and server-side logic',
|
|
481
|
+
behaviors: [
|
|
482
|
+
'Designs efficient database schemas and queries',
|
|
483
|
+
'Implements robust API endpoints and services',
|
|
484
|
+
'Optimizes server-side performance',
|
|
485
|
+
'Handles data processing and business logic',
|
|
486
|
+
'Ensures data integrity and consistency'
|
|
487
|
+
],
|
|
488
|
+
focusAreas: ['API design', 'database optimization', 'microservices', 'server architecture'],
|
|
489
|
+
recommendedTools: ['ORMs', 'API frameworks', 'database tools', 'monitoring']
|
|
490
|
+
},
|
|
491
|
+
|
|
492
|
+
data_analyst: {
|
|
493
|
+
name: 'data_analyst',
|
|
494
|
+
description: 'Data analysis expert for insights, visualization, and data-driven decisions',
|
|
495
|
+
behaviors: [
|
|
496
|
+
'Analyzes data patterns and trends',
|
|
497
|
+
'Creates meaningful visualizations and reports',
|
|
498
|
+
'Implements data processing pipelines',
|
|
499
|
+
'Performs statistical analysis and modeling',
|
|
500
|
+
'Optimizes data queries and transformations'
|
|
501
|
+
],
|
|
502
|
+
focusAreas: ['data analysis', 'visualization', 'statistics', 'reporting'],
|
|
503
|
+
recommendedTools: ['pandas', 'visualization libraries', 'SQL', 'analytics tools']
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
// Export for testing
|
|
508
|
+
export { getPersonaManager };
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Handle persona command from command line
|
|
512
|
+
* Supports direct persona activation and management
|
|
513
|
+
*/
|
|
514
|
+
async function handlePersonaCommand() {
|
|
515
|
+
const command = process.argv[2];
|
|
516
|
+
const args = process.argv.slice(3);
|
|
517
|
+
|
|
518
|
+
// If no command provided, show help
|
|
519
|
+
if (!command) {
|
|
520
|
+
console.log(chalk.cyan('🎭 AIWF AI Persona Manager'));
|
|
521
|
+
console.log(chalk.gray('━'.repeat(50)));
|
|
522
|
+
console.log('\nUsage:');
|
|
523
|
+
console.log(' ai-persona <persona> Switch to specific persona');
|
|
524
|
+
console.log(' ai-persona status Show current persona status');
|
|
525
|
+
console.log(' ai-persona list List available personas');
|
|
526
|
+
console.log(' ai-persona default Restore default mode');
|
|
527
|
+
console.log('\nAvailable personas:');
|
|
528
|
+
console.log(' architect - System design and architecture expert');
|
|
529
|
+
console.log(' security - Security specialist');
|
|
530
|
+
console.log(' frontend - Frontend development expert');
|
|
531
|
+
console.log(' backend - Backend development specialist');
|
|
532
|
+
console.log(' data_analyst - Data analysis expert');
|
|
533
|
+
return;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
try {
|
|
537
|
+
// Initialize persona manager
|
|
538
|
+
const manager = await getPersonaManager();
|
|
539
|
+
|
|
540
|
+
// Check if command is a persona name
|
|
541
|
+
const validPersonas = ['architect', 'security', 'frontend', 'backend', 'data_analyst'];
|
|
542
|
+
|
|
543
|
+
if (validPersonas.includes(command)) {
|
|
544
|
+
// Save current persona state
|
|
545
|
+
const personaState = {
|
|
546
|
+
persona: command,
|
|
547
|
+
timestamp: new Date().toISOString(),
|
|
548
|
+
contextRules: []
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
// Load context rules for the persona
|
|
552
|
+
try {
|
|
553
|
+
const contextPath = path.join(process.cwd(), '.aiwf', 'personas', `${command}_context.json`);
|
|
554
|
+
const { readFile } = await import('fs/promises');
|
|
555
|
+
const contextData = await readFile(contextPath, 'utf8');
|
|
556
|
+
const context = JSON.parse(contextData);
|
|
557
|
+
personaState.contextRules = context.rules || [];
|
|
558
|
+
} catch (error) {
|
|
559
|
+
// Context file might not exist, which is okay
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
// Save persona state
|
|
563
|
+
const statePath = path.join(process.cwd(), '.aiwf', 'current_persona.json');
|
|
564
|
+
const { writeFile, mkdir } = await import('fs/promises');
|
|
565
|
+
await mkdir(path.dirname(statePath), { recursive: true });
|
|
566
|
+
await writeFile(statePath, JSON.stringify(personaState, null, 2));
|
|
567
|
+
|
|
568
|
+
// Switch persona
|
|
569
|
+
await manager.switchPersona(command, { manual: true });
|
|
570
|
+
|
|
571
|
+
console.log(chalk.green(`✅ Activated ${command} persona`));
|
|
572
|
+
|
|
573
|
+
// Show persona info
|
|
574
|
+
const persona = personaDescriptions[command];
|
|
575
|
+
if (persona) {
|
|
576
|
+
console.log(chalk.gray('━'.repeat(50)));
|
|
577
|
+
console.log(chalk.yellow(`Role: ${persona.description}`));
|
|
578
|
+
|
|
579
|
+
if (persona.behaviors?.length) {
|
|
580
|
+
console.log('\nKey behaviors:');
|
|
581
|
+
persona.behaviors.forEach(behavior => {
|
|
582
|
+
console.log(` • ${behavior}`);
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
if (personaState.contextRules?.length) {
|
|
587
|
+
console.log('\nContext rules applied:');
|
|
588
|
+
personaState.contextRules.forEach(rule => {
|
|
589
|
+
console.log(` • ${rule.description || rule.pattern || 'Custom rule'}`);
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// Handle other commands
|
|
598
|
+
switch (command) {
|
|
599
|
+
case 'status':
|
|
600
|
+
const current = manager.getCurrentPersona();
|
|
601
|
+
if (current) {
|
|
602
|
+
const metrics = await manager.metricsCollector.getCurrentSessionMetrics();
|
|
603
|
+
console.log(formatPersonaStatus(current, metrics));
|
|
604
|
+
} else {
|
|
605
|
+
console.log(chalk.yellow('No persona currently active'));
|
|
606
|
+
}
|
|
607
|
+
break;
|
|
608
|
+
|
|
609
|
+
case 'list':
|
|
610
|
+
const personas = manager.getAvailablePersonas();
|
|
611
|
+
const currentPersona = manager.getCurrentPersona();
|
|
612
|
+
|
|
613
|
+
console.log(chalk.cyan('🎭 Available AI Personas'));
|
|
614
|
+
console.log(chalk.gray('━'.repeat(50)));
|
|
615
|
+
|
|
616
|
+
for (const personaName of personas) {
|
|
617
|
+
const persona = personaDescriptions[personaName];
|
|
618
|
+
const isCurrent = currentPersona?.name === personaName;
|
|
619
|
+
|
|
620
|
+
console.log(`\n${isCurrent ? '▶ ' : ' '}${chalk.yellow(personaName)}${isCurrent ? ' (current)' : ''}`);
|
|
621
|
+
if (persona) {
|
|
622
|
+
console.log(` ${persona.description}`);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
break;
|
|
626
|
+
|
|
627
|
+
case 'default':
|
|
628
|
+
case 'reset':
|
|
629
|
+
// Remove persona state file to restore default mode
|
|
630
|
+
try {
|
|
631
|
+
const statePath = path.join(process.cwd(), '.aiwf', 'current_persona.json');
|
|
632
|
+
const { unlink } = await import('fs/promises');
|
|
633
|
+
await unlink(statePath);
|
|
634
|
+
console.log(chalk.green('✅ Restored default mode'));
|
|
635
|
+
} catch (error) {
|
|
636
|
+
// File might not exist
|
|
637
|
+
console.log(chalk.yellow('Already in default mode'));
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
// Reset persona manager
|
|
641
|
+
await manager.reset();
|
|
642
|
+
break;
|
|
643
|
+
|
|
644
|
+
default:
|
|
645
|
+
// Check if it's a command format
|
|
646
|
+
if (command.startsWith('/')) {
|
|
647
|
+
if (commands[command]) {
|
|
648
|
+
const result = await commands[command](args);
|
|
649
|
+
console.log(result);
|
|
650
|
+
} else {
|
|
651
|
+
console.error(chalk.red(`Unknown command: ${command}`));
|
|
652
|
+
}
|
|
653
|
+
} else {
|
|
654
|
+
console.error(chalk.red(`Unknown command: ${command}`));
|
|
655
|
+
console.log(chalk.gray('Use "ai-persona" without arguments to see help'));
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
} catch (error) {
|
|
659
|
+
console.error(chalk.red(`Error: ${error.message}`));
|
|
660
|
+
process.exit(1);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// If running directly, handle command line arguments
|
|
665
|
+
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
666
|
+
handlePersonaCommand();
|
|
667
|
+
}
|