javi-forge 0.1.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 (500) hide show
  1. package/.gitignore.template +105 -0
  2. package/.releaserc +44 -0
  3. package/README.md +45 -0
  4. package/ai-config/.skillignore +15 -0
  5. package/ai-config/AUTO_INVOKE.md +300 -0
  6. package/ai-config/agents/_TEMPLATE.md +93 -0
  7. package/ai-config/agents/business/api-designer.md +1657 -0
  8. package/ai-config/agents/business/business-analyst.md +1331 -0
  9. package/ai-config/agents/business/product-strategist.md +206 -0
  10. package/ai-config/agents/business/project-manager.md +178 -0
  11. package/ai-config/agents/business/requirements-analyst.md +1277 -0
  12. package/ai-config/agents/business/technical-writer.md +1679 -0
  13. package/ai-config/agents/creative/ux-designer.md +205 -0
  14. package/ai-config/agents/data-ai/ai-engineer.md +487 -0
  15. package/ai-config/agents/data-ai/analytics-engineer.md +953 -0
  16. package/ai-config/agents/data-ai/data-engineer.md +173 -0
  17. package/ai-config/agents/data-ai/data-scientist.md +672 -0
  18. package/ai-config/agents/data-ai/mlops-engineer.md +814 -0
  19. package/ai-config/agents/data-ai/prompt-engineer.md +772 -0
  20. package/ai-config/agents/development/angular-expert.md +620 -0
  21. package/ai-config/agents/development/backend-architect.md +795 -0
  22. package/ai-config/agents/development/database-specialist.md +212 -0
  23. package/ai-config/agents/development/frontend-specialist.md +686 -0
  24. package/ai-config/agents/development/fullstack-engineer.md +668 -0
  25. package/ai-config/agents/development/golang-pro.md +338 -0
  26. package/ai-config/agents/development/java-enterprise.md +400 -0
  27. package/ai-config/agents/development/javascript-pro.md +422 -0
  28. package/ai-config/agents/development/nextjs-pro.md +474 -0
  29. package/ai-config/agents/development/python-pro.md +570 -0
  30. package/ai-config/agents/development/react-pro.md +487 -0
  31. package/ai-config/agents/development/rust-pro.md +246 -0
  32. package/ai-config/agents/development/spring-boot-4-expert.md +326 -0
  33. package/ai-config/agents/development/typescript-pro.md +336 -0
  34. package/ai-config/agents/development/vue-specialist.md +605 -0
  35. package/ai-config/agents/infrastructure/cloud-architect.md +472 -0
  36. package/ai-config/agents/infrastructure/deployment-manager.md +358 -0
  37. package/ai-config/agents/infrastructure/devops-engineer.md +455 -0
  38. package/ai-config/agents/infrastructure/incident-responder.md +519 -0
  39. package/ai-config/agents/infrastructure/kubernetes-expert.md +705 -0
  40. package/ai-config/agents/infrastructure/monitoring-specialist.md +674 -0
  41. package/ai-config/agents/infrastructure/performance-engineer.md +658 -0
  42. package/ai-config/agents/orchestrator.md +241 -0
  43. package/ai-config/agents/quality/accessibility-auditor.md +1204 -0
  44. package/ai-config/agents/quality/code-reviewer-compact.md +123 -0
  45. package/ai-config/agents/quality/code-reviewer.md +363 -0
  46. package/ai-config/agents/quality/dependency-manager.md +743 -0
  47. package/ai-config/agents/quality/e2e-test-specialist.md +1005 -0
  48. package/ai-config/agents/quality/performance-tester.md +1086 -0
  49. package/ai-config/agents/quality/security-auditor.md +133 -0
  50. package/ai-config/agents/quality/test-engineer.md +453 -0
  51. package/ai-config/agents/specialists/api-designer.md +87 -0
  52. package/ai-config/agents/specialists/backend-architect.md +73 -0
  53. package/ai-config/agents/specialists/code-reviewer.md +77 -0
  54. package/ai-config/agents/specialists/db-optimizer.md +75 -0
  55. package/ai-config/agents/specialists/devops-engineer.md +83 -0
  56. package/ai-config/agents/specialists/documentation-writer.md +78 -0
  57. package/ai-config/agents/specialists/frontend-developer.md +75 -0
  58. package/ai-config/agents/specialists/performance-analyst.md +82 -0
  59. package/ai-config/agents/specialists/refactor-specialist.md +74 -0
  60. package/ai-config/agents/specialists/security-auditor.md +74 -0
  61. package/ai-config/agents/specialists/test-engineer.md +81 -0
  62. package/ai-config/agents/specialists/ux-consultant.md +76 -0
  63. package/ai-config/agents/specialized/agent-generator.md +1190 -0
  64. package/ai-config/agents/specialized/blockchain-developer.md +149 -0
  65. package/ai-config/agents/specialized/code-migrator.md +892 -0
  66. package/ai-config/agents/specialized/context-manager.md +978 -0
  67. package/ai-config/agents/specialized/documentation-writer.md +1078 -0
  68. package/ai-config/agents/specialized/ecommerce-expert.md +1756 -0
  69. package/ai-config/agents/specialized/embedded-engineer.md +1714 -0
  70. package/ai-config/agents/specialized/error-detective.md +1034 -0
  71. package/ai-config/agents/specialized/fintech-specialist.md +1659 -0
  72. package/ai-config/agents/specialized/freelance-project-planner-v2.md +1988 -0
  73. package/ai-config/agents/specialized/freelance-project-planner-v3.md +2136 -0
  74. package/ai-config/agents/specialized/freelance-project-planner-v4.md +4503 -0
  75. package/ai-config/agents/specialized/freelance-project-planner.md +722 -0
  76. package/ai-config/agents/specialized/game-developer.md +1963 -0
  77. package/ai-config/agents/specialized/healthcare-dev.md +1620 -0
  78. package/ai-config/agents/specialized/mobile-developer.md +188 -0
  79. package/ai-config/agents/specialized/parallel-plan-executor.md +506 -0
  80. package/ai-config/agents/specialized/plan-executor.md +485 -0
  81. package/ai-config/agents/specialized/solo-dev-planner-modular/00-INDEX.md +485 -0
  82. package/ai-config/agents/specialized/solo-dev-planner-modular/01-CORE.md +3493 -0
  83. package/ai-config/agents/specialized/solo-dev-planner-modular/02-SELF-CORRECTION.md +778 -0
  84. package/ai-config/agents/specialized/solo-dev-planner-modular/03-PROGRESSIVE-SETUP.md +918 -0
  85. package/ai-config/agents/specialized/solo-dev-planner-modular/04-DEPLOYMENT.md +1537 -0
  86. package/ai-config/agents/specialized/solo-dev-planner-modular/05-TESTING.md +2633 -0
  87. package/ai-config/agents/specialized/solo-dev-planner-modular/06-OPERATIONS.md +5610 -0
  88. package/ai-config/agents/specialized/solo-dev-planner-modular/INSTALL.md +335 -0
  89. package/ai-config/agents/specialized/solo-dev-planner-modular/QUICK-REFERENCE.txt +215 -0
  90. package/ai-config/agents/specialized/solo-dev-planner-modular/README.md +260 -0
  91. package/ai-config/agents/specialized/solo-dev-planner-modular/START-HERE.md +379 -0
  92. package/ai-config/agents/specialized/solo-dev-planner-modular/WORKFLOW-DIAGRAM.md +355 -0
  93. package/ai-config/agents/specialized/solo-dev-planner-modular/solo-dev-planner.md +279 -0
  94. package/ai-config/agents/specialized/template-writer.md +347 -0
  95. package/ai-config/agents/specialized/test-runner.md +99 -0
  96. package/ai-config/agents/specialized/vibekanban-smart-worker.md +244 -0
  97. package/ai-config/agents/specialized/wave-executor.md +138 -0
  98. package/ai-config/agents/specialized/workflow-optimizer.md +1114 -0
  99. package/ai-config/commands/git/changelog.md +32 -0
  100. package/ai-config/commands/git/ci-local.md +70 -0
  101. package/ai-config/commands/git/commit.md +35 -0
  102. package/ai-config/commands/git/fix-issue.md +23 -0
  103. package/ai-config/commands/git/pr-create.md +42 -0
  104. package/ai-config/commands/git/pr-review.md +50 -0
  105. package/ai-config/commands/git/worktree.md +39 -0
  106. package/ai-config/commands/refactoring/cleanup.md +24 -0
  107. package/ai-config/commands/refactoring/dead-code.md +40 -0
  108. package/ai-config/commands/refactoring/extract.md +31 -0
  109. package/ai-config/commands/testing/e2e.md +30 -0
  110. package/ai-config/commands/testing/tdd.md +36 -0
  111. package/ai-config/commands/testing/test-coverage.md +30 -0
  112. package/ai-config/commands/testing/test-fix.md +24 -0
  113. package/ai-config/commands/workflow/generate-agents-md.md +85 -0
  114. package/ai-config/commands/workflow/planning.md +47 -0
  115. package/ai-config/commands/workflows/compound.md +89 -0
  116. package/ai-config/commands/workflows/plan.md +77 -0
  117. package/ai-config/commands/workflows/review.md +78 -0
  118. package/ai-config/commands/workflows/work.md +75 -0
  119. package/ai-config/config.yaml +18 -0
  120. package/ai-config/hooks/_TEMPLATE.md +96 -0
  121. package/ai-config/hooks/block-dangerous-commands.md +75 -0
  122. package/ai-config/hooks/commit-guard.md +90 -0
  123. package/ai-config/hooks/context-loader.md +73 -0
  124. package/ai-config/hooks/improve-prompt.md +91 -0
  125. package/ai-config/hooks/learning-log.md +72 -0
  126. package/ai-config/hooks/model-router.md +86 -0
  127. package/ai-config/hooks/secret-scanner.md +64 -0
  128. package/ai-config/hooks/skill-validator.md +102 -0
  129. package/ai-config/hooks/task-artifact.md +114 -0
  130. package/ai-config/hooks/validate-workflow.md +100 -0
  131. package/ai-config/prompts/base.md +71 -0
  132. package/ai-config/prompts/modes/debug.md +34 -0
  133. package/ai-config/prompts/modes/deploy.md +40 -0
  134. package/ai-config/prompts/modes/research.md +32 -0
  135. package/ai-config/prompts/modes/review.md +33 -0
  136. package/ai-config/prompts/review-policy.md +79 -0
  137. package/ai-config/skills/_TEMPLATE.md +157 -0
  138. package/ai-config/skills/backend/api-gateway/SKILL.md +254 -0
  139. package/ai-config/skills/backend/bff-concepts/SKILL.md +239 -0
  140. package/ai-config/skills/backend/bff-spring/SKILL.md +364 -0
  141. package/ai-config/skills/backend/chi-router/SKILL.md +396 -0
  142. package/ai-config/skills/backend/error-handling/SKILL.md +255 -0
  143. package/ai-config/skills/backend/exceptions-spring/SKILL.md +323 -0
  144. package/ai-config/skills/backend/fastapi/SKILL.md +302 -0
  145. package/ai-config/skills/backend/gateway-spring/SKILL.md +390 -0
  146. package/ai-config/skills/backend/go-backend/SKILL.md +457 -0
  147. package/ai-config/skills/backend/gradle-multimodule/SKILL.md +274 -0
  148. package/ai-config/skills/backend/graphql-concepts/SKILL.md +352 -0
  149. package/ai-config/skills/backend/graphql-spring/SKILL.md +398 -0
  150. package/ai-config/skills/backend/grpc-concepts/SKILL.md +283 -0
  151. package/ai-config/skills/backend/grpc-spring/SKILL.md +445 -0
  152. package/ai-config/skills/backend/jwt-auth/SKILL.md +412 -0
  153. package/ai-config/skills/backend/notifications-concepts/SKILL.md +259 -0
  154. package/ai-config/skills/backend/recommendations-concepts/SKILL.md +261 -0
  155. package/ai-config/skills/backend/search-concepts/SKILL.md +263 -0
  156. package/ai-config/skills/backend/search-spring/SKILL.md +375 -0
  157. package/ai-config/skills/backend/spring-boot-4/SKILL.md +172 -0
  158. package/ai-config/skills/backend/websockets/SKILL.md +532 -0
  159. package/ai-config/skills/data-ai/ai-ml/SKILL.md +423 -0
  160. package/ai-config/skills/data-ai/analytics-concepts/SKILL.md +195 -0
  161. package/ai-config/skills/data-ai/analytics-spring/SKILL.md +340 -0
  162. package/ai-config/skills/data-ai/duckdb-analytics/SKILL.md +440 -0
  163. package/ai-config/skills/data-ai/langchain/SKILL.md +238 -0
  164. package/ai-config/skills/data-ai/mlflow/SKILL.md +302 -0
  165. package/ai-config/skills/data-ai/onnx-inference/SKILL.md +290 -0
  166. package/ai-config/skills/data-ai/powerbi/SKILL.md +352 -0
  167. package/ai-config/skills/data-ai/pytorch/SKILL.md +274 -0
  168. package/ai-config/skills/data-ai/scikit-learn/SKILL.md +321 -0
  169. package/ai-config/skills/data-ai/vector-db/SKILL.md +301 -0
  170. package/ai-config/skills/database/graph-databases/SKILL.md +218 -0
  171. package/ai-config/skills/database/graph-spring/SKILL.md +361 -0
  172. package/ai-config/skills/database/pgx-postgres/SKILL.md +512 -0
  173. package/ai-config/skills/database/redis-cache/SKILL.md +343 -0
  174. package/ai-config/skills/database/sqlite-embedded/SKILL.md +388 -0
  175. package/ai-config/skills/database/timescaledb/SKILL.md +320 -0
  176. package/ai-config/skills/docs/api-documentation/SKILL.md +293 -0
  177. package/ai-config/skills/docs/docs-spring/SKILL.md +377 -0
  178. package/ai-config/skills/docs/mustache-templates/SKILL.md +190 -0
  179. package/ai-config/skills/docs/technical-docs/SKILL.md +447 -0
  180. package/ai-config/skills/frontend/astro-ssr/SKILL.md +441 -0
  181. package/ai-config/skills/frontend/frontend-design/SKILL.md +54 -0
  182. package/ai-config/skills/frontend/frontend-web/SKILL.md +368 -0
  183. package/ai-config/skills/frontend/mantine-ui/SKILL.md +396 -0
  184. package/ai-config/skills/frontend/tanstack-query/SKILL.md +439 -0
  185. package/ai-config/skills/frontend/zod-validation/SKILL.md +417 -0
  186. package/ai-config/skills/frontend/zustand-state/SKILL.md +350 -0
  187. package/ai-config/skills/infrastructure/chaos-engineering/SKILL.md +244 -0
  188. package/ai-config/skills/infrastructure/chaos-spring/SKILL.md +378 -0
  189. package/ai-config/skills/infrastructure/devops-infra/SKILL.md +435 -0
  190. package/ai-config/skills/infrastructure/docker-containers/SKILL.md +420 -0
  191. package/ai-config/skills/infrastructure/kubernetes/SKILL.md +456 -0
  192. package/ai-config/skills/infrastructure/opentelemetry/SKILL.md +546 -0
  193. package/ai-config/skills/infrastructure/traefik-proxy/SKILL.md +474 -0
  194. package/ai-config/skills/infrastructure/woodpecker-ci/SKILL.md +315 -0
  195. package/ai-config/skills/mobile/ionic-capacitor/SKILL.md +504 -0
  196. package/ai-config/skills/mobile/mobile-ionic/SKILL.md +448 -0
  197. package/ai-config/skills/prompt-improver/SKILL.md +125 -0
  198. package/ai-config/skills/quality/ghagga-review/SKILL.md +216 -0
  199. package/ai-config/skills/references/hooks-patterns/SKILL.md +238 -0
  200. package/ai-config/skills/references/mcp-servers/SKILL.md +275 -0
  201. package/ai-config/skills/references/plugins-reference/SKILL.md +110 -0
  202. package/ai-config/skills/references/skills-reference/SKILL.md +420 -0
  203. package/ai-config/skills/references/subagent-templates/SKILL.md +193 -0
  204. package/ai-config/skills/systems-iot/modbus-protocol/SKILL.md +410 -0
  205. package/ai-config/skills/systems-iot/mqtt-rumqttc/SKILL.md +408 -0
  206. package/ai-config/skills/systems-iot/rust-systems/SKILL.md +386 -0
  207. package/ai-config/skills/systems-iot/tokio-async/SKILL.md +324 -0
  208. package/ai-config/skills/testing/playwright-e2e/SKILL.md +289 -0
  209. package/ai-config/skills/testing/testcontainers/SKILL.md +299 -0
  210. package/ai-config/skills/testing/vitest-testing/SKILL.md +381 -0
  211. package/ai-config/skills/workflow/ci-local-guide/SKILL.md +118 -0
  212. package/ai-config/skills/workflow/claude-automation-recommender/SKILL.md +299 -0
  213. package/ai-config/skills/workflow/claude-md-improver/SKILL.md +158 -0
  214. package/ai-config/skills/workflow/finishing-a-development-branch/SKILL.md +117 -0
  215. package/ai-config/skills/workflow/git-github/SKILL.md +334 -0
  216. package/ai-config/skills/workflow/git-github/references/examples.md +160 -0
  217. package/ai-config/skills/workflow/git-workflow/SKILL.md +214 -0
  218. package/ai-config/skills/workflow/ide-plugins/SKILL.md +277 -0
  219. package/ai-config/skills/workflow/ide-plugins-intellij/SKILL.md +401 -0
  220. package/ai-config/skills/workflow/obsidian-brain-workflow/SKILL.md +199 -0
  221. package/ai-config/skills/workflow/using-git-worktrees/SKILL.md +100 -0
  222. package/ai-config/skills/workflow/verification-before-completion/SKILL.md +73 -0
  223. package/ai-config/skills/workflow/wave-workflow/SKILL.md +178 -0
  224. package/ci-local/README.md +170 -0
  225. package/ci-local/ci-local.sh +297 -0
  226. package/ci-local/hooks/commit-msg +74 -0
  227. package/ci-local/hooks/pre-commit +162 -0
  228. package/ci-local/hooks/pre-push +41 -0
  229. package/ci-local/install.sh +49 -0
  230. package/ci-local/semgrep.yml +214 -0
  231. package/dist/commands/analyze.d.ts +9 -0
  232. package/dist/commands/analyze.d.ts.map +1 -0
  233. package/dist/commands/analyze.js +55 -0
  234. package/dist/commands/analyze.js.map +1 -0
  235. package/dist/commands/analyze.test.d.ts +2 -0
  236. package/dist/commands/analyze.test.d.ts.map +1 -0
  237. package/dist/commands/analyze.test.js +145 -0
  238. package/dist/commands/analyze.test.js.map +1 -0
  239. package/dist/commands/doctor.d.ts +7 -0
  240. package/dist/commands/doctor.d.ts.map +1 -0
  241. package/dist/commands/doctor.js +158 -0
  242. package/dist/commands/doctor.js.map +1 -0
  243. package/dist/commands/doctor.test.d.ts +2 -0
  244. package/dist/commands/doctor.test.d.ts.map +1 -0
  245. package/dist/commands/doctor.test.js +200 -0
  246. package/dist/commands/doctor.test.js.map +1 -0
  247. package/dist/commands/init.d.ts +9 -0
  248. package/dist/commands/init.d.ts.map +1 -0
  249. package/dist/commands/init.js +283 -0
  250. package/dist/commands/init.js.map +1 -0
  251. package/dist/commands/init.test.d.ts +2 -0
  252. package/dist/commands/init.test.d.ts.map +1 -0
  253. package/dist/commands/init.test.js +271 -0
  254. package/dist/commands/init.test.js.map +1 -0
  255. package/dist/commands/sync.d.ts +8 -0
  256. package/dist/commands/sync.d.ts.map +1 -0
  257. package/dist/commands/sync.js +201 -0
  258. package/dist/commands/sync.js.map +1 -0
  259. package/dist/constants.d.ts +21 -0
  260. package/dist/constants.d.ts.map +1 -0
  261. package/dist/constants.js +57 -0
  262. package/dist/constants.js.map +1 -0
  263. package/dist/e2e/aggressive.e2e.test.d.ts +2 -0
  264. package/dist/e2e/aggressive.e2e.test.d.ts.map +1 -0
  265. package/dist/e2e/aggressive.e2e.test.js +350 -0
  266. package/dist/e2e/aggressive.e2e.test.js.map +1 -0
  267. package/dist/e2e/commands.e2e.test.d.ts +2 -0
  268. package/dist/e2e/commands.e2e.test.d.ts.map +1 -0
  269. package/dist/e2e/commands.e2e.test.js +213 -0
  270. package/dist/e2e/commands.e2e.test.js.map +1 -0
  271. package/dist/index.d.ts +3 -0
  272. package/dist/index.d.ts.map +1 -0
  273. package/dist/index.js +82 -0
  274. package/dist/index.js.map +1 -0
  275. package/dist/lib/common.d.ts +17 -0
  276. package/dist/lib/common.d.ts.map +1 -0
  277. package/dist/lib/common.js +111 -0
  278. package/dist/lib/common.js.map +1 -0
  279. package/dist/lib/common.test.d.ts +2 -0
  280. package/dist/lib/common.test.d.ts.map +1 -0
  281. package/dist/lib/common.test.js +316 -0
  282. package/dist/lib/common.test.js.map +1 -0
  283. package/dist/lib/frontmatter.d.ts +18 -0
  284. package/dist/lib/frontmatter.d.ts.map +1 -0
  285. package/dist/lib/frontmatter.js +61 -0
  286. package/dist/lib/frontmatter.js.map +1 -0
  287. package/dist/lib/frontmatter.test.d.ts +2 -0
  288. package/dist/lib/frontmatter.test.d.ts.map +1 -0
  289. package/dist/lib/frontmatter.test.js +257 -0
  290. package/dist/lib/frontmatter.test.js.map +1 -0
  291. package/dist/lib/template.d.ts +24 -0
  292. package/dist/lib/template.d.ts.map +1 -0
  293. package/dist/lib/template.js +78 -0
  294. package/dist/lib/template.js.map +1 -0
  295. package/dist/lib/template.test.d.ts +2 -0
  296. package/dist/lib/template.test.d.ts.map +1 -0
  297. package/dist/lib/template.test.js +201 -0
  298. package/dist/lib/template.test.js.map +1 -0
  299. package/dist/types/index.d.ts +48 -0
  300. package/dist/types/index.d.ts.map +1 -0
  301. package/dist/types/index.js +2 -0
  302. package/dist/types/index.js.map +1 -0
  303. package/dist/ui/AnalyzeUI.d.ts +7 -0
  304. package/dist/ui/AnalyzeUI.d.ts.map +1 -0
  305. package/dist/ui/AnalyzeUI.js +100 -0
  306. package/dist/ui/AnalyzeUI.js.map +1 -0
  307. package/dist/ui/App.d.ts +13 -0
  308. package/dist/ui/App.d.ts.map +1 -0
  309. package/dist/ui/App.js +100 -0
  310. package/dist/ui/App.js.map +1 -0
  311. package/dist/ui/CIContext.d.ts +9 -0
  312. package/dist/ui/CIContext.d.ts.map +1 -0
  313. package/dist/ui/CIContext.js +9 -0
  314. package/dist/ui/CIContext.js.map +1 -0
  315. package/dist/ui/CISelector.d.ts +8 -0
  316. package/dist/ui/CISelector.d.ts.map +1 -0
  317. package/dist/ui/CISelector.js +45 -0
  318. package/dist/ui/CISelector.js.map +1 -0
  319. package/dist/ui/Doctor.d.ts +3 -0
  320. package/dist/ui/Doctor.d.ts.map +1 -0
  321. package/dist/ui/Doctor.js +89 -0
  322. package/dist/ui/Doctor.js.map +1 -0
  323. package/dist/ui/Header.d.ts +8 -0
  324. package/dist/ui/Header.d.ts.map +1 -0
  325. package/dist/ui/Header.js +30 -0
  326. package/dist/ui/Header.js.map +1 -0
  327. package/dist/ui/MemorySelector.d.ts +8 -0
  328. package/dist/ui/MemorySelector.d.ts.map +1 -0
  329. package/dist/ui/MemorySelector.js +46 -0
  330. package/dist/ui/MemorySelector.js.map +1 -0
  331. package/dist/ui/NameInput.d.ts +8 -0
  332. package/dist/ui/NameInput.d.ts.map +1 -0
  333. package/dist/ui/NameInput.js +69 -0
  334. package/dist/ui/NameInput.js.map +1 -0
  335. package/dist/ui/OptionSelector.d.ts +12 -0
  336. package/dist/ui/OptionSelector.d.ts.map +1 -0
  337. package/dist/ui/OptionSelector.js +69 -0
  338. package/dist/ui/OptionSelector.js.map +1 -0
  339. package/dist/ui/Progress.d.ts +11 -0
  340. package/dist/ui/Progress.d.ts.map +1 -0
  341. package/dist/ui/Progress.js +58 -0
  342. package/dist/ui/Progress.js.map +1 -0
  343. package/dist/ui/StackSelector.d.ts +9 -0
  344. package/dist/ui/StackSelector.d.ts.map +1 -0
  345. package/dist/ui/StackSelector.js +65 -0
  346. package/dist/ui/StackSelector.js.map +1 -0
  347. package/dist/ui/Summary.d.ts +12 -0
  348. package/dist/ui/Summary.d.ts.map +1 -0
  349. package/dist/ui/Summary.js +114 -0
  350. package/dist/ui/Summary.js.map +1 -0
  351. package/dist/ui/SyncUI.d.ts +10 -0
  352. package/dist/ui/SyncUI.d.ts.map +1 -0
  353. package/dist/ui/SyncUI.js +64 -0
  354. package/dist/ui/SyncUI.js.map +1 -0
  355. package/dist/ui/Welcome.d.ts +7 -0
  356. package/dist/ui/Welcome.d.ts.map +1 -0
  357. package/dist/ui/Welcome.js +45 -0
  358. package/dist/ui/Welcome.js.map +1 -0
  359. package/dist/ui/theme.d.ts +10 -0
  360. package/dist/ui/theme.d.ts.map +1 -0
  361. package/dist/ui/theme.js +9 -0
  362. package/dist/ui/theme.js.map +1 -0
  363. package/modules/engram/.gitignore-snippet.txt +6 -0
  364. package/modules/engram/.mcp-config-snippet.json +11 -0
  365. package/modules/engram/README.md +146 -0
  366. package/modules/engram/install-engram.sh +216 -0
  367. package/modules/ghagga/.env.example +43 -0
  368. package/modules/ghagga/README.md +153 -0
  369. package/modules/ghagga/docker-compose.yml +80 -0
  370. package/modules/ghagga/setup-ghagga.sh +139 -0
  371. package/modules/memory-simple/.project/NOTES.md +22 -0
  372. package/modules/memory-simple/README.md +23 -0
  373. package/modules/obsidian-brain/.obsidian/app.json +23 -0
  374. package/modules/obsidian-brain/.obsidian/appearance.json +5 -0
  375. package/modules/obsidian-brain/.obsidian/bookmarks.json +34 -0
  376. package/modules/obsidian-brain/.obsidian/community-plugins.json +1 -0
  377. package/modules/obsidian-brain/.obsidian/core-plugins-migration.json +21 -0
  378. package/modules/obsidian-brain/.obsidian/core-plugins.json +18 -0
  379. package/modules/obsidian-brain/.obsidian/daily-notes.json +5 -0
  380. package/modules/obsidian-brain/.obsidian/graph.json +37 -0
  381. package/modules/obsidian-brain/.obsidian/hotkeys.json +14 -0
  382. package/modules/obsidian-brain/.obsidian/plugins/dataview/data.json +25 -0
  383. package/modules/obsidian-brain/.obsidian/plugins/obsidian-kanban/data.json +29 -0
  384. package/modules/obsidian-brain/.obsidian/plugins/templater-obsidian/data.json +18 -0
  385. package/modules/obsidian-brain/.obsidian/snippets/project-memory.css +71 -0
  386. package/modules/obsidian-brain/.obsidian-gitignore-snippet.txt +8 -0
  387. package/modules/obsidian-brain/.project/Attachments/.gitkeep +0 -0
  388. package/modules/obsidian-brain/.project/Memory/BLOCKERS.md +78 -0
  389. package/modules/obsidian-brain/.project/Memory/CONTEXT.md +102 -0
  390. package/modules/obsidian-brain/.project/Memory/DASHBOARD.md +73 -0
  391. package/modules/obsidian-brain/.project/Memory/DECISIONS.md +87 -0
  392. package/modules/obsidian-brain/.project/Memory/KANBAN.md +15 -0
  393. package/modules/obsidian-brain/.project/Memory/README.md +61 -0
  394. package/modules/obsidian-brain/.project/Memory/WAVES.md +78 -0
  395. package/modules/obsidian-brain/.project/Sessions/TEMPLATE.md +99 -0
  396. package/modules/obsidian-brain/.project/Templates/ADR.md +33 -0
  397. package/modules/obsidian-brain/.project/Templates/Blocker.md +21 -0
  398. package/modules/obsidian-brain/.project/Templates/Session.md +88 -0
  399. package/modules/obsidian-brain/README.md +268 -0
  400. package/modules/obsidian-brain/new-wave.sh +182 -0
  401. package/package.json +51 -0
  402. package/schemas/agent.schema.json +34 -0
  403. package/schemas/ai-config.schema.json +28 -0
  404. package/schemas/skill.schema.json +44 -0
  405. package/src/commands/analyze.test.ts +145 -0
  406. package/src/commands/analyze.ts +69 -0
  407. package/src/commands/doctor.test.ts +208 -0
  408. package/src/commands/doctor.ts +163 -0
  409. package/src/commands/init.test.ts +298 -0
  410. package/src/commands/init.ts +285 -0
  411. package/src/constants.ts +69 -0
  412. package/src/e2e/aggressive.e2e.test.ts +557 -0
  413. package/src/e2e/commands.e2e.test.ts +298 -0
  414. package/src/index.tsx +106 -0
  415. package/src/lib/common.test.ts +318 -0
  416. package/src/lib/common.ts +127 -0
  417. package/src/lib/frontmatter.test.ts +291 -0
  418. package/src/lib/frontmatter.ts +77 -0
  419. package/src/lib/template.test.ts +226 -0
  420. package/src/lib/template.ts +99 -0
  421. package/src/types/index.ts +53 -0
  422. package/src/ui/AnalyzeUI.tsx +133 -0
  423. package/src/ui/App.tsx +175 -0
  424. package/src/ui/CIContext.tsx +25 -0
  425. package/src/ui/CISelector.tsx +72 -0
  426. package/src/ui/Doctor.tsx +122 -0
  427. package/src/ui/Header.tsx +48 -0
  428. package/src/ui/MemorySelector.tsx +73 -0
  429. package/src/ui/NameInput.tsx +82 -0
  430. package/src/ui/OptionSelector.tsx +100 -0
  431. package/src/ui/Progress.tsx +88 -0
  432. package/src/ui/StackSelector.tsx +101 -0
  433. package/src/ui/Summary.tsx +134 -0
  434. package/src/ui/Welcome.tsx +54 -0
  435. package/src/ui/theme.ts +10 -0
  436. package/stryker.config.json +19 -0
  437. package/tasks/_TEMPLATE/files-edited.md +3 -0
  438. package/tasks/_TEMPLATE/plan.md +3 -0
  439. package/tasks/_TEMPLATE/research.md +3 -0
  440. package/tasks/_TEMPLATE/verification.md +5 -0
  441. package/templates/common/dependabot/cargo.yml +11 -0
  442. package/templates/common/dependabot/github-actions.yml +16 -0
  443. package/templates/common/dependabot/gomod.yml +15 -0
  444. package/templates/common/dependabot/gradle.yml +15 -0
  445. package/templates/common/dependabot/header.yml +3 -0
  446. package/templates/common/dependabot/maven.yml +15 -0
  447. package/templates/common/dependabot/npm.yml +20 -0
  448. package/templates/common/dependabot/pip.yml +11 -0
  449. package/templates/dependabot.yml +162 -0
  450. package/templates/github/ci-go.yml +41 -0
  451. package/templates/github/ci-java.yml +45 -0
  452. package/templates/github/ci-monorepo.yml +150 -0
  453. package/templates/github/ci-node.yml +42 -0
  454. package/templates/github/ci-python.yml +42 -0
  455. package/templates/github/ci-rust.yml +42 -0
  456. package/templates/github/dependabot-automerge.yml +40 -0
  457. package/templates/gitlab/gitlab-ci-go.yml +88 -0
  458. package/templates/gitlab/gitlab-ci-java.yml +79 -0
  459. package/templates/gitlab/gitlab-ci-monorepo.yml +126 -0
  460. package/templates/gitlab/gitlab-ci-node.yml +63 -0
  461. package/templates/gitlab/gitlab-ci-python.yml +147 -0
  462. package/templates/gitlab/gitlab-ci-rust.yml +67 -0
  463. package/templates/global/claude-settings.json +98 -0
  464. package/templates/global/codex-config.toml +8 -0
  465. package/templates/global/copilot-instructions/base-rules.instructions.md +13 -0
  466. package/templates/global/copilot-instructions/sdd-orchestrator.instructions.md +37 -0
  467. package/templates/global/gemini-commands/cleanup.toml +20 -0
  468. package/templates/global/gemini-commands/commit.toml +15 -0
  469. package/templates/global/gemini-commands/dead-code.toml +22 -0
  470. package/templates/global/gemini-commands/plan.toml +30 -0
  471. package/templates/global/gemini-commands/review.toml +17 -0
  472. package/templates/global/gemini-commands/sdd-apply.toml +22 -0
  473. package/templates/global/gemini-commands/sdd-ff.toml +14 -0
  474. package/templates/global/gemini-commands/sdd-new.toml +21 -0
  475. package/templates/global/gemini-commands/sdd-verify.toml +21 -0
  476. package/templates/global/gemini-commands/tdd.toml +26 -0
  477. package/templates/global/gemini-settings.json +8 -0
  478. package/templates/global/opencode-config.json +44 -0
  479. package/templates/global/sdd-instructions.md +47 -0
  480. package/templates/global/sdd-orchestrator-claude.md +46 -0
  481. package/templates/global/sdd-orchestrator-copilot.md +34 -0
  482. package/templates/renovate.json +69 -0
  483. package/templates/woodpecker/monorepo/backend.yml +34 -0
  484. package/templates/woodpecker/monorepo/frontend.yml +34 -0
  485. package/templates/woodpecker/monorepo/summary.yml +25 -0
  486. package/templates/woodpecker/woodpecker-go.yml +51 -0
  487. package/templates/woodpecker/woodpecker-java.yml +67 -0
  488. package/templates/woodpecker/woodpecker-node.yml +47 -0
  489. package/templates/woodpecker/woodpecker-python.yml +108 -0
  490. package/templates/woodpecker/woodpecker-rust.yml +57 -0
  491. package/tsconfig.json +19 -0
  492. package/vitest.config.ts +16 -0
  493. package/workflows/reusable-build-go.yml +111 -0
  494. package/workflows/reusable-build-java.yml +120 -0
  495. package/workflows/reusable-build-node.yml +145 -0
  496. package/workflows/reusable-build-python.yml +159 -0
  497. package/workflows/reusable-build-rust.yml +135 -0
  498. package/workflows/reusable-docker.yml +120 -0
  499. package/workflows/reusable-ghagga-review.yml +165 -0
  500. package/workflows/reusable-release.yml +91 -0
@@ -0,0 +1,1331 @@
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