shmakk 1.1.0 → 1.2.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/README.md +16 -1
- package/package.json +6 -3
- package/scripts/import-skills.js +536 -0
- package/scripts/install-skills.js +64 -0
- package/skills/ai-elements.md +482 -0
- package/skills/architecture.md +151 -0
- package/skills/backend-adapter-aws-lambda.md +204 -0
- package/skills/backend-adapter-express.md +177 -0
- package/skills/backend-adapter-fastify.md +222 -0
- package/skills/backend-adapter-fetch.md +200 -0
- package/skills/backend-api-docs.md +22 -0
- package/skills/backend-aspire.md +232 -0
- package/skills/backend-aspnet-core.md +62 -0
- package/skills/backend-build-chatgpt-app.md +321 -0
- package/skills/backend-build-mcp-app.md +393 -0
- package/skills/backend-build-mcp-server.md +222 -0
- package/skills/backend-build-mcpb.md +200 -0
- package/skills/backend-building-ai-agent-on-cloudflare.md +401 -0
- package/skills/backend-caching.md +206 -0
- package/skills/backend-chatgpt-app-submission.md +157 -0
- package/skills/backend-chatgpt-apps.md +321 -0
- package/skills/backend-client-setup.md +318 -0
- package/skills/backend-containerize-aspnet-framework.md +455 -0
- package/skills/backend-create-spring-boot-java-project.md +164 -0
- package/skills/backend-create-spring-boot-kotlin-project.md +148 -0
- package/skills/backend-csharp-async.md +50 -0
- package/skills/backend-csharp-docs.md +63 -0
- package/skills/backend-csharp-mcp-server-generator.md +60 -0
- package/skills/backend-dotenv.md +201 -0
- package/skills/backend-dotenvx.md +119 -0
- package/skills/backend-env-vars.md +259 -0
- package/skills/backend-error-handling.md +254 -0
- package/skills/backend-fastapi.md +437 -0
- package/skills/backend-go-mcp-server-generator.md +335 -0
- package/skills/backend-java-mcp-server-generator.md +757 -0
- package/skills/backend-kotlin-mcp-server-generator.md +450 -0
- package/skills/backend-middlewares.md +243 -0
- package/skills/backend-multi-stage-dockerfile.md +47 -0
- package/skills/backend-nestjs.md +192 -0
- package/skills/backend-next-forge.md +375 -0
- package/skills/backend-nextjs.md +746 -0
- package/skills/backend-openapi-to-application-code.md +113 -0
- package/skills/backend-php-mcp-server-generator.md +523 -0
- package/skills/backend-python-mcp-server-generator.md +106 -0
- package/skills/backend-routing-middleware.md +251 -0
- package/skills/backend-ruby-mcp-server-generator.md +661 -0
- package/skills/backend-rust-mcp-server-generator.md +578 -0
- package/skills/backend-semantic-kernel.md +57 -0
- package/skills/backend-server-setup.md +379 -0
- package/skills/backend-server-side-calls.md +250 -0
- package/skills/backend-subscriptions.md +407 -0
- package/skills/backend-swift-mcp-server-generator.md +670 -0
- package/skills/backend-trpc-router.md +152 -0
- package/skills/backend-typescript-mcp-server-generator.md +91 -0
- package/skills/backend-validators.md +229 -0
- package/skills/backend.md +76 -0
- package/skills/backup.md +165 -0
- package/skills/budget.md +140 -0
- package/skills/business-gtm-0-to-1-launch.md +322 -0
- package/skills/business-gtm-operating-cadence.md +421 -0
- package/skills/business-gtm-positioning-strategy.md +439 -0
- package/skills/business-gtm-product-led-growth.md +340 -0
- package/skills/calendar.md +95 -0
- package/skills/code-review.md +130 -0
- package/skills/compliance.md +168 -0
- package/skills/contracts.md +130 -0
- package/skills/daily-job-run.md +46 -0
- package/skills/daily-webdesign.md +187 -0
- package/skills/database-bigquery-pipeline-audit.md +130 -0
- package/skills/database-cosmosdb-datamodeling.md +1046 -0
- package/skills/database-durable-objects.md +187 -0
- package/skills/database-ef-core.md +76 -0
- package/skills/database-fabric-lakehouse.md +107 -0
- package/skills/database-neon-postgres-egress-optimizer.md +213 -0
- package/skills/database-neon-postgres.md +218 -0
- package/skills/database-postgresql-code-review.md +213 -0
- package/skills/database-postgresql-optimization.md +405 -0
- package/skills/database-sql-code-review.md +302 -0
- package/skills/database-sql-optimization.md +297 -0
- package/skills/dependency-audit.md +165 -0
- package/skills/design-kami-landing.md +234 -0
- package/skills/design.md +221 -0
- package/skills/dev-acquire-codebase-knowledge.md +175 -0
- package/skills/dev-add-educational-comments.md +129 -0
- package/skills/dev-add-model-descriptions.md +74 -0
- package/skills/dev-adr-review.md +56 -0
- package/skills/dev-boost-prompt.md +26 -0
- package/skills/dev-build-run-debug.md +130 -0
- package/skills/dev-chunk.md +49 -0
- package/skills/dev-claude-md-improver.md +180 -0
- package/skills/dev-code-exemplars-blueprint-generator.md +127 -0
- package/skills/dev-code-tour.md +434 -0
- package/skills/dev-comment-code-generate-a-tutorial.md +27 -0
- package/skills/dev-commit.md +81 -0
- package/skills/dev-context-map.md +53 -0
- package/skills/dev-conventional-commit.md +73 -0
- package/skills/dev-create-architectural-decision-record.md +98 -0
- package/skills/dev-create-draft-pr.md +17 -0
- package/skills/dev-create-pr.md +17 -0
- package/skills/dev-create-readme.md +22 -0
- package/skills/dev-csharp-mstest.md +479 -0
- package/skills/dev-csharp-nunit.md +72 -0
- package/skills/dev-csharp-tunit.md +101 -0
- package/skills/dev-csharp-xunit.md +69 -0
- package/skills/dev-debug-failing-test.md +90 -0
- package/skills/dev-diff-analyze.md +32 -0
- package/skills/dev-diffs.md +24 -0
- package/skills/dev-dotnet-best-practices.md +86 -0
- package/skills/dev-dotnet-design-pattern-review.md +43 -0
- package/skills/dev-dotnet-timezone.md +110 -0
- package/skills/dev-dotnet-upgrade.md +117 -0
- package/skills/dev-doublecheck.md +278 -0
- package/skills/dev-explain-error.md +15 -0
- package/skills/dev-finding-discovery.md +164 -0
- package/skills/dev-fix-finding.md +111 -0
- package/skills/dev-full-file-edit.md +25 -0
- package/skills/dev-git-commit.md +125 -0
- package/skills/dev-git-flow-branch-creator.md +293 -0
- package/skills/dev-git-workflow.md +46 -0
- package/skills/dev-github-automation.md +64 -0
- package/skills/dev-github-code-review.md +1140 -0
- package/skills/dev-github-issues.md +202 -0
- package/skills/dev-gpt-5-4-prompting.md +55 -0
- package/skills/dev-investigation-mode.md +277 -0
- package/skills/dev-java-add-graalvm-native-image-support.md +450 -0
- package/skills/dev-java-docs.md +24 -0
- package/skills/dev-java-refactoring-extract-method.md +105 -0
- package/skills/dev-java-refactoring-remove-parameter.md +85 -0
- package/skills/dev-merge.md +73 -0
- package/skills/dev-migrate-create.md +36 -0
- package/skills/dev-migrate-validate.md +36 -0
- package/skills/dev-my-issues.md +9 -0
- package/skills/dev-my-pull-requests.md +15 -0
- package/skills/dev-planning-oracle-to-postgres-migration-integration-testing.md +45 -0
- package/skills/dev-playwright-generate-test.md +18 -0
- package/skills/dev-playwright.md +148 -0
- package/skills/dev-prompt-builder.md +142 -0
- package/skills/dev-pytest-coverage.md +29 -0
- package/skills/dev-python-manager-discovery.md +330 -0
- package/skills/dev-python-pypi-package-builder.md +445 -0
- package/skills/dev-readme-blueprint-generator.md +79 -0
- package/skills/dev-refactor-method-complexity-reduce.md +99 -0
- package/skills/dev-refactor-plan.md +66 -0
- package/skills/dev-refactor.md +646 -0
- package/skills/dev-review-and-refactor.md +16 -0
- package/skills/dev-reviewing-oracle-to-postgres-migration.md +68 -0
- package/skills/dev-ruff-recursive-fix.md +201 -0
- package/skills/dev-run-e2e-tests.md +126 -0
- package/skills/dev-run-pre-commit-checks.md +133 -0
- package/skills/dev-run-smoke-tests.md +127 -0
- package/skills/dev-scaffolding-oracle-to-postgres-migration-test-project.md +55 -0
- package/skills/dev-spring-boot-testing.md +190 -0
- package/skills/dev-sync-upstream.md +32 -0
- package/skills/dev-sync.md +74 -0
- package/skills/dev-tdd-workflow.md +23 -0
- package/skills/dev-terraform-azurerm-set-diff-analyzer.md +49 -0
- package/skills/dev-test-driven-development.md +372 -0
- package/skills/dev-test-gaps.md +18 -0
- package/skills/dev-test-triage.md +55 -0
- package/skills/dev-typer.md +267 -0
- package/skills/dev-typescript-setup.md +25 -0
- package/skills/dev-unified-diff-edit.md +16 -0
- package/skills/dev-unit-test-vue-pinia.md +198 -0
- package/skills/dev-using-git-worktrees.md +216 -0
- package/skills/dev-validation.md +99 -0
- package/skills/dev-verification.md +168 -0
- package/skills/dev-webapp-testing.md +134 -0
- package/skills/dev-write-coding-standards-from-file.md +317 -0
- package/skills/dev-write-tests.md +16 -0
- package/skills/devops-appinsights-instrumentation.md +49 -0
- package/skills/devops-az-cost-optimize.md +306 -0
- package/skills/devops-chronicle.md +154 -0
- package/skills/devops-deployments-cicd.md +331 -0
- package/skills/devops-devops-rollout-plan.md +118 -0
- package/skills/devops-geistdocs.md +276 -0
- package/skills/devops-observability.md +774 -0
- package/skills/devops-observe-metrics.md +35 -0
- package/skills/devops-observe-trace.md +30 -0
- package/skills/devops-phoenix-cli.md +163 -0
- package/skills/devops-phoenix-tracing.md +140 -0
- package/skills/devops-publish-to-pages.md +108 -0
- package/skills/devops-telemetry.md +87 -0
- package/skills/devops-update-avm-modules-in-bicep.md +61 -0
- package/skills/devops.md +81 -0
- package/skills/diagrams-canvas.md +204 -0
- package/skills/diagrams-draw-io-diagram-generator.md +463 -0
- package/skills/diagrams-excalidraw-diagram-generator.md +614 -0
- package/skills/diagrams-graphify.md +1277 -0
- package/skills/docs-bear-notes.md +108 -0
- package/skills/docs-create-llms.md +211 -0
- package/skills/docs-doc-gen.md +20 -0
- package/skills/docs-documentation-writer.md +46 -0
- package/skills/docs-llm-config.md +33 -0
- package/skills/docs-mkdocs-translations.md +109 -0
- package/skills/docs-obsidian-vault-maintainer.md +14 -0
- package/skills/docs-obsidian.md +82 -0
- package/skills/docs-prose.md +324 -0
- package/skills/docs-update-llms.md +217 -0
- package/skills/docs-update-markdown-file-index.md +77 -0
- package/skills/docs-wiki-maintainer.md +20 -0
- package/skills/documents.md +120 -0
- package/skills/email.md +113 -0
- package/skills/expenses.md +140 -0
- package/skills/file-ops.md +149 -0
- package/skills/files-convert-plaintext-to-md.md +363 -0
- package/skills/files-doc.md +81 -0
- package/skills/files-docx.md +594 -0
- package/skills/files-markdown-to-html.md +917 -0
- package/skills/files-nano-pdf.md +39 -0
- package/skills/files-pdf.md +315 -0
- package/skills/files-pdftk-server.md +163 -0
- package/skills/files-pptx-html-fidelity-audit.md +255 -0
- package/skills/files-pptx.md +231 -0
- package/skills/files-xlsx.md +301 -0
- package/skills/find-jobs.md +78 -0
- package/skills/format-conversion.md +157 -0
- package/skills/frontend-ai-elements.md +483 -0
- package/skills/frontend-ai-gateway.md +563 -0
- package/skills/frontend-ai-generation-persistence.md +242 -0
- package/skills/frontend-ai-sdk.md +799 -0
- package/skills/frontend-ai-visibility.md +127 -0
- package/skills/frontend-angular-developer.md +130 -0
- package/skills/frontend-aspnet-minimal-api-openapi.md +42 -0
- package/skills/frontend-bencium-innovative-ux-designer.md +719 -0
- package/skills/frontend-chat-sdk.md +666 -0
- package/skills/frontend-chrome-devtools.md +98 -0
- package/skills/frontend-frontend-app-builder.md +186 -0
- package/skills/frontend-frontend-design.md +43 -0
- package/skills/frontend-frontend-testing-debugging.md +143 -0
- package/skills/frontend-gsap-framer-scroll-animation.md +152 -0
- package/skills/frontend-internal-linking.md +109 -0
- package/skills/frontend-json-render.md +335 -0
- package/skills/frontend-keyword-clustering.md +118 -0
- package/skills/frontend-next-intl-add-language.md +20 -0
- package/skills/frontend-on-page-seo.md +112 -0
- package/skills/frontend-premium-frontend-ui.md +114 -0
- package/skills/frontend-react-best-practices.md +143 -0
- package/skills/frontend-schema-markup.md +160 -0
- package/skills/frontend-seo-audit.md +110 -0
- package/skills/frontend-swr.md +215 -0
- package/skills/frontend-technical-seo.md +162 -0
- package/skills/frontend-use-dom.md +418 -0
- package/skills/frontend-web-coder.md +564 -0
- package/skills/frontend-web-design-reviewer.md +369 -0
- package/skills/frontend-web-perf.md +202 -0
- package/skills/frontend.md +125 -0
- package/skills/general-adapter-standalone.md +199 -0
- package/skills/general-auth.md +356 -0
- package/skills/general-containerize-aspnetcore.md +393 -0
- package/skills/general-create-technical-spike.md +231 -0
- package/skills/general-cron-jobs.md +72 -0
- package/skills/general-ddd-aggregate.md +52 -0
- package/skills/general-ddd-context.md +46 -0
- package/skills/general-ddd-validate.md +51 -0
- package/skills/general-dependency-check.md +26 -0
- package/skills/general-email-marketing.md +86 -0
- package/skills/general-healthcheck.md +246 -0
- package/skills/general-import-infrastructure-as-code.md +368 -0
- package/skills/general-init.md +49 -0
- package/skills/general-java-junit.md +64 -0
- package/skills/general-java-springboot.md +66 -0
- package/skills/general-javascript-typescript-jest.md +45 -0
- package/skills/general-kotlin-springboot.md +71 -0
- package/skills/general-make-repo-contribution.md +91 -0
- package/skills/general-market-research.md +78 -0
- package/skills/general-marketplace.md +468 -0
- package/skills/general-model-recommendation.md +673 -0
- package/skills/general-payments.md +352 -0
- package/skills/general-quality-playbook.md +480 -0
- package/skills/general-run-integration-tests.md +113 -0
- package/skills/general-superjson.md +274 -0
- package/skills/general-swiftpm-macos.md +51 -0
- package/skills/general-threat-model.md +61 -0
- package/skills/invoices.md +167 -0
- package/skills/licenses.md +159 -0
- package/skills/logs.md +156 -0
- package/skills/marketing.md +139 -0
- package/skills/media-image-manipulation-image-magick.md +253 -0
- package/skills/media-imagegen.md +357 -0
- package/skills/media-openai-whisper-api.md +63 -0
- package/skills/media-openai-whisper.md +39 -0
- package/skills/media-peekaboo.md +191 -0
- package/skills/media-screenshot.md +268 -0
- package/skills/media-speech.md +145 -0
- package/skills/media-transcribe.md +82 -0
- package/skills/media-video-frames.md +47 -0
- package/skills/mobile-android-emulator-qa.md +81 -0
- package/skills/mobile-android-performance.md +280 -0
- package/skills/mobile-building-mcp-server-on-cloudflare.md +267 -0
- package/skills/mobile-building-native-ui.md +322 -0
- package/skills/mobile-expo-api-routes.md +369 -0
- package/skills/mobile-expo-cicd-workflows.md +92 -0
- package/skills/mobile-expo-deployment.md +191 -0
- package/skills/mobile-expo-dev-client.md +165 -0
- package/skills/mobile-expo-module.md +177 -0
- package/skills/mobile-expo-tailwind-setup.md +481 -0
- package/skills/mobile-expo-ui-jetpack-compose.md +41 -0
- package/skills/mobile-expo-ui-swift-ui.md +40 -0
- package/skills/mobile-ios-app-intents.md +78 -0
- package/skills/mobile-ios-debugger-agent.md +52 -0
- package/skills/mobile-ios-ettrace-performance.md +198 -0
- package/skills/mobile-ios-memgraph-leaks.md +77 -0
- package/skills/mobile-native-data-fetching.md +508 -0
- package/skills/mobile-packaging-notarization.md +48 -0
- package/skills/mobile-react-native-architecture.md +672 -0
- package/skills/mobile-react-native-mobile-design.md +438 -0
- package/skills/mobile-signing-entitlements.md +59 -0
- package/skills/mobile-swiftui-liquid-glass.md +91 -0
- package/skills/mobile-swiftui-patterns.md +210 -0
- package/skills/mobile-swiftui-performance-audit.md +108 -0
- package/skills/mobile-swiftui-ui-patterns.md +97 -0
- package/skills/mobile-swiftui-view-refactor.md +204 -0
- package/skills/mobile-upgrading-expo.md +134 -0
- package/skills/mobile.md +183 -0
- package/skills/notes.md +106 -0
- package/skills/planning-adr-create.md +62 -0
- package/skills/planning-adr-index.md +67 -0
- package/skills/planning-architecture-blueprint-generator.md +323 -0
- package/skills/planning-brainstorming.md +165 -0
- package/skills/planning-breakdown-epic-arch.md +67 -0
- package/skills/planning-breakdown-epic-pm.md +59 -0
- package/skills/planning-breakdown-feature-implementation.md +129 -0
- package/skills/planning-breakdown-feature-prd.md +62 -0
- package/skills/planning-breakdown-plan.md +510 -0
- package/skills/planning-breakdown-test.md +366 -0
- package/skills/planning-cloud-design-patterns.md +63 -0
- package/skills/planning-content-brief.md +128 -0
- package/skills/planning-content-strategy.md +138 -0
- package/skills/planning-content-translation.md +143 -0
- package/skills/planning-create-github-action-workflow-specification.md +277 -0
- package/skills/planning-create-github-issues-feature-from-implementation-plan.md +29 -0
- package/skills/planning-create-github-issues-for-unmet-specification-requirements.md +36 -0
- package/skills/planning-create-github-pull-request-from-specification.md +25 -0
- package/skills/planning-create-implementation-plan.md +158 -0
- package/skills/planning-create-specification.md +128 -0
- package/skills/planning-first-ask.md +31 -0
- package/skills/planning-folder-structure-blueprint-generator.md +406 -0
- package/skills/planning-gen-specs-as-issues.md +166 -0
- package/skills/planning-generate-snapshot.md +144 -0
- package/skills/planning-generate-status-report.md +336 -0
- package/skills/planning-metric-pack-designer.md +27 -0
- package/skills/planning-pm-spec.md +53 -0
- package/skills/planning-prd.md +144 -0
- package/skills/planning-project-assessment.md +182 -0
- package/skills/planning-project-setup-info-local.md +128 -0
- package/skills/planning-project-workflow-analysis-blueprint-generator.md +294 -0
- package/skills/planning-service-oriented-architecture.md +248 -0
- package/skills/planning-spec-to-backlog.md +544 -0
- package/skills/planning-technology-stack-blueprint-generator.md +243 -0
- package/skills/planning-update-implementation-plan.md +158 -0
- package/skills/planning-update-specification.md +128 -0
- package/skills/planning-what-context-needed.md +40 -0
- package/skills/planning-writing-plans.md +153 -0
- package/skills/prepare-application.md +81 -0
- package/skills/productivity-apple-notes.md +78 -0
- package/skills/productivity-apple-reminders.md +119 -0
- package/skills/productivity-capture-tasks-from-meeting-notes.md +680 -0
- package/skills/productivity-daily-prep.md +156 -0
- package/skills/productivity-email-drafter.md +101 -0
- package/skills/productivity-hr-onboarding.md +53 -0
- package/skills/productivity-things-mac.md +87 -0
- package/skills/productivity-update.md +169 -0
- package/skills/reminders.md +109 -0
- package/skills/research-dossier-collect.md +71 -0
- package/skills/research-kg-extract.md +37 -0
- package/skills/research-openai-docs.md +89 -0
- package/skills/research-research-add-items.md +31 -0
- package/skills/research-research-report.md +94 -0
- package/skills/research-research-synthesize.md +63 -0
- package/skills/research-summarize.md +88 -0
- package/skills/research-transformers-js.md +635 -0
- package/skills/research.md +119 -0
- package/skills/security-ai-prompt-engineering-safety-review.md +231 -0
- package/skills/security-attack-path-analysis.md +182 -0
- package/skills/security-gdpr-compliant.md +284 -0
- package/skills/security-mcp-security-audit.md +279 -0
- package/skills/security-pii-detect.md +31 -0
- package/skills/security-secret-scanning.md +243 -0
- package/skills/security-security-best-practices.md +87 -0
- package/skills/security-security-ownership-map.md +207 -0
- package/skills/security-security-review.md +169 -0
- package/skills/security-security-scan.md +138 -0
- package/skills/security-security-threat-model.md +82 -0
- package/skills/security-threat-model-analyst.md +76 -0
- package/skills/sysmon.md +181 -0
- package/skills/system-arch-linux-triage.md +32 -0
- package/skills/system-centos-linux-triage.md +32 -0
- package/skills/system-debian-linux-triage.md +32 -0
- package/skills/system-fedora-linux-triage.md +32 -0
- package/skills/system-geofeed-tuner.md +865 -0
- package/skills/system-iot-anomalies.md +15 -0
- package/skills/system-iot-firmware.md +16 -0
- package/skills/system-iot-fleet.md +14 -0
- package/skills/system-iot-register.md +19 -0
- package/skills/system-iot-witness-verify.md +15 -0
- package/skills/system-tmux.md +171 -0
- package/skills/system-window-management.md +228 -0
- package/skills/task-management.md +90 -0
- package/skills/tasks.md +102 -0
- package/skills/test-coverage.md +188 -0
- package/skills/ux-ui.md +128 -0
- package/skills/web.md +186 -0
- package/skills/workflow-act-on-feedback.md +15 -0
- package/skills/workflow-automate-this.md +245 -0
- package/skills/workflow-autoresearch.md +276 -0
- package/skills/workflow-coding-agent.md +317 -0
- package/skills/workflow-deep-research.md +44 -0
- package/skills/workflow-dispatching-parallel-agents.md +183 -0
- package/skills/workflow-eval-driven-dev.md +148 -0
- package/skills/workflow-executing-plans.md +71 -0
- package/skills/workflow-mentoring-juniors.md +311 -0
- package/skills/workflow-receiving-code-review.md +214 -0
- package/skills/workflow-repo-story-time.md +155 -0
- package/skills/workflow-requesting-code-review.md +104 -0
- package/skills/workflow-session-report.md +43 -0
- package/skills/workflow-structured-autonomy-generate.md +126 -0
- package/skills/workflow-subagent-driven-development.md +280 -0
- package/skills/writing.md +106 -0
- package/src/agent.js +0 -0
- package/src/browser.js +297 -0
- package/src/cli.js +25 -4
- package/src/code-reviewer.js +119 -0
- package/src/completions.js +1 -1
- package/src/control.js +222 -30
- package/src/coordinator.js +303 -0
- package/src/correction.js +29 -8
- package/src/edit-tracker.js +21 -0
- package/src/edit-viewer.js +414 -0
- package/src/endpoints.js +64 -15
- package/src/index.js +45 -11
- package/src/llm.js +86 -2
- package/src/mcp-client.js +416 -0
- package/src/memory.js +182 -0
- package/src/planner.js +216 -0
- package/src/rules.js +90 -0
- package/src/self-commands.js +757 -0
- package/src/services/voice.js +10 -7
- package/src/session-search.js +427 -0
- package/src/session.js +487 -99
- package/src/shmakk-server.js +91 -0
- package/src/skills.js +410 -3
- package/src/subagent.js +4 -1
- package/src/system-prompt.js +13 -5
- package/src/task-file.js +114 -0
- package/src/taskClassifier.js +246 -0
- package/src/team.js +752 -0
- package/src/tools.js +142 -21
- package/src/web.js +35 -5
- package/src/workflows.js +261 -0
- package/src/workspace-index.js +25 -6
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: import-infrastructure-as-code
|
|
3
|
+
description: 'Import existing Azure resources into Terraform using Azure CLI discovery and Azure Verified Modules (AVM). Use when asked to reverse-engineer live Azure infrastructure, generate Infrastructure as Code from existing subscriptions/resource groups/resource IDs, map dependencies, derive exact import addresses from downloaded module source, prevent configuration drift, and produce AVM-based Terraform files ready for validation and planning across any Azure resource type.'
|
|
4
|
+
category: general
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Import Infrastructure as Code (Azure -> Terraform with AVM)
|
|
8
|
+
|
|
9
|
+
Convert existing Azure infrastructure into maintainable Terraform code using discovery data and Azure Verified Modules.
|
|
10
|
+
|
|
11
|
+
## When to Use This Skill
|
|
12
|
+
|
|
13
|
+
Use this skill when the user asks to:
|
|
14
|
+
|
|
15
|
+
- Import existing Azure resources into Terraform
|
|
16
|
+
- Generate IaC from live Azure environments
|
|
17
|
+
- Handle any Azure resource type supported by AVM (and document justified non-AVM fallbacks)
|
|
18
|
+
- Recreate infrastructure from a subscription or resource group
|
|
19
|
+
- Map dependencies between discovered Azure resources
|
|
20
|
+
- Use AVM modules instead of handwritten `azurerm_*` resources
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
- Azure CLI installed and authenticated (`az login`)
|
|
25
|
+
- Access to the target subscription or resource group
|
|
26
|
+
- Terraform CLI installed
|
|
27
|
+
- Network access to Terraform Registry and AVM index sources
|
|
28
|
+
|
|
29
|
+
## Inputs
|
|
30
|
+
|
|
31
|
+
| Parameter | Required | Default | Description |
|
|
32
|
+
|---|---|---|---|
|
|
33
|
+
| `subscription-id` | No | Active CLI context | Azure subscription used for subscription-scope discovery and context setting |
|
|
34
|
+
| `resource-group-name` | No | None | Azure resource group used for resource-group-scope discovery |
|
|
35
|
+
| `resource-id` | No | None | One or more Azure ARM resource IDs used for specific-resource-scope discovery |
|
|
36
|
+
|
|
37
|
+
At least one of `subscription-id`, `resource-group-name`, or `resource-id` is required.
|
|
38
|
+
|
|
39
|
+
## Step-by-Step Workflows
|
|
40
|
+
|
|
41
|
+
### 1) Collect Required Scope (Mandatory)
|
|
42
|
+
|
|
43
|
+
Request one of these scopes before running discovery commands:
|
|
44
|
+
|
|
45
|
+
- Subscription scope: `<subscription-id>`
|
|
46
|
+
- Resource group scope: `<resource-group-name>`
|
|
47
|
+
- Specific resources scope: one or more `<resource-id>` values
|
|
48
|
+
|
|
49
|
+
Scope handling rules:
|
|
50
|
+
|
|
51
|
+
- Treat Azure ARM resource IDs (for example `/subscriptions/.../providers/...`) as cloud resource identifiers, not local file system paths.
|
|
52
|
+
- Use resource IDs only with Azure CLI `--ids` arguments (for example `az resource show --ids <resource-id>`).
|
|
53
|
+
- Never pass resource IDs to file-reading commands (`cat`, `ls`, `read_file`, glob searches) unless the user explicitly says they are local file paths.
|
|
54
|
+
- If the user already provided one valid scope, do not ask for additional scope inputs unless required by a failing command.
|
|
55
|
+
- Do not ask follow-up questions that can be answered from already-provided scope values.
|
|
56
|
+
|
|
57
|
+
If scope is missing, ask for it explicitly and stop.
|
|
58
|
+
|
|
59
|
+
### 2) Authenticate and Set Context
|
|
60
|
+
|
|
61
|
+
Run only the commands required for the selected scope.
|
|
62
|
+
|
|
63
|
+
For subscription scope:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
az login
|
|
67
|
+
az account set --subscription <subscription-id>
|
|
68
|
+
az account show --query "{subscriptionId:id, name:name, tenantId:tenantId}" -o json
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Expected output: JSON object with `subscriptionId`, `name`, and `tenantId`.
|
|
72
|
+
|
|
73
|
+
For resource group or specific resource scope, `az login` is still required but `az account set` is optional if the active context is already correct.
|
|
74
|
+
|
|
75
|
+
When using specific resource scope, prefer direct `--ids`-based commands first and avoid extra discovery prompts for subscription or resource group unless needed for a concrete command.
|
|
76
|
+
|
|
77
|
+
### 3) Run Discovery Commands
|
|
78
|
+
|
|
79
|
+
Discover resources using the selected scopes. Ensure to fetch all necessary information for accurate Terraform generation.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Subscription scope
|
|
83
|
+
az resource list --subscription <subscription-id> -o json
|
|
84
|
+
|
|
85
|
+
# Resource group scope
|
|
86
|
+
az resource list --resource-group <resource-group-name> -o json
|
|
87
|
+
|
|
88
|
+
# Specific resource scope
|
|
89
|
+
az resource show --ids <resource-id-1> <resource-id-2> ... -o json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Expected output: JSON object or array containing Azure resource metadata (`id`, `type`, `name`, `location`, `tags`, `properties`).
|
|
93
|
+
|
|
94
|
+
### 4) Resolve Dependencies Before Code Generation
|
|
95
|
+
|
|
96
|
+
Parse exported JSON and map:
|
|
97
|
+
|
|
98
|
+
- Parent-child relationships (for example: NIC -> Subnet -> VNet)
|
|
99
|
+
- Cross-resource references in `properties`
|
|
100
|
+
- Ordering for Terraform creation
|
|
101
|
+
|
|
102
|
+
IMPORTANT: Generate the following documentation and save it to a docs folder in the root of the project.
|
|
103
|
+
- `exported-resources.json` with all discovered resources and their metadata, including dependencies and references.
|
|
104
|
+
- `EXPORTED-ARCHITECTURE.MD` file with a human-readable architecture overview based on the discovered resources and their relationships.
|
|
105
|
+
|
|
106
|
+
### 5) Select Azure Verified Modules (Required)
|
|
107
|
+
|
|
108
|
+
Use the latest AVM version for each resource type.
|
|
109
|
+
|
|
110
|
+
### Terraform Registry
|
|
111
|
+
|
|
112
|
+
- Search for "avm" + resource name
|
|
113
|
+
- Filter by "Partner" tag to find official AVM modules
|
|
114
|
+
- Example: Search "avm storage account" → filter by Partner
|
|
115
|
+
|
|
116
|
+
### Official AVM Index
|
|
117
|
+
|
|
118
|
+
> **Note:** The following links always point to the latest version of the CSV files on the main branch. As intended, this means the files may change over time. If you require a point-in-time version, consider using a specific release tag in the URL.
|
|
119
|
+
|
|
120
|
+
- **Terraform Resource Modules**: `https://raw.githubusercontent.com/Azure/Azure-Verified-Modules/refs/heads/main/docs/static/module-indexes/TerraformResourceModules.csv`
|
|
121
|
+
- **Terraform Pattern Modules**: `https://raw.githubusercontent.com/Azure/Azure-Verified-Modules/refs/heads/main/docs/static/module-indexes/TerraformPatternModules.csv`
|
|
122
|
+
- **Terraform Utility Modules**: `https://raw.githubusercontent.com/Azure/Azure-Verified-Modules/refs/heads/main/docs/static/module-indexes/TerraformUtilityModules.csv`
|
|
123
|
+
|
|
124
|
+
### Individual Module information
|
|
125
|
+
|
|
126
|
+
Use the `web` tool or another suitable MCP method to get module information if not available locally in the `.terraform` folder.
|
|
127
|
+
|
|
128
|
+
Use AVM sources:
|
|
129
|
+
|
|
130
|
+
- Registry: `https://registry.terraform.io/modules/Azure/<module>/azurerm/latest`
|
|
131
|
+
- GitHub: `https://github.com/Azure/terraform-azurerm-avm-res-<service>-<resource>`
|
|
132
|
+
|
|
133
|
+
Prefer AVM modules over handwritten `azurerm_*` resources when an AVM module exists.
|
|
134
|
+
|
|
135
|
+
When fetching module information from GitHub repositories, the README.md file in the root of the repository typically contains all detailed information about the module, for example: https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-res-<service>-<resource>/refs/heads/main/README.md
|
|
136
|
+
|
|
137
|
+
### 5a) Read the Module README Before Writing Any Code (Mandatory)
|
|
138
|
+
|
|
139
|
+
**This step is not optional.** Before writing a single line of HCL for a module, fetch and
|
|
140
|
+
read the full README for that module. Do not rely on knowledge of the raw `azurerm` provider
|
|
141
|
+
or prior experience with other AVM modules.
|
|
142
|
+
|
|
143
|
+
For each selected AVM module, fetch its README:
|
|
144
|
+
|
|
145
|
+
```text
|
|
146
|
+
https://raw.githubusercontent.com/Azure/terraform-azurerm-avm-res-<service>-<resource>/refs/heads/main/README.md
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Or if the module is already downloaded after `terraform init`:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
cat .terraform/modules/<module_key>/README.md
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
From the README, extract and record **before writing code**:
|
|
156
|
+
|
|
157
|
+
1. **Required Inputs** — every input the module requires. Any child resource listed here
|
|
158
|
+
(NICs, extensions, subnets, public IPs) is managed **inside** the module. Do **not**
|
|
159
|
+
create standalone module blocks for those resources.
|
|
160
|
+
2. **Optional Inputs** — the exact Terraform variable names and their declared `type`.
|
|
161
|
+
Do not assume they match the raw `azurerm` provider argument names or block shapes.
|
|
162
|
+
3. **Usage examples** — check what resource group identifier is used (`parent_id` vs
|
|
163
|
+
`resource_group_name`), how child resources are expressed (inline map vs separate module),
|
|
164
|
+
and what syntax each input expects.
|
|
165
|
+
|
|
166
|
+
#### Apply module rules as patterns, not assumptions
|
|
167
|
+
|
|
168
|
+
Use the lessons below as examples of the *type* of mismatch that often causes imports to fail.
|
|
169
|
+
Do not assume these exact names apply to every AVM module. Always verify each selected module's
|
|
170
|
+
README and `variables.tf`.
|
|
171
|
+
|
|
172
|
+
**`avm-res-compute-virtualmachine` (any version)**
|
|
173
|
+
|
|
174
|
+
- `network_interfaces` is a **Required Input**. NICs are owned by the VM module. Never
|
|
175
|
+
create standalone `avm-res-network-networkinterface` modules alongside a VM module —
|
|
176
|
+
define every NIC inline under `network_interfaces`.
|
|
177
|
+
- TrustedLaunch is expressed through the top-level booleans `secure_boot_enabled = true`
|
|
178
|
+
and `vtpm_enabled = true`. The `security_type` argument exists only under `os_disk` for
|
|
179
|
+
Confidential VM disk encryption and must not be used for TrustedLaunch.
|
|
180
|
+
- `boot_diagnostics` is a `bool`, not an object. Use `boot_diagnostics = true`; use the
|
|
181
|
+
separate `boot_diagnostics_storage_account_uri` variable if a storage URI is needed.
|
|
182
|
+
- Extensions are managed inside the module via the `extensions` map. Do not create
|
|
183
|
+
standalone extension resources.
|
|
184
|
+
|
|
185
|
+
**`avm-res-network-virtualnetwork` (any version)**
|
|
186
|
+
|
|
187
|
+
- This module is backed by the AzAPI provider, not `azurerm`. Use `parent_id` (the full
|
|
188
|
+
resource group resource ID string) to specify the resource group, not `resource_group_name`.
|
|
189
|
+
- Every example in the README shows `parent_id`; none show `resource_group_name`.
|
|
190
|
+
|
|
191
|
+
Generalized takeaway for all AVM modules:
|
|
192
|
+
|
|
193
|
+
- Determine child resource ownership from **Required Inputs** before creating sibling modules.
|
|
194
|
+
- Determine accepted variable names and types from **Optional Inputs** and `variables.tf`.
|
|
195
|
+
- Determine identifier style and input shape from README usage examples.
|
|
196
|
+
- Do not infer argument names from raw `azurerm_*` resources.
|
|
197
|
+
|
|
198
|
+
### 6) Generate Terraform Files
|
|
199
|
+
|
|
200
|
+
### Before Writing Import Blocks — Inspect Module Source (Mandatory)
|
|
201
|
+
|
|
202
|
+
After `terraform init` downloads the modules, inspect each module's source files to determine
|
|
203
|
+
the exact Terraform resource addresses before writing any `import {}` blocks. Never write
|
|
204
|
+
import addresses from memory.
|
|
205
|
+
|
|
206
|
+
#### Step A — Identify the provider and resource label
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
grep "^resource" .terraform/modules/<module_key>/main*.tf
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
This reveals whether the module uses `azurerm_*` or `azapi_resource` labels. For example,
|
|
213
|
+
`avm-res-network-virtualnetwork` exposes `azapi_resource "vnet"`, not
|
|
214
|
+
`azurerm_virtual_network "this"`.
|
|
215
|
+
|
|
216
|
+
#### Step B — Identify child modules and nested paths
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
grep "^module" .terraform/modules/<module_key>/main*.tf
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
If child resources are managed in a sub-module (subnets, extensions, etc.), the import
|
|
223
|
+
address must include every intermediate module label:
|
|
224
|
+
|
|
225
|
+
```text
|
|
226
|
+
module.<root_module_key>.module.<child_module_key>["<map_key>"].<resource_type>.<label>[<index>]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
#### Step C — Check for `count` vs `for_each`
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
grep -n "count\|for_each" .terraform/modules/<module_key>/main*.tf
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Any resource using `count` requires an index in the import address. When `count = 1` (e.g.,
|
|
236
|
+
conditional Linux vs Windows selection), the address must end with `[0]`. Resources using
|
|
237
|
+
`for_each` use string keys, not numeric indexes.
|
|
238
|
+
|
|
239
|
+
#### Known import address patterns (examples from lessons learned)
|
|
240
|
+
|
|
241
|
+
These are examples only. Use them as templates for reasoning, then derive the exact addresses
|
|
242
|
+
from the downloaded source code for the modules in your current import.
|
|
243
|
+
|
|
244
|
+
| Resource | Correct import `to` address pattern |
|
|
245
|
+
|---|---|
|
|
246
|
+
| AzAPI-backed VNet | `module.<vnet_key>.azapi_resource.vnet` |
|
|
247
|
+
| Subnet (nested, count-based) | `module.<vnet_key>.module.subnet["<subnet_name>"].azapi_resource.subnet[0]` |
|
|
248
|
+
| Linux VM (count-based) | `module.<vm_key>.azurerm_linux_virtual_machine.this[0]` |
|
|
249
|
+
| VM NIC | `module.<vm_key>.azurerm_network_interface.virtualmachine_network_interfaces["<nic_key>"]` |
|
|
250
|
+
| VM extension (default deploy_sequence=5) | `module.<vm_key>.module.extension["<ext_name>"].azurerm_virtual_machine_extension.this` |
|
|
251
|
+
| VM extension (deploy_sequence=1–4) | `module.<vm_key>.module.extension_<n>["<ext_name>"].azurerm_virtual_machine_extension.this` |
|
|
252
|
+
| NSG-NIC association | `module.<vm_key>.azurerm_network_interface_security_group_association.this["<nic_key>-<nsg_key>"]` |
|
|
253
|
+
|
|
254
|
+
Produce:
|
|
255
|
+
|
|
256
|
+
- `providers.tf` with `azurerm` provider and required version constraints
|
|
257
|
+
- `main.tf` with AVM module blocks and explicit dependencies
|
|
258
|
+
- `variables.tf` for environment-specific values
|
|
259
|
+
- `outputs.tf` for key IDs and endpoints
|
|
260
|
+
- `terraform.tfvars.example` with placeholder values
|
|
261
|
+
|
|
262
|
+
### Diff Live Properties Against Module Defaults (Mandatory)
|
|
263
|
+
|
|
264
|
+
After writing the initial configuration, compare every non-zero property of each discovered
|
|
265
|
+
live resource against the default value declared in the corresponding AVM module's
|
|
266
|
+
`variables.tf`. Any property where the live value differs from the module default must be
|
|
267
|
+
set explicitly in the Terraform configuration.
|
|
268
|
+
|
|
269
|
+
Pay particular attention to the following property categories, which are common sources
|
|
270
|
+
of silent configuration drift:
|
|
271
|
+
|
|
272
|
+
- **Timeout values** (e.g., Public IP `idle_timeout_in_minutes` defaults to `4`; live
|
|
273
|
+
deployments often use `30`)
|
|
274
|
+
- **Network policy flags** (e.g., subnet `private_endpoint_network_policies` defaults to
|
|
275
|
+
`"Enabled"`; existing subnets often have `"Disabled"`)
|
|
276
|
+
- **SKU and allocation** (e.g., Public IP `sku`, `allocation_method`)
|
|
277
|
+
- **Availability zones** (e.g., VM zone, Public IP zone)
|
|
278
|
+
- **Redundancy and replication** settings on storage and database resources
|
|
279
|
+
|
|
280
|
+
Retrieve full live properties with explicit `az` commands, for example:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
az network public-ip show --ids <resource_id> --query "{idleTimeout:idleTimeoutInMinutes, sku:sku.name, zones:zones}" -o json
|
|
284
|
+
az network vnet subnet show --ids <resource_id> --query "{privateEndpointPolicies:privateEndpointNetworkPolicies, delegation:delegations}" -o json
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Do not rely solely on `az resource list` output, which may omit nested or computed properties.
|
|
288
|
+
|
|
289
|
+
Pin module versions explicitly:
|
|
290
|
+
|
|
291
|
+
```hcl
|
|
292
|
+
module "example" {
|
|
293
|
+
source = "Azure/<module>/azurerm"
|
|
294
|
+
version = "<latest-compatible-version>"
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### 7) Validate Generated Code
|
|
299
|
+
|
|
300
|
+
Run:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
terraform init
|
|
304
|
+
terraform fmt -recursive
|
|
305
|
+
terraform validate
|
|
306
|
+
terraform plan
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
Expected output: no syntax errors, no validation errors, and a plan that matches discovered infrastructure intent.
|
|
310
|
+
|
|
311
|
+
## Troubleshooting
|
|
312
|
+
|
|
313
|
+
| Problem | Likely Cause | Action |
|
|
314
|
+
|---|---|---|
|
|
315
|
+
| `az` command fails with authorization errors | Wrong tenant/subscription or missing RBAC role | Re-run `az login`, verify subscription context, confirm required permissions |
|
|
316
|
+
| Discovery output is empty | Incorrect scope or no resources in scope | Re-check scope input and run scoped list/show command again |
|
|
317
|
+
| No AVM module found for a resource type | Resource type not yet covered by AVM | Use native `azurerm_*` resource for that type and document the gap |
|
|
318
|
+
| `terraform validate` fails | Missing variables or unresolved dependencies | Add required variables and explicit dependencies, then re-run validation |
|
|
319
|
+
| Unknown argument or variable not found in module | AVM variable name differs from `azurerm` provider argument name | Read the module README `variables.tf` or Optional Inputs section for the correct name |
|
|
320
|
+
| Import block fails — resource not found at address | Wrong provider label (`azurerm_` vs `azapi_`), missing sub-module path, or missing `[0]` index | Run `grep "^resource" .terraform/modules/<key>/main*.tf` and `grep "^module"` to find exact address |
|
|
321
|
+
| `terraform plan` shows unexpected `~ update` on imported resource | Live value differs from AVM module default | Fetch live property with `az <resource> show`, compare to module default, add explicit value |
|
|
322
|
+
| Child-resource module gives "provider configuration not present" | Child resources declared as standalone modules even though parent module owns them | Check Required Inputs in README, remove incorrect standalone modules, and model child resources using the parent module's documented input structure |
|
|
323
|
+
| Nested child resource import fails with "resource not found" | Missing intermediate module path, wrong map key, or missing index | Inspect module blocks and `count`/`for_each` in source; build full nested import address including all module segments and required key/index |
|
|
324
|
+
| Tool tries to read ARM resource ID as file path or asks repeated scope questions | Resource ID not treated as `--ids` input, or agent did not trust already-provided scope | Treat ARM IDs strictly as cloud identifiers, use `az ... --ids ...`, and stop re-prompting once one valid scope is present |
|
|
325
|
+
|
|
326
|
+
## Response Contract
|
|
327
|
+
|
|
328
|
+
When returning results, provide:
|
|
329
|
+
|
|
330
|
+
1. Scope used (subscription, resource group, or resource IDs)
|
|
331
|
+
2. Discovery files created
|
|
332
|
+
3. Resource types detected
|
|
333
|
+
4. AVM modules selected with versions
|
|
334
|
+
5. Terraform files generated or updated
|
|
335
|
+
6. Validation command results
|
|
336
|
+
7. Open gaps requiring user input (if any)
|
|
337
|
+
|
|
338
|
+
## Execution Rules for the Agent
|
|
339
|
+
|
|
340
|
+
- Do not continue if scope is missing.
|
|
341
|
+
- Do not claim successful import without listing discovered files and validation output.
|
|
342
|
+
- Do not skip dependency mapping before generating Terraform.
|
|
343
|
+
- Prefer AVM modules first; justify each non-AVM fallback explicitly.
|
|
344
|
+
- **Read the README for every AVM module before writing code.** Required Inputs identify
|
|
345
|
+
which child resources the module owns. Optional Inputs document exact variable names and
|
|
346
|
+
types. Usage examples show provider-specific conventions (`parent_id` vs
|
|
347
|
+
`resource_group_name`). Skipping the README is the single most common cause of
|
|
348
|
+
code errors in AVM-based imports.
|
|
349
|
+
- **Never assume NIC, extension, or public IP resources are standalone.** For
|
|
350
|
+
any AVM module, treat child resources as parent-owned unless the README explicitly indicates
|
|
351
|
+
a separate module is required. Check Required Inputs before creating sibling modules.
|
|
352
|
+
- **Never write import addresses from memory.** After `terraform init`, grep the downloaded
|
|
353
|
+
module source to discover the actual provider (`azurerm` vs `azapi`), resource labels,
|
|
354
|
+
sub-module nesting, and `count` vs `for_each` usage before writing any `import {}` block.
|
|
355
|
+
- **Never treat ARM resource IDs as file paths.** Resource IDs belong in Azure CLI `--ids`
|
|
356
|
+
arguments and API queries, not file IO tools. Only read local files when a real workspace
|
|
357
|
+
path is provided.
|
|
358
|
+
- **Minimize prompts when scope is already known.** If subscription, resource group, or
|
|
359
|
+
specific resource IDs are already provided, proceed with commands directly and only ask a
|
|
360
|
+
follow-up when a command fails due to missing required context.
|
|
361
|
+
- **Do not declare the import complete until `terraform plan` shows 0 destroys and 0
|
|
362
|
+
unwanted changes.** Telemetry `+ create` resources are acceptable. Any `~ update` or
|
|
363
|
+
`- destroy` on real infrastructure resources must be resolved.
|
|
364
|
+
|
|
365
|
+
## References
|
|
366
|
+
|
|
367
|
+
- [Azure Verified Modules index (Terraform)](https://github.com/Azure/Azure-Verified-Modules/tree/main/docs/static/module-indexes)
|
|
368
|
+
- [Terraform AVM Registry namespace](https://registry.terraform.io/namespaces/Azure)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: init
|
|
3
|
+
description: Generate or update chat customization files for AI coding agents
|
|
4
|
+
argument-hint: Optionally specify a focus area or pattern to document for agents
|
|
5
|
+
disable-model-invocation: true
|
|
6
|
+
category: general
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
The purpose of this command is to create or update chat customization files
|
|
10
|
+
- the agent instructions file (`.github/copilot-instructions.md` or `AGENTS.md`) to help AI coding agents understand the codebase and be immediately productive
|
|
11
|
+
- skills and custom agents to automate common tasks or enforce conventions in the codebase
|
|
12
|
+
|
|
13
|
+
The user can optionally call this command with an argument. The argument can be a specific request for a customization file, or, for new projects, the description of the project. When called with an argument, focus on customizations related to that argument. Only create or modify chat customization files. Never start working on a task in the argument.
|
|
14
|
+
|
|
15
|
+
When the command is invoked, immediately tell the user that you are now exploring the codebase and work on creating and improving the chat customization files. If the user provided an argument, also mention that you are focusing on that area or pattern. Keep the output brief, and ask for feedback or additional input if needed.
|
|
16
|
+
|
|
17
|
+
Use the related skill `agent-customization` for detailed information about the different types of customization files.
|
|
18
|
+
Explore the codebase to get a good understanding of the project and its conventions, and then create or update the relevant chat customization files to help AI coding agents be productive in this codebase.
|
|
19
|
+
|
|
20
|
+
When complete, print a table of the added or modified chat customization files, along with a short explanation why this file is useful to the AI coding agents.
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
1. **Discover existing conventions**
|
|
25
|
+
Search: `**/{.github/copilot-instructions.md,AGENT.md,AGENTS.md,CLAUDE.md,.cursorrules,.windsurfrules,.clinerules,.cursor/rules/**,.windsurf/rules/**,.clinerules/**,README.md}`
|
|
26
|
+
|
|
27
|
+
2. **Explore the codebase** via subagent, 1-3 in parallel if needed
|
|
28
|
+
Find essential knowledge that helps an AI agent be immediately productive:
|
|
29
|
+
- Build/test commands (agents run these automatically)
|
|
30
|
+
- Architecture decisions and component boundaries
|
|
31
|
+
- Project-specific conventions that differ from common practices
|
|
32
|
+
- Potential pitfalls or common development environment issues
|
|
33
|
+
- Key files/directories that exemplify patterns
|
|
34
|
+
|
|
35
|
+
Also inventory existing documentation (`docs/**/*.md`, `CONTRIBUTING.md`, `ARCHITECTURE.md`, etc.) to identify topics that should be linked, not duplicated.
|
|
36
|
+
|
|
37
|
+
3. **Generate or merge**
|
|
38
|
+
- New file: Prefer AGENTS.md over `.github/copilot-instructions.md`. If the user already has one of these files, update it instead of creating a new one.
|
|
39
|
+
- Existing file: Preserve valuable content, update outdated sections, remove duplication
|
|
40
|
+
- Follow the guidelines in the `agent-customization` skill:
|
|
41
|
+
1. **Link, don't embed** principle. Do not copy existing documentation that exists in the workspace, link to them with a Markdown link instead.
|
|
42
|
+
2. **Minimal by default**: Only what's relevant and can not be easely discovered by an agent should be included. Link to other documentation for details.
|
|
43
|
+
3. **Concise and actionable**: Every line should guide behavior
|
|
44
|
+
|
|
45
|
+
4. **Iterate**
|
|
46
|
+
- Ask for feedback on unclear or incomplete sections
|
|
47
|
+
- If the workspace is complex, suggest creating separate instructions files or skills for specific areas (e.g., frontend, backend, tests)
|
|
48
|
+
|
|
49
|
+
Once finalized, propose related agent-customizations to create next (`/create-(agent|hook|instruction|prompt|skill) …`), explaining the customization and how it would be used in practice.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: java-junit
|
|
3
|
+
description: 'Get best practices for JUnit 5 unit testing, including data-driven tests'
|
|
4
|
+
category: general
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# JUnit 5+ Best Practices
|
|
8
|
+
|
|
9
|
+
Your goal is to help me write effective unit tests with JUnit 5, covering both standard and data-driven testing approaches.
|
|
10
|
+
|
|
11
|
+
## Project Setup
|
|
12
|
+
|
|
13
|
+
- Use a standard Maven or Gradle project structure.
|
|
14
|
+
- Place test source code in `src/test/java`.
|
|
15
|
+
- Include dependencies for `junit-jupiter-api`, `junit-jupiter-engine`, and `junit-jupiter-params` for parameterized tests.
|
|
16
|
+
- Use build tool commands to run tests: `mvn test` or `gradle test`.
|
|
17
|
+
|
|
18
|
+
## Test Structure
|
|
19
|
+
|
|
20
|
+
- Test classes should have a `Test` suffix, e.g., `CalculatorTest` for a `Calculator` class.
|
|
21
|
+
- Use `@Test` for test methods.
|
|
22
|
+
- Follow the Arrange-Act-Assert (AAA) pattern.
|
|
23
|
+
- Name tests using a descriptive convention, like `methodName_should_expectedBehavior_when_scenario`.
|
|
24
|
+
- Use `@BeforeEach` and `@AfterEach` for per-test setup and teardown.
|
|
25
|
+
- Use `@BeforeAll` and `@AfterAll` for per-class setup and teardown (must be static methods).
|
|
26
|
+
- Use `@DisplayName` to provide a human-readable name for test classes and methods.
|
|
27
|
+
|
|
28
|
+
## Standard Tests
|
|
29
|
+
|
|
30
|
+
- Keep tests focused on a single behavior.
|
|
31
|
+
- Avoid testing multiple conditions in one test method.
|
|
32
|
+
- Make tests independent and idempotent (can run in any order).
|
|
33
|
+
- Avoid test interdependencies.
|
|
34
|
+
|
|
35
|
+
## Data-Driven (Parameterized) Tests
|
|
36
|
+
|
|
37
|
+
- Use `@ParameterizedTest` to mark a method as a parameterized test.
|
|
38
|
+
- Use `@ValueSource` for simple literal values (strings, ints, etc.).
|
|
39
|
+
- Use `@MethodSource` to refer to a factory method that provides test arguments as a `Stream`, `Collection`, etc.
|
|
40
|
+
- Use `@CsvSource` for inline comma-separated values.
|
|
41
|
+
- Use `@CsvFileSource` to use a CSV file from the classpath.
|
|
42
|
+
- Use `@EnumSource` to use enum constants.
|
|
43
|
+
|
|
44
|
+
## Assertions
|
|
45
|
+
|
|
46
|
+
- Use the static methods from `org.junit.jupiter.api.Assertions` (e.g., `assertEquals`, `assertTrue`, `assertNotNull`).
|
|
47
|
+
- For more fluent and readable assertions, consider using a library like AssertJ (`assertThat(...).is...`).
|
|
48
|
+
- Use `assertThrows` or `assertDoesNotThrow` to test for exceptions.
|
|
49
|
+
- Group related assertions with `assertAll` to ensure all assertions are checked before the test fails.
|
|
50
|
+
- Use descriptive messages in assertions to provide clarity on failure.
|
|
51
|
+
|
|
52
|
+
## Mocking and Isolation
|
|
53
|
+
|
|
54
|
+
- Use a mocking framework like Mockito to create mock objects for dependencies.
|
|
55
|
+
- Use `@Mock` and `@InjectMocks` annotations from Mockito to simplify mock creation and injection.
|
|
56
|
+
- Use interfaces to facilitate mocking.
|
|
57
|
+
|
|
58
|
+
## Test Organization
|
|
59
|
+
|
|
60
|
+
- Group tests by feature or component using packages.
|
|
61
|
+
- Use `@Tag` to categorize tests (e.g., `@Tag("fast")`, `@Tag("integration")`).
|
|
62
|
+
- Use `@TestMethodOrder(MethodOrderer.OrderAnnotation.class)` and `@Order` to control test execution order when strictly necessary.
|
|
63
|
+
- Use `@Disabled` to temporarily skip a test method or class, providing a reason.
|
|
64
|
+
- Use `@Nested` to group tests in a nested inner class for better organization and structure.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: java-springboot
|
|
3
|
+
description: 'Get best practices for developing applications with Spring Boot.'
|
|
4
|
+
category: general
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Spring Boot Best Practices
|
|
8
|
+
|
|
9
|
+
Your goal is to help me write high-quality Spring Boot applications by following established best practices.
|
|
10
|
+
|
|
11
|
+
## Project Setup & Structure
|
|
12
|
+
|
|
13
|
+
- **Build Tool:** Use Maven (`pom.xml`) or Gradle (`build.gradle`) for dependency management.
|
|
14
|
+
- **Starters:** Use Spring Boot starters (e.g., `spring-boot-starter-web`, `spring-boot-starter-data-jpa`) to simplify dependency management.
|
|
15
|
+
- **Package Structure:** Organize code by feature/domain (e.g., `com.example.app.order`, `com.example.app.user`) rather than by layer (e.g., `com.example.app.controller`, `com.example.app.service`).
|
|
16
|
+
|
|
17
|
+
## Dependency Injection & Components
|
|
18
|
+
|
|
19
|
+
- **Constructor Injection:** Always use constructor-based injection for required dependencies. This makes components easier to test and dependencies explicit.
|
|
20
|
+
- **Immutability:** Declare dependency fields as `private final`.
|
|
21
|
+
- **Component Stereotypes:** Use `@Component`, `@Service`, `@Repository`, and `@Controller`/`@RestController` annotations appropriately to define beans.
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
- **Externalized Configuration:** Use `application.yml` (or `application.properties`) for configuration. YAML is often preferred for its readability and hierarchical structure.
|
|
26
|
+
- **Type-Safe Properties:** Use `@ConfigurationProperties` to bind configuration to strongly-typed Java objects.
|
|
27
|
+
- **Profiles:** Use Spring Profiles (`application-dev.yml`, `application-prod.yml`) to manage environment-specific configurations.
|
|
28
|
+
- **Secrets Management:** Do not hardcode secrets. Use environment variables, or a dedicated secret management tool like HashiCorp Vault or AWS Secrets Manager.
|
|
29
|
+
|
|
30
|
+
## Web Layer (Controllers)
|
|
31
|
+
|
|
32
|
+
- **RESTful APIs:** Design clear and consistent RESTful endpoints.
|
|
33
|
+
- **DTOs (Data Transfer Objects):** Use DTOs to expose and consume data in the API layer. Do not expose JPA entities directly to the client.
|
|
34
|
+
- **Validation:** Use Java Bean Validation (JSR 380) with annotations (`@Valid`, `@NotNull`, `@Size`) on DTOs to validate request payloads.
|
|
35
|
+
- **Error Handling:** Implement a global exception handler using `@ControllerAdvice` and `@ExceptionHandler` to provide consistent error responses.
|
|
36
|
+
|
|
37
|
+
## Service Layer
|
|
38
|
+
|
|
39
|
+
- **Business Logic:** Encapsulate all business logic within `@Service` classes.
|
|
40
|
+
- **Statelessness:** Services should be stateless.
|
|
41
|
+
- **Transaction Management:** Use `@Transactional` on service methods to manage database transactions declaratively. Apply it at the most granular level necessary.
|
|
42
|
+
|
|
43
|
+
## Data Layer (Repositories)
|
|
44
|
+
|
|
45
|
+
- **Spring Data JPA:** Use Spring Data JPA repositories by extending `JpaRepository` or `CrudRepository` for standard database operations.
|
|
46
|
+
- **Custom Queries:** For complex queries, use `@Query` or the JPA Criteria API.
|
|
47
|
+
- **Projections:** Use DTO projections to fetch only the necessary data from the database.
|
|
48
|
+
|
|
49
|
+
## Logging
|
|
50
|
+
|
|
51
|
+
- **SLF4J:** Use the SLF4J API for logging.
|
|
52
|
+
- **Logger Declaration:** `private static final Logger logger = LoggerFactory.getLogger(MyClass.class);`
|
|
53
|
+
- **Parameterized Logging:** Use parameterized messages (`logger.info("Processing user {}...", userId);`) instead of string concatenation to improve performance.
|
|
54
|
+
|
|
55
|
+
## Testing
|
|
56
|
+
|
|
57
|
+
- **Unit Tests:** Write unit tests for services and components using JUnit 5 and a mocking framework like Mockito.
|
|
58
|
+
- **Integration Tests:** Use `@SpringBootTest` for integration tests that load the Spring application context.
|
|
59
|
+
- **Test Slices:** Use test slice annotations like `@WebMvcTest` (for controllers) or `@DataJpaTest` (for repositories) to test specific parts of the application in isolation.
|
|
60
|
+
- **Testcontainers:** Consider using Testcontainers for reliable integration tests with real databases, message brokers, etc.
|
|
61
|
+
|
|
62
|
+
## Security
|
|
63
|
+
|
|
64
|
+
- **Spring Security:** Use Spring Security for authentication and authorization.
|
|
65
|
+
- **Password Encoding:** Always encode passwords using a strong hashing algorithm like BCrypt.
|
|
66
|
+
- **Input Sanitization:** Prevent SQL injection by using Spring Data JPA or parameterized queries. Prevent Cross-Site Scripting (XSS) by properly encoding output.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: javascript-typescript-jest
|
|
3
|
+
description: 'Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.'
|
|
4
|
+
category: general
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### Test Structure
|
|
8
|
+
- Name test files with `.test.ts` or `.test.js` suffix
|
|
9
|
+
- Place test files next to the code they test or in a dedicated `__tests__` directory
|
|
10
|
+
- Use descriptive test names that explain the expected behavior
|
|
11
|
+
- Use nested describe blocks to organize related tests
|
|
12
|
+
- Follow the pattern: `describe('Component/Function/Class', () => { it('should do something', () => {}) })`
|
|
13
|
+
|
|
14
|
+
### Effective Mocking
|
|
15
|
+
- Mock external dependencies (APIs, databases, etc.) to isolate your tests
|
|
16
|
+
- Use `jest.mock()` for module-level mocks
|
|
17
|
+
- Use `jest.spyOn()` for specific function mocks
|
|
18
|
+
- Use `mockImplementation()` or `mockReturnValue()` to define mock behavior
|
|
19
|
+
- Reset mocks between tests with `jest.resetAllMocks()` in `afterEach`
|
|
20
|
+
|
|
21
|
+
### Testing Async Code
|
|
22
|
+
- Always return promises or use async/await syntax in tests
|
|
23
|
+
- Use `resolves`/`rejects` matchers for promises
|
|
24
|
+
- Set appropriate timeouts for slow tests with `jest.setTimeout()`
|
|
25
|
+
|
|
26
|
+
### Snapshot Testing
|
|
27
|
+
- Use snapshot tests for UI components or complex objects that change infrequently
|
|
28
|
+
- Keep snapshots small and focused
|
|
29
|
+
- Review snapshot changes carefully before committing
|
|
30
|
+
|
|
31
|
+
### Testing React Components
|
|
32
|
+
- Use React Testing Library over Enzyme for testing components
|
|
33
|
+
- Test user behavior and component accessibility
|
|
34
|
+
- Query elements by accessibility roles, labels, or text content
|
|
35
|
+
- Use `userEvent` over `fireEvent` for more realistic user interactions
|
|
36
|
+
|
|
37
|
+
## Common Jest Matchers
|
|
38
|
+
- Basic: `expect(value).toBe(expected)`, `expect(value).toEqual(expected)`
|
|
39
|
+
- Truthiness: `expect(value).toBeTruthy()`, `expect(value).toBeFalsy()`
|
|
40
|
+
- Numbers: `expect(value).toBeGreaterThan(3)`, `expect(value).toBeLessThanOrEqual(3)`
|
|
41
|
+
- Strings: `expect(value).toMatch(/pattern/)`, `expect(value).toContain('substring')`
|
|
42
|
+
- Arrays: `expect(array).toContain(item)`, `expect(array).toHaveLength(3)`
|
|
43
|
+
- Objects: `expect(object).toHaveProperty('key', value)`
|
|
44
|
+
- Exceptions: `expect(fn).toThrow()`, `expect(fn).toThrow(Error)`
|
|
45
|
+
- Mock functions: `expect(mockFn).toHaveBeenCalled()`, `expect(mockFn).toHaveBeenCalledWith(arg1, arg2)`
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kotlin-springboot
|
|
3
|
+
description: 'Get best practices for developing applications with Spring Boot and Kotlin.'
|
|
4
|
+
category: general
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Spring Boot with Kotlin Best Practices
|
|
8
|
+
|
|
9
|
+
Your goal is to help me write high-quality, idiomatic Spring Boot applications using Kotlin.
|
|
10
|
+
|
|
11
|
+
## Project Setup & Structure
|
|
12
|
+
|
|
13
|
+
- **Build Tool:** Use Maven (`pom.xml`) or Gradle (`build.gradle`) with the Kotlin plugins (`kotlin-maven-plugin` or `org.jetbrains.kotlin.jvm`).
|
|
14
|
+
- **Kotlin Plugins:** For JPA, enable the `kotlin-jpa` plugin to automatically make entity classes `open` without boilerplate.
|
|
15
|
+
- **Starters:** Use Spring Boot starters (e.g., `spring-boot-starter-web`, `spring-boot-starter-data-jpa`) as usual.
|
|
16
|
+
- **Package Structure:** Organize code by feature/domain (e.g., `com.example.app.order`, `com.example.app.user`) rather than by layer.
|
|
17
|
+
|
|
18
|
+
## Dependency Injection & Components
|
|
19
|
+
|
|
20
|
+
- **Primary Constructors:** Always use the primary constructor for required dependency injection. It's the most idiomatic and concise approach in Kotlin.
|
|
21
|
+
- **Immutability:** Declare dependencies as `private val` in the primary constructor. Prefer `val` over `var` everywhere to promote immutability.
|
|
22
|
+
- **Component Stereotypes:** Use `@Service`, `@Repository`, and `@RestController` annotations just as you would in Java.
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
- **Externalized Configuration:** Use `application.yml` for its readability and hierarchical structure.
|
|
27
|
+
- **Type-Safe Properties:** Use `@ConfigurationProperties` with `data class` to create immutable, type-safe configuration objects.
|
|
28
|
+
- **Profiles:** Use Spring Profiles (`application-dev.yml`, `application-prod.yml`) to manage environment-specific configurations.
|
|
29
|
+
- **Secrets Management:** Never hardcode secrets. Use environment variables or a dedicated secret management tool like HashiCorp Vault or AWS Secrets Manager.
|
|
30
|
+
|
|
31
|
+
## Web Layer (Controllers)
|
|
32
|
+
|
|
33
|
+
- **RESTful APIs:** Design clear and consistent RESTful endpoints.
|
|
34
|
+
- **Data Classes for DTOs:** Use Kotlin `data class` for all DTOs. This provides `equals()`, `hashCode()`, `toString()`, and `copy()` for free and promotes immutability.
|
|
35
|
+
- **Validation:** Use Java Bean Validation (JSR 380) with annotations (`@Valid`, `@NotNull`, `@Size`) on your DTO data classes.
|
|
36
|
+
- **Error Handling:** Implement a global exception handler using `@ControllerAdvice` and `@ExceptionHandler` for consistent error responses.
|
|
37
|
+
|
|
38
|
+
## Service Layer
|
|
39
|
+
|
|
40
|
+
- **Business Logic:** Encapsulate business logic within `@Service` classes.
|
|
41
|
+
- **Statelessness:** Services should be stateless.
|
|
42
|
+
- **Transaction Management:** Use `@Transactional` on service methods. In Kotlin, this can be applied to class or function level.
|
|
43
|
+
|
|
44
|
+
## Data Layer (Repositories)
|
|
45
|
+
|
|
46
|
+
- **JPA Entities:** Define entities as classes. Remember they must be `open`. It's highly recommended to use the `kotlin-jpa` compiler plugin to handle this automatically.
|
|
47
|
+
- **Null Safety:** Leverage Kotlin's null-safety (`?`) to clearly define which entity fields are optional or required at the type level.
|
|
48
|
+
- **Spring Data JPA:** Use Spring Data JPA repositories by extending `JpaRepository` or `CrudRepository`.
|
|
49
|
+
- **Coroutines:** For reactive applications, leverage Spring Boot's support for Kotlin Coroutines in the data layer.
|
|
50
|
+
|
|
51
|
+
## Logging
|
|
52
|
+
|
|
53
|
+
- **Companion Object Logger:** The idiomatic way to declare a logger is in a companion object.
|
|
54
|
+
```kotlin
|
|
55
|
+
companion object {
|
|
56
|
+
private val logger = LoggerFactory.getLogger(MyClass::class.java)
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
- **Parameterized Logging:** Use parameterized messages (`logger.info("Processing user {}...", userId)`) for performance and clarity.
|
|
60
|
+
|
|
61
|
+
## Testing
|
|
62
|
+
|
|
63
|
+
- **JUnit 5:** JUnit 5 is the default and works seamlessly with Kotlin.
|
|
64
|
+
- **Idiomatic Testing Libraries:** For more fluent and idiomatic tests, consider using **Kotest** for assertions and **MockK** for mocking. They are designed for Kotlin and offer a more expressive syntax.
|
|
65
|
+
- **Test Slices:** Use test slice annotations like `@WebMvcTest` or `@DataJpaTest` to test specific parts of the application.
|
|
66
|
+
- **Testcontainers:** Use Testcontainers for reliable integration tests with real databases, message brokers, etc.
|
|
67
|
+
|
|
68
|
+
## Coroutines & Asynchronous Programming
|
|
69
|
+
|
|
70
|
+
- **`suspend` functions:** For non-blocking asynchronous code, use `suspend` functions in your controllers and services. Spring Boot has excellent support for coroutines.
|
|
71
|
+
- **Structured Concurrency:** Use `coroutineScope` or `supervisorScope` to manage the lifecycle of coroutines.
|