workspace-architect 1.3.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 (354) hide show
  1. package/.env.example +1 -0
  2. package/.gitattributes +1 -0
  3. package/.github/workflows/manual-publish.yml +36 -0
  4. package/.github/workflows/sync-and-publish.yml +58 -0
  5. package/.release-it.json +20 -0
  6. package/CHANGELOG.md +43 -0
  7. package/README.md +62 -0
  8. package/assets/chatmodes/4.1-Beast.chatmode.md +152 -0
  9. package/assets/chatmodes/Thinking-Beast-Mode.chatmode.md +337 -0
  10. package/assets/chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +644 -0
  11. package/assets/chatmodes/accessibility.chatmode.md +298 -0
  12. package/assets/chatmodes/address-comments.chatmode.md +59 -0
  13. package/assets/chatmodes/aem-frontend-specialist.chatmode.md +385 -0
  14. package/assets/chatmodes/api-architect.chatmode.md +40 -0
  15. package/assets/chatmodes/atlassian-requirements-to-jira.chatmode.md +444 -0
  16. package/assets/chatmodes/azure-logic-apps-expert.chatmode.md +100 -0
  17. package/assets/chatmodes/azure-principal-architect.chatmode.md +58 -0
  18. package/assets/chatmodes/azure-saas-architect.chatmode.md +118 -0
  19. package/assets/chatmodes/azure-verified-modules-bicep.chatmode.md +44 -0
  20. package/assets/chatmodes/azure-verified-modules-terraform.chatmode.md +58 -0
  21. package/assets/chatmodes/bicep-implement.chatmode.md +40 -0
  22. package/assets/chatmodes/bicep-plan.chatmode.md +112 -0
  23. package/assets/chatmodes/blueprint-mode-codex.chatmode.md +110 -0
  24. package/assets/chatmodes/blueprint-mode.chatmode.md +171 -0
  25. package/assets/chatmodes/clojure-interactive-programming.chatmode.md +174 -0
  26. package/assets/chatmodes/code-tour.chatmode.md +205 -0
  27. package/assets/chatmodes/critical-thinking.chatmode.md +23 -0
  28. package/assets/chatmodes/csharp-dotnet-janitor.chatmode.md +83 -0
  29. package/assets/chatmodes/csharp-mcp-expert.chatmode.md +69 -0
  30. package/assets/chatmodes/debug.chatmode.md +79 -0
  31. package/assets/chatmodes/declarative-agents-architect.chatmode.md +76 -0
  32. package/assets/chatmodes/demonstrate-understanding.chatmode.md +60 -0
  33. package/assets/chatmodes/dotnet-upgrade.chatmode.md +222 -0
  34. package/assets/chatmodes/drupal-expert.chatmode.md +687 -0
  35. package/assets/chatmodes/electron-angular-native.chatmode.md +285 -0
  36. package/assets/chatmodes/expert-cpp-software-engineer.chatmode.md +27 -0
  37. package/assets/chatmodes/expert-dotnet-software-engineer.chatmode.md +22 -0
  38. package/assets/chatmodes/expert-nextjs-developer.chatmode.md +477 -0
  39. package/assets/chatmodes/expert-react-frontend-engineer.chatmode.md +738 -0
  40. package/assets/chatmodes/gilfoyle.chatmode.md +66 -0
  41. package/assets/chatmodes/go-mcp-expert.chatmode.md +122 -0
  42. package/assets/chatmodes/gpt-5-beast-mode.chatmode.md +109 -0
  43. package/assets/chatmodes/hlbpa.chatmode.md +232 -0
  44. package/assets/chatmodes/implementation-plan.chatmode.md +159 -0
  45. package/assets/chatmodes/janitor.chatmode.md +89 -0
  46. package/assets/chatmodes/java-mcp-expert.chatmode.md +325 -0
  47. package/assets/chatmodes/kotlin-mcp-expert.chatmode.md +181 -0
  48. package/assets/chatmodes/kusto-assistant.chatmode.md +143 -0
  49. package/assets/chatmodes/laravel-expert-agent.chatmode.md +628 -0
  50. package/assets/chatmodes/mentor.chatmode.md +32 -0
  51. package/assets/chatmodes/meta-agentic-project-scaffold.chatmode.md +15 -0
  52. package/assets/chatmodes/microsoft-agent-framework-dotnet.chatmode.md +62 -0
  53. package/assets/chatmodes/microsoft-agent-framework-python.chatmode.md +62 -0
  54. package/assets/chatmodes/microsoft-study-mode.chatmode.md +32 -0
  55. package/assets/chatmodes/microsoft_learn_contributor.chatmode.md +388 -0
  56. package/assets/chatmodes/ms-sql-dba.chatmode.md +25 -0
  57. package/assets/chatmodes/php-mcp-expert.chatmode.md +498 -0
  58. package/assets/chatmodes/pimcore-expert.chatmode.md +869 -0
  59. package/assets/chatmodes/plan.chatmode.md +114 -0
  60. package/assets/chatmodes/planner.chatmode.md +14 -0
  61. package/assets/chatmodes/playwright-tester.chatmode.md +13 -0
  62. package/assets/chatmodes/postgresql-dba.chatmode.md +17 -0
  63. package/assets/chatmodes/power-bi-data-modeling-expert.chatmode.md +319 -0
  64. package/assets/chatmodes/power-bi-dax-expert.chatmode.md +334 -0
  65. package/assets/chatmodes/power-bi-performance-expert.chatmode.md +533 -0
  66. package/assets/chatmodes/power-bi-visualization-expert.chatmode.md +549 -0
  67. package/assets/chatmodes/power-platform-expert.chatmode.md +116 -0
  68. package/assets/chatmodes/power-platform-mcp-integration-expert.chatmode.md +149 -0
  69. package/assets/chatmodes/prd.chatmode.md +201 -0
  70. package/assets/chatmodes/principal-software-engineer.chatmode.md +41 -0
  71. package/assets/chatmodes/prompt-builder.chatmode.md +352 -0
  72. package/assets/chatmodes/prompt-engineer.chatmode.md +72 -0
  73. package/assets/chatmodes/python-mcp-expert.chatmode.md +99 -0
  74. package/assets/chatmodes/refine-issue.chatmode.md +34 -0
  75. package/assets/chatmodes/research-technical-spike.chatmode.md +169 -0
  76. package/assets/chatmodes/ruby-mcp-expert.chatmode.md +346 -0
  77. package/assets/chatmodes/rust-gpt-4.1-beast-mode.chatmode.md +197 -0
  78. package/assets/chatmodes/rust-mcp-expert.chatmode.md +465 -0
  79. package/assets/chatmodes/search-ai-optimization-expert.chatmode.md +227 -0
  80. package/assets/chatmodes/semantic-kernel-dotnet.chatmode.md +31 -0
  81. package/assets/chatmodes/semantic-kernel-python.chatmode.md +28 -0
  82. package/assets/chatmodes/shopify-expert.chatmode.md +681 -0
  83. package/assets/chatmodes/simple-app-idea-generator.chatmode.md +134 -0
  84. package/assets/chatmodes/software-engineer-agent-v1.chatmode.md +164 -0
  85. package/assets/chatmodes/specification.chatmode.md +127 -0
  86. package/assets/chatmodes/swift-mcp-expert.chatmode.md +240 -0
  87. package/assets/chatmodes/task-planner.chatmode.md +374 -0
  88. package/assets/chatmodes/task-researcher.chatmode.md +254 -0
  89. package/assets/chatmodes/tdd-green.chatmode.md +59 -0
  90. package/assets/chatmodes/tdd-red.chatmode.md +59 -0
  91. package/assets/chatmodes/tdd-refactor.chatmode.md +84 -0
  92. package/assets/chatmodes/tech-debt-remediation-plan.chatmode.md +49 -0
  93. package/assets/chatmodes/terraform-azure-implement.chatmode.md +104 -0
  94. package/assets/chatmodes/terraform-azure-planning.chatmode.md +157 -0
  95. package/assets/chatmodes/typescript-mcp-expert.chatmode.md +91 -0
  96. package/assets/chatmodes/voidbeast-gpt41enhanced.chatmode.md +230 -0
  97. package/assets/chatmodes/wg-code-alchemist.chatmode.md +61 -0
  98. package/assets/chatmodes/wg-code-sentinel.chatmode.md +55 -0
  99. package/assets/collections/ai-prompt-engineering.json +18 -0
  100. package/assets/collections/angular-development.json +7 -0
  101. package/assets/collections/azure-cloud-architect.json +29 -0
  102. package/assets/collections/cpp-development.json +6 -0
  103. package/assets/collections/database-administration.json +8 -0
  104. package/assets/collections/devops-sre.json +11 -0
  105. package/assets/collections/dotnet-development.json +22 -0
  106. package/assets/collections/general-productivity.json +9 -0
  107. package/assets/collections/go-development.json +7 -0
  108. package/assets/collections/java-spring-developer.json +26 -0
  109. package/assets/collections/learning-mentoring.json +10 -0
  110. package/assets/collections/legacy-migration.json +4 -0
  111. package/assets/collections/mcp-specialist.json +41 -0
  112. package/assets/collections/mobile-development.json +4 -0
  113. package/assets/collections/php-cms-development.json +11 -0
  114. package/assets/collections/power-platform-specialist.json +31 -0
  115. package/assets/collections/project-management.json +12 -0
  116. package/assets/collections/python-development.json +13 -0
  117. package/assets/collections/quality-assurance.json +13 -0
  118. package/assets/collections/ruby-development.json +9 -0
  119. package/assets/collections/rust-development.json +10 -0
  120. package/assets/collections/security-specialist.json +8 -0
  121. package/assets/collections/software-architect.json +25 -0
  122. package/assets/collections/technical-writing.json +9 -0
  123. package/assets/collections/web-frontend-development.json +14 -0
  124. package/assets/instructions/a11y.instructions.md +369 -0
  125. package/assets/instructions/ai-prompt-engineering-safety-best-practices.instructions.md +867 -0
  126. package/assets/instructions/angular.instructions.md +104 -0
  127. package/assets/instructions/ansible.instructions.md +88 -0
  128. package/assets/instructions/aspnet-rest-apis.instructions.md +110 -0
  129. package/assets/instructions/astro.instructions.md +182 -0
  130. package/assets/instructions/azure-devops-pipelines.instructions.md +185 -0
  131. package/assets/instructions/azure-functions-typescript.instructions.md +14 -0
  132. package/assets/instructions/azure-logic-apps-power-automate.instructions.md +1943 -0
  133. package/assets/instructions/azure-verified-modules-terraform.instructions.md +229 -0
  134. package/assets/instructions/bicep-code-best-practices.instructions.md +54 -0
  135. package/assets/instructions/blazor.instructions.md +77 -0
  136. package/assets/instructions/clojure.instructions.md +349 -0
  137. package/assets/instructions/cmake-vcpkg.instructions.md +10 -0
  138. package/assets/instructions/codexer.instructions.md +428 -0
  139. package/assets/instructions/coldfusion-cfc.instructions.md +30 -0
  140. package/assets/instructions/coldfusion-cfm.instructions.md +28 -0
  141. package/assets/instructions/collections.instructions.md +54 -0
  142. package/assets/instructions/containerization-docker-best-practices.instructions.md +681 -0
  143. package/assets/instructions/convert-jpa-to-spring-data-cosmos.instructions.md +949 -0
  144. package/assets/instructions/copilot-thought-logging.instructions.md +62 -0
  145. package/assets/instructions/csharp-ja.instructions.md +114 -0
  146. package/assets/instructions/csharp-ko.instructions.md +77 -0
  147. package/assets/instructions/csharp-mcp-server.instructions.md +95 -0
  148. package/assets/instructions/csharp.instructions.md +114 -0
  149. package/assets/instructions/dart-n-flutter.instructions.md +447 -0
  150. package/assets/instructions/declarative-agents-microsoft365.instructions.md +316 -0
  151. package/assets/instructions/devbox-image-definition.instructions.md +302 -0
  152. package/assets/instructions/devops-core-principles.instructions.md +167 -0
  153. package/assets/instructions/dotnet-architecture-good-practices.instructions.md +279 -0
  154. package/assets/instructions/dotnet-framework.instructions.md +113 -0
  155. package/assets/instructions/dotnet-maui-9-to-dotnet-maui-10-upgrade.instructions.md +1922 -0
  156. package/assets/instructions/dotnet-maui.instructions.md +69 -0
  157. package/assets/instructions/dotnet-upgrade.instructions.md +287 -0
  158. package/assets/instructions/dotnet-wpf.instructions.md +79 -0
  159. package/assets/instructions/genaiscript.instructions.md +21 -0
  160. package/assets/instructions/generate-modern-terraform-code-for-azure.instructions.md +82 -0
  161. package/assets/instructions/gilfoyle-code-review.instructions.md +114 -0
  162. package/assets/instructions/github-actions-ci-cd-best-practices.instructions.md +607 -0
  163. package/assets/instructions/go-mcp-server.instructions.md +346 -0
  164. package/assets/instructions/go.instructions.md +373 -0
  165. package/assets/instructions/instructions.instructions.md +256 -0
  166. package/assets/instructions/java-11-to-java-17-upgrade.instructions.md +793 -0
  167. package/assets/instructions/java-17-to-java-21-upgrade.instructions.md +464 -0
  168. package/assets/instructions/java-21-to-java-25-upgrade.instructions.md +311 -0
  169. package/assets/instructions/java-mcp-server.instructions.md +553 -0
  170. package/assets/instructions/java.instructions.md +81 -0
  171. package/assets/instructions/joyride-user-project.instructions.md +206 -0
  172. package/assets/instructions/joyride-workspace-automation.instructions.md +46 -0
  173. package/assets/instructions/kotlin-mcp-server.instructions.md +481 -0
  174. package/assets/instructions/kubernetes-deployment-best-practices.instructions.md +307 -0
  175. package/assets/instructions/langchain-python.instructions.md +229 -0
  176. package/assets/instructions/localization.instructions.md +39 -0
  177. package/assets/instructions/makefile.instructions.md +410 -0
  178. package/assets/instructions/markdown.instructions.md +52 -0
  179. package/assets/instructions/memory-bank.instructions.md +299 -0
  180. package/assets/instructions/mongo-dba.instructions.md +25 -0
  181. package/assets/instructions/ms-sql-dba.instructions.md +25 -0
  182. package/assets/instructions/nestjs.instructions.md +406 -0
  183. package/assets/instructions/nextjs-tailwind.instructions.md +72 -0
  184. package/assets/instructions/nextjs.instructions.md +143 -0
  185. package/assets/instructions/nodejs-javascript-vitest.instructions.md +30 -0
  186. package/assets/instructions/object-calisthenics.instructions.md +302 -0
  187. package/assets/instructions/oqtane.instructions.md +86 -0
  188. package/assets/instructions/performance-optimization.instructions.md +420 -0
  189. package/assets/instructions/php-mcp-server.instructions.md +809 -0
  190. package/assets/instructions/playwright-dotnet.instructions.md +101 -0
  191. package/assets/instructions/playwright-python.instructions.md +62 -0
  192. package/assets/instructions/playwright-typescript.instructions.md +86 -0
  193. package/assets/instructions/power-apps-canvas-yaml.instructions.md +827 -0
  194. package/assets/instructions/power-apps-code-apps.instructions.md +601 -0
  195. package/assets/instructions/power-bi-custom-visuals-development.instructions.md +810 -0
  196. package/assets/instructions/power-bi-data-modeling-best-practices.instructions.md +639 -0
  197. package/assets/instructions/power-bi-dax-best-practices.instructions.md +795 -0
  198. package/assets/instructions/power-bi-devops-alm-best-practices.instructions.md +623 -0
  199. package/assets/instructions/power-bi-report-design-best-practices.instructions.md +752 -0
  200. package/assets/instructions/power-bi-security-rls-best-practices.instructions.md +504 -0
  201. package/assets/instructions/power-platform-connector.instructions.md +430 -0
  202. package/assets/instructions/power-platform-mcp-development.instructions.md +88 -0
  203. package/assets/instructions/powershell-pester-5.instructions.md +197 -0
  204. package/assets/instructions/powershell.instructions.md +356 -0
  205. package/assets/instructions/prompt.instructions.md +73 -0
  206. package/assets/instructions/python-mcp-server.instructions.md +204 -0
  207. package/assets/instructions/python.instructions.md +56 -0
  208. package/assets/instructions/quarkus-mcp-server-sse.instructions.md +49 -0
  209. package/assets/instructions/quarkus.instructions.md +98 -0
  210. package/assets/instructions/r.instructions.md +116 -0
  211. package/assets/instructions/reactjs.instructions.md +162 -0
  212. package/assets/instructions/ruby-mcp-server.instructions.md +629 -0
  213. package/assets/instructions/ruby-on-rails.instructions.md +124 -0
  214. package/assets/instructions/rust-mcp-server.instructions.md +715 -0
  215. package/assets/instructions/rust.instructions.md +135 -0
  216. package/assets/instructions/security-and-owasp.instructions.md +51 -0
  217. package/assets/instructions/self-explanatory-code-commenting.instructions.md +162 -0
  218. package/assets/instructions/shell.instructions.md +132 -0
  219. package/assets/instructions/spec-driven-workflow-v1.instructions.md +323 -0
  220. package/assets/instructions/springboot.instructions.md +68 -0
  221. package/assets/instructions/sql-sp-generation.instructions.md +74 -0
  222. package/assets/instructions/svelte.instructions.md +161 -0
  223. package/assets/instructions/swift-mcp-server.instructions.md +498 -0
  224. package/assets/instructions/taming-copilot.instructions.md +40 -0
  225. package/assets/instructions/tanstack-start-shadcn-tailwind.instructions.md +212 -0
  226. package/assets/instructions/task-implementation.instructions.md +190 -0
  227. package/assets/instructions/tasksync.instructions.md +352 -0
  228. package/assets/instructions/terraform-azure.instructions.md +254 -0
  229. package/assets/instructions/terraform-sap-btp.instructions.md +195 -0
  230. package/assets/instructions/terraform.instructions.md +113 -0
  231. package/assets/instructions/typescript-5-es2022.instructions.md +114 -0
  232. package/assets/instructions/typescript-mcp-server.instructions.md +228 -0
  233. package/assets/instructions/update-code-from-shorthand.instructions.md +130 -0
  234. package/assets/instructions/vuejs3.instructions.md +153 -0
  235. package/assets/instructions/wordpress.instructions.md +186 -0
  236. package/assets/prompts/add-educational-comments.prompt.md +129 -0
  237. package/assets/prompts/ai-prompt-engineering-safety-review.prompt.md +230 -0
  238. package/assets/prompts/architecture-blueprint-generator.prompt.md +322 -0
  239. package/assets/prompts/aspnet-minimal-api-openapi.prompt.md +42 -0
  240. package/assets/prompts/az-cost-optimize.prompt.md +305 -0
  241. package/assets/prompts/azure-resource-health-diagnose.prompt.md +290 -0
  242. package/assets/prompts/boost-prompt.prompt.md +25 -0
  243. package/assets/prompts/breakdown-epic-arch.prompt.md +66 -0
  244. package/assets/prompts/breakdown-epic-pm.prompt.md +58 -0
  245. package/assets/prompts/breakdown-feature-implementation.prompt.md +128 -0
  246. package/assets/prompts/breakdown-feature-prd.prompt.md +61 -0
  247. package/assets/prompts/breakdown-plan.prompt.md +509 -0
  248. package/assets/prompts/breakdown-test.prompt.md +365 -0
  249. package/assets/prompts/code-exemplars-blueprint-generator.prompt.md +126 -0
  250. package/assets/prompts/comment-code-generate-a-tutorial.prompt.md +26 -0
  251. package/assets/prompts/containerize-aspnet-framework.prompt.md +455 -0
  252. package/assets/prompts/containerize-aspnetcore.prompt.md +393 -0
  253. package/assets/prompts/conventional-commit.prompt.md +73 -0
  254. package/assets/prompts/copilot-instructions-blueprint-generator.prompt.md +294 -0
  255. package/assets/prompts/cosmosdb-datamodeling.prompt.md +1045 -0
  256. package/assets/prompts/create-agentsmd.prompt.md +249 -0
  257. package/assets/prompts/create-architectural-decision-record.prompt.md +97 -0
  258. package/assets/prompts/create-github-action-workflow-specification.prompt.md +276 -0
  259. package/assets/prompts/create-github-issue-feature-from-specification.prompt.md +28 -0
  260. package/assets/prompts/create-github-issues-feature-from-implementation-plan.prompt.md +28 -0
  261. package/assets/prompts/create-github-issues-for-unmet-specification-requirements.prompt.md +35 -0
  262. package/assets/prompts/create-github-pull-request-from-specification.prompt.md +24 -0
  263. package/assets/prompts/create-implementation-plan.prompt.md +157 -0
  264. package/assets/prompts/create-llms.prompt.md +210 -0
  265. package/assets/prompts/create-oo-component-documentation.prompt.md +193 -0
  266. package/assets/prompts/create-readme.prompt.md +21 -0
  267. package/assets/prompts/create-specification.prompt.md +127 -0
  268. package/assets/prompts/create-spring-boot-java-project.prompt.md +163 -0
  269. package/assets/prompts/create-spring-boot-kotlin-project.prompt.md +147 -0
  270. package/assets/prompts/create-technical-spike.prompt.md +231 -0
  271. package/assets/prompts/csharp-async.prompt.md +50 -0
  272. package/assets/prompts/csharp-docs.prompt.md +63 -0
  273. package/assets/prompts/csharp-mcp-server-generator.prompt.md +59 -0
  274. package/assets/prompts/csharp-mstest.prompt.md +67 -0
  275. package/assets/prompts/csharp-nunit.prompt.md +72 -0
  276. package/assets/prompts/csharp-tunit.prompt.md +101 -0
  277. package/assets/prompts/csharp-xunit.prompt.md +69 -0
  278. package/assets/prompts/declarative-agents.prompt.md +93 -0
  279. package/assets/prompts/documentation-writer.prompt.md +46 -0
  280. package/assets/prompts/dotnet-best-practices.prompt.md +84 -0
  281. package/assets/prompts/dotnet-design-pattern-review.prompt.md +41 -0
  282. package/assets/prompts/dotnet-upgrade.prompt.md +116 -0
  283. package/assets/prompts/editorconfig.prompt.md +64 -0
  284. package/assets/prompts/ef-core.prompt.md +76 -0
  285. package/assets/prompts/finalize-agent-prompt.prompt.md +27 -0
  286. package/assets/prompts/first-ask.prompt.md +29 -0
  287. package/assets/prompts/folder-structure-blueprint-generator.prompt.md +405 -0
  288. package/assets/prompts/gen-specs-as-issues.prompt.md +165 -0
  289. package/assets/prompts/generate-custom-instructions-from-codebase.prompt.md +240 -0
  290. package/assets/prompts/git-flow-branch-creator.prompt.md +293 -0
  291. package/assets/prompts/github-copilot-starter.prompt.md +372 -0
  292. package/assets/prompts/go-mcp-server-generator.prompt.md +334 -0
  293. package/assets/prompts/java-docs.prompt.md +24 -0
  294. package/assets/prompts/java-junit.prompt.md +64 -0
  295. package/assets/prompts/java-mcp-server-generator.prompt.md +756 -0
  296. package/assets/prompts/java-refactoring-extract-method.prompt.md +105 -0
  297. package/assets/prompts/java-refactoring-remove-parameter.prompt.md +85 -0
  298. package/assets/prompts/java-springboot.prompt.md +66 -0
  299. package/assets/prompts/javascript-typescript-jest.prompt.md +44 -0
  300. package/assets/prompts/kotlin-mcp-server-generator.prompt.md +449 -0
  301. package/assets/prompts/kotlin-springboot.prompt.md +71 -0
  302. package/assets/prompts/mcp-copilot-studio-server-generator.prompt.md +118 -0
  303. package/assets/prompts/memory-merger.prompt.md +107 -0
  304. package/assets/prompts/mkdocs-translations.prompt.md +110 -0
  305. package/assets/prompts/model-recommendation.prompt.md +677 -0
  306. package/assets/prompts/multi-stage-dockerfile.prompt.md +47 -0
  307. package/assets/prompts/my-issues.prompt.md +9 -0
  308. package/assets/prompts/my-pull-requests.prompt.md +15 -0
  309. package/assets/prompts/next-intl-add-language.prompt.md +20 -0
  310. package/assets/prompts/php-mcp-server-generator.prompt.md +522 -0
  311. package/assets/prompts/playwright-automation-fill-in-form.prompt.md +30 -0
  312. package/assets/prompts/playwright-explore-website.prompt.md +19 -0
  313. package/assets/prompts/playwright-generate-test.prompt.md +19 -0
  314. package/assets/prompts/postgresql-code-review.prompt.md +214 -0
  315. package/assets/prompts/postgresql-optimization.prompt.md +406 -0
  316. package/assets/prompts/power-apps-code-app-scaffold.prompt.md +150 -0
  317. package/assets/prompts/power-bi-dax-optimization.prompt.md +175 -0
  318. package/assets/prompts/power-bi-model-design-review.prompt.md +405 -0
  319. package/assets/prompts/power-bi-performance-troubleshooting.prompt.md +384 -0
  320. package/assets/prompts/power-bi-report-design-consultation.prompt.md +353 -0
  321. package/assets/prompts/power-platform-mcp-connector-suite.prompt.md +156 -0
  322. package/assets/prompts/project-workflow-analysis-blueprint-generator.prompt.md +294 -0
  323. package/assets/prompts/prompt-builder.prompt.md +142 -0
  324. package/assets/prompts/pytest-coverage.prompt.md +28 -0
  325. package/assets/prompts/python-mcp-server-generator.prompt.md +105 -0
  326. package/assets/prompts/readme-blueprint-generator.prompt.md +79 -0
  327. package/assets/prompts/remember-interactive-programming.prompt.md +13 -0
  328. package/assets/prompts/remember.prompt.md +125 -0
  329. package/assets/prompts/repo-story-time.prompt.md +156 -0
  330. package/assets/prompts/review-and-refactor.prompt.md +15 -0
  331. package/assets/prompts/ruby-mcp-server-generator.prompt.md +660 -0
  332. package/assets/prompts/rust-mcp-server-generator.prompt.md +578 -0
  333. package/assets/prompts/shuffle-json-data.prompt.md +151 -0
  334. package/assets/prompts/sql-code-review.prompt.md +303 -0
  335. package/assets/prompts/sql-optimization.prompt.md +298 -0
  336. package/assets/prompts/suggest-awesome-github-copilot-agents.prompt.md +72 -0
  337. package/assets/prompts/suggest-awesome-github-copilot-chatmodes.prompt.md +71 -0
  338. package/assets/prompts/suggest-awesome-github-copilot-collections.prompt.md +149 -0
  339. package/assets/prompts/suggest-awesome-github-copilot-instructions.prompt.md +88 -0
  340. package/assets/prompts/suggest-awesome-github-copilot-prompts.prompt.md +71 -0
  341. package/assets/prompts/swift-mcp-server-generator.prompt.md +669 -0
  342. package/assets/prompts/technology-stack-blueprint-generator.prompt.md +242 -0
  343. package/assets/prompts/typescript-mcp-server-generator.prompt.md +90 -0
  344. package/assets/prompts/update-avm-modules-in-bicep.prompt.md +60 -0
  345. package/assets/prompts/update-implementation-plan.prompt.md +157 -0
  346. package/assets/prompts/update-llms.prompt.md +216 -0
  347. package/assets/prompts/update-markdown-file-index.prompt.md +76 -0
  348. package/assets/prompts/update-oo-component-documentation.prompt.md +162 -0
  349. package/assets/prompts/update-specification.prompt.md +127 -0
  350. package/assets/prompts/write-coding-standards-from-file.prompt.md +316 -0
  351. package/bin/cli.js +200 -0
  352. package/package.json +53 -0
  353. package/scripts/sync.js +99 -0
  354. package/verdaccio/config.yaml +202 -0
@@ -0,0 +1,810 @@
1
+ ---
2
+ description: 'Comprehensive Power BI custom visuals development guide covering React, D3.js integration, TypeScript patterns, testing frameworks, and advanced visualization techniques.'
3
+ applyTo: '**/*.{ts,tsx,js,jsx,json,less,css}'
4
+ ---
5
+
6
+ # Power BI Custom Visuals Development Best Practices
7
+
8
+ ## Overview
9
+ This document provides comprehensive instructions for developing custom Power BI visuals using modern web technologies including React, D3.js, TypeScript, and advanced testing frameworks, based on Microsoft's official guidance and community best practices.
10
+
11
+ ## Development Environment Setup
12
+
13
+ ### 1. Project Initialization
14
+ ```typescript
15
+ // Install Power BI visuals tools globally
16
+ npm install -g powerbi-visuals-tools
17
+
18
+ // Create new visual project
19
+ pbiviz new MyCustomVisual
20
+ cd MyCustomVisual
21
+
22
+ // Start development server
23
+ pbiviz start
24
+ ```
25
+
26
+ ### 2. TypeScript Configuration
27
+ ```json
28
+ {
29
+ "compilerOptions": {
30
+ "jsx": "react",
31
+ "types": ["react", "react-dom"],
32
+ "allowJs": false,
33
+ "emitDecoratorMetadata": true,
34
+ "experimentalDecorators": true,
35
+ "target": "es6",
36
+ "sourceMap": true,
37
+ "outDir": "./.tmp/build/",
38
+ "moduleResolution": "node",
39
+ "declaration": true,
40
+ "lib": [
41
+ "es2015",
42
+ "dom"
43
+ ]
44
+ },
45
+ "files": [
46
+ "./src/visual.ts"
47
+ ]
48
+ }
49
+ ```
50
+
51
+ ## Core Visual Development Patterns
52
+
53
+ ### 1. Basic Visual Structure
54
+ ```typescript
55
+ "use strict";
56
+ import powerbi from "powerbi-visuals-api";
57
+
58
+ import DataView = powerbi.DataView;
59
+ import VisualConstructorOptions = powerbi.extensibility.visual.VisualConstructorOptions;
60
+ import VisualUpdateOptions = powerbi.extensibility.visual.VisualUpdateOptions;
61
+ import IVisual = powerbi.extensibility.visual.IVisual;
62
+ import IVisualHost = powerbi.extensibility.IVisualHost;
63
+
64
+ import "./../style/visual.less";
65
+
66
+ export class Visual implements IVisual {
67
+ private target: HTMLElement;
68
+ private host: IVisualHost;
69
+
70
+ constructor(options: VisualConstructorOptions) {
71
+ this.target = options.element;
72
+ this.host = options.host;
73
+ }
74
+
75
+ public update(options: VisualUpdateOptions) {
76
+ const dataView: DataView = options.dataViews[0];
77
+
78
+ if (!dataView) {
79
+ return;
80
+ }
81
+
82
+ // Visual update logic here
83
+ }
84
+
85
+ public getFormattingModel(): powerbi.visuals.FormattingModel {
86
+ return this.formattingSettingsService.buildFormattingModel(this.formattingSettings);
87
+ }
88
+ }
89
+ ```
90
+
91
+ ### 2. Data View Processing
92
+ ```typescript
93
+ // Single data mapping example
94
+ export class Visual implements IVisual {
95
+ private valueText: HTMLParagraphElement;
96
+
97
+ constructor(options: VisualConstructorOptions) {
98
+ this.target = options.element;
99
+ this.host = options.host;
100
+ this.valueText = document.createElement("p");
101
+ this.target.appendChild(this.valueText);
102
+ }
103
+
104
+ public update(options: VisualUpdateOptions) {
105
+ const dataView: DataView = options.dataViews[0];
106
+ const singleDataView: DataViewSingle = dataView.single;
107
+
108
+ if (!singleDataView || !singleDataView.value ) {
109
+ return;
110
+ }
111
+
112
+ this.valueText.innerText = singleDataView.value.toString();
113
+ }
114
+ }
115
+ ```
116
+
117
+ ## React Integration
118
+
119
+ ### 1. React Visual Setup
120
+ ```typescript
121
+ import * as React from "react";
122
+ import * as ReactDOM from "react-dom";
123
+ import ReactCircleCard from "./component";
124
+
125
+ export class Visual implements IVisual {
126
+ private target: HTMLElement;
127
+ private reactRoot: React.ComponentElement<any, any>;
128
+
129
+ constructor(options: VisualConstructorOptions) {
130
+ this.reactRoot = React.createElement(ReactCircleCard, {});
131
+ this.target = options.element;
132
+
133
+ ReactDOM.render(this.reactRoot, this.target);
134
+ }
135
+
136
+ public update(options: VisualUpdateOptions) {
137
+ const dataView: DataView = options.dataViews[0];
138
+
139
+ if (dataView) {
140
+ const reactProps = this.parseDataView(dataView);
141
+ this.reactRoot = React.createElement(ReactCircleCard, reactProps);
142
+ ReactDOM.render(this.reactRoot, this.target);
143
+ }
144
+ }
145
+
146
+ private parseDataView(dataView: DataView): any {
147
+ // Transform Power BI data for React component
148
+ return {
149
+ data: dataView.categorical?.values?.[0]?.values || [],
150
+ categories: dataView.categorical?.categories?.[0]?.values || []
151
+ };
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### 2. React Component with Props
157
+ ```typescript
158
+ // React component for Power BI visual
159
+ import * as React from "react";
160
+
161
+ export interface ReactCircleCardProps {
162
+ data: number[];
163
+ categories: string[];
164
+ size?: number;
165
+ color?: string;
166
+ }
167
+
168
+ export const ReactCircleCard: React.FC<ReactCircleCardProps> = (props) => {
169
+ const { data, categories, size = 200, color = "#3498db" } = props;
170
+
171
+ const maxValue = Math.max(...data);
172
+ const minValue = Math.min(...data);
173
+
174
+ return (
175
+ <div className="react-circle-card">
176
+ {data.map((value, index) => {
177
+ const radius = ((value - minValue) / (maxValue - minValue)) * size / 2;
178
+ return (
179
+ <div key={index} className="data-point">
180
+ <div
181
+ className="circle"
182
+ style={{
183
+ width: radius * 2,
184
+ height: radius * 2,
185
+ backgroundColor: color,
186
+ borderRadius: '50%'
187
+ }}
188
+ />
189
+ <span className="label">{categories[index]}: {value}</span>
190
+ </div>
191
+ );
192
+ })}
193
+ </div>
194
+ );
195
+ };
196
+
197
+ export default ReactCircleCard;
198
+ ```
199
+
200
+ ## D3.js Integration
201
+
202
+ ### 1. D3 with TypeScript
203
+ ```typescript
204
+ import * as d3 from "d3";
205
+ type Selection<T extends d3.BaseType> = d3.Selection<T, any, any, any>;
206
+
207
+ export class Visual implements IVisual {
208
+ private svg: Selection<SVGElement>;
209
+ private container: Selection<SVGElement>;
210
+ private host: IVisualHost;
211
+
212
+ constructor(options: VisualConstructorOptions) {
213
+ this.host = options.host;
214
+ this.svg = d3.select(options.element)
215
+ .append('svg')
216
+ .classed('visual-svg', true);
217
+
218
+ this.container = this.svg
219
+ .append('g')
220
+ .classed('visual-container', true);
221
+ }
222
+
223
+ public update(options: VisualUpdateOptions) {
224
+ const dataView = options.dataViews[0];
225
+
226
+ if (!dataView) {
227
+ return;
228
+ }
229
+
230
+ const width = options.viewport.width;
231
+ const height = options.viewport.height;
232
+
233
+ this.svg
234
+ .attr('width', width)
235
+ .attr('height', height);
236
+
237
+ // D3 data binding and visualization logic
238
+ this.renderChart(dataView, width, height);
239
+ }
240
+
241
+ private renderChart(dataView: DataView, width: number, height: number): void {
242
+ const data = this.transformData(dataView);
243
+
244
+ // Create scales
245
+ const xScale = d3.scaleBand()
246
+ .domain(data.map(d => d.category))
247
+ .range([0, width])
248
+ .padding(0.1);
249
+
250
+ const yScale = d3.scaleLinear()
251
+ .domain([0, d3.max(data, d => d.value)])
252
+ .range([height, 0]);
253
+
254
+ // Bind data and create bars
255
+ const bars = this.container.selectAll('.bar')
256
+ .data(data);
257
+
258
+ bars.enter()
259
+ .append('rect')
260
+ .classed('bar', true)
261
+ .merge(bars)
262
+ .attr('x', d => xScale(d.category))
263
+ .attr('y', d => yScale(d.value))
264
+ .attr('width', xScale.bandwidth())
265
+ .attr('height', d => height - yScale(d.value))
266
+ .style('fill', '#3498db');
267
+
268
+ bars.exit().remove();
269
+ }
270
+
271
+ private transformData(dataView: DataView): any[] {
272
+ // Transform Power BI DataView to D3-friendly format
273
+ const categorical = dataView.categorical;
274
+ const categories = categorical.categories[0];
275
+ const values = categorical.values[0];
276
+
277
+ return categories.values.map((category, index) => ({
278
+ category: category.toString(),
279
+ value: values.values[index] as number
280
+ }));
281
+ }
282
+ }
283
+ ```
284
+
285
+ ### 2. Advanced D3 Patterns
286
+ ```typescript
287
+ // Complex D3 visualization with interactions
288
+ export class AdvancedD3Visual implements IVisual {
289
+ private svg: Selection<SVGElement>;
290
+ private tooltip: Selection<HTMLDivElement>;
291
+ private selectionManager: ISelectionManager;
292
+
293
+ constructor(options: VisualConstructorOptions) {
294
+ this.host = options.host;
295
+ this.selectionManager = this.host.createSelectionManager();
296
+
297
+ // Create main SVG
298
+ this.svg = d3.select(options.element)
299
+ .append('svg');
300
+
301
+ // Create tooltip
302
+ this.tooltip = d3.select(options.element)
303
+ .append('div')
304
+ .classed('tooltip', true)
305
+ .style('opacity', 0);
306
+ }
307
+
308
+ private createInteractiveElements(data: VisualDataPoint[]): void {
309
+ const circles = this.svg.selectAll('.data-circle')
310
+ .data(data);
311
+
312
+ const circlesEnter = circles.enter()
313
+ .append('circle')
314
+ .classed('data-circle', true);
315
+
316
+ circlesEnter.merge(circles)
317
+ .attr('cx', d => d.x)
318
+ .attr('cy', d => d.y)
319
+ .attr('r', d => d.radius)
320
+ .style('fill', d => d.color)
321
+ .style('stroke', d => d.strokeColor)
322
+ .style('stroke-width', d => `${d.strokeWidth}px`)
323
+ .on('click', (event, d) => {
324
+ // Handle selection
325
+ this.selectionManager.select(d.selectionId, event.ctrlKey);
326
+ })
327
+ .on('mouseover', (event, d) => {
328
+ // Show tooltip
329
+ this.tooltip
330
+ .style('opacity', 1)
331
+ .style('left', (event.pageX + 10) + 'px')
332
+ .style('top', (event.pageY - 10) + 'px')
333
+ .html(`${d.category}: ${d.value}`);
334
+ })
335
+ .on('mouseout', () => {
336
+ // Hide tooltip
337
+ this.tooltip.style('opacity', 0);
338
+ });
339
+
340
+ circles.exit().remove();
341
+ }
342
+ }
343
+ ```
344
+
345
+ ## Advanced Visual Features
346
+
347
+ ### 1. Custom Formatting Model
348
+ ```typescript
349
+ import { formattingSettings } from "powerbi-visuals-utils-formattingmodel";
350
+
351
+ export class VisualFormattingSettingsModel extends formattingSettings.CompositeFormattingSettingsModel {
352
+ // Color settings card
353
+ public colorCard: ColorCardSettings = new ColorCardSettings();
354
+
355
+ // Data point settings card
356
+ public dataPointCard: DataPointCardSettings = new DataPointCardSettings();
357
+
358
+ // General settings card
359
+ public generalCard: GeneralCardSettings = new GeneralCardSettings();
360
+
361
+ public cards: formattingSettings.SimpleCard[] = [this.colorCard, this.dataPointCard, this.generalCard];
362
+ }
363
+
364
+ export class ColorCardSettings extends formattingSettings.SimpleCard {
365
+ name: string = "colorCard";
366
+ displayName: string = "Color";
367
+
368
+ public defaultColor: formattingSettings.ColorPicker = new formattingSettings.ColorPicker({
369
+ name: "defaultColor",
370
+ displayName: "Default color",
371
+ value: { value: "#3498db" }
372
+ });
373
+
374
+ public showAllDataPoints: formattingSettings.ToggleSwitch = new formattingSettings.ToggleSwitch({
375
+ name: "showAllDataPoints",
376
+ displayName: "Show all",
377
+ value: false
378
+ });
379
+ }
380
+ ```
381
+
382
+ ### 2. Interactivity and Selections
383
+ ```typescript
384
+ import { interactivitySelectionService, baseBehavior } from "powerbi-visuals-utils-interactivityutils";
385
+
386
+ export interface VisualDataPoint extends interactivitySelectionService.SelectableDataPoint {
387
+ value: powerbi.PrimitiveValue;
388
+ category: string;
389
+ color: string;
390
+ selectionId: ISelectionId;
391
+ }
392
+
393
+ export class VisualBehavior extends baseBehavior.BaseBehavior<VisualDataPoint> {
394
+ protected bindClick() {
395
+ // Implement click behavior for data point selection
396
+ this.behaviorOptions.clearCatcher.on('click', () => {
397
+ this.selectionHandler.handleClearSelection();
398
+ });
399
+
400
+ this.behaviorOptions.elementsSelection.on('click', (event, dataPoint) => {
401
+ event.stopPropagation();
402
+ this.selectionHandler.handleSelection(dataPoint, event.ctrlKey);
403
+ });
404
+ }
405
+
406
+ protected bindContextMenu() {
407
+ // Implement context menu behavior
408
+ this.behaviorOptions.elementsSelection.on('contextmenu', (event, dataPoint) => {
409
+ this.selectionHandler.handleContextMenu(
410
+ dataPoint ? dataPoint.selectionId : null,
411
+ {
412
+ x: event.clientX,
413
+ y: event.clientY
414
+ }
415
+ );
416
+ event.preventDefault();
417
+ });
418
+ }
419
+ }
420
+ ```
421
+
422
+ ### 3. Landing Page Implementation
423
+ ```typescript
424
+ export class Visual implements IVisual {
425
+ private element: HTMLElement;
426
+ private isLandingPageOn: boolean;
427
+ private LandingPageRemoved: boolean;
428
+ private LandingPage: d3.Selection<any>;
429
+
430
+ constructor(options: VisualConstructorOptions) {
431
+ this.element = options.element;
432
+ }
433
+
434
+ public update(options: VisualUpdateOptions) {
435
+ this.HandleLandingPage(options);
436
+ }
437
+
438
+ private HandleLandingPage(options: VisualUpdateOptions) {
439
+ if(!options.dataViews || !options.dataViews[0]?.metadata?.columns?.length){
440
+ if(!this.isLandingPageOn) {
441
+ this.isLandingPageOn = true;
442
+ const SampleLandingPage: Element = this.createSampleLandingPage();
443
+ this.element.appendChild(SampleLandingPage);
444
+ this.LandingPage = d3.select(SampleLandingPage);
445
+ }
446
+ } else {
447
+ if(this.isLandingPageOn && !this.LandingPageRemoved){
448
+ this.LandingPageRemoved = true;
449
+ this.LandingPage.remove();
450
+ }
451
+ }
452
+ }
453
+
454
+ private createSampleLandingPage(): Element {
455
+ const landingPage = document.createElement("div");
456
+ landingPage.className = "landing-page";
457
+ landingPage.innerHTML = `
458
+ <div class="landing-page-content">
459
+ <h2>Custom Visual</h2>
460
+ <p>Add data to get started</p>
461
+ <div class="landing-page-icon">📊</div>
462
+ </div>
463
+ `;
464
+ return landingPage;
465
+ }
466
+ }
467
+ ```
468
+
469
+ ## Testing Framework
470
+
471
+ ### 1. Unit Testing Setup
472
+ ```typescript
473
+ // Webpack configuration for testing
474
+ const path = require('path');
475
+ const webpack = require("webpack");
476
+
477
+ module.exports = {
478
+ devtool: 'source-map',
479
+ mode: 'development',
480
+ module: {
481
+ rules: [
482
+ {
483
+ test: /\.tsx?$/,
484
+ use: 'ts-loader',
485
+ exclude: /node_modules/
486
+ },
487
+ {
488
+ test: /\.json$/,
489
+ loader: 'json-loader'
490
+ },
491
+ {
492
+ test: /\.tsx?$/i,
493
+ enforce: 'post',
494
+ include: path.resolve(__dirname, 'src'),
495
+ exclude: /(node_modules|resources\/js\/vendor)/,
496
+ loader: 'coverage-istanbul-loader',
497
+ options: { esModules: true }
498
+ }
499
+ ]
500
+ },
501
+ externals: {
502
+ "powerbi-visuals-api": '{}'
503
+ },
504
+ resolve: {
505
+ extensions: ['.tsx', '.ts', '.js', '.css']
506
+ },
507
+ output: {
508
+ path: path.resolve(__dirname, ".tmp/test")
509
+ },
510
+ plugins: [
511
+ new webpack.ProvidePlugin({
512
+ 'powerbi-visuals-api': null
513
+ })
514
+ ]
515
+ };
516
+ ```
517
+
518
+ ### 2. Visual Testing Utilities
519
+ ```typescript
520
+ // Test utilities for Power BI visuals
521
+ export class VisualTestUtils {
522
+ public static d3Click(element: JQuery, x: number, y: number): void {
523
+ const event = new MouseEvent('click', {
524
+ clientX: x,
525
+ clientY: y,
526
+ button: 0
527
+ });
528
+ element[0].dispatchEvent(event);
529
+ }
530
+
531
+ public static d3KeyEvent(element: JQuery, typeArg: string, keyArg: string, keyCode: number): void {
532
+ const event = new KeyboardEvent(typeArg, {
533
+ key: keyArg,
534
+ code: keyArg,
535
+ keyCode: keyCode
536
+ });
537
+ element[0].dispatchEvent(event);
538
+ }
539
+
540
+ public static createVisualHost(): IVisualHost {
541
+ return {
542
+ createSelectionIdBuilder: () => new SelectionIdBuilder(),
543
+ createSelectionManager: () => new SelectionManager(),
544
+ colorPalette: new ColorPalette(),
545
+ eventService: new EventService(),
546
+ tooltipService: new TooltipService()
547
+ } as IVisualHost;
548
+ }
549
+
550
+ public static createUpdateOptions(dataView: DataView, viewport?: IViewport): VisualUpdateOptions {
551
+ return {
552
+ dataViews: [dataView],
553
+ viewport: viewport || { width: 500, height: 500 },
554
+ operationKind: VisualDataChangeOperationKind.Create,
555
+ type: VisualUpdateType.Data
556
+ };
557
+ }
558
+ }
559
+ ```
560
+
561
+ ### 3. Component Testing
562
+ ```typescript
563
+ // Jest test for React component
564
+ import * as React from 'react';
565
+ import { render, screen } from '@testing-library/react';
566
+ import '@testing-library/jest-dom';
567
+ import ReactCircleCard from '../src/component';
568
+
569
+ describe('ReactCircleCard', () => {
570
+ const mockProps = {
571
+ data: [10, 20, 30],
572
+ categories: ['A', 'B', 'C'],
573
+ size: 200,
574
+ color: '#3498db'
575
+ };
576
+
577
+ test('renders with correct data points', () => {
578
+ render(<ReactCircleCard {...mockProps} />);
579
+
580
+ expect(screen.getByText('A: 10')).toBeInTheDocument();
581
+ expect(screen.getByText('B: 20')).toBeInTheDocument();
582
+ expect(screen.getByText('C: 30')).toBeInTheDocument();
583
+ });
584
+
585
+ test('applies correct styling', () => {
586
+ render(<ReactCircleCard {...mockProps} />);
587
+
588
+ const circles = document.querySelectorAll('.circle');
589
+ expect(circles).toHaveLength(3);
590
+
591
+ circles.forEach(circle => {
592
+ expect(circle).toHaveStyle('backgroundColor: #3498db');
593
+ expect(circle).toHaveStyle('borderRadius: 50%');
594
+ });
595
+ });
596
+
597
+ test('handles empty data gracefully', () => {
598
+ const emptyProps = { ...mockProps, data: [], categories: [] };
599
+ const { container } = render(<ReactCircleCard {...emptyProps} />);
600
+
601
+ expect(container.querySelector('.data-point')).toBeNull();
602
+ });
603
+ });
604
+ ```
605
+
606
+ ## Advanced Patterns
607
+
608
+ ### 1. Dialog Box Implementation
609
+ ```typescript
610
+ import DialogConstructorOptions = powerbi.extensibility.visual.DialogConstructorOptions;
611
+ import DialogAction = powerbi.DialogAction;
612
+ import * as ReactDOM from 'react-dom';
613
+ import * as React from 'react';
614
+
615
+ export class CustomDialog {
616
+ private dialogContainer: HTMLElement;
617
+
618
+ constructor(options: DialogConstructorOptions) {
619
+ this.dialogContainer = options.element;
620
+ this.initializeDialog();
621
+ }
622
+
623
+ private initializeDialog(): void {
624
+ const dialogContent = React.createElement(DialogContent, {
625
+ onSave: this.handleSave.bind(this),
626
+ onCancel: this.handleCancel.bind(this)
627
+ });
628
+
629
+ ReactDOM.render(dialogContent, this.dialogContainer);
630
+ }
631
+
632
+ private handleSave(data: any): void {
633
+ // Process save action
634
+ this.closeDialog(DialogAction.Save, data);
635
+ }
636
+
637
+ private handleCancel(): void {
638
+ // Process cancel action
639
+ this.closeDialog(DialogAction.Cancel);
640
+ }
641
+
642
+ private closeDialog(action: DialogAction, data?: any): void {
643
+ // Close dialog with action and optional data
644
+ powerbi.extensibility.visual.DialogUtils.closeDialog(action, data);
645
+ }
646
+ }
647
+ ```
648
+
649
+ ### 2. Conditional Formatting Integration
650
+ ```typescript
651
+ import powerbiVisualsApi from "powerbi-visuals-api";
652
+ import { ColorHelper } from "powerbi-visuals-utils-colorutils";
653
+
654
+ export class Visual implements IVisual {
655
+ private colorHelper: ColorHelper;
656
+
657
+ constructor(options: VisualConstructorOptions) {
658
+ this.colorHelper = new ColorHelper(
659
+ options.host.colorPalette,
660
+ { objectName: "dataPoint", propertyName: "fill" },
661
+ "#3498db" // Default color
662
+ );
663
+ }
664
+
665
+ private applyConditionalFormatting(dataPoints: VisualDataPoint[]): VisualDataPoint[] {
666
+ return dataPoints.map(dataPoint => {
667
+ // Get conditional formatting color
668
+ const color = this.colorHelper.getColorForDataPoint(dataPoint.dataViewObject);
669
+
670
+ return {
671
+ ...dataPoint,
672
+ color: color,
673
+ strokeColor: this.darkenColor(color, 0.2),
674
+ strokeWidth: 2
675
+ };
676
+ });
677
+ }
678
+
679
+ private darkenColor(color: string, amount: number): string {
680
+ // Utility function to darken a color for stroke
681
+ const colorObj = d3.color(color);
682
+ return colorObj ? colorObj.darker(amount).toString() : color;
683
+ }
684
+ }
685
+ ```
686
+
687
+ ### 3. Tooltip Integration
688
+ ```typescript
689
+ import { createTooltipServiceWrapper, TooltipEventArgs, ITooltipServiceWrapper } from "powerbi-visuals-utils-tooltiputils";
690
+
691
+ export class Visual implements IVisual {
692
+ private tooltipServiceWrapper: ITooltipServiceWrapper;
693
+
694
+ constructor(options: VisualConstructorOptions) {
695
+ this.tooltipServiceWrapper = createTooltipServiceWrapper(
696
+ options.host.tooltipService,
697
+ options.element
698
+ );
699
+ }
700
+
701
+ private addTooltips(selection: d3.Selection<any, VisualDataPoint, any, any>): void {
702
+ this.tooltipServiceWrapper.addTooltip(
703
+ selection,
704
+ (tooltipEvent: TooltipEventArgs<VisualDataPoint>) => {
705
+ const dataPoint = tooltipEvent.data;
706
+ return [
707
+ {
708
+ displayName: "Category",
709
+ value: dataPoint.category
710
+ },
711
+ {
712
+ displayName: "Value",
713
+ value: dataPoint.value.toString()
714
+ },
715
+ {
716
+ displayName: "Percentage",
717
+ value: `${((dataPoint.value / this.totalValue) * 100).toFixed(1)}%`
718
+ }
719
+ ];
720
+ }
721
+ );
722
+ }
723
+ }
724
+ ```
725
+
726
+ ## Performance Optimization
727
+
728
+ ### 1. Data Reduction Strategies
729
+ ```json
730
+ // Visual capabilities with data reduction
731
+ "dataViewMappings": {
732
+ "categorical": {
733
+ "categories": {
734
+ "for": { "in": "category" },
735
+ "dataReductionAlgorithm": {
736
+ "window": {
737
+ "count": 300
738
+ }
739
+ }
740
+ },
741
+ "values": {
742
+ "group": {
743
+ "by": "series",
744
+ "select": [{
745
+ "for": {
746
+ "in": "measure"
747
+ }
748
+ }],
749
+ "dataReductionAlgorithm": {
750
+ "top": {
751
+ "count": 100
752
+ }
753
+ }
754
+ }
755
+ }
756
+ }
757
+ }
758
+ ```
759
+
760
+ ### 2. Efficient Rendering Patterns
761
+ ```typescript
762
+ export class OptimizedVisual implements IVisual {
763
+ private animationFrameId: number;
764
+ private renderQueue: (() => void)[] = [];
765
+
766
+ public update(options: VisualUpdateOptions) {
767
+ // Queue render operation instead of immediate execution
768
+ this.queueRender(() => this.performUpdate(options));
769
+ }
770
+
771
+ private queueRender(renderFunction: () => void): void {
772
+ this.renderQueue.push(renderFunction);
773
+
774
+ if (!this.animationFrameId) {
775
+ this.animationFrameId = requestAnimationFrame(() => {
776
+ this.processRenderQueue();
777
+ });
778
+ }
779
+ }
780
+
781
+ private processRenderQueue(): void {
782
+ // Process all queued render operations
783
+ while (this.renderQueue.length > 0) {
784
+ const renderFunction = this.renderQueue.shift();
785
+ if (renderFunction) {
786
+ renderFunction();
787
+ }
788
+ }
789
+
790
+ this.animationFrameId = null;
791
+ }
792
+
793
+ private performUpdate(options: VisualUpdateOptions): void {
794
+ // Use virtual DOM or efficient diffing strategies
795
+ const currentData = this.transformData(options.dataViews[0]);
796
+
797
+ if (this.hasDataChanged(currentData)) {
798
+ this.renderVisualization(currentData);
799
+ this.previousData = currentData;
800
+ }
801
+ }
802
+
803
+ private hasDataChanged(newData: any[]): boolean {
804
+ // Efficient data comparison
805
+ return JSON.stringify(newData) !== JSON.stringify(this.previousData);
806
+ }
807
+ }
808
+ ```
809
+
810
+ Remember: Custom visual development requires understanding both Power BI's visual framework and modern web development practices. Focus on creating reusable, testable, and performant visualizations that enhance the Power BI ecosystem.