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,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Instructions for building Model Context Protocol (MCP) servers using the Python SDK'
|
|
3
|
+
applyTo: '**/*.py, **/pyproject.toml, **/requirements.txt'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python MCP Server Development
|
|
7
|
+
|
|
8
|
+
## Instructions
|
|
9
|
+
|
|
10
|
+
- Use **uv** for project management: `uv init mcp-server-demo` and `uv add "mcp[cli]"`
|
|
11
|
+
- Import FastMCP from `mcp.server.fastmcp`: `from mcp.server.fastmcp import FastMCP`
|
|
12
|
+
- Use `@mcp.tool()`, `@mcp.resource()`, and `@mcp.prompt()` decorators for registration
|
|
13
|
+
- Type hints are mandatory - they're used for schema generation and validation
|
|
14
|
+
- Use Pydantic models, TypedDicts, or dataclasses for structured output
|
|
15
|
+
- Tools automatically return structured output when return types are compatible
|
|
16
|
+
- For stdio transport, use `mcp.run()` or `mcp.run(transport="stdio")`
|
|
17
|
+
- For HTTP servers, use `mcp.run(transport="streamable-http")` or mount to Starlette/FastAPI
|
|
18
|
+
- Use `Context` parameter in tools/resources to access MCP capabilities: `ctx: Context`
|
|
19
|
+
- Send logs with `await ctx.debug()`, `await ctx.info()`, `await ctx.warning()`, `await ctx.error()`
|
|
20
|
+
- Report progress with `await ctx.report_progress(progress, total, message)`
|
|
21
|
+
- Request user input with `await ctx.elicit(message, schema)`
|
|
22
|
+
- Use LLM sampling with `await ctx.session.create_message(messages, max_tokens)`
|
|
23
|
+
- Configure icons with `Icon(src="path", mimeType="image/png")` for server, tools, resources, prompts
|
|
24
|
+
- Use `Image` class for automatic image handling: `return Image(data=bytes, format="png")`
|
|
25
|
+
- Define resource templates with URI patterns: `@mcp.resource("greeting://{name}")`
|
|
26
|
+
- Implement completion support by accepting partial values and returning suggestions
|
|
27
|
+
- Use lifespan context managers for startup/shutdown with shared resources
|
|
28
|
+
- Access lifespan context in tools via `ctx.request_context.lifespan_context`
|
|
29
|
+
- For stateless HTTP servers, set `stateless_http=True` in FastMCP initialization
|
|
30
|
+
- Enable JSON responses for modern clients: `json_response=True`
|
|
31
|
+
- Test servers with: `uv run mcp dev server.py` (Inspector) or `uv run mcp install server.py` (Claude Desktop)
|
|
32
|
+
- Mount multiple servers in Starlette with different paths: `Mount("/path", mcp.streamable_http_app())`
|
|
33
|
+
- Configure CORS for browser clients: expose `Mcp-Session-Id` header
|
|
34
|
+
- Use low-level Server class for maximum control when FastMCP isn't sufficient
|
|
35
|
+
|
|
36
|
+
## Best Practices
|
|
37
|
+
|
|
38
|
+
- Always use type hints - they drive schema generation and validation
|
|
39
|
+
- Return Pydantic models or TypedDicts for structured tool outputs
|
|
40
|
+
- Keep tool functions focused on single responsibilities
|
|
41
|
+
- Provide clear docstrings - they become tool descriptions
|
|
42
|
+
- Use descriptive parameter names with type hints
|
|
43
|
+
- Validate inputs using Pydantic Field descriptions
|
|
44
|
+
- Implement proper error handling with try-except blocks
|
|
45
|
+
- Use async functions for I/O-bound operations
|
|
46
|
+
- Clean up resources in lifespan context managers
|
|
47
|
+
- Log to stderr to avoid interfering with stdio transport (when using stdio)
|
|
48
|
+
- Use environment variables for configuration
|
|
49
|
+
- Test tools independently before LLM integration
|
|
50
|
+
- Consider security when exposing file system or network access
|
|
51
|
+
- Use structured output for machine-readable data
|
|
52
|
+
- Provide both content and structured data for backward compatibility
|
|
53
|
+
|
|
54
|
+
## Common Patterns
|
|
55
|
+
|
|
56
|
+
### Basic Server Setup (stdio)
|
|
57
|
+
```python
|
|
58
|
+
from mcp.server.fastmcp import FastMCP
|
|
59
|
+
|
|
60
|
+
mcp = FastMCP("My Server")
|
|
61
|
+
|
|
62
|
+
@mcp.tool()
|
|
63
|
+
def calculate(a: int, b: int, op: str) -> int:
|
|
64
|
+
"""Perform calculation"""
|
|
65
|
+
if op == "add":
|
|
66
|
+
return a + b
|
|
67
|
+
return a - b
|
|
68
|
+
|
|
69
|
+
if __name__ == "__main__":
|
|
70
|
+
mcp.run() # stdio by default
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### HTTP Server
|
|
74
|
+
```python
|
|
75
|
+
from mcp.server.fastmcp import FastMCP
|
|
76
|
+
|
|
77
|
+
mcp = FastMCP("My HTTP Server")
|
|
78
|
+
|
|
79
|
+
@mcp.tool()
|
|
80
|
+
def hello(name: str = "World") -> str:
|
|
81
|
+
"""Greet someone"""
|
|
82
|
+
return f"Hello, {name}!"
|
|
83
|
+
|
|
84
|
+
if __name__ == "__main__":
|
|
85
|
+
mcp.run(transport="streamable-http")
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Tool with Structured Output
|
|
89
|
+
```python
|
|
90
|
+
from pydantic import BaseModel, Field
|
|
91
|
+
|
|
92
|
+
class WeatherData(BaseModel):
|
|
93
|
+
temperature: float = Field(description="Temperature in Celsius")
|
|
94
|
+
condition: str
|
|
95
|
+
humidity: float
|
|
96
|
+
|
|
97
|
+
@mcp.tool()
|
|
98
|
+
def get_weather(city: str) -> WeatherData:
|
|
99
|
+
"""Get weather for a city"""
|
|
100
|
+
return WeatherData(
|
|
101
|
+
temperature=22.5,
|
|
102
|
+
condition="sunny",
|
|
103
|
+
humidity=65.0
|
|
104
|
+
)
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Dynamic Resource
|
|
108
|
+
```python
|
|
109
|
+
@mcp.resource("users://{user_id}")
|
|
110
|
+
def get_user(user_id: str) -> str:
|
|
111
|
+
"""Get user profile data"""
|
|
112
|
+
return f"User {user_id} profile data"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Tool with Context
|
|
116
|
+
```python
|
|
117
|
+
from mcp.server.fastmcp import Context
|
|
118
|
+
from mcp.server.session import ServerSession
|
|
119
|
+
|
|
120
|
+
@mcp.tool()
|
|
121
|
+
async def process_data(
|
|
122
|
+
data: str,
|
|
123
|
+
ctx: Context[ServerSession, None]
|
|
124
|
+
) -> str:
|
|
125
|
+
"""Process data with logging"""
|
|
126
|
+
await ctx.info(f"Processing: {data}")
|
|
127
|
+
await ctx.report_progress(0.5, 1.0, "Halfway done")
|
|
128
|
+
return f"Processed: {data}"
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Tool with Sampling
|
|
132
|
+
```python
|
|
133
|
+
from mcp.server.fastmcp import Context
|
|
134
|
+
from mcp.server.session import ServerSession
|
|
135
|
+
from mcp.types import SamplingMessage, TextContent
|
|
136
|
+
|
|
137
|
+
@mcp.tool()
|
|
138
|
+
async def summarize(
|
|
139
|
+
text: str,
|
|
140
|
+
ctx: Context[ServerSession, None]
|
|
141
|
+
) -> str:
|
|
142
|
+
"""Summarize text using LLM"""
|
|
143
|
+
result = await ctx.session.create_message(
|
|
144
|
+
messages=[SamplingMessage(
|
|
145
|
+
role="user",
|
|
146
|
+
content=TextContent(type="text", text=f"Summarize: {text}")
|
|
147
|
+
)],
|
|
148
|
+
max_tokens=100
|
|
149
|
+
)
|
|
150
|
+
return result.content.text if result.content.type == "text" else ""
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Lifespan Management
|
|
154
|
+
```python
|
|
155
|
+
from contextlib import asynccontextmanager
|
|
156
|
+
from dataclasses import dataclass
|
|
157
|
+
from mcp.server.fastmcp import FastMCP, Context
|
|
158
|
+
|
|
159
|
+
@dataclass
|
|
160
|
+
class AppContext:
|
|
161
|
+
db: Database
|
|
162
|
+
|
|
163
|
+
@asynccontextmanager
|
|
164
|
+
async def app_lifespan(server: FastMCP):
|
|
165
|
+
db = await Database.connect()
|
|
166
|
+
try:
|
|
167
|
+
yield AppContext(db=db)
|
|
168
|
+
finally:
|
|
169
|
+
await db.disconnect()
|
|
170
|
+
|
|
171
|
+
mcp = FastMCP("My App", lifespan=app_lifespan)
|
|
172
|
+
|
|
173
|
+
@mcp.tool()
|
|
174
|
+
def query(sql: str, ctx: Context) -> str:
|
|
175
|
+
"""Query database"""
|
|
176
|
+
db = ctx.request_context.lifespan_context.db
|
|
177
|
+
return db.execute(sql)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Prompt with Messages
|
|
181
|
+
```python
|
|
182
|
+
from mcp.server.fastmcp.prompts import base
|
|
183
|
+
|
|
184
|
+
@mcp.prompt(title="Code Review")
|
|
185
|
+
def review_code(code: str) -> list[base.Message]:
|
|
186
|
+
"""Create code review prompt"""
|
|
187
|
+
return [
|
|
188
|
+
base.UserMessage("Review this code:"),
|
|
189
|
+
base.UserMessage(code),
|
|
190
|
+
base.AssistantMessage("I'll review the code for you.")
|
|
191
|
+
]
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Error Handling
|
|
195
|
+
```python
|
|
196
|
+
@mcp.tool()
|
|
197
|
+
async def risky_operation(input: str) -> str:
|
|
198
|
+
"""Operation that might fail"""
|
|
199
|
+
try:
|
|
200
|
+
result = await perform_operation(input)
|
|
201
|
+
return f"Success: {result}"
|
|
202
|
+
except Exception as e:
|
|
203
|
+
return f"Error: {str(e)}"
|
|
204
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Python coding conventions and guidelines'
|
|
3
|
+
applyTo: '**/*.py'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Python Coding Conventions
|
|
7
|
+
|
|
8
|
+
## Python Instructions
|
|
9
|
+
|
|
10
|
+
- Write clear and concise comments for each function.
|
|
11
|
+
- Ensure functions have descriptive names and include type hints.
|
|
12
|
+
- Provide docstrings following PEP 257 conventions.
|
|
13
|
+
- Use the `typing` module for type annotations (e.g., `List[str]`, `Dict[str, int]`).
|
|
14
|
+
- Break down complex functions into smaller, more manageable functions.
|
|
15
|
+
|
|
16
|
+
## General Instructions
|
|
17
|
+
|
|
18
|
+
- Always prioritize readability and clarity.
|
|
19
|
+
- For algorithm-related code, include explanations of the approach used.
|
|
20
|
+
- Write code with good maintainability practices, including comments on why certain design decisions were made.
|
|
21
|
+
- Handle edge cases and write clear exception handling.
|
|
22
|
+
- For libraries or external dependencies, mention their usage and purpose in comments.
|
|
23
|
+
- Use consistent naming conventions and follow language-specific best practices.
|
|
24
|
+
- Write concise, efficient, and idiomatic code that is also easily understandable.
|
|
25
|
+
|
|
26
|
+
## Code Style and Formatting
|
|
27
|
+
|
|
28
|
+
- Follow the **PEP 8** style guide for Python.
|
|
29
|
+
- Maintain proper indentation (use 4 spaces for each level of indentation).
|
|
30
|
+
- Ensure lines do not exceed 79 characters.
|
|
31
|
+
- Place function and class docstrings immediately after the `def` or `class` keyword.
|
|
32
|
+
- Use blank lines to separate functions, classes, and code blocks where appropriate.
|
|
33
|
+
|
|
34
|
+
## Edge Cases and Testing
|
|
35
|
+
|
|
36
|
+
- Always include test cases for critical paths of the application.
|
|
37
|
+
- Account for common edge cases like empty inputs, invalid data types, and large datasets.
|
|
38
|
+
- Include comments for edge cases and the expected behavior in those cases.
|
|
39
|
+
- Write unit tests for functions and document them with docstrings explaining the test cases.
|
|
40
|
+
|
|
41
|
+
## Example of Proper Documentation
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
def calculate_area(radius: float) -> float:
|
|
45
|
+
"""
|
|
46
|
+
Calculate the area of a circle given the radius.
|
|
47
|
+
|
|
48
|
+
Parameters:
|
|
49
|
+
radius (float): The radius of the circle.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
float: The area of the circle, calculated as π * radius^2.
|
|
53
|
+
"""
|
|
54
|
+
import math
|
|
55
|
+
return math.pi * radius ** 2
|
|
56
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: '*'
|
|
3
|
+
description: 'Quarkus and MCP Server with HTTP SSE transport development standards and instructions'
|
|
4
|
+
---
|
|
5
|
+
# Quarkus MCP Server
|
|
6
|
+
|
|
7
|
+
Build MCP servers with Java 21, Quarkus, and HTTP SSE transport.
|
|
8
|
+
|
|
9
|
+
## Stack
|
|
10
|
+
|
|
11
|
+
- Java 21 with Quarkus Framework
|
|
12
|
+
- MCP Server Extension: `mcp-server-sse`
|
|
13
|
+
- CDI for dependency injection
|
|
14
|
+
- MCP Endpoint: `http://localhost:8080/mcp/sse`
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
quarkus create app --no-code -x rest-client-jackson,qute,mcp-server-sse your-domain-mcp-server
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Structure
|
|
23
|
+
|
|
24
|
+
- Use standard Java naming conventions (PascalCase classes, camelCase methods)
|
|
25
|
+
- Organize in packages: `model`, `repository`, `service`, `mcp`
|
|
26
|
+
- Use Record types for immutable data models
|
|
27
|
+
- State management for immutable data must be managed by repository layer
|
|
28
|
+
- Add Javadoc for public methods
|
|
29
|
+
|
|
30
|
+
## MCP Tools
|
|
31
|
+
|
|
32
|
+
- Must be public methods in `@ApplicationScoped` CDI beans
|
|
33
|
+
- Use `@Tool(name="tool_name", description="clear description")`
|
|
34
|
+
- Never return `null` - return error messages instead
|
|
35
|
+
- Always validate parameters and handle errors gracefully
|
|
36
|
+
|
|
37
|
+
## Architecture
|
|
38
|
+
|
|
39
|
+
- Separate concerns: MCP tools → Service layer → Repository
|
|
40
|
+
- Use `@Inject` for dependency injection
|
|
41
|
+
- Make data operations thread-safe
|
|
42
|
+
- Use `Optional<T>` to avoid null pointer exceptions
|
|
43
|
+
|
|
44
|
+
## Common Issues
|
|
45
|
+
|
|
46
|
+
- Don't put business logic in MCP tools (use service layer)
|
|
47
|
+
- Don't throw exceptions from tools (return error strings)
|
|
48
|
+
- Don't forget to validate input parameters
|
|
49
|
+
- Test with edge cases (null, empty inputs)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
---
|
|
2
|
+
applyTo: '*'
|
|
3
|
+
description: 'Quarkus development standards and instructions'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
- Instructions for high-quality Quarkus applications with Java 17 or later.
|
|
7
|
+
|
|
8
|
+
## Project Context
|
|
9
|
+
|
|
10
|
+
- Latest Quarkus version: 3.x
|
|
11
|
+
- Java version: 17 or later
|
|
12
|
+
- Use Maven or Gradle for build management.
|
|
13
|
+
- Focus on clean architecture, maintainability, and performance.
|
|
14
|
+
|
|
15
|
+
## Development Standards
|
|
16
|
+
|
|
17
|
+
- Write clear and concise comments for each class, method, and complex logic.
|
|
18
|
+
- Use Javadoc for public APIs and methods to ensure clarity for consumers.
|
|
19
|
+
- Maintain a consistent coding style across the project, adhering to Java conventions.
|
|
20
|
+
- Adhere to the Quarkus coding standards and best practices for optimal performance and maintainability.
|
|
21
|
+
- Follow Jarkarta EE and MicroProfile conventions, ensuring clarity in package organization.
|
|
22
|
+
- Use Java 17 or later features where appropriate, such as records and sealed classes.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Naming Conventions
|
|
26
|
+
- Use PascalCase for class names (e.g., `ProductService`, `ProductResource`).
|
|
27
|
+
- Use camelCase for method and variable names (e.g., `findProductById`, `isProductAvailable`).
|
|
28
|
+
- Use ALL_CAPS for constants (e.g., `DEFAULT_PAGE_SIZE`).
|
|
29
|
+
|
|
30
|
+
## Quarkus
|
|
31
|
+
- Leverage Quarkus Dev Mode for faster development cycles.
|
|
32
|
+
- Implement build-time optimizations using Quarkus extensions and best practices.
|
|
33
|
+
- Configure native builds with GraalVM for optimal performance (e.g., use the quarkus-maven-plugin).
|
|
34
|
+
- Use quarkus logging capabilities (JBoss, SL4J or JUL) for consistent logging practices.
|
|
35
|
+
|
|
36
|
+
### Quarkus-Specific Patterns
|
|
37
|
+
- Use `@ApplicationScoped` for singleton beans instead of `@Singleton`
|
|
38
|
+
- Use `@Inject` for dependency injection
|
|
39
|
+
- Prefer Panache repositories over traditional JPA repositories
|
|
40
|
+
- Use `@Transactional` on service methods that modify data
|
|
41
|
+
- Apply `@Path` with descriptive REST endpoint paths
|
|
42
|
+
- Use `@Consumes(MediaType.APPLICATION_JSON)` and `@Produces(MediaType.APPLICATION_JSON)` for REST resources
|
|
43
|
+
|
|
44
|
+
### REST Resources
|
|
45
|
+
- Always use JAX-RS annotations (`@Path`, `@GET`, `@POST`, etc.)
|
|
46
|
+
- Return proper HTTP status codes (200, 201, 400, 404, 500)
|
|
47
|
+
- Use `Response` class for complex responses
|
|
48
|
+
- Include proper error handling with try-catch blocks
|
|
49
|
+
- Validate input parameters using Bean Validation annotations
|
|
50
|
+
- Implement rate limiting for public endpoints
|
|
51
|
+
|
|
52
|
+
### Data Access
|
|
53
|
+
- Prefer Panache entities (extend `PanacheEntity`) over traditional JPA
|
|
54
|
+
- Use Panache repositories (`PanacheRepository<T>`) for complex queries
|
|
55
|
+
- Always use `@Transactional` for data modifications
|
|
56
|
+
- Use named queries for complex database operations
|
|
57
|
+
- Implement proper pagination for list endpoints
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Configuration
|
|
61
|
+
- Use `application.properties` or `application.yaml` for simple configuration
|
|
62
|
+
- Use `@ConfigProperty` for type-safe configuration classes
|
|
63
|
+
- Prefer environment variables for sensitive data
|
|
64
|
+
- Use profiles for different environments (dev, test, prod)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Testing
|
|
68
|
+
- Use `@QuarkusTest` for integration tests
|
|
69
|
+
- Use JUnit 5 for unit tests
|
|
70
|
+
- Use `@QuarkusIntegrationTest` for native build tests
|
|
71
|
+
- Mock external dependencies using `@QuarkusTestResource`
|
|
72
|
+
- Use RestAssured for REST endpoint testing (`@QuarkusTestResource`)
|
|
73
|
+
- Use `@Transactional` for tests that modify the database
|
|
74
|
+
- Use test-containers for database integration tests
|
|
75
|
+
|
|
76
|
+
### Don't use these patterns:
|
|
77
|
+
- Don't use field injection in tests (use constructor injection)
|
|
78
|
+
- Don't hardcode configuration values
|
|
79
|
+
- Don't ignore exceptions
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## Development Workflow
|
|
83
|
+
|
|
84
|
+
### When creating new features:
|
|
85
|
+
1. Create entity with proper validation
|
|
86
|
+
2. Create repository with custom queries
|
|
87
|
+
3. Create service with business logic
|
|
88
|
+
4. Create REST resource with proper endpoints
|
|
89
|
+
5. Write comprehensive tests
|
|
90
|
+
6. Add proper error handling
|
|
91
|
+
7. Update documentation
|
|
92
|
+
|
|
93
|
+
## Security Considerations
|
|
94
|
+
|
|
95
|
+
### When implementing security:
|
|
96
|
+
- Use Quarkus Security extensions (e.g., `quarkus-smallrye-jwt`, `quarkus-oidc`).
|
|
97
|
+
- Implement role-based access control (RBAC) using MicroProfile JWT or OIDC.
|
|
98
|
+
- Validate all input parameters
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'R language and document formats (R, Rmd, Quarto): coding standards and Copilot guidance for idiomatic, safe, and consistent code generation.'
|
|
3
|
+
applyTo: '**/*.R, **/*.r, **/*.Rmd, **/*.rmd, **/*.qmd'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# R Programming Language Instructions
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Help GitHub Copilot generate idiomatic, safe, and maintainable R code across projects.
|
|
11
|
+
|
|
12
|
+
## Core Conventions
|
|
13
|
+
|
|
14
|
+
- **Match the project’s style.** If the file shows a preference (tidyverse vs. base R, `%>%` vs. `|>`), follow it.
|
|
15
|
+
- **Prefer clear, vectorized code.** Keep functions small and avoid hidden side effects.
|
|
16
|
+
- **Qualify non-base functions in examples/snippets**, e.g., `dplyr::mutate()`, `stringr::str_detect()`. In project code, using `library()` is acceptable when that’s the repo norm.
|
|
17
|
+
- **Naming:** `lower_snake_case` for objects/files; avoid dots in names.
|
|
18
|
+
- **Side effects:** Never call `setwd()`; prefer project-relative paths (e.g., `here::here()`).
|
|
19
|
+
- **Reproducibility:** Set seeds locally around stochastic operations using `withr::with_seed()`.
|
|
20
|
+
- **Validation:** Validate and constrain user inputs; use typed checks and allowlists where possible.
|
|
21
|
+
- **Safety:** Avoid `eval(parse())`, unvalidated shell calls, and unparameterized SQL.
|
|
22
|
+
|
|
23
|
+
### Pipe Operators
|
|
24
|
+
|
|
25
|
+
- **Native pipe `|>` (R ≥ 4.1.0):** Prefer in R ≥ 4.1 (no extra dependency).
|
|
26
|
+
- **Magrittr pipe `%>%`:** Continue using in projects already committed to magrittr or when you need features like `.`, `%T>%`, or `%$%`.
|
|
27
|
+
- **Be consistent:** Don't mix `|>` and `%>%` within the same script unless there's a clear technical reason.
|
|
28
|
+
|
|
29
|
+
## Performance Considerations
|
|
30
|
+
|
|
31
|
+
- **Large datasets:** consider `data.table`; benchmark with your workload.
|
|
32
|
+
- **dplyr compatibility:** Use `dtplyr` to write dplyr syntax that translates to data.table operations automatically for performance gains.
|
|
33
|
+
- **Profiling:** Use `profvis::profvis()` to identify performance bottlenecks in your code. Profile before optimizing.
|
|
34
|
+
- **Caching:** Use `memoise::memoise()` to cache expensive function results. Particularly useful for repeated API calls or complex computations.
|
|
35
|
+
- **Vectorization:** Prefer vectorized operations over loops. Use `purrr::map_*()` family or `apply()` family for remaining iteration needs.
|
|
36
|
+
|
|
37
|
+
## Tooling & Quality
|
|
38
|
+
|
|
39
|
+
- **Formatting:** `styler` (tidyverse style), two-space indents, ~100-char lines.
|
|
40
|
+
- **Linting:** `lintr` configured via `.lintr`.
|
|
41
|
+
- **Pre-commit:** consider `precommit` hooks to lint/format automatically.
|
|
42
|
+
- **Docs:** roxygen2 for exported functions (`@param`, `@return`, `@examples`).
|
|
43
|
+
- **Tests:** prefer small, pure, composable functions that are easy to unit test.
|
|
44
|
+
- **Dependencies:** manage with `renv`; snapshot after adding packages.
|
|
45
|
+
- **Paths:** prefer `fs` and `here` for portability.
|
|
46
|
+
|
|
47
|
+
## Data Wrangling & I/O
|
|
48
|
+
|
|
49
|
+
- **Data frames:** prefer tibbles in tidyverse-heavy files; otherwise base `data.frame()` is fine.
|
|
50
|
+
- **Iteration:** use `purrr` in tidyverse code. In base-style code, prefer type-stable, vectorized patterns such as `vapply()`
|
|
51
|
+
(for atomic outputs) or `Map()` (for elementwise operations) instead of explicit `for` loops when they improve clarity or performance.
|
|
52
|
+
- **Strings & Dates:** use `stringr`/`lubridate` where already present; otherwise use clear base helpers (e.g., `nchar()`, `substr()`, `as.Date()` with explicit format).
|
|
53
|
+
- **I/O:** prefer explicit, typed readers (e.g., `readr::read_csv()`); make parsing assumptions explicit.
|
|
54
|
+
|
|
55
|
+
## Plotting
|
|
56
|
+
|
|
57
|
+
- Prefer `ggplot2` for publication-quality plots. Keep layers readable and label axes and units.
|
|
58
|
+
|
|
59
|
+
## Error Handling
|
|
60
|
+
|
|
61
|
+
- In tidyverse contexts, use `rlang::abort()` / `rlang::warn()` for structured conditions; in base-only code, use `stop()` / `warning()`.
|
|
62
|
+
- For recoverable operations:
|
|
63
|
+
- Use `purrr::possibly()` when you want a typed fallback value of the same type (simpler).
|
|
64
|
+
- Use `purrr::safely()` when you need to capture both results and errors for later inspection or logging.
|
|
65
|
+
- Use `tryCatch()` in base R for fine-grained control or compatibility with non-tidyverse code.
|
|
66
|
+
- Prefer consistent return structures—typed outputs for normal flows, structured lists only when error details are required.
|
|
67
|
+
|
|
68
|
+
## Security Best Practices
|
|
69
|
+
|
|
70
|
+
- **Command execution:** Prefer `processx::run()` or `sys::exec_wait()` over `system()`; validate and sanitize all arguments.
|
|
71
|
+
- **Database queries:** Use parameterized `DBI` queries to prevent SQL injection.
|
|
72
|
+
- **File paths:** Normalize and sanitize user-provided paths (e.g., `fs::path_sanitize()`), and validate against allowlists.
|
|
73
|
+
- **Credentials:** Never hardcode secrets. Use env vars (`Sys.getenv()`), config outside VCS, or `keyring`.
|
|
74
|
+
|
|
75
|
+
## Shiny
|
|
76
|
+
|
|
77
|
+
- Modularize UI and server logic for non-trivial apps. Use `eventReactive()` / `observeEvent()` for explicit dependencies.
|
|
78
|
+
- Validate inputs with `req()` and clear, user-friendly messages.
|
|
79
|
+
- Use connection pooling (`pool`) for databases; avoid long-lived global objects.
|
|
80
|
+
- Isolate expensive computations and prefer `reactiveVal()` / `reactiveValues()` for small state.
|
|
81
|
+
|
|
82
|
+
## R Markdown / Quarto
|
|
83
|
+
|
|
84
|
+
- Keep chunks focused; prefer explicit chunk options (`echo`, `message`, `warning`).
|
|
85
|
+
- Avoid global state; prefer local helpers. Use `withr::with_seed()` for deterministic chunks.
|
|
86
|
+
|
|
87
|
+
## Copilot-Specific Guidance
|
|
88
|
+
|
|
89
|
+
- If the current file uses tidyverse, **suggest tidyverse-first patterns** (e.g., `dplyr::across()` instead of superseded verbs). If base-R style is present, **use base idioms**.
|
|
90
|
+
- Qualify non-base calls in suggestions (e.g., `dplyr::mutate()`).
|
|
91
|
+
- Suggest vectorized or tidy solutions over loops when idiomatic.
|
|
92
|
+
- Prefer small helper functions over long pipelines.
|
|
93
|
+
- When multiple approaches are equivalent, prefer readability and type stability and explain the trade-offs.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Minimal Examples
|
|
98
|
+
|
|
99
|
+
```r
|
|
100
|
+
# Base R variant
|
|
101
|
+
scores <- data.frame(id = 1:5, x = c(1, 3, 2, 5, 4))
|
|
102
|
+
safe_log <- function(x) tryCatch(log(x), error = function(e) NA_real_)
|
|
103
|
+
scores$z <- vapply(scores$x, safe_log, numeric(1))
|
|
104
|
+
|
|
105
|
+
# Tidyverse variant (if this file uses tidyverse)
|
|
106
|
+
result <- tibble::tibble(id = 1:5, x = c(1, 3, 2, 5, 4)) |>
|
|
107
|
+
dplyr::mutate(z = purrr::map_dbl(x, purrr::possibly(log, otherwise = NA_real_))) |>
|
|
108
|
+
dplyr::filter(z > 0)
|
|
109
|
+
|
|
110
|
+
# Example reusable helper with roxygen2 doc
|
|
111
|
+
#' Compute the z-score of a numeric vector
|
|
112
|
+
#' @param x A numeric vector
|
|
113
|
+
#' @return Numeric vector of z-scores
|
|
114
|
+
#' @examples z_score(c(1, 2, 3))
|
|
115
|
+
z_score <- function(x) (x - mean(x, na.rm = TRUE)) / stats::sd(x, na.rm = TRUE)
|
|
116
|
+
```
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'ReactJS development standards and best practices'
|
|
3
|
+
applyTo: '**/*.jsx, **/*.tsx, **/*.js, **/*.ts, **/*.css, **/*.scss'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# ReactJS Development Instructions
|
|
7
|
+
|
|
8
|
+
Instructions for building high-quality ReactJS applications with modern patterns, hooks, and best practices following the official React documentation at https://react.dev.
|
|
9
|
+
|
|
10
|
+
## Project Context
|
|
11
|
+
- Latest React version (React 19+)
|
|
12
|
+
- TypeScript for type safety (when applicable)
|
|
13
|
+
- Functional components with hooks as default
|
|
14
|
+
- Follow React's official style guide and best practices
|
|
15
|
+
- Use modern build tools (Vite, Create React App, or custom Webpack setup)
|
|
16
|
+
- Implement proper component composition and reusability patterns
|
|
17
|
+
|
|
18
|
+
## Development Standards
|
|
19
|
+
|
|
20
|
+
### Architecture
|
|
21
|
+
- Use functional components with hooks as the primary pattern
|
|
22
|
+
- Implement component composition over inheritance
|
|
23
|
+
- Organize components by feature or domain for scalability
|
|
24
|
+
- Separate presentational and container components clearly
|
|
25
|
+
- Use custom hooks for reusable stateful logic
|
|
26
|
+
- Implement proper component hierarchies with clear data flow
|
|
27
|
+
|
|
28
|
+
### TypeScript Integration
|
|
29
|
+
- Use TypeScript interfaces for props, state, and component definitions
|
|
30
|
+
- Define proper types for event handlers and refs
|
|
31
|
+
- Implement generic components where appropriate
|
|
32
|
+
- Use strict mode in `tsconfig.json` for type safety
|
|
33
|
+
- Leverage React's built-in types (`React.FC`, `React.ComponentProps`, etc.)
|
|
34
|
+
- Create union types for component variants and states
|
|
35
|
+
|
|
36
|
+
### Component Design
|
|
37
|
+
- Follow the single responsibility principle for components
|
|
38
|
+
- Use descriptive and consistent naming conventions
|
|
39
|
+
- Implement proper prop validation with TypeScript or PropTypes
|
|
40
|
+
- Design components to be testable and reusable
|
|
41
|
+
- Keep components small and focused on a single concern
|
|
42
|
+
- Use composition patterns (render props, children as functions)
|
|
43
|
+
|
|
44
|
+
### State Management
|
|
45
|
+
- Use `useState` for local component state
|
|
46
|
+
- Implement `useReducer` for complex state logic
|
|
47
|
+
- Leverage `useContext` for sharing state across component trees
|
|
48
|
+
- Consider external state management (Redux Toolkit, Zustand) for complex applications
|
|
49
|
+
- Implement proper state normalization and data structures
|
|
50
|
+
- Use React Query or SWR for server state management
|
|
51
|
+
|
|
52
|
+
### Hooks and Effects
|
|
53
|
+
- Use `useEffect` with proper dependency arrays to avoid infinite loops
|
|
54
|
+
- Implement cleanup functions in effects to prevent memory leaks
|
|
55
|
+
- Use `useMemo` and `useCallback` for performance optimization when needed
|
|
56
|
+
- Create custom hooks for reusable stateful logic
|
|
57
|
+
- Follow the rules of hooks (only call at the top level)
|
|
58
|
+
- Use `useRef` for accessing DOM elements and storing mutable values
|
|
59
|
+
|
|
60
|
+
### Styling
|
|
61
|
+
- Use CSS Modules, Styled Components, or modern CSS-in-JS solutions
|
|
62
|
+
- Implement responsive design with mobile-first approach
|
|
63
|
+
- Follow BEM methodology or similar naming conventions for CSS classes
|
|
64
|
+
- Use CSS custom properties (variables) for theming
|
|
65
|
+
- Implement consistent spacing, typography, and color systems
|
|
66
|
+
- Ensure accessibility with proper ARIA attributes and semantic HTML
|
|
67
|
+
|
|
68
|
+
### Performance Optimization
|
|
69
|
+
- Use `React.memo` for component memoization when appropriate
|
|
70
|
+
- Implement code splitting with `React.lazy` and `Suspense`
|
|
71
|
+
- Optimize bundle size with tree shaking and dynamic imports
|
|
72
|
+
- Use `useMemo` and `useCallback` judiciously to prevent unnecessary re-renders
|
|
73
|
+
- Implement virtual scrolling for large lists
|
|
74
|
+
- Profile components with React DevTools to identify performance bottlenecks
|
|
75
|
+
|
|
76
|
+
### Data Fetching
|
|
77
|
+
- Use modern data fetching libraries (React Query, SWR, Apollo Client)
|
|
78
|
+
- Implement proper loading, error, and success states
|
|
79
|
+
- Handle race conditions and request cancellation
|
|
80
|
+
- Use optimistic updates for better user experience
|
|
81
|
+
- Implement proper caching strategies
|
|
82
|
+
- Handle offline scenarios and network errors gracefully
|
|
83
|
+
|
|
84
|
+
### Error Handling
|
|
85
|
+
- Implement Error Boundaries for component-level error handling
|
|
86
|
+
- Use proper error states in data fetching
|
|
87
|
+
- Implement fallback UI for error scenarios
|
|
88
|
+
- Log errors appropriately for debugging
|
|
89
|
+
- Handle async errors in effects and event handlers
|
|
90
|
+
- Provide meaningful error messages to users
|
|
91
|
+
|
|
92
|
+
### Forms and Validation
|
|
93
|
+
- Use controlled components for form inputs
|
|
94
|
+
- Implement proper form validation with libraries like Formik, React Hook Form
|
|
95
|
+
- Handle form submission and error states appropriately
|
|
96
|
+
- Implement accessibility features for forms (labels, ARIA attributes)
|
|
97
|
+
- Use debounced validation for better user experience
|
|
98
|
+
- Handle file uploads and complex form scenarios
|
|
99
|
+
|
|
100
|
+
### Routing
|
|
101
|
+
- Use React Router for client-side routing
|
|
102
|
+
- Implement nested routes and route protection
|
|
103
|
+
- Handle route parameters and query strings properly
|
|
104
|
+
- Implement lazy loading for route-based code splitting
|
|
105
|
+
- Use proper navigation patterns and back button handling
|
|
106
|
+
- Implement breadcrumbs and navigation state management
|
|
107
|
+
|
|
108
|
+
### Testing
|
|
109
|
+
- Write unit tests for components using React Testing Library
|
|
110
|
+
- Test component behavior, not implementation details
|
|
111
|
+
- Use Jest for test runner and assertion library
|
|
112
|
+
- Implement integration tests for complex component interactions
|
|
113
|
+
- Mock external dependencies and API calls appropriately
|
|
114
|
+
- Test accessibility features and keyboard navigation
|
|
115
|
+
|
|
116
|
+
### Security
|
|
117
|
+
- Sanitize user inputs to prevent XSS attacks
|
|
118
|
+
- Validate and escape data before rendering
|
|
119
|
+
- Use HTTPS for all external API calls
|
|
120
|
+
- Implement proper authentication and authorization patterns
|
|
121
|
+
- Avoid storing sensitive data in localStorage or sessionStorage
|
|
122
|
+
- Use Content Security Policy (CSP) headers
|
|
123
|
+
|
|
124
|
+
### Accessibility
|
|
125
|
+
- Use semantic HTML elements appropriately
|
|
126
|
+
- Implement proper ARIA attributes and roles
|
|
127
|
+
- Ensure keyboard navigation works for all interactive elements
|
|
128
|
+
- Provide alt text for images and descriptive text for icons
|
|
129
|
+
- Implement proper color contrast ratios
|
|
130
|
+
- Test with screen readers and accessibility tools
|
|
131
|
+
|
|
132
|
+
## Implementation Process
|
|
133
|
+
1. Plan component architecture and data flow
|
|
134
|
+
2. Set up project structure with proper folder organization
|
|
135
|
+
3. Define TypeScript interfaces and types
|
|
136
|
+
4. Implement core components with proper styling
|
|
137
|
+
5. Add state management and data fetching logic
|
|
138
|
+
6. Implement routing and navigation
|
|
139
|
+
7. Add form handling and validation
|
|
140
|
+
8. Implement error handling and loading states
|
|
141
|
+
9. Add testing coverage for components and functionality
|
|
142
|
+
10. Optimize performance and bundle size
|
|
143
|
+
11. Ensure accessibility compliance
|
|
144
|
+
12. Add documentation and code comments
|
|
145
|
+
|
|
146
|
+
## Additional Guidelines
|
|
147
|
+
- Follow React's naming conventions (PascalCase for components, camelCase for functions)
|
|
148
|
+
- Use meaningful commit messages and maintain clean git history
|
|
149
|
+
- Implement proper code splitting and lazy loading strategies
|
|
150
|
+
- Document complex components and custom hooks with JSDoc
|
|
151
|
+
- Use ESLint and Prettier for consistent code formatting
|
|
152
|
+
- Keep dependencies up to date and audit for security vulnerabilities
|
|
153
|
+
- Implement proper environment configuration for different deployment stages
|
|
154
|
+
- Use React Developer Tools for debugging and performance analysis
|
|
155
|
+
|
|
156
|
+
## Common Patterns
|
|
157
|
+
- Higher-Order Components (HOCs) for cross-cutting concerns
|
|
158
|
+
- Render props pattern for component composition
|
|
159
|
+
- Compound components for related functionality
|
|
160
|
+
- Provider pattern for context-based state sharing
|
|
161
|
+
- Container/Presentational component separation
|
|
162
|
+
- Custom hooks for reusable logic extraction
|