opencode-skills-collection 4.0.53 → 4.0.55
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/bundled-skills/.antigravity-install-manifest.json +3 -2
- package/bundled-skills/00-andruia-consultant/SKILL.md +6 -0
- package/bundled-skills/007/SKILL.md +2 -610
- package/bundled-skills/007/references/detailed-guide.md +647 -0
- package/bundled-skills/10-andruia-skill-smith/SKILL.md +6 -0
- package/bundled-skills/20-andruia-niche-intelligence/SKILL.md +6 -0
- package/bundled-skills/2slides-ppt-generator/SKILL.md +2 -741
- package/bundled-skills/2slides-ppt-generator/references/detailed-guide.md +761 -0
- package/bundled-skills/ab-test-setup/SKILL.md +59 -27
- package/bundled-skills/ab-testing/SKILL.md +1 -1
- package/bundled-skills/acceptance-orchestrator/SKILL.md +6 -0
- package/bundled-skills/accint-commitments/SKILL.md +6 -0
- package/bundled-skills/accint-frames/SKILL.md +6 -0
- package/bundled-skills/accint-solve/SKILL.md +6 -0
- package/bundled-skills/advogado-criminal/SKILL.md +2 -912
- package/bundled-skills/advogado-criminal/references/detailed-guide.md +946 -0
- package/bundled-skills/advogado-especialista/SKILL.md +2 -1071
- package/bundled-skills/advogado-especialista/references/detailed-guide.md +1114 -0
- package/bundled-skills/agent-evaluation/SKILL.md +53 -1102
- package/bundled-skills/agent-evaluation/references/architecture-sketches.md +1112 -0
- package/bundled-skills/agent-memory/SKILL.md +6 -0
- package/bundled-skills/agent-memory-systems/SKILL.md +8 -1042
- package/bundled-skills/agent-memory-systems/references/detailed-guide.md +1088 -0
- package/bundled-skills/agent-squad/SKILL.md +1 -0
- package/bundled-skills/agent-tool-builder/SKILL.md +2 -624
- package/bundled-skills/agent-tool-builder/references/detailed-guide.md +650 -0
- package/bundled-skills/agentic-actions-auditor/SKILL.md +6 -0
- package/bundled-skills/agentmail/SKILL.md +1 -0
- package/bundled-skills/agentphone/SKILL.md +5 -1323
- package/bundled-skills/agentphone/references/detailed-guide.md +1333 -0
- package/bundled-skills/agents-v2-py/SKILL.md +23 -5
- package/bundled-skills/ai-agents-architect/SKILL.md +25 -25
- package/bundled-skills/ai-analyzer/SKILL.md +1 -0
- package/bundled-skills/ai-md/SKILL.md +25 -0
- package/bundled-skills/ai-md/references/detailed-guide.md +512 -0
- package/bundled-skills/ai-product/SKILL.md +2 -726
- package/bundled-skills/ai-product/references/detailed-guide.md +746 -0
- package/bundled-skills/ai-wrapper-product/SKILL.md +2 -641
- package/bundled-skills/ai-wrapper-product/references/detailed-guide.md +659 -0
- package/bundled-skills/airtable-automation/SKILL.md +6 -0
- package/bundled-skills/algolia-search/SKILL.md +2 -893
- package/bundled-skills/algolia-search/references/detailed-guide.md +901 -0
- package/bundled-skills/alpha-vantage/SKILL.md +1 -0
- package/bundled-skills/alternatives-pages/SKILL.md +7 -1
- package/bundled-skills/amazon-alexa/SKILL.md +2 -627
- package/bundled-skills/amazon-alexa/references/detailed-guide.md +644 -0
- package/bundled-skills/analytics/SKILL.md +1 -1
- package/bundled-skills/analytics-product/SKILL.md +57 -44
- package/bundled-skills/analytics-tracking/SKILL.md +21 -12
- package/bundled-skills/analyze-project/SKILL.md +1 -0
- package/bundled-skills/android-dev/SKILL.md +2 -490
- package/bundled-skills/android-dev/references/detailed-guide.md +506 -0
- package/bundled-skills/angular/SKILL.md +4 -783
- package/bundled-skills/angular/references/detailed-guide.md +801 -0
- package/bundled-skills/angular-best-practices/SKILL.md +4 -535
- package/bundled-skills/angular-best-practices/references/detailed-guide.md +549 -0
- package/bundled-skills/angular-state-management/SKILL.md +4 -608
- package/bundled-skills/angular-state-management/references/detailed-guide.md +618 -0
- package/bundled-skills/angular-ui-patterns/SKILL.md +2 -498
- package/bundled-skills/angular-ui-patterns/references/detailed-guide.md +513 -0
- package/bundled-skills/animejs-animation/SKILL.md +6 -0
- package/bundled-skills/anti-deception/SKILL.md +7 -1
- package/bundled-skills/antigravity-design-expert/SKILL.md +6 -0
- package/bundled-skills/antigravity-maintainer-batch-release/SKILL.md +16 -0
- package/bundled-skills/antigravity-workflows/SKILL.md +20 -3
- package/bundled-skills/antigravity-workflows/references/workflow-cards.md +78 -0
- package/bundled-skills/api-analyzer/SKILL.md +1 -1
- package/bundled-skills/api-designer/SKILL.md +1 -1
- package/bundled-skills/api-integration/SKILL.md +1 -1
- package/bundled-skills/api-onboarding/SKILL.md +1 -1
- package/bundled-skills/api-patterns/SKILL.md +19 -8
- package/bundled-skills/api-patterns/api-style.md +2 -2
- package/bundled-skills/api-patterns/auth.md +3 -2
- package/bundled-skills/api-patterns/graphql.md +1 -1
- package/bundled-skills/api-patterns/scripts/api_validator.py +9 -7
- package/bundled-skills/api-patterns/trpc.md +2 -2
- package/bundled-skills/api-patterns/versioning.md +1 -1
- package/bundled-skills/api-sdk-generator/SKILL.md +1 -1
- package/bundled-skills/api-security-best-practices/SKILL.md +179 -879
- package/bundled-skills/apify-actor-development/SKILL.md +1 -0
- package/bundled-skills/apify-actorization/SKILL.md +1 -0
- package/bundled-skills/apify-audience-analysis/SKILL.md +1 -0
- package/bundled-skills/apify-brand-reputation-monitoring/SKILL.md +1 -0
- package/bundled-skills/apify-competitor-intelligence/SKILL.md +1 -0
- package/bundled-skills/apify-content-analytics/SKILL.md +1 -0
- package/bundled-skills/apify-ecommerce/SKILL.md +1 -0
- package/bundled-skills/apify-influencer-discovery/SKILL.md +1 -0
- package/bundled-skills/apify-lead-generation/SKILL.md +1 -0
- package/bundled-skills/apify-market-research/SKILL.md +1 -0
- package/bundled-skills/apify-trend-analysis/SKILL.md +1 -0
- package/bundled-skills/apify-ultimate-scraper/SKILL.md +1 -0
- package/bundled-skills/appium-skill/SKILL.md +1 -1
- package/bundled-skills/apple-notes-search/SKILL.md +6 -0
- package/bundled-skills/application-performance-performance-optimization/SKILL.md +6 -0
- package/bundled-skills/applicationinsights-web-ts/SKILL.md +1 -1
- package/bundled-skills/ask-matt/SKILL.md +5 -0
- package/bundled-skills/ask-questions-if-underspecified/SKILL.md +1 -0
- package/bundled-skills/astropy/SKILL.md +1 -0
- package/bundled-skills/atlas-contract/SKILL.md +117 -0
- package/bundled-skills/atlas-contract/references/detailed-guide.md +572 -0
- package/bundled-skills/audio-transcriber/SKILL.md +2 -425
- package/bundled-skills/audio-transcriber/references/detailed-guide.md +430 -0
- package/bundled-skills/audit-context-building/SKILL.md +1 -0
- package/bundled-skills/auri-core/SKILL.md +5 -562
- package/bundled-skills/auri-core/references/detailed-guide.md +623 -0
- package/bundled-skills/auth-implementation-patterns/SKILL.md +14 -4
- package/bundled-skills/auth-implementation-patterns/resources/implementation-playbook.md +72 -180
- package/bundled-skills/automated-triage/SKILL.md +6 -0
- package/bundled-skills/autonomous-agent-patterns/SKILL.md +4 -741
- package/bundled-skills/autonomous-agent-patterns/references/detailed-guide.md +751 -0
- package/bundled-skills/autonomous-agents/SKILL.md +8 -1010
- package/bundled-skills/autonomous-agents/references/detailed-guide.md +1065 -0
- package/bundled-skills/awareness-stage-mapper/SKILL.md +6 -0
- package/bundled-skills/aws-agentic-ai/SKILL.md +7 -1
- package/bundled-skills/aws-cdk-development/SKILL.md +1 -1
- package/bundled-skills/aws-cost-operations/SKILL.md +1 -1
- package/bundled-skills/aws-mcp-setup/SKILL.md +1 -1
- package/bundled-skills/aws-serverless/SKILL.md +2 -1305
- package/bundled-skills/aws-serverless/references/detailed-guide.md +1340 -0
- package/bundled-skills/aws-serverless-eda/SKILL.md +1 -1
- package/bundled-skills/aws-skills/SKILL.md +6 -0
- package/bundled-skills/aws-sst-development/SKILL.md +7 -1
- package/bundled-skills/awt-e2e-testing/SKILL.md +7 -0
- package/bundled-skills/azure-functions/SKILL.md +2 -1321
- package/bundled-skills/azure-functions/references/detailed-guide.md +1356 -0
- package/bundled-skills/azure-maps-search-dotnet/SKILL.md +2 -482
- package/bundled-skills/azure-maps-search-dotnet/references/detailed-guide.md +496 -0
- package/bundled-skills/azure-search-documents-py/SKILL.md +2 -515
- package/bundled-skills/azure-search-documents-py/references/detailed-guide.md +548 -0
- package/bundled-skills/azure-storage-file-share-ts/SKILL.md +2 -481
- package/bundled-skills/azure-storage-file-share-ts/references/detailed-guide.md +500 -0
- package/bundled-skills/azure-storage-queue-ts/SKILL.md +2 -512
- package/bundled-skills/azure-storage-queue-ts/references/detailed-guide.md +530 -0
- package/bundled-skills/backend-development-feature-development/SKILL.md +6 -0
- package/bundled-skills/backend-security-coder/resources/implementation-playbook.md +23 -0
- package/bundled-skills/basecamp-automation/SKILL.md +6 -0
- package/bundled-skills/baseline-ui/SKILL.md +6 -0
- package/bundled-skills/bash-pro/SKILL.md +6 -0
- package/bundled-skills/bdi-mental-states/SKILL.md +1 -0
- package/bundled-skills/beautiful-prose/SKILL.md +1 -0
- package/bundled-skills/bill-gates/SKILL.md +2 -778
- package/bundled-skills/bill-gates/references/detailed-guide.md +784 -0
- package/bundled-skills/biopython/SKILL.md +1 -0
- package/bundled-skills/bitbucket-automation/SKILL.md +6 -0
- package/bundled-skills/blog-writing-guide/SKILL.md +6 -0
- package/bundled-skills/box-automation/SKILL.md +6 -0
- package/bundled-skills/brain-to-docs/SKILL.md +6 -0
- package/bundled-skills/brainstorming/SKILL.md +6 -0
- package/bundled-skills/brand-guidelines/SKILL.md +1 -0
- package/bundled-skills/brand-guidelines-anthropic/SKILL.md +23 -8
- package/bundled-skills/brand-guidelines-community/SKILL.md +23 -8
- package/bundled-skills/brand-perception-psychologist/SKILL.md +6 -0
- package/bundled-skills/brooks-audit/SKILL.md +1 -1
- package/bundled-skills/brooks-debt/SKILL.md +1 -1
- package/bundled-skills/brooks-harness/SKILL.md +1 -1
- package/bundled-skills/brooks-review/SKILL.md +7 -1
- package/bundled-skills/brooks-sweep/SKILL.md +1 -1
- package/bundled-skills/brooks-test/SKILL.md +1 -1
- package/bundled-skills/browser-automation/SKILL.md +18 -1044
- package/bundled-skills/browser-automation/references/detailed-guide.md +852 -0
- package/bundled-skills/bug-hunt-swarm/SKILL.md +7 -1
- package/bundled-skills/build/SKILL.md +5 -627
- package/bundled-skills/build/references/detailed-guide.md +637 -0
- package/bundled-skills/bun-development/SKILL.md +4 -678
- package/bundled-skills/bun-development/references/detailed-guide.md +691 -0
- package/bundled-skills/burpsuite-project-parser/SKILL.md +1 -0
- package/bundled-skills/business-analyst/resources/implementation-playbook.md +23 -0
- package/bundled-skills/c-pro/SKILL.md +6 -0
- package/bundled-skills/calendly-automation/SKILL.md +6 -0
- package/bundled-skills/cc-skill-backend-patterns/SKILL.md +2 -572
- package/bundled-skills/cc-skill-backend-patterns/references/detailed-guide.md +584 -0
- package/bundled-skills/cc-skill-coding-standards/SKILL.md +2 -510
- package/bundled-skills/cc-skill-coding-standards/references/detailed-guide.md +523 -0
- package/bundled-skills/cc-skill-continuous-learning/SKILL.md +49 -7
- package/bundled-skills/cc-skill-continuous-learning/config.json +1 -16
- package/bundled-skills/cc-skill-continuous-learning/evaluate-session.sh +56 -59
- package/bundled-skills/cc-skill-frontend-patterns/SKILL.md +2 -621
- package/bundled-skills/cc-skill-frontend-patterns/references/detailed-guide.md +633 -0
- package/bundled-skills/cc-skill-security-review/SKILL.md +4 -36
- package/bundled-skills/cc-skill-security-review/references/detailed-guide.md +40 -0
- package/bundled-skills/cc-skill-strategic-compact/SKILL.md +53 -7
- package/bundled-skills/cc-skill-strategic-compact/suggest-compact.sh +20 -51
- package/bundled-skills/changelog-updates/SKILL.md +6 -528
- package/bundled-skills/changelog-updates/references/detailed-guide.md +540 -0
- package/bundled-skills/chat-widget/SKILL.md +5 -879
- package/bundled-skills/chat-widget/references/detailed-guide.md +890 -0
- package/bundled-skills/cirq/SKILL.md +1 -0
- package/bundled-skills/citation-management/SKILL.md +3 -960
- package/bundled-skills/citation-management/references/detailed-guide.md +975 -0
- package/bundled-skills/ckw-design/SKILL.md +6 -0
- package/bundled-skills/claimable-postgres/SKILL.md +1 -1
- package/bundled-skills/clarity-gate/SKILL.md +3 -635
- package/bundled-skills/clarity-gate/references/detailed-guide.md +653 -0
- package/bundled-skills/claude-ally-health/SKILL.md +6 -0
- package/bundled-skills/claude-code-expert/SKILL.md +2 -527
- package/bundled-skills/claude-code-expert/references/detailed-guide.md +548 -0
- package/bundled-skills/claude-d3js-skill/SKILL.md +2 -798
- package/bundled-skills/claude-d3js-skill/references/detailed-guide.md +811 -0
- package/bundled-skills/claude-in-chrome-troubleshooting/SKILL.md +1 -0
- package/bundled-skills/claude-scientific-skills/SKILL.md +6 -0
- package/bundled-skills/claude-settings-audit/SKILL.md +1 -0
- package/bundled-skills/claude-speed-reader/SKILL.md +6 -0
- package/bundled-skills/claude-win11-speckit-update-skill/SKILL.md +6 -0
- package/bundled-skills/clean-code/SKILL.md +6 -0
- package/bundled-skills/clerk-auth/SKILL.md +2 -812
- package/bundled-skills/clerk-auth/references/detailed-guide.md +820 -0
- package/bundled-skills/clickup-automation/SKILL.md +6 -0
- package/bundled-skills/closed-loop-delivery/SKILL.md +6 -0
- package/bundled-skills/co-marketing/SKILL.md +1 -1
- package/bundled-skills/code-documentation-doc-generate/SKILL.md +16 -1
- package/bundled-skills/code-documentation-doc-generate/resources/implementation-playbook.md +33 -55
- package/bundled-skills/code-refactoring-context-restore/SKILL.md +40 -177
- package/bundled-skills/code-refactoring-tech-debt/SKILL.md +20 -9
- package/bundled-skills/code-simplifier/SKILL.md +1 -0
- package/bundled-skills/codebase-cleanup-tech-debt/SKILL.md +20 -9
- package/bundled-skills/cold-email/SKILL.md +6 -0
- package/bundled-skills/commit/SKILL.md +1 -0
- package/bundled-skills/community-building/SKILL.md +1 -1
- package/bundled-skills/competitor-alternatives/SKILL.md +2 -740
- package/bundled-skills/competitor-alternatives/references/detailed-guide.md +756 -0
- package/bundled-skills/competitor-profiling/SKILL.md +1 -1
- package/bundled-skills/competitor-tracking/SKILL.md +1 -1
- package/bundled-skills/comprehensive-review-full-review/SKILL.md +6 -0
- package/bundled-skills/comprehensive-review-pr-enhance/SKILL.md +1 -0
- package/bundled-skills/computer-use-agents/SKILL.md +2 -2131
- package/bundled-skills/computer-use-agents/references/detailed-guide.md +2158 -0
- package/bundled-skills/computer-vision-expert/SKILL.md +6 -0
- package/bundled-skills/conductor-setup/SKILL.md +1 -0
- package/bundled-skills/confluence-automation/SKILL.md +6 -0
- package/bundled-skills/constant-time-analysis/SKILL.md +1 -0
- package/bundled-skills/container-security-hardening/SKILL.md +4 -915
- package/bundled-skills/container-security-hardening/references/detailed-guide.md +927 -0
- package/bundled-skills/content-creator/SKILL.md +53 -23
- package/bundled-skills/content-creator/assets/content_calendar_template.md +5 -2
- package/bundled-skills/content-creator/references/brand_guidelines.md +7 -3
- package/bundled-skills/content-creator/references/content_frameworks.md +12 -7
- package/bundled-skills/content-creator/references/social_media_optimization.md +61 -317
- package/bundled-skills/content-creator/scripts/brand_voice_analyzer.py +14 -9
- package/bundled-skills/content-creator/scripts/seo_optimizer.py +31 -94
- package/bundled-skills/context-compression/SKILL.md +1 -0
- package/bundled-skills/context-degradation/SKILL.md +1 -0
- package/bundled-skills/context-fundamentals/SKILL.md +1 -0
- package/bundled-skills/context-management-context-restore/SKILL.md +40 -177
- package/bundled-skills/context-optimization/SKILL.md +1 -0
- package/bundled-skills/convex/SKILL.md +4 -766
- package/bundled-skills/convex/references/detailed-guide.md +772 -0
- package/bundled-skills/copilot-sdk/SKILL.md +4 -496
- package/bundled-skills/copilot-sdk/references/detailed-guide.md +516 -0
- package/bundled-skills/copy-editing/SKILL.md +6 -0
- package/bundled-skills/copywriting/SKILL.md +6 -0
- package/bundled-skills/copywriting-psychologist/SKILL.md +6 -0
- package/bundled-skills/create-branch/SKILL.md +1 -0
- package/bundled-skills/create-pr/SKILL.md +7 -0
- package/bundled-skills/cred-omega/SKILL.md +2 -847
- package/bundled-skills/cred-omega/references/detailed-guide.md +872 -0
- package/bundled-skills/cro/SKILL.md +1 -1
- package/bundled-skills/csharp-pro/SKILL.md +6 -0
- package/bundled-skills/cucumber-skill/SKILL.md +1 -1
- package/bundled-skills/customer-psychographic-profiler/SKILL.md +6 -0
- package/bundled-skills/customer-research/SKILL.md +1 -1
- package/bundled-skills/cv-generator/SKILL.md +4 -828
- package/bundled-skills/cv-generator/references/detailed-guide.md +845 -0
- package/bundled-skills/cypress-skill/SKILL.md +1 -1
- package/bundled-skills/daily-gift/SKILL.md +6 -0
- package/bundled-skills/debug-buttercup/SKILL.md +1 -0
- package/bundled-skills/debugger/SKILL.md +6 -0
- package/bundled-skills/debugging-code/SKILL.md +1 -1
- package/bundled-skills/deepapi/SKILL.md +4 -619
- package/bundled-skills/deepapi/references/detailed-guide.md +627 -0
- package/bundled-skills/delegating-to-agents/SKILL.md +6 -0
- package/bundled-skills/deployment-validation-config-validate/SKILL.md +4 -478
- package/bundled-skills/deployment-validation-config-validate/references/detailed-guide.md +484 -0
- package/bundled-skills/design-it/SKILL.md +6 -0
- package/bundled-skills/design-orchestration/SKILL.md +6 -0
- package/bundled-skills/design-spells/SKILL.md +6 -0
- package/bundled-skills/design-system/SKILL.md +7 -1
- package/bundled-skills/design-taste-frontend/SKILL.md +6 -0
- package/bundled-skills/design-thinking/SKILL.md +6 -0
- package/bundled-skills/design-ux/SKILL.md +7 -1
- package/bundled-skills/deterministic-design/SKILL.md +6 -0
- package/bundled-skills/developer-advocacy/SKILL.md +1 -1
- package/bundled-skills/developer-audience-context/SKILL.md +1 -1
- package/bundled-skills/developer-churn/SKILL.md +5 -625
- package/bundled-skills/developer-churn/references/detailed-guide.md +639 -0
- package/bundled-skills/developer-listening/SKILL.md +7 -1
- package/bundled-skills/developer-onboarding/SKILL.md +6 -474
- package/bundled-skills/developer-onboarding/references/detailed-guide.md +486 -0
- package/bundled-skills/developer-sandbox/SKILL.md +6 -414
- package/bundled-skills/developer-sandbox/references/detailed-guide.md +425 -0
- package/bundled-skills/developer-seo/SKILL.md +1 -1
- package/bundled-skills/developer-signup-flow/SKILL.md +1 -1
- package/bundled-skills/devops-troubleshooter/resources/implementation-playbook.md +23 -0
- package/bundled-skills/devrel-content/SKILL.md +1 -1
- package/bundled-skills/diagnosing-bugs/SKILL.md +5 -0
- package/bundled-skills/diary/SKILL.md +1 -0
- package/bundled-skills/differential-review/SKILL.md +1 -0
- package/bundled-skills/discord-automation/SKILL.md +6 -0
- package/bundled-skills/discord-bot-architect/SKILL.md +2 -1434
- package/bundled-skills/discord-bot-architect/references/detailed-guide.md +1465 -0
- package/bundled-skills/distributed-tracing/SKILL.md +22 -435
- package/bundled-skills/distributed-tracing/references/instrumentation.md +13 -0
- package/bundled-skills/distributed-tracing/references/jaeger-setup.md +13 -0
- package/bundled-skills/distributed-tracing/resources/implementation-playbook.md +23 -0
- package/bundled-skills/django-access-review/SKILL.md +1 -0
- package/bundled-skills/django-perf-review/SKILL.md +1 -0
- package/bundled-skills/django-pro/resources/implementation-playbook.md +23 -0
- package/bundled-skills/doc-coauthoring/SKILL.md +6 -0
- package/bundled-skills/docs-architect/SKILL.md +6 -0
- package/bundled-skills/docs-as-marketing/SKILL.md +1 -1
- package/bundled-skills/documentation-generation-doc-generate/SKILL.md +16 -1
- package/bundled-skills/documentation-generation-doc-generate/resources/implementation-playbook.md +33 -55
- package/bundled-skills/doubt-driven-development/SKILL.md +1 -1
- package/bundled-skills/dropbox-automation/SKILL.md +6 -0
- package/bundled-skills/dwarf-expert/SKILL.md +1 -0
- package/bundled-skills/dx-optimizer/SKILL.md +6 -0
- package/bundled-skills/e2e-testing-patterns/SKILL.md +14 -4
- package/bundled-skills/e2e-testing-patterns/resources/implementation-playbook.md +22 -41
- package/bundled-skills/eas-update-insights/SKILL.md +1 -1
- package/bundled-skills/ecl-harness-engineer/SKILL.md +4 -681
- package/bundled-skills/ecl-harness-engineer/references/detailed-guide.md +691 -0
- package/bundled-skills/efficient-web-research/SKILL.md +1 -0
- package/bundled-skills/electron-development/SKILL.md +4 -820
- package/bundled-skills/electron-development/references/detailed-guide.md +828 -0
- package/bundled-skills/elixir-pro/SKILL.md +6 -0
- package/bundled-skills/elon-musk/SKILL.md +5 -1278
- package/bundled-skills/elon-musk/references/detailed-guide.md +1293 -0
- package/bundled-skills/email-sequence/SKILL.md +2 -915
- package/bundled-skills/email-sequence/references/detailed-guide.md +932 -0
- package/bundled-skills/email-systems/SKILL.md +2 -654
- package/bundled-skills/email-systems/references/detailed-guide.md +669 -0
- package/bundled-skills/embedding-strategies/SKILL.md +40 -64
- package/bundled-skills/embedding-strategies/resources/implementation-playbook.md +23 -0
- package/bundled-skills/emergency-card/SKILL.md +1 -0
- package/bundled-skills/emil-design-eng/SKILL.md +4 -673
- package/bundled-skills/emil-design-eng/references/detailed-guide.md +690 -0
- package/bundled-skills/emotional-arc-designer/SKILL.md +6 -0
- package/bundled-skills/enhance-prompt/SKILL.md +1 -0
- package/bundled-skills/error-debugging-error-analysis/SKILL.md +15 -0
- package/bundled-skills/error-debugging-error-analysis/resources/implementation-playbook.md +122 -1125
- package/bundled-skills/error-debugging-multi-agent-review/SKILL.md +42 -214
- package/bundled-skills/error-detective/SKILL.md +6 -0
- package/bundled-skills/error-diagnostics-error-analysis/SKILL.md +15 -0
- package/bundled-skills/error-diagnostics-error-analysis/resources/implementation-playbook.md +122 -1125
- package/bundled-skills/event-sourcing-architect/SKILL.md +6 -0
- package/bundled-skills/event-staffing-compliance/SKILL.md +6 -0
- package/bundled-skills/event-staffing-ordering/SKILL.md +6 -0
- package/bundled-skills/evolution/SKILL.md +1 -0
- package/bundled-skills/executing-plans/SKILL.md +6 -0
- package/bundled-skills/explain-like-socrates/SKILL.md +6 -0
- package/bundled-skills/expo-deployment/SKILL.md +1 -1
- package/bundled-skills/expo-examples/SKILL.md +1 -1
- package/bundled-skills/expo-module/SKILL.md +1 -1
- package/bundled-skills/expo-observe/SKILL.md +1 -1
- package/bundled-skills/expo-ui/SKILL.md +1 -1
- package/bundled-skills/expo-ui-jetpack-compose/SKILL.md +1 -0
- package/bundled-skills/expo-ui-swift-ui/SKILL.md +1 -0
- package/bundled-skills/fable-safe-prompt/SKILL.md +6 -0
- package/bundled-skills/fal-audio/SKILL.md +6 -0
- package/bundled-skills/fal-generate/SKILL.md +6 -0
- package/bundled-skills/fal-image-edit/SKILL.md +6 -0
- package/bundled-skills/fal-platform/SKILL.md +6 -0
- package/bundled-skills/fal-upscale/SKILL.md +6 -0
- package/bundled-skills/fal-workflow/SKILL.md +6 -0
- package/bundled-skills/family-health-analyzer/SKILL.md +1 -0
- package/bundled-skills/fastapi-pro/resources/implementation-playbook.md +23 -0
- package/bundled-skills/favicon/SKILL.md +1 -0
- package/bundled-skills/fda-food-safety-auditor/SKILL.md +1 -0
- package/bundled-skills/fda-medtech-compliance-auditor/SKILL.md +1 -0
- package/bundled-skills/ffuf-claude-skill/SKILL.md +6 -0
- package/bundled-skills/ffuf-web-fuzzing/SKILL.md +5 -492
- package/bundled-skills/ffuf-web-fuzzing/references/detailed-guide.md +510 -0
- package/bundled-skills/file-organizer/SKILL.md +6 -0
- package/bundled-skills/file-uploads/SKILL.md +6 -0
- package/bundled-skills/filesystem-context/SKILL.md +1 -0
- package/bundled-skills/find-bugs/SKILL.md +7 -0
- package/bundled-skills/find-complementary-founders/scripts/assess_profile.py +7 -1
- package/bundled-skills/firebase/SKILL.md +8 -651
- package/bundled-skills/firebase/references/detailed-guide.md +662 -0
- package/bundled-skills/fitness-analyzer/SKILL.md +1 -0
- package/bundled-skills/fix-review/SKILL.md +6 -0
- package/bundled-skills/fixing-metadata/SKILL.md +7 -1
- package/bundled-skills/food-database-query/SKILL.md +5 -772
- package/bundled-skills/food-database-query/references/detailed-guide.md +785 -0
- package/bundled-skills/form-cro/SKILL.md +6 -0
- package/bundled-skills/fp-async/SKILL.md +5 -716
- package/bundled-skills/fp-async/references/detailed-guide.md +726 -0
- package/bundled-skills/fp-backend/SKILL.md +5 -1313
- package/bundled-skills/fp-backend/references/detailed-guide.md +1323 -0
- package/bundled-skills/fp-data-transforms/SKILL.md +5 -1181
- package/bundled-skills/fp-data-transforms/references/detailed-guide.md +1190 -0
- package/bundled-skills/fp-either-ref/SKILL.md +1 -0
- package/bundled-skills/fp-errors/SKILL.md +5 -835
- package/bundled-skills/fp-errors/references/detailed-guide.md +846 -0
- package/bundled-skills/fp-option-ref/SKILL.md +1 -0
- package/bundled-skills/fp-pipe-ref/SKILL.md +1 -0
- package/bundled-skills/fp-pragmatic/SKILL.md +5 -500
- package/bundled-skills/fp-pragmatic/references/detailed-guide.md +510 -0
- package/bundled-skills/fp-react/SKILL.md +3 -761
- package/bundled-skills/fp-react/references/detailed-guide.md +775 -0
- package/bundled-skills/fp-refactor/SKILL.md +5 -1761
- package/bundled-skills/fp-refactor/references/detailed-guide.md +1775 -0
- package/bundled-skills/fp-taskeither-ref/SKILL.md +1 -0
- package/bundled-skills/fp-ts-errors/SKILL.md +4 -835
- package/bundled-skills/fp-ts-errors/references/detailed-guide.md +846 -0
- package/bundled-skills/fp-ts-pragmatic/SKILL.md +4 -500
- package/bundled-skills/fp-ts-pragmatic/references/detailed-guide.md +510 -0
- package/bundled-skills/fp-ts-react/SKILL.md +4 -763
- package/bundled-skills/fp-ts-react/references/detailed-guide.md +775 -0
- package/bundled-skills/fp-types-ref/SKILL.md +1 -0
- package/bundled-skills/framework-migration-legacy-modernize/SKILL.md +6 -0
- package/bundled-skills/free-tool-strategy/SKILL.md +2 -532
- package/bundled-skills/free-tool-strategy/references/detailed-guide.md +550 -0
- package/bundled-skills/freshdesk-automation/SKILL.md +6 -0
- package/bundled-skills/frontend-architecture/SKILL.md +1 -1
- package/bundled-skills/frontend-data-contracts/SKILL.md +1 -1
- package/bundled-skills/frontend-design/SKILL.md +33 -34
- package/bundled-skills/frontend-observability/SKILL.md +1 -1
- package/bundled-skills/frontend-optimistic-mutations/SKILL.md +1 -1
- package/bundled-skills/frontend-security-coder/SKILL.md +5 -5
- package/bundled-skills/frontend-security-coder/resources/implementation-playbook.md +23 -0
- package/bundled-skills/frontend-seo/SKILL.md +6 -675
- package/bundled-skills/frontend-seo/references/detailed-guide.md +688 -0
- package/bundled-skills/frontend-slides-frontend-slides/SKILL.md +7 -1
- package/bundled-skills/frontend-ui-dark-ts/SKILL.md +2 -561
- package/bundled-skills/frontend-ui-dark-ts/references/detailed-guide.md +573 -0
- package/bundled-skills/full-stack-orchestration-full-stack-feature/SKILL.md +6 -0
- package/bundled-skills/game-development/2d-games/SKILL.md +6 -0
- package/bundled-skills/game-development/mobile-games/SKILL.md +6 -0
- package/bundled-skills/game-development/vr-ar/SKILL.md +6 -0
- package/bundled-skills/gcp-cloud-run/SKILL.md +2 -1303
- package/bundled-skills/gcp-cloud-run/references/detailed-guide.md +1350 -0
- package/bundled-skills/gemini-api-dev/SKILL.md +1 -1
- package/bundled-skills/gemini-live-api-dev/SKILL.md +1 -1
- package/bundled-skills/gemini-omni-flash-api/SKILL.md +1 -1
- package/bundled-skills/geo-fundamentals/SKILL.md +6 -0
- package/bundled-skills/geoffrey-hinton/SKILL.md +5 -1235
- package/bundled-skills/geoffrey-hinton/references/detailed-guide.md +1324 -0
- package/bundled-skills/gh-review-requests/SKILL.md +1 -0
- package/bundled-skills/github-actions-advanced/SKILL.md +4 -971
- package/bundled-skills/github-actions-advanced/references/detailed-guide.md +991 -0
- package/bundled-skills/github-actions-templates/SKILL.md +34 -314
- package/bundled-skills/github-actions-templates/references/common-workflows.md +13 -0
- package/bundled-skills/github-actions-templates/resources/implementation-playbook.md +23 -0
- package/bundled-skills/github-automation/SKILL.md +6 -0
- package/bundled-skills/github-workflow-automation/SKILL.md +4 -826
- package/bundled-skills/github-workflow-automation/references/detailed-guide.md +832 -0
- package/bundled-skills/gitlab-automation/SKILL.md +6 -0
- package/bundled-skills/gmail-automation/SKILL.md +1 -0
- package/bundled-skills/go-rod-master/SKILL.md +2 -496
- package/bundled-skills/go-rod-master/references/detailed-guide.md +508 -0
- package/bundled-skills/goal-analyzer/SKILL.md +5 -596
- package/bundled-skills/goal-analyzer/references/detailed-guide.md +602 -0
- package/bundled-skills/google-calendar-automation/SKILL.md +1 -0
- package/bundled-skills/google-docs-automation/SKILL.md +20 -69
- package/bundled-skills/google-drive-automation/SKILL.md +1 -0
- package/bundled-skills/google-sheets-automation/SKILL.md +21 -128
- package/bundled-skills/google-slides-automation/SKILL.md +20 -128
- package/bundled-skills/googlesheets-automation/SKILL.md +6 -0
- package/bundled-skills/gpt-taste/SKILL.md +6 -0
- package/bundled-skills/grafana-dashboards/SKILL.md +6 -6
- package/bundled-skills/grafana-dashboards/references/dashboard-design.md +13 -0
- package/bundled-skills/grafana-dashboards/resources/implementation-playbook.md +23 -0
- package/bundled-skills/graphql/SKILL.md +8 -1031
- package/bundled-skills/graphql/references/detailed-guide.md +1044 -0
- package/bundled-skills/grill-me/SKILL.md +5 -0
- package/bundled-skills/grill-with-docs/SKILL.md +5 -0
- package/bundled-skills/grilling/SKILL.md +5 -0
- package/bundled-skills/growth-engine/SKILL.md +6 -0
- package/bundled-skills/handoff/SKILL.md +5 -0
- package/bundled-skills/haskell-pro/SKILL.md +6 -0
- package/bundled-skills/headline-psychologist/SKILL.md +6 -0
- package/bundled-skills/health-trend-analyzer/SKILL.md +1 -0
- package/bundled-skills/hig-components-content/SKILL.md +6 -0
- package/bundled-skills/hig-components-controls/SKILL.md +6 -0
- package/bundled-skills/hig-components-dialogs/SKILL.md +6 -0
- package/bundled-skills/hig-components-layout/SKILL.md +6 -0
- package/bundled-skills/hig-components-menus/SKILL.md +6 -0
- package/bundled-skills/hig-components-search/SKILL.md +6 -0
- package/bundled-skills/hig-components-status/SKILL.md +6 -0
- package/bundled-skills/hig-components-system/SKILL.md +6 -0
- package/bundled-skills/hig-foundations/SKILL.md +6 -0
- package/bundled-skills/hig-inputs/SKILL.md +6 -0
- package/bundled-skills/hig-patterns/SKILL.md +6 -0
- package/bundled-skills/hig-platforms/SKILL.md +6 -0
- package/bundled-skills/hig-technologies/SKILL.md +6 -0
- package/bundled-skills/high-end-visual-design/SKILL.md +6 -0
- package/bundled-skills/hosted-agents/SKILL.md +7 -0
- package/bundled-skills/hosted-agents-v2-py/SKILL.md +23 -5
- package/bundled-skills/html-injection-testing/SKILL.md +2 -453
- package/bundled-skills/html-injection-testing/references/detailed-guide.md +462 -0
- package/bundled-skills/hubspot-automation/SKILL.md +6 -0
- package/bundled-skills/hubspot-integration/SKILL.md +8 -807
- package/bundled-skills/hubspot-integration/references/detailed-guide.md +815 -0
- package/bundled-skills/hugging-face-cli/SKILL.md +7 -1
- package/bundled-skills/hugging-face-community-evals/SKILL.md +1 -1
- package/bundled-skills/hugging-face-datasets/SKILL.md +5 -430
- package/bundled-skills/hugging-face-datasets/references/detailed-guide.md +442 -0
- package/bundled-skills/hugging-face-evaluation/SKILL.md +5 -640
- package/bundled-skills/hugging-face-evaluation/references/detailed-guide.md +652 -0
- package/bundled-skills/hugging-face-jobs/SKILL.md +3 -801
- package/bundled-skills/hugging-face-jobs/references/detailed-guide.md +821 -0
- package/bundled-skills/hugging-face-model-trainer/SKILL.md +3 -681
- package/bundled-skills/hugging-face-model-trainer/references/detailed-guide.md +702 -0
- package/bundled-skills/hugging-face-paper-publisher/SKILL.md +5 -617
- package/bundled-skills/hugging-face-paper-publisher/references/detailed-guide.md +624 -0
- package/bundled-skills/hugging-face-papers/SKILL.md +1 -1
- package/bundled-skills/hugging-face-tool-builder/SKILL.md +1 -0
- package/bundled-skills/hugging-face-trackio/SKILL.md +1 -1
- package/bundled-skills/hugging-face-vision-trainer/SKILL.md +5 -534
- package/bundled-skills/hugging-face-vision-trainer/references/detailed-guide.md +549 -0
- package/bundled-skills/huggingface-best/SKILL.md +1 -1
- package/bundled-skills/huggingface-lora-space-builder/SKILL.md +1 -1
- package/bundled-skills/huggingface-spaces/SKILL.md +1 -1
- package/bundled-skills/huggingface-tool-builder/SKILL.md +1 -1
- package/bundled-skills/huggingface-zerogpu/SKILL.md +1 -1
- package/bundled-skills/hugo-to-markdown/SKILL.md +1 -1
- package/bundled-skills/hyperexecute-skill/SKILL.md +7 -1
- package/bundled-skills/iconsax-library/SKILL.md +6 -0
- package/bundled-skills/idea-refine/SKILL.md +1 -1
- package/bundled-skills/identity-mirror/SKILL.md +6 -0
- package/bundled-skills/ilya-sutskever/SKILL.md +2 -1126
- package/bundled-skills/ilya-sutskever/references/detailed-guide.md +1167 -0
- package/bundled-skills/image-generator/SKILL.md +4 -320
- package/bundled-skills/image-generator/references/detailed-guide.md +332 -0
- package/bundled-skills/implement/SKILL.md +6 -0
- package/bundled-skills/incident-responder/SKILL.md +6 -0
- package/bundled-skills/incident-responder/resources/implementation-playbook.md +23 -0
- package/bundled-skills/incident-response-incident-response/SKILL.md +6 -0
- package/bundled-skills/industrial-brutalist-ui/SKILL.md +6 -0
- package/bundled-skills/instagram/scripts/config.py +33 -8
- package/bundled-skills/interactive-portfolio/SKILL.md +2 -482
- package/bundled-skills/interactive-portfolio/references/detailed-guide.md +500 -0
- package/bundled-skills/internal-comms/SKILL.md +20 -1
- package/bundled-skills/internal-comms/examples/3p-updates.md +5 -4
- package/bundled-skills/internal-comms/examples/company-newsletter.md +3 -2
- package/bundled-skills/internal-comms/examples/faq-answers.md +1 -0
- package/bundled-skills/internal-comms/examples/general-comms.md +1 -0
- package/bundled-skills/internal-comms-anthropic/SKILL.md +21 -2
- package/bundled-skills/internal-comms-anthropic/examples/3p-updates.md +5 -4
- package/bundled-skills/internal-comms-anthropic/examples/company-newsletter.md +3 -2
- package/bundled-skills/internal-comms-anthropic/examples/faq-answers.md +1 -0
- package/bundled-skills/internal-comms-anthropic/examples/general-comms.md +1 -0
- package/bundled-skills/internal-comms-community/SKILL.md +21 -2
- package/bundled-skills/internal-comms-community/examples/3p-updates.md +48 -0
- package/bundled-skills/internal-comms-community/examples/company-newsletter.md +66 -0
- package/bundled-skills/internal-comms-community/examples/faq-answers.md +31 -0
- package/bundled-skills/internal-comms-community/examples/general-comms.md +17 -0
- package/bundled-skills/ios-debugger-agent/SKILL.md +6 -0
- package/bundled-skills/ios-developer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/issues/SKILL.md +1 -0
- package/bundled-skills/iterate-pr/SKILL.md +1 -0
- package/bundled-skills/javascript-mastery/SKILL.md +4 -625
- package/bundled-skills/javascript-mastery/references/detailed-guide.md +636 -0
- package/bundled-skills/javascript-pro/SKILL.md +6 -0
- package/bundled-skills/jest-skill/SKILL.md +1 -1
- package/bundled-skills/jira-automation/SKILL.md +6 -0
- package/bundled-skills/jobs-to-be-done-analyst/SKILL.md +6 -0
- package/bundled-skills/junit-5-skill/SKILL.md +1 -1
- package/bundled-skills/junta-leiloeiros/scripts/.snyk +5 -0
- package/bundled-skills/junta-leiloeiros/scripts/requirements.txt +2 -0
- package/bundled-skills/k6-load-testing/SKILL.md +2 -544
- package/bundled-skills/k6-load-testing/references/detailed-guide.md +563 -0
- package/bundled-skills/kaizen/SKILL.md +2 -711
- package/bundled-skills/kaizen/references/detailed-guide.md +720 -0
- package/bundled-skills/kpi-dashboard-design/SKILL.md +7 -67
- package/bundled-skills/kpi-dashboard-design/resources/implementation-playbook.md +23 -0
- package/bundled-skills/kpi-dashboard-design/resources/metric-queries.sql +30 -0
- package/bundled-skills/langfuse/SKILL.md +41 -468
- package/bundled-skills/langgraph/SKILL.md +2 -445
- package/bundled-skills/langgraph/references/detailed-guide.md +455 -0
- package/bundled-skills/laravel-expert/SKILL.md +6 -0
- package/bundled-skills/launch-strategy/SKILL.md +6 -0
- package/bundled-skills/lead-magnets/SKILL.md +6 -0
- package/bundled-skills/learn/SKILL.md +5 -0
- package/bundled-skills/legacy-modernizer/SKILL.md +6 -0
- package/bundled-skills/legal-advisor/SKILL.md +6 -0
- package/bundled-skills/leiloeiro-avaliacao/SKILL.md +2 -469
- package/bundled-skills/leiloeiro-avaliacao/references/detailed-guide.md +503 -0
- package/bundled-skills/leiloeiro-edital/SKILL.md +2 -468
- package/bundled-skills/leiloeiro-edital/references/detailed-guide.md +491 -0
- package/bundled-skills/leiloeiro-mercado/SKILL.md +2 -458
- package/bundled-skills/leiloeiro-mercado/references/detailed-guide.md +488 -0
- package/bundled-skills/leiloeiro-risco/SKILL.md +2 -457
- package/bundled-skills/leiloeiro-risco/references/detailed-guide.md +482 -0
- package/bundled-skills/lesson-generator/SKILL.md +5 -0
- package/bundled-skills/lightning-architecture-review/SKILL.md +6 -0
- package/bundled-skills/lightning-channel-factories/SKILL.md +6 -0
- package/bundled-skills/lightning-factory-explainer/SKILL.md +6 -0
- package/bundled-skills/linear-claude-skill/SKILL.md +4 -502
- package/bundled-skills/linear-claude-skill/references/detailed-guide.md +517 -0
- package/bundled-skills/linkedin-cli/SKILL.md +4 -513
- package/bundled-skills/linkedin-cli/references/detailed-guide.md +520 -0
- package/bundled-skills/lint-and-validate/SKILL.md +17 -39
- package/bundled-skills/lint-and-validate/scripts/lint_runner.py +17 -8
- package/bundled-skills/lint-and-validate/scripts/type_coverage.py +77 -167
- package/bundled-skills/linux-privilege-escalation/SKILL.md +2 -426
- package/bundled-skills/linux-privilege-escalation/references/detailed-guide.md +436 -0
- package/bundled-skills/linux-shell-scripting/SKILL.md +2 -473
- package/bundled-skills/linux-shell-scripting/references/detailed-guide.md +481 -0
- package/bundled-skills/llm-app-patterns/SKILL.md +16 -741
- package/bundled-skills/llm-app-patterns/references/detailed-guide.md +760 -0
- package/bundled-skills/llm-council/SKILL.md +4 -550
- package/bundled-skills/llm-council/references/detailed-guide.md +556 -0
- package/bundled-skills/llm-ops/SKILL.md +6 -0
- package/bundled-skills/local-legal-seo-audit/SKILL.md +6 -0
- package/bundled-skills/logic-diff/SKILL.md +1 -1
- package/bundled-skills/logic-explain/SKILL.md +7 -1
- package/bundled-skills/logic-fix-all/SKILL.md +1 -1
- package/bundled-skills/logic-locate/SKILL.md +1 -1
- package/bundled-skills/logic-review/SKILL.md +1 -1
- package/bundled-skills/loki-mode/SKILL.md +4 -696
- package/bundled-skills/loki-mode/references/detailed-guide.md +717 -0
- package/bundled-skills/longbridge-content/SKILL.md +1 -1
- package/bundled-skills/longbridge-fundamentals/SKILL.md +1 -1
- package/bundled-skills/longbridge-market-data/SKILL.md +1 -1
- package/bundled-skills/lookdev-auto/SKILL.md +6 -0
- package/bundled-skills/loopy/SKILL.md +1 -1
- package/bundled-skills/loss-aversion-designer/SKILL.md +6 -0
- package/bundled-skills/machine-learning-ops-ml-pipeline/SKILL.md +6 -0
- package/bundled-skills/magic-animator/SKILL.md +6 -0
- package/bundled-skills/magic-ui-generator/SKILL.md +6 -0
- package/bundled-skills/mailtrap-setting-up-sending-domain/SKILL.md +6 -0
- package/bundled-skills/makepad-animation/SKILL.md +1 -0
- package/bundled-skills/makepad-basics/SKILL.md +1 -0
- package/bundled-skills/makepad-deployment/SKILL.md +1 -0
- package/bundled-skills/makepad-dsl/SKILL.md +1 -0
- package/bundled-skills/makepad-event-action/SKILL.md +1 -0
- package/bundled-skills/makepad-font/SKILL.md +1 -0
- package/bundled-skills/makepad-layout/SKILL.md +1 -0
- package/bundled-skills/makepad-platform/SKILL.md +1 -0
- package/bundled-skills/makepad-reference/SKILL.md +1 -0
- package/bundled-skills/makepad-shaders/SKILL.md +1 -0
- package/bundled-skills/makepad-skills/SKILL.md +6 -0
- package/bundled-skills/makepad-splash/SKILL.md +1 -0
- package/bundled-skills/makepad-widgets/SKILL.md +1 -0
- package/bundled-skills/manage-skills/SKILL.md +1 -0
- package/bundled-skills/marketing-plan/SKILL.md +1 -1
- package/bundled-skills/matematico-tao/SKILL.md +2 -632
- package/bundled-skills/matematico-tao/references/detailed-guide.md +651 -0
- package/bundled-skills/matplotlib/SKILL.md +1 -0
- package/bundled-skills/maxia/SKILL.md +1 -0
- package/bundled-skills/mcp-builder/SKILL.md +46 -14
- package/bundled-skills/mcp-builder/reference/evaluation.md +69 -226
- package/bundled-skills/mcp-builder/reference/mcp_best_practices.md +8 -5
- package/bundled-skills/mcp-builder/reference/node_mcp_server.md +46 -144
- package/bundled-skills/mcp-builder/reference/python_mcp_server.md +42 -80
- package/bundled-skills/mcp-builder/scripts/connections.py +18 -11
- package/bundled-skills/mcp-builder/scripts/evaluation.py +88 -95
- package/bundled-skills/mcp-builder/scripts/example_evaluation.xml +1 -1
- package/bundled-skills/mcp-builder/scripts/requirements.txt +4 -2
- package/bundled-skills/mental-health-analyzer/SKILL.md +5 -974
- package/bundled-skills/mental-health-analyzer/references/detailed-guide.md +1014 -0
- package/bundled-skills/micro-saas-launcher/SKILL.md +2 -473
- package/bundled-skills/micro-saas-launcher/references/detailed-guide.md +491 -0
- package/bundled-skills/minecraft-bukkit-pro/SKILL.md +6 -0
- package/bundled-skills/minimalist-ui/SKILL.md +6 -0
- package/bundled-skills/moatmri/SKILL.md +6 -0
- package/bundled-skills/mobile-developer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/molykit/SKILL.md +1 -0
- package/bundled-skills/monday-automation/SKILL.md +6 -0
- package/bundled-skills/monopoly/SKILL.md +1 -0
- package/bundled-skills/monopoly/patterns/SKILL.md +1 -0
- package/bundled-skills/monopoly/scale-benchmarks/SKILL.md +1 -0
- package/bundled-skills/monopoly/security-checklist/SKILL.md +6 -0
- package/bundled-skills/monopoly/tech-matrix/SKILL.md +1 -0
- package/bundled-skills/monorepo-architect/SKILL.md +6 -0
- package/bundled-skills/monte-carlo-analyze-root-cause/SKILL.md +1 -1
- package/bundled-skills/monte-carlo-performance-diagnosis/SKILL.md +7 -1
- package/bundled-skills/monte-carlo-validation-notebook/SKILL.md +4 -601
- package/bundled-skills/monte-carlo-validation-notebook/references/detailed-guide.md +613 -0
- package/bundled-skills/moodle-external-api-development/SKILL.md +4 -517
- package/bundled-skills/moodle-external-api-development/references/detailed-guide.md +529 -0
- package/bundled-skills/multi-agent-architect/SKILL.md +1 -0
- package/bundled-skills/multi-agent-brainstorming/SKILL.md +6 -0
- package/bundled-skills/multi-agent-patterns/SKILL.md +1 -0
- package/bundled-skills/multi-platform-apps-multi-platform/SKILL.md +6 -0
- package/bundled-skills/multi-platform-apps-multi-platform/resources/implementation-playbook.md +23 -0
- package/bundled-skills/n8n-code-javascript/SKILL.md +3 -667
- package/bundled-skills/n8n-code-javascript/references/detailed-guide.md +683 -0
- package/bundled-skills/n8n-code-python/SKILL.md +3 -664
- package/bundled-skills/n8n-code-python/references/detailed-guide.md +682 -0
- package/bundled-skills/n8n-expression-syntax/SKILL.md +5 -401
- package/bundled-skills/n8n-expression-syntax/references/detailed-guide.md +416 -0
- package/bundled-skills/n8n-mcp-tools-expert/SKILL.md +5 -485
- package/bundled-skills/n8n-mcp-tools-expert/references/detailed-guide.md +499 -0
- package/bundled-skills/n8n-node-configuration/SKILL.md +5 -775
- package/bundled-skills/n8n-node-configuration/references/detailed-guide.md +789 -0
- package/bundled-skills/n8n-validation-expert/SKILL.md +5 -679
- package/bundled-skills/n8n-validation-expert/references/detailed-guide.md +694 -0
- package/bundled-skills/n8n-workflow-patterns/SKILL.md +1 -0
- package/bundled-skills/nanobanana-ppt-skills/SKILL.md +6 -0
- package/bundled-skills/native-data-fetching/SKILL.md +2 -456
- package/bundled-skills/native-data-fetching/references/detailed-guide.md +465 -0
- package/bundled-skills/neon-ai-gateway/SKILL.md +1 -1
- package/bundled-skills/neon-functions/SKILL.md +1 -1
- package/bundled-skills/neon-object-storage/SKILL.md +1 -1
- package/bundled-skills/neon-postgres/SKILL.md +1 -1
- package/bundled-skills/neon-postgres-branches/SKILL.md +1 -1
- package/bundled-skills/neon-postgres-egress-optimizer/SKILL.md +1 -1
- package/bundled-skills/nerdzao-elite/SKILL.md +6 -0
- package/bundled-skills/nerdzao-elite-gemini-high/SKILL.md +6 -0
- package/bundled-skills/nestjs-expert/SKILL.md +2 -524
- package/bundled-skills/nestjs-expert/references/detailed-guide.md +539 -0
- package/bundled-skills/networkx/SKILL.md +1 -0
- package/bundled-skills/new-rails-project/SKILL.md +7 -0
- package/bundled-skills/newman-cicd-integration/SKILL.md +1 -1
- package/bundled-skills/nika/SKILL.md +1 -0
- package/bundled-skills/nosql-expert/SKILL.md +6 -0
- package/bundled-skills/not-a-vibe-coder/SKILL.md +7 -0
- package/bundled-skills/notebooklm/scripts/config.py +33 -11
- package/bundled-skills/notion-template-business/SKILL.md +2 -505
- package/bundled-skills/notion-template-business/references/detailed-guide.md +523 -0
- package/bundled-skills/nutrition-analyzer/SKILL.md +5 -766
- package/bundled-skills/nutrition-analyzer/references/detailed-guide.md +775 -0
- package/bundled-skills/objection-preemptor/SKILL.md +6 -0
- package/bundled-skills/observability-and-instrumentation/SKILL.md +5 -2
- package/bundled-skills/observability-and-instrumentation/references/observability-checklist.md +13 -0
- package/bundled-skills/observability-engineer/SKILL.md +16 -8
- package/bundled-skills/obsidian-bases/SKILL.md +4 -366
- package/bundled-skills/obsidian-bases/references/detailed-guide.md +380 -0
- package/bundled-skills/occupational-health-analyzer/SKILL.md +1 -0
- package/bundled-skills/odoo-accounting-setup/SKILL.md +1 -0
- package/bundled-skills/odoo-automated-tests/SKILL.md +1 -0
- package/bundled-skills/odoo-backup-strategy/SKILL.md +1 -0
- package/bundled-skills/odoo-docker-deployment/SKILL.md +1 -0
- package/bundled-skills/odoo-ecommerce-configurator/SKILL.md +1 -0
- package/bundled-skills/odoo-edi-connector/SKILL.md +1 -0
- package/bundled-skills/odoo-hr-payroll-setup/SKILL.md +1 -0
- package/bundled-skills/odoo-inventory-optimizer/SKILL.md +1 -0
- package/bundled-skills/odoo-l10n-compliance/SKILL.md +1 -0
- package/bundled-skills/odoo-manufacturing-advisor/SKILL.md +1 -0
- package/bundled-skills/odoo-migration-helper/SKILL.md +1 -0
- package/bundled-skills/odoo-module-developer/SKILL.md +1 -0
- package/bundled-skills/odoo-orm-expert/SKILL.md +1 -0
- package/bundled-skills/odoo-performance-tuner/SKILL.md +1 -0
- package/bundled-skills/odoo-project-timesheet/SKILL.md +1 -0
- package/bundled-skills/odoo-purchase-workflow/SKILL.md +1 -0
- package/bundled-skills/odoo-qweb-templates/SKILL.md +1 -0
- package/bundled-skills/odoo-rpc-api/SKILL.md +1 -0
- package/bundled-skills/odoo-sales-crm-expert/SKILL.md +1 -0
- package/bundled-skills/odoo-security-rules/SKILL.md +1 -0
- package/bundled-skills/odoo-shopify-integration/SKILL.md +1 -0
- package/bundled-skills/odoo-upgrade-advisor/SKILL.md +1 -0
- package/bundled-skills/odoo-woocommerce-bridge/SKILL.md +1 -0
- package/bundled-skills/odoo-xml-views-builder/SKILL.md +1 -0
- package/bundled-skills/odw/SKILL.md +6 -0
- package/bundled-skills/offers/SKILL.md +1 -1
- package/bundled-skills/onboarding/SKILL.md +1 -1
- package/bundled-skills/onboarding-psychologist/SKILL.md +6 -0
- package/bundled-skills/one-drive-automation/SKILL.md +6 -0
- package/bundled-skills/openapi-spec-generator/SKILL.md +1 -1
- package/bundled-skills/oral-health-analyzer/SKILL.md +8 -515
- package/bundled-skills/oral-health-analyzer/references/detailed-guide.md +529 -0
- package/bundled-skills/outlook-automation/SKILL.md +6 -0
- package/bundled-skills/pagespeed-enhancer/SKILL.md +4 -520
- package/bundled-skills/pagespeed-enhancer/references/detailed-guide.md +533 -0
- package/bundled-skills/paid-ads/SKILL.md +2 -541
- package/bundled-skills/paid-ads/references/detailed-guide.md +558 -0
- package/bundled-skills/parallel-search-mcp/SKILL.md +134 -0
- package/bundled-skills/payment-integration/SKILL.md +6 -0
- package/bundled-skills/paywall-upgrade-cro/SKILL.md +2 -560
- package/bundled-skills/paywall-upgrade-cro/references/detailed-guide.md +579 -0
- package/bundled-skills/pci-compliance/SKILL.md +23 -469
- package/bundled-skills/pci-compliance/resources/implementation-playbook.md +23 -0
- package/bundled-skills/performance-testing-review-multi-agent-review/SKILL.md +42 -214
- package/bundled-skills/personal-tool-builder/SKILL.md +2 -688
- package/bundled-skills/personal-tool-builder/references/detailed-guide.md +705 -0
- package/bundled-skills/phase-gated-debugging/SKILL.md +6 -0
- package/bundled-skills/photopea-embedded-editor/SKILL.md +3 -1218
- package/bundled-skills/photopea-embedded-editor/references/detailed-guide.md +1252 -0
- package/bundled-skills/php-pro/SKILL.md +6 -0
- package/bundled-skills/pi-custom-model/SKILL.md +6 -0
- package/bundled-skills/pipedrive-automation/SKILL.md +6 -0
- package/bundled-skills/pitch-psychologist/SKILL.md +6 -0
- package/bundled-skills/plaid-fintech/SKILL.md +8 -829
- package/bundled-skills/plaid-fintech/references/detailed-guide.md +837 -0
- package/bundled-skills/plotly/SKILL.md +1 -0
- package/bundled-skills/polars/SKILL.md +1 -0
- package/bundled-skills/popup-cro/SKILL.md +6 -0
- package/bundled-skills/posix-shell-pro/SKILL.md +6 -0
- package/bundled-skills/postgresql-cli/SKILL.md +1 -1
- package/bundled-skills/postman-collection-generator/SKILL.md +1 -1
- package/bundled-skills/postman-newman-automation/SKILL.md +1 -1
- package/bundled-skills/postman-openapi-converter/SKILL.md +1 -1
- package/bundled-skills/postmortem-writing/SKILL.md +1 -1
- package/bundled-skills/postmortem-writing/resources/implementation-playbook.md +23 -0
- package/bundled-skills/power-user-cultivation/SKILL.md +6 -572
- package/bundled-skills/power-user-cultivation/references/detailed-guide.md +585 -0
- package/bundled-skills/pr-writer/SKILL.md +1 -0
- package/bundled-skills/price-psychology-strategist/SKILL.md +6 -0
- package/bundled-skills/pricing/SKILL.md +1 -1
- package/bundled-skills/privacy-mask/SKILL.md +1 -1
- package/bundled-skills/product-decision-agent/SKILL.md +6 -0
- package/bundled-skills/product-inventor/SKILL.md +2 -627
- package/bundled-skills/product-inventor/references/detailed-guide.md +646 -0
- package/bundled-skills/product-manager/SKILL.md +6 -0
- package/bundled-skills/product-marketing/SKILL.md +1 -1
- package/bundled-skills/production-code-audit/SKILL.md +2 -264
- package/bundled-skills/production-code-audit/references/detailed-guide.md +277 -0
- package/bundled-skills/professional-proofreader/SKILL.md +6 -0
- package/bundled-skills/programmatic-seo/SKILL.md +6 -0
- package/bundled-skills/project-development/SKILL.md +1 -0
- package/bundled-skills/project-skill-audit/SKILL.md +6 -0
- package/bundled-skills/public-relations/SKILL.md +1 -1
- package/bundled-skills/pubmed-database/SKILL.md +1 -0
- package/bundled-skills/push-skill-to-github/SKILL.md +6 -0
- package/bundled-skills/pydantic-models-py/SKILL.md +1 -3
- package/bundled-skills/pypict-skill/SKILL.md +6 -0
- package/bundled-skills/pytest-skill/SKILL.md +1 -1
- package/bundled-skills/qiskit/SKILL.md +1 -0
- package/bundled-skills/quant-analyst/SKILL.md +6 -0
- package/bundled-skills/radix-ui-design-system/SKILL.md +2 -693
- package/bundled-skills/radix-ui-design-system/references/detailed-guide.md +711 -0
- package/bundled-skills/rag-engineer/SKILL.md +6 -0
- package/bundled-skills/rclone-cli/SKILL.md +1 -1
- package/bundled-skills/react-flow-architect/SKILL.md +2 -507
- package/bundled-skills/react-flow-architect/references/detailed-guide.md +517 -0
- package/bundled-skills/react-patterns/SKILL.md +6 -0
- package/bundled-skills/read-all-adrs/SKILL.md +6 -0
- package/bundled-skills/readme/SKILL.md +4 -822
- package/bundled-skills/readme/references/detailed-guide.md +829 -0
- package/bundled-skills/redesign-existing-projects/SKILL.md +6 -0
- package/bundled-skills/redis-cli/SKILL.md +1 -1
- package/bundled-skills/referral-program/SKILL.md +2 -508
- package/bundled-skills/referral-program/references/detailed-guide.md +524 -0
- package/bundled-skills/rehabilitation-analyzer/SKILL.md +5 -629
- package/bundled-skills/rehabilitation-analyzer/references/detailed-guide.md +641 -0
- package/bundled-skills/remotion/SKILL.md +1 -0
- package/bundled-skills/research-prompt/SKILL.md +6 -0
- package/bundled-skills/resolving-merge-conflicts/SKILL.md +6 -0
- package/bundled-skills/review-and-simplify-changes/SKILL.md +7 -1
- package/bundled-skills/review-swarm/SKILL.md +7 -1
- package/bundled-skills/risk-manager/SKILL.md +6 -0
- package/bundled-skills/robius-app-architecture/SKILL.md +1 -0
- package/bundled-skills/robius-event-action/SKILL.md +1 -0
- package/bundled-skills/robius-matrix-integration/SKILL.md +1 -0
- package/bundled-skills/robius-state-management/SKILL.md +1 -0
- package/bundled-skills/robius-widget-patterns/SKILL.md +1 -0
- package/bundled-skills/robot-framework-skill/SKILL.md +1 -1
- package/bundled-skills/ruby-pro/SKILL.md +6 -0
- package/bundled-skills/saga-orchestration/SKILL.md +4 -482
- package/bundled-skills/saga-orchestration/references/detailed-guide.md +491 -0
- package/bundled-skills/sales-automator/SKILL.md +6 -0
- package/bundled-skills/salesforce-development/SKILL.md +2 -985
- package/bundled-skills/salesforce-development/references/detailed-guide.md +994 -0
- package/bundled-skills/sam-altman/SKILL.md +5 -1040
- package/bundled-skills/sam-altman/references/detailed-guide.md +1102 -0
- package/bundled-skills/scala-pro/SKILL.md +6 -0
- package/bundled-skills/scanning-tools/SKILL.md +2 -546
- package/bundled-skills/scanning-tools/references/detailed-guide.md +555 -0
- package/bundled-skills/scanpy/SKILL.md +1 -0
- package/bundled-skills/scarcity-urgency-psychologist/SKILL.md +6 -0
- package/bundled-skills/scientific-writing/SKILL.md +3 -691
- package/bundled-skills/scientific-writing/references/detailed-guide.md +702 -0
- package/bundled-skills/scikit-learn/SKILL.md +3 -462
- package/bundled-skills/scikit-learn/references/detailed-guide.md +475 -0
- package/bundled-skills/scroll-experience/SKILL.md +2 -560
- package/bundled-skills/scroll-experience/references/detailed-guide.md +578 -0
- package/bundled-skills/sdk-dx/SKILL.md +6 -517
- package/bundled-skills/sdk-dx/references/detailed-guide.md +530 -0
- package/bundled-skills/seaborn/SKILL.md +5 -661
- package/bundled-skills/seaborn/references/detailed-guide.md +677 -0
- package/bundled-skills/search-specialist/SKILL.md +6 -0
- package/bundled-skills/secrets-management/SKILL.md +24 -349
- package/bundled-skills/secrets-management/references/github-secrets.md +13 -0
- package/bundled-skills/secrets-management/references/vault-setup.md +13 -0
- package/bundled-skills/security/aws-compliance-checker/SKILL.md +4 -492
- package/bundled-skills/security/aws-compliance-checker/references/detailed-guide.md +502 -0
- package/bundled-skills/security-and-hardening/SKILL.md +8 -6
- package/bundled-skills/security-and-hardening/references/security-checklist.md +13 -0
- package/bundled-skills/security-bluebook-builder/SKILL.md +7 -0
- package/bundled-skills/security-scanning-security-hardening/SKILL.md +6 -0
- package/bundled-skills/security-scanning-security-sast/SKILL.md +2 -463
- package/bundled-skills/security-scanning-security-sast/references/detailed-guide.md +476 -0
- package/bundled-skills/segment-cdp/SKILL.md +8 -822
- package/bundled-skills/segment-cdp/references/detailed-guide.md +830 -0
- package/bundled-skills/selenium-skill/SKILL.md +1 -1
- package/bundled-skills/semgrep-rule-creator/SKILL.md +1 -0
- package/bundled-skills/semgrep-rule-variant-creator/SKILL.md +1 -0
- package/bundled-skills/sendgrid-automation/SKILL.md +6 -0
- package/bundled-skills/seo-audit/SKILL.md +33 -44
- package/bundled-skills/seo-content/SKILL.md +6 -0
- package/bundled-skills/seo-content-auditor/SKILL.md +6 -0
- package/bundled-skills/seo-content-planner/resources/implementation-playbook.md +23 -0
- package/bundled-skills/seo-content-writer/SKILL.md +8 -2
- package/bundled-skills/seo-content-writer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/seo-forensic-incident-response/SKILL.md +6 -0
- package/bundled-skills/seo-fundamentals/SKILL.md +6 -0
- package/bundled-skills/seo-programmatic/SKILL.md +6 -0
- package/bundled-skills/sequence-psychologist/SKILL.md +6 -0
- package/bundled-skills/server-management/SKILL.md +6 -0
- package/bundled-skills/service-mesh-expert/SKILL.md +6 -0
- package/bundled-skills/setup-help/SKILL.md +6 -0
- package/bundled-skills/sexual-health-analyzer/SKILL.md +8 -1109
- package/bundled-skills/sexual-health-analyzer/references/detailed-guide.md +1123 -0
- package/bundled-skills/sharp-coder/SKILL.md +1 -0
- package/bundled-skills/sharp-edges/SKILL.md +1 -0
- package/bundled-skills/shodan-reconnaissance/SKILL.md +2 -356
- package/bundled-skills/shodan-reconnaissance/references/detailed-guide.md +366 -0
- package/bundled-skills/shopify-apps/SKILL.md +2 -1477
- package/bundled-skills/shopify-apps/references/detailed-guide.md +1512 -0
- package/bundled-skills/shopify-development/scripts/.snyk +3 -0
- package/bundled-skills/short/SKILL.md +6 -0
- package/bundled-skills/signup-flow-cro/SKILL.md +6 -0
- package/bundled-skills/simplify-code/SKILL.md +6 -0
- package/bundled-skills/skill-creator/SKILL.md +2 -568
- package/bundled-skills/skill-creator/references/detailed-guide.md +581 -0
- package/bundled-skills/skill-creator-ms/SKILL.md +2 -601
- package/bundled-skills/skill-creator-ms/references/detailed-guide.md +614 -0
- package/bundled-skills/skill-improver/SKILL.md +1 -0
- package/bundled-skills/skill-router/SKILL.md +1 -0
- package/bundled-skills/skill-scanner/SKILL.md +1 -0
- package/bundled-skills/skill-security-audit/SKILL.md +87 -0
- package/bundled-skills/skill-seekers/SKILL.md +6 -0
- package/bundled-skills/skill-writer/SKILL.md +1 -0
- package/bundled-skills/skin-health-analyzer/SKILL.md +8 -696
- package/bundled-skills/skin-health-analyzer/references/detailed-guide.md +710 -0
- package/bundled-skills/slack-automation/SKILL.md +6 -0
- package/bundled-skills/slack-bot-builder/SKILL.md +2 -1372
- package/bundled-skills/slack-bot-builder/references/detailed-guide.md +1395 -0
- package/bundled-skills/slack-gif-creator/.snyk +5 -0
- package/bundled-skills/slack-gif-creator/requirements.txt +2 -2
- package/bundled-skills/sleep-analyzer/SKILL.md +5 -764
- package/bundled-skills/sleep-analyzer/references/detailed-guide.md +773 -0
- package/bundled-skills/slo-implementation/SKILL.md +24 -9
- package/bundled-skills/slo-implementation/references/error-budget.md +13 -0
- package/bundled-skills/slo-implementation/references/slo-definitions.md +13 -0
- package/bundled-skills/slo-implementation/resources/implementation-playbook.md +23 -0
- package/bundled-skills/smartui-skill/SKILL.md +1 -1
- package/bundled-skills/smtp-penetration-testing/SKILL.md +2 -346
- package/bundled-skills/smtp-penetration-testing/references/detailed-guide.md +355 -0
- package/bundled-skills/social-content/SKILL.md +2 -797
- package/bundled-skills/social-content/references/detailed-guide.md +816 -0
- package/bundled-skills/social-proof-architect/SKILL.md +6 -0
- package/bundled-skills/software-architecture/SKILL.md +6 -0
- package/bundled-skills/spec-to-code-compliance/SKILL.md +7 -0
- package/bundled-skills/speckit-updater/SKILL.md +1 -0
- package/bundled-skills/speed/SKILL.md +7 -0
- package/bundled-skills/sql-optimization-patterns/SKILL.md +10 -6
- package/bundled-skills/sql-optimization-patterns/resources/implementation-playbook.md +52 -56
- package/bundled-skills/sred-project-organizer/SKILL.md +1 -0
- package/bundled-skills/sred-work-summary/SKILL.md +1 -0
- package/bundled-skills/statsmodels/SKILL.md +3 -586
- package/bundled-skills/statsmodels/references/detailed-guide.md +600 -0
- package/bundled-skills/steve-jobs/SKILL.md +2 -564
- package/bundled-skills/steve-jobs/references/detailed-guide.md +574 -0
- package/bundled-skills/stitch-loop/SKILL.md +1 -0
- package/bundled-skills/stripe-automation/SKILL.md +6 -0
- package/bundled-skills/stripe-integration/SKILL.md +60 -79
- package/bundled-skills/styleseed-design-review/SKILL.md +1 -1
- package/bundled-skills/subagent-orchestrator/SKILL.md +1 -0
- package/bundled-skills/subject-line-psychologist/SKILL.md +6 -0
- package/bundled-skills/supabase/SKILL.md +1 -1
- package/bundled-skills/supabase-automation/SKILL.md +6 -0
- package/bundled-skills/superpowers-lab/SKILL.md +6 -0
- package/bundled-skills/supply-chain-risk-auditor/SKILL.md +7 -0
- package/bundled-skills/swiftui-expert-skill/SKILL.md +1 -1
- package/bundled-skills/sympy/SKILL.md +3 -426
- package/bundled-skills/sympy/references/detailed-guide.md +439 -0
- package/bundled-skills/systematic-debugging/CREATION-LOG.md +3 -0
- package/bundled-skills/systematic-debugging/SKILL.md +30 -34
- package/bundled-skills/systematic-debugging/condition-based-waiting.md +9 -6
- package/bundled-skills/systematic-debugging/defense-in-depth.md +13 -7
- package/bundled-skills/systematic-debugging/find-polluter.sh +77 -57
- package/bundled-skills/systematic-debugging/root-cause-tracing.md +7 -5
- package/bundled-skills/systematic-debugging/test-academic.md +3 -0
- package/bundled-skills/systematic-debugging/test-pressure-1.md +3 -0
- package/bundled-skills/systematic-debugging/test-pressure-2.md +3 -0
- package/bundled-skills/systematic-debugging/test-pressure-3.md +3 -0
- package/bundled-skills/tcm-constitution-analyzer/SKILL.md +5 -655
- package/bundled-skills/tcm-constitution-analyzer/references/detailed-guide.md +660 -0
- package/bundled-skills/tdd-workflows-tdd-cycle/SKILL.md +6 -0
- package/bundled-skills/technical-tutorials/SKILL.md +5 -483
- package/bundled-skills/technical-tutorials/references/detailed-guide.md +496 -0
- package/bundled-skills/telegram/SKILL.md +2 -541
- package/bundled-skills/telegram/assets/boilerplate/nodejs/package-lock.json +1888 -0
- package/bundled-skills/telegram/assets/boilerplate/nodejs/package.json +3 -0
- package/bundled-skills/telegram/references/detailed-guide.md +569 -0
- package/bundled-skills/telegram-mini-app/SKILL.md +2 -643
- package/bundled-skills/telegram-mini-app/references/detailed-guide.md +661 -0
- package/bundled-skills/temporal-python-pro/SKILL.md +6 -0
- package/bundled-skills/terraform-skill/SKILL.md +4 -417
- package/bundled-skills/terraform-skill/references/detailed-guide.md +430 -0
- package/bundled-skills/test-driven-development/SKILL.md +21 -124
- package/bundled-skills/test-driven-development/testing-anti-patterns.md +6 -6
- package/bundled-skills/test-framework-migration-skill/SKILL.md +7 -1
- package/bundled-skills/threat-modeling-expert/SKILL.md +6 -0
- package/bundled-skills/threejs-animation/SKILL.md +5 -551
- package/bundled-skills/threejs-animation/references/detailed-guide.md +566 -0
- package/bundled-skills/threejs-fundamentals/SKILL.md +5 -525
- package/bundled-skills/threejs-fundamentals/references/detailed-guide.md +535 -0
- package/bundled-skills/threejs-geometry/SKILL.md +5 -572
- package/bundled-skills/threejs-geometry/references/detailed-guide.md +587 -0
- package/bundled-skills/threejs-interaction/SKILL.md +5 -666
- package/bundled-skills/threejs-interaction/references/detailed-guide.md +679 -0
- package/bundled-skills/threejs-lighting/SKILL.md +1 -0
- package/bundled-skills/threejs-loaders/SKILL.md +5 -637
- package/bundled-skills/threejs-loaders/references/detailed-guide.md +651 -0
- package/bundled-skills/threejs-materials/SKILL.md +3 -535
- package/bundled-skills/threejs-materials/references/detailed-guide.md +560 -0
- package/bundled-skills/threejs-postprocessing/SKILL.md +5 -617
- package/bundled-skills/threejs-postprocessing/references/detailed-guide.md +630 -0
- package/bundled-skills/threejs-shaders/SKILL.md +5 -679
- package/bundled-skills/threejs-shaders/references/detailed-guide.md +695 -0
- package/bundled-skills/threejs-skills/SKILL.md +4 -683
- package/bundled-skills/threejs-skills/references/detailed-guide.md +693 -0
- package/bundled-skills/threejs-textures/SKILL.md +5 -630
- package/bundled-skills/threejs-textures/references/detailed-guide.md +649 -0
- package/bundled-skills/to-issues/SKILL.md +5 -0
- package/bundled-skills/to-prd/SKILL.md +5 -0
- package/bundled-skills/todoist-automation/SKILL.md +6 -0
- package/bundled-skills/tools-page-seo-optimizer/SKILL.md +2 -580
- package/bundled-skills/tools-page-seo-optimizer/references/detailed-guide.md +602 -0
- package/bundled-skills/top-web-vulnerabilities/SKILL.md +2 -513
- package/bundled-skills/top-web-vulnerabilities/references/detailed-guide.md +523 -0
- package/bundled-skills/train-sentence-transformers/SKILL.md +1 -1
- package/bundled-skills/transformers-js/SKILL.md +5 -669
- package/bundled-skills/transformers-js/references/detailed-guide.md +683 -0
- package/bundled-skills/travel-health-analyzer/SKILL.md +1 -0
- package/bundled-skills/trello-automation/SKILL.md +6 -0
- package/bundled-skills/trigger-dev/SKILL.md +2 -937
- package/bundled-skills/trigger-dev/references/detailed-guide.md +950 -0
- package/bundled-skills/trust-calibrator/SKILL.md +6 -0
- package/bundled-skills/tutorial-engineer/SKILL.md +6 -0
- package/bundled-skills/twilio-communications/SKILL.md +2 -1549
- package/bundled-skills/twilio-communications/references/detailed-guide.md +1574 -0
- package/bundled-skills/typescript-pro/SKILL.md +6 -0
- package/bundled-skills/ui-a11y/SKILL.md +6 -0
- package/bundled-skills/ui-component/SKILL.md +6 -0
- package/bundled-skills/ui-motion/SKILL.md +7 -1
- package/bundled-skills/ui-pattern/SKILL.md +6 -0
- package/bundled-skills/ui-review/SKILL.md +6 -0
- package/bundled-skills/ui-skills/SKILL.md +6 -0
- package/bundled-skills/ui-tokens/SKILL.md +6 -0
- package/bundled-skills/uniprot-database/SKILL.md +1 -0
- package/bundled-skills/unslop-commit/SKILL.md +1 -1
- package/bundled-skills/unslop-file/SKILL.md +1 -1
- package/bundled-skills/unslop-review/SKILL.md +1 -1
- package/bundled-skills/unsplash-integration/SKILL.md +6 -0
- package/bundled-skills/update-swiftui-apis/SKILL.md +1 -1
- package/bundled-skills/upstash-qstash/SKILL.md +2 -919
- package/bundled-skills/upstash-qstash/references/detailed-guide.md +932 -0
- package/bundled-skills/usage-based-pricing/SKILL.md +5 -395
- package/bundled-skills/usage-based-pricing/references/detailed-guide.md +407 -0
- package/bundled-skills/ux-audit/SKILL.md +6 -0
- package/bundled-skills/ux-flow/SKILL.md +6 -0
- package/bundled-skills/ux-persuasion-engineer/SKILL.md +6 -0
- package/bundled-skills/variant-analysis/SKILL.md +1 -0
- package/bundled-skills/varlock/SKILL.md +1 -0
- package/bundled-skills/varlock-claude-skill/SKILL.md +6 -0
- package/bundled-skills/vector-database-engineer/SKILL.md +6 -0
- package/bundled-skills/vector-database-engineer/resources/implementation-playbook.md +23 -0
- package/bundled-skills/vercel-deployment/SKILL.md +2 -650
- package/bundled-skills/vercel-deployment/references/detailed-guide.md +660 -0
- package/bundled-skills/vexor/SKILL.md +6 -0
- package/bundled-skills/vexor-cli/SKILL.md +1 -0
- package/bundled-skills/videodb/scripts/ws_listener.py +8 -1
- package/bundled-skills/visual-emotion-engineer/SKILL.md +6 -0
- package/bundled-skills/vizcom/SKILL.md +6 -0
- package/bundled-skills/voice-agents/SKILL.md +2 -867
- package/bundled-skills/voice-agents/references/detailed-guide.md +890 -0
- package/bundled-skills/voice-ai-development/SKILL.md +2 -583
- package/bundled-skills/voice-ai-development/references/detailed-guide.md +594 -0
- package/bundled-skills/voice-ai-engine-development/SKILL.md +2 -702
- package/bundled-skills/voice-ai-engine-development/references/detailed-guide.md +720 -0
- package/bundled-skills/warren-buffett/SKILL.md +2 -577
- package/bundled-skills/warren-buffett/references/detailed-guide.md +583 -0
- package/bundled-skills/web-performance-optimization/SKILL.md +2 -214
- package/bundled-skills/web-performance-optimization/references/detailed-guide.md +226 -0
- package/bundled-skills/web-scraper/SKILL.md +2 -728
- package/bundled-skills/web-scraper/references/detailed-guide.md +792 -0
- package/bundled-skills/webflow-automation/SKILL.md +6 -0
- package/bundled-skills/weightloss-analyzer/SKILL.md +1 -0
- package/bundled-skills/wellally-tech/SKILL.md +5 -367
- package/bundled-skills/wellally-tech/references/detailed-guide.md +379 -0
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/nodejs/package-lock.json +1881 -0
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/nodejs/package.json +3 -0
- package/bundled-skills/whatsapp-cloud-api/assets/boilerplate/python/.snyk +3 -0
- package/bundled-skills/wiki-architect/SKILL.md +6 -0
- package/bundled-skills/wiki-changelog/SKILL.md +6 -0
- package/bundled-skills/wiki-onboarding/SKILL.md +6 -0
- package/bundled-skills/wiki-qa/SKILL.md +6 -0
- package/bundled-skills/wiki-researcher/SKILL.md +6 -0
- package/bundled-skills/windows-privilege-escalation/SKILL.md +131 -0
- package/bundled-skills/windows-privilege-escalation/references/detailed-guide.md +397 -0
- package/bundled-skills/wireshark-analysis/SKILL.md +2 -419
- package/bundled-skills/wireshark-analysis/references/detailed-guide.md +429 -0
- package/bundled-skills/wjttc-builder/SKILL.md +1 -1
- package/bundled-skills/wjttc-tester/SKILL.md +1 -1
- package/bundled-skills/wordpress/SKILL.md +2 -572
- package/bundled-skills/wordpress/references/detailed-guide.md +582 -0
- package/bundled-skills/wordpress-penetration-testing/SKILL.md +68 -0
- package/bundled-skills/wordpress-penetration-testing/references/detailed-guide.md +555 -0
- package/bundled-skills/wordpress-plugin-development/SKILL.md +2 -474
- package/bundled-skills/wordpress-plugin-development/references/detailed-guide.md +485 -0
- package/bundled-skills/wordpress-theme-development/SKILL.md +2 -479
- package/bundled-skills/wordpress-theme-development/references/detailed-guide.md +490 -0
- package/bundled-skills/wordpress-woocommerce-development/SKILL.md +2 -605
- package/bundled-skills/wordpress-woocommerce-development/references/detailed-guide.md +615 -0
- package/bundled-skills/workflow-automation/SKILL.md +2 -875
- package/bundled-skills/workflow-automation/references/detailed-guide.md +902 -0
- package/bundled-skills/writing-great-skills/SKILL.md +5 -0
- package/bundled-skills/x-article-publisher-skill/SKILL.md +6 -0
- package/bundled-skills/x402-express-wrapper/SKILL.md +1 -0
- package/bundled-skills/xss-html-injection/SKILL.md +2 -389
- package/bundled-skills/xss-html-injection/references/detailed-guide.md +399 -0
- package/bundled-skills/yann-lecun/SKILL.md +2 -1431
- package/bundled-skills/yann-lecun/references/detailed-guide.md +1484 -0
- package/bundled-skills/yann-lecun-filosofia/SKILL.md +6 -0
- package/bundled-skills/yann-lecun-tecnico/SKILL.md +2 -485
- package/bundled-skills/yann-lecun-tecnico/references/detailed-guide.md +502 -0
- package/bundled-skills/youtube-seo-optimizer/SKILL.md +4 -884
- package/bundled-skills/youtube-seo-optimizer/references/detailed-guide.md +907 -0
- package/bundled-skills/zapier-make-patterns/SKILL.md +2 -728
- package/bundled-skills/zapier-make-patterns/references/detailed-guide.md +752 -0
- package/bundled-skills/zipai-optimizer/SKILL.md +7 -0
- package/bundled-skills/zoom-automation/SKILL.md +6 -0
- package/package.json +1 -1
- package/skills_index.json +541 -383
- package/bundled-skills/docs/AUDIT.md +0 -3
- package/bundled-skills/docs/BUNDLES.md +0 -3
- package/bundled-skills/docs/CATEGORIZATION_IMPLEMENTATION.md +0 -3
- package/bundled-skills/docs/CI_DRIFT_FIX.md +0 -3
- package/bundled-skills/docs/COMMUNITY_GUIDELINES.md +0 -3
- package/bundled-skills/docs/DATE_TRACKING_IMPLEMENTATION.md +0 -3
- package/bundled-skills/docs/EXAMPLES.md +0 -3
- package/bundled-skills/docs/FAQ.md +0 -3
- package/bundled-skills/docs/GETTING_STARTED.md +0 -3
- package/bundled-skills/docs/KIRO_INTEGRATION.md +0 -3
- package/bundled-skills/docs/QUALITY_BAR.md +0 -3
- package/bundled-skills/docs/README.md +0 -51
- package/bundled-skills/docs/SECURITY_GUARDRAILS.md +0 -3
- package/bundled-skills/docs/SEC_SKILLS.md +0 -3
- package/bundled-skills/docs/SKILLS_DATE_TRACKING.md +0 -3
- package/bundled-skills/docs/SKILL_ANATOMY.md +0 -3
- package/bundled-skills/docs/SKILL_TEMPLATE.md +0 -3
- package/bundled-skills/docs/SMART_AUTO_CATEGORIZATION.md +0 -3
- package/bundled-skills/docs/SOURCES.md +0 -3
- package/bundled-skills/docs/USAGE.md +0 -3
- package/bundled-skills/docs/VISUAL_GUIDE.md +0 -3
- package/bundled-skills/docs/WORKFLOWS.md +0 -3
- package/bundled-skills/docs/contributors/community-guidelines.md +0 -4
- package/bundled-skills/docs/contributors/examples.md +0 -760
- package/bundled-skills/docs/contributors/quality-bar.md +0 -104
- package/bundled-skills/docs/contributors/security-guardrails.md +0 -70
- package/bundled-skills/docs/contributors/skill-anatomy.md +0 -637
- package/bundled-skills/docs/contributors/skill-template.md +0 -93
- package/bundled-skills/docs/integrations/jetski-cortex.md +0 -282
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +0 -103
- package/bundled-skills/docs/integrations/jetski-gemini-loader/loader.mjs +0 -154
- package/bundled-skills/docs/integrations/jetski-gemini-loader/package.json +0 -1
- package/bundled-skills/docs/maintainers/aas-agent-first-control-plane-preview-profile.md +0 -63
- package/bundled-skills/docs/maintainers/aas-agent-first-control-plane-v1-design.md +0 -304
- package/bundled-skills/docs/maintainers/aas-agent-first-control-plane-v1-goal.md +0 -171
- package/bundled-skills/docs/maintainers/aas-agent-first-control-plane-v1-worklog.md +0 -104
- package/bundled-skills/docs/maintainers/audit.md +0 -89
- package/bundled-skills/docs/maintainers/backups/README-2026-06-02.md +0 -687
- package/bundled-skills/docs/maintainers/categorization-implementation.md +0 -160
- package/bundled-skills/docs/maintainers/ci-drift-fix.md +0 -64
- package/bundled-skills/docs/maintainers/date-tracking-implementation.md +0 -66
- package/bundled-skills/docs/maintainers/full-repo-audit-2026-05-23.md +0 -289
- package/bundled-skills/docs/maintainers/legacy-redirect-bridge.md +0 -46
- package/bundled-skills/docs/maintainers/merge-batch.md +0 -81
- package/bundled-skills/docs/maintainers/merging-prs.md +0 -79
- package/bundled-skills/docs/maintainers/pr-autonomy.md +0 -102
- package/bundled-skills/docs/maintainers/provenance-identity-exceptions.json +0 -14
- package/bundled-skills/docs/maintainers/release-notes-7.2.0.md +0 -32
- package/bundled-skills/docs/maintainers/release-process.md +0 -124
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +0 -133
- package/bundled-skills/docs/maintainers/rollback-procedure.md +0 -43
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-15.csv +0 -34
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-15.md +0 -60
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-18-addendum.md +0 -22
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-addendum.md +0 -48
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.csv +0 -34
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.md +0 -86
- package/bundled-skills/docs/maintainers/skills-date-tracking.md +0 -228
- package/bundled-skills/docs/maintainers/skills-import-2026-03-21.md +0 -81
- package/bundled-skills/docs/maintainers/skills-update-guide.md +0 -92
- package/bundled-skills/docs/maintainers/smart-auto-categorization.md +0 -218
- package/bundled-skills/docs/plugin-submissions/aas-agent-mcp-builder/README.md +0 -19
- package/bundled-skills/docs/plugin-submissions/aas-agent-mcp-builder/evaluation-cases.json +0 -74
- package/bundled-skills/docs/plugin-submissions/aas-agent-mcp-builder/evaluation-results.json +0 -86
- package/bundled-skills/docs/plugin-submissions/aas-agent-mcp-builder/submission.json +0 -41
- package/bundled-skills/docs/sources/LICENSE-MICROSOFT +0 -21
- package/bundled-skills/docs/sources/microsoft-skills-attribution.json +0 -709
- package/bundled-skills/docs/sources/sources.md +0 -179
- package/bundled-skills/docs/users/aas-core.md +0 -225
- package/bundled-skills/docs/users/agent-overload-recovery.md +0 -54
- package/bundled-skills/docs/users/agentic-awesome-skills-vs-awesome-claude-skills.md +0 -44
- package/bundled-skills/docs/users/ai-agent-skills.md +0 -48
- package/bundled-skills/docs/users/best-claude-code-skills-github.md +0 -62
- package/bundled-skills/docs/users/best-cursor-skills-github.md +0 -62
- package/bundled-skills/docs/users/bundles.md +0 -1067
- package/bundled-skills/docs/users/claude-code-skills.md +0 -89
- package/bundled-skills/docs/users/codex-cli-skills.md +0 -88
- package/bundled-skills/docs/users/cursor-skills.md +0 -56
- package/bundled-skills/docs/users/discovery-manifest.md +0 -65
- package/bundled-skills/docs/users/faq.md +0 -521
- package/bundled-skills/docs/users/gemini-cli-skills.md +0 -56
- package/bundled-skills/docs/users/getting-started.md +0 -233
- package/bundled-skills/docs/users/kiro-integration.md +0 -304
- package/bundled-skills/docs/users/local-config.md +0 -152
- package/bundled-skills/docs/users/plugins.md +0 -201
- package/bundled-skills/docs/users/security-and-antivirus.md +0 -63
- package/bundled-skills/docs/users/security-skills.md +0 -1722
- package/bundled-skills/docs/users/skills-library-overview.md +0 -87
- package/bundled-skills/docs/users/skills-vs-mcp-tools.md +0 -108
- package/bundled-skills/docs/users/specialized-plugin-roadmap.md +0 -101
- package/bundled-skills/docs/users/usage.md +0 -465
- package/bundled-skills/docs/users/visual-guide.md +0 -515
- package/bundled-skills/docs/users/walkthrough.md +0 -46
- package/bundled-skills/docs/users/windows-truncation-recovery.md +0 -135
- package/bundled-skills/docs/users/workflows.md +0 -215
- package/bundled-skills/docs/vietnamese/AAS_CORE.vi.md +0 -28
- package/bundled-skills/docs/vietnamese/BUNDLES.vi.md +0 -124
- package/bundled-skills/docs/vietnamese/CONTRIBUTING.vi.md +0 -242
- package/bundled-skills/docs/vietnamese/EXAMPLES.vi.md +0 -56
- package/bundled-skills/docs/vietnamese/FAQ.vi.md +0 -195
- package/bundled-skills/docs/vietnamese/GETTING_STARTED.vi.md +0 -123
- package/bundled-skills/docs/vietnamese/QUALITY_BAR.vi.md +0 -69
- package/bundled-skills/docs/vietnamese/README.vi.md +0 -191
- package/bundled-skills/docs/vietnamese/SECURITY.vi.md +0 -19
- package/bundled-skills/docs/vietnamese/SECURITY_GUARDRAILS.vi.md +0 -51
- package/bundled-skills/docs/vietnamese/SKILLS_README.vi.md +0 -106
- package/bundled-skills/docs/vietnamese/SKILL_ANATOMY.vi.md +0 -633
- package/bundled-skills/docs/vietnamese/SOURCES.vi.md +0 -21
- package/bundled-skills/docs/vietnamese/TRANSLATION_PLAN.vi.md +0 -65
- package/bundled-skills/docs/vietnamese/VISUAL_GUIDE.vi.md +0 -511
- package/bundled-skills/docs/walkthrough.md +0 -3
|
@@ -3,6 +3,7 @@ name: fp-backend
|
|
|
3
3
|
description: Functional programming patterns for Node.js/Deno backend development using fp-ts, ReaderTaskEither, and functional dependency injection
|
|
4
4
|
risk: critical
|
|
5
5
|
source: community
|
|
6
|
+
date_added: "2026-09-04"
|
|
6
7
|
version: 1.0.0
|
|
7
8
|
author: kadu
|
|
8
9
|
tags:
|
|
@@ -20,1324 +21,15 @@ tags:
|
|
|
20
21
|
|
|
21
22
|
Functional programming patterns for building type-safe, testable backend services using fp-ts.
|
|
22
23
|
|
|
24
|
+
## Detailed Guide
|
|
25
|
+
|
|
26
|
+
Read [the detailed guide](references/detailed-guide.md) before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.
|
|
27
|
+
|
|
23
28
|
## When to Use
|
|
24
29
|
- You are building or refactoring a Node.js or Deno backend with fp-ts.
|
|
25
30
|
- The task involves dependency injection, service composition, or typed backend errors with `ReaderTaskEither`.
|
|
26
31
|
- You need functional backend architecture patterns rather than isolated utility snippets.
|
|
27
32
|
|
|
28
|
-
## Core Concepts
|
|
29
|
-
|
|
30
|
-
### ReaderTaskEither (RTE)
|
|
31
|
-
|
|
32
|
-
The `ReaderTaskEither<R, E, A>` type is the backbone of functional backend development:
|
|
33
|
-
- **R** (Reader): Dependencies/environment (database, config, logger)
|
|
34
|
-
- **E** (Either left): Error type
|
|
35
|
-
- **A** (Either right): Success value
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
39
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
40
|
-
import { pipe } from 'fp-ts/function'
|
|
41
|
-
|
|
42
|
-
// Define your dependencies
|
|
43
|
-
type Deps = {
|
|
44
|
-
db: DatabaseClient
|
|
45
|
-
logger: Logger
|
|
46
|
-
config: Config
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Define domain errors
|
|
50
|
-
type AppError =
|
|
51
|
-
| { _tag: 'NotFound'; resource: string; id: string }
|
|
52
|
-
| { _tag: 'ValidationError'; message: string }
|
|
53
|
-
| { _tag: 'DatabaseError'; cause: unknown }
|
|
54
|
-
| { _tag: 'Unauthorized'; reason: string }
|
|
55
|
-
|
|
56
|
-
// A service function
|
|
57
|
-
const getUser = (id: string): RTE.ReaderTaskEither<Deps, AppError, User> =>
|
|
58
|
-
pipe(
|
|
59
|
-
RTE.ask<Deps>(),
|
|
60
|
-
RTE.flatMap(({ db, logger }) =>
|
|
61
|
-
pipe(
|
|
62
|
-
RTE.fromTaskEither(db.users.findById(id)),
|
|
63
|
-
RTE.mapLeft((e): AppError => ({ _tag: 'DatabaseError', cause: e })),
|
|
64
|
-
RTE.flatMap(user =>
|
|
65
|
-
user
|
|
66
|
-
? RTE.right(user)
|
|
67
|
-
: RTE.left({ _tag: 'NotFound', resource: 'User', id })
|
|
68
|
-
),
|
|
69
|
-
RTE.tap(user => RTE.fromIO(() => logger.info(`Found user: ${user.id}`)))
|
|
70
|
-
)
|
|
71
|
-
)
|
|
72
|
-
)
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Service Layer Patterns
|
|
76
|
-
|
|
77
|
-
### Defining Service Modules
|
|
78
|
-
|
|
79
|
-
Structure services as modules exporting RTE functions:
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
// src/services/user.service.ts
|
|
83
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
84
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
85
|
-
import * as A from 'fp-ts/Array'
|
|
86
|
-
import { pipe } from 'fp-ts/function'
|
|
87
|
-
|
|
88
|
-
type UserDeps = {
|
|
89
|
-
db: DatabaseClient
|
|
90
|
-
hasher: PasswordHasher
|
|
91
|
-
mailer: EmailService
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
type UserError =
|
|
95
|
-
| { _tag: 'UserNotFound'; id: string }
|
|
96
|
-
| { _tag: 'EmailExists'; email: string }
|
|
97
|
-
| { _tag: 'InvalidPassword' }
|
|
98
|
-
|
|
99
|
-
// Create user
|
|
100
|
-
export const create = (
|
|
101
|
-
input: CreateUserInput
|
|
102
|
-
): RTE.ReaderTaskEither<UserDeps, UserError, User> =>
|
|
103
|
-
pipe(
|
|
104
|
-
RTE.ask<UserDeps>(),
|
|
105
|
-
RTE.flatMap(({ db, hasher }) =>
|
|
106
|
-
pipe(
|
|
107
|
-
// Check email uniqueness
|
|
108
|
-
checkEmailUnique(input.email),
|
|
109
|
-
RTE.flatMap(() =>
|
|
110
|
-
RTE.fromTaskEither(hasher.hash(input.password))
|
|
111
|
-
),
|
|
112
|
-
RTE.flatMap(hashedPassword =>
|
|
113
|
-
RTE.fromTaskEither(
|
|
114
|
-
db.users.create({
|
|
115
|
-
...input,
|
|
116
|
-
password: hashedPassword,
|
|
117
|
-
})
|
|
118
|
-
)
|
|
119
|
-
)
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
// Find by ID
|
|
125
|
-
export const findById = (
|
|
126
|
-
id: string
|
|
127
|
-
): RTE.ReaderTaskEither<UserDeps, UserError, User> =>
|
|
128
|
-
pipe(
|
|
129
|
-
RTE.ask<UserDeps>(),
|
|
130
|
-
RTE.flatMap(({ db }) =>
|
|
131
|
-
pipe(
|
|
132
|
-
RTE.fromTaskEither(db.users.findUnique({ where: { id } })),
|
|
133
|
-
RTE.flatMap(user =>
|
|
134
|
-
user
|
|
135
|
-
? RTE.right(user)
|
|
136
|
-
: RTE.left({ _tag: 'UserNotFound' as const, id })
|
|
137
|
-
)
|
|
138
|
-
)
|
|
139
|
-
)
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
// Find many with pagination
|
|
143
|
-
export const findMany = (
|
|
144
|
-
params: PaginationParams
|
|
145
|
-
): RTE.ReaderTaskEither<UserDeps, UserError, PaginatedResult<User>> =>
|
|
146
|
-
pipe(
|
|
147
|
-
RTE.ask<UserDeps>(),
|
|
148
|
-
RTE.flatMap(({ db }) =>
|
|
149
|
-
RTE.fromTaskEither(
|
|
150
|
-
pipe(
|
|
151
|
-
TE.Do,
|
|
152
|
-
TE.bind('users', () => db.users.findMany({
|
|
153
|
-
skip: params.offset,
|
|
154
|
-
take: params.limit,
|
|
155
|
-
})),
|
|
156
|
-
TE.bind('total', () => db.users.count()),
|
|
157
|
-
TE.map(({ users, total }) => ({
|
|
158
|
-
data: users,
|
|
159
|
-
total,
|
|
160
|
-
...params,
|
|
161
|
-
}))
|
|
162
|
-
)
|
|
163
|
-
)
|
|
164
|
-
)
|
|
165
|
-
)
|
|
166
|
-
|
|
167
|
-
const checkEmailUnique = (
|
|
168
|
-
email: string
|
|
169
|
-
): RTE.ReaderTaskEither<UserDeps, UserError, void> =>
|
|
170
|
-
pipe(
|
|
171
|
-
RTE.ask<UserDeps>(),
|
|
172
|
-
RTE.flatMap(({ db }) =>
|
|
173
|
-
pipe(
|
|
174
|
-
RTE.fromTaskEither(db.users.findUnique({ where: { email } })),
|
|
175
|
-
RTE.flatMap(existing =>
|
|
176
|
-
existing
|
|
177
|
-
? RTE.left({ _tag: 'EmailExists' as const, email })
|
|
178
|
-
: RTE.right(undefined)
|
|
179
|
-
)
|
|
180
|
-
)
|
|
181
|
-
)
|
|
182
|
-
)
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
### Composing Services
|
|
186
|
-
|
|
187
|
-
```typescript
|
|
188
|
-
// src/services/order.service.ts
|
|
189
|
-
import * as UserService from './user.service'
|
|
190
|
-
import * as ProductService from './product.service'
|
|
191
|
-
import * as PaymentService from './payment.service'
|
|
192
|
-
|
|
193
|
-
type OrderDeps = UserService.UserDeps &
|
|
194
|
-
ProductService.ProductDeps &
|
|
195
|
-
PaymentService.PaymentDeps & {
|
|
196
|
-
db: DatabaseClient
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export const createOrder = (
|
|
200
|
-
userId: string,
|
|
201
|
-
items: OrderItem[]
|
|
202
|
-
): RTE.ReaderTaskEither<OrderDeps, OrderError, Order> =>
|
|
203
|
-
pipe(
|
|
204
|
-
RTE.Do,
|
|
205
|
-
// Validate user exists
|
|
206
|
-
RTE.bind('user', () =>
|
|
207
|
-
pipe(
|
|
208
|
-
UserService.findById(userId),
|
|
209
|
-
RTE.mapLeft(toOrderError)
|
|
210
|
-
)
|
|
211
|
-
),
|
|
212
|
-
// Validate and get products
|
|
213
|
-
RTE.bind('products', () =>
|
|
214
|
-
pipe(
|
|
215
|
-
items,
|
|
216
|
-
A.traverse(RTE.ApplicativePar)(item =>
|
|
217
|
-
ProductService.findById(item.productId)
|
|
218
|
-
),
|
|
219
|
-
RTE.mapLeft(toOrderError)
|
|
220
|
-
)
|
|
221
|
-
),
|
|
222
|
-
// Calculate total
|
|
223
|
-
RTE.bind('total', ({ products }) =>
|
|
224
|
-
RTE.right(calculateTotal(products, items))
|
|
225
|
-
),
|
|
226
|
-
// Process payment
|
|
227
|
-
RTE.bind('payment', ({ user, total }) =>
|
|
228
|
-
pipe(
|
|
229
|
-
PaymentService.charge(user, total),
|
|
230
|
-
RTE.mapLeft(toOrderError)
|
|
231
|
-
)
|
|
232
|
-
),
|
|
233
|
-
// Create order
|
|
234
|
-
RTE.flatMap(({ user, products, total, payment }) =>
|
|
235
|
-
createOrderRecord(user, products, items, total, payment)
|
|
236
|
-
)
|
|
237
|
-
)
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
## Functional Dependency Injection
|
|
241
|
-
|
|
242
|
-
### Building the Dependency Container
|
|
243
|
-
|
|
244
|
-
```typescript
|
|
245
|
-
// src/deps.ts
|
|
246
|
-
import { pipe } from 'fp-ts/function'
|
|
247
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
248
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
249
|
-
|
|
250
|
-
// Layer 0: Config (no dependencies)
|
|
251
|
-
type Config = {
|
|
252
|
-
database: { url: string; poolSize: number }
|
|
253
|
-
redis: { url: string }
|
|
254
|
-
jwt: { secret: string; expiresIn: string }
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
const loadConfig = (): TE.TaskEither<Error, Config> =>
|
|
258
|
-
TE.tryCatch(
|
|
259
|
-
async () => ({
|
|
260
|
-
database: {
|
|
261
|
-
url: process.env.DATABASE_URL!,
|
|
262
|
-
poolSize: parseInt(process.env.DB_POOL_SIZE || '10'),
|
|
263
|
-
},
|
|
264
|
-
redis: { url: process.env.REDIS_URL! },
|
|
265
|
-
jwt: {
|
|
266
|
-
secret: process.env.JWT_SECRET!,
|
|
267
|
-
expiresIn: process.env.JWT_EXPIRES || '1d',
|
|
268
|
-
},
|
|
269
|
-
}),
|
|
270
|
-
(e) => new Error(`Config error: ${e}`)
|
|
271
|
-
)
|
|
272
|
-
|
|
273
|
-
// Layer 1: Infrastructure (depends on config)
|
|
274
|
-
type Infrastructure = {
|
|
275
|
-
config: Config
|
|
276
|
-
db: PrismaClient
|
|
277
|
-
redis: RedisClient
|
|
278
|
-
logger: Logger
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
const buildInfrastructure = (
|
|
282
|
-
config: Config
|
|
283
|
-
): TE.TaskEither<Error, Infrastructure> =>
|
|
284
|
-
pipe(
|
|
285
|
-
TE.Do,
|
|
286
|
-
TE.bind('db', () =>
|
|
287
|
-
TE.tryCatch(
|
|
288
|
-
async () => {
|
|
289
|
-
const prisma = new PrismaClient({
|
|
290
|
-
datasources: { db: { url: config.database.url } },
|
|
291
|
-
})
|
|
292
|
-
await prisma.$connect()
|
|
293
|
-
return prisma
|
|
294
|
-
},
|
|
295
|
-
(e) => new Error(`Database error: ${e}`)
|
|
296
|
-
)
|
|
297
|
-
),
|
|
298
|
-
TE.bind('redis', () =>
|
|
299
|
-
TE.tryCatch(
|
|
300
|
-
async () => createRedisClient(config.redis.url),
|
|
301
|
-
(e) => new Error(`Redis error: ${e}`)
|
|
302
|
-
)
|
|
303
|
-
),
|
|
304
|
-
TE.bind('logger', () => TE.right(createLogger())),
|
|
305
|
-
TE.map(({ db, redis, logger }) => ({
|
|
306
|
-
config,
|
|
307
|
-
db,
|
|
308
|
-
redis,
|
|
309
|
-
logger,
|
|
310
|
-
}))
|
|
311
|
-
)
|
|
312
|
-
|
|
313
|
-
// Layer 2: Services (depends on infrastructure)
|
|
314
|
-
type Services = {
|
|
315
|
-
hasher: PasswordHasher
|
|
316
|
-
jwt: JwtService
|
|
317
|
-
mailer: EmailService
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
const buildServices = (infra: Infrastructure): Services => ({
|
|
321
|
-
hasher: createBcryptHasher(),
|
|
322
|
-
jwt: createJwtService(infra.config.jwt),
|
|
323
|
-
mailer: createEmailService(infra.config),
|
|
324
|
-
})
|
|
325
|
-
|
|
326
|
-
// Full application dependencies
|
|
327
|
-
export type AppDeps = Infrastructure & Services
|
|
328
|
-
|
|
329
|
-
export const buildDeps = (): TE.TaskEither<Error, AppDeps> =>
|
|
330
|
-
pipe(
|
|
331
|
-
loadConfig(),
|
|
332
|
-
TE.flatMap(buildInfrastructure),
|
|
333
|
-
TE.map(infra => ({
|
|
334
|
-
...infra,
|
|
335
|
-
...buildServices(infra),
|
|
336
|
-
}))
|
|
337
|
-
)
|
|
338
|
-
|
|
339
|
-
// Cleanup
|
|
340
|
-
export const destroyDeps = (deps: AppDeps): TE.TaskEither<Error, void> =>
|
|
341
|
-
pipe(
|
|
342
|
-
TE.tryCatch(
|
|
343
|
-
async () => {
|
|
344
|
-
await deps.db.$disconnect()
|
|
345
|
-
await deps.redis.quit()
|
|
346
|
-
},
|
|
347
|
-
(e) => new Error(`Cleanup error: ${e}`)
|
|
348
|
-
)
|
|
349
|
-
)
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
### Running Programs with Dependencies
|
|
353
|
-
|
|
354
|
-
```typescript
|
|
355
|
-
// src/main.ts
|
|
356
|
-
import { pipe } from 'fp-ts/function'
|
|
357
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
358
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
359
|
-
|
|
360
|
-
const program: RTE.ReaderTaskEither<AppDeps, AppError, void> = pipe(
|
|
361
|
-
RTE.ask<AppDeps>(),
|
|
362
|
-
RTE.flatMap(deps =>
|
|
363
|
-
pipe(
|
|
364
|
-
startServer(deps),
|
|
365
|
-
RTE.fromTaskEither
|
|
366
|
-
)
|
|
367
|
-
)
|
|
368
|
-
)
|
|
369
|
-
|
|
370
|
-
const main = async () => {
|
|
371
|
-
const result = await pipe(
|
|
372
|
-
buildDeps(),
|
|
373
|
-
TE.mapLeft((e): AppError => ({ _tag: 'StartupError', cause: e })),
|
|
374
|
-
TE.flatMap(deps =>
|
|
375
|
-
pipe(
|
|
376
|
-
program(deps),
|
|
377
|
-
TE.tap(() => TE.fromIO(() => console.log('Server running'))),
|
|
378
|
-
// Cleanup on exit
|
|
379
|
-
TE.tapError(() => destroyDeps(deps))
|
|
380
|
-
)
|
|
381
|
-
)
|
|
382
|
-
)()
|
|
383
|
-
|
|
384
|
-
if (result._tag === 'Left') {
|
|
385
|
-
console.error('Failed to start:', result.left)
|
|
386
|
-
process.exit(1)
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
main()
|
|
391
|
-
```
|
|
392
|
-
|
|
393
|
-
## Database Operations
|
|
394
|
-
|
|
395
|
-
### Prisma Wrappers
|
|
396
|
-
|
|
397
|
-
```typescript
|
|
398
|
-
// src/lib/db.ts
|
|
399
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
400
|
-
import * as O from 'fp-ts/Option'
|
|
401
|
-
import { PrismaClient, Prisma } from '@prisma/client'
|
|
402
|
-
|
|
403
|
-
type DbError =
|
|
404
|
-
| { _tag: 'RecordNotFound'; model: string; id: string }
|
|
405
|
-
| { _tag: 'UniqueViolation'; field: string }
|
|
406
|
-
| { _tag: 'ForeignKeyViolation'; field: string }
|
|
407
|
-
| { _tag: 'UnknownDbError'; cause: unknown }
|
|
408
|
-
|
|
409
|
-
// Wrap Prisma operations
|
|
410
|
-
const wrapPrisma = <A>(
|
|
411
|
-
operation: () => Promise<A>
|
|
412
|
-
): TE.TaskEither<DbError, A> =>
|
|
413
|
-
TE.tryCatch(operation, (error): DbError => {
|
|
414
|
-
if (error instanceof Prisma.PrismaClientKnownRequestError) {
|
|
415
|
-
switch (error.code) {
|
|
416
|
-
case 'P2002':
|
|
417
|
-
return {
|
|
418
|
-
_tag: 'UniqueViolation',
|
|
419
|
-
field: (error.meta?.target as string[])?.join(', ') || 'unknown',
|
|
420
|
-
}
|
|
421
|
-
case 'P2003':
|
|
422
|
-
return {
|
|
423
|
-
_tag: 'ForeignKeyViolation',
|
|
424
|
-
field: error.meta?.field_name as string || 'unknown',
|
|
425
|
-
}
|
|
426
|
-
case 'P2025':
|
|
427
|
-
return {
|
|
428
|
-
_tag: 'RecordNotFound',
|
|
429
|
-
model: error.meta?.modelName as string || 'unknown',
|
|
430
|
-
id: 'unknown',
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
return { _tag: 'UnknownDbError', cause: error }
|
|
435
|
-
})
|
|
436
|
-
|
|
437
|
-
// Repository factory
|
|
438
|
-
export const createRepository = <
|
|
439
|
-
Model,
|
|
440
|
-
CreateInput,
|
|
441
|
-
UpdateInput,
|
|
442
|
-
WhereUnique,
|
|
443
|
-
WhereMany
|
|
444
|
-
>(
|
|
445
|
-
db: PrismaClient,
|
|
446
|
-
delegate: {
|
|
447
|
-
findUnique: (args: { where: WhereUnique }) => Promise<Model | null>
|
|
448
|
-
findMany: (args: { where?: WhereMany; skip?: number; take?: number }) => Promise<Model[]>
|
|
449
|
-
create: (args: { data: CreateInput }) => Promise<Model>
|
|
450
|
-
update: (args: { where: WhereUnique; data: UpdateInput }) => Promise<Model>
|
|
451
|
-
delete: (args: { where: WhereUnique }) => Promise<Model>
|
|
452
|
-
count: (args?: { where?: WhereMany }) => Promise<number>
|
|
453
|
-
}
|
|
454
|
-
) => ({
|
|
455
|
-
findUnique: (where: WhereUnique): TE.TaskEither<DbError, O.Option<Model>> =>
|
|
456
|
-
pipe(
|
|
457
|
-
wrapPrisma(() => delegate.findUnique({ where })),
|
|
458
|
-
TE.map(O.fromNullable)
|
|
459
|
-
),
|
|
460
|
-
|
|
461
|
-
findMany: (
|
|
462
|
-
where?: WhereMany,
|
|
463
|
-
pagination?: { skip: number; take: number }
|
|
464
|
-
): TE.TaskEither<DbError, Model[]> =>
|
|
465
|
-
wrapPrisma(() => delegate.findMany({ where, ...pagination })),
|
|
466
|
-
|
|
467
|
-
create: (data: CreateInput): TE.TaskEither<DbError, Model> =>
|
|
468
|
-
wrapPrisma(() => delegate.create({ data })),
|
|
469
|
-
|
|
470
|
-
update: (
|
|
471
|
-
where: WhereUnique,
|
|
472
|
-
data: UpdateInput
|
|
473
|
-
): TE.TaskEither<DbError, Model> =>
|
|
474
|
-
wrapPrisma(() => delegate.update({ where, data })),
|
|
475
|
-
|
|
476
|
-
delete: (where: WhereUnique): TE.TaskEither<DbError, Model> =>
|
|
477
|
-
wrapPrisma(() => delegate.delete({ where })),
|
|
478
|
-
|
|
479
|
-
count: (where?: WhereMany): TE.TaskEither<DbError, number> =>
|
|
480
|
-
wrapPrisma(() => delegate.count({ where })),
|
|
481
|
-
})
|
|
482
|
-
|
|
483
|
-
// Usage
|
|
484
|
-
const userRepo = createRepository(prisma, prisma.user)
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
### Transaction Handling
|
|
488
|
-
|
|
489
|
-
```typescript
|
|
490
|
-
// src/lib/transaction.ts
|
|
491
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
492
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
493
|
-
import { PrismaClient } from '@prisma/client'
|
|
494
|
-
import { pipe } from 'fp-ts/function'
|
|
495
|
-
|
|
496
|
-
type TxClient = Omit<
|
|
497
|
-
PrismaClient,
|
|
498
|
-
'$connect' | '$disconnect' | '$on' | '$transaction' | '$use'
|
|
499
|
-
>
|
|
500
|
-
|
|
501
|
-
type TxDeps = { tx: TxClient }
|
|
502
|
-
|
|
503
|
-
// Transaction wrapper
|
|
504
|
-
export const withTransaction = <R extends { db: PrismaClient }, E, A>(
|
|
505
|
-
program: RTE.ReaderTaskEither<R & TxDeps, E, A>
|
|
506
|
-
): RTE.ReaderTaskEither<R, E | DbError, A> =>
|
|
507
|
-
pipe(
|
|
508
|
-
RTE.ask<R>(),
|
|
509
|
-
RTE.flatMap(deps =>
|
|
510
|
-
RTE.fromTaskEither(
|
|
511
|
-
TE.tryCatch(
|
|
512
|
-
() =>
|
|
513
|
-
deps.db.$transaction(async tx => {
|
|
514
|
-
const result = await program({ ...deps, tx })()
|
|
515
|
-
if (result._tag === 'Left') {
|
|
516
|
-
throw result.left // Rollback
|
|
517
|
-
}
|
|
518
|
-
return result.right
|
|
519
|
-
}),
|
|
520
|
-
(error): E | DbError => {
|
|
521
|
-
// Re-throw domain errors
|
|
522
|
-
if (typeof error === 'object' && error !== null && '_tag' in error) {
|
|
523
|
-
return error as E
|
|
524
|
-
}
|
|
525
|
-
return { _tag: 'UnknownDbError', cause: error }
|
|
526
|
-
}
|
|
527
|
-
)
|
|
528
|
-
)
|
|
529
|
-
)
|
|
530
|
-
)
|
|
531
|
-
|
|
532
|
-
// Usage in service
|
|
533
|
-
export const transferFunds = (
|
|
534
|
-
fromId: string,
|
|
535
|
-
toId: string,
|
|
536
|
-
amount: number
|
|
537
|
-
): RTE.ReaderTaskEither<AppDeps, TransferError, Transfer> =>
|
|
538
|
-
withTransaction(
|
|
539
|
-
pipe(
|
|
540
|
-
RTE.Do,
|
|
541
|
-
RTE.bind('from', () => debitAccount(fromId, amount)),
|
|
542
|
-
RTE.bind('to', () => creditAccount(toId, amount)),
|
|
543
|
-
RTE.bind('transfer', ({ from, to }) =>
|
|
544
|
-
createTransferRecord(from, to, amount)
|
|
545
|
-
),
|
|
546
|
-
RTE.map(({ transfer }) => transfer)
|
|
547
|
-
)
|
|
548
|
-
)
|
|
549
|
-
|
|
550
|
-
// Inside transaction, use tx instead of db
|
|
551
|
-
const debitAccount = (
|
|
552
|
-
accountId: string,
|
|
553
|
-
amount: number
|
|
554
|
-
): RTE.ReaderTaskEither<TxDeps, TransferError, Account> =>
|
|
555
|
-
pipe(
|
|
556
|
-
RTE.ask<TxDeps>(),
|
|
557
|
-
RTE.flatMap(({ tx }) =>
|
|
558
|
-
RTE.fromTaskEither(
|
|
559
|
-
pipe(
|
|
560
|
-
TE.tryCatch(
|
|
561
|
-
() =>
|
|
562
|
-
tx.account.update({
|
|
563
|
-
where: { id: accountId },
|
|
564
|
-
data: { balance: { decrement: amount } },
|
|
565
|
-
}),
|
|
566
|
-
toDbError
|
|
567
|
-
),
|
|
568
|
-
TE.flatMap(account =>
|
|
569
|
-
account.balance < 0
|
|
570
|
-
? TE.left({ _tag: 'InsufficientFunds' as const, accountId })
|
|
571
|
-
: TE.right(account)
|
|
572
|
-
)
|
|
573
|
-
)
|
|
574
|
-
)
|
|
575
|
-
)
|
|
576
|
-
)
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
## Middleware Patterns
|
|
580
|
-
|
|
581
|
-
### Express Middleware
|
|
582
|
-
|
|
583
|
-
```typescript
|
|
584
|
-
// src/middleware/fp-express.ts
|
|
585
|
-
import { Request, Response, NextFunction, RequestHandler } from 'express'
|
|
586
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
587
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
588
|
-
import * as E from 'fp-ts/Either'
|
|
589
|
-
import { pipe } from 'fp-ts/function'
|
|
590
|
-
|
|
591
|
-
// Convert RTE handler to Express middleware
|
|
592
|
-
export const toHandler =
|
|
593
|
-
<R, E, A>(
|
|
594
|
-
getDeps: (req: Request) => R,
|
|
595
|
-
handler: (req: Request) => RTE.ReaderTaskEither<R, E, A>,
|
|
596
|
-
onError: (error: E, res: Response) => void
|
|
597
|
-
): RequestHandler =>
|
|
598
|
-
async (req, res, next) => {
|
|
599
|
-
const deps = getDeps(req)
|
|
600
|
-
const result = await handler(req)(deps)()
|
|
601
|
-
|
|
602
|
-
pipe(
|
|
603
|
-
result,
|
|
604
|
-
E.fold(
|
|
605
|
-
error => onError(error, res),
|
|
606
|
-
data => res.json(data)
|
|
607
|
-
)
|
|
608
|
-
)
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
// Error handler
|
|
612
|
-
const handleError = (error: AppError, res: Response): void => {
|
|
613
|
-
switch (error._tag) {
|
|
614
|
-
case 'NotFound':
|
|
615
|
-
res.status(404).json({ error: error.resource + ' not found' })
|
|
616
|
-
break
|
|
617
|
-
case 'ValidationError':
|
|
618
|
-
res.status(400).json({ error: error.message })
|
|
619
|
-
break
|
|
620
|
-
case 'Unauthorized':
|
|
621
|
-
res.status(401).json({ error: error.reason })
|
|
622
|
-
break
|
|
623
|
-
default:
|
|
624
|
-
res.status(500).json({ error: 'Internal server error' })
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
// Usage
|
|
629
|
-
const getUserHandler = toHandler(
|
|
630
|
-
req => req.app.locals.deps as AppDeps,
|
|
631
|
-
req => UserService.findById(req.params.id),
|
|
632
|
-
handleError
|
|
633
|
-
)
|
|
634
|
-
|
|
635
|
-
app.get('/users/:id', getUserHandler)
|
|
636
|
-
```
|
|
637
|
-
|
|
638
|
-
### Hono Middleware
|
|
639
|
-
|
|
640
|
-
```typescript
|
|
641
|
-
// src/middleware/fp-hono.ts
|
|
642
|
-
import { Hono, Context, MiddlewareHandler } from 'hono'
|
|
643
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
644
|
-
import * as E from 'fp-ts/Either'
|
|
645
|
-
import { pipe } from 'fp-ts/function'
|
|
646
|
-
|
|
647
|
-
// Store deps in context
|
|
648
|
-
declare module 'hono' {
|
|
649
|
-
interface ContextVariableMap {
|
|
650
|
-
deps: AppDeps
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
// Dependency injection middleware
|
|
655
|
-
export const withDeps = (deps: AppDeps): MiddlewareHandler =>
|
|
656
|
-
async (c, next) => {
|
|
657
|
-
c.set('deps', deps)
|
|
658
|
-
await next()
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
// Convert RTE to Hono handler
|
|
662
|
-
export const toHonoHandler =
|
|
663
|
-
<E, A>(
|
|
664
|
-
handler: (c: Context) => RTE.ReaderTaskEither<AppDeps, E, A>,
|
|
665
|
-
onError: (error: E, c: Context) => Response
|
|
666
|
-
) =>
|
|
667
|
-
async (c: Context): Promise<Response> => {
|
|
668
|
-
const deps = c.get('deps')
|
|
669
|
-
const result = await handler(c)(deps)()
|
|
670
|
-
|
|
671
|
-
return pipe(
|
|
672
|
-
result,
|
|
673
|
-
E.fold(
|
|
674
|
-
error => onError(error, c),
|
|
675
|
-
data => c.json(data)
|
|
676
|
-
)
|
|
677
|
-
)
|
|
678
|
-
}
|
|
679
|
-
|
|
680
|
-
// Validation middleware
|
|
681
|
-
export const validate =
|
|
682
|
-
<T>(schema: z.ZodSchema<T>): MiddlewareHandler =>
|
|
683
|
-
async (c, next) => {
|
|
684
|
-
const body = await c.req.json()
|
|
685
|
-
const result = schema.safeParse(body)
|
|
686
|
-
|
|
687
|
-
if (!result.success) {
|
|
688
|
-
return c.json(
|
|
689
|
-
{ error: 'Validation failed', details: result.error.flatten() },
|
|
690
|
-
400
|
|
691
|
-
)
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
c.set('validatedBody', result.data)
|
|
695
|
-
await next()
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
// Auth middleware using RTE
|
|
699
|
-
export const requireAuth: MiddlewareHandler = async (c, next) => {
|
|
700
|
-
const deps = c.get('deps')
|
|
701
|
-
const token = c.req.header('Authorization')?.replace('Bearer ', '')
|
|
702
|
-
|
|
703
|
-
if (!token) {
|
|
704
|
-
return c.json({ error: 'No token provided' }, 401)
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
const result = await pipe(
|
|
708
|
-
deps.jwt.verify(token),
|
|
709
|
-
TE.mapLeft(() => ({ _tag: 'Unauthorized' as const, reason: 'Invalid token' }))
|
|
710
|
-
)()
|
|
711
|
-
|
|
712
|
-
if (E.isLeft(result)) {
|
|
713
|
-
return c.json({ error: result.left.reason }, 401)
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
c.set('user', result.right)
|
|
717
|
-
await next()
|
|
718
|
-
}
|
|
719
|
-
|
|
720
|
-
// Usage
|
|
721
|
-
const app = new Hono()
|
|
722
|
-
|
|
723
|
-
app.use('*', withDeps(deps))
|
|
724
|
-
app.use('/api/*', requireAuth)
|
|
725
|
-
|
|
726
|
-
app.get(
|
|
727
|
-
'/api/users/:id',
|
|
728
|
-
toHonoHandler(
|
|
729
|
-
c => UserService.findById(c.req.param('id')),
|
|
730
|
-
(error, c) => {
|
|
731
|
-
if (error._tag === 'UserNotFound') {
|
|
732
|
-
return c.json({ error: 'User not found' }, 404)
|
|
733
|
-
}
|
|
734
|
-
return c.json({ error: 'Internal error' }, 500)
|
|
735
|
-
}
|
|
736
|
-
)
|
|
737
|
-
)
|
|
738
|
-
```
|
|
739
|
-
|
|
740
|
-
### Request Context Pattern
|
|
741
|
-
|
|
742
|
-
```typescript
|
|
743
|
-
// src/context.ts
|
|
744
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
745
|
-
import { pipe } from 'fp-ts/function'
|
|
746
|
-
|
|
747
|
-
// Request-scoped context
|
|
748
|
-
type RequestContext = {
|
|
749
|
-
requestId: string
|
|
750
|
-
userId: O.Option<string>
|
|
751
|
-
startTime: number
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
type ContextDeps = AppDeps & { ctx: RequestContext }
|
|
755
|
-
|
|
756
|
-
// Logging with context
|
|
757
|
-
const logWithContext =
|
|
758
|
-
(level: 'info' | 'warn' | 'error') =>
|
|
759
|
-
(message: string, meta?: object): RTE.ReaderTaskEither<ContextDeps, never, void> =>
|
|
760
|
-
pipe(
|
|
761
|
-
RTE.ask<ContextDeps>(),
|
|
762
|
-
RTE.flatMap(({ logger, ctx }) =>
|
|
763
|
-
RTE.fromIO(() =>
|
|
764
|
-
loggerlevel,
|
|
765
|
-
elapsed: Date.now() - ctx.startTime,
|
|
766
|
-
})
|
|
767
|
-
)
|
|
768
|
-
)
|
|
769
|
-
)
|
|
770
|
-
|
|
771
|
-
export const log = {
|
|
772
|
-
info: logWithContext('info'),
|
|
773
|
-
warn: logWithContext('warn'),
|
|
774
|
-
error: logWithContext('error'),
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
// Middleware to create context
|
|
778
|
-
export const withContext: MiddlewareHandler = async (c, next) => {
|
|
779
|
-
const deps = c.get('deps')
|
|
780
|
-
const ctx: RequestContext = {
|
|
781
|
-
requestId: crypto.randomUUID(),
|
|
782
|
-
userId: O.fromNullable(c.get('user')?.id),
|
|
783
|
-
startTime: Date.now(),
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
c.set('deps', { ...deps, ctx })
|
|
787
|
-
|
|
788
|
-
// Log request start
|
|
789
|
-
deps.logger.info('Request started', {
|
|
790
|
-
requestId: ctx.requestId,
|
|
791
|
-
method: c.req.method,
|
|
792
|
-
path: c.req.path,
|
|
793
|
-
})
|
|
794
|
-
|
|
795
|
-
await next()
|
|
796
|
-
|
|
797
|
-
// Log request end
|
|
798
|
-
deps.logger.info('Request completed', {
|
|
799
|
-
requestId: ctx.requestId,
|
|
800
|
-
status: c.res.status,
|
|
801
|
-
elapsed: Date.now() - ctx.startTime,
|
|
802
|
-
})
|
|
803
|
-
}
|
|
804
|
-
```
|
|
805
|
-
|
|
806
|
-
## Error Handling Patterns
|
|
807
|
-
|
|
808
|
-
### Typed Error Hierarchy
|
|
809
|
-
|
|
810
|
-
```typescript
|
|
811
|
-
// src/errors.ts
|
|
812
|
-
import * as E from 'fp-ts/Either'
|
|
813
|
-
import * as O from 'fp-ts/Option'
|
|
814
|
-
|
|
815
|
-
// Base error types
|
|
816
|
-
type DomainError =
|
|
817
|
-
| NotFoundError
|
|
818
|
-
| ValidationError
|
|
819
|
-
| ConflictError
|
|
820
|
-
| AuthError
|
|
821
|
-
| InfrastructureError
|
|
822
|
-
|
|
823
|
-
type NotFoundError = {
|
|
824
|
-
_tag: 'NotFoundError'
|
|
825
|
-
resource: string
|
|
826
|
-
id: string
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
type ValidationError = {
|
|
830
|
-
_tag: 'ValidationError'
|
|
831
|
-
field: string
|
|
832
|
-
message: string
|
|
833
|
-
value?: unknown
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
type ConflictError = {
|
|
837
|
-
_tag: 'ConflictError'
|
|
838
|
-
resource: string
|
|
839
|
-
field: string
|
|
840
|
-
value: string
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
type AuthError =
|
|
844
|
-
| { _tag: 'Unauthenticated' }
|
|
845
|
-
| { _tag: 'Unauthorized'; required: string }
|
|
846
|
-
| { _tag: 'TokenExpired' }
|
|
847
|
-
|
|
848
|
-
type InfrastructureError = {
|
|
849
|
-
_tag: 'InfrastructureError'
|
|
850
|
-
service: string
|
|
851
|
-
cause: unknown
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
// Smart constructors
|
|
855
|
-
export const notFound = (resource: string, id: string): NotFoundError => ({
|
|
856
|
-
_tag: 'NotFoundError',
|
|
857
|
-
resource,
|
|
858
|
-
id,
|
|
859
|
-
})
|
|
860
|
-
|
|
861
|
-
export const validation = (
|
|
862
|
-
field: string,
|
|
863
|
-
message: string,
|
|
864
|
-
value?: unknown
|
|
865
|
-
): ValidationError => ({
|
|
866
|
-
_tag: 'ValidationError',
|
|
867
|
-
field,
|
|
868
|
-
message,
|
|
869
|
-
value,
|
|
870
|
-
})
|
|
871
|
-
|
|
872
|
-
export const conflict = (
|
|
873
|
-
resource: string,
|
|
874
|
-
field: string,
|
|
875
|
-
value: string
|
|
876
|
-
): ConflictError => ({
|
|
877
|
-
_tag: 'ConflictError',
|
|
878
|
-
resource,
|
|
879
|
-
field,
|
|
880
|
-
value,
|
|
881
|
-
})
|
|
882
|
-
|
|
883
|
-
// Error to HTTP status mapping
|
|
884
|
-
export const toHttpStatus = (error: DomainError): number => {
|
|
885
|
-
switch (error._tag) {
|
|
886
|
-
case 'NotFoundError':
|
|
887
|
-
return 404
|
|
888
|
-
case 'ValidationError':
|
|
889
|
-
return 400
|
|
890
|
-
case 'ConflictError':
|
|
891
|
-
return 409
|
|
892
|
-
case 'Unauthenticated':
|
|
893
|
-
return 401
|
|
894
|
-
case 'Unauthorized':
|
|
895
|
-
return 403
|
|
896
|
-
case 'TokenExpired':
|
|
897
|
-
return 401
|
|
898
|
-
case 'InfrastructureError':
|
|
899
|
-
return 503
|
|
900
|
-
default:
|
|
901
|
-
return 500
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
|
|
905
|
-
// Error to response body
|
|
906
|
-
export const toResponseBody = (
|
|
907
|
-
error: DomainError
|
|
908
|
-
): { error: string; details?: unknown } => {
|
|
909
|
-
switch (error._tag) {
|
|
910
|
-
case 'NotFoundError':
|
|
911
|
-
return { error: `${error.resource} not found` }
|
|
912
|
-
case 'ValidationError':
|
|
913
|
-
return {
|
|
914
|
-
error: 'Validation failed',
|
|
915
|
-
details: { field: error.field, message: error.message },
|
|
916
|
-
}
|
|
917
|
-
case 'ConflictError':
|
|
918
|
-
return {
|
|
919
|
-
error: `${error.resource} with ${error.field} already exists`,
|
|
920
|
-
}
|
|
921
|
-
case 'Unauthenticated':
|
|
922
|
-
return { error: 'Authentication required' }
|
|
923
|
-
case 'Unauthorized':
|
|
924
|
-
return { error: `Permission denied: ${error.required}` }
|
|
925
|
-
case 'TokenExpired':
|
|
926
|
-
return { error: 'Token expired' }
|
|
927
|
-
case 'InfrastructureError':
|
|
928
|
-
return { error: 'Service temporarily unavailable' }
|
|
929
|
-
}
|
|
930
|
-
}
|
|
931
|
-
```
|
|
932
|
-
|
|
933
|
-
### Error Recovery
|
|
934
|
-
|
|
935
|
-
```typescript
|
|
936
|
-
// src/lib/recovery.ts
|
|
937
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
938
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
939
|
-
import { pipe } from 'fp-ts/function'
|
|
940
|
-
|
|
941
|
-
// Retry with exponential backoff
|
|
942
|
-
export const withRetry =
|
|
943
|
-
<R, E, A>(
|
|
944
|
-
maxAttempts: number,
|
|
945
|
-
baseDelayMs: number,
|
|
946
|
-
shouldRetry: (error: E) => boolean
|
|
947
|
-
) =>
|
|
948
|
-
(
|
|
949
|
-
operation: RTE.ReaderTaskEither<R, E, A>
|
|
950
|
-
): RTE.ReaderTaskEither<R, E, A> =>
|
|
951
|
-
pipe(
|
|
952
|
-
RTE.ask<R>(),
|
|
953
|
-
RTE.flatMap(deps => {
|
|
954
|
-
const attempt = (
|
|
955
|
-
remaining: number,
|
|
956
|
-
delay: number
|
|
957
|
-
): TE.TaskEither<E, A> =>
|
|
958
|
-
pipe(
|
|
959
|
-
operation(deps),
|
|
960
|
-
TE.orElse(error => {
|
|
961
|
-
if (remaining <= 0 || !shouldRetry(error)) {
|
|
962
|
-
return TE.left(error)
|
|
963
|
-
}
|
|
964
|
-
return pipe(
|
|
965
|
-
TE.fromTask(() => new Promise(r => setTimeout(r, delay))),
|
|
966
|
-
TE.flatMap(() => attempt(remaining - 1, delay * 2))
|
|
967
|
-
)
|
|
968
|
-
})
|
|
969
|
-
)
|
|
970
|
-
|
|
971
|
-
return RTE.fromTaskEither(attempt(maxAttempts - 1, baseDelayMs))
|
|
972
|
-
})
|
|
973
|
-
)
|
|
974
|
-
|
|
975
|
-
// Fallback to cached value
|
|
976
|
-
export const withFallback =
|
|
977
|
-
<R extends { cache: CacheClient }, E, A>(
|
|
978
|
-
cacheKey: string,
|
|
979
|
-
ttlSeconds: number
|
|
980
|
-
) =>
|
|
981
|
-
(
|
|
982
|
-
operation: RTE.ReaderTaskEither<R, E, A>
|
|
983
|
-
): RTE.ReaderTaskEither<R, E, A> =>
|
|
984
|
-
pipe(
|
|
985
|
-
RTE.ask<R>(),
|
|
986
|
-
RTE.flatMap(({ cache, ...rest }) =>
|
|
987
|
-
pipe(
|
|
988
|
-
operation,
|
|
989
|
-
// On success, cache the result
|
|
990
|
-
RTE.tap(result =>
|
|
991
|
-
RTE.fromTaskEither(cache.set(cacheKey, result, ttlSeconds))
|
|
992
|
-
),
|
|
993
|
-
// On failure, try to get cached value
|
|
994
|
-
RTE.orElse(error =>
|
|
995
|
-
pipe(
|
|
996
|
-
RTE.fromTaskEither(cache.get<A>(cacheKey)),
|
|
997
|
-
RTE.flatMap(cached =>
|
|
998
|
-
cached ? RTE.right(cached) : RTE.left(error)
|
|
999
|
-
)
|
|
1000
|
-
)
|
|
1001
|
-
)
|
|
1002
|
-
)
|
|
1003
|
-
)
|
|
1004
|
-
)
|
|
1005
|
-
|
|
1006
|
-
// Circuit breaker
|
|
1007
|
-
type CircuitState = 'closed' | 'open' | 'half-open'
|
|
1008
|
-
|
|
1009
|
-
export const createCircuitBreaker = <E>(
|
|
1010
|
-
failureThreshold: number,
|
|
1011
|
-
resetTimeoutMs: number,
|
|
1012
|
-
isFailure: (error: E) => boolean
|
|
1013
|
-
) => {
|
|
1014
|
-
let state: CircuitState = 'closed'
|
|
1015
|
-
let failures = 0
|
|
1016
|
-
let lastFailure = 0
|
|
1017
|
-
|
|
1018
|
-
return <R, A>(
|
|
1019
|
-
operation: RTE.ReaderTaskEither<R, E, A>
|
|
1020
|
-
): RTE.ReaderTaskEither<R, E | { _tag: 'CircuitOpen' }, A> =>
|
|
1021
|
-
pipe(
|
|
1022
|
-
RTE.ask<R>(),
|
|
1023
|
-
RTE.flatMap(deps => {
|
|
1024
|
-
// Check if circuit should reset
|
|
1025
|
-
if (
|
|
1026
|
-
state === 'open' &&
|
|
1027
|
-
Date.now() - lastFailure > resetTimeoutMs
|
|
1028
|
-
) {
|
|
1029
|
-
state = 'half-open'
|
|
1030
|
-
}
|
|
1031
|
-
|
|
1032
|
-
if (state === 'open') {
|
|
1033
|
-
return RTE.left({ _tag: 'CircuitOpen' as const })
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
return pipe(
|
|
1037
|
-
operation,
|
|
1038
|
-
RTE.tap(() => {
|
|
1039
|
-
if (state === 'half-open') {
|
|
1040
|
-
state = 'closed'
|
|
1041
|
-
failures = 0
|
|
1042
|
-
}
|
|
1043
|
-
return RTE.right(undefined)
|
|
1044
|
-
}),
|
|
1045
|
-
RTE.tapError(error => {
|
|
1046
|
-
if (isFailure(error)) {
|
|
1047
|
-
failures++
|
|
1048
|
-
lastFailure = Date.now()
|
|
1049
|
-
if (failures >= failureThreshold) {
|
|
1050
|
-
state = 'open'
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
return RTE.right(undefined)
|
|
1054
|
-
})
|
|
1055
|
-
)
|
|
1056
|
-
})
|
|
1057
|
-
)
|
|
1058
|
-
}
|
|
1059
|
-
```
|
|
1060
|
-
|
|
1061
|
-
## Testing Strategies
|
|
1062
|
-
|
|
1063
|
-
### Mocking Dependencies
|
|
1064
|
-
|
|
1065
|
-
```typescript
|
|
1066
|
-
// src/services/__tests__/user.service.test.ts
|
|
1067
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
1068
|
-
import * as E from 'fp-ts/Either'
|
|
1069
|
-
import * as O from 'fp-ts/Option'
|
|
1070
|
-
import { describe, it, expect, vi } from 'vitest'
|
|
1071
|
-
import * as UserService from '../user.service'
|
|
1072
|
-
|
|
1073
|
-
// Create mock dependencies
|
|
1074
|
-
const createMockDeps = (overrides: Partial<UserDeps> = {}): UserDeps => ({
|
|
1075
|
-
db: {
|
|
1076
|
-
users: {
|
|
1077
|
-
findUnique: vi.fn(() => Promise.resolve(null)),
|
|
1078
|
-
create: vi.fn(data => Promise.resolve({ id: '1', ...data })),
|
|
1079
|
-
update: vi.fn((where, data) => Promise.resolve({ id: where.id, ...data })),
|
|
1080
|
-
},
|
|
1081
|
-
},
|
|
1082
|
-
hasher: {
|
|
1083
|
-
hash: vi.fn(password => TE.right(`hashed_${password}`)),
|
|
1084
|
-
verify: vi.fn(() => TE.right(true)),
|
|
1085
|
-
},
|
|
1086
|
-
mailer: {
|
|
1087
|
-
send: vi.fn(() => TE.right(undefined)),
|
|
1088
|
-
},
|
|
1089
|
-
...overrides,
|
|
1090
|
-
})
|
|
1091
|
-
|
|
1092
|
-
describe('UserService', () => {
|
|
1093
|
-
describe('create', () => {
|
|
1094
|
-
it('should create a user with hashed password', async () => {
|
|
1095
|
-
const deps = createMockDeps()
|
|
1096
|
-
const input = {
|
|
1097
|
-
email: 'test@example.com',
|
|
1098
|
-
password: 'secret123',
|
|
1099
|
-
name: 'Test User',
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
const result = await UserService.create(input)(deps)()
|
|
1103
|
-
|
|
1104
|
-
expect(E.isRight(result)).toBe(true)
|
|
1105
|
-
if (E.isRight(result)) {
|
|
1106
|
-
expect(result.right.email).toBe(input.email)
|
|
1107
|
-
}
|
|
1108
|
-
expect(deps.hasher.hash).toHaveBeenCalledWith('secret123')
|
|
1109
|
-
})
|
|
1110
|
-
|
|
1111
|
-
it('should fail when email already exists', async () => {
|
|
1112
|
-
const existingUser = { id: '1', email: 'test@example.com' }
|
|
1113
|
-
const deps = createMockDeps({
|
|
1114
|
-
db: {
|
|
1115
|
-
users: {
|
|
1116
|
-
findUnique: vi.fn(() => Promise.resolve(existingUser)),
|
|
1117
|
-
create: vi.fn(),
|
|
1118
|
-
},
|
|
1119
|
-
},
|
|
1120
|
-
})
|
|
1121
|
-
|
|
1122
|
-
const result = await UserService.create({
|
|
1123
|
-
email: 'test@example.com',
|
|
1124
|
-
password: 'secret',
|
|
1125
|
-
name: 'Test',
|
|
1126
|
-
})(deps)()
|
|
1127
|
-
|
|
1128
|
-
expect(E.isLeft(result)).toBe(true)
|
|
1129
|
-
if (E.isLeft(result)) {
|
|
1130
|
-
expect(result.left._tag).toBe('EmailExists')
|
|
1131
|
-
}
|
|
1132
|
-
})
|
|
1133
|
-
})
|
|
1134
|
-
|
|
1135
|
-
describe('findById', () => {
|
|
1136
|
-
it('should return user when found', async () => {
|
|
1137
|
-
const user = { id: '1', email: 'test@example.com', name: 'Test' }
|
|
1138
|
-
const deps = createMockDeps({
|
|
1139
|
-
db: {
|
|
1140
|
-
users: {
|
|
1141
|
-
findUnique: vi.fn(() => Promise.resolve(user)),
|
|
1142
|
-
},
|
|
1143
|
-
},
|
|
1144
|
-
})
|
|
1145
|
-
|
|
1146
|
-
const result = await UserService.findById('1')(deps)()
|
|
1147
|
-
|
|
1148
|
-
expect(E.isRight(result)).toBe(true)
|
|
1149
|
-
if (E.isRight(result)) {
|
|
1150
|
-
expect(result.right).toEqual(user)
|
|
1151
|
-
}
|
|
1152
|
-
})
|
|
1153
|
-
|
|
1154
|
-
it('should return NotFound when user does not exist', async () => {
|
|
1155
|
-
const deps = createMockDeps()
|
|
1156
|
-
|
|
1157
|
-
const result = await UserService.findById('nonexistent')(deps)()
|
|
1158
|
-
|
|
1159
|
-
expect(E.isLeft(result)).toBe(true)
|
|
1160
|
-
if (E.isLeft(result)) {
|
|
1161
|
-
expect(result.left._tag).toBe('UserNotFound')
|
|
1162
|
-
expect(result.left.id).toBe('nonexistent')
|
|
1163
|
-
}
|
|
1164
|
-
})
|
|
1165
|
-
})
|
|
1166
|
-
})
|
|
1167
|
-
```
|
|
1168
|
-
|
|
1169
|
-
### Integration Testing with Test Containers
|
|
1170
|
-
|
|
1171
|
-
```typescript
|
|
1172
|
-
// src/__tests__/integration/user.integration.test.ts
|
|
1173
|
-
import { PostgreSqlContainer } from '@testcontainers/postgresql'
|
|
1174
|
-
import { PrismaClient } from '@prisma/client'
|
|
1175
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
1176
|
-
import * as E from 'fp-ts/Either'
|
|
1177
|
-
import { pipe } from 'fp-ts/function'
|
|
1178
|
-
import { describe, it, expect, beforeAll, afterAll } from 'vitest'
|
|
1179
|
-
import { buildDeps, destroyDeps, AppDeps } from '../../deps'
|
|
1180
|
-
import * as UserService from '../../services/user.service'
|
|
1181
|
-
|
|
1182
|
-
describe('UserService Integration', () => {
|
|
1183
|
-
let container: PostgreSqlContainer
|
|
1184
|
-
let deps: AppDeps
|
|
1185
|
-
|
|
1186
|
-
beforeAll(async () => {
|
|
1187
|
-
// Start PostgreSQL container
|
|
1188
|
-
container = await new PostgreSqlContainer().start()
|
|
1189
|
-
|
|
1190
|
-
// Build real dependencies with test database
|
|
1191
|
-
process.env.DATABASE_URL = container.getConnectionUri()
|
|
1192
|
-
|
|
1193
|
-
const depsResult = await buildDeps()()
|
|
1194
|
-
if (E.isLeft(depsResult)) {
|
|
1195
|
-
throw new Error(`Failed to build deps: ${depsResult.left}`)
|
|
1196
|
-
}
|
|
1197
|
-
deps = depsResult.right
|
|
1198
|
-
|
|
1199
|
-
// Run migrations
|
|
1200
|
-
await deps.db.$executeRaw`CREATE EXTENSION IF NOT EXISTS "uuid-ossp"`
|
|
1201
|
-
// ... run Prisma migrations
|
|
1202
|
-
}, 60000)
|
|
1203
|
-
|
|
1204
|
-
afterAll(async () => {
|
|
1205
|
-
await destroyDeps(deps)()
|
|
1206
|
-
await container.stop()
|
|
1207
|
-
})
|
|
1208
|
-
|
|
1209
|
-
it('should create and retrieve a user', async () => {
|
|
1210
|
-
// Create user
|
|
1211
|
-
const createResult = await UserService.create({
|
|
1212
|
-
email: 'integration@test.com',
|
|
1213
|
-
password: 'password123',
|
|
1214
|
-
name: 'Integration Test',
|
|
1215
|
-
})(deps)()
|
|
1216
|
-
|
|
1217
|
-
expect(E.isRight(createResult)).toBe(true)
|
|
1218
|
-
if (E.isLeft(createResult)) return
|
|
1219
|
-
|
|
1220
|
-
const user = createResult.right
|
|
1221
|
-
|
|
1222
|
-
// Retrieve user
|
|
1223
|
-
const findResult = await UserService.findById(user.id)(deps)()
|
|
1224
|
-
|
|
1225
|
-
expect(E.isRight(findResult)).toBe(true)
|
|
1226
|
-
if (E.isRight(findResult)) {
|
|
1227
|
-
expect(findResult.right.email).toBe('integration@test.com')
|
|
1228
|
-
}
|
|
1229
|
-
})
|
|
1230
|
-
})
|
|
1231
|
-
```
|
|
1232
|
-
|
|
1233
|
-
### Property-Based Testing
|
|
1234
|
-
|
|
1235
|
-
```typescript
|
|
1236
|
-
// src/__tests__/property/user.property.test.ts
|
|
1237
|
-
import * as fc from 'fast-check'
|
|
1238
|
-
import * as E from 'fp-ts/Either'
|
|
1239
|
-
import { describe, it, expect } from 'vitest'
|
|
1240
|
-
import { validateEmail, validatePassword } from '../../validation'
|
|
1241
|
-
|
|
1242
|
-
describe('Validation Properties', () => {
|
|
1243
|
-
it('valid emails should pass validation', () => {
|
|
1244
|
-
fc.assert(
|
|
1245
|
-
fc.property(fc.emailAddress(), email => {
|
|
1246
|
-
const result = validateEmail(email)
|
|
1247
|
-
return E.isRight(result)
|
|
1248
|
-
})
|
|
1249
|
-
)
|
|
1250
|
-
})
|
|
1251
|
-
|
|
1252
|
-
it('passwords meeting requirements should pass', () => {
|
|
1253
|
-
const validPassword = fc
|
|
1254
|
-
.tuple(
|
|
1255
|
-
fc.stringOf(fc.constantFrom(...'abcdefghijklmnopqrstuvwxyz'), {
|
|
1256
|
-
minLength: 4,
|
|
1257
|
-
}),
|
|
1258
|
-
fc.stringOf(fc.constantFrom(...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'), {
|
|
1259
|
-
minLength: 1,
|
|
1260
|
-
}),
|
|
1261
|
-
fc.stringOf(fc.constantFrom(...'0123456789'), { minLength: 1 }),
|
|
1262
|
-
fc.stringOf(fc.constantFrom(...'!@#$%^&*'), { minLength: 1 })
|
|
1263
|
-
)
|
|
1264
|
-
.map(parts => parts.join(''))
|
|
1265
|
-
|
|
1266
|
-
fc.assert(
|
|
1267
|
-
fc.property(validPassword, password => {
|
|
1268
|
-
const result = validatePassword(password)
|
|
1269
|
-
return E.isRight(result)
|
|
1270
|
-
})
|
|
1271
|
-
)
|
|
1272
|
-
})
|
|
1273
|
-
|
|
1274
|
-
it('empty strings should fail email validation', () => {
|
|
1275
|
-
const result = validateEmail('')
|
|
1276
|
-
expect(E.isLeft(result)).toBe(true)
|
|
1277
|
-
})
|
|
1278
|
-
})
|
|
1279
|
-
```
|
|
1280
|
-
|
|
1281
|
-
## Quick Reference
|
|
1282
|
-
|
|
1283
|
-
### Common Imports
|
|
1284
|
-
|
|
1285
|
-
```typescript
|
|
1286
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
1287
|
-
import * as TE from 'fp-ts/TaskEither'
|
|
1288
|
-
import * as E from 'fp-ts/Either'
|
|
1289
|
-
import * as O from 'fp-ts/Option'
|
|
1290
|
-
import * as A from 'fp-ts/Array'
|
|
1291
|
-
import * as T from 'fp-ts/Task'
|
|
1292
|
-
import { pipe, flow } from 'fp-ts/function'
|
|
1293
|
-
```
|
|
1294
|
-
|
|
1295
|
-
### RTE Cheat Sheet
|
|
1296
|
-
|
|
1297
|
-
| Operation | Description |
|
|
1298
|
-
|-----------|-------------|
|
|
1299
|
-
| `RTE.right(a)` | Lift value into success |
|
|
1300
|
-
| `RTE.left(e)` | Create error |
|
|
1301
|
-
| `RTE.ask<R>()` | Get dependencies |
|
|
1302
|
-
| `RTE.fromTaskEither(te)` | Lift TaskEither |
|
|
1303
|
-
| `RTE.fromEither(e)` | Lift Either |
|
|
1304
|
-
| `RTE.fromOption(onNone)(o)` | Lift Option |
|
|
1305
|
-
| `RTE.flatMap(f)` | Chain operations |
|
|
1306
|
-
| `RTE.map(f)` | Transform success |
|
|
1307
|
-
| `RTE.mapLeft(f)` | Transform error |
|
|
1308
|
-
| `RTE.tap(f)` | Side effect on success |
|
|
1309
|
-
| `RTE.tapError(f)` | Side effect on error |
|
|
1310
|
-
| `RTE.orElse(f)` | Recover from error |
|
|
1311
|
-
| `RTE.getOrElse(f)` | Extract with fallback |
|
|
1312
|
-
|
|
1313
|
-
### Service Template
|
|
1314
|
-
|
|
1315
|
-
```typescript
|
|
1316
|
-
// Template for a new service
|
|
1317
|
-
import * as RTE from 'fp-ts/ReaderTaskEither'
|
|
1318
|
-
import { pipe } from 'fp-ts/function'
|
|
1319
|
-
|
|
1320
|
-
type MyServiceDeps = {
|
|
1321
|
-
db: DatabaseClient
|
|
1322
|
-
// ... other dependencies
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
type MyServiceError =
|
|
1326
|
-
| { _tag: 'NotFound'; id: string }
|
|
1327
|
-
| { _tag: 'ValidationFailed'; reason: string }
|
|
1328
|
-
|
|
1329
|
-
export const myOperation = (
|
|
1330
|
-
input: Input
|
|
1331
|
-
): RTE.ReaderTaskEither<MyServiceDeps, MyServiceError, Output> =>
|
|
1332
|
-
pipe(
|
|
1333
|
-
RTE.ask<MyServiceDeps>(),
|
|
1334
|
-
RTE.flatMap(deps =>
|
|
1335
|
-
// Your implementation here
|
|
1336
|
-
RTE.right(output)
|
|
1337
|
-
)
|
|
1338
|
-
)
|
|
1339
|
-
```
|
|
1340
|
-
|
|
1341
33
|
## Limitations
|
|
1342
34
|
- Use this skill only when the task clearly matches the scope described above.
|
|
1343
35
|
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
|