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.
- package/.env.example +1 -0
- package/.gitattributes +1 -0
- package/.github/workflows/manual-publish.yml +36 -0
- package/.github/workflows/sync-and-publish.yml +58 -0
- package/.release-it.json +20 -0
- package/CHANGELOG.md +43 -0
- package/README.md +62 -0
- package/assets/chatmodes/4.1-Beast.chatmode.md +152 -0
- package/assets/chatmodes/Thinking-Beast-Mode.chatmode.md +337 -0
- package/assets/chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +644 -0
- package/assets/chatmodes/accessibility.chatmode.md +298 -0
- package/assets/chatmodes/address-comments.chatmode.md +59 -0
- package/assets/chatmodes/aem-frontend-specialist.chatmode.md +385 -0
- package/assets/chatmodes/api-architect.chatmode.md +40 -0
- package/assets/chatmodes/atlassian-requirements-to-jira.chatmode.md +444 -0
- package/assets/chatmodes/azure-logic-apps-expert.chatmode.md +100 -0
- package/assets/chatmodes/azure-principal-architect.chatmode.md +58 -0
- package/assets/chatmodes/azure-saas-architect.chatmode.md +118 -0
- package/assets/chatmodes/azure-verified-modules-bicep.chatmode.md +44 -0
- package/assets/chatmodes/azure-verified-modules-terraform.chatmode.md +58 -0
- package/assets/chatmodes/bicep-implement.chatmode.md +40 -0
- package/assets/chatmodes/bicep-plan.chatmode.md +112 -0
- package/assets/chatmodes/blueprint-mode-codex.chatmode.md +110 -0
- package/assets/chatmodes/blueprint-mode.chatmode.md +171 -0
- package/assets/chatmodes/clojure-interactive-programming.chatmode.md +174 -0
- package/assets/chatmodes/code-tour.chatmode.md +205 -0
- package/assets/chatmodes/critical-thinking.chatmode.md +23 -0
- package/assets/chatmodes/csharp-dotnet-janitor.chatmode.md +83 -0
- package/assets/chatmodes/csharp-mcp-expert.chatmode.md +69 -0
- package/assets/chatmodes/debug.chatmode.md +79 -0
- package/assets/chatmodes/declarative-agents-architect.chatmode.md +76 -0
- package/assets/chatmodes/demonstrate-understanding.chatmode.md +60 -0
- package/assets/chatmodes/dotnet-upgrade.chatmode.md +222 -0
- package/assets/chatmodes/drupal-expert.chatmode.md +687 -0
- package/assets/chatmodes/electron-angular-native.chatmode.md +285 -0
- package/assets/chatmodes/expert-cpp-software-engineer.chatmode.md +27 -0
- package/assets/chatmodes/expert-dotnet-software-engineer.chatmode.md +22 -0
- package/assets/chatmodes/expert-nextjs-developer.chatmode.md +477 -0
- package/assets/chatmodes/expert-react-frontend-engineer.chatmode.md +738 -0
- package/assets/chatmodes/gilfoyle.chatmode.md +66 -0
- package/assets/chatmodes/go-mcp-expert.chatmode.md +122 -0
- package/assets/chatmodes/gpt-5-beast-mode.chatmode.md +109 -0
- package/assets/chatmodes/hlbpa.chatmode.md +232 -0
- package/assets/chatmodes/implementation-plan.chatmode.md +159 -0
- package/assets/chatmodes/janitor.chatmode.md +89 -0
- package/assets/chatmodes/java-mcp-expert.chatmode.md +325 -0
- package/assets/chatmodes/kotlin-mcp-expert.chatmode.md +181 -0
- package/assets/chatmodes/kusto-assistant.chatmode.md +143 -0
- package/assets/chatmodes/laravel-expert-agent.chatmode.md +628 -0
- package/assets/chatmodes/mentor.chatmode.md +32 -0
- package/assets/chatmodes/meta-agentic-project-scaffold.chatmode.md +15 -0
- package/assets/chatmodes/microsoft-agent-framework-dotnet.chatmode.md +62 -0
- package/assets/chatmodes/microsoft-agent-framework-python.chatmode.md +62 -0
- package/assets/chatmodes/microsoft-study-mode.chatmode.md +32 -0
- package/assets/chatmodes/microsoft_learn_contributor.chatmode.md +388 -0
- package/assets/chatmodes/ms-sql-dba.chatmode.md +25 -0
- package/assets/chatmodes/php-mcp-expert.chatmode.md +498 -0
- package/assets/chatmodes/pimcore-expert.chatmode.md +869 -0
- package/assets/chatmodes/plan.chatmode.md +114 -0
- package/assets/chatmodes/planner.chatmode.md +14 -0
- package/assets/chatmodes/playwright-tester.chatmode.md +13 -0
- package/assets/chatmodes/postgresql-dba.chatmode.md +17 -0
- package/assets/chatmodes/power-bi-data-modeling-expert.chatmode.md +319 -0
- package/assets/chatmodes/power-bi-dax-expert.chatmode.md +334 -0
- package/assets/chatmodes/power-bi-performance-expert.chatmode.md +533 -0
- package/assets/chatmodes/power-bi-visualization-expert.chatmode.md +549 -0
- package/assets/chatmodes/power-platform-expert.chatmode.md +116 -0
- package/assets/chatmodes/power-platform-mcp-integration-expert.chatmode.md +149 -0
- package/assets/chatmodes/prd.chatmode.md +201 -0
- package/assets/chatmodes/principal-software-engineer.chatmode.md +41 -0
- package/assets/chatmodes/prompt-builder.chatmode.md +352 -0
- package/assets/chatmodes/prompt-engineer.chatmode.md +72 -0
- package/assets/chatmodes/python-mcp-expert.chatmode.md +99 -0
- package/assets/chatmodes/refine-issue.chatmode.md +34 -0
- package/assets/chatmodes/research-technical-spike.chatmode.md +169 -0
- package/assets/chatmodes/ruby-mcp-expert.chatmode.md +346 -0
- package/assets/chatmodes/rust-gpt-4.1-beast-mode.chatmode.md +197 -0
- package/assets/chatmodes/rust-mcp-expert.chatmode.md +465 -0
- package/assets/chatmodes/search-ai-optimization-expert.chatmode.md +227 -0
- package/assets/chatmodes/semantic-kernel-dotnet.chatmode.md +31 -0
- package/assets/chatmodes/semantic-kernel-python.chatmode.md +28 -0
- package/assets/chatmodes/shopify-expert.chatmode.md +681 -0
- package/assets/chatmodes/simple-app-idea-generator.chatmode.md +134 -0
- package/assets/chatmodes/software-engineer-agent-v1.chatmode.md +164 -0
- package/assets/chatmodes/specification.chatmode.md +127 -0
- package/assets/chatmodes/swift-mcp-expert.chatmode.md +240 -0
- package/assets/chatmodes/task-planner.chatmode.md +374 -0
- package/assets/chatmodes/task-researcher.chatmode.md +254 -0
- package/assets/chatmodes/tdd-green.chatmode.md +59 -0
- package/assets/chatmodes/tdd-red.chatmode.md +59 -0
- package/assets/chatmodes/tdd-refactor.chatmode.md +84 -0
- package/assets/chatmodes/tech-debt-remediation-plan.chatmode.md +49 -0
- package/assets/chatmodes/terraform-azure-implement.chatmode.md +104 -0
- package/assets/chatmodes/terraform-azure-planning.chatmode.md +157 -0
- package/assets/chatmodes/typescript-mcp-expert.chatmode.md +91 -0
- package/assets/chatmodes/voidbeast-gpt41enhanced.chatmode.md +230 -0
- package/assets/chatmodes/wg-code-alchemist.chatmode.md +61 -0
- package/assets/chatmodes/wg-code-sentinel.chatmode.md +55 -0
- package/assets/collections/ai-prompt-engineering.json +18 -0
- package/assets/collections/angular-development.json +7 -0
- package/assets/collections/azure-cloud-architect.json +29 -0
- package/assets/collections/cpp-development.json +6 -0
- package/assets/collections/database-administration.json +8 -0
- package/assets/collections/devops-sre.json +11 -0
- package/assets/collections/dotnet-development.json +22 -0
- package/assets/collections/general-productivity.json +9 -0
- package/assets/collections/go-development.json +7 -0
- package/assets/collections/java-spring-developer.json +26 -0
- package/assets/collections/learning-mentoring.json +10 -0
- package/assets/collections/legacy-migration.json +4 -0
- package/assets/collections/mcp-specialist.json +41 -0
- package/assets/collections/mobile-development.json +4 -0
- package/assets/collections/php-cms-development.json +11 -0
- package/assets/collections/power-platform-specialist.json +31 -0
- package/assets/collections/project-management.json +12 -0
- package/assets/collections/python-development.json +13 -0
- package/assets/collections/quality-assurance.json +13 -0
- package/assets/collections/ruby-development.json +9 -0
- package/assets/collections/rust-development.json +10 -0
- package/assets/collections/security-specialist.json +8 -0
- package/assets/collections/software-architect.json +25 -0
- package/assets/collections/technical-writing.json +9 -0
- package/assets/collections/web-frontend-development.json +14 -0
- package/assets/instructions/a11y.instructions.md +369 -0
- package/assets/instructions/ai-prompt-engineering-safety-best-practices.instructions.md +867 -0
- package/assets/instructions/angular.instructions.md +104 -0
- package/assets/instructions/ansible.instructions.md +88 -0
- package/assets/instructions/aspnet-rest-apis.instructions.md +110 -0
- package/assets/instructions/astro.instructions.md +182 -0
- package/assets/instructions/azure-devops-pipelines.instructions.md +185 -0
- package/assets/instructions/azure-functions-typescript.instructions.md +14 -0
- package/assets/instructions/azure-logic-apps-power-automate.instructions.md +1943 -0
- package/assets/instructions/azure-verified-modules-terraform.instructions.md +229 -0
- package/assets/instructions/bicep-code-best-practices.instructions.md +54 -0
- package/assets/instructions/blazor.instructions.md +77 -0
- package/assets/instructions/clojure.instructions.md +349 -0
- package/assets/instructions/cmake-vcpkg.instructions.md +10 -0
- package/assets/instructions/codexer.instructions.md +428 -0
- package/assets/instructions/coldfusion-cfc.instructions.md +30 -0
- package/assets/instructions/coldfusion-cfm.instructions.md +28 -0
- package/assets/instructions/collections.instructions.md +54 -0
- package/assets/instructions/containerization-docker-best-practices.instructions.md +681 -0
- package/assets/instructions/convert-jpa-to-spring-data-cosmos.instructions.md +949 -0
- package/assets/instructions/copilot-thought-logging.instructions.md +62 -0
- package/assets/instructions/csharp-ja.instructions.md +114 -0
- package/assets/instructions/csharp-ko.instructions.md +77 -0
- package/assets/instructions/csharp-mcp-server.instructions.md +95 -0
- package/assets/instructions/csharp.instructions.md +114 -0
- package/assets/instructions/dart-n-flutter.instructions.md +447 -0
- package/assets/instructions/declarative-agents-microsoft365.instructions.md +316 -0
- package/assets/instructions/devbox-image-definition.instructions.md +302 -0
- package/assets/instructions/devops-core-principles.instructions.md +167 -0
- package/assets/instructions/dotnet-architecture-good-practices.instructions.md +279 -0
- package/assets/instructions/dotnet-framework.instructions.md +113 -0
- package/assets/instructions/dotnet-maui-9-to-dotnet-maui-10-upgrade.instructions.md +1922 -0
- package/assets/instructions/dotnet-maui.instructions.md +69 -0
- package/assets/instructions/dotnet-upgrade.instructions.md +287 -0
- package/assets/instructions/dotnet-wpf.instructions.md +79 -0
- package/assets/instructions/genaiscript.instructions.md +21 -0
- package/assets/instructions/generate-modern-terraform-code-for-azure.instructions.md +82 -0
- package/assets/instructions/gilfoyle-code-review.instructions.md +114 -0
- package/assets/instructions/github-actions-ci-cd-best-practices.instructions.md +607 -0
- package/assets/instructions/go-mcp-server.instructions.md +346 -0
- package/assets/instructions/go.instructions.md +373 -0
- package/assets/instructions/instructions.instructions.md +256 -0
- package/assets/instructions/java-11-to-java-17-upgrade.instructions.md +793 -0
- package/assets/instructions/java-17-to-java-21-upgrade.instructions.md +464 -0
- package/assets/instructions/java-21-to-java-25-upgrade.instructions.md +311 -0
- package/assets/instructions/java-mcp-server.instructions.md +553 -0
- package/assets/instructions/java.instructions.md +81 -0
- package/assets/instructions/joyride-user-project.instructions.md +206 -0
- package/assets/instructions/joyride-workspace-automation.instructions.md +46 -0
- package/assets/instructions/kotlin-mcp-server.instructions.md +481 -0
- package/assets/instructions/kubernetes-deployment-best-practices.instructions.md +307 -0
- package/assets/instructions/langchain-python.instructions.md +229 -0
- package/assets/instructions/localization.instructions.md +39 -0
- package/assets/instructions/makefile.instructions.md +410 -0
- package/assets/instructions/markdown.instructions.md +52 -0
- package/assets/instructions/memory-bank.instructions.md +299 -0
- package/assets/instructions/mongo-dba.instructions.md +25 -0
- package/assets/instructions/ms-sql-dba.instructions.md +25 -0
- package/assets/instructions/nestjs.instructions.md +406 -0
- package/assets/instructions/nextjs-tailwind.instructions.md +72 -0
- package/assets/instructions/nextjs.instructions.md +143 -0
- package/assets/instructions/nodejs-javascript-vitest.instructions.md +30 -0
- package/assets/instructions/object-calisthenics.instructions.md +302 -0
- package/assets/instructions/oqtane.instructions.md +86 -0
- package/assets/instructions/performance-optimization.instructions.md +420 -0
- package/assets/instructions/php-mcp-server.instructions.md +809 -0
- package/assets/instructions/playwright-dotnet.instructions.md +101 -0
- package/assets/instructions/playwright-python.instructions.md +62 -0
- package/assets/instructions/playwright-typescript.instructions.md +86 -0
- package/assets/instructions/power-apps-canvas-yaml.instructions.md +827 -0
- package/assets/instructions/power-apps-code-apps.instructions.md +601 -0
- package/assets/instructions/power-bi-custom-visuals-development.instructions.md +810 -0
- package/assets/instructions/power-bi-data-modeling-best-practices.instructions.md +639 -0
- package/assets/instructions/power-bi-dax-best-practices.instructions.md +795 -0
- package/assets/instructions/power-bi-devops-alm-best-practices.instructions.md +623 -0
- package/assets/instructions/power-bi-report-design-best-practices.instructions.md +752 -0
- package/assets/instructions/power-bi-security-rls-best-practices.instructions.md +504 -0
- package/assets/instructions/power-platform-connector.instructions.md +430 -0
- package/assets/instructions/power-platform-mcp-development.instructions.md +88 -0
- package/assets/instructions/powershell-pester-5.instructions.md +197 -0
- package/assets/instructions/powershell.instructions.md +356 -0
- package/assets/instructions/prompt.instructions.md +73 -0
- package/assets/instructions/python-mcp-server.instructions.md +204 -0
- package/assets/instructions/python.instructions.md +56 -0
- package/assets/instructions/quarkus-mcp-server-sse.instructions.md +49 -0
- package/assets/instructions/quarkus.instructions.md +98 -0
- package/assets/instructions/r.instructions.md +116 -0
- package/assets/instructions/reactjs.instructions.md +162 -0
- package/assets/instructions/ruby-mcp-server.instructions.md +629 -0
- package/assets/instructions/ruby-on-rails.instructions.md +124 -0
- package/assets/instructions/rust-mcp-server.instructions.md +715 -0
- package/assets/instructions/rust.instructions.md +135 -0
- package/assets/instructions/security-and-owasp.instructions.md +51 -0
- package/assets/instructions/self-explanatory-code-commenting.instructions.md +162 -0
- package/assets/instructions/shell.instructions.md +132 -0
- package/assets/instructions/spec-driven-workflow-v1.instructions.md +323 -0
- package/assets/instructions/springboot.instructions.md +68 -0
- package/assets/instructions/sql-sp-generation.instructions.md +74 -0
- package/assets/instructions/svelte.instructions.md +161 -0
- package/assets/instructions/swift-mcp-server.instructions.md +498 -0
- package/assets/instructions/taming-copilot.instructions.md +40 -0
- package/assets/instructions/tanstack-start-shadcn-tailwind.instructions.md +212 -0
- package/assets/instructions/task-implementation.instructions.md +190 -0
- package/assets/instructions/tasksync.instructions.md +352 -0
- package/assets/instructions/terraform-azure.instructions.md +254 -0
- package/assets/instructions/terraform-sap-btp.instructions.md +195 -0
- package/assets/instructions/terraform.instructions.md +113 -0
- package/assets/instructions/typescript-5-es2022.instructions.md +114 -0
- package/assets/instructions/typescript-mcp-server.instructions.md +228 -0
- package/assets/instructions/update-code-from-shorthand.instructions.md +130 -0
- package/assets/instructions/vuejs3.instructions.md +153 -0
- package/assets/instructions/wordpress.instructions.md +186 -0
- package/assets/prompts/add-educational-comments.prompt.md +129 -0
- package/assets/prompts/ai-prompt-engineering-safety-review.prompt.md +230 -0
- package/assets/prompts/architecture-blueprint-generator.prompt.md +322 -0
- package/assets/prompts/aspnet-minimal-api-openapi.prompt.md +42 -0
- package/assets/prompts/az-cost-optimize.prompt.md +305 -0
- package/assets/prompts/azure-resource-health-diagnose.prompt.md +290 -0
- package/assets/prompts/boost-prompt.prompt.md +25 -0
- package/assets/prompts/breakdown-epic-arch.prompt.md +66 -0
- package/assets/prompts/breakdown-epic-pm.prompt.md +58 -0
- package/assets/prompts/breakdown-feature-implementation.prompt.md +128 -0
- package/assets/prompts/breakdown-feature-prd.prompt.md +61 -0
- package/assets/prompts/breakdown-plan.prompt.md +509 -0
- package/assets/prompts/breakdown-test.prompt.md +365 -0
- package/assets/prompts/code-exemplars-blueprint-generator.prompt.md +126 -0
- package/assets/prompts/comment-code-generate-a-tutorial.prompt.md +26 -0
- package/assets/prompts/containerize-aspnet-framework.prompt.md +455 -0
- package/assets/prompts/containerize-aspnetcore.prompt.md +393 -0
- package/assets/prompts/conventional-commit.prompt.md +73 -0
- package/assets/prompts/copilot-instructions-blueprint-generator.prompt.md +294 -0
- package/assets/prompts/cosmosdb-datamodeling.prompt.md +1045 -0
- package/assets/prompts/create-agentsmd.prompt.md +249 -0
- package/assets/prompts/create-architectural-decision-record.prompt.md +97 -0
- package/assets/prompts/create-github-action-workflow-specification.prompt.md +276 -0
- package/assets/prompts/create-github-issue-feature-from-specification.prompt.md +28 -0
- package/assets/prompts/create-github-issues-feature-from-implementation-plan.prompt.md +28 -0
- package/assets/prompts/create-github-issues-for-unmet-specification-requirements.prompt.md +35 -0
- package/assets/prompts/create-github-pull-request-from-specification.prompt.md +24 -0
- package/assets/prompts/create-implementation-plan.prompt.md +157 -0
- package/assets/prompts/create-llms.prompt.md +210 -0
- package/assets/prompts/create-oo-component-documentation.prompt.md +193 -0
- package/assets/prompts/create-readme.prompt.md +21 -0
- package/assets/prompts/create-specification.prompt.md +127 -0
- package/assets/prompts/create-spring-boot-java-project.prompt.md +163 -0
- package/assets/prompts/create-spring-boot-kotlin-project.prompt.md +147 -0
- package/assets/prompts/create-technical-spike.prompt.md +231 -0
- package/assets/prompts/csharp-async.prompt.md +50 -0
- package/assets/prompts/csharp-docs.prompt.md +63 -0
- package/assets/prompts/csharp-mcp-server-generator.prompt.md +59 -0
- package/assets/prompts/csharp-mstest.prompt.md +67 -0
- package/assets/prompts/csharp-nunit.prompt.md +72 -0
- package/assets/prompts/csharp-tunit.prompt.md +101 -0
- package/assets/prompts/csharp-xunit.prompt.md +69 -0
- package/assets/prompts/declarative-agents.prompt.md +93 -0
- package/assets/prompts/documentation-writer.prompt.md +46 -0
- package/assets/prompts/dotnet-best-practices.prompt.md +84 -0
- package/assets/prompts/dotnet-design-pattern-review.prompt.md +41 -0
- package/assets/prompts/dotnet-upgrade.prompt.md +116 -0
- package/assets/prompts/editorconfig.prompt.md +64 -0
- package/assets/prompts/ef-core.prompt.md +76 -0
- package/assets/prompts/finalize-agent-prompt.prompt.md +27 -0
- package/assets/prompts/first-ask.prompt.md +29 -0
- package/assets/prompts/folder-structure-blueprint-generator.prompt.md +405 -0
- package/assets/prompts/gen-specs-as-issues.prompt.md +165 -0
- package/assets/prompts/generate-custom-instructions-from-codebase.prompt.md +240 -0
- package/assets/prompts/git-flow-branch-creator.prompt.md +293 -0
- package/assets/prompts/github-copilot-starter.prompt.md +372 -0
- package/assets/prompts/go-mcp-server-generator.prompt.md +334 -0
- package/assets/prompts/java-docs.prompt.md +24 -0
- package/assets/prompts/java-junit.prompt.md +64 -0
- package/assets/prompts/java-mcp-server-generator.prompt.md +756 -0
- package/assets/prompts/java-refactoring-extract-method.prompt.md +105 -0
- package/assets/prompts/java-refactoring-remove-parameter.prompt.md +85 -0
- package/assets/prompts/java-springboot.prompt.md +66 -0
- package/assets/prompts/javascript-typescript-jest.prompt.md +44 -0
- package/assets/prompts/kotlin-mcp-server-generator.prompt.md +449 -0
- package/assets/prompts/kotlin-springboot.prompt.md +71 -0
- package/assets/prompts/mcp-copilot-studio-server-generator.prompt.md +118 -0
- package/assets/prompts/memory-merger.prompt.md +107 -0
- package/assets/prompts/mkdocs-translations.prompt.md +110 -0
- package/assets/prompts/model-recommendation.prompt.md +677 -0
- package/assets/prompts/multi-stage-dockerfile.prompt.md +47 -0
- package/assets/prompts/my-issues.prompt.md +9 -0
- package/assets/prompts/my-pull-requests.prompt.md +15 -0
- package/assets/prompts/next-intl-add-language.prompt.md +20 -0
- package/assets/prompts/php-mcp-server-generator.prompt.md +522 -0
- package/assets/prompts/playwright-automation-fill-in-form.prompt.md +30 -0
- package/assets/prompts/playwright-explore-website.prompt.md +19 -0
- package/assets/prompts/playwright-generate-test.prompt.md +19 -0
- package/assets/prompts/postgresql-code-review.prompt.md +214 -0
- package/assets/prompts/postgresql-optimization.prompt.md +406 -0
- package/assets/prompts/power-apps-code-app-scaffold.prompt.md +150 -0
- package/assets/prompts/power-bi-dax-optimization.prompt.md +175 -0
- package/assets/prompts/power-bi-model-design-review.prompt.md +405 -0
- package/assets/prompts/power-bi-performance-troubleshooting.prompt.md +384 -0
- package/assets/prompts/power-bi-report-design-consultation.prompt.md +353 -0
- package/assets/prompts/power-platform-mcp-connector-suite.prompt.md +156 -0
- package/assets/prompts/project-workflow-analysis-blueprint-generator.prompt.md +294 -0
- package/assets/prompts/prompt-builder.prompt.md +142 -0
- package/assets/prompts/pytest-coverage.prompt.md +28 -0
- package/assets/prompts/python-mcp-server-generator.prompt.md +105 -0
- package/assets/prompts/readme-blueprint-generator.prompt.md +79 -0
- package/assets/prompts/remember-interactive-programming.prompt.md +13 -0
- package/assets/prompts/remember.prompt.md +125 -0
- package/assets/prompts/repo-story-time.prompt.md +156 -0
- package/assets/prompts/review-and-refactor.prompt.md +15 -0
- package/assets/prompts/ruby-mcp-server-generator.prompt.md +660 -0
- package/assets/prompts/rust-mcp-server-generator.prompt.md +578 -0
- package/assets/prompts/shuffle-json-data.prompt.md +151 -0
- package/assets/prompts/sql-code-review.prompt.md +303 -0
- package/assets/prompts/sql-optimization.prompt.md +298 -0
- package/assets/prompts/suggest-awesome-github-copilot-agents.prompt.md +72 -0
- package/assets/prompts/suggest-awesome-github-copilot-chatmodes.prompt.md +71 -0
- package/assets/prompts/suggest-awesome-github-copilot-collections.prompt.md +149 -0
- package/assets/prompts/suggest-awesome-github-copilot-instructions.prompt.md +88 -0
- package/assets/prompts/suggest-awesome-github-copilot-prompts.prompt.md +71 -0
- package/assets/prompts/swift-mcp-server-generator.prompt.md +669 -0
- package/assets/prompts/technology-stack-blueprint-generator.prompt.md +242 -0
- package/assets/prompts/typescript-mcp-server-generator.prompt.md +90 -0
- package/assets/prompts/update-avm-modules-in-bicep.prompt.md +60 -0
- package/assets/prompts/update-implementation-plan.prompt.md +157 -0
- package/assets/prompts/update-llms.prompt.md +216 -0
- package/assets/prompts/update-markdown-file-index.prompt.md +76 -0
- package/assets/prompts/update-oo-component-documentation.prompt.md +162 -0
- package/assets/prompts/update-specification.prompt.md +127 -0
- package/assets/prompts/write-coding-standards-from-file.prompt.md +316 -0
- package/bin/cli.js +200 -0
- package/package.json +53 -0
- package/scripts/sync.js +99 -0
- package/verdaccio/config.yaml +202 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Terraform conventions and guidelines for SAP Business Technology Platform (SAP BTP).'
|
|
3
|
+
applyTo: '**/*.tf, **/*.tfvars, **/*.tflint.hcl, **/*.tf.json, **/*.tfvars.json'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Terraform on SAP BTP – Best Practices & Conventions
|
|
7
|
+
|
|
8
|
+
## Core Principles
|
|
9
|
+
|
|
10
|
+
Keep Terraform code minimal, modular, repeatable, secure, and auditable.
|
|
11
|
+
Always version control Terraform HCL and never version control generated state.
|
|
12
|
+
|
|
13
|
+
## Security
|
|
14
|
+
|
|
15
|
+
Mandatory:
|
|
16
|
+
- Use the latest stable Terraform CLI and provider versions; upgrade proactively for security patches.
|
|
17
|
+
- Do NOT commit secrets, credentials, certificates, Terraform state, or plan output artifacts.
|
|
18
|
+
- Mark all secret variables and outputs as `sensitive = true`.
|
|
19
|
+
- Prefer ephemeral / write‑only provider auth (Terraform >= 1.11) so secrets never persist in state.
|
|
20
|
+
- Minimize sensitive outputs; emit only what downstream automation truly needs.
|
|
21
|
+
- Continuously scan with `tfsec`, `trivy`, `checkov` (pick at least one) in CI.
|
|
22
|
+
- Periodically review provider credentials, rotate keys, and enable MFA where supported.
|
|
23
|
+
|
|
24
|
+
## Modularity
|
|
25
|
+
|
|
26
|
+
Structure for clarity and speed:
|
|
27
|
+
- Split by logical domain (e.g., entitlements, service instances) – NOT by environment.
|
|
28
|
+
- Use modules for reusable multi‑resource patterns only; avoid single‑resource wrapper modules.
|
|
29
|
+
- Keep module hierarchy shallow; avoid deep nesting and circular dependencies.
|
|
30
|
+
- Expose only essential cross‑module data via `outputs` (mark sensitive when required).
|
|
31
|
+
|
|
32
|
+
## Maintainability
|
|
33
|
+
|
|
34
|
+
Aim for explicit > implicit.
|
|
35
|
+
- Comment WHY, not WHAT; avoid restating obvious resource attributes.
|
|
36
|
+
- Parameterize (variables) instead of hard‑coding; provide defaults only when sensible.
|
|
37
|
+
- Prefer data sources for external existing infra; never for resources just created in same root – use outputs.
|
|
38
|
+
- Avoid data sources in generic reusable modules; require inputs instead.
|
|
39
|
+
- Remove unused / slow data sources; they degrade plan time.
|
|
40
|
+
- Use `locals` for derived or repeated expressions to centralize logic.
|
|
41
|
+
|
|
42
|
+
## Style & Formatting
|
|
43
|
+
|
|
44
|
+
### General
|
|
45
|
+
- Descriptive, consistent names for resources, variables, outputs.
|
|
46
|
+
- snake_case for variables & locals.
|
|
47
|
+
- 2 spaces indentation; run `terraform fmt -recursive`.
|
|
48
|
+
|
|
49
|
+
### Layout & Files
|
|
50
|
+
|
|
51
|
+
Recommended structure:
|
|
52
|
+
```text
|
|
53
|
+
my-sap-btp-app/
|
|
54
|
+
├── infra/ # Root module
|
|
55
|
+
│ ├── main.tf # Core resources (split by domain when large)
|
|
56
|
+
│ ├── variables.tf # Inputs
|
|
57
|
+
│ ├── outputs.tf # Outputs
|
|
58
|
+
│ ├── provider.tf # Provider config(s)
|
|
59
|
+
│ ├── locals.tf # Local/derived values
|
|
60
|
+
│ └── environments/ # Environment var files only
|
|
61
|
+
│ ├── dev.tfvars
|
|
62
|
+
│ ├── test.tfvars
|
|
63
|
+
│ └── prod.tfvars
|
|
64
|
+
├── .github/workflows/ # CI/CD (if GitHub)
|
|
65
|
+
└── README.md # Documentation
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Rules:
|
|
69
|
+
- Do NOT create separate branches/repos/folders per environment (antipattern).
|
|
70
|
+
- Keep environment drift minimal; encode differences in *.tfvars files only.
|
|
71
|
+
- Split oversized `main.tf` / `variables.tf` into logically named fragments (e.g., `main_services.tf`, `variables_services.tf`).
|
|
72
|
+
Keep naming consistent.
|
|
73
|
+
|
|
74
|
+
### Resource Block Organization
|
|
75
|
+
|
|
76
|
+
Order (top → bottom): optional `depends_on`, then `count`/`for_each`, then attributes, finally `lifecycle`.
|
|
77
|
+
- Use `depends_on` ONLY when Terraform cannot infer dependency (e.g., data source needs entitlement).
|
|
78
|
+
- Use `count` for optional single resource; `for_each` for multiple instances keyed by a map for stable addresses.
|
|
79
|
+
- Group attributes: required first, then optional; blank lines between logical sections.
|
|
80
|
+
- Alphabetize within a section for faster scanning.
|
|
81
|
+
|
|
82
|
+
### Variables
|
|
83
|
+
- Every variable: explicit `type`, non‑empty `description`.
|
|
84
|
+
- Prefer concrete types (`object`, `map(string)`, etc.) over `any`.
|
|
85
|
+
- Avoid null defaults for collections; use empty lists/maps instead.
|
|
86
|
+
|
|
87
|
+
### Locals
|
|
88
|
+
- Centralize computed or repeated expressions.
|
|
89
|
+
- Group related values into object locals for cohesion.
|
|
90
|
+
|
|
91
|
+
### Outputs
|
|
92
|
+
- Expose only what downstream modules/automation consume.
|
|
93
|
+
- Mark secrets `sensitive = true`.
|
|
94
|
+
- Always give a clear `description`.
|
|
95
|
+
|
|
96
|
+
### Formatting & Linting
|
|
97
|
+
- Run `terraform fmt -recursive` (required in CI).
|
|
98
|
+
- Enforce `tflint` (and optionally `terraform validate`) in pre‑commit / CI.
|
|
99
|
+
|
|
100
|
+
## Documentation
|
|
101
|
+
|
|
102
|
+
Mandatory:
|
|
103
|
+
- `description` + `type` on all variables & outputs.
|
|
104
|
+
- A concise root `README.md`: purpose, prerequisites, auth model, usage (init/plan/apply), testing, rollback.
|
|
105
|
+
- Generate module docs with `terraform-docs` (add to CI if possible).
|
|
106
|
+
- Comments only where they clarify non-obvious decisions or constraints.
|
|
107
|
+
|
|
108
|
+
## State Management
|
|
109
|
+
- Use a remote backend supporting locking (e.g., Terraform Cloud, AWS S3, GCS, Azure Storage). Avoid SAP BTP Object Store (insufficient capabilities for reliable locking & security).
|
|
110
|
+
- NEVER commit `*.tfstate` or backups.
|
|
111
|
+
- Encrypt state at rest & in transit; restrict access by principle of least privilege.
|
|
112
|
+
|
|
113
|
+
## Validation
|
|
114
|
+
- Run `terraform validate` (syntax & internal checks) before committing.
|
|
115
|
+
- Confirm with user before `terraform plan` (requires auth & global account subdomain). Provide auth via env vars or tfvars; NEVER inline secrets in provider blocks.
|
|
116
|
+
- Test in non‑prod first; ensure idempotent applies.
|
|
117
|
+
|
|
118
|
+
## Testing
|
|
119
|
+
- Use Terraform test framework (`*.tftest.hcl`) for module logic & invariants.
|
|
120
|
+
- Cover success & failure paths; keep tests stateless/idempotent.
|
|
121
|
+
- Prefer mocking external data sources where feasible.
|
|
122
|
+
|
|
123
|
+
## SAP BTP Provider Specifics
|
|
124
|
+
|
|
125
|
+
Guidelines:
|
|
126
|
+
- Resolve service plan IDs using `data "btp_subaccount_service_plan"` and reference `serviceplan_id` from that data source.
|
|
127
|
+
|
|
128
|
+
Example:
|
|
129
|
+
```terraform
|
|
130
|
+
data "btp_subaccount_service_plan" "example" {
|
|
131
|
+
subaccount_id = var.subaccount_id
|
|
132
|
+
service_name = "your_service_name"
|
|
133
|
+
plan_name = "your_plan_name"
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
resource "btp_subaccount_service_instance" "example" {
|
|
137
|
+
subaccount_id = var.subaccount_id
|
|
138
|
+
serviceplan_id = data.btp_subaccount_service_plan.example.id
|
|
139
|
+
name = "my-example-instance"
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Explicit dependencies (provider cannot infer):
|
|
144
|
+
```terraform
|
|
145
|
+
resource "btp_subaccount_entitlement" "example" {
|
|
146
|
+
subaccount_id = var.subaccount_id
|
|
147
|
+
service_name = "your_service_name"
|
|
148
|
+
plan_name = "your_plan_name"
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
data "btp_subaccount_service_plan" "example" {
|
|
152
|
+
subaccount_id = var.subaccount_id
|
|
153
|
+
service_name = "your_service_name"
|
|
154
|
+
plan_name = "your_plan_name"
|
|
155
|
+
depends_on = [btp_subaccount_entitlement.example]
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Subscriptions also depend on entitlements; add `depends_on` when the provider cannot infer linkage via attributes (match `service_name`/`plan_name` ↔ `app_name`).
|
|
160
|
+
|
|
161
|
+
## Tool Integration
|
|
162
|
+
|
|
163
|
+
### HashiCorp Terraform MCP Server
|
|
164
|
+
Use the Terraform MCP Server for interactive schema lookup, resource block drafting, and validation.
|
|
165
|
+
1. Install & run server (see https://github.com/mcp/hashicorp/terraform-mcp-server).
|
|
166
|
+
2. Add it as a tool in your Copilot / MCP client configuration.
|
|
167
|
+
3. Query provider schema (e.g., list resources, data sources) before authoring.
|
|
168
|
+
4. Generate draft resource blocks, then refine manually for naming & tagging standards.
|
|
169
|
+
5. Validate plan summaries (never include secrets); confirm diff with reviewer before `apply`.
|
|
170
|
+
|
|
171
|
+
### Terraform Registry
|
|
172
|
+
Reference the SAP BTP provider docs: https://registry.terraform.io/providers/SAP/btp/latest/docs for authoritative resource & data source fields. Cross‑check MCP responses with registry docs if uncertain.
|
|
173
|
+
|
|
174
|
+
## Anti‑Patterns (Avoid)
|
|
175
|
+
|
|
176
|
+
Configuration:
|
|
177
|
+
- Hard‑coded environment‑specific values (use variables & tfvars).
|
|
178
|
+
- Routine use of `terraform import` (migration only).
|
|
179
|
+
- Deep / opaque conditional logic and dynamic blocks that reduce clarity.
|
|
180
|
+
- `local-exec` provisioners except for unavoidable integration gaps.
|
|
181
|
+
- Mixing SAP BTP provider with Cloud Foundry provider in the same root unless explicitly justified (split modules).
|
|
182
|
+
|
|
183
|
+
Security:
|
|
184
|
+
- Storing secrets in HCL, state, or VCS.
|
|
185
|
+
- Disabling encryption, validation, or scanning for speed.
|
|
186
|
+
- Using default passwords/keys or reusing credentials across environments.
|
|
187
|
+
|
|
188
|
+
Operational:
|
|
189
|
+
- Direct production applies without prior non‑prod validation.
|
|
190
|
+
- Manual drift changes outside Terraform.
|
|
191
|
+
- Ignoring state inconsistencies / corruption symptoms.
|
|
192
|
+
- Running production applies from uncontrolled local laptops (use CI/CD or approved runners).
|
|
193
|
+
- Reading business data from raw `*.tfstate` instead of outputs / data sources.
|
|
194
|
+
|
|
195
|
+
All changes must flow through Terraform CLI + HCL – never mutate state manually.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Terraform Conventions and Guidelines'
|
|
3
|
+
applyTo: '**/*.tf'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Terraform Conventions
|
|
7
|
+
|
|
8
|
+
## General Instructions
|
|
9
|
+
|
|
10
|
+
- Use Terraform to provision and manage infrastructure.
|
|
11
|
+
- Use version control for your Terraform configurations.
|
|
12
|
+
|
|
13
|
+
## Security
|
|
14
|
+
|
|
15
|
+
- Always use the latest stable version of Terraform and its providers.
|
|
16
|
+
- Regularly update your Terraform configurations to incorporate security patches and improvements.
|
|
17
|
+
- Store sensitive information in a secure manner, such as using AWS Secrets Manager or SSM Parameter Store.
|
|
18
|
+
- Regularly rotate credentials and secrets.
|
|
19
|
+
- Automate the rotation of secrets, where possible.
|
|
20
|
+
- Use AWS environment variables to reference values stored in AWS Secrets Manager or SSM Parameter Store.
|
|
21
|
+
- This keeps sensitive values out of your Terraform state files.
|
|
22
|
+
- Never commit sensitive information such as AWS credentials, API keys, passwords, certificates, or Terraform state to version control.
|
|
23
|
+
- Use `.gitignore` to exclude files containing sensitive information from version control.
|
|
24
|
+
- Always mark sensitive variables as `sensitive = true` in your Terraform configurations.
|
|
25
|
+
- This prevents sensitive values from being displayed in the Terraform plan or apply output.
|
|
26
|
+
- Use IAM roles and policies to control access to resources.
|
|
27
|
+
- Follow the principle of least privilege when assigning permissions.
|
|
28
|
+
- Use security groups and network ACLs to control network access to resources.
|
|
29
|
+
- Deploy resources in private subnets whenever possible.
|
|
30
|
+
- Use public subnets only for resources that require direct internet access, such as load balancers or NAT gateways.
|
|
31
|
+
- Use encryption for sensitive data at rest and in transit.
|
|
32
|
+
- Enable encryption for EBS volumes, S3 buckets, and RDS instances.
|
|
33
|
+
- Use TLS for communication between services.
|
|
34
|
+
- Regularly review and audit your Terraform configurations for security vulnerabilities.
|
|
35
|
+
- Use tools like `trivy`, `tfsec`, or `checkov` to scan your Terraform configurations for security issues.
|
|
36
|
+
|
|
37
|
+
## Modularity
|
|
38
|
+
|
|
39
|
+
- Use separate projects for each major component of the infrastructure; this:
|
|
40
|
+
- Reduces complexity
|
|
41
|
+
- Makes it easier to manage and maintain configurations
|
|
42
|
+
- Speeds up `plan` and `apply` operations
|
|
43
|
+
- Allows for independent development and deployment of components
|
|
44
|
+
- Reduces the risk of accidental changes to unrelated resources
|
|
45
|
+
- Use modules to avoid duplication of configurations.
|
|
46
|
+
- Use modules to encapsulate related resources and configurations.
|
|
47
|
+
- Use modules to simplify complex configurations and improve readability.
|
|
48
|
+
- Avoid circular dependencies between modules.
|
|
49
|
+
- Avoid unnecessary layers of abstraction; use modules only when they add value.
|
|
50
|
+
- Avoid using modules for single resources; only use them for groups of related resources.
|
|
51
|
+
- Avoid excessive nesting of modules; keep the module hierarchy shallow.
|
|
52
|
+
- Use `output` blocks to expose important information about your infrastructure.
|
|
53
|
+
- Use outputs to provide information that is useful for other modules or for users of the configuration.
|
|
54
|
+
- Avoid exposing sensitive information in outputs; mark outputs as `sensitive = true` if they contain sensitive data.
|
|
55
|
+
|
|
56
|
+
## Maintainability
|
|
57
|
+
|
|
58
|
+
- Prioritize readability, clarity, and maintainability.
|
|
59
|
+
- Use comments to explain complex configurations and why certain design decisions were made.
|
|
60
|
+
- Write concise, efficient, and idiomatic configs that are easy to understand.
|
|
61
|
+
- Avoid using hard-coded values; use variables for configuration instead.
|
|
62
|
+
- Set default values for variables, where appropriate.
|
|
63
|
+
- Use data sources to retrieve information about existing resources instead of requiring manual configuration.
|
|
64
|
+
- This reduces the risk of errors, ensures that configurations are always up-to-date, and allows configurations to adapt to different environments.
|
|
65
|
+
- Avoid using data sources for resources that are created within the same configuration; use outputs instead.
|
|
66
|
+
- Avoid, or remove, unnecessary data sources; they slow down `plan` and `apply` operations.
|
|
67
|
+
- Use `locals` for values that are used multiple times to ensure consistency.
|
|
68
|
+
|
|
69
|
+
## Style and Formatting
|
|
70
|
+
|
|
71
|
+
- Follow Terraform best practices for resource naming and organization.
|
|
72
|
+
- Use descriptive names for resources, variables, and outputs.
|
|
73
|
+
- Use consistent naming conventions across all configurations.
|
|
74
|
+
- Follow the **Terraform Style Guide** for formatting.
|
|
75
|
+
- Use consistent indentation (2 spaces for each level).
|
|
76
|
+
- Group related resources together in the same file.
|
|
77
|
+
- Use a consistent naming convention for resource groups (e.g., `providers.tf`, `variables.tf`, `network.tf`, `ecs.tf`, `mariadb.tf`).
|
|
78
|
+
- Place `depends_on` blocks at the very beginning of resource definitions to make dependency relationships clear.
|
|
79
|
+
- Use `depends_on` only when necessary to avoid circular dependencies.
|
|
80
|
+
- Place `for_each` and `count` blocks at the beginning of resource definitions to clarify the resource's instantiation logic.
|
|
81
|
+
- Use `for_each` for collections and `count` for numeric iterations.
|
|
82
|
+
- Place them after `depends_on` blocks, if they are present.
|
|
83
|
+
- Place `lifecycle` blocks at the end of resource definitions.
|
|
84
|
+
- Alphabetize providers, variables, data sources, resources, and outputs within each file for easier navigation.
|
|
85
|
+
- Group related attributes together within blocks.
|
|
86
|
+
- Place required attributes before optional ones, and comment each section accordingly.
|
|
87
|
+
- Separate attribute sections with blank lines to improve readability.
|
|
88
|
+
- Alphabetize attributes within each section for easier navigation.
|
|
89
|
+
- Use blank lines to separate logical sections of your configurations.
|
|
90
|
+
- Use `terraform fmt` to format your configurations automatically.
|
|
91
|
+
- Use `terraform validate` to check for syntax errors and ensure configurations are valid.
|
|
92
|
+
- Use `tflint` to check for style violations and ensure configurations follow best practices.
|
|
93
|
+
- Run `tflint` regularly to catch style issues early in the development process.
|
|
94
|
+
|
|
95
|
+
## Documentation
|
|
96
|
+
|
|
97
|
+
- Always include `description` and `type` attributes for variables and outputs.
|
|
98
|
+
- Use clear and concise descriptions to explain the purpose of each variable and output.
|
|
99
|
+
- Use appropriate types for variables (e.g., `string`, `number`, `bool`, `list`, `map`).
|
|
100
|
+
- Document your Terraform configurations using comments, where appropriate.
|
|
101
|
+
- Use comments to explain the purpose of resources and variables.
|
|
102
|
+
- Use comments to explain complex configurations or decisions.
|
|
103
|
+
- Avoid redundant comments; comments should add value and clarity.
|
|
104
|
+
- Include a `README.md` file in each project to provide an overview of the project and its structure.
|
|
105
|
+
- Include instructions for setting up and using the configurations.
|
|
106
|
+
- Use `terraform-docs` to generate documentation for your configurations automatically.
|
|
107
|
+
|
|
108
|
+
## Testing
|
|
109
|
+
|
|
110
|
+
- Write tests to validate the functionality of your Terraform configurations.
|
|
111
|
+
- Use the `.tftest.hcl` extension for test files.
|
|
112
|
+
- Write tests to cover both positive and negative scenarios.
|
|
113
|
+
- Ensure tests are idempotent and can be run multiple times without side effects.
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Guidelines for TypeScript Development targeting TypeScript 5.x and ES2022 output'
|
|
3
|
+
applyTo: '**/*.ts'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TypeScript Development
|
|
7
|
+
|
|
8
|
+
> These instructions assume projects are built with TypeScript 5.x (or newer) compiling to an ES2022 JavaScript baseline. Adjust guidance if your runtime requires older language targets or down-level transpilation.
|
|
9
|
+
|
|
10
|
+
## Core Intent
|
|
11
|
+
|
|
12
|
+
- Respect the existing architecture and coding standards.
|
|
13
|
+
- Prefer readable, explicit solutions over clever shortcuts.
|
|
14
|
+
- Extend current abstractions before inventing new ones.
|
|
15
|
+
- Prioritize maintainability and clarity, short methods and classes, clean code.
|
|
16
|
+
|
|
17
|
+
## General Guardrails
|
|
18
|
+
|
|
19
|
+
- Target TypeScript 5.x / ES2022 and prefer native features over polyfills.
|
|
20
|
+
- Use pure ES modules; never emit `require`, `module.exports`, or CommonJS helpers.
|
|
21
|
+
- Rely on the project's build, lint, and test scripts unless asked otherwise.
|
|
22
|
+
- Note design trade-offs when intent is not obvious.
|
|
23
|
+
|
|
24
|
+
## Project Organization
|
|
25
|
+
|
|
26
|
+
- Follow the repository's folder and responsibility layout for new code.
|
|
27
|
+
- Use kebab-case filenames (e.g., `user-session.ts`, `data-service.ts`) unless told otherwise.
|
|
28
|
+
- Keep tests, types, and helpers near their implementation when it aids discovery.
|
|
29
|
+
- Reuse or extend shared utilities before adding new ones.
|
|
30
|
+
|
|
31
|
+
## Naming & Style
|
|
32
|
+
|
|
33
|
+
- Use PascalCase for classes, interfaces, enums, and type aliases; camelCase for everything else.
|
|
34
|
+
- Skip interface prefixes like `I`; rely on descriptive names.
|
|
35
|
+
- Name things for their behavior or domain meaning, not implementation.
|
|
36
|
+
|
|
37
|
+
## Formatting & Style
|
|
38
|
+
|
|
39
|
+
- Run the repository's lint/format scripts (e.g., `npm run lint`) before submitting.
|
|
40
|
+
- Match the project's indentation, quote style, and trailing comma rules.
|
|
41
|
+
- Keep functions focused; extract helpers when logic branches grow.
|
|
42
|
+
- Favor immutable data and pure functions when practical.
|
|
43
|
+
|
|
44
|
+
## Type System Expectations
|
|
45
|
+
|
|
46
|
+
- Avoid `any` (implicit or explicit); prefer `unknown` plus narrowing.
|
|
47
|
+
- Use discriminated unions for realtime events and state machines.
|
|
48
|
+
- Centralize shared contracts instead of duplicating shapes.
|
|
49
|
+
- Express intent with TypeScript utility types (e.g., `Readonly`, `Partial`, `Record`).
|
|
50
|
+
|
|
51
|
+
## Async, Events & Error Handling
|
|
52
|
+
|
|
53
|
+
- Use `async/await`; wrap awaits in try/catch with structured errors.
|
|
54
|
+
- Guard edge cases early to avoid deep nesting.
|
|
55
|
+
- Send errors through the project's logging/telemetry utilities.
|
|
56
|
+
- Surface user-facing errors via the repository's notification pattern.
|
|
57
|
+
- Debounce configuration-driven updates and dispose resources deterministically.
|
|
58
|
+
|
|
59
|
+
## Architecture & Patterns
|
|
60
|
+
|
|
61
|
+
- Follow the repository's dependency injection or composition pattern; keep modules single-purpose.
|
|
62
|
+
- Observe existing initialization and disposal sequences when wiring into lifecycles.
|
|
63
|
+
- Keep transport, domain, and presentation layers decoupled with clear interfaces.
|
|
64
|
+
- Supply lifecycle hooks (e.g., `initialize`, `dispose`) and targeted tests when adding services.
|
|
65
|
+
|
|
66
|
+
## External Integrations
|
|
67
|
+
|
|
68
|
+
- Instantiate clients outside hot paths and inject them for testability.
|
|
69
|
+
- Never hardcode secrets; load them from secure sources.
|
|
70
|
+
- Apply retries, backoff, and cancellation to network or IO calls.
|
|
71
|
+
- Normalize external responses and map errors to domain shapes.
|
|
72
|
+
|
|
73
|
+
## Security Practices
|
|
74
|
+
|
|
75
|
+
- Validate and sanitize external input with schema validators or type guards.
|
|
76
|
+
- Avoid dynamic code execution and untrusted template rendering.
|
|
77
|
+
- Encode untrusted content before rendering HTML; use framework escaping or trusted types.
|
|
78
|
+
- Use parameterized queries or prepared statements to block injection.
|
|
79
|
+
- Keep secrets in secure storage, rotate them regularly, and request least-privilege scopes.
|
|
80
|
+
- Favor immutable flows and defensive copies for sensitive data.
|
|
81
|
+
- Use vetted crypto libraries only.
|
|
82
|
+
- Patch dependencies promptly and monitor advisories.
|
|
83
|
+
|
|
84
|
+
## Configuration & Secrets
|
|
85
|
+
|
|
86
|
+
- Reach configuration through shared helpers and validate with schemas or dedicated validators.
|
|
87
|
+
- Handle secrets via the project's secure storage; guard `undefined` and error states.
|
|
88
|
+
- Document new configuration keys and update related tests.
|
|
89
|
+
|
|
90
|
+
## UI & UX Components
|
|
91
|
+
|
|
92
|
+
- Sanitize user or external content before rendering.
|
|
93
|
+
- Keep UI layers thin; push heavy logic to services or state managers.
|
|
94
|
+
- Use messaging or events to decouple UI from business logic.
|
|
95
|
+
|
|
96
|
+
## Testing Expectations
|
|
97
|
+
|
|
98
|
+
- Add or update unit tests with the project's framework and naming style.
|
|
99
|
+
- Expand integration or end-to-end suites when behavior crosses modules or platform APIs.
|
|
100
|
+
- Run targeted test scripts for quick feedback before submitting.
|
|
101
|
+
- Avoid brittle timing assertions; prefer fake timers or injected clocks.
|
|
102
|
+
|
|
103
|
+
## Performance & Reliability
|
|
104
|
+
|
|
105
|
+
- Lazy-load heavy dependencies and dispose them when done.
|
|
106
|
+
- Defer expensive work until users need it.
|
|
107
|
+
- Batch or debounce high-frequency events to reduce thrash.
|
|
108
|
+
- Track resource lifetimes to prevent leaks.
|
|
109
|
+
|
|
110
|
+
## Documentation & Comments
|
|
111
|
+
|
|
112
|
+
- Add JSDoc to public APIs; include `@remarks` or `@example` when helpful.
|
|
113
|
+
- Write comments that capture intent, and remove stale notes during refactors.
|
|
114
|
+
- Update architecture or design docs when introducing significant patterns.
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Instructions for building Model Context Protocol (MCP) servers using the TypeScript SDK'
|
|
3
|
+
applyTo: '**/*.ts, **/*.js, **/package.json'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# TypeScript MCP Server Development
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
- Use the **@modelcontextprotocol/sdk** npm package: `npm install @modelcontextprotocol/sdk`
|
|
11
|
+
- Import from specific paths: `@modelcontextprotocol/sdk/server/mcp.js`, `@modelcontextprotocol/sdk/server/stdio.js`, etc.
|
|
12
|
+
- Use `McpServer` class for high-level server implementation with automatic protocol handling
|
|
13
|
+
- Use `Server` class for low-level control with manual request handlers
|
|
14
|
+
- Use **zod** for input/output schema validation: `npm install zod@3`
|
|
15
|
+
- Always provide `title` field for tools, resources, and prompts for better UI display
|
|
16
|
+
- Use `registerTool()`, `registerResource()`, and `registerPrompt()` methods (recommended over older APIs)
|
|
17
|
+
- Define schemas using zod: `{ inputSchema: { param: z.string() }, outputSchema: { result: z.string() } }`
|
|
18
|
+
- Return both `content` (for display) and `structuredContent` (for structured data) from tools
|
|
19
|
+
- For HTTP servers, use `StreamableHTTPServerTransport` with Express or similar frameworks
|
|
20
|
+
- For local integrations, use `StdioServerTransport` for stdio-based communication
|
|
21
|
+
- Create new transport instances per request to prevent request ID collisions (stateless mode)
|
|
22
|
+
- Use session management with `sessionIdGenerator` for stateful servers
|
|
23
|
+
- Enable DNS rebinding protection for local servers: `enableDnsRebindingProtection: true`
|
|
24
|
+
- Configure CORS headers and expose `Mcp-Session-Id` for browser-based clients
|
|
25
|
+
- Use `ResourceTemplate` for dynamic resources with URI parameters: `new ResourceTemplate('resource://{param}', { list: undefined })`
|
|
26
|
+
- Support completions for better UX using `completable()` wrapper from `@modelcontextprotocol/sdk/server/completable.js`
|
|
27
|
+
- Implement sampling with `server.server.createMessage()` to request LLM completions from clients
|
|
28
|
+
- Use `server.server.elicitInput()` to request additional user input during tool execution
|
|
29
|
+
- Enable notification debouncing for bulk updates: `debouncedNotificationMethods: ['notifications/tools/list_changed']`
|
|
30
|
+
- Dynamic updates: call `.enable()`, `.disable()`, `.update()`, or `.remove()` on registered items to emit `listChanged` notifications
|
|
31
|
+
- Use `getDisplayName()` from `@modelcontextprotocol/sdk/shared/metadataUtils.js` for UI display names
|
|
32
|
+
- Test servers with MCP Inspector: `npx @modelcontextprotocol/inspector`
|
|
33
|
+
|
|
34
|
+
## Best Practices
|
|
35
|
+
|
|
36
|
+
- Keep tool implementations focused on single responsibilities
|
|
37
|
+
- Provide clear, descriptive titles and descriptions for LLM understanding
|
|
38
|
+
- Use proper TypeScript types for all parameters and return values
|
|
39
|
+
- Implement comprehensive error handling with try-catch blocks
|
|
40
|
+
- Return `isError: true` in tool results for error conditions
|
|
41
|
+
- Use async/await for all asynchronous operations
|
|
42
|
+
- Close database connections and clean up resources properly
|
|
43
|
+
- Validate input parameters before processing
|
|
44
|
+
- Use structured logging for debugging without polluting stdout/stderr
|
|
45
|
+
- Consider security implications when exposing file system or network access
|
|
46
|
+
- Implement proper resource cleanup on transport close events
|
|
47
|
+
- Use environment variables for configuration (ports, API keys, etc.)
|
|
48
|
+
- Document tool capabilities and limitations clearly
|
|
49
|
+
- Test with multiple clients to ensure compatibility
|
|
50
|
+
|
|
51
|
+
## Common Patterns
|
|
52
|
+
|
|
53
|
+
### Basic Server Setup (HTTP)
|
|
54
|
+
```typescript
|
|
55
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
56
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
57
|
+
import express from 'express';
|
|
58
|
+
|
|
59
|
+
const server = new McpServer({
|
|
60
|
+
name: 'my-server',
|
|
61
|
+
version: '1.0.0'
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const app = express();
|
|
65
|
+
app.use(express.json());
|
|
66
|
+
|
|
67
|
+
app.post('/mcp', async (req, res) => {
|
|
68
|
+
const transport = new StreamableHTTPServerTransport({
|
|
69
|
+
sessionIdGenerator: undefined,
|
|
70
|
+
enableJsonResponse: true
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
res.on('close', () => transport.close());
|
|
74
|
+
|
|
75
|
+
await server.connect(transport);
|
|
76
|
+
await transport.handleRequest(req, res, req.body);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
app.listen(3000);
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Basic Server Setup (stdio)
|
|
83
|
+
```typescript
|
|
84
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
85
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
86
|
+
|
|
87
|
+
const server = new McpServer({
|
|
88
|
+
name: 'my-server',
|
|
89
|
+
version: '1.0.0'
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// ... register tools, resources, prompts ...
|
|
93
|
+
|
|
94
|
+
const transport = new StdioServerTransport();
|
|
95
|
+
await server.connect(transport);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Simple Tool
|
|
99
|
+
```typescript
|
|
100
|
+
import { z } from 'zod';
|
|
101
|
+
|
|
102
|
+
server.registerTool(
|
|
103
|
+
'calculate',
|
|
104
|
+
{
|
|
105
|
+
title: 'Calculator',
|
|
106
|
+
description: 'Perform basic calculations',
|
|
107
|
+
inputSchema: { a: z.number(), b: z.number(), op: z.enum(['+', '-', '*', '/']) },
|
|
108
|
+
outputSchema: { result: z.number() }
|
|
109
|
+
},
|
|
110
|
+
async ({ a, b, op }) => {
|
|
111
|
+
const result = op === '+' ? a + b : op === '-' ? a - b :
|
|
112
|
+
op === '*' ? a * b : a / b;
|
|
113
|
+
const output = { result };
|
|
114
|
+
return {
|
|
115
|
+
content: [{ type: 'text', text: JSON.stringify(output) }],
|
|
116
|
+
structuredContent: output
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Dynamic Resource
|
|
123
|
+
```typescript
|
|
124
|
+
import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
125
|
+
|
|
126
|
+
server.registerResource(
|
|
127
|
+
'user',
|
|
128
|
+
new ResourceTemplate('users://{userId}', { list: undefined }),
|
|
129
|
+
{
|
|
130
|
+
title: 'User Profile',
|
|
131
|
+
description: 'Fetch user profile data'
|
|
132
|
+
},
|
|
133
|
+
async (uri, { userId }) => ({
|
|
134
|
+
contents: [{
|
|
135
|
+
uri: uri.href,
|
|
136
|
+
text: `User ${userId} data here`
|
|
137
|
+
}]
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Tool with Sampling
|
|
143
|
+
```typescript
|
|
144
|
+
server.registerTool(
|
|
145
|
+
'summarize',
|
|
146
|
+
{
|
|
147
|
+
title: 'Text Summarizer',
|
|
148
|
+
description: 'Summarize text using LLM',
|
|
149
|
+
inputSchema: { text: z.string() },
|
|
150
|
+
outputSchema: { summary: z.string() }
|
|
151
|
+
},
|
|
152
|
+
async ({ text }) => {
|
|
153
|
+
const response = await server.server.createMessage({
|
|
154
|
+
messages: [{
|
|
155
|
+
role: 'user',
|
|
156
|
+
content: { type: 'text', text: `Summarize: ${text}` }
|
|
157
|
+
}],
|
|
158
|
+
maxTokens: 500
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const summary = response.content.type === 'text' ?
|
|
162
|
+
response.content.text : 'Unable to summarize';
|
|
163
|
+
const output = { summary };
|
|
164
|
+
return {
|
|
165
|
+
content: [{ type: 'text', text: JSON.stringify(output) }],
|
|
166
|
+
structuredContent: output
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Prompt with Completion
|
|
173
|
+
```typescript
|
|
174
|
+
import { completable } from '@modelcontextprotocol/sdk/server/completable.js';
|
|
175
|
+
|
|
176
|
+
server.registerPrompt(
|
|
177
|
+
'review',
|
|
178
|
+
{
|
|
179
|
+
title: 'Code Review',
|
|
180
|
+
description: 'Review code with specific focus',
|
|
181
|
+
argsSchema: {
|
|
182
|
+
language: completable(z.string(), value =>
|
|
183
|
+
['typescript', 'python', 'javascript', 'java']
|
|
184
|
+
.filter(l => l.startsWith(value))
|
|
185
|
+
),
|
|
186
|
+
code: z.string()
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
({ language, code }) => ({
|
|
190
|
+
messages: [{
|
|
191
|
+
role: 'user',
|
|
192
|
+
content: {
|
|
193
|
+
type: 'text',
|
|
194
|
+
text: `Review this ${language} code:\n\n${code}`
|
|
195
|
+
}
|
|
196
|
+
}]
|
|
197
|
+
})
|
|
198
|
+
);
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Error Handling
|
|
202
|
+
```typescript
|
|
203
|
+
server.registerTool(
|
|
204
|
+
'risky-operation',
|
|
205
|
+
{
|
|
206
|
+
title: 'Risky Operation',
|
|
207
|
+
description: 'An operation that might fail',
|
|
208
|
+
inputSchema: { input: z.string() },
|
|
209
|
+
outputSchema: { result: z.string() }
|
|
210
|
+
},
|
|
211
|
+
async ({ input }) => {
|
|
212
|
+
try {
|
|
213
|
+
const result = await performRiskyOperation(input);
|
|
214
|
+
const output = { result };
|
|
215
|
+
return {
|
|
216
|
+
content: [{ type: 'text', text: JSON.stringify(output) }],
|
|
217
|
+
structuredContent: output
|
|
218
|
+
};
|
|
219
|
+
} catch (err: unknown) {
|
|
220
|
+
const error = err as Error;
|
|
221
|
+
return {
|
|
222
|
+
content: [{ type: 'text', text: `Error: ${error.message}` }],
|
|
223
|
+
isError: true
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
```
|