@ngxtm/devkit 3.7.0 → 3.9.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/cli/init.js +23 -7
- package/cli/update.js +21 -6
- package/merged-commands/3d-web-experience.md +254 -0
- package/merged-commands/ab-test-setup.md +232 -0
- package/merged-commands/accessibility-compliance-accessibility-audit.md +42 -0
- package/merged-commands/active-directory-attacks.md +383 -0
- package/merged-commands/address-github-comments.md +55 -0
- package/merged-commands/aesthetic.md +134 -0
- package/merged-commands/agent-evaluation.md +64 -0
- package/merged-commands/agent-framework-azure-hosted-agents.md +332 -0
- package/merged-commands/agent-manager-skill.md +40 -0
- package/merged-commands/agent-memory-mcp.md +82 -0
- package/merged-commands/agent-memory-systems.md +67 -0
- package/merged-commands/agent-orchestration-improve-agent.md +349 -0
- package/merged-commands/agent-orchestration-multi-agent-optimize.md +239 -0
- package/merged-commands/agent-tool-builder.md +53 -0
- package/merged-commands/agile-product-owner.md +31 -0
- package/merged-commands/ai-agents-architect.md +90 -0
- package/merged-commands/ai-artist.md +75 -0
- package/merged-commands/ai-engineer.md +171 -0
- package/merged-commands/ai-multimodal.md +109 -0
- package/merged-commands/ai-product.md +54 -0
- package/merged-commands/ai-wrapper-product.md +273 -0
- package/merged-commands/airflow-dag-patterns.md +41 -0
- package/merged-commands/algolia-search.md +66 -0
- package/merged-commands/algorithmic-art.md +405 -0
- package/merged-commands/analytics-tracking.md +404 -0
- package/merged-commands/angular-architect.md +97 -0
- package/merged-commands/angular-migration.md +428 -0
- package/merged-commands/anti-reversing-techniques.md +42 -0
- package/merged-commands/api-design-principles.md +37 -0
- package/merged-commands/api-designer.md +101 -0
- package/merged-commands/api-documentation-generator.md +484 -0
- package/merged-commands/api-documenter.md +184 -0
- package/merged-commands/api-fuzzing-bug-bounty.md +433 -0
- package/merged-commands/api-patterns.md +81 -0
- package/merged-commands/api-security-best-practices.md +907 -0
- package/merged-commands/api-testing-observability-api-mock.md +46 -0
- package/merged-commands/app-builder.md +75 -0
- package/merged-commands/app-store-optimization.md +403 -0
- package/merged-commands/application-performance-performance-optimization.md +154 -0
- package/merged-commands/architect-review.md +174 -0
- package/merged-commands/architecture-decision-records.md +441 -0
- package/merged-commands/architecture-designer.md +89 -0
- package/merged-commands/architecture-patterns.md +37 -0
- package/merged-commands/architecture.md +55 -0
- package/merged-commands/arm-cortex-expert.md +306 -0
- package/merged-commands/artifacts-builder.md +74 -0
- package/merged-commands/ask-questions-if-underspecified.md +81 -0
- package/merged-commands/async-python-patterns.md +39 -0
- package/merged-commands/atlassian-mcp.md +100 -0
- package/merged-commands/attack-tree-construction.md +38 -0
- package/merged-commands/auth-implementation-patterns.md +39 -0
- package/merged-commands/automate-whatsapp.md +257 -0
- package/merged-commands/autonomous-agent-patterns.md +761 -0
- package/merged-commands/autonomous-agents.md +68 -0
- package/merged-commands/avalonia-layout-zafiro.md +59 -0
- package/merged-commands/avalonia-viewmodels-zafiro.md +29 -0
- package/merged-commands/avalonia-zafiro-development.md +29 -0
- package/merged-commands/aws-agentic-ai.md +117 -0
- package/merged-commands/aws-cdk-development.md +278 -0
- package/merged-commands/aws-cost-operations.md +317 -0
- package/merged-commands/aws-penetration-testing.md +405 -0
- package/merged-commands/aws-serverless-eda.md +757 -0
- package/merged-commands/aws-serverless.md +323 -0
- package/merged-commands/aws-skills.md +22 -0
- package/merged-commands/azd-deployment.md +296 -0
- package/merged-commands/azure-ai-agents-python.md +277 -0
- package/merged-commands/azure-ai-search-python.md +198 -0
- package/merged-commands/azure-ai-voicelive-skill.md +294 -0
- package/merged-commands/azure-functions.md +42 -0
- package/merged-commands/backend-architect.md +333 -0
- package/merged-commands/backend-dev-guidelines.md +342 -0
- package/merged-commands/backend-development-feature-development.md +180 -0
- package/merged-commands/backend-development.md +155 -0
- package/merged-commands/backend-security-coder.md +156 -0
- package/merged-commands/backtesting-frameworks.md +39 -0
- package/merged-commands/bash-defensive-patterns.md +43 -0
- package/merged-commands/bash-linux.md +199 -0
- package/merged-commands/bash-pro.md +310 -0
- package/merged-commands/bats-testing-patterns.md +34 -0
- package/merged-commands/bazel-build-optimization.md +397 -0
- package/merged-commands/beautiful-prose.md +22 -0
- package/merged-commands/behavioral-modes.md +242 -0
- package/merged-commands/best-practices.md +500 -0
- package/merged-commands/better-auth.md +204 -0
- package/merged-commands/billing-automation.md +42 -0
- package/merged-commands/binary-analysis-patterns.md +450 -0
- package/merged-commands/blockchain-developer.md +208 -0
- package/merged-commands/blockrun.md +292 -0
- package/merged-commands/brainstorming.md +230 -0
- package/merged-commands/brand-guidelines-anthropic.md +73 -0
- package/merged-commands/brand-guidelines-community.md +73 -0
- package/merged-commands/brand-guidelines.md +73 -0
- package/merged-commands/broken-authentication.md +476 -0
- package/merged-commands/browser-automation.md +70 -0
- package/merged-commands/browser-extension-builder.md +261 -0
- package/merged-commands/building-ai-agent-on-cloudflare.md +391 -0
- package/merged-commands/building-mcp-server-on-cloudflare.md +265 -0
- package/merged-commands/bullmq-specialist.md +57 -0
- package/merged-commands/bun-development.md +691 -0
- package/merged-commands/burp-suite-testing.md +380 -0
- package/merged-commands/business-analyst.md +182 -0
- package/merged-commands/busybox-on-windows.md +30 -0
- package/merged-commands/c-pro.md +56 -0
- package/merged-commands/c4-architecture-c4-architecture.md +389 -0
- package/merged-commands/c4-code.md +244 -0
- package/merged-commands/c4-component.md +153 -0
- package/merged-commands/c4-container.md +171 -0
- package/merged-commands/c4-context.md +150 -0
- package/merged-commands/canvas-design.md +130 -0
- package/merged-commands/cc-skill-backend-patterns.md +584 -0
- package/merged-commands/cc-skill-clickhouse-io.md +431 -0
- package/merged-commands/cc-skill-coding-standards.md +522 -0
- package/merged-commands/cc-skill-continuous-learning.md +10 -0
- package/merged-commands/cc-skill-frontend-patterns.md +633 -0
- package/merged-commands/cc-skill-project-guidelines-example.md +352 -0
- package/merged-commands/cc-skill-security-review.md +496 -0
- package/merged-commands/cc-skill-strategic-compact.md +10 -0
- package/merged-commands/changelog-automation.md +38 -0
- package/merged-commands/changelog-generator.md +104 -0
- package/merged-commands/chaos-engineer.md +98 -0
- package/merged-commands/chrome-devtools.md +407 -0
- package/merged-commands/cicd-automation-workflow-automate.md +51 -0
- package/merged-commands/clarity-gate.md +22 -0
- package/merged-commands/claude-ally-health.md +22 -0
- package/merged-commands/claude-code-guide.md +68 -0
- package/merged-commands/claude-d3js-skill.md +820 -0
- package/merged-commands/claude-scientific-skills.md +22 -0
- package/merged-commands/claude-speed-reader.md +22 -0
- package/merged-commands/claude-win11-speckit-update-skill.md +22 -0
- package/merged-commands/clean-code.md +201 -0
- package/merged-commands/clerk-auth.md +56 -0
- package/merged-commands/cli-developer.md +97 -0
- package/merged-commands/cloud-architect.md +135 -0
- package/merged-commands/cloud-penetration-testing.md +501 -0
- package/merged-commands/cloudflare-expert.md +227 -0
- package/merged-commands/code-documentation-code-explain.md +46 -0
- package/merged-commands/code-documentation-doc-generate.md +48 -0
- package/merged-commands/code-documentation.md +263 -0
- package/merged-commands/code-documenter.md +95 -0
- package/merged-commands/code-refactoring-context-restore.md +179 -0
- package/merged-commands/code-refactoring-refactor-clean.md +51 -0
- package/merged-commands/code-refactoring-tech-debt.md +386 -0
- package/merged-commands/code-refactoring.md +209 -0
- package/merged-commands/code-review-ai-ai-review.md +450 -0
- package/merged-commands/code-review-checklist.md +444 -0
- package/merged-commands/code-review-excellence.md +40 -0
- package/merged-commands/code-review.md +121 -0
- package/merged-commands/code-reviewer.md +178 -0
- package/merged-commands/codebase-cleanup-deps-audit.md +51 -0
- package/merged-commands/codebase-cleanup-refactor-clean.md +51 -0
- package/merged-commands/codebase-cleanup-tech-debt.md +386 -0
- package/merged-commands/codex-review.md +37 -0
- package/merged-commands/commit.md +171 -0
- package/merged-commands/competitive-ads-extractor.md +293 -0
- package/merged-commands/competitive-landscape.md +34 -0
- package/merged-commands/competitor-alternatives.md +750 -0
- package/merged-commands/comprehensive-review-full-review.md +146 -0
- package/merged-commands/comprehensive-review-pr-enhance.md +46 -0
- package/merged-commands/computer-use-agents.md +315 -0
- package/merged-commands/concise-planning.md +62 -0
- package/merged-commands/conductor-implement.md +388 -0
- package/merged-commands/conductor-manage.md +39 -0
- package/merged-commands/conductor-new-track.md +433 -0
- package/merged-commands/conductor-revert.md +372 -0
- package/merged-commands/conductor-setup.md +426 -0
- package/merged-commands/conductor-status.md +338 -0
- package/merged-commands/conductor-validator.md +62 -0
- package/merged-commands/content-creator.md +248 -0
- package/merged-commands/content-marketer.md +170 -0
- package/merged-commands/content-research-writer.md +538 -0
- package/merged-commands/context-compression.md +266 -0
- package/merged-commands/context-degradation.md +238 -0
- package/merged-commands/context-driven-development.md +400 -0
- package/merged-commands/context-engineering.md +107 -0
- package/merged-commands/context-fundamentals.md +192 -0
- package/merged-commands/context-management-context-restore.md +179 -0
- package/merged-commands/context-management-context-save.md +177 -0
- package/merged-commands/context-manager.md +185 -0
- package/merged-commands/context-optimization.md +186 -0
- package/merged-commands/context-window-management.md +53 -0
- package/merged-commands/context7-auto-research.md +36 -0
- package/merged-commands/conversation-memory.md +61 -0
- package/merged-commands/copy-editing.md +439 -0
- package/merged-commands/copywriting.md +225 -0
- package/merged-commands/core-components.md +264 -0
- package/merged-commands/cosmos-db-python-skill.md +198 -0
- package/merged-commands/cost-optimization.md +286 -0
- package/merged-commands/cpp-pro.md +59 -0
- package/merged-commands/cqrs-implementation.md +35 -0
- package/merged-commands/create-pr.md +192 -0
- package/merged-commands/crewai.md +243 -0
- package/merged-commands/csharp-developer.md +94 -0
- package/merged-commands/csharp-pro.md +59 -0
- package/merged-commands/culture-index.md +43 -0
- package/merged-commands/customer-support.md +170 -0
- package/merged-commands/daily-news-report.md +356 -0
- package/merged-commands/data-engineer.md +224 -0
- package/merged-commands/data-engineering-data-driven-feature.md +182 -0
- package/merged-commands/data-engineering-data-pipeline.md +201 -0
- package/merged-commands/data-quality-frameworks.md +40 -0
- package/merged-commands/data-scientist.md +199 -0
- package/merged-commands/data-storytelling.md +465 -0
- package/merged-commands/database-admin.md +165 -0
- package/merged-commands/database-architect.md +268 -0
- package/merged-commands/database-cloud-optimization-cost-optimize.md +44 -0
- package/merged-commands/database-design.md +52 -0
- package/merged-commands/database-migration.md +436 -0
- package/merged-commands/database-migrations-migration-observability.md +420 -0
- package/merged-commands/database-migrations-sql-migrations.md +53 -0
- package/merged-commands/database-optimizer.md +167 -0
- package/merged-commands/databases.md +232 -0
- package/merged-commands/dbt-transformation-patterns.md +34 -0
- package/merged-commands/debugger.md +49 -0
- package/merged-commands/debugging-strategies.md +34 -0
- package/merged-commands/debugging-toolkit-smart-debug.md +197 -0
- package/merged-commands/debugging-wizard.md +93 -0
- package/merged-commands/debugging.md +84 -0
- package/merged-commands/deep-research.md +114 -0
- package/merged-commands/defi-protocol-templates.md +466 -0
- package/merged-commands/dependency-management-deps-audit.md +44 -0
- package/merged-commands/dependency-upgrade.md +421 -0
- package/merged-commands/deployment-engineer.md +170 -0
- package/merged-commands/deployment-pipeline-design.md +371 -0
- package/merged-commands/deployment-procedures.md +241 -0
- package/merged-commands/deployment-validation-config-validate.md +496 -0
- package/merged-commands/design-md.md +178 -0
- package/merged-commands/design-orchestration.md +167 -0
- package/merged-commands/developer-growth-analysis.md +322 -0
- package/merged-commands/devops-engineer.md +92 -0
- package/merged-commands/devops-troubleshooter.md +161 -0
- package/merged-commands/devops.md +285 -0
- package/merged-commands/discord-bot-architect.md +277 -0
- package/merged-commands/dispatching-parallel-agents.md +180 -0
- package/merged-commands/distributed-debugging-debug-trace.md +44 -0
- package/merged-commands/distributed-tracing.md +450 -0
- package/merged-commands/django-expert.md +89 -0
- package/merged-commands/django-pro.md +180 -0
- package/merged-commands/doc-coauthoring.md +375 -0
- package/merged-commands/docker-expert.md +409 -0
- package/merged-commands/docs-architect.md +98 -0
- package/merged-commands/docs-seeker.md +102 -0
- package/merged-commands/documentation-generation-doc-generate.md +48 -0
- package/merged-commands/documentation-templates.md +194 -0
- package/merged-commands/docx-official.md +197 -0
- package/merged-commands/docx.md +197 -0
- package/merged-commands/domain-name-brainstormer.md +212 -0
- package/merged-commands/dotnet-architect.md +197 -0
- package/merged-commands/dotnet-backend-patterns.md +37 -0
- package/merged-commands/dotnet-core-expert.md +96 -0
- package/merged-commands/dx-optimizer.md +83 -0
- package/merged-commands/e2e-testing-patterns.md +41 -0
- package/merged-commands/elixir-pro.md +59 -0
- package/merged-commands/email-sequence.md +925 -0
- package/merged-commands/email-systems.md +54 -0
- package/merged-commands/embedded-systems.md +98 -0
- package/merged-commands/embedding-strategies.md +491 -0
- package/merged-commands/employment-contract-templates.md +39 -0
- package/merged-commands/environment-setup-guide.md +479 -0
- package/merged-commands/error-debugging-error-analysis.md +47 -0
- package/merged-commands/error-debugging-error-trace.md +43 -0
- package/merged-commands/error-debugging-multi-agent-review.md +216 -0
- package/merged-commands/error-detective.md +53 -0
- package/merged-commands/error-diagnostics-error-analysis.md +47 -0
- package/merged-commands/error-diagnostics-error-trace.md +48 -0
- package/merged-commands/error-diagnostics-smart-debug.md +197 -0
- package/merged-commands/error-handling-patterns.md +35 -0
- package/merged-commands/ethical-hacking-methodology.md +466 -0
- package/merged-commands/evaluation.md +238 -0
- package/merged-commands/event-sourcing-architect.md +58 -0
- package/merged-commands/event-store-design.md +449 -0
- package/merged-commands/exa-search.md +36 -0
- package/merged-commands/executing-plans.md +76 -0
- package/merged-commands/expo-app-design.md +22 -0
- package/merged-commands/expo-deployment.md +72 -0
- package/merged-commands/fal-audio.md +22 -0
- package/merged-commands/fal-generate.md +22 -0
- package/merged-commands/fal-image-edit.md +22 -0
- package/merged-commands/fal-platform.md +22 -0
- package/merged-commands/fal-upscale.md +22 -0
- package/merged-commands/fal-workflow.md +22 -0
- package/merged-commands/fastapi-expert.md +93 -0
- package/merged-commands/fastapi-pro.md +192 -0
- package/merged-commands/fastapi-router.md +52 -0
- package/merged-commands/fastapi-templates.md +32 -0
- package/merged-commands/feature-forge.md +90 -0
- package/merged-commands/ffuf-claude-skill.md +22 -0
- package/merged-commands/file-organizer.md +250 -0
- package/merged-commands/file-path-traversal.md +486 -0
- package/merged-commands/file-uploads.md +22 -0
- package/merged-commands/find-bugs.md +86 -0
- package/merged-commands/fine-tuning-expert.md +98 -0
- package/merged-commands/finishing-a-development-branch.md +200 -0
- package/merged-commands/firebase.md +56 -0
- package/merged-commands/firecrawl-scraper.md +37 -0
- package/merged-commands/firmware-analyst.md +320 -0
- package/merged-commands/fix-review.md +53 -0
- package/merged-commands/fixing.md +72 -0
- package/merged-commands/flutter-expert.md +200 -0
- package/merged-commands/form-cro.md +441 -0
- package/merged-commands/foundry-iq-agent.md +15 -0
- package/merged-commands/foundry-iq-python.md +275 -0
- package/merged-commands/foundry-nextgen-frontend.md +555 -0
- package/merged-commands/foundry-sdk-python.md +290 -0
- package/merged-commands/fp-ts-errors.md +856 -0
- package/merged-commands/fp-ts-pragmatic.md +598 -0
- package/merged-commands/fp-ts-react.md +796 -0
- package/merged-commands/framework-migration-code-migrate.md +48 -0
- package/merged-commands/framework-migration-deps-upgrade.md +48 -0
- package/merged-commands/framework-migration-legacy-modernize.md +132 -0
- package/merged-commands/free-tool-strategy.md +576 -0
- package/merged-commands/frontend-design.md +272 -0
- package/merged-commands/frontend-dev-guidelines.md +359 -0
- package/merged-commands/frontend-developer.md +171 -0
- package/merged-commands/frontend-development.md +399 -0
- package/merged-commands/frontend-mobile-development-component-scaffold.md +403 -0
- package/merged-commands/frontend-mobile-security-xss-scan.md +322 -0
- package/merged-commands/frontend-security-coder.md +170 -0
- package/merged-commands/frontend-slides.md +770 -0
- package/merged-commands/full-stack-orchestration-full-stack-feature.md +135 -0
- package/merged-commands/fullstack-guardian.md +99 -0
- package/merged-commands/game-developer.md +94 -0
- package/merged-commands/game-development.md +167 -0
- package/merged-commands/gcp-cloud-run.md +288 -0
- package/merged-commands/gdpr-data-handling.md +33 -0
- package/merged-commands/geo-fundamentals.md +156 -0
- package/merged-commands/git-advanced-workflows.md +412 -0
- package/merged-commands/git-pr-workflows-git-workflow.md +140 -0
- package/merged-commands/git-pr-workflows-onboard.md +416 -0
- package/merged-commands/git-pr-workflows-pr-enhance.md +48 -0
- package/merged-commands/git-pushing.md +33 -0
- package/merged-commands/github-actions-templates.md +345 -0
- package/merged-commands/github-workflow-automation.md +846 -0
- package/merged-commands/gitlab-ci-patterns.md +283 -0
- package/merged-commands/gitops-workflow.md +303 -0
- package/merged-commands/go-concurrency-patterns.md +33 -0
- package/merged-commands/godot-gdscript-patterns.md +33 -0
- package/merged-commands/golang-pro.md +179 -0
- package/merged-commands/google-adk-python.md +243 -0
- package/merged-commands/grafana-dashboards.md +381 -0
- package/merged-commands/graphql-architect.md +182 -0
- package/merged-commands/graphql.md +68 -0
- package/merged-commands/haskell-pro.md +56 -0
- package/merged-commands/helm-chart-scaffolding.md +34 -0
- package/merged-commands/hr-pro.md +126 -0
- package/merged-commands/html-injection-testing.md +498 -0
- package/merged-commands/hubspot-integration.md +42 -0
- package/merged-commands/hugging-face-cli.md +198 -0
- package/merged-commands/hugging-face-jobs.md +1038 -0
- package/merged-commands/hybrid-cloud-architect.md +168 -0
- package/merged-commands/hybrid-cloud-networking.md +238 -0
- package/merged-commands/hybrid-search-implementation.md +32 -0
- package/merged-commands/i18n-localization.md +154 -0
- package/merged-commands/idor-testing.md +442 -0
- package/merged-commands/image-enhancer.md +99 -0
- package/merged-commands/imagen.md +77 -0
- package/merged-commands/incident-responder.md +213 -0
- package/merged-commands/incident-response-incident-response.md +168 -0
- package/merged-commands/incident-response-smart-fix.md +29 -0
- package/merged-commands/incident-runbook-templates.md +395 -0
- package/merged-commands/infinite-gratitude.md +26 -0
- package/merged-commands/inngest.md +55 -0
- package/merged-commands/interactive-portfolio.md +223 -0
- package/merged-commands/internal-comms-anthropic.md +32 -0
- package/merged-commands/internal-comms-community.md +32 -0
- package/merged-commands/internal-comms.md +32 -0
- package/merged-commands/invoice-organizer.md +446 -0
- package/merged-commands/ios-developer.md +219 -0
- package/merged-commands/issue-creator.md +137 -0
- package/merged-commands/istio-traffic-management.md +337 -0
- package/merged-commands/iterate-pr.md +150 -0
- package/merged-commands/java-architect.md +95 -0
- package/merged-commands/java-pro.md +177 -0
- package/merged-commands/javascript-mastery.md +645 -0
- package/merged-commands/javascript-pro.md +57 -0
- package/merged-commands/javascript-testing-patterns.md +35 -0
- package/merged-commands/javascript-typescript-typescript-scaffold.md +361 -0
- package/merged-commands/javascript-typescript.md +142 -0
- package/merged-commands/jira-issues.md +181 -0
- package/merged-commands/job-application.md +90 -0
- package/merged-commands/julia-pro.md +209 -0
- package/merged-commands/k8s-manifest-generator.md +35 -0
- package/merged-commands/k8s-security-policies.md +346 -0
- package/merged-commands/kaizen.md +730 -0
- package/merged-commands/kotlin-specialist.md +94 -0
- package/merged-commands/kpi-dashboard-design.md +440 -0
- package/merged-commands/kubernetes-architect.md +170 -0
- package/merged-commands/kubernetes-specialist.md +117 -0
- package/merged-commands/langchain-architecture.md +350 -0
- package/merged-commands/langfuse.md +238 -0
- package/merged-commands/langgraph.md +287 -0
- package/merged-commands/laravel-specialist.md +101 -0
- package/merged-commands/last30days.md +421 -0
- package/merged-commands/launch-strategy.md +344 -0
- package/merged-commands/lead-research-assistant.md +199 -0
- package/merged-commands/learn.md +476 -0
- package/merged-commands/legacy-modernizer.md +53 -0
- package/merged-commands/legal-advisor.md +70 -0
- package/merged-commands/linear-claude-skill.md +543 -0
- package/merged-commands/linkerd-patterns.md +321 -0
- package/merged-commands/lint-and-validate.md +45 -0
- package/merged-commands/linux-privilege-escalation.md +504 -0
- package/merged-commands/linux-shell-scripting.md +504 -0
- package/merged-commands/llm-app-patterns.md +760 -0
- package/merged-commands/llm-application-dev-ai-assistant.md +35 -0
- package/merged-commands/llm-application-dev-langchain-agent.md +246 -0
- package/merged-commands/llm-application-dev-prompt-optimize.md +37 -0
- package/merged-commands/llm-application-dev.md +216 -0
- package/merged-commands/llm-evaluation.md +483 -0
- package/merged-commands/loki-mode.md +721 -0
- package/merged-commands/machine-learning-ops-ml-pipeline.md +314 -0
- package/merged-commands/makepad-skills.md +22 -0
- package/merged-commands/malware-analyst.md +247 -0
- package/merged-commands/markdown-novel-viewer.md +281 -0
- package/merged-commands/market-sizing-analysis.md +425 -0
- package/merged-commands/marketing-ideas.md +221 -0
- package/merged-commands/marketing-psychology.md +255 -0
- package/merged-commands/mcp-builder.md +236 -0
- package/merged-commands/mcp-developer.md +94 -0
- package/merged-commands/mcp-management.md +209 -0
- package/merged-commands/media-processing.md +358 -0
- package/merged-commands/meeting-insights-analyzer.md +327 -0
- package/merged-commands/memory-forensics.md +491 -0
- package/merged-commands/memory-safety-patterns.md +33 -0
- package/merged-commands/memory-systems.md +228 -0
- package/merged-commands/mermaid-expert.md +59 -0
- package/merged-commands/mermaidjs-v11.md +115 -0
- package/merged-commands/metasploit-framework.md +478 -0
- package/merged-commands/micro-saas-launcher.md +212 -0
- package/merged-commands/microservices-architect.md +102 -0
- package/merged-commands/microservices-patterns.md +35 -0
- package/merged-commands/minecraft-bukkit-pro.md +126 -0
- package/merged-commands/ml-engineer.md +168 -0
- package/merged-commands/ml-pipeline-workflow.md +257 -0
- package/merged-commands/ml-pipeline.md +111 -0
- package/merged-commands/mlops-engineer.md +219 -0
- package/merged-commands/mobile-design.md +284 -0
- package/merged-commands/mobile-developer.md +205 -0
- package/merged-commands/mobile-development.md +212 -0
- package/merged-commands/mobile-security-coder.md +184 -0
- package/merged-commands/modern-javascript-patterns.md +35 -0
- package/merged-commands/monitoring-expert.md +92 -0
- package/merged-commands/monorepo-architect.md +61 -0
- package/merged-commands/monorepo-management.md +35 -0
- package/merged-commands/moodle-external-api-development.md +597 -0
- package/merged-commands/mtls-configuration.md +359 -0
- package/merged-commands/multi-agent-brainstorming.md +256 -0
- package/merged-commands/multi-agent-patterns.md +262 -0
- package/merged-commands/multi-cloud-architecture.md +189 -0
- package/merged-commands/multi-platform-apps-multi-platform.md +203 -0
- package/merged-commands/n8n-code-python.md +750 -0
- package/merged-commands/n8n-mcp-tools-expert.md +654 -0
- package/merged-commands/n8n-node-configuration.md +796 -0
- package/merged-commands/nanobanana-ppt-skills.md +22 -0
- package/merged-commands/neon-postgres.md +56 -0
- package/merged-commands/nestjs-expert.md +552 -0
- package/merged-commands/network-101.md +342 -0
- package/merged-commands/network-engineer.md +169 -0
- package/merged-commands/nextjs-app-router-patterns.md +33 -0
- package/merged-commands/nextjs-best-practices.md +203 -0
- package/merged-commands/nextjs-developer.md +97 -0
- package/merged-commands/nextjs-supabase-auth.md +56 -0
- package/merged-commands/nft-standards.md +395 -0
- package/merged-commands/nodejs-backend-patterns.md +35 -0
- package/merged-commands/nodejs-best-practices.md +333 -0
- package/merged-commands/nosql-expert.md +111 -0
- package/merged-commands/notebooklm-skill.md +269 -0
- package/merged-commands/notebooklm.md +269 -0
- package/merged-commands/notion-template-business.md +216 -0
- package/merged-commands/nx-workspace-patterns.md +464 -0
- package/merged-commands/observability-engineer.md +237 -0
- package/merged-commands/observability-monitoring-monitor-setup.md +48 -0
- package/merged-commands/observability-monitoring-slo-implement.md +43 -0
- package/merged-commands/observe-whatsapp.md +109 -0
- package/merged-commands/obsidian-clipper-template-creator.md +64 -0
- package/merged-commands/on-call-handoff-patterns.md +453 -0
- package/merged-commands/onboarding-cro.md +433 -0
- package/merged-commands/openapi-spec-generation.md +33 -0
- package/merged-commands/page-cro.md +343 -0
- package/merged-commands/paid-ads.md +551 -0
- package/merged-commands/pandas-pro.md +96 -0
- package/merged-commands/parallel-agents.md +175 -0
- package/merged-commands/payment-integration.md +77 -0
- package/merged-commands/paypal-integration.md +479 -0
- package/merged-commands/paywall-upgrade-cro.md +570 -0
- package/merged-commands/pci-compliance.md +478 -0
- package/merged-commands/pdf-official.md +294 -0
- package/merged-commands/pdf.md +294 -0
- package/merged-commands/pentest-checklist.md +334 -0
- package/merged-commands/pentest-commands.md +438 -0
- package/merged-commands/performance-engineer.md +180 -0
- package/merged-commands/performance-profiling.md +143 -0
- package/merged-commands/performance-testing-review-ai-review.md +450 -0
- package/merged-commands/performance-testing-review-multi-agent-review.md +216 -0
- package/merged-commands/personal-tool-builder.md +289 -0
- package/merged-commands/php-pro.md +63 -0
- package/merged-commands/plaid-fintech.md +50 -0
- package/merged-commands/plan-writing.md +152 -0
- package/merged-commands/planning-with-files.md +211 -0
- package/merged-commands/planning.md +95 -0
- package/merged-commands/plans-kanban.md +166 -0
- package/merged-commands/playwright-expert.md +87 -0
- package/merged-commands/playwright-skill.md +453 -0
- package/merged-commands/podcast-generation.md +121 -0
- package/merged-commands/popup-cro.md +346 -0
- package/merged-commands/posix-shell-pro.md +304 -0
- package/merged-commands/postgres-best-practices.md +57 -0
- package/merged-commands/postgres-pro.md +98 -0
- package/merged-commands/postgresql.md +230 -0
- package/merged-commands/postmortem-writing.md +386 -0
- package/merged-commands/powershell-windows.md +167 -0
- package/merged-commands/pptx-official.md +484 -0
- package/merged-commands/pptx.md +484 -0
- package/merged-commands/pricing-strategy.md +356 -0
- package/merged-commands/prisma-expert.md +355 -0
- package/merged-commands/privilege-escalation-methods.md +333 -0
- package/merged-commands/problem-solving.md +96 -0
- package/merged-commands/product-manager-toolkit.md +351 -0
- package/merged-commands/product-strategist.md +26 -0
- package/merged-commands/production-code-audit.md +540 -0
- package/merged-commands/programmatic-seo.md +351 -0
- package/merged-commands/projection-patterns.md +33 -0
- package/merged-commands/prometheus-configuration.md +404 -0
- package/merged-commands/prompt-caching.md +61 -0
- package/merged-commands/prompt-engineer.md +272 -0
- package/merged-commands/prompt-engineering-patterns.md +213 -0
- package/merged-commands/prompt-engineering.md +171 -0
- package/merged-commands/prompt-library.md +322 -0
- package/merged-commands/protocol-reverse-engineering.md +29 -0
- package/merged-commands/pydantic-models.md +58 -0
- package/merged-commands/pypict-skill.md +22 -0
- package/merged-commands/python-development-python-scaffold.md +331 -0
- package/merged-commands/python-development.md +139 -0
- package/merged-commands/python-packaging.md +36 -0
- package/merged-commands/python-patterns.md +441 -0
- package/merged-commands/python-performance-optimization.md +36 -0
- package/merged-commands/python-pro.md +158 -0
- package/merged-commands/python-testing-patterns.md +37 -0
- package/merged-commands/qa-regression.md +337 -0
- package/merged-commands/quant-analyst.md +53 -0
- package/merged-commands/radix-ui-design-system.md +847 -0
- package/merged-commands/raffle-winner-picker.md +159 -0
- package/merged-commands/rag-architect.md +100 -0
- package/merged-commands/rag-engineer.md +90 -0
- package/merged-commands/rag-implementation.md +421 -0
- package/merged-commands/rails-expert.md +97 -0
- package/merged-commands/react-best-practices.md +121 -0
- package/merged-commands/react-expert.md +98 -0
- package/merged-commands/react-flow-node.md +66 -0
- package/merged-commands/react-modernization.md +34 -0
- package/merged-commands/react-native-architecture.md +33 -0
- package/merged-commands/react-native-expert.md +88 -0
- package/merged-commands/react-patterns.md +198 -0
- package/merged-commands/react-state-management.md +441 -0
- package/merged-commands/react-ui-patterns.md +289 -0
- package/merged-commands/readme.md +775 -0
- package/merged-commands/receiving-code-review.md +213 -0
- package/merged-commands/red-team-tactics.md +199 -0
- package/merged-commands/red-team-tools.md +310 -0
- package/merged-commands/reference-builder.md +188 -0
- package/merged-commands/referral-program.md +602 -0
- package/merged-commands/remotion-best-practices.md +45 -0
- package/merged-commands/repomix.md +275 -0
- package/merged-commands/requesting-code-review.md +105 -0
- package/merged-commands/research-engineer.md +135 -0
- package/merged-commands/research.md +191 -0
- package/merged-commands/reverse-engineer.md +173 -0
- package/merged-commands/risk-manager.md +61 -0
- package/merged-commands/risk-metrics-calculation.md +33 -0
- package/merged-commands/ruby-pro.md +56 -0
- package/merged-commands/rust-async-patterns.md +33 -0
- package/merged-commands/rust-engineer.md +96 -0
- package/merged-commands/rust-pro.md +178 -0
- package/merged-commands/saga-orchestration.md +496 -0
- package/merged-commands/sales-automator.md +55 -0
- package/merged-commands/salesforce-developer.md +105 -0
- package/merged-commands/salesforce-development.md +51 -0
- package/merged-commands/sast-configuration.md +212 -0
- package/merged-commands/scala-pro.md +82 -0
- package/merged-commands/scanning-tools.md +589 -0
- package/merged-commands/schema-markup.md +360 -0
- package/merged-commands/screen-reader-testing.md +33 -0
- package/merged-commands/screenshots.md +401 -0
- package/merged-commands/scroll-experience.md +263 -0
- package/merged-commands/search-specialist.md +80 -0
- package/merged-commands/secrets-management.md +364 -0
- package/merged-commands/secure-code-guardian.md +93 -0
- package/merged-commands/security-auditor.md +169 -0
- package/merged-commands/security-bluebook-builder.md +22 -0
- package/merged-commands/security-compliance-compliance-check.md +55 -0
- package/merged-commands/security-requirement-extraction.md +33 -0
- package/merged-commands/security-reviewer.md +94 -0
- package/merged-commands/security-scanning-security-dependencies.md +43 -0
- package/merged-commands/security-scanning-security-hardening.md +147 -0
- package/merged-commands/security-scanning-security-sast.md +495 -0
- package/merged-commands/segment-cdp.md +50 -0
- package/merged-commands/senior-architect.md +209 -0
- package/merged-commands/senior-backend.md +209 -0
- package/merged-commands/senior-computer-vision.md +226 -0
- package/merged-commands/senior-data-engineer.md +226 -0
- package/merged-commands/senior-data-scientist.md +226 -0
- package/merged-commands/senior-devops.md +209 -0
- package/merged-commands/senior-frontend.md +209 -0
- package/merged-commands/senior-fullstack.md +209 -0
- package/merged-commands/senior-ml-engineer.md +226 -0
- package/merged-commands/senior-prompt-engineer.md +226 -0
- package/merged-commands/senior-qa.md +209 -0
- package/merged-commands/senior-secops.md +209 -0
- package/merged-commands/senior-security.md +209 -0
- package/merged-commands/seo-audit.md +487 -0
- package/merged-commands/seo-authority-builder.md +136 -0
- package/merged-commands/seo-cannibalization-detector.md +123 -0
- package/merged-commands/seo-content-auditor.md +83 -0
- package/merged-commands/seo-content-planner.md +108 -0
- package/merged-commands/seo-content-refresher.md +118 -0
- package/merged-commands/seo-content-writer.md +96 -0
- package/merged-commands/seo-fundamentals.md +173 -0
- package/merged-commands/seo-keyword-strategist.md +95 -0
- package/merged-commands/seo-meta-optimizer.md +92 -0
- package/merged-commands/seo-snippet-hunter.md +114 -0
- package/merged-commands/seo-structure-architect.md +108 -0
- package/merged-commands/sequential-thinking.md +94 -0
- package/merged-commands/server-management.md +161 -0
- package/merged-commands/service-mesh-expert.md +58 -0
- package/merged-commands/service-mesh-observability.md +395 -0
- package/merged-commands/sharp-edges.md +70 -0
- package/merged-commands/shellcheck-configuration.md +466 -0
- package/merged-commands/shodan-reconnaissance.md +503 -0
- package/merged-commands/shopify-apps.md +42 -0
- package/merged-commands/shopify-development.md +366 -0
- package/merged-commands/shopify-expert.md +102 -0
- package/merged-commands/signup-flow-cro.md +355 -0
- package/merged-commands/similarity-search-patterns.md +33 -0
- package/merged-commands/skill-creator.md +356 -0
- package/merged-commands/skill-developer.md +426 -0
- package/merged-commands/skill-rails-upgrade.md +408 -0
- package/merged-commands/skill-seekers.md +22 -0
- package/merged-commands/skill-share.md +80 -0
- package/merged-commands/slack-bot-builder.md +264 -0
- package/merged-commands/slack-gif-creator.md +254 -0
- package/merged-commands/slo-implementation.md +341 -0
- package/merged-commands/smtp-penetration-testing.md +500 -0
- package/merged-commands/social-content.md +807 -0
- package/merged-commands/software-architecture.md +75 -0
- package/merged-commands/solidity-security.md +34 -0
- package/merged-commands/spark-engineer.md +100 -0
- package/merged-commands/spark-optimization.md +427 -0
- package/merged-commands/spec-miner.md +88 -0
- package/merged-commands/spring-boot-engineer.md +104 -0
- package/merged-commands/sql-injection-testing.md +448 -0
- package/merged-commands/sql-optimization-patterns.md +35 -0
- package/merged-commands/sql-pro.md +173 -0
- package/merged-commands/sqlmap-database-pentesting.md +400 -0
- package/merged-commands/sre-engineer.md +98 -0
- package/merged-commands/ssh-penetration-testing.md +488 -0
- package/merged-commands/startup-analyst.md +328 -0
- package/merged-commands/startup-business-analyst-business-case.md +487 -0
- package/merged-commands/startup-business-analyst-financial-projections.md +353 -0
- package/merged-commands/startup-business-analyst-market-opportunity.md +240 -0
- package/merged-commands/startup-financial-modeling.md +467 -0
- package/merged-commands/startup-metrics-framework.md +34 -0
- package/merged-commands/stitch-ui-design.md +378 -0
- package/merged-commands/stride-analysis-patterns.md +33 -0
- package/merged-commands/stripe-integration.md +454 -0
- package/merged-commands/subagent-driven-development.md +240 -0
- package/merged-commands/superpowers-lab.md +22 -0
- package/merged-commands/swift-expert.md +94 -0
- package/merged-commands/swiftui-expert-skill.md +275 -0
- package/merged-commands/systematic-debugging.md +296 -0
- package/merged-commands/systems-programming-rust-project.md +440 -0
- package/merged-commands/tailwind-design-system.md +33 -0
- package/merged-commands/tailwind-patterns.md +269 -0
- package/merged-commands/tavily-web.md +36 -0
- package/merged-commands/tdd-orchestrator.md +205 -0
- package/merged-commands/tdd-workflow.md +149 -0
- package/merged-commands/tdd-workflows-tdd-cycle.md +221 -0
- package/merged-commands/tdd-workflows-tdd-green.md +73 -0
- package/merged-commands/tdd-workflows-tdd-red.md +164 -0
- package/merged-commands/tdd-workflows-tdd-refactor.md +187 -0
- package/merged-commands/team-collaboration-issue.md +37 -0
- package/merged-commands/team-collaboration-standup-notes.md +44 -0
- package/merged-commands/team-composition-analysis.md +413 -0
- package/merged-commands/telegram-bot-builder.md +254 -0
- package/merged-commands/telegram-mini-app.md +279 -0
- package/merged-commands/template-skill.md +6 -0
- package/merged-commands/temporal-python-pro.md +370 -0
- package/merged-commands/temporal-python-testing.md +170 -0
- package/merged-commands/terraform-engineer.md +97 -0
- package/merged-commands/terraform-module-library.md +261 -0
- package/merged-commands/terraform-skill.md +517 -0
- package/merged-commands/terraform-specialist.md +166 -0
- package/merged-commands/test-automator.md +224 -0
- package/merged-commands/test-driven-development.md +371 -0
- package/merged-commands/test-fixing.md +119 -0
- package/merged-commands/test-master.md +104 -0
- package/merged-commands/testing-patterns.md +259 -0
- package/merged-commands/theme-factory.md +59 -0
- package/merged-commands/threat-mitigation-mapping.md +33 -0
- package/merged-commands/threat-modeling-expert.md +60 -0
- package/merged-commands/threejs-skills.md +22 -0
- package/merged-commands/threejs.md +89 -0
- package/merged-commands/tool-design.md +318 -0
- package/merged-commands/top-web-vulnerabilities.md +543 -0
- package/merged-commands/track-management.md +38 -0
- package/merged-commands/trigger-dev.md +67 -0
- package/merged-commands/turborepo-caching.md +419 -0
- package/merged-commands/tutorial-engineer.md +139 -0
- package/merged-commands/twilio-communications.md +295 -0
- package/merged-commands/typescript-advanced-types.md +35 -0
- package/merged-commands/typescript-expert.md +429 -0
- package/merged-commands/typescript-pro.md +55 -0
- package/merged-commands/ui-design-system.md +32 -0
- package/merged-commands/ui-skills.md +22 -0
- package/merged-commands/ui-styling.md +321 -0
- package/merged-commands/ui-ux-designer.md +209 -0
- package/merged-commands/ui-ux-pro-max.md +351 -0
- package/merged-commands/ui-visual-validator.md +214 -0
- package/merged-commands/unit-testing-test-generate.md +319 -0
- package/merged-commands/unity-developer.md +230 -0
- package/merged-commands/unity-ecs-patterns.md +33 -0
- package/merged-commands/unreal-engine-cpp-pro.md +114 -0
- package/merged-commands/upgrading-expo.md +118 -0
- package/merged-commands/upstash-qstash.md +68 -0
- package/merged-commands/using-git-worktrees.md +217 -0
- package/merged-commands/using-neon.md +84 -0
- package/merged-commands/using-superpowers.md +87 -0
- package/merged-commands/uv-package-manager.md +37 -0
- package/merged-commands/ux-researcher-designer.md +30 -0
- package/merged-commands/varlock-claude-skill.md +22 -0
- package/merged-commands/vector-database-engineer.md +60 -0
- package/merged-commands/vector-index-tuning.md +42 -0
- package/merged-commands/vercel-deploy-claimable.md +120 -0
- package/merged-commands/vercel-deploy.md +22 -0
- package/merged-commands/vercel-deployment.md +79 -0
- package/merged-commands/verification-before-completion.md +139 -0
- package/merged-commands/vexor.md +22 -0
- package/merged-commands/video-downloader.md +106 -0
- package/merged-commands/viral-generator-builder.md +199 -0
- package/merged-commands/voice-agents.md +68 -0
- package/merged-commands/voice-ai-development.md +302 -0
- package/merged-commands/voice-ai-engine-development.md +721 -0
- package/merged-commands/vue-expert-js.md +91 -0
- package/merged-commands/vue-expert.md +374 -0
- package/merged-commands/vulnerability-scanner.md +276 -0
- package/merged-commands/wcag-audit-patterns.md +41 -0
- package/merged-commands/web-artifacts-builder.md +74 -0
- package/merged-commands/web-design-guidelines.md +36 -0
- package/merged-commands/web-frameworks.md +324 -0
- package/merged-commands/web-performance-optimization.md +646 -0
- package/merged-commands/web3-testing.md +427 -0
- package/merged-commands/webapp-testing.md +96 -0
- package/merged-commands/websocket-engineer.md +96 -0
- package/merged-commands/windows-privilege-escalation.md +496 -0
- package/merged-commands/wireshark-analysis.md +497 -0
- package/merged-commands/wordpress-penetration-testing.md +485 -0
- package/merged-commands/wordpress-pro.md +105 -0
- package/merged-commands/workflow-automation.md +68 -0
- package/merged-commands/workflow-orchestration-patterns.md +333 -0
- package/merged-commands/workflow-patterns.md +38 -0
- package/merged-commands/writing-plans.md +116 -0
- package/merged-commands/writing-skills.md +125 -0
- package/merged-commands/x-article-publisher-skill.md +22 -0
- package/merged-commands/xlsx-official.md +289 -0
- package/merged-commands/xlsx.md +289 -0
- package/merged-commands/xss-html-injection.md +499 -0
- package/merged-commands/youtube-transcript.md +415 -0
- package/merged-commands/zapier-make-patterns.md +67 -0
- package/merged-commands/zustand-store.md +68 -0
- package/package.json +1 -1
- package/scripts/merge-commands.js +21 -0
- package/templates/base/rules/auto-skill.md +131 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: software-architecture
|
|
3
|
+
description: Guide for quality focused software architecture. This skill should be used when users want to write code, design architecture, analyze code, in any case that relates to software development.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Software Architecture Development Skill
|
|
7
|
+
|
|
8
|
+
This skill provides guidance for quality focused software development and architecture. It is based on Clean Architecture and Domain Driven Design principles.
|
|
9
|
+
|
|
10
|
+
## Code Style Rules
|
|
11
|
+
|
|
12
|
+
### General Principles
|
|
13
|
+
|
|
14
|
+
- **Early return pattern**: Always use early returns when possible, over nested conditions for better readability
|
|
15
|
+
- Avoid code duplication through creation of reusable functions and modules
|
|
16
|
+
- Decompose long (more than 80 lines of code) components and functions into multiple smaller components and functions. If they cannot be used anywhere else, keep it in the same file. But if file longer than 200 lines of code, it should be split into multiple files.
|
|
17
|
+
- Use arrow functions instead of function declarations when possible
|
|
18
|
+
|
|
19
|
+
### Best Practices
|
|
20
|
+
|
|
21
|
+
#### Library-First Approach
|
|
22
|
+
|
|
23
|
+
- **ALWAYS search for existing solutions before writing custom code**
|
|
24
|
+
- Check npm for existing libraries that solve the problem
|
|
25
|
+
- Evaluate existing services/SaaS solutions
|
|
26
|
+
- Consider third-party APIs for common functionality
|
|
27
|
+
- Use libraries instead of writing your own utils or helpers. For example, use `cockatiel` instead of writing your own retry logic.
|
|
28
|
+
- **When custom code IS justified:**
|
|
29
|
+
- Specific business logic unique to the domain
|
|
30
|
+
- Performance-critical paths with special requirements
|
|
31
|
+
- When external dependencies would be overkill
|
|
32
|
+
- Security-sensitive code requiring full control
|
|
33
|
+
- When existing solutions don't meet requirements after thorough evaluation
|
|
34
|
+
|
|
35
|
+
#### Architecture and Design
|
|
36
|
+
|
|
37
|
+
- **Clean Architecture & DDD Principles:**
|
|
38
|
+
- Follow domain-driven design and ubiquitous language
|
|
39
|
+
- Separate domain entities from infrastructure concerns
|
|
40
|
+
- Keep business logic independent of frameworks
|
|
41
|
+
- Define use cases clearly and keep them isolated
|
|
42
|
+
- **Naming Conventions:**
|
|
43
|
+
- **AVOID** generic names: `utils`, `helpers`, `common`, `shared`
|
|
44
|
+
- **USE** domain-specific names: `OrderCalculator`, `UserAuthenticator`, `InvoiceGenerator`
|
|
45
|
+
- Follow bounded context naming patterns
|
|
46
|
+
- Each module should have a single, clear purpose
|
|
47
|
+
- **Separation of Concerns:**
|
|
48
|
+
- Do NOT mix business logic with UI components
|
|
49
|
+
- Keep database queries out of controllers
|
|
50
|
+
- Maintain clear boundaries between contexts
|
|
51
|
+
- Ensure proper separation of responsibilities
|
|
52
|
+
|
|
53
|
+
#### Anti-Patterns to Avoid
|
|
54
|
+
|
|
55
|
+
- **NIH (Not Invented Here) Syndrome:**
|
|
56
|
+
- Don't build custom auth when Auth0/Supabase exists
|
|
57
|
+
- Don't write custom state management instead of using Redux/Zustand
|
|
58
|
+
- Don't create custom form validation instead of using established libraries
|
|
59
|
+
- **Poor Architectural Choices:**
|
|
60
|
+
- Mixing business logic with UI components
|
|
61
|
+
- Database queries directly in controllers
|
|
62
|
+
- Lack of clear separation of concerns
|
|
63
|
+
- **Generic Naming Anti-Patterns:**
|
|
64
|
+
- `utils.js` with 50 unrelated functions
|
|
65
|
+
- `helpers/misc.js` as a dumping ground
|
|
66
|
+
- `common/shared.js` with unclear purpose
|
|
67
|
+
- Remember: Every line of custom code is a liability that needs maintenance, testing, and documentation
|
|
68
|
+
|
|
69
|
+
#### Code Quality
|
|
70
|
+
|
|
71
|
+
- Proper error handling with typed catch blocks
|
|
72
|
+
- Break down complex logic into smaller, reusable functions
|
|
73
|
+
- Avoid deep nesting (max 3 levels)
|
|
74
|
+
- Keep functions focused and under 50 lines when possible
|
|
75
|
+
- Keep files focused and under 200 lines of code when possible
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: solidity-security
|
|
3
|
+
description: Master smart contract security best practices to prevent common vulnerabilities and implement secure Solidity patterns. Use when writing smart contracts, auditing existing contracts, or implementing security measures for blockchain applications.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Solidity Security
|
|
7
|
+
|
|
8
|
+
Master smart contract security best practices, vulnerability prevention, and secure Solidity development patterns.
|
|
9
|
+
|
|
10
|
+
## Use this skill when
|
|
11
|
+
|
|
12
|
+
- Writing secure smart contracts
|
|
13
|
+
- Auditing existing contracts for vulnerabilities
|
|
14
|
+
- Implementing secure DeFi protocols
|
|
15
|
+
- Preventing reentrancy, overflow, and access control issues
|
|
16
|
+
- Optimizing gas usage while maintaining security
|
|
17
|
+
- Preparing contracts for professional audits
|
|
18
|
+
- Understanding common attack vectors
|
|
19
|
+
|
|
20
|
+
## Do not use this skill when
|
|
21
|
+
|
|
22
|
+
- The task is unrelated to solidity security
|
|
23
|
+
- You need a different domain or tool outside this scope
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
- Clarify goals, constraints, and required inputs.
|
|
28
|
+
- Apply relevant best practices and validate outcomes.
|
|
29
|
+
- Provide actionable steps and verification.
|
|
30
|
+
- If detailed examples are required, open `resources/implementation-playbook.md`.
|
|
31
|
+
|
|
32
|
+
## Resources
|
|
33
|
+
|
|
34
|
+
- `resources/implementation-playbook.md` for detailed patterns and examples.
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spark-engineer
|
|
3
|
+
description: Use when building Apache Spark applications, distributed data processing pipelines, or optimizing big data workloads. Invoke for DataFrame API, Spark SQL, RDD operations, performance tuning, streaming analytics.
|
|
4
|
+
triggers:
|
|
5
|
+
- Apache Spark
|
|
6
|
+
- PySpark
|
|
7
|
+
- Spark SQL
|
|
8
|
+
- distributed computing
|
|
9
|
+
- big data
|
|
10
|
+
- DataFrame API
|
|
11
|
+
- RDD
|
|
12
|
+
- Spark Streaming
|
|
13
|
+
- structured streaming
|
|
14
|
+
- data partitioning
|
|
15
|
+
- Spark performance
|
|
16
|
+
- cluster computing
|
|
17
|
+
- data processing pipeline
|
|
18
|
+
role: expert
|
|
19
|
+
scope: implementation
|
|
20
|
+
output-format: code
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
# Spark Engineer
|
|
24
|
+
|
|
25
|
+
Senior Apache Spark engineer specializing in high-performance distributed data processing, optimizing large-scale ETL pipelines, and building production-grade Spark applications.
|
|
26
|
+
|
|
27
|
+
## Role Definition
|
|
28
|
+
|
|
29
|
+
You are a senior Apache Spark engineer with deep big data experience. You specialize in building scalable data processing pipelines using DataFrame API, Spark SQL, and RDD operations. You optimize Spark applications for performance through partitioning strategies, caching, and cluster tuning. You build production-grade systems processing petabyte-scale data.
|
|
30
|
+
|
|
31
|
+
## When to Use This Skill
|
|
32
|
+
|
|
33
|
+
- Building distributed data processing pipelines with Spark
|
|
34
|
+
- Optimizing Spark application performance and resource usage
|
|
35
|
+
- Implementing complex transformations with DataFrame API and Spark SQL
|
|
36
|
+
- Processing streaming data with Structured Streaming
|
|
37
|
+
- Designing partitioning and caching strategies
|
|
38
|
+
- Troubleshooting memory issues, shuffle operations, and skew
|
|
39
|
+
- Migrating from RDD to DataFrame/Dataset APIs
|
|
40
|
+
|
|
41
|
+
## Core Workflow
|
|
42
|
+
|
|
43
|
+
1. **Analyze requirements** - Understand data volume, transformations, latency requirements, cluster resources
|
|
44
|
+
2. **Design pipeline** - Choose DataFrame vs RDD, plan partitioning strategy, identify broadcast opportunities
|
|
45
|
+
3. **Implement** - Write Spark code with optimized transformations, appropriate caching, proper error handling
|
|
46
|
+
4. **Optimize** - Analyze Spark UI, tune shuffle partitions, eliminate skew, optimize joins and aggregations
|
|
47
|
+
5. **Validate** - Test with production-scale data, monitor resource usage, verify performance targets
|
|
48
|
+
|
|
49
|
+
## Reference Guide
|
|
50
|
+
|
|
51
|
+
Load detailed guidance based on context:
|
|
52
|
+
|
|
53
|
+
| Topic | Reference | Load When |
|
|
54
|
+
|-------|-----------|-----------|
|
|
55
|
+
| Spark SQL & DataFrames | `references/spark-sql-dataframes.md` | DataFrame API, Spark SQL, schemas, joins, aggregations |
|
|
56
|
+
| RDD Operations | `references/rdd-operations.md` | Transformations, actions, pair RDDs, custom partitioners |
|
|
57
|
+
| Partitioning & Caching | `references/partitioning-caching.md` | Data partitioning, persistence levels, broadcast variables |
|
|
58
|
+
| Performance Tuning | `references/performance-tuning.md` | Configuration, memory tuning, shuffle optimization, skew handling |
|
|
59
|
+
| Streaming Patterns | `references/streaming-patterns.md` | Structured Streaming, watermarks, stateful operations, sinks |
|
|
60
|
+
|
|
61
|
+
## Constraints
|
|
62
|
+
|
|
63
|
+
### MUST DO
|
|
64
|
+
- Use DataFrame API over RDD for structured data processing
|
|
65
|
+
- Define explicit schemas for production pipelines
|
|
66
|
+
- Partition data appropriately (200-1000 partitions per executor core)
|
|
67
|
+
- Cache intermediate results only when reused multiple times
|
|
68
|
+
- Use broadcast joins for small dimension tables (<200MB)
|
|
69
|
+
- Handle data skew with salting or custom partitioning
|
|
70
|
+
- Monitor Spark UI for shuffle, spill, and GC metrics
|
|
71
|
+
- Test with production-scale data volumes
|
|
72
|
+
|
|
73
|
+
### MUST NOT DO
|
|
74
|
+
- Use collect() on large datasets (causes OOM)
|
|
75
|
+
- Skip schema definition and rely on inference in production
|
|
76
|
+
- Cache every DataFrame without measuring benefit
|
|
77
|
+
- Ignore shuffle partition tuning (default 200 often wrong)
|
|
78
|
+
- Use UDFs when built-in functions available (10-100x slower)
|
|
79
|
+
- Process small files without coalescing (small file problem)
|
|
80
|
+
- Run transformations without understanding lazy evaluation
|
|
81
|
+
- Ignore data skew warnings in Spark UI
|
|
82
|
+
|
|
83
|
+
## Output Templates
|
|
84
|
+
|
|
85
|
+
When implementing Spark solutions, provide:
|
|
86
|
+
1. Complete Spark code (PySpark or Scala) with type hints/types
|
|
87
|
+
2. Configuration recommendations (executors, memory, shuffle partitions)
|
|
88
|
+
3. Partitioning strategy explanation
|
|
89
|
+
4. Performance analysis (expected shuffle size, memory usage)
|
|
90
|
+
5. Monitoring recommendations (key Spark UI metrics to watch)
|
|
91
|
+
|
|
92
|
+
## Knowledge Reference
|
|
93
|
+
|
|
94
|
+
Spark DataFrame API, Spark SQL, RDD transformations/actions, catalyst optimizer, tungsten execution engine, partitioning strategies, broadcast variables, accumulators, structured streaming, watermarks, checkpointing, Spark UI analysis, memory management, shuffle optimization
|
|
95
|
+
|
|
96
|
+
## Related Skills
|
|
97
|
+
|
|
98
|
+
- **Python Pro** - PySpark development patterns and best practices
|
|
99
|
+
- **SQL Pro** - Advanced Spark SQL query optimization
|
|
100
|
+
- **DevOps Engineer** - Spark cluster deployment and monitoring
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spark-optimization
|
|
3
|
+
description: Optimize Apache Spark jobs with partitioning, caching, shuffle optimization, and memory tuning. Use when improving Spark performance, debugging slow jobs, or scaling data processing pipelines.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Apache Spark Optimization
|
|
7
|
+
|
|
8
|
+
Production patterns for optimizing Apache Spark jobs including partitioning strategies, memory management, shuffle optimization, and performance tuning.
|
|
9
|
+
|
|
10
|
+
## Do not use this skill when
|
|
11
|
+
|
|
12
|
+
- The task is unrelated to apache spark optimization
|
|
13
|
+
- You need a different domain or tool outside this scope
|
|
14
|
+
|
|
15
|
+
## Instructions
|
|
16
|
+
|
|
17
|
+
- Clarify goals, constraints, and required inputs.
|
|
18
|
+
- Apply relevant best practices and validate outcomes.
|
|
19
|
+
- Provide actionable steps and verification.
|
|
20
|
+
- If detailed examples are required, open `resources/implementation-playbook.md`.
|
|
21
|
+
|
|
22
|
+
## Use this skill when
|
|
23
|
+
|
|
24
|
+
- Optimizing slow Spark jobs
|
|
25
|
+
- Tuning memory and executor configuration
|
|
26
|
+
- Implementing efficient partitioning strategies
|
|
27
|
+
- Debugging Spark performance issues
|
|
28
|
+
- Scaling Spark pipelines for large datasets
|
|
29
|
+
- Reducing shuffle and data skew
|
|
30
|
+
|
|
31
|
+
## Core Concepts
|
|
32
|
+
|
|
33
|
+
### 1. Spark Execution Model
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Driver Program
|
|
37
|
+
↓
|
|
38
|
+
Job (triggered by action)
|
|
39
|
+
↓
|
|
40
|
+
Stages (separated by shuffles)
|
|
41
|
+
↓
|
|
42
|
+
Tasks (one per partition)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Key Performance Factors
|
|
46
|
+
|
|
47
|
+
| Factor | Impact | Solution |
|
|
48
|
+
|--------|--------|----------|
|
|
49
|
+
| **Shuffle** | Network I/O, disk I/O | Minimize wide transformations |
|
|
50
|
+
| **Data Skew** | Uneven task duration | Salting, broadcast joins |
|
|
51
|
+
| **Serialization** | CPU overhead | Use Kryo, columnar formats |
|
|
52
|
+
| **Memory** | GC pressure, spills | Tune executor memory |
|
|
53
|
+
| **Partitions** | Parallelism | Right-size partitions |
|
|
54
|
+
|
|
55
|
+
## Quick Start
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from pyspark.sql import SparkSession
|
|
59
|
+
from pyspark.sql import functions as F
|
|
60
|
+
|
|
61
|
+
# Create optimized Spark session
|
|
62
|
+
spark = (SparkSession.builder
|
|
63
|
+
.appName("OptimizedJob")
|
|
64
|
+
.config("spark.sql.adaptive.enabled", "true")
|
|
65
|
+
.config("spark.sql.adaptive.coalescePartitions.enabled", "true")
|
|
66
|
+
.config("spark.sql.adaptive.skewJoin.enabled", "true")
|
|
67
|
+
.config("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
|
|
68
|
+
.config("spark.sql.shuffle.partitions", "200")
|
|
69
|
+
.getOrCreate())
|
|
70
|
+
|
|
71
|
+
# Read with optimized settings
|
|
72
|
+
df = (spark.read
|
|
73
|
+
.format("parquet")
|
|
74
|
+
.option("mergeSchema", "false")
|
|
75
|
+
.load("s3://bucket/data/"))
|
|
76
|
+
|
|
77
|
+
# Efficient transformations
|
|
78
|
+
result = (df
|
|
79
|
+
.filter(F.col("date") >= "2024-01-01")
|
|
80
|
+
.select("id", "amount", "category")
|
|
81
|
+
.groupBy("category")
|
|
82
|
+
.agg(F.sum("amount").alias("total")))
|
|
83
|
+
|
|
84
|
+
result.write.mode("overwrite").parquet("s3://bucket/output/")
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Patterns
|
|
88
|
+
|
|
89
|
+
### Pattern 1: Optimal Partitioning
|
|
90
|
+
|
|
91
|
+
```python
|
|
92
|
+
# Calculate optimal partition count
|
|
93
|
+
def calculate_partitions(data_size_gb: float, partition_size_mb: int = 128) -> int:
|
|
94
|
+
"""
|
|
95
|
+
Optimal partition size: 128MB - 256MB
|
|
96
|
+
Too few: Under-utilization, memory pressure
|
|
97
|
+
Too many: Task scheduling overhead
|
|
98
|
+
"""
|
|
99
|
+
return max(int(data_size_gb * 1024 / partition_size_mb), 1)
|
|
100
|
+
|
|
101
|
+
# Repartition for even distribution
|
|
102
|
+
df_repartitioned = df.repartition(200, "partition_key")
|
|
103
|
+
|
|
104
|
+
# Coalesce to reduce partitions (no shuffle)
|
|
105
|
+
df_coalesced = df.coalesce(100)
|
|
106
|
+
|
|
107
|
+
# Partition pruning with predicate pushdown
|
|
108
|
+
df = (spark.read.parquet("s3://bucket/data/")
|
|
109
|
+
.filter(F.col("date") == "2024-01-01")) # Spark pushes this down
|
|
110
|
+
|
|
111
|
+
# Write with partitioning for future queries
|
|
112
|
+
(df.write
|
|
113
|
+
.partitionBy("year", "month", "day")
|
|
114
|
+
.mode("overwrite")
|
|
115
|
+
.parquet("s3://bucket/partitioned_output/"))
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Pattern 2: Join Optimization
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from pyspark.sql import functions as F
|
|
122
|
+
from pyspark.sql.types import *
|
|
123
|
+
|
|
124
|
+
# 1. Broadcast Join - Small table joins
|
|
125
|
+
# Best when: One side < 10MB (configurable)
|
|
126
|
+
small_df = spark.read.parquet("s3://bucket/small_table/") # < 10MB
|
|
127
|
+
large_df = spark.read.parquet("s3://bucket/large_table/") # TBs
|
|
128
|
+
|
|
129
|
+
# Explicit broadcast hint
|
|
130
|
+
result = large_df.join(
|
|
131
|
+
F.broadcast(small_df),
|
|
132
|
+
on="key",
|
|
133
|
+
how="left"
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
# 2. Sort-Merge Join - Default for large tables
|
|
137
|
+
# Requires shuffle, but handles any size
|
|
138
|
+
result = large_df1.join(large_df2, on="key", how="inner")
|
|
139
|
+
|
|
140
|
+
# 3. Bucket Join - Pre-sorted, no shuffle at join time
|
|
141
|
+
# Write bucketed tables
|
|
142
|
+
(df.write
|
|
143
|
+
.bucketBy(200, "customer_id")
|
|
144
|
+
.sortBy("customer_id")
|
|
145
|
+
.mode("overwrite")
|
|
146
|
+
.saveAsTable("bucketed_orders"))
|
|
147
|
+
|
|
148
|
+
# Join bucketed tables (no shuffle!)
|
|
149
|
+
orders = spark.table("bucketed_orders")
|
|
150
|
+
customers = spark.table("bucketed_customers") # Same bucket count
|
|
151
|
+
result = orders.join(customers, on="customer_id")
|
|
152
|
+
|
|
153
|
+
# 4. Skew Join Handling
|
|
154
|
+
# Enable AQE skew join optimization
|
|
155
|
+
spark.conf.set("spark.sql.adaptive.skewJoin.enabled", "true")
|
|
156
|
+
spark.conf.set("spark.sql.adaptive.skewJoin.skewedPartitionFactor", "5")
|
|
157
|
+
spark.conf.set("spark.sql.adaptive.skewJoin.skewedPartitionThresholdInBytes", "256MB")
|
|
158
|
+
|
|
159
|
+
# Manual salting for severe skew
|
|
160
|
+
def salt_join(df_skewed, df_other, key_col, num_salts=10):
|
|
161
|
+
"""Add salt to distribute skewed keys"""
|
|
162
|
+
# Add salt to skewed side
|
|
163
|
+
df_salted = df_skewed.withColumn(
|
|
164
|
+
"salt",
|
|
165
|
+
(F.rand() * num_salts).cast("int")
|
|
166
|
+
).withColumn(
|
|
167
|
+
"salted_key",
|
|
168
|
+
F.concat(F.col(key_col), F.lit("_"), F.col("salt"))
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
# Explode other side with all salts
|
|
172
|
+
df_exploded = df_other.crossJoin(
|
|
173
|
+
spark.range(num_salts).withColumnRenamed("id", "salt")
|
|
174
|
+
).withColumn(
|
|
175
|
+
"salted_key",
|
|
176
|
+
F.concat(F.col(key_col), F.lit("_"), F.col("salt"))
|
|
177
|
+
)
|
|
178
|
+
|
|
179
|
+
# Join on salted key
|
|
180
|
+
return df_salted.join(df_exploded, on="salted_key", how="inner")
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Pattern 3: Caching and Persistence
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from pyspark import StorageLevel
|
|
187
|
+
|
|
188
|
+
# Cache when reusing DataFrame multiple times
|
|
189
|
+
df = spark.read.parquet("s3://bucket/data/")
|
|
190
|
+
df_filtered = df.filter(F.col("status") == "active")
|
|
191
|
+
|
|
192
|
+
# Cache in memory (MEMORY_AND_DISK is default)
|
|
193
|
+
df_filtered.cache()
|
|
194
|
+
|
|
195
|
+
# Or with specific storage level
|
|
196
|
+
df_filtered.persist(StorageLevel.MEMORY_AND_DISK_SER)
|
|
197
|
+
|
|
198
|
+
# Force materialization
|
|
199
|
+
df_filtered.count()
|
|
200
|
+
|
|
201
|
+
# Use in multiple actions
|
|
202
|
+
agg1 = df_filtered.groupBy("category").count()
|
|
203
|
+
agg2 = df_filtered.groupBy("region").sum("amount")
|
|
204
|
+
|
|
205
|
+
# Unpersist when done
|
|
206
|
+
df_filtered.unpersist()
|
|
207
|
+
|
|
208
|
+
# Storage levels explained:
|
|
209
|
+
# MEMORY_ONLY - Fast, but may not fit
|
|
210
|
+
# MEMORY_AND_DISK - Spills to disk if needed (recommended)
|
|
211
|
+
# MEMORY_ONLY_SER - Serialized, less memory, more CPU
|
|
212
|
+
# DISK_ONLY - When memory is tight
|
|
213
|
+
# OFF_HEAP - Tungsten off-heap memory
|
|
214
|
+
|
|
215
|
+
# Checkpoint for complex lineage
|
|
216
|
+
spark.sparkContext.setCheckpointDir("s3://bucket/checkpoints/")
|
|
217
|
+
df_complex = (df
|
|
218
|
+
.join(other_df, "key")
|
|
219
|
+
.groupBy("category")
|
|
220
|
+
.agg(F.sum("amount")))
|
|
221
|
+
df_complex.checkpoint() # Breaks lineage, materializes
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Pattern 4: Memory Tuning
|
|
225
|
+
|
|
226
|
+
```python
|
|
227
|
+
# Executor memory configuration
|
|
228
|
+
# spark-submit --executor-memory 8g --executor-cores 4
|
|
229
|
+
|
|
230
|
+
# Memory breakdown (8GB executor):
|
|
231
|
+
# - spark.memory.fraction = 0.6 (60% = 4.8GB for execution + storage)
|
|
232
|
+
# - spark.memory.storageFraction = 0.5 (50% of 4.8GB = 2.4GB for cache)
|
|
233
|
+
# - Remaining 2.4GB for execution (shuffles, joins, sorts)
|
|
234
|
+
# - 40% = 3.2GB for user data structures and internal metadata
|
|
235
|
+
|
|
236
|
+
spark = (SparkSession.builder
|
|
237
|
+
.config("spark.executor.memory", "8g")
|
|
238
|
+
.config("spark.executor.memoryOverhead", "2g") # For non-JVM memory
|
|
239
|
+
.config("spark.memory.fraction", "0.6")
|
|
240
|
+
.config("spark.memory.storageFraction", "0.5")
|
|
241
|
+
.config("spark.sql.shuffle.partitions", "200")
|
|
242
|
+
# For memory-intensive operations
|
|
243
|
+
.config("spark.sql.autoBroadcastJoinThreshold", "50MB")
|
|
244
|
+
# Prevent OOM on large shuffles
|
|
245
|
+
.config("spark.sql.files.maxPartitionBytes", "128MB")
|
|
246
|
+
.getOrCreate())
|
|
247
|
+
|
|
248
|
+
# Monitor memory usage
|
|
249
|
+
def print_memory_usage(spark):
|
|
250
|
+
"""Print current memory usage"""
|
|
251
|
+
sc = spark.sparkContext
|
|
252
|
+
for executor in sc._jsc.sc().getExecutorMemoryStatus().keySet().toArray():
|
|
253
|
+
mem_status = sc._jsc.sc().getExecutorMemoryStatus().get(executor)
|
|
254
|
+
total = mem_status._1() / (1024**3)
|
|
255
|
+
free = mem_status._2() / (1024**3)
|
|
256
|
+
print(f"{executor}: {total:.2f}GB total, {free:.2f}GB free")
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Pattern 5: Shuffle Optimization
|
|
260
|
+
|
|
261
|
+
```python
|
|
262
|
+
# Reduce shuffle data size
|
|
263
|
+
spark.conf.set("spark.sql.shuffle.partitions", "auto") # With AQE
|
|
264
|
+
spark.conf.set("spark.shuffle.compress", "true")
|
|
265
|
+
spark.conf.set("spark.shuffle.spill.compress", "true")
|
|
266
|
+
|
|
267
|
+
# Pre-aggregate before shuffle
|
|
268
|
+
df_optimized = (df
|
|
269
|
+
# Local aggregation first (combiner)
|
|
270
|
+
.groupBy("key", "partition_col")
|
|
271
|
+
.agg(F.sum("value").alias("partial_sum"))
|
|
272
|
+
# Then global aggregation
|
|
273
|
+
.groupBy("key")
|
|
274
|
+
.agg(F.sum("partial_sum").alias("total")))
|
|
275
|
+
|
|
276
|
+
# Avoid shuffle with map-side operations
|
|
277
|
+
# BAD: Shuffle for each distinct
|
|
278
|
+
distinct_count = df.select("category").distinct().count()
|
|
279
|
+
|
|
280
|
+
# GOOD: Approximate distinct (no shuffle)
|
|
281
|
+
approx_count = df.select(F.approx_count_distinct("category")).collect()[0][0]
|
|
282
|
+
|
|
283
|
+
# Use coalesce instead of repartition when reducing partitions
|
|
284
|
+
df_reduced = df.coalesce(10) # No shuffle
|
|
285
|
+
|
|
286
|
+
# Optimize shuffle with compression
|
|
287
|
+
spark.conf.set("spark.io.compression.codec", "lz4") # Fast compression
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Pattern 6: Data Format Optimization
|
|
291
|
+
|
|
292
|
+
```python
|
|
293
|
+
# Parquet optimizations
|
|
294
|
+
(df.write
|
|
295
|
+
.option("compression", "snappy") # Fast compression
|
|
296
|
+
.option("parquet.block.size", 128 * 1024 * 1024) # 128MB row groups
|
|
297
|
+
.parquet("s3://bucket/output/"))
|
|
298
|
+
|
|
299
|
+
# Column pruning - only read needed columns
|
|
300
|
+
df = (spark.read.parquet("s3://bucket/data/")
|
|
301
|
+
.select("id", "amount", "date")) # Spark only reads these columns
|
|
302
|
+
|
|
303
|
+
# Predicate pushdown - filter at storage level
|
|
304
|
+
df = (spark.read.parquet("s3://bucket/partitioned/year=2024/")
|
|
305
|
+
.filter(F.col("status") == "active")) # Pushed to Parquet reader
|
|
306
|
+
|
|
307
|
+
# Delta Lake optimizations
|
|
308
|
+
(df.write
|
|
309
|
+
.format("delta")
|
|
310
|
+
.option("optimizeWrite", "true") # Bin-packing
|
|
311
|
+
.option("autoCompact", "true") # Compact small files
|
|
312
|
+
.mode("overwrite")
|
|
313
|
+
.save("s3://bucket/delta_table/"))
|
|
314
|
+
|
|
315
|
+
# Z-ordering for multi-dimensional queries
|
|
316
|
+
spark.sql("""
|
|
317
|
+
OPTIMIZE delta.`s3://bucket/delta_table/`
|
|
318
|
+
ZORDER BY (customer_id, date)
|
|
319
|
+
""")
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
### Pattern 7: Monitoring and Debugging
|
|
323
|
+
|
|
324
|
+
```python
|
|
325
|
+
# Enable detailed metrics
|
|
326
|
+
spark.conf.set("spark.sql.codegen.wholeStage", "true")
|
|
327
|
+
spark.conf.set("spark.sql.execution.arrow.pyspark.enabled", "true")
|
|
328
|
+
|
|
329
|
+
# Explain query plan
|
|
330
|
+
df.explain(mode="extended")
|
|
331
|
+
# Modes: simple, extended, codegen, cost, formatted
|
|
332
|
+
|
|
333
|
+
# Get physical plan statistics
|
|
334
|
+
df.explain(mode="cost")
|
|
335
|
+
|
|
336
|
+
# Monitor task metrics
|
|
337
|
+
def analyze_stage_metrics(spark):
|
|
338
|
+
"""Analyze recent stage metrics"""
|
|
339
|
+
status_tracker = spark.sparkContext.statusTracker()
|
|
340
|
+
|
|
341
|
+
for stage_id in status_tracker.getActiveStageIds():
|
|
342
|
+
stage_info = status_tracker.getStageInfo(stage_id)
|
|
343
|
+
print(f"Stage {stage_id}:")
|
|
344
|
+
print(f" Tasks: {stage_info.numTasks}")
|
|
345
|
+
print(f" Completed: {stage_info.numCompletedTasks}")
|
|
346
|
+
print(f" Failed: {stage_info.numFailedTasks}")
|
|
347
|
+
|
|
348
|
+
# Identify data skew
|
|
349
|
+
def check_partition_skew(df):
|
|
350
|
+
"""Check for partition skew"""
|
|
351
|
+
partition_counts = (df
|
|
352
|
+
.withColumn("partition_id", F.spark_partition_id())
|
|
353
|
+
.groupBy("partition_id")
|
|
354
|
+
.count()
|
|
355
|
+
.orderBy(F.desc("count")))
|
|
356
|
+
|
|
357
|
+
partition_counts.show(20)
|
|
358
|
+
|
|
359
|
+
stats = partition_counts.select(
|
|
360
|
+
F.min("count").alias("min"),
|
|
361
|
+
F.max("count").alias("max"),
|
|
362
|
+
F.avg("count").alias("avg"),
|
|
363
|
+
F.stddev("count").alias("stddev")
|
|
364
|
+
).collect()[0]
|
|
365
|
+
|
|
366
|
+
skew_ratio = stats["max"] / stats["avg"]
|
|
367
|
+
print(f"Skew ratio: {skew_ratio:.2f}x (>2x indicates skew)")
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## Configuration Cheat Sheet
|
|
371
|
+
|
|
372
|
+
```python
|
|
373
|
+
# Production configuration template
|
|
374
|
+
spark_configs = {
|
|
375
|
+
# Adaptive Query Execution (AQE)
|
|
376
|
+
"spark.sql.adaptive.enabled": "true",
|
|
377
|
+
"spark.sql.adaptive.coalescePartitions.enabled": "true",
|
|
378
|
+
"spark.sql.adaptive.skewJoin.enabled": "true",
|
|
379
|
+
|
|
380
|
+
# Memory
|
|
381
|
+
"spark.executor.memory": "8g",
|
|
382
|
+
"spark.executor.memoryOverhead": "2g",
|
|
383
|
+
"spark.memory.fraction": "0.6",
|
|
384
|
+
"spark.memory.storageFraction": "0.5",
|
|
385
|
+
|
|
386
|
+
# Parallelism
|
|
387
|
+
"spark.sql.shuffle.partitions": "200",
|
|
388
|
+
"spark.default.parallelism": "200",
|
|
389
|
+
|
|
390
|
+
# Serialization
|
|
391
|
+
"spark.serializer": "org.apache.spark.serializer.KryoSerializer",
|
|
392
|
+
"spark.sql.execution.arrow.pyspark.enabled": "true",
|
|
393
|
+
|
|
394
|
+
# Compression
|
|
395
|
+
"spark.io.compression.codec": "lz4",
|
|
396
|
+
"spark.shuffle.compress": "true",
|
|
397
|
+
|
|
398
|
+
# Broadcast
|
|
399
|
+
"spark.sql.autoBroadcastJoinThreshold": "50MB",
|
|
400
|
+
|
|
401
|
+
# File handling
|
|
402
|
+
"spark.sql.files.maxPartitionBytes": "128MB",
|
|
403
|
+
"spark.sql.files.openCostInBytes": "4MB",
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
## Best Practices
|
|
408
|
+
|
|
409
|
+
### Do's
|
|
410
|
+
- **Enable AQE** - Adaptive query execution handles many issues
|
|
411
|
+
- **Use Parquet/Delta** - Columnar formats with compression
|
|
412
|
+
- **Broadcast small tables** - Avoid shuffle for small joins
|
|
413
|
+
- **Monitor Spark UI** - Check for skew, spills, GC
|
|
414
|
+
- **Right-size partitions** - 128MB - 256MB per partition
|
|
415
|
+
|
|
416
|
+
### Don'ts
|
|
417
|
+
- **Don't collect large data** - Keep data distributed
|
|
418
|
+
- **Don't use UDFs unnecessarily** - Use built-in functions
|
|
419
|
+
- **Don't over-cache** - Memory is limited
|
|
420
|
+
- **Don't ignore data skew** - It dominates job time
|
|
421
|
+
- **Don't use `.count()` for existence** - Use `.take(1)` or `.isEmpty()`
|
|
422
|
+
|
|
423
|
+
## Resources
|
|
424
|
+
|
|
425
|
+
- [Spark Performance Tuning](https://spark.apache.org/docs/latest/sql-performance-tuning.html)
|
|
426
|
+
- [Spark Configuration](https://spark.apache.org/docs/latest/configuration.html)
|
|
427
|
+
- [Databricks Optimization Guide](https://docs.databricks.com/en/optimizations/index.html)
|