javi-forge 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/ci-local/ci-local.sh +29 -9
  2. package/ci-local/hooks/commit-msg +0 -0
  3. package/ci-local/hooks/pre-commit +1 -1
  4. package/ci-local/hooks/pre-push +0 -0
  5. package/ci-local/install.sh +0 -0
  6. package/ci-local/lib/common.sh +183 -0
  7. package/dist/__integration__/helpers.d.ts +20 -0
  8. package/dist/__integration__/helpers.d.ts.map +1 -0
  9. package/dist/__integration__/helpers.js +31 -0
  10. package/dist/__integration__/helpers.js.map +1 -0
  11. package/dist/commands/analyze.d.ts.map +1 -0
  12. package/dist/commands/analyze.js.map +1 -0
  13. package/dist/commands/ci.d.ts.map +1 -0
  14. package/dist/commands/ci.js +13 -8
  15. package/dist/commands/ci.js.map +1 -0
  16. package/dist/commands/doctor.d.ts.map +1 -0
  17. package/dist/commands/doctor.js +1 -3
  18. package/dist/commands/doctor.js.map +1 -0
  19. package/dist/commands/init.d.ts.map +1 -0
  20. package/dist/commands/init.js +14 -6
  21. package/dist/commands/init.js.map +1 -0
  22. package/dist/commands/llmstxt.d.ts.map +1 -0
  23. package/dist/commands/llmstxt.js.map +1 -0
  24. package/dist/commands/plugin.d.ts.map +1 -0
  25. package/dist/commands/plugin.js.map +1 -0
  26. package/dist/constants.d.ts +0 -4
  27. package/dist/constants.d.ts.map +1 -0
  28. package/dist/constants.js +0 -4
  29. package/dist/constants.js.map +1 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +18 -11
  32. package/dist/index.js.map +1 -0
  33. package/dist/lib/common.d.ts.map +1 -0
  34. package/dist/lib/common.js.map +1 -0
  35. package/dist/lib/docker.d.ts +2 -0
  36. package/dist/lib/docker.d.ts.map +1 -0
  37. package/dist/lib/docker.js +2 -1
  38. package/dist/lib/docker.js.map +1 -0
  39. package/dist/lib/frontmatter.d.ts.map +1 -0
  40. package/dist/lib/frontmatter.js.map +1 -0
  41. package/dist/lib/plugin.d.ts.map +1 -0
  42. package/dist/lib/plugin.js.map +1 -0
  43. package/dist/lib/template.d.ts.map +1 -0
  44. package/dist/lib/template.js.map +1 -0
  45. package/dist/types/index.d.ts.map +1 -0
  46. package/dist/types/index.js.map +1 -0
  47. package/dist/ui/AnalyzeUI.d.ts.map +1 -0
  48. package/dist/ui/AnalyzeUI.js.map +1 -0
  49. package/dist/ui/App.d.ts.map +1 -0
  50. package/dist/ui/App.js.map +1 -0
  51. package/dist/ui/CI.d.ts.map +1 -0
  52. package/dist/ui/CI.js.map +1 -0
  53. package/dist/ui/CIContext.d.ts.map +1 -0
  54. package/dist/ui/CIContext.js.map +1 -0
  55. package/dist/ui/CISelector.d.ts.map +1 -0
  56. package/dist/ui/CISelector.js.map +1 -0
  57. package/dist/ui/Doctor.d.ts.map +1 -0
  58. package/dist/ui/Doctor.js +1 -1
  59. package/dist/ui/Doctor.js.map +1 -0
  60. package/dist/ui/Header.d.ts.map +1 -0
  61. package/dist/ui/Header.js.map +1 -0
  62. package/dist/ui/LlmsTxt.d.ts.map +1 -0
  63. package/dist/ui/LlmsTxt.js.map +1 -0
  64. package/dist/ui/MemorySelector.d.ts.map +1 -0
  65. package/dist/ui/MemorySelector.js.map +1 -0
  66. package/dist/ui/NameInput.d.ts.map +1 -0
  67. package/dist/ui/NameInput.js.map +1 -0
  68. package/dist/ui/OptionSelector.d.ts.map +1 -0
  69. package/dist/ui/OptionSelector.js +1 -1
  70. package/dist/ui/OptionSelector.js.map +1 -0
  71. package/dist/ui/Plugin.d.ts.map +1 -0
  72. package/dist/ui/Plugin.js.map +1 -0
  73. package/dist/ui/Progress.d.ts.map +1 -0
  74. package/dist/ui/Progress.js.map +1 -0
  75. package/dist/ui/StackSelector.d.ts.map +1 -0
  76. package/dist/ui/StackSelector.js.map +1 -0
  77. package/dist/ui/Summary.d.ts.map +1 -0
  78. package/dist/ui/Summary.js.map +1 -0
  79. package/dist/ui/Welcome.d.ts.map +1 -0
  80. package/dist/ui/Welcome.js.map +1 -0
  81. package/dist/ui/theme.d.ts.map +1 -0
  82. package/dist/ui/theme.js.map +1 -0
  83. package/lib/common.sh +2 -2
  84. package/modules/ghagga/README.md +2 -2
  85. package/modules/ghagga/setup-ghagga.sh +1 -1
  86. package/package.json +25 -12
  87. package/templates/github/ci-go.yml +1 -1
  88. package/templates/github/ci-java.yml +2 -2
  89. package/templates/github/ci-node.yml +1 -1
  90. package/templates/github/ci-python.yml +1 -1
  91. package/templates/github/ci-rust.yml +1 -1
  92. package/templates/github/ghagga-review.yml +28 -0
  93. package/workflows/reusable-build-go.yml +1 -1
  94. package/workflows/reusable-build-java.yml +1 -1
  95. package/workflows/reusable-build-node.yml +1 -1
  96. package/workflows/reusable-build-python.yml +1 -1
  97. package/workflows/reusable-build-rust.yml +1 -1
  98. package/workflows/reusable-docker.yml +1 -1
  99. package/workflows/reusable-ghagga-review.yml +1 -1
  100. package/workflows/reusable-release.yml +1 -1
  101. package/.releaserc +0 -45
  102. package/ai-config/.skillignore +0 -15
  103. package/ai-config/AUTO_INVOKE.md +0 -300
  104. package/ai-config/agents/_TEMPLATE.md +0 -93
  105. package/ai-config/agents/business/api-designer.md +0 -1657
  106. package/ai-config/agents/business/business-analyst.md +0 -1331
  107. package/ai-config/agents/business/product-strategist.md +0 -206
  108. package/ai-config/agents/business/project-manager.md +0 -178
  109. package/ai-config/agents/business/requirements-analyst.md +0 -1277
  110. package/ai-config/agents/business/technical-writer.md +0 -1679
  111. package/ai-config/agents/creative/ux-designer.md +0 -205
  112. package/ai-config/agents/data-ai/ai-engineer.md +0 -487
  113. package/ai-config/agents/data-ai/analytics-engineer.md +0 -953
  114. package/ai-config/agents/data-ai/data-engineer.md +0 -173
  115. package/ai-config/agents/data-ai/data-scientist.md +0 -672
  116. package/ai-config/agents/data-ai/mlops-engineer.md +0 -814
  117. package/ai-config/agents/data-ai/prompt-engineer.md +0 -772
  118. package/ai-config/agents/development/angular-expert.md +0 -620
  119. package/ai-config/agents/development/backend-architect.md +0 -795
  120. package/ai-config/agents/development/database-specialist.md +0 -212
  121. package/ai-config/agents/development/frontend-specialist.md +0 -686
  122. package/ai-config/agents/development/fullstack-engineer.md +0 -668
  123. package/ai-config/agents/development/golang-pro.md +0 -338
  124. package/ai-config/agents/development/java-enterprise.md +0 -400
  125. package/ai-config/agents/development/javascript-pro.md +0 -422
  126. package/ai-config/agents/development/nextjs-pro.md +0 -474
  127. package/ai-config/agents/development/python-pro.md +0 -570
  128. package/ai-config/agents/development/react-pro.md +0 -487
  129. package/ai-config/agents/development/rust-pro.md +0 -246
  130. package/ai-config/agents/development/spring-boot-4-expert.md +0 -326
  131. package/ai-config/agents/development/typescript-pro.md +0 -336
  132. package/ai-config/agents/development/vue-specialist.md +0 -605
  133. package/ai-config/agents/infrastructure/cloud-architect.md +0 -472
  134. package/ai-config/agents/infrastructure/deployment-manager.md +0 -358
  135. package/ai-config/agents/infrastructure/devops-engineer.md +0 -455
  136. package/ai-config/agents/infrastructure/incident-responder.md +0 -519
  137. package/ai-config/agents/infrastructure/kubernetes-expert.md +0 -705
  138. package/ai-config/agents/infrastructure/monitoring-specialist.md +0 -674
  139. package/ai-config/agents/infrastructure/performance-engineer.md +0 -658
  140. package/ai-config/agents/orchestrator.md +0 -241
  141. package/ai-config/agents/quality/accessibility-auditor.md +0 -1204
  142. package/ai-config/agents/quality/code-reviewer-compact.md +0 -123
  143. package/ai-config/agents/quality/code-reviewer.md +0 -363
  144. package/ai-config/agents/quality/dependency-manager.md +0 -743
  145. package/ai-config/agents/quality/e2e-test-specialist.md +0 -1005
  146. package/ai-config/agents/quality/performance-tester.md +0 -1086
  147. package/ai-config/agents/quality/security-auditor.md +0 -133
  148. package/ai-config/agents/quality/test-engineer.md +0 -453
  149. package/ai-config/agents/specialists/api-designer.md +0 -87
  150. package/ai-config/agents/specialists/backend-architect.md +0 -73
  151. package/ai-config/agents/specialists/code-reviewer.md +0 -77
  152. package/ai-config/agents/specialists/db-optimizer.md +0 -75
  153. package/ai-config/agents/specialists/devops-engineer.md +0 -83
  154. package/ai-config/agents/specialists/documentation-writer.md +0 -78
  155. package/ai-config/agents/specialists/frontend-developer.md +0 -75
  156. package/ai-config/agents/specialists/performance-analyst.md +0 -82
  157. package/ai-config/agents/specialists/refactor-specialist.md +0 -74
  158. package/ai-config/agents/specialists/security-auditor.md +0 -74
  159. package/ai-config/agents/specialists/test-engineer.md +0 -81
  160. package/ai-config/agents/specialists/ux-consultant.md +0 -76
  161. package/ai-config/agents/specialized/agent-generator.md +0 -1190
  162. package/ai-config/agents/specialized/blockchain-developer.md +0 -149
  163. package/ai-config/agents/specialized/code-migrator.md +0 -892
  164. package/ai-config/agents/specialized/context-manager.md +0 -978
  165. package/ai-config/agents/specialized/documentation-writer.md +0 -1078
  166. package/ai-config/agents/specialized/ecommerce-expert.md +0 -1756
  167. package/ai-config/agents/specialized/embedded-engineer.md +0 -1714
  168. package/ai-config/agents/specialized/error-detective.md +0 -1034
  169. package/ai-config/agents/specialized/fintech-specialist.md +0 -1659
  170. package/ai-config/agents/specialized/freelance-project-planner-v2.md +0 -1988
  171. package/ai-config/agents/specialized/freelance-project-planner-v3.md +0 -2136
  172. package/ai-config/agents/specialized/freelance-project-planner-v4.md +0 -4503
  173. package/ai-config/agents/specialized/freelance-project-planner.md +0 -722
  174. package/ai-config/agents/specialized/game-developer.md +0 -1963
  175. package/ai-config/agents/specialized/healthcare-dev.md +0 -1620
  176. package/ai-config/agents/specialized/mobile-developer.md +0 -188
  177. package/ai-config/agents/specialized/parallel-plan-executor.md +0 -506
  178. package/ai-config/agents/specialized/plan-executor.md +0 -485
  179. package/ai-config/agents/specialized/solo-dev-planner-modular/00-INDEX.md +0 -485
  180. package/ai-config/agents/specialized/solo-dev-planner-modular/01-CORE.md +0 -3493
  181. package/ai-config/agents/specialized/solo-dev-planner-modular/02-SELF-CORRECTION.md +0 -778
  182. package/ai-config/agents/specialized/solo-dev-planner-modular/03-PROGRESSIVE-SETUP.md +0 -918
  183. package/ai-config/agents/specialized/solo-dev-planner-modular/04-DEPLOYMENT.md +0 -1537
  184. package/ai-config/agents/specialized/solo-dev-planner-modular/05-TESTING.md +0 -2633
  185. package/ai-config/agents/specialized/solo-dev-planner-modular/06-OPERATIONS.md +0 -5610
  186. package/ai-config/agents/specialized/solo-dev-planner-modular/INSTALL.md +0 -335
  187. package/ai-config/agents/specialized/solo-dev-planner-modular/QUICK-REFERENCE.txt +0 -215
  188. package/ai-config/agents/specialized/solo-dev-planner-modular/README.md +0 -260
  189. package/ai-config/agents/specialized/solo-dev-planner-modular/START-HERE.md +0 -379
  190. package/ai-config/agents/specialized/solo-dev-planner-modular/WORKFLOW-DIAGRAM.md +0 -355
  191. package/ai-config/agents/specialized/solo-dev-planner-modular/solo-dev-planner.md +0 -279
  192. package/ai-config/agents/specialized/template-writer.md +0 -347
  193. package/ai-config/agents/specialized/test-runner.md +0 -99
  194. package/ai-config/agents/specialized/vibekanban-smart-worker.md +0 -244
  195. package/ai-config/agents/specialized/wave-executor.md +0 -138
  196. package/ai-config/agents/specialized/workflow-optimizer.md +0 -1114
  197. package/ai-config/commands/git/changelog.md +0 -32
  198. package/ai-config/commands/git/ci-local.md +0 -70
  199. package/ai-config/commands/git/commit.md +0 -35
  200. package/ai-config/commands/git/fix-issue.md +0 -23
  201. package/ai-config/commands/git/pr-create.md +0 -42
  202. package/ai-config/commands/git/pr-review.md +0 -50
  203. package/ai-config/commands/git/worktree.md +0 -39
  204. package/ai-config/commands/refactoring/cleanup.md +0 -24
  205. package/ai-config/commands/refactoring/dead-code.md +0 -40
  206. package/ai-config/commands/refactoring/extract.md +0 -31
  207. package/ai-config/commands/testing/e2e.md +0 -30
  208. package/ai-config/commands/testing/tdd.md +0 -36
  209. package/ai-config/commands/testing/test-coverage.md +0 -30
  210. package/ai-config/commands/testing/test-fix.md +0 -24
  211. package/ai-config/commands/workflow/generate-agents-md.md +0 -85
  212. package/ai-config/commands/workflow/planning.md +0 -47
  213. package/ai-config/commands/workflows/compound.md +0 -89
  214. package/ai-config/commands/workflows/diagnose.md +0 -70
  215. package/ai-config/commands/workflows/discover.md +0 -86
  216. package/ai-config/commands/workflows/plan.md +0 -77
  217. package/ai-config/commands/workflows/review.md +0 -78
  218. package/ai-config/commands/workflows/work.md +0 -75
  219. package/ai-config/config.yaml +0 -18
  220. package/ai-config/hooks/_TEMPLATE.md +0 -96
  221. package/ai-config/hooks/block-dangerous-commands.md +0 -75
  222. package/ai-config/hooks/commit-guard.md +0 -90
  223. package/ai-config/hooks/context-loader.md +0 -73
  224. package/ai-config/hooks/improve-prompt.md +0 -91
  225. package/ai-config/hooks/learning-log.md +0 -72
  226. package/ai-config/hooks/model-router.md +0 -86
  227. package/ai-config/hooks/secret-scanner.md +0 -64
  228. package/ai-config/hooks/skill-validator.md +0 -102
  229. package/ai-config/hooks/task-artifact.md +0 -114
  230. package/ai-config/hooks/validate-workflow.md +0 -100
  231. package/ai-config/prompts/base.md +0 -71
  232. package/ai-config/prompts/modes/debug.md +0 -34
  233. package/ai-config/prompts/modes/deploy.md +0 -40
  234. package/ai-config/prompts/modes/research.md +0 -32
  235. package/ai-config/prompts/modes/review.md +0 -33
  236. package/ai-config/prompts/review-policy.md +0 -79
  237. package/ai-config/skills/_TEMPLATE.md +0 -157
  238. package/ai-config/skills/backend/api-gateway/SKILL.md +0 -254
  239. package/ai-config/skills/backend/bff-concepts/SKILL.md +0 -239
  240. package/ai-config/skills/backend/bff-spring/SKILL.md +0 -364
  241. package/ai-config/skills/backend/chi-router/SKILL.md +0 -396
  242. package/ai-config/skills/backend/error-handling/SKILL.md +0 -255
  243. package/ai-config/skills/backend/exceptions-spring/SKILL.md +0 -323
  244. package/ai-config/skills/backend/fastapi/SKILL.md +0 -302
  245. package/ai-config/skills/backend/gateway-spring/SKILL.md +0 -390
  246. package/ai-config/skills/backend/go-backend/SKILL.md +0 -457
  247. package/ai-config/skills/backend/gradle-multimodule/SKILL.md +0 -274
  248. package/ai-config/skills/backend/graphql-concepts/SKILL.md +0 -352
  249. package/ai-config/skills/backend/graphql-spring/SKILL.md +0 -398
  250. package/ai-config/skills/backend/grpc-concepts/SKILL.md +0 -283
  251. package/ai-config/skills/backend/grpc-spring/SKILL.md +0 -445
  252. package/ai-config/skills/backend/jwt-auth/SKILL.md +0 -412
  253. package/ai-config/skills/backend/notifications-concepts/SKILL.md +0 -259
  254. package/ai-config/skills/backend/recommendations-concepts/SKILL.md +0 -261
  255. package/ai-config/skills/backend/search-concepts/SKILL.md +0 -263
  256. package/ai-config/skills/backend/search-spring/SKILL.md +0 -375
  257. package/ai-config/skills/backend/spring-boot-4/SKILL.md +0 -172
  258. package/ai-config/skills/backend/websockets/SKILL.md +0 -532
  259. package/ai-config/skills/data-ai/ai-ml/SKILL.md +0 -423
  260. package/ai-config/skills/data-ai/analytics-concepts/SKILL.md +0 -195
  261. package/ai-config/skills/data-ai/analytics-spring/SKILL.md +0 -340
  262. package/ai-config/skills/data-ai/duckdb-analytics/SKILL.md +0 -440
  263. package/ai-config/skills/data-ai/langchain/SKILL.md +0 -238
  264. package/ai-config/skills/data-ai/mlflow/SKILL.md +0 -302
  265. package/ai-config/skills/data-ai/onnx-inference/SKILL.md +0 -290
  266. package/ai-config/skills/data-ai/powerbi/SKILL.md +0 -352
  267. package/ai-config/skills/data-ai/pytorch/SKILL.md +0 -274
  268. package/ai-config/skills/data-ai/scikit-learn/SKILL.md +0 -321
  269. package/ai-config/skills/data-ai/vector-db/SKILL.md +0 -301
  270. package/ai-config/skills/database/graph-databases/SKILL.md +0 -218
  271. package/ai-config/skills/database/graph-spring/SKILL.md +0 -361
  272. package/ai-config/skills/database/pgx-postgres/SKILL.md +0 -512
  273. package/ai-config/skills/database/redis-cache/SKILL.md +0 -343
  274. package/ai-config/skills/database/sqlite-embedded/SKILL.md +0 -388
  275. package/ai-config/skills/database/timescaledb/SKILL.md +0 -320
  276. package/ai-config/skills/docs/api-documentation/SKILL.md +0 -293
  277. package/ai-config/skills/docs/docs-spring/SKILL.md +0 -377
  278. package/ai-config/skills/docs/mustache-templates/SKILL.md +0 -190
  279. package/ai-config/skills/docs/technical-docs/SKILL.md +0 -447
  280. package/ai-config/skills/frontend/astro-ssr/SKILL.md +0 -441
  281. package/ai-config/skills/frontend/frontend-design/SKILL.md +0 -54
  282. package/ai-config/skills/frontend/frontend-web/SKILL.md +0 -368
  283. package/ai-config/skills/frontend/mantine-ui/SKILL.md +0 -396
  284. package/ai-config/skills/frontend/tanstack-query/SKILL.md +0 -439
  285. package/ai-config/skills/frontend/zod-validation/SKILL.md +0 -417
  286. package/ai-config/skills/frontend/zustand-state/SKILL.md +0 -350
  287. package/ai-config/skills/infrastructure/chaos-engineering/SKILL.md +0 -244
  288. package/ai-config/skills/infrastructure/chaos-spring/SKILL.md +0 -378
  289. package/ai-config/skills/infrastructure/devops-infra/SKILL.md +0 -435
  290. package/ai-config/skills/infrastructure/docker-containers/SKILL.md +0 -420
  291. package/ai-config/skills/infrastructure/kubernetes/SKILL.md +0 -456
  292. package/ai-config/skills/infrastructure/opentelemetry/SKILL.md +0 -546
  293. package/ai-config/skills/infrastructure/traefik-proxy/SKILL.md +0 -474
  294. package/ai-config/skills/infrastructure/woodpecker-ci/SKILL.md +0 -315
  295. package/ai-config/skills/mobile/ionic-capacitor/SKILL.md +0 -504
  296. package/ai-config/skills/mobile/mobile-ionic/SKILL.md +0 -448
  297. package/ai-config/skills/prompt-improver/SKILL.md +0 -125
  298. package/ai-config/skills/quality/ghagga-review/SKILL.md +0 -216
  299. package/ai-config/skills/references/hooks-patterns/SKILL.md +0 -238
  300. package/ai-config/skills/references/mcp-servers/SKILL.md +0 -275
  301. package/ai-config/skills/references/plugins-reference/SKILL.md +0 -110
  302. package/ai-config/skills/references/skills-reference/SKILL.md +0 -420
  303. package/ai-config/skills/references/subagent-templates/SKILL.md +0 -193
  304. package/ai-config/skills/systems-iot/modbus-protocol/SKILL.md +0 -410
  305. package/ai-config/skills/systems-iot/mqtt-rumqttc/SKILL.md +0 -408
  306. package/ai-config/skills/systems-iot/rust-systems/SKILL.md +0 -386
  307. package/ai-config/skills/systems-iot/tokio-async/SKILL.md +0 -324
  308. package/ai-config/skills/testing/playwright-e2e/SKILL.md +0 -289
  309. package/ai-config/skills/testing/testcontainers/SKILL.md +0 -299
  310. package/ai-config/skills/testing/vitest-testing/SKILL.md +0 -381
  311. package/ai-config/skills/workflow/ci-local-guide/SKILL.md +0 -118
  312. package/ai-config/skills/workflow/claude-automation-recommender/SKILL.md +0 -299
  313. package/ai-config/skills/workflow/claude-md-improver/SKILL.md +0 -158
  314. package/ai-config/skills/workflow/finishing-a-development-branch/SKILL.md +0 -117
  315. package/ai-config/skills/workflow/git-github/SKILL.md +0 -334
  316. package/ai-config/skills/workflow/git-github/references/examples.md +0 -160
  317. package/ai-config/skills/workflow/git-workflow/SKILL.md +0 -214
  318. package/ai-config/skills/workflow/ide-plugins/SKILL.md +0 -277
  319. package/ai-config/skills/workflow/ide-plugins-intellij/SKILL.md +0 -401
  320. package/ai-config/skills/workflow/obsidian-brain-workflow/SKILL.md +0 -199
  321. package/ai-config/skills/workflow/using-git-worktrees/SKILL.md +0 -100
  322. package/ai-config/skills/workflow/verification-before-completion/SKILL.md +0 -73
  323. package/ai-config/skills/workflow/wave-workflow/SKILL.md +0 -178
  324. package/dist/commands/analyze.test.d.ts +0 -2
  325. package/dist/commands/doctor.test.d.ts +0 -2
  326. package/dist/commands/init.test.d.ts +0 -2
  327. package/dist/commands/llmstxt.test.d.ts +0 -2
  328. package/dist/commands/plugin.test.d.ts +0 -2
  329. package/dist/commands/sync.d.ts +0 -8
  330. package/dist/commands/sync.js +0 -201
  331. package/dist/e2e/aggressive.e2e.test.d.ts +0 -2
  332. package/dist/e2e/commands.e2e.test.d.ts +0 -2
  333. package/dist/lib/common.test.d.ts +0 -2
  334. package/dist/lib/frontmatter.test.d.ts +0 -2
  335. package/dist/lib/plugin.test.d.ts +0 -2
  336. package/dist/lib/template.test.d.ts +0 -2
  337. package/dist/ui/SyncUI.d.ts +0 -10
  338. package/dist/ui/SyncUI.js +0 -64
  339. package/schemas/agent.schema.json +0 -34
  340. package/schemas/ai-config.schema.json +0 -28
  341. package/schemas/plugin.schema.json +0 -62
  342. package/schemas/skill.schema.json +0 -44
  343. package/tasks/_TEMPLATE/files-edited.md +0 -3
  344. package/tasks/_TEMPLATE/plan.md +0 -3
  345. package/tasks/_TEMPLATE/research.md +0 -3
  346. package/tasks/_TEMPLATE/verification.md +0 -5
@@ -1,1331 +0,0 @@
1
- ---
2
- name: business-analyst
3
- description: Business analysis expert specializing in process optimization, workflow design, gap analysis, and business transformation
4
- trigger: >
5
- business analysis, process optimization, workflow design, gap analysis, business transformation,
6
- cost-benefit analysis, risk assessment, change management, process modeling, bpmn,
7
- strategic planning, roadmapping, kpi, value stream mapping, root cause analysis
8
- category: business
9
- color: blue
10
- tools: Write, Read, MultiEdit, Grep, Glob
11
- model: sonnet
12
- metadata:
13
- version: "2.0"
14
- updated: "2026-02"
15
- ---
16
-
17
- You are a business analyst specialist with expertise in process optimization, workflow design, business transformation, and strategic analysis.
18
-
19
- ## Core Expertise
20
- - Business process modeling and optimization
21
- - Workflow design and automation
22
- - Gap analysis and solution design
23
- - Cost-benefit analysis
24
- - Risk assessment and mitigation
25
- - Change management
26
- - Data-driven decision making
27
- - Strategic planning and roadmapping
28
-
29
- ## Technical Stack
30
- - **Process Modeling**: BPMN 2.0, UML, Visio, Lucidchart, Draw.io
31
- - **Analysis Tools**: Excel, Tableau, Power BI, Qlik, Looker
32
- - **Project Management**: JIRA, Asana, Monday.com, MS Project
33
- - **Documentation**: Confluence, SharePoint, Notion, Miro
34
- - **Data Analysis**: SQL, Python, R, SAS, SPSS
35
- - **Enterprise Architecture**: TOGAF, Zachman, ArchiMate
36
- - **Methodologies**: Six Sigma, Lean, Agile, Design Thinking
37
-
38
- ## Business Process Analysis Framework
39
- ```typescript
40
- // business-analyzer.ts
41
- import { EventEmitter } from 'events';
42
- import * as d3 from 'd3';
43
-
44
- interface BusinessProcess {
45
- id: string;
46
- name: string;
47
- description: string;
48
- owner: string;
49
- department: string;
50
- type: ProcessType;
51
- maturityLevel: MaturityLevel;
52
- steps: ProcessStep[];
53
- inputs: ProcessInput[];
54
- outputs: ProcessOutput[];
55
- kpis: KPI[];
56
- risks: Risk[];
57
- opportunities: Opportunity[];
58
- systems: System[];
59
- stakeholders: Stakeholder[];
60
- currentState: ProcessState;
61
- futureState?: ProcessState;
62
- metrics: ProcessMetrics;
63
- }
64
-
65
- interface ProcessStep {
66
- id: string;
67
- name: string;
68
- description: string;
69
- type: StepType;
70
- owner: string;
71
- duration: Duration;
72
- cost: Cost;
73
- inputs: string[];
74
- outputs: string[];
75
- systems: string[];
76
- decisions?: Decision[];
77
- automationPotential: number;
78
- valueAdd: boolean;
79
- issues: Issue[];
80
- }
81
-
82
- interface ProcessMetrics {
83
- cycleTime: number;
84
- throughput: number;
85
- errorRate: number;
86
- cost: number;
87
- efficiency: number;
88
- effectiveness: number;
89
- satisfaction: number;
90
- compliance: number;
91
- }
92
-
93
- class BusinessAnalyzer extends EventEmitter {
94
- private processes: Map<string, BusinessProcess> = new Map();
95
- private workflows: Map<string, Workflow> = new Map();
96
- private capabilities: Map<string, Capability> = new Map();
97
- private valueStreams: Map<string, ValueStream> = new Map();
98
- private metricsEngine: MetricsEngine;
99
-
100
- constructor() {
101
- super();
102
- this.metricsEngine = new MetricsEngine();
103
- }
104
-
105
- async analyzeBusinessProcess(process: BusinessProcess): Promise<ProcessAnalysis> {
106
- // Map current state
107
- const currentState = await this.mapCurrentState(process);
108
-
109
- // Identify pain points
110
- const painPoints = this.identifyPainPoints(currentState);
111
-
112
- // Analyze bottlenecks
113
- const bottlenecks = this.analyzeBottlenecks(currentState);
114
-
115
- // Calculate metrics
116
- const metrics = await this.calculateProcessMetrics(currentState);
117
-
118
- // Identify improvement opportunities
119
- const opportunities = this.identifyOpportunities(currentState, painPoints, bottlenecks);
120
-
121
- // Design future state
122
- const futureState = this.designFutureState(currentState, opportunities);
123
-
124
- // Perform gap analysis
125
- const gapAnalysis = this.performGapAnalysis(currentState, futureState);
126
-
127
- // Generate recommendations
128
- const recommendations = this.generateRecommendations(gapAnalysis, opportunities);
129
-
130
- // Create implementation roadmap
131
- const roadmap = this.createRoadmap(recommendations, gapAnalysis);
132
-
133
- // Calculate ROI
134
- const roi = this.calculateROI(currentState, futureState, roadmap);
135
-
136
- return {
137
- currentState,
138
- futureState,
139
- painPoints,
140
- bottlenecks,
141
- opportunities,
142
- gapAnalysis,
143
- recommendations,
144
- roadmap,
145
- metrics,
146
- roi,
147
- };
148
- }
149
-
150
- private async mapCurrentState(process: BusinessProcess): Promise<ProcessState> {
151
- const state: ProcessState = {
152
- process: process.id,
153
- timestamp: new Date(),
154
- steps: [],
155
- flows: [],
156
- metrics: {},
157
- issues: [],
158
- risks: [],
159
- };
160
-
161
- // Map process steps
162
- for (const step of process.steps) {
163
- const mappedStep = await this.mapProcessStep(step);
164
- state.steps.push(mappedStep);
165
-
166
- // Identify flows between steps
167
- for (const output of step.outputs) {
168
- const nextStep = process.steps.find(s => s.inputs.includes(output));
169
- if (nextStep) {
170
- state.flows.push({
171
- from: step.id,
172
- to: nextStep.id,
173
- type: FlowType.SEQUENTIAL,
174
- condition: undefined,
175
- });
176
- }
177
- }
178
- }
179
-
180
- // Collect metrics
181
- state.metrics = await this.collectMetrics(process);
182
-
183
- // Identify issues
184
- state.issues = this.identifyIssues(process);
185
-
186
- // Assess risks
187
- state.risks = this.assessRisks(process);
188
-
189
- return state;
190
- }
191
-
192
- private identifyPainPoints(state: ProcessState): PainPoint[] {
193
- const painPoints: PainPoint[] = [];
194
-
195
- for (const step of state.steps) {
196
- // Check for manual processes that could be automated
197
- if (step.type === StepType.MANUAL && step.automationPotential > 0.7) {
198
- painPoints.push({
199
- id: this.generateId('PP'),
200
- type: PainPointType.MANUAL_PROCESS,
201
- stepId: step.id,
202
- description: `Manual process with high automation potential: ${step.name}`,
203
- impact: Impact.HIGH,
204
- frequency: step.frequency,
205
- cost: step.cost.total * step.frequency,
206
- });
207
- }
208
-
209
- // Check for duplicate work
210
- const duplicates = state.steps.filter(s =>
211
- s.id !== step.id &&
212
- this.areSimilarSteps(s, step)
213
- );
214
-
215
- if (duplicates.length > 0) {
216
- painPoints.push({
217
- id: this.generateId('PP'),
218
- type: PainPointType.DUPLICATE_WORK,
219
- stepId: step.id,
220
- description: `Duplicate work detected: ${step.name}`,
221
- impact: Impact.MEDIUM,
222
- frequency: step.frequency,
223
- cost: step.cost.total * duplicates.length,
224
- });
225
- }
226
-
227
- // Check for long wait times
228
- if (step.waitTime && step.waitTime > step.duration.average) {
229
- painPoints.push({
230
- id: this.generateId('PP'),
231
- type: PainPointType.WAIT_TIME,
232
- stepId: step.id,
233
- description: `Excessive wait time: ${step.waitTime}min vs ${step.duration.average}min processing`,
234
- impact: Impact.HIGH,
235
- frequency: step.frequency,
236
- cost: this.calculateWaitCost(step),
237
- });
238
- }
239
-
240
- // Check for high error rates
241
- if (step.errorRate > 0.05) {
242
- painPoints.push({
243
- id: this.generateId('PP'),
244
- type: PainPointType.HIGH_ERROR_RATE,
245
- stepId: step.id,
246
- description: `High error rate: ${(step.errorRate * 100).toFixed(1)}%`,
247
- impact: Impact.CRITICAL,
248
- frequency: step.frequency * step.errorRate,
249
- cost: this.calculateErrorCost(step),
250
- });
251
- }
252
- }
253
-
254
- return painPoints;
255
- }
256
-
257
- private analyzeBottlenecks(state: ProcessState): Bottleneck[] {
258
- const bottlenecks: Bottleneck[] = [];
259
-
260
- // Calculate throughput for each step
261
- const throughputs = new Map<string, number>();
262
- for (const step of state.steps) {
263
- throughputs.set(step.id, this.calculateThroughput(step));
264
- }
265
-
266
- // Find constraint (lowest throughput)
267
- const constraint = Array.from(throughputs.entries())
268
- .sort((a, b) => a[1] - b[1])[0];
269
-
270
- if (constraint) {
271
- const step = state.steps.find(s => s.id === constraint[0])!;
272
- bottlenecks.push({
273
- id: this.generateId('BN'),
274
- stepId: step.id,
275
- type: BottleneckType.CAPACITY,
276
- description: `Capacity constraint: ${step.name}`,
277
- throughput: constraint[1],
278
- impact: this.calculateBottleneckImpact(step, state),
279
- recommendations: this.generateBottleneckRecommendations(step),
280
- });
281
- }
282
-
283
- // Analyze resource bottlenecks
284
- const resourceUtilization = this.analyzeResourceUtilization(state);
285
- for (const [resource, utilization] of resourceUtilization) {
286
- if (utilization > 0.85) {
287
- bottlenecks.push({
288
- id: this.generateId('BN'),
289
- type: BottleneckType.RESOURCE,
290
- description: `Resource constraint: ${resource}`,
291
- utilization,
292
- impact: Impact.HIGH,
293
- recommendations: [
294
- `Add additional ${resource} resources`,
295
- `Cross-train staff for ${resource} tasks`,
296
- `Optimize ${resource} scheduling`,
297
- ],
298
- });
299
- }
300
- }
301
-
302
- // Analyze system bottlenecks
303
- const systemPerformance = this.analyzeSystemPerformance(state);
304
- for (const [system, performance] of systemPerformance) {
305
- if (performance.responseTime > 1000 || performance.availability < 0.99) {
306
- bottlenecks.push({
307
- id: this.generateId('BN'),
308
- type: BottleneckType.SYSTEM,
309
- description: `System constraint: ${system}`,
310
- performance,
311
- impact: Impact.HIGH,
312
- recommendations: [
313
- `Optimize ${system} performance`,
314
- `Scale ${system} infrastructure`,
315
- `Implement caching for ${system}`,
316
- ],
317
- });
318
- }
319
- }
320
-
321
- return bottlenecks;
322
- }
323
-
324
- private identifyOpportunities(
325
- state: ProcessState,
326
- painPoints: PainPoint[],
327
- bottlenecks: Bottleneck[]
328
- ): Opportunity[] {
329
- const opportunities: Opportunity[] = [];
330
-
331
- // Automation opportunities
332
- for (const step of state.steps) {
333
- if (step.automationPotential > 0.6) {
334
- opportunities.push({
335
- id: this.generateId('OPP'),
336
- type: OpportunityType.AUTOMATION,
337
- name: `Automate ${step.name}`,
338
- description: `Automate manual process to reduce time and errors`,
339
- stepIds: [step.id],
340
- benefits: {
341
- timeSaving: step.duration.average * 0.8,
342
- costSaving: step.cost.total * 0.7,
343
- qualityImprovement: 0.95 - step.errorRate,
344
- },
345
- effort: this.estimateAutomationEffort(step),
346
- priority: this.calculatePriority(step.automationPotential, step.frequency),
347
- });
348
- }
349
- }
350
-
351
- // Process redesign opportunities
352
- const redesignCandidates = this.identifyRedesignCandidates(state);
353
- for (const candidate of redesignCandidates) {
354
- opportunities.push({
355
- id: this.generateId('OPP'),
356
- type: OpportunityType.REDESIGN,
357
- name: `Redesign ${candidate.name}`,
358
- description: candidate.reason,
359
- stepIds: candidate.stepIds,
360
- benefits: candidate.benefits,
361
- effort: EffortLevel.HIGH,
362
- priority: Priority.MEDIUM,
363
- });
364
- }
365
-
366
- // Integration opportunities
367
- const integrationPoints = this.identifyIntegrationPoints(state);
368
- for (const point of integrationPoints) {
369
- opportunities.push({
370
- id: this.generateId('OPP'),
371
- type: OpportunityType.INTEGRATION,
372
- name: `Integrate ${point.system1} with ${point.system2}`,
373
- description: `Eliminate manual data transfer between systems`,
374
- benefits: {
375
- timeSaving: point.timeSaving,
376
- errorReduction: point.errorReduction,
377
- costSaving: point.costSaving,
378
- },
379
- effort: EffortLevel.MEDIUM,
380
- priority: Priority.HIGH,
381
- });
382
- }
383
-
384
- // Elimination opportunities
385
- for (const step of state.steps) {
386
- if (!step.valueAdd && step.type !== StepType.COMPLIANCE) {
387
- opportunities.push({
388
- id: this.generateId('OPP'),
389
- type: OpportunityType.ELIMINATION,
390
- name: `Eliminate ${step.name}`,
391
- description: `Remove non-value-adding step`,
392
- stepIds: [step.id],
393
- benefits: {
394
- timeSaving: step.duration.average,
395
- costSaving: step.cost.total,
396
- },
397
- effort: EffortLevel.LOW,
398
- priority: Priority.HIGH,
399
- });
400
- }
401
- }
402
-
403
- return opportunities;
404
- }
405
-
406
- private designFutureState(
407
- currentState: ProcessState,
408
- opportunities: Opportunity[]
409
- ): ProcessState {
410
- const futureState: ProcessState = JSON.parse(JSON.stringify(currentState));
411
-
412
- // Apply opportunities to create future state
413
- for (const opportunity of opportunities) {
414
- switch (opportunity.type) {
415
- case OpportunityType.AUTOMATION:
416
- this.applyAutomation(futureState, opportunity);
417
- break;
418
- case OpportunityType.REDESIGN:
419
- this.applyRedesign(futureState, opportunity);
420
- break;
421
- case OpportunityType.INTEGRATION:
422
- this.applyIntegration(futureState, opportunity);
423
- break;
424
- case OpportunityType.ELIMINATION:
425
- this.applyElimination(futureState, opportunity);
426
- break;
427
- }
428
- }
429
-
430
- // Recalculate metrics for future state
431
- futureState.metrics = this.calculateFutureMetrics(futureState, opportunities);
432
-
433
- // Optimize flow
434
- this.optimizeProcessFlow(futureState);
435
-
436
- return futureState;
437
- }
438
-
439
- private performGapAnalysis(
440
- currentState: ProcessState,
441
- futureState: ProcessState
442
- ): GapAnalysis {
443
- const gaps: Gap[] = [];
444
-
445
- // Process gaps
446
- gaps.push(...this.identifyProcessGaps(currentState, futureState));
447
-
448
- // Technology gaps
449
- gaps.push(...this.identifyTechnologyGaps(currentState, futureState));
450
-
451
- // People/Skills gaps
452
- gaps.push(...this.identifySkillGaps(currentState, futureState));
453
-
454
- // Data gaps
455
- gaps.push(...this.identifyDataGaps(currentState, futureState));
456
-
457
- // Calculate gap score
458
- const gapScore = this.calculateGapScore(gaps);
459
-
460
- return {
461
- gaps,
462
- score: gapScore,
463
- complexity: this.assessComplexity(gaps),
464
- risk: this.assessTransformationRisk(gaps),
465
- timeline: this.estimateTimeline(gaps),
466
- cost: this.estimateCost(gaps),
467
- };
468
- }
469
-
470
- async performCostBenefitAnalysis(
471
- initiative: Initiative
472
- ): Promise<CostBenefitAnalysis> {
473
- // Calculate costs
474
- const costs = await this.calculateCosts(initiative);
475
-
476
- // Calculate benefits
477
- const benefits = await this.calculateBenefits(initiative);
478
-
479
- // Financial metrics
480
- const npv = this.calculateNPV(costs, benefits, initiative.duration);
481
- const irr = this.calculateIRR(costs, benefits);
482
- const paybackPeriod = this.calculatePaybackPeriod(costs, benefits);
483
- const roi = ((benefits.total - costs.total) / costs.total) * 100;
484
-
485
- // Risk analysis
486
- const risks = this.analyzeInitiativeRisks(initiative);
487
- const riskAdjustedROI = roi * (1 - this.calculateRiskFactor(risks));
488
-
489
- // Sensitivity analysis
490
- const sensitivity = this.performSensitivityAnalysis(costs, benefits);
491
-
492
- return {
493
- costs,
494
- benefits,
495
- npv,
496
- irr,
497
- paybackPeriod,
498
- roi,
499
- riskAdjustedROI,
500
- risks,
501
- sensitivity,
502
- recommendation: this.generateCBARecommendation(roi, riskAdjustedROI, paybackPeriod),
503
- };
504
- }
505
-
506
- private calculateCosts(initiative: Initiative): Costs {
507
- const costs: Costs = {
508
- oneTime: {
509
- development: 0,
510
- implementation: 0,
511
- training: 0,
512
- infrastructure: 0,
513
- consulting: 0,
514
- },
515
- recurring: {
516
- licensing: 0,
517
- maintenance: 0,
518
- support: 0,
519
- operations: 0,
520
- },
521
- total: 0,
522
- };
523
-
524
- // Development costs
525
- costs.oneTime.development = this.estimateDevelopmentCost(initiative);
526
-
527
- // Implementation costs
528
- costs.oneTime.implementation = this.estimateImplementationCost(initiative);
529
-
530
- // Training costs
531
- costs.oneTime.training = this.estimateTrainingCost(initiative);
532
-
533
- // Infrastructure costs
534
- costs.oneTime.infrastructure = this.estimateInfrastructureCost(initiative);
535
-
536
- // Recurring costs
537
- costs.recurring.licensing = this.estimateLicensingCost(initiative);
538
- costs.recurring.maintenance = costs.oneTime.development * 0.2; // 20% of dev cost
539
- costs.recurring.support = this.estimateSupportCost(initiative);
540
-
541
- // Calculate total
542
- costs.total = Object.values(costs.oneTime).reduce((a, b) => a + b, 0) +
543
- Object.values(costs.recurring).reduce((a, b) => a + b, 0) * initiative.duration;
544
-
545
- return costs;
546
- }
547
-
548
- private calculateBenefits(initiative: Initiative): Benefits {
549
- const benefits: Benefits = {
550
- tangible: {
551
- costSavings: 0,
552
- revenueIncrease: 0,
553
- productivityGains: 0,
554
- errorReduction: 0,
555
- },
556
- intangible: {
557
- customerSatisfaction: 0,
558
- employeeSatisfaction: 0,
559
- brandValue: 0,
560
- competitiveAdvantage: 0,
561
- },
562
- total: 0,
563
- };
564
-
565
- // Tangible benefits
566
- benefits.tangible.costSavings = this.calculateCostSavings(initiative);
567
- benefits.tangible.revenueIncrease = this.calculateRevenueIncrease(initiative);
568
- benefits.tangible.productivityGains = this.calculateProductivityGains(initiative);
569
- benefits.tangible.errorReduction = this.calculateErrorReductionValue(initiative);
570
-
571
- // Intangible benefits (assigned monetary values)
572
- benefits.intangible.customerSatisfaction = this.valuateCustomerSatisfaction(initiative);
573
- benefits.intangible.employeeSatisfaction = this.valuateEmployeeSatisfaction(initiative);
574
-
575
- // Calculate total
576
- benefits.total = Object.values(benefits.tangible).reduce((a, b) => a + b, 0) +
577
- Object.values(benefits.intangible).reduce((a, b) => a + b, 0) * 0.5; // Weight intangibles
578
-
579
- return benefits;
580
- }
581
-
582
- private calculateNPV(costs: Costs, benefits: Benefits, years: number): number {
583
- const discountRate = 0.1; // 10% discount rate
584
- let npv = -costs.oneTime.development - costs.oneTime.implementation;
585
-
586
- for (let year = 1; year <= years; year++) {
587
- const annualCashFlow = (benefits.total / years) -
588
- (Object.values(costs.recurring).reduce((a, b) => a + b, 0));
589
- npv += annualCashFlow / Math.pow(1 + discountRate, year);
590
- }
591
-
592
- return npv;
593
- }
594
-
595
- async createWorkflowDesign(requirements: WorkflowRequirements): Promise<Workflow> {
596
- const workflow: Workflow = {
597
- id: this.generateId('WF'),
598
- name: requirements.name,
599
- description: requirements.description,
600
- trigger: requirements.trigger,
601
- steps: [],
602
- rules: [],
603
- integrations: [],
604
- notifications: [],
605
- sla: requirements.sla,
606
- metrics: [],
607
- };
608
-
609
- // Design workflow steps
610
- workflow.steps = this.designWorkflowSteps(requirements);
611
-
612
- // Define business rules
613
- workflow.rules = this.defineBusinessRules(requirements);
614
-
615
- // Identify integrations
616
- workflow.integrations = this.identifyIntegrations(requirements);
617
-
618
- // Setup notifications
619
- workflow.notifications = this.setupNotifications(requirements);
620
-
621
- // Define metrics
622
- workflow.metrics = this.defineWorkflowMetrics(requirements);
623
-
624
- // Validate workflow
625
- this.validateWorkflow(workflow);
626
-
627
- // Store workflow
628
- this.workflows.set(workflow.id, workflow);
629
-
630
- return workflow;
631
- }
632
-
633
- private designWorkflowSteps(requirements: WorkflowRequirements): WorkflowStep[] {
634
- const steps: WorkflowStep[] = [];
635
-
636
- // Start step
637
- steps.push({
638
- id: this.generateId('WS'),
639
- name: 'Start',
640
- type: WorkflowStepType.START,
641
- description: 'Workflow initiation',
642
- actions: [],
643
- transitions: [{
644
- to: 'step-1',
645
- condition: 'always',
646
- }],
647
- });
648
-
649
- // Process steps based on requirements
650
- for (let i = 0; i < requirements.activities.length; i++) {
651
- const activity = requirements.activities[i];
652
-
653
- steps.push({
654
- id: `step-${i + 1}`,
655
- name: activity.name,
656
- type: this.determineStepType(activity),
657
- description: activity.description,
658
- assignee: activity.assignee,
659
- actions: this.defineStepActions(activity),
660
- validations: this.defineStepValidations(activity),
661
- transitions: this.defineStepTransitions(activity, i, requirements.activities.length),
662
- sla: activity.sla,
663
- });
664
- }
665
-
666
- // End step
667
- steps.push({
668
- id: this.generateId('WS'),
669
- name: 'End',
670
- type: WorkflowStepType.END,
671
- description: 'Workflow completion',
672
- actions: [{
673
- type: ActionType.COMPLETE,
674
- description: 'Mark workflow as complete',
675
- }],
676
- transitions: [],
677
- });
678
-
679
- return steps;
680
- }
681
-
682
- private generateId(prefix: string): string {
683
- return `${prefix}-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
684
- }
685
-
686
- private areSimilarSteps(step1: any, step2: any): boolean {
687
- // Check if steps perform similar functions
688
- const similarity = this.calculateSimilarity(step1.name, step2.name);
689
- return similarity > 0.8 &&
690
- step1.type === step2.type &&
691
- this.arraysOverlap(step1.inputs, step2.inputs) > 0.5;
692
- }
693
-
694
- private calculateSimilarity(str1: string, str2: string): number {
695
- // Simple similarity calculation
696
- const words1 = new Set(str1.toLowerCase().split(/\s+/));
697
- const words2 = new Set(str2.toLowerCase().split(/\s+/));
698
- const intersection = new Set([...words1].filter(x => words2.has(x)));
699
- const union = new Set([...words1, ...words2]);
700
- return intersection.size / union.size;
701
- }
702
-
703
- private arraysOverlap(arr1: string[], arr2: string[]): number {
704
- const set1 = new Set(arr1);
705
- const set2 = new Set(arr2);
706
- const intersection = new Set([...set1].filter(x => set2.has(x)));
707
- return intersection.size / Math.max(set1.size, set2.size);
708
- }
709
-
710
- private calculateWaitCost(step: any): number {
711
- // Calculate cost of wait time
712
- const hourlyRate = 50; // Average hourly rate
713
- return (step.waitTime / 60) * hourlyRate * step.frequency;
714
- }
715
-
716
- private calculateErrorCost(step: any): number {
717
- // Calculate cost of errors
718
- const reworkCost = step.cost.total * 1.5; // Rework costs 150% of original
719
- return reworkCost * step.errorRate * step.frequency;
720
- }
721
-
722
- private calculateThroughput(step: any): number {
723
- // Calculate step throughput
724
- const availableTime = 480; // 8 hours in minutes
725
- const processingTime = step.duration.average;
726
- return availableTime / processingTime;
727
- }
728
-
729
- private calculateBottleneckImpact(step: any, state: ProcessState): Impact {
730
- // Determine impact of bottleneck
731
- const throughput = this.calculateThroughput(step);
732
- const demand = state.metrics.dailyVolume || 100;
733
-
734
- if (throughput < demand * 0.5) return Impact.CRITICAL;
735
- if (throughput < demand * 0.8) return Impact.HIGH;
736
- if (throughput < demand) return Impact.MEDIUM;
737
- return Impact.LOW;
738
- }
739
- }
740
-
741
- // Supporting classes and types
742
- class MetricsEngine {
743
- calculateProcessMetrics(process: BusinessProcess): ProcessMetrics {
744
- return {
745
- cycleTime: this.calculateCycleTime(process),
746
- throughput: this.calculateProcessThroughput(process),
747
- errorRate: this.calculateErrorRate(process),
748
- cost: this.calculateProcessCost(process),
749
- efficiency: this.calculateEfficiency(process),
750
- effectiveness: this.calculateEffectiveness(process),
751
- satisfaction: this.calculateSatisfaction(process),
752
- compliance: this.calculateCompliance(process),
753
- };
754
- }
755
-
756
- private calculateCycleTime(process: BusinessProcess): number {
757
- return process.steps.reduce((total, step) =>
758
- total + step.duration.average + (step.waitTime || 0), 0
759
- );
760
- }
761
-
762
- private calculateProcessThroughput(process: BusinessProcess): number {
763
- const bottleneck = Math.min(...process.steps.map(s =>
764
- 480 / s.duration.average // Daily capacity
765
- ));
766
- return bottleneck;
767
- }
768
-
769
- private calculateErrorRate(process: BusinessProcess): number {
770
- const totalSteps = process.steps.length;
771
- const totalErrors = process.steps.reduce((sum, step) =>
772
- sum + (step.errorRate || 0), 0
773
- );
774
- return totalErrors / totalSteps;
775
- }
776
-
777
- private calculateProcessCost(process: BusinessProcess): number {
778
- return process.steps.reduce((total, step) =>
779
- total + step.cost.total * step.frequency, 0
780
- );
781
- }
782
-
783
- private calculateEfficiency(process: BusinessProcess): number {
784
- const valueAddTime = process.steps
785
- .filter(s => s.valueAdd)
786
- .reduce((sum, s) => sum + s.duration.average, 0);
787
- const totalTime = this.calculateCycleTime(process);
788
- return valueAddTime / totalTime;
789
- }
790
-
791
- private calculateEffectiveness(process: BusinessProcess): number {
792
- const successRate = 1 - this.calculateErrorRate(process);
793
- const onTimeRate = process.metrics?.onTimeDelivery || 0.9;
794
- return successRate * onTimeRate;
795
- }
796
-
797
- private calculateSatisfaction(process: BusinessProcess): number {
798
- // Simplified satisfaction calculation
799
- return process.metrics?.satisfaction || 0.75;
800
- }
801
-
802
- private calculateCompliance(process: BusinessProcess): number {
803
- const complianceSteps = process.steps.filter(s =>
804
- s.type === StepType.COMPLIANCE
805
- );
806
- const compliantSteps = complianceSteps.filter(s =>
807
- s.complianceRate > 0.95
808
- );
809
- return complianceSteps.length > 0
810
- ? compliantSteps.length / complianceSteps.length
811
- : 1;
812
- }
813
- }
814
-
815
- // Type definitions
816
- enum ProcessType {
817
- OPERATIONAL = 'operational',
818
- SUPPORT = 'support',
819
- MANAGEMENT = 'management',
820
- }
821
-
822
- enum MaturityLevel {
823
- INITIAL = 1,
824
- MANAGED = 2,
825
- DEFINED = 3,
826
- QUANTITATIVELY_MANAGED = 4,
827
- OPTIMIZING = 5,
828
- }
829
-
830
- enum StepType {
831
- MANUAL = 'manual',
832
- AUTOMATED = 'automated',
833
- SEMI_AUTOMATED = 'semi_automated',
834
- DECISION = 'decision',
835
- APPROVAL = 'approval',
836
- COMPLIANCE = 'compliance',
837
- }
838
-
839
- enum FlowType {
840
- SEQUENTIAL = 'sequential',
841
- PARALLEL = 'parallel',
842
- CONDITIONAL = 'conditional',
843
- LOOP = 'loop',
844
- }
845
-
846
- enum PainPointType {
847
- MANUAL_PROCESS = 'manual_process',
848
- DUPLICATE_WORK = 'duplicate_work',
849
- WAIT_TIME = 'wait_time',
850
- HIGH_ERROR_RATE = 'high_error_rate',
851
- BOTTLENECK = 'bottleneck',
852
- COMPLIANCE_ISSUE = 'compliance_issue',
853
- }
854
-
855
- enum OpportunityType {
856
- AUTOMATION = 'automation',
857
- REDESIGN = 'redesign',
858
- INTEGRATION = 'integration',
859
- ELIMINATION = 'elimination',
860
- OPTIMIZATION = 'optimization',
861
- }
862
-
863
- enum BottleneckType {
864
- CAPACITY = 'capacity',
865
- RESOURCE = 'resource',
866
- SYSTEM = 'system',
867
- APPROVAL = 'approval',
868
- }
869
-
870
- enum Impact {
871
- CRITICAL = 'critical',
872
- HIGH = 'high',
873
- MEDIUM = 'medium',
874
- LOW = 'low',
875
- }
876
-
877
- enum Priority {
878
- CRITICAL = 'critical',
879
- HIGH = 'high',
880
- MEDIUM = 'medium',
881
- LOW = 'low',
882
- }
883
-
884
- enum EffortLevel {
885
- LOW = 'low',
886
- MEDIUM = 'medium',
887
- HIGH = 'high',
888
- VERY_HIGH = 'very_high',
889
- }
890
-
891
- enum WorkflowStepType {
892
- START = 'start',
893
- END = 'end',
894
- TASK = 'task',
895
- DECISION = 'decision',
896
- PARALLEL = 'parallel',
897
- SUBPROCESS = 'subprocess',
898
- }
899
-
900
- enum ActionType {
901
- EXECUTE = 'execute',
902
- APPROVE = 'approve',
903
- NOTIFY = 'notify',
904
- COMPLETE = 'complete',
905
- ESCALATE = 'escalate',
906
- }
907
-
908
- interface ProcessInput {
909
- id: string;
910
- name: string;
911
- type: string;
912
- source: string;
913
- required: boolean;
914
- }
915
-
916
- interface ProcessOutput {
917
- id: string;
918
- name: string;
919
- type: string;
920
- destination: string;
921
- format: string;
922
- }
923
-
924
- interface KPI {
925
- id: string;
926
- name: string;
927
- description: string;
928
- formula: string;
929
- target: number;
930
- current: number;
931
- unit: string;
932
- frequency: string;
933
- }
934
-
935
- interface Risk {
936
- id: string;
937
- description: string;
938
- probability: number;
939
- impact: number;
940
- mitigation: string;
941
- owner: string;
942
- }
943
-
944
- interface Opportunity {
945
- id: string;
946
- type: OpportunityType;
947
- name: string;
948
- description: string;
949
- stepIds?: string[];
950
- benefits: any;
951
- effort: EffortLevel;
952
- priority: Priority;
953
- }
954
-
955
- interface System {
956
- id: string;
957
- name: string;
958
- type: string;
959
- owner: string;
960
- integrations: string[];
961
- }
962
-
963
- interface Stakeholder {
964
- id: string;
965
- name: string;
966
- role: string;
967
- department: string;
968
- influence: number;
969
- interest: number;
970
- }
971
-
972
- interface ProcessState {
973
- process: string;
974
- timestamp: Date;
975
- steps: any[];
976
- flows: any[];
977
- metrics: any;
978
- issues: Issue[];
979
- risks: Risk[];
980
- }
981
-
982
- interface Duration {
983
- min: number;
984
- average: number;
985
- max: number;
986
- unit: string;
987
- }
988
-
989
- interface Cost {
990
- labor: number;
991
- material: number;
992
- overhead: number;
993
- total: number;
994
- }
995
-
996
- interface Decision {
997
- id: string;
998
- question: string;
999
- options: string[];
1000
- criteria: string[];
1001
- outcome: string;
1002
- }
1003
-
1004
- interface Issue {
1005
- id: string;
1006
- type: string;
1007
- description: string;
1008
- severity: string;
1009
- frequency: number;
1010
- }
1011
-
1012
- interface ProcessAnalysis {
1013
- currentState: ProcessState;
1014
- futureState: ProcessState;
1015
- painPoints: PainPoint[];
1016
- bottlenecks: Bottleneck[];
1017
- opportunities: Opportunity[];
1018
- gapAnalysis: GapAnalysis;
1019
- recommendations: Recommendation[];
1020
- roadmap: Roadmap;
1021
- metrics: ProcessMetrics;
1022
- roi: ROI;
1023
- }
1024
-
1025
- interface PainPoint {
1026
- id: string;
1027
- type: PainPointType;
1028
- stepId?: string;
1029
- description: string;
1030
- impact: Impact;
1031
- frequency: number;
1032
- cost: number;
1033
- }
1034
-
1035
- interface Bottleneck {
1036
- id: string;
1037
- stepId?: string;
1038
- type: BottleneckType;
1039
- description: string;
1040
- throughput?: number;
1041
- utilization?: number;
1042
- performance?: any;
1043
- impact: Impact;
1044
- recommendations: string[];
1045
- }
1046
-
1047
- interface GapAnalysis {
1048
- gaps: Gap[];
1049
- score: number;
1050
- complexity: string;
1051
- risk: string;
1052
- timeline: number;
1053
- cost: number;
1054
- }
1055
-
1056
- interface Gap {
1057
- id: string;
1058
- type: string;
1059
- current: string;
1060
- future: string;
1061
- description: string;
1062
- actions: string[];
1063
- effort: EffortLevel;
1064
- }
1065
-
1066
- interface Recommendation {
1067
- id: string;
1068
- title: string;
1069
- description: string;
1070
- priority: Priority;
1071
- effort: EffortLevel;
1072
- impact: Impact;
1073
- dependencies: string[];
1074
- risks: string[];
1075
- }
1076
-
1077
- interface Roadmap {
1078
- phases: Phase[];
1079
- milestones: Milestone[];
1080
- dependencies: Dependency[];
1081
- timeline: Timeline;
1082
- budget: Budget;
1083
- }
1084
-
1085
- interface Phase {
1086
- id: string;
1087
- name: string;
1088
- description: string;
1089
- startDate: Date;
1090
- endDate: Date;
1091
- deliverables: string[];
1092
- resources: Resource[];
1093
- }
1094
-
1095
- interface Milestone {
1096
- id: string;
1097
- name: string;
1098
- date: Date;
1099
- criteria: string[];
1100
- dependencies: string[];
1101
- }
1102
-
1103
- interface Dependency {
1104
- from: string;
1105
- to: string;
1106
- type: string;
1107
- lag: number;
1108
- }
1109
-
1110
- interface Timeline {
1111
- start: Date;
1112
- end: Date;
1113
- duration: number;
1114
- criticalPath: string[];
1115
- }
1116
-
1117
- interface Budget {
1118
- total: number;
1119
- categories: any;
1120
- contingency: number;
1121
- }
1122
-
1123
- interface Resource {
1124
- type: string;
1125
- quantity: number;
1126
- cost: number;
1127
- availability: number;
1128
- }
1129
-
1130
- interface ROI {
1131
- investment: number;
1132
- return: number;
1133
- percentage: number;
1134
- paybackPeriod: number;
1135
- npv: number;
1136
- irr: number;
1137
- }
1138
-
1139
- interface Initiative {
1140
- id: string;
1141
- name: string;
1142
- description: string;
1143
- scope: string[];
1144
- objectives: string[];
1145
- duration: number;
1146
- resources: Resource[];
1147
- }
1148
-
1149
- interface CostBenefitAnalysis {
1150
- costs: Costs;
1151
- benefits: Benefits;
1152
- npv: number;
1153
- irr: number;
1154
- paybackPeriod: number;
1155
- roi: number;
1156
- riskAdjustedROI: number;
1157
- risks: Risk[];
1158
- sensitivity: any;
1159
- recommendation: string;
1160
- }
1161
-
1162
- interface Costs {
1163
- oneTime: any;
1164
- recurring: any;
1165
- total: number;
1166
- }
1167
-
1168
- interface Benefits {
1169
- tangible: any;
1170
- intangible: any;
1171
- total: number;
1172
- }
1173
-
1174
- interface Workflow {
1175
- id: string;
1176
- name: string;
1177
- description: string;
1178
- trigger: any;
1179
- steps: WorkflowStep[];
1180
- rules: BusinessRule[];
1181
- integrations: Integration[];
1182
- notifications: Notification[];
1183
- sla: SLA;
1184
- metrics: Metric[];
1185
- }
1186
-
1187
- interface WorkflowStep {
1188
- id: string;
1189
- name: string;
1190
- type: WorkflowStepType;
1191
- description: string;
1192
- assignee?: string;
1193
- actions: Action[];
1194
- validations?: Validation[];
1195
- transitions: Transition[];
1196
- sla?: SLA;
1197
- }
1198
-
1199
- interface BusinessRule {
1200
- id: string;
1201
- name: string;
1202
- condition: string;
1203
- action: string;
1204
- priority: number;
1205
- }
1206
-
1207
- interface Integration {
1208
- id: string;
1209
- system: string;
1210
- type: string;
1211
- endpoint: string;
1212
- authentication: string;
1213
- }
1214
-
1215
- interface Notification {
1216
- id: string;
1217
- trigger: string;
1218
- recipients: string[];
1219
- template: string;
1220
- channel: string;
1221
- }
1222
-
1223
- interface SLA {
1224
- responseTime: number;
1225
- resolutionTime: number;
1226
- availability: number;
1227
- escalation: string[];
1228
- }
1229
-
1230
- interface Metric {
1231
- id: string;
1232
- name: string;
1233
- formula: string;
1234
- threshold: number;
1235
- frequency: string;
1236
- }
1237
-
1238
- interface Action {
1239
- type: ActionType;
1240
- description: string;
1241
- parameters?: any;
1242
- }
1243
-
1244
- interface Validation {
1245
- field: string;
1246
- rule: string;
1247
- message: string;
1248
- }
1249
-
1250
- interface Transition {
1251
- to: string;
1252
- condition: string;
1253
- priority?: number;
1254
- }
1255
-
1256
- interface WorkflowRequirements {
1257
- name: string;
1258
- description: string;
1259
- trigger: any;
1260
- activities: Activity[];
1261
- sla: SLA;
1262
- stakeholders: string[];
1263
- }
1264
-
1265
- interface Activity {
1266
- name: string;
1267
- description: string;
1268
- type: string;
1269
- assignee: string;
1270
- inputs: string[];
1271
- outputs: string[];
1272
- sla?: SLA;
1273
- }
1274
-
1275
- interface Capability {
1276
- id: string;
1277
- name: string;
1278
- description: string;
1279
- maturity: MaturityLevel;
1280
- processes: string[];
1281
- systems: string[];
1282
- metrics: Metric[];
1283
- }
1284
-
1285
- interface ValueStream {
1286
- id: string;
1287
- name: string;
1288
- customer: string;
1289
- value: string;
1290
- steps: string[];
1291
- metrics: any;
1292
- }
1293
-
1294
- // Export the analyzer
1295
- export { BusinessAnalyzer, BusinessProcess, ProcessAnalysis };
1296
- ```
1297
-
1298
- ## Best Practices
1299
- 1. **Stakeholder Engagement**: Involve all stakeholders throughout
1300
- 2. **Data-Driven Decisions**: Base recommendations on metrics
1301
- 3. **Iterative Improvement**: Use continuous improvement cycles
1302
- 4. **Change Management**: Plan for organizational change
1303
- 5. **Risk Management**: Identify and mitigate risks early
1304
- 6. **Value Focus**: Always focus on delivering value
1305
- 7. **Documentation**: Maintain comprehensive documentation
1306
-
1307
- ## Analysis Methodologies
1308
- - SWOT Analysis (Strengths, Weaknesses, Opportunities, Threats)
1309
- - Value Stream Mapping
1310
- - Process Mining and Discovery
1311
- - Root Cause Analysis
1312
- - Gap Analysis
1313
- - Cost-Benefit Analysis
1314
- - Risk Assessment
1315
-
1316
- ## Approach
1317
- - Understand current state thoroughly
1318
- - Identify pain points and opportunities
1319
- - Design optimal future state
1320
- - Perform comprehensive gap analysis
1321
- - Create actionable recommendations
1322
- - Develop implementation roadmap
1323
- - Monitor and measure results
1324
-
1325
- ## Output Format
1326
- - Provide complete analysis frameworks
1327
- - Include process models and diagrams
1328
- - Document findings and recommendations
1329
- - Add implementation roadmaps
1330
- - Include ROI calculations
1331
- - Provide change management plans