claudecode-omc 5.6.4 → 5.6.6
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/.local/commands/code-review.md +416 -0
- package/.local/commands/pr.md +250 -0
- package/.local/commands/prp-pr.md +244 -0
- package/.local/guidelines/CLAUDE.md +47 -0
- package/.local/skills/prompt-optimizer/SKILL.md +23 -4
- package/bundled/manifest.json +4 -4
- package/bundled/upstream/anthropic-skills/skills/algorithmic-art/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/brand-guidelines/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/canvas-design/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/claude-api/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/claude-api/SKILL.md +120 -58
- package/bundled/upstream/anthropic-skills/skills/claude-api/curl/examples.md +9 -9
- package/bundled/upstream/anthropic-skills/skills/claude-api/curl/managed-agents.md +336 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/go/managed-agents/README.md +561 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/java/claude-api.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/java/managed-agents/README.md +442 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/php/claude-api.md +10 -10
- package/bundled/upstream/anthropic-skills/skills/claude-api/php/managed-agents/README.md +435 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/README.md +16 -16
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/batches.md +3 -3
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/files-api.md +3 -3
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/streaming.md +7 -7
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/claude-api/tool-use.md +19 -19
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/managed-agents/README.md +332 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/claude-api.md +4 -4
- package/bundled/upstream/anthropic-skills/skills/claude-api/ruby/managed-agents/README.md +389 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/agent-design.md +101 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/error-codes.md +11 -4
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/live-sources.md +60 -48
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-api-reference.md +372 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-client-patterns.md +209 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-core.md +220 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-environments.md +211 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-events.md +195 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-memory.md +197 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-multiagent.md +99 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-onboarding.md +114 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-outcomes.md +106 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-overview.md +67 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-tools.md +315 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/managed-agents-webhooks.md +110 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/model-migration.md +779 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/models.md +16 -14
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/prompt-caching.md +45 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/shared/tool-use-concepts.md +28 -6
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/README.md +15 -15
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/batches.md +2 -2
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/files-api.md +1 -1
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/streaming.md +5 -5
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/claude-api/tool-use.md +15 -15
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/managed-agents/README.md +359 -0
- package/bundled/upstream/anthropic-skills/skills/internal-comms/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/mcp-builder/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/skill-creator/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/slack-gif-creator/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/theme-factory/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/web-artifacts-builder/LICENSE.txt +1 -1
- package/bundled/upstream/anthropic-skills/skills/webapp-testing/LICENSE.txt +1 -1
- package/bundled/upstream/ecc/.omc-source/bundle.json +2 -3
- package/bundled/upstream/ecc/.omc-source/manifests/.claude-plugin/marketplace.json +4 -4
- package/bundled/upstream/ecc/agents/a11y-architect.md +10 -2
- package/bundled/upstream/ecc/agents/architect.md +9 -0
- package/bundled/upstream/ecc/agents/build-error-resolver.md +9 -0
- package/bundled/upstream/ecc/agents/chief-of-staff.md +9 -0
- package/bundled/upstream/ecc/agents/code-architect.md +9 -0
- package/bundled/upstream/ecc/agents/code-explorer.md +10 -1
- package/bundled/upstream/ecc/agents/code-reviewer.md +87 -1
- package/bundled/upstream/ecc/agents/code-simplifier.md +9 -0
- package/bundled/upstream/ecc/agents/comment-analyzer.md +10 -1
- package/bundled/upstream/ecc/agents/conversation-analyzer.md +9 -0
- package/bundled/upstream/ecc/agents/cpp-build-resolver.md +9 -0
- package/bundled/upstream/ecc/agents/cpp-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/csharp-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/dart-build-resolver.md +9 -0
- package/bundled/upstream/ecc/agents/database-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/django-build-resolver.md +252 -0
- package/bundled/upstream/ecc/agents/django-reviewer.md +169 -0
- package/bundled/upstream/ecc/agents/doc-updater.md +9 -0
- package/bundled/upstream/ecc/agents/docs-lookup.md +9 -0
- package/bundled/upstream/ecc/agents/e2e-runner.md +9 -0
- package/bundled/upstream/ecc/agents/fastapi-reviewer.md +79 -0
- package/bundled/upstream/ecc/agents/flutter-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/fsharp-reviewer.md +109 -0
- package/bundled/upstream/ecc/agents/gan-evaluator.md +9 -0
- package/bundled/upstream/ecc/agents/gan-generator.md +9 -0
- package/bundled/upstream/ecc/agents/gan-planner.md +9 -0
- package/bundled/upstream/ecc/agents/go-build-resolver.md +9 -0
- package/bundled/upstream/ecc/agents/go-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/harmonyos-app-resolver.md +182 -0
- package/bundled/upstream/ecc/agents/harness-optimizer.md +9 -0
- package/bundled/upstream/ecc/agents/healthcare-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/homelab-architect.md +107 -0
- package/bundled/upstream/ecc/agents/java-build-resolver.md +133 -11
- package/bundled/upstream/ecc/agents/java-reviewer.md +130 -32
- package/bundled/upstream/ecc/agents/kotlin-build-resolver.md +9 -0
- package/bundled/upstream/ecc/agents/kotlin-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/loop-operator.md +9 -0
- package/bundled/upstream/ecc/agents/mle-reviewer.md +162 -0
- package/bundled/upstream/ecc/agents/network-architect.md +106 -0
- package/bundled/upstream/ecc/agents/network-config-reviewer.md +106 -0
- package/bundled/upstream/ecc/agents/network-troubleshooter.md +128 -0
- package/bundled/upstream/ecc/agents/opensource-forker.md +9 -0
- package/bundled/upstream/ecc/agents/opensource-packager.md +9 -0
- package/bundled/upstream/ecc/agents/opensource-sanitizer.md +9 -0
- package/bundled/upstream/ecc/agents/performance-optimizer.md +9 -0
- package/bundled/upstream/ecc/agents/planner.md +9 -0
- package/bundled/upstream/ecc/agents/pr-test-analyzer.md +9 -0
- package/bundled/upstream/ecc/agents/python-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/pytorch-build-resolver.md +12 -3
- package/bundled/upstream/ecc/agents/refactor-cleaner.md +9 -0
- package/bundled/upstream/ecc/agents/rust-build-resolver.md +9 -0
- package/bundled/upstream/ecc/agents/rust-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/security-reviewer.md +9 -0
- package/bundled/upstream/ecc/agents/seo-specialist.md +10 -1
- package/bundled/upstream/ecc/agents/silent-failure-hunter.md +9 -0
- package/bundled/upstream/ecc/agents/swift-build-resolver.md +170 -0
- package/bundled/upstream/ecc/agents/swift-reviewer.md +116 -0
- package/bundled/upstream/ecc/agents/tdd-guide.md +9 -0
- package/bundled/upstream/ecc/agents/type-design-analyzer.md +10 -1
- package/bundled/upstream/ecc/agents/typescript-reviewer.md +9 -0
- package/bundled/upstream/ecc/commands/auto-update.md +28 -0
- package/bundled/upstream/ecc/commands/build-fix.md +4 -0
- package/bundled/upstream/ecc/commands/checkpoint.md +4 -0
- package/bundled/upstream/ecc/commands/code-review.md +3 -3
- package/bundled/upstream/ecc/commands/cost-report.md +107 -0
- package/bundled/upstream/ecc/commands/cpp-build.md +1 -1
- package/bundled/upstream/ecc/commands/cpp-test.md +1 -1
- package/bundled/upstream/ecc/commands/ecc-guide.md +93 -0
- package/bundled/upstream/ecc/commands/fastapi-review.md +39 -0
- package/bundled/upstream/ecc/commands/flutter-build.md +1 -1
- package/bundled/upstream/ecc/commands/flutter-test.md +1 -1
- package/bundled/upstream/ecc/commands/gan-build.md +4 -0
- package/bundled/upstream/ecc/commands/gan-design.md +4 -0
- package/bundled/upstream/ecc/commands/go-build.md +1 -1
- package/bundled/upstream/ecc/commands/go-test.md +1 -1
- package/bundled/upstream/ecc/commands/harness-audit.md +4 -0
- package/bundled/upstream/ecc/commands/jira.md +2 -2
- package/bundled/upstream/ecc/commands/kotlin-build.md +1 -1
- package/bundled/upstream/ecc/commands/kotlin-test.md +1 -1
- package/bundled/upstream/ecc/commands/learn.md +4 -0
- package/bundled/upstream/ecc/commands/loop-start.md +4 -0
- package/bundled/upstream/ecc/commands/loop-status.md +54 -1
- package/bundled/upstream/ecc/commands/model-route.md +4 -0
- package/bundled/upstream/ecc/commands/multi-backend.md +4 -0
- package/bundled/upstream/ecc/commands/multi-execute.md +4 -0
- package/bundled/upstream/ecc/commands/multi-frontend.md +4 -0
- package/bundled/upstream/ecc/commands/multi-plan.md +4 -0
- package/bundled/upstream/ecc/commands/multi-workflow.md +4 -0
- package/bundled/upstream/ecc/commands/plan-prd.md +160 -0
- package/bundled/upstream/ecc/commands/plan.md +96 -13
- package/bundled/upstream/ecc/commands/pm2.md +4 -0
- package/bundled/upstream/ecc/commands/pr.md +184 -0
- package/bundled/upstream/ecc/commands/project-init.md +86 -0
- package/bundled/upstream/ecc/commands/python-review.md +1 -1
- package/bundled/upstream/ecc/commands/quality-gate.md +4 -0
- package/bundled/upstream/ecc/commands/refactor-clean.md +4 -0
- package/bundled/upstream/ecc/commands/rust-build.md +1 -1
- package/bundled/upstream/ecc/commands/rust-test.md +1 -1
- package/bundled/upstream/ecc/commands/security-scan.md +92 -0
- package/bundled/upstream/ecc/commands/sessions.md +6 -6
- package/bundled/upstream/ecc/commands/skill-health.md +3 -3
- package/bundled/upstream/ecc/commands/test-coverage.md +4 -0
- package/bundled/upstream/ecc/commands/update-codemaps.md +4 -0
- package/bundled/upstream/ecc/commands/update-docs.md +4 -0
- package/bundled/upstream/ecc/skills/accessibility/SKILL.md +1 -1
- package/bundled/upstream/ecc/skills/agent-architecture-audit/SKILL.md +256 -0
- package/bundled/upstream/ecc/skills/agent-payment-x402/SKILL.md +49 -3
- package/bundled/upstream/ecc/skills/agentic-os/SKILL.md +387 -0
- package/bundled/upstream/ecc/skills/angular-developer/SKILL.md +154 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/angular-animations.md +160 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/angular-aria.md +410 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/cli.md +86 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/component-harnesses.md +59 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/component-styling.md +91 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/components.md +117 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/creating-services.md +97 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/data-resolvers.md +69 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/define-routes.md +67 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/defining-providers.md +72 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/di-fundamentals.md +120 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/e2e-testing.md +56 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/effects.md +83 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/hierarchical-injectors.md +43 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/host-elements.md +80 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/injection-context.md +63 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/inputs.md +101 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/linked-signal.md +59 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/loading-strategies.md +61 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/mcp.md +108 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/navigate-to-routes.md +69 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/outputs.md +86 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/reactive-forms.md +122 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/rendering-strategies.md +44 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/resource.md +77 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/route-animations.md +56 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/route-guards.md +52 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/router-lifecycle.md +45 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/router-testing.md +87 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/show-routes-with-outlets.md +68 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/signal-forms.md +795 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/signals-overview.md +94 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/tailwind-css.md +69 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/template-driven-forms.md +114 -0
- package/bundled/upstream/ecc/skills/angular-developer/references/testing-fundamentals.md +65 -0
- package/bundled/upstream/ecc/skills/autonomous-agent-harness/SKILL.md +6 -0
- package/bundled/upstream/ecc/skills/backend-patterns/SKILL.md +8 -45
- package/bundled/upstream/ecc/skills/cisco-ios-patterns/SKILL.md +163 -0
- package/bundled/upstream/ecc/skills/configure-ecc/SKILL.md +31 -14
- package/bundled/upstream/ecc/skills/continuous-learning/SKILL.md +10 -2
- package/bundled/upstream/ecc/skills/continuous-learning-v2/SKILL.md +19 -5
- package/bundled/upstream/ecc/skills/continuous-learning-v2/agents/observer-loop.sh +44 -4
- package/bundled/upstream/ecc/skills/continuous-learning-v2/agents/observer.md +4 -4
- package/bundled/upstream/ecc/skills/continuous-learning-v2/agents/start-observer.sh +5 -1
- package/bundled/upstream/ecc/skills/continuous-learning-v2/hooks/observe.sh +21 -5
- package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/detect-project.sh +58 -13
- package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/instinct-cli.py +97 -4
- package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/lib/homunculus-dir.sh +31 -0
- package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/migrate-homunculus.sh +62 -0
- package/bundled/upstream/ecc/skills/continuous-learning-v2/scripts/test_parse_instinct.py +34 -0
- package/bundled/upstream/ecc/skills/cost-tracking/SKILL.md +147 -0
- package/bundled/upstream/ecc/skills/deep-research/SKILL.md +4 -0
- package/bundled/upstream/ecc/skills/defi-amm-security/SKILL.md +6 -0
- package/bundled/upstream/ecc/skills/django-celery/SKILL.md +457 -0
- package/bundled/upstream/ecc/skills/ecc-guide/SKILL.md +189 -0
- package/bundled/upstream/ecc/skills/error-handling/SKILL.md +376 -0
- package/bundled/upstream/ecc/skills/exa-search/SKILL.md +4 -0
- package/bundled/upstream/ecc/skills/fal-ai-media/SKILL.md +4 -0
- package/bundled/upstream/ecc/skills/fastapi-patterns/SKILL.md +327 -0
- package/bundled/upstream/ecc/skills/flox-environments/SKILL.md +496 -0
- package/bundled/upstream/ecc/skills/frontend-design-direction/SKILL.md +92 -0
- package/bundled/upstream/ecc/skills/frontend-slides/animation-patterns.md +122 -0
- package/bundled/upstream/ecc/skills/frontend-slides/html-template.md +419 -0
- package/bundled/upstream/ecc/skills/frontend-slides/scripts/export-pdf.sh +418 -0
- package/bundled/upstream/ecc/skills/frontend-slides/scripts/extract-pptx.py +96 -0
- package/bundled/upstream/ecc/skills/frontend-slides/viewport-base.css +153 -0
- package/bundled/upstream/ecc/skills/fsharp-testing/SKILL.md +280 -0
- package/bundled/upstream/ecc/skills/gateguard/SKILL.md +4 -0
- package/bundled/upstream/ecc/skills/hermes-imports/SKILL.md +88 -0
- package/bundled/upstream/ecc/skills/homelab-network-readiness/SKILL.md +169 -0
- package/bundled/upstream/ecc/skills/homelab-network-setup/SKILL.md +129 -0
- package/bundled/upstream/ecc/skills/homelab-pihole-dns/SKILL.md +274 -0
- package/bundled/upstream/ecc/skills/homelab-vlan-segmentation/SKILL.md +311 -0
- package/bundled/upstream/ecc/skills/homelab-wireguard-vpn/SKILL.md +305 -0
- package/bundled/upstream/ecc/skills/ios-icon-gen/SKILL.md +157 -0
- package/bundled/upstream/ecc/skills/ios-icon-gen/scripts/generate_icons.swift +258 -0
- package/bundled/upstream/ecc/skills/ios-icon-gen/scripts/iconify_gen.sh +235 -0
- package/bundled/upstream/ecc/skills/java-coding-standards/SKILL.md +241 -5
- package/bundled/upstream/ecc/skills/make-interfaces-feel-better/SKILL.md +151 -0
- package/bundled/upstream/ecc/skills/mle-workflow/SKILL.md +346 -0
- package/bundled/upstream/ecc/skills/motion-advanced/SKILL.md +596 -0
- package/bundled/upstream/ecc/skills/motion-foundations/SKILL.md +299 -0
- package/bundled/upstream/ecc/skills/motion-patterns/SKILL.md +435 -0
- package/bundled/upstream/ecc/skills/motion-ui/SKILL.md +575 -0
- package/bundled/upstream/ecc/skills/mysql-patterns/SKILL.md +412 -0
- package/bundled/upstream/ecc/skills/netmiko-ssh-automation/SKILL.md +173 -0
- package/bundled/upstream/ecc/skills/network-bgp-diagnostics/SKILL.md +167 -0
- package/bundled/upstream/ecc/skills/network-config-validation/SKILL.md +210 -0
- package/bundled/upstream/ecc/skills/network-interface-health/SKILL.md +152 -0
- package/bundled/upstream/ecc/skills/openclaw-persona-forge/SKILL.md +1 -9
- package/bundled/upstream/ecc/skills/plan-orchestrate/SKILL.md +262 -0
- package/bundled/upstream/ecc/skills/prisma-patterns/SKILL.md +371 -0
- package/bundled/upstream/ecc/skills/production-audit/SKILL.md +206 -0
- package/bundled/upstream/ecc/skills/prompt-optimizer/SKILL.md +24 -400
- package/bundled/upstream/ecc/skills/quarkus-patterns/SKILL.md +722 -0
- package/bundled/upstream/ecc/skills/quarkus-security/SKILL.md +467 -0
- package/bundled/upstream/ecc/skills/quarkus-tdd/SKILL.md +811 -0
- package/bundled/upstream/ecc/skills/quarkus-verification/SKILL.md +479 -0
- package/bundled/upstream/ecc/skills/redis-patterns/SKILL.md +403 -0
- package/bundled/upstream/ecc/skills/scientific-db-pubmed-database/SKILL.md +175 -0
- package/bundled/upstream/ecc/skills/scientific-db-uspto-database/SKILL.md +177 -0
- package/bundled/upstream/ecc/skills/scientific-pkg-gget/SKILL.md +166 -0
- package/bundled/upstream/ecc/skills/scientific-thinking-literature-review/SKILL.md +192 -0
- package/bundled/upstream/ecc/skills/scientific-thinking-scholar-evaluation/SKILL.md +160 -0
- package/bundled/upstream/ecc/skills/search-first/SKILL.md +23 -2
- package/bundled/upstream/ecc/skills/security-review/SKILL.md +10 -2
- package/bundled/upstream/ecc/skills/skill-comply/scripts/runner.py +28 -3
- package/bundled/upstream/ecc/skills/skill-comply/tests/test_runner.py +172 -0
- package/bundled/upstream/ecc/skills/skill-scout/SKILL.md +140 -0
- package/bundled/upstream/ecc/skills/skill-stocktake/SKILL.md +1 -0
- package/bundled/upstream/ecc/skills/strategic-compact/SKILL.md +2 -2
- package/bundled/upstream/ecc/skills/tinystruct-patterns/SKILL.md +203 -0
- package/bundled/upstream/ecc/skills/tinystruct-patterns/references/architecture.md +90 -0
- package/bundled/upstream/ecc/skills/tinystruct-patterns/references/data-handling.md +60 -0
- package/bundled/upstream/ecc/skills/tinystruct-patterns/references/database.md +99 -0
- package/bundled/upstream/ecc/skills/tinystruct-patterns/references/routing.md +64 -0
- package/bundled/upstream/ecc/skills/tinystruct-patterns/references/system-usage.md +97 -0
- package/bundled/upstream/ecc/skills/tinystruct-patterns/references/testing.md +72 -0
- package/bundled/upstream/ecc/skills/ui-to-vue/SKILL.md +134 -0
- package/bundled/upstream/ecc/skills/vite-patterns/SKILL.md +449 -0
- package/bundled/upstream/ecc/skills/windows-desktop-e2e/SKILL.md +788 -0
- package/bundled/upstream/ecc/skills/x-api/SKILL.md +4 -0
- package/bundled/upstream/oh-my-claudecode/.omc-source/bundle.json +20 -0
- package/bundled/upstream/oh-my-claudecode/agents/analyst.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/architect.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/code-reviewer.md +26 -7
- package/bundled/upstream/oh-my-claudecode/agents/critic.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/debugger.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/designer.md +14 -1
- package/bundled/upstream/oh-my-claudecode/agents/document-specialist.md +1 -1
- package/bundled/upstream/oh-my-claudecode/agents/executor.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/explore.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/git-master.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/planner.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/qa-tester.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/scientist.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/security-reviewer.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/test-engineer.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/tracer.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/verifier.md +2 -1
- package/bundled/upstream/oh-my-claudecode/agents/writer.md +2 -1
- package/bundled/upstream/oh-my-claudecode/skills/AGENTS.md +4 -3
- package/bundled/upstream/oh-my-claudecode/skills/ai-slop-cleaner/SKILL.md +12 -0
- package/bundled/upstream/oh-my-claudecode/skills/deep-dive/SKILL.md +69 -13
- package/bundled/upstream/oh-my-claudecode/skills/deep-interview/SKILL.md +176 -63
- package/bundled/upstream/oh-my-claudecode/skills/learner/SKILL.md +3 -1
- package/bundled/upstream/oh-my-claudecode/skills/omc-doctor/SKILL.md +22 -3
- package/bundled/upstream/oh-my-claudecode/skills/omc-reference/SKILL.md +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/01-install-claude-md.md +2 -2
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/02-configure.md +45 -2
- package/bundled/upstream/oh-my-claudecode/skills/omc-setup/phases/03-integrations.md +46 -5
- package/bundled/upstream/oh-my-claudecode/skills/plan/SKILL.md +19 -17
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/config.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/parse.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/azure-devops.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/bitbucket.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/gitea.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/github.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/gitlab.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/interface.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/providers/jira.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/session.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/tmux.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/lib/worktree.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/psm.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/project-session-manager/tests/test-psm-prompt-injection.sh +1 -1
- package/bundled/upstream/oh-my-claudecode/skills/ralph/SKILL.md +8 -8
- package/bundled/upstream/oh-my-claudecode/skills/ralplan/SKILL.md +9 -5
- package/bundled/upstream/oh-my-claudecode/skills/skill/SKILL.md +6 -6
- package/bundled/upstream/oh-my-claudecode/skills/skillify/SKILL.md +19 -3
- package/bundled/upstream/oh-my-claudecode/skills/trace/SKILL.md +3 -1
- package/bundled/upstream/oh-my-claudecode/skills/ultrawork/SKILL.md +20 -7
- package/bundled/upstream/superpowers/.omc-source/bundle.json +21 -0
- package/bundled/upstream/superpowers/hooks/hooks-cursor.json +1 -1
- package/bundled/upstream/superpowers/skills/executing-plans/SKILL.md +1 -1
- package/bundled/upstream/superpowers/skills/finishing-a-development-branch/SKILL.md +93 -42
- package/bundled/upstream/superpowers/skills/requesting-code-review/SKILL.md +7 -9
- package/bundled/upstream/superpowers/skills/requesting-code-review/code-reviewer.md +107 -85
- package/bundled/upstream/superpowers/skills/subagent-driven-development/SKILL.md +3 -1
- package/bundled/upstream/superpowers/skills/subagent-driven-development/code-quality-reviewer-prompt.md +2 -3
- package/bundled/upstream/superpowers/skills/systematic-debugging/CREATION-LOG.md +1 -1
- package/bundled/upstream/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
- package/bundled/upstream/superpowers/skills/using-git-worktrees/SKILL.md +95 -98
- package/bundled/upstream/superpowers/skills/using-superpowers/references/codex-tools.md +7 -48
- package/bundled/upstream/superpowers/skills/using-superpowers/references/copilot-tools.md +1 -11
- package/bundled/upstream/superpowers/skills/using-superpowers/references/gemini-tools.md +21 -3
- package/bundled/upstream/superpowers/skills/writing-plans/SKILL.md +1 -1
- package/package.json +1 -1
- package/src/cli/index.js +1 -0
- package/src/cli/setup.js +9 -0
- package/src/cli/skill-index.js +209 -0
- package/src/cli/skill.js +4 -0
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/agent-sdk/README.md +0 -355
- package/bundled/upstream/anthropic-skills/skills/claude-api/python/agent-sdk/patterns.md +0 -359
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/agent-sdk/README.md +0 -297
- package/bundled/upstream/anthropic-skills/skills/claude-api/typescript/agent-sdk/patterns.md +0 -209
- package/bundled/upstream/ecc/commands/agent-sort.md +0 -23
- package/bundled/upstream/ecc/commands/claw.md +0 -23
- package/bundled/upstream/ecc/commands/context-budget.md +0 -23
- package/bundled/upstream/ecc/commands/devfleet.md +0 -23
- package/bundled/upstream/ecc/commands/docs.md +0 -23
- package/bundled/upstream/ecc/commands/e2e.md +0 -268
- package/bundled/upstream/ecc/commands/eval.md +0 -23
- package/bundled/upstream/ecc/commands/orchestrate.md +0 -135
- package/bundled/upstream/ecc/commands/prompt-optimize.md +0 -23
- package/bundled/upstream/ecc/commands/rules-distill.md +0 -20
- package/bundled/upstream/ecc/commands/tdd.md +0 -231
- package/bundled/upstream/ecc/commands/verify.md +0 -23
- package/bundled/upstream/ecc/skills/claude-api/SKILL.md +0 -337
- package/bundled/upstream/ecc/skills/frontend-design/SKILL.md +0 -145
- package/bundled/upstream/superpowers/agents/code-reviewer.md +0 -48
- package/bundled/upstream/superpowers/commands/brainstorm.md +0 -5
- package/bundled/upstream/superpowers/commands/execute-plan.md +0 -5
- package/bundled/upstream/superpowers/commands/write-plan.md +0 -5
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: plan-orchestrate
|
|
3
|
+
description: Read a plan document, decompose it into steps, design a per-step agent chain from the ECC catalogue, and emit ready-to-paste /orchestrate custom prompts. Generative only — never invokes /orchestrate itself. Use when the user has a multi-step plan and wants to drive it through orchestrate without composing chains by hand.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Plan Orchestrate
|
|
8
|
+
|
|
9
|
+
Bridge a plan document to `/orchestrate custom` by emitting one ready-to-paste invocation per step. The skill is generative only — it never executes `/orchestrate`. The user pastes each line when ready.
|
|
10
|
+
|
|
11
|
+
## When to Activate
|
|
12
|
+
|
|
13
|
+
- User has a multi-step plan document (PRD, RFC, implementation plan) and wants to drive it through `/orchestrate`.
|
|
14
|
+
- User says "orchestrate this plan", "give me orchestrate prompts for each step", "compose chains for this plan".
|
|
15
|
+
- A step-by-step plan exists but the user does not want to manually pick agents per step.
|
|
16
|
+
|
|
17
|
+
Skip when:
|
|
18
|
+
- The work is one ad-hoc step → call `/orchestrate custom` directly.
|
|
19
|
+
- The plan is unreadable or empty. Lack of explicit numbering alone is not a skip condition — see the "No clear steps" edge case below.
|
|
20
|
+
|
|
21
|
+
## Inputs
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
<plan-doc-path> [--lang=python|typescript|go|rust|cpp|java|kotlin|flutter|auto] [--scope=all|step:<n>|range:<a>-<b>] [--dry-run]
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
- `<plan-doc-path>` — required; relative or absolute path (`@docs/...` accepted).
|
|
28
|
+
- `--lang` — reviewer language variant; defaults to `auto` (detected from project).
|
|
29
|
+
- `--scope` — limits emitted steps; defaults to `all`.
|
|
30
|
+
- `--dry-run` — print decomposition + chain rationale only; do not emit final prompts.
|
|
31
|
+
|
|
32
|
+
## Authoritative `/orchestrate` shape (do not deviate)
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
{ORCH_CMD} custom "<agent1>,<agent2>,...,<agentN>" "<task description>"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Where `{ORCH_CMD}` is determined in Phase 0 (see below). The command string in the emitted output **always uses one concrete form** — never both, never a placeholder.
|
|
39
|
+
|
|
40
|
+
- `custom` is a sequential chain; each agent's HANDOFF feeds the next.
|
|
41
|
+
- Comma-separated agent list. No spaces preferred; one space tolerated.
|
|
42
|
+
- No `--mode` / `--gate` / `--agents=...` flags exist — never invent them.
|
|
43
|
+
- Agent names come from the catalogue in this skill. Embedded double quotes in the task description are escaped as `\"`.
|
|
44
|
+
|
|
45
|
+
## ECC install form and namespacing
|
|
46
|
+
|
|
47
|
+
Two install forms determine the prefix on **both** the slash command and every agent name. The two MUST stay in sync — one form per output, never mixed:
|
|
48
|
+
|
|
49
|
+
Let `<claude-home>` denote the Claude Code home directory: `~/.claude` on macOS/Linux, `%USERPROFILE%\.claude` on Windows. Resolve it the way the host platform resolves the user home directory (do not hardcode `~`).
|
|
50
|
+
|
|
51
|
+
| Form | Detection | `{ORCH_CMD}` | Agent name format |
|
|
52
|
+
|---|---|---|---|
|
|
53
|
+
| Plugin install (1.9.0+) | `<claude-home>/plugins/marketplaces/everything-claude-code/` exists | `/everything-claude-code:orchestrate` | `everything-claude-code:<name>` |
|
|
54
|
+
| Legacy bare install | Above absent; agent files under `<claude-home>/agents/` | `/orchestrate` | `<name>` |
|
|
55
|
+
|
|
56
|
+
Why this matters: under the plugin install, agents register as `everything-claude-code:tdd-guide`. Bare names force fuzzy matching, which fails intermittently under parallel calls. Under legacy, the prefixed forms are not registered and fail outright.
|
|
57
|
+
|
|
58
|
+
## Available agent catalogue (must pick from these)
|
|
59
|
+
|
|
60
|
+
General:
|
|
61
|
+
- `planner` — requirement restatement, risk decomposition, step planning
|
|
62
|
+
- `architect` — architecture, system design, refactor proposals
|
|
63
|
+
- `tdd-guide` — write tests → implement → 80%+ coverage
|
|
64
|
+
- `code-reviewer` — generic code review
|
|
65
|
+
- `security-reviewer` — security audit, OWASP, secret leakage
|
|
66
|
+
- `refactor-cleaner` — dead code, duplicates, knip-class cleanup
|
|
67
|
+
- `doc-updater` — documentation, codemap, README
|
|
68
|
+
- `docs-lookup` — third-party library API lookups (Context7)
|
|
69
|
+
- `e2e-runner` — end-to-end test orchestration
|
|
70
|
+
- `database-reviewer` — PostgreSQL schema, migration, performance
|
|
71
|
+
- `harness-optimizer` — local agent harness configuration
|
|
72
|
+
- `loop-operator` — long-running autonomous loops
|
|
73
|
+
- `chief-of-staff` — multi-channel triage (rarely a fit for plan steps)
|
|
74
|
+
|
|
75
|
+
Build error resolvers:
|
|
76
|
+
- `build-error-resolver` (generic) / `cpp-build-resolver` / `go-build-resolver` / `java-build-resolver` / `kotlin-build-resolver` / `rust-build-resolver` / `pytorch-build-resolver`
|
|
77
|
+
|
|
78
|
+
Code reviewers:
|
|
79
|
+
- `python-reviewer` / `typescript-reviewer` / `go-reviewer` / `rust-reviewer` / `cpp-reviewer` / `java-reviewer` / `kotlin-reviewer` / `flutter-reviewer`
|
|
80
|
+
|
|
81
|
+
A misspelled agent name fails `/orchestrate`. Cross-check against this list before emitting.
|
|
82
|
+
|
|
83
|
+
## How It Works
|
|
84
|
+
|
|
85
|
+
### Phase 0 — Detect ECC mode + language
|
|
86
|
+
|
|
87
|
+
1. Read `<plan-doc-path>`. If missing or empty, report and stop.
|
|
88
|
+
2. Detect ECC install form once and freeze it into `ECC_MODE`. Algorithm (run in order, stop at the first match):
|
|
89
|
+
1. If `<claude-home>/plugins/marketplaces/everything-claude-code/` exists → `ECC_MODE=plugin`.
|
|
90
|
+
2. Else if `<claude-home>/agents/` exists and contains at least one ECC agent file (e.g. `tdd-guide.md`, `code-reviewer.md`) → `ECC_MODE=legacy`.
|
|
91
|
+
3. Else → default to `ECC_MODE=legacy` and emit a one-line warning at the top of the output: `> Warning: could not detect ECC install; defaulting to legacy form. If you use the plugin install, edit the prefixes manually.`
|
|
92
|
+
4. If both markers exist (mixed install), `plugin` wins — the plugin namespace is the only one that resolves agent names without fuzzy matching.
|
|
93
|
+
|
|
94
|
+
From this point on, every emitted line uses the matching prefix on **both** the slash command and every agent name. **Never emit both forms in the same output.**
|
|
95
|
+
3. Resolve `--lang`. When `auto`, run a polyglot-aware detection:
|
|
96
|
+
- Probe markers: `pyproject.toml` / `uv.lock` / `requirements.txt` → python; `package.json` → typescript; `go.mod` → go; `Cargo.toml` → rust; `CMakeLists.txt` or top-level `*.cpp` → cpp; `pom.xml` / `build.gradle` (Java) → java; `build.gradle.kts` or top-level Kotlin → kotlin; `pubspec.yaml` → flutter.
|
|
97
|
+
- **Polyglot tie-break**: if more than one marker matches, pick the language whose source files outnumber the others (count via `git ls-files`, excluding `vendor/`, `node_modules/`, `dist/`, `build/`, `.venv/`, generated files, and obvious test fixtures). On a tie or when no language exceeds 60% of source files, set `lang=unknown`.
|
|
98
|
+
- No marker matched → set `lang=unknown`.
|
|
99
|
+
- `lang=unknown` is a sentinel — it is **not** an agent name. Phase 2 rules 4 and 5 turn it into `code-reviewer` / `build-error-resolver` at chain composition time.
|
|
100
|
+
4. Detect a **PyTorch sub-profile**: when `lang=python` and any of `pyproject.toml` / `requirements.txt` / `uv.lock` declares a dependency on `torch`, set `pytorch=true`. This only affects `build` chain selection (Phase 2 rule below); the reviewer remains `python-reviewer`.
|
|
101
|
+
5. **Normalize any agent names declared in the plan**: if the plan text references agents by their plugin-prefixed form (e.g. `everything-claude-code:tdd-guide`), strip the prefix to get the bare catalogue name before validating or composing chains. Re-prefixing happens only at output time per `ECC_MODE` (Phase 4). Never let a pre-prefixed name flow into chain composition — it would double-prefix in plugin mode.
|
|
102
|
+
|
|
103
|
+
### Phase 1 — Decompose steps
|
|
104
|
+
|
|
105
|
+
Identify "step units" in priority order:
|
|
106
|
+
|
|
107
|
+
1. Explicit numbering: `## Step N` / `### Phase N` / `## N. ...` / top-level ordered list.
|
|
108
|
+
2. A "Step" column in a table.
|
|
109
|
+
3. `---`-separated blocks with verb-led headings.
|
|
110
|
+
4. Otherwise treat each H2 as one step.
|
|
111
|
+
|
|
112
|
+
Per step extract `id` (1-based), `title` (≤ 80 chars), `intent` (1–3 sentences), `tags`.
|
|
113
|
+
|
|
114
|
+
### Phase 2 — Tag and pick chain
|
|
115
|
+
|
|
116
|
+
Tag by intent (multi-tag allowed; chain built from primary + stacked secondaries):
|
|
117
|
+
|
|
118
|
+
Trigger words below are matched case-insensitively. Multilingual plans are supported by matching the word stems in any language as long as the meaning aligns with the listed English trigger words.
|
|
119
|
+
|
|
120
|
+
| Tag | Trigger words | Default chain |
|
|
121
|
+
|---|---|---|
|
|
122
|
+
| `design` | architecture, design, choose, evaluate, RFC | `planner,architect` |
|
|
123
|
+
| `plan` | plan, breakdown, milestone | `planner` |
|
|
124
|
+
| `impl` | implement, build, add, create, port | `tdd-guide,<lang>-reviewer` |
|
|
125
|
+
| `test` | test, coverage, e2e, integration | `tdd-guide,e2e-runner` |
|
|
126
|
+
| `refactor` | refactor, cleanup, dedupe, split | `architect,refactor-cleaner,<lang>-reviewer` |
|
|
127
|
+
| `migration` | migrate, upgrade, rewrite, port | `architect,tdd-guide,<lang>-reviewer` |
|
|
128
|
+
| `db` | schema, migration, index, SQL, Postgres, alembic, sqlmodel | `database-reviewer,<lang>-reviewer` |
|
|
129
|
+
| `security` | encrypt, auth, secret, OWASP, PII | `security-reviewer,<lang>-reviewer` |
|
|
130
|
+
| `build` | build, compile, lint failure, CI | `<lang>-build-resolver` (falls back to `build-error-resolver`) |
|
|
131
|
+
| `docs` | docs, readme, codemap, changelog | `doc-updater` |
|
|
132
|
+
| `lookup` | lookup, reference, API usage | `docs-lookup` |
|
|
133
|
+
| `review` | review, audit, verify | `<lang>-reviewer,code-reviewer` |
|
|
134
|
+
| `loop` | loop, autonomous, watchdog | `loop-operator` |
|
|
135
|
+
|
|
136
|
+
Chain composition rules:
|
|
137
|
+
1. **Primary tag selection**: when a step matches multiple tags, the **first one in table order** (top of the table = highest priority) is the primary; the rest are secondaries. Composition rules 2 and 3 below handle specific multi-tag combinations explicitly; otherwise, append secondary chains in tag table order.
|
|
138
|
+
2. `impl` + `security` → `tdd-guide,<lang>-reviewer,security-reviewer`.
|
|
139
|
+
3. `impl` + `db` → `tdd-guide,database-reviewer,<lang>-reviewer`.
|
|
140
|
+
4. **Deduplicate** the resulting chain (preserve first occurrence). E.g. `review` + `lang=unknown` would yield `code-reviewer,code-reviewer` after rule 5; deduplication collapses it to `code-reviewer`.
|
|
141
|
+
5. `<lang>-reviewer` resolves to `code-reviewer` when `lang=unknown`.
|
|
142
|
+
6. `<lang>-build-resolver` resolves to `build-error-resolver` when `lang=unknown`. **Special case**: if Phase 0 set `pytorch=true`, use `pytorch-build-resolver` for `build` chains regardless of `<lang>`. There is no `python-build-resolver`; `--lang=python` without `pytorch=true` resolves to `build-error-resolver`.
|
|
143
|
+
7. **Zero-tag steps**: if no trigger word matches, set chain to `code-reviewer` and write `no tag matched; default review-only chain` under "Chain rationale".
|
|
144
|
+
8. Chain length ≤ 4 after deduplication. If exceeded, drop weakest tag (`lookup` and `docs` first).
|
|
145
|
+
9. Do not pair `planner` and `architect` in an `impl` chain (token waste). Pair them only on `design` steps.
|
|
146
|
+
10. Steps tagged `impl`, `refactor`, or `migration` end with a **reviewer-class** agent — any of `<lang>-reviewer`, `code-reviewer`, `security-reviewer`, or `database-reviewer`. The most domain-specific reviewer wins the tail position (e.g. rule 2's `impl+security` ends with `security-reviewer`; rule 3's `impl+db` ends with `<lang>-reviewer` because `database-reviewer` already gates the migration earlier in the chain). `test` and `build` steps are gated by their own validators (`e2e-runner` and the build resolver respectively) and do not require an additional reviewer.
|
|
147
|
+
|
|
148
|
+
### Phase 3 — Compress task description
|
|
149
|
+
|
|
150
|
+
Each emitted `<task description>` must:
|
|
151
|
+
- Be self-contained (the first agent does not need the plan document open).
|
|
152
|
+
- Start with `[Plan: <path>#step-<id>]`.
|
|
153
|
+
- Include 1–3 verifiable Acceptance criteria.
|
|
154
|
+
- Include a Scope guard (`Out of scope: ...`) **only if the plan declares one for this step**. Inherit verbatim. If the plan has no out-of-scope statement, omit the clause entirely — do not invent one.
|
|
155
|
+
- Be 200–600 characters; one line; embedded `"` escaped as `\"`; no literal newlines.
|
|
156
|
+
|
|
157
|
+
### Phase 4 — Output
|
|
158
|
+
|
|
159
|
+
Emit Markdown using **the form determined by `ECC_MODE`**. The output uses one form throughout — every `{ORCH_CMD}` and every agent name is rendered with the matching prefix from Phase 0. **Do not emit both forms; do not include "this is plugin form" / "strip the prefix" instructions in the rendered output.**
|
|
160
|
+
|
|
161
|
+
Concrete rendering rules:
|
|
162
|
+
|
|
163
|
+
- `{ORCH_CMD}` = `/everything-claude-code:orchestrate` under `plugin`, `/orchestrate` under `legacy`.
|
|
164
|
+
- `{AGENT(name)}` = `everything-claude-code:<name>` under `plugin`, `<name>` under `legacy`.
|
|
165
|
+
- The overview-table "Chain" column uses the same `{AGENT(name)}` rendering.
|
|
166
|
+
- Per-step bash blocks contain only the runnable command. **No `# plugin form` or `# legacy form` comments** — the form is implicit and uniform across the whole output.
|
|
167
|
+
|
|
168
|
+
Output structure:
|
|
169
|
+
|
|
170
|
+
````markdown
|
|
171
|
+
# Plan-Orchestrate Result
|
|
172
|
+
|
|
173
|
+
**Plan**: `<path>`
|
|
174
|
+
**Lang**: `<detected-or-given>`
|
|
175
|
+
**ECC mode**: `<plugin | legacy>`
|
|
176
|
+
**Steps**: <N>
|
|
177
|
+
**Scope**: <all | step:n | range:a-b>
|
|
178
|
+
|
|
179
|
+
## Steps overview
|
|
180
|
+
|
|
181
|
+
| # | Title | Tags | Chain |
|
|
182
|
+
|---|---|---|---|
|
|
183
|
+
| 1 | ... | impl, db | `{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}` |
|
|
184
|
+
| ... | | | |
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Step 1 — <title>
|
|
189
|
+
|
|
190
|
+
**Intent**: <1–3 sentences>
|
|
191
|
+
**Tags**: <a, b>
|
|
192
|
+
**Chain rationale**: <why this chain; which agent closes the loop>
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
{ORCH_CMD} custom "{AGENT(tdd-guide)},{AGENT(database-reviewer)},{AGENT(python-reviewer)}" "[Plan: docs/foo.md#step-1] <compressed task description>; Acceptance: <1–3 items>; Out of scope: <…>"
|
|
196
|
+
```
|
|
197
|
+
````
|
|
198
|
+
|
|
199
|
+
> The `{ORCH_CMD}` and `{AGENT(...)}` notation above describes the substitution this skill performs at runtime. The actual emitted Markdown contains the resolved strings, never the placeholders.
|
|
200
|
+
|
|
201
|
+
Append a final "Batch execution" block aggregating every step's command in order so the user can paste them all at once. **Skip the Batch block in overview-only mode** (see "Large plan" edge case): when only the overview table is being emitted, there are no per-step commands to aggregate.
|
|
202
|
+
|
|
203
|
+
### Phase 5 — Self-check (run before emitting)
|
|
204
|
+
|
|
205
|
+
- [ ] Every agent in every chain comes from the catalogue (after stripping any `everything-claude-code:` prefix that appeared in the plan; see Phase 0 step 5).
|
|
206
|
+
- [ ] Resolved `{ORCH_CMD}` and every resolved `{AGENT(...)}` use the **same** form (`plugin` or `legacy`) — never mixed in one output.
|
|
207
|
+
- [ ] No `# plugin form` / `# legacy form` annotations and no "strip the prefix" instructions remain in the rendered output.
|
|
208
|
+
- [ ] No invented `--mode` / `--gate` / `--agents=...` fields.
|
|
209
|
+
- [ ] Each task description is single-line, double-quoted, with embedded `"` escaped.
|
|
210
|
+
- [ ] Each task description begins with `[Plan: <path>#step-<id>]` and includes Acceptance (1–3 items). The `Out of scope:` clause is present only when inherited from the plan.
|
|
211
|
+
- [ ] No duplicate agent in any chain after Phase 2 dedup.
|
|
212
|
+
- [ ] Chain length ≤ 4.
|
|
213
|
+
- [ ] Steps tagged `impl`/`refactor`/`migration` end with a reviewer-class agent (`<lang>-reviewer`, `code-reviewer`, `security-reviewer`, or `database-reviewer`). `test` and `build` are exempt — see Phase 2 rule 10.
|
|
214
|
+
- [ ] Zero-tag steps emit `code-reviewer` with the rationale `no tag matched; default review-only chain`.
|
|
215
|
+
- [ ] Overview table lists every step in the plan, regardless of `--scope`.
|
|
216
|
+
- [ ] Per-step detail block count matches the resolved `--scope` (full plan when `--scope=all`; one block for `step:n`; range size for `range:a-b`). In overview-only mode, no per-step blocks and no Batch block are emitted.
|
|
217
|
+
|
|
218
|
+
## Edge cases
|
|
219
|
+
|
|
220
|
+
- **No clear steps**: prefer H2/H3 splitting; if still ambiguous, report "no structured steps detected" with the document outline and ask the user to confirm running by outline.
|
|
221
|
+
- **Large plan (>1500 lines)**: enter **overview-only mode** — emit only the overview table and ask the user to narrow with `--scope` before re-running for details. In this mode, skip per-step detail blocks and skip the Batch execution block.
|
|
222
|
+
- **Step too broad** (e.g. "complete all backend work"): do not force a single chain. Suggest splitting into N.a and N.b and propose a split.
|
|
223
|
+
- **Plan declares agents** (rare): first **strip any `everything-claude-code:` prefix** to get the bare catalogue name (Phase 0 step 5), then validate against the catalogue. Replace invalid agents and explain under "Chain rationale". The bare name is re-prefixed at output time per `ECC_MODE`.
|
|
224
|
+
- **Polyglot project where `--lang=auto` cannot pick a winner**: set `lang=unknown`; reviewer resolves to `code-reviewer` and build resolver to `build-error-resolver`. Mention the fallback under "Chain rationale".
|
|
225
|
+
|
|
226
|
+
## Examples
|
|
227
|
+
|
|
228
|
+
### Example 1 — Plugin mode, Python plan
|
|
229
|
+
|
|
230
|
+
Input:
|
|
231
|
+
```
|
|
232
|
+
plan-orchestrate @docs/plan/example-feature.md --lang=python
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Excerpt of expected output:
|
|
236
|
+
````markdown
|
|
237
|
+
## Step 2 — Encrypt sensitive UserProfile fields
|
|
238
|
+
|
|
239
|
+
**Intent**: Introduce an `EncryptedString` SQLAlchemy type and AES-GCM encrypt `birth_datetime` / `location` before persistence; load the key from an environment variable.
|
|
240
|
+
**Tags**: impl, security, db
|
|
241
|
+
**Chain rationale**: Security-sensitive write path, so `security-reviewer` closes the chain; `database-reviewer` validates the alembic migration; `python-reviewer` covers typing and PEP 8.
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
/everything-claude-code:orchestrate custom "everything-claude-code:tdd-guide,everything-claude-code:database-reviewer,everything-claude-code:python-reviewer,everything-claude-code:security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] Implement EncryptedString SQLAlchemy type and migrate UserProfile.birth_datetime/location columns; key from ENV APP_DB_KEY; Acceptance: encrypt/decrypt roundtrip tests pass; alembic upgrade/downgrade clean on empty DB; no plaintext in DB after migrate; Out of scope: cross-tenant profile sharing logic"
|
|
245
|
+
```
|
|
246
|
+
````
|
|
247
|
+
|
|
248
|
+
### Example 2 — Legacy mode, same step
|
|
249
|
+
|
|
250
|
+
If `ECC_MODE=legacy` were detected, the same step would be emitted as a single uniform command (no plugin-prefixed forms anywhere in the output):
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
/orchestrate custom "tdd-guide,database-reviewer,python-reviewer,security-reviewer" "[Plan: docs/plan/example-feature.md#step-2] ..."
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
The two examples above illustrate **the two possible outputs** for two different environments. A single skill invocation produces only one of them, end to end.
|
|
257
|
+
|
|
258
|
+
## Notes
|
|
259
|
+
|
|
260
|
+
- Generative only. Never invoke `/orchestrate` from inside this skill.
|
|
261
|
+
- Match the language of the plan document for task descriptions (agent names always remain English).
|
|
262
|
+
- Do not insert "Co-Authored-By" lines or emoji in the output unless the user explicitly asks.
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: prisma-patterns
|
|
3
|
+
description: Prisma ORM patterns for TypeScript backends — schema design, query optimization, transactions, pagination, and critical traps like updateMany returning count not records, $transaction timeouts, migrate dev resetting the DB, @updatedAt skipped on bulk writes, and serverless connection exhaustion.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Prisma Patterns
|
|
8
|
+
|
|
9
|
+
Production patterns and non-obvious traps for Prisma ORM in TypeScript backends.
|
|
10
|
+
Tested against Prisma 5.x and 6.x. Some behaviors differ from Prisma 4.
|
|
11
|
+
|
|
12
|
+
Check the Prisma version before applying version-specific patterns:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npx prisma --version
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Prisma 5 introduced `relationJoins`, which can load relations via JOIN rather than separate queries depending on query strategy and configuration. The `omit` field modifier and `prisma.$extends` Client Extensions API were also added. Note: `relationJoins` can cause row explosion on large 1:N relations or deep nested `include` — benchmark both approaches when relations may return many rows per parent.
|
|
19
|
+
|
|
20
|
+
## When to Activate
|
|
21
|
+
|
|
22
|
+
- Designing or modifying Prisma schema models and relations
|
|
23
|
+
- Writing queries, transactions, or pagination logic
|
|
24
|
+
- Using `updateMany`, `deleteMany`, or any bulk operation
|
|
25
|
+
- Running or planning database migrations
|
|
26
|
+
- Deploying to serverless environments (Vercel, Lambda, Cloudflare Workers)
|
|
27
|
+
- Implementing soft delete or multi-tenant row filtering
|
|
28
|
+
|
|
29
|
+
## Core Concepts
|
|
30
|
+
|
|
31
|
+
### ID Strategy
|
|
32
|
+
|
|
33
|
+
| Strategy | Use When | Avoid When |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| `@default(cuid())` | Default choice — URL-safe, sortable, no collisions | Sequential IDs needed for external systems |
|
|
36
|
+
| `@default(uuid())` | Interoperability with non-Prisma systems required | High-write tables (random UUIDs fragment B-tree indexes) |
|
|
37
|
+
| `@default(autoincrement())` | Internal join tables, audit logs | Public-facing IDs (exposes record count) |
|
|
38
|
+
|
|
39
|
+
### Schema Defaults
|
|
40
|
+
|
|
41
|
+
```prisma
|
|
42
|
+
model User {
|
|
43
|
+
id String @id @default(cuid())
|
|
44
|
+
email String @unique // @unique already creates an index — no @@index needed
|
|
45
|
+
name String
|
|
46
|
+
role Role @default(USER)
|
|
47
|
+
posts Post[]
|
|
48
|
+
createdAt DateTime @default(now())
|
|
49
|
+
updatedAt DateTime @updatedAt
|
|
50
|
+
deletedAt DateTime?
|
|
51
|
+
|
|
52
|
+
@@index([createdAt])
|
|
53
|
+
@@index([deletedAt, createdAt]) // composite for soft-delete + sort queries
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- Add `@@index` on every foreign key and column used in `WHERE` or `ORDER BY`.
|
|
58
|
+
- Declare `deletedAt DateTime?` upfront when soft delete is a foreseeable requirement — adding it later requires a migration on a live table.
|
|
59
|
+
- `updatedAt @updatedAt` is set automatically by Prisma on `update` and `upsert` only (see Anti-Patterns for bulk update trap).
|
|
60
|
+
|
|
61
|
+
### `include` vs `select`
|
|
62
|
+
|
|
63
|
+
| | `include` | `select` |
|
|
64
|
+
|---|---|---|
|
|
65
|
+
| Returns | All scalar fields + specified relations | Only specified fields |
|
|
66
|
+
| Use when | You need most fields plus a relation | Hot paths, large tables, avoiding over-fetch |
|
|
67
|
+
| Performance | May over-fetch on wide tables | Minimal payload, faster on large datasets |
|
|
68
|
+
| Prisma 5 note | Uses JOIN by default (`relationJoins`) | Same |
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// include — all columns + relation
|
|
72
|
+
const user = await prisma.user.findUnique({
|
|
73
|
+
where: { id },
|
|
74
|
+
include: { posts: { select: { id: true, title: true } } },
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// select — explicit allowlist
|
|
78
|
+
const user = await prisma.user.findUnique({
|
|
79
|
+
where: { id },
|
|
80
|
+
select: { id: true, email: true, name: true },
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Never return raw Prisma entities from API responses — map to response DTOs to control exposed fields:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
// BAD: leaks passwordHash, deletedAt, internal fields
|
|
88
|
+
return await prisma.user.findUniqueOrThrow({ where: { id } });
|
|
89
|
+
|
|
90
|
+
// GOOD: explicit DTO mapping
|
|
91
|
+
const user = await prisma.user.findUniqueOrThrow({ where: { id } });
|
|
92
|
+
return { id: user.id, name: user.name, email: user.email };
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Transaction Form Selection
|
|
96
|
+
|
|
97
|
+
| Situation | Use |
|
|
98
|
+
|---|---|
|
|
99
|
+
| Independent operations, no inter-dependency | Array form |
|
|
100
|
+
| Later step depends on earlier result | Interactive form |
|
|
101
|
+
| External calls (email, HTTP) involved | Outside transaction entirely |
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
// Array form — batched in one round trip
|
|
105
|
+
const [user, post] = await prisma.$transaction([
|
|
106
|
+
prisma.user.update({ where: { id }, data: { name } }),
|
|
107
|
+
prisma.post.create({ data: { title, authorId: id } }),
|
|
108
|
+
]);
|
|
109
|
+
|
|
110
|
+
// Interactive form — use tx client only, never the outer prisma client
|
|
111
|
+
const post = await prisma.$transaction(async (tx) => {
|
|
112
|
+
const user = await tx.user.findUniqueOrThrow({ where: { id } });
|
|
113
|
+
if (user.role !== 'ADMIN') throw new Error('Forbidden');
|
|
114
|
+
return tx.post.create({ data: { title, authorId: user.id } });
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### PrismaClient Singleton
|
|
119
|
+
|
|
120
|
+
Each `PrismaClient` instance opens its own connection pool. Instantiate once.
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
// lib/prisma.ts
|
|
124
|
+
import { PrismaClient } from '@prisma/client';
|
|
125
|
+
|
|
126
|
+
const globalForPrisma = globalThis as unknown as { prisma?: PrismaClient };
|
|
127
|
+
|
|
128
|
+
export const prisma =
|
|
129
|
+
globalForPrisma.prisma ??
|
|
130
|
+
new PrismaClient({
|
|
131
|
+
log: process.env.NODE_ENV === 'development' ? ['query', 'error'] : ['error'],
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The `globalThis` pattern prevents duplicate instances during hot reload (Next.js, nodemon, ts-node-dev).
|
|
138
|
+
|
|
139
|
+
### N+1 Problem
|
|
140
|
+
|
|
141
|
+
Loading relations inside a loop issues one query per row.
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
// BAD: N+1 — one extra query per user
|
|
145
|
+
const users = await prisma.user.findMany();
|
|
146
|
+
for (const user of users) {
|
|
147
|
+
const posts = await prisma.post.findMany({ where: { authorId: user.id } });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// GOOD: single query
|
|
151
|
+
const users = await prisma.user.findMany({ include: { posts: true } });
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
With Prisma 5+ `relationJoins`, the `include` form uses a single JOIN. On large 1:N sets this may increase result set size — benchmark both approaches if the relation can return many rows per parent.
|
|
155
|
+
|
|
156
|
+
## Code Examples
|
|
157
|
+
|
|
158
|
+
### Cursor Pagination (preferred for feeds and large datasets)
|
|
159
|
+
|
|
160
|
+
```ts
|
|
161
|
+
async function getPosts(cursor?: string, limit = 20) {
|
|
162
|
+
const items = await prisma.post.findMany({
|
|
163
|
+
where: { published: true },
|
|
164
|
+
orderBy: [
|
|
165
|
+
{ createdAt: 'desc' },
|
|
166
|
+
{ id: 'desc' }, // secondary sort prevents unstable pagination on duplicate timestamps
|
|
167
|
+
],
|
|
168
|
+
take: limit + 1,
|
|
169
|
+
...(cursor && { cursor: { id: cursor }, skip: 1 }),
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const hasNextPage = items.length > limit;
|
|
173
|
+
if (hasNextPage) items.pop();
|
|
174
|
+
|
|
175
|
+
return { items, nextCursor: hasNextPage ? items[items.length - 1].id : null };
|
|
176
|
+
}
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Fetch `limit + 1` and pop — canonical way to detect `hasNextPage` without an extra count query. Always include a unique field (e.g. `id`) as a secondary `orderBy` to prevent unstable pagination when multiple rows share the same timestamp. Use offset pagination only when users need to jump to arbitrary pages (admin tables).
|
|
180
|
+
|
|
181
|
+
### Soft Delete
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
// Always filter explicitly — do not rely on middleware (hides behavior, hard to debug)
|
|
185
|
+
const activeUsers = await prisma.user.findMany({ where: { deletedAt: null } });
|
|
186
|
+
|
|
187
|
+
await prisma.user.update({ where: { id }, data: { deletedAt: new Date() } });
|
|
188
|
+
await prisma.user.update({ where: { id }, data: { deletedAt: null } }); // restore
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Error Handling
|
|
192
|
+
|
|
193
|
+
```ts
|
|
194
|
+
import { Prisma } from '@prisma/client';
|
|
195
|
+
|
|
196
|
+
try {
|
|
197
|
+
await prisma.user.create({ data: { email } });
|
|
198
|
+
} catch (e) {
|
|
199
|
+
if (e instanceof Prisma.PrismaClientKnownRequestError) {
|
|
200
|
+
if (e.code === 'P2002') throw new ConflictError('Email already exists');
|
|
201
|
+
if (e.code === 'P2025') throw new NotFoundError('Record not found');
|
|
202
|
+
if (e.code === 'P2003') throw new BadRequestError('Referenced record does not exist');
|
|
203
|
+
}
|
|
204
|
+
throw e;
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Common codes: `P2002` unique violation · `P2025` not found · `P2003` foreign key violation.
|
|
209
|
+
|
|
210
|
+
Catch at the service boundary and translate to domain errors. Never expose raw Prisma messages to API consumers.
|
|
211
|
+
|
|
212
|
+
### Connection Pool — Serverless
|
|
213
|
+
|
|
214
|
+
Embed connection params directly in `DATABASE_URL` — string concatenation breaks if the URL already has query parameters (e.g. `?schema=public`):
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# .env — preferred: embed params in the URL
|
|
218
|
+
DATABASE_URL="postgresql://user:pass@host/db?connection_limit=1&pool_timeout=20"
|
|
219
|
+
|
|
220
|
+
# With an external pooler (PgBouncer, Supabase pooler)
|
|
221
|
+
DATABASE_URL="postgresql://user:pass@host/db?pgbouncer=true&connection_limit=1"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
```ts
|
|
225
|
+
// Vercel, AWS Lambda, and similar serverless runtimes: cap pool to 1 per instance
|
|
226
|
+
// connection_limit and pool_timeout are controlled via DATABASE_URL
|
|
227
|
+
const prisma = new PrismaClient();
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Anti-Patterns
|
|
231
|
+
|
|
232
|
+
### `updateMany` returns a count, not records
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
// BAD: result is { count: 2 } — users[0] is undefined
|
|
236
|
+
const users = await prisma.user.updateMany({ where: { role: 'GUEST' }, data: { role: 'USER' } });
|
|
237
|
+
|
|
238
|
+
// GOOD: capture IDs first, then update, then fetch only the affected rows
|
|
239
|
+
const targets = await prisma.user.findMany({
|
|
240
|
+
where: { role: 'GUEST' },
|
|
241
|
+
select: { id: true },
|
|
242
|
+
});
|
|
243
|
+
const ids = targets.map((u) => u.id);
|
|
244
|
+
await prisma.user.updateMany({ where: { id: { in: ids } }, data: { role: 'USER' } });
|
|
245
|
+
const updated = await prisma.user.findMany({ where: { id: { in: ids } } });
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Same applies to `deleteMany` — returns `{ count: n }`, never the deleted rows.
|
|
249
|
+
|
|
250
|
+
### `$transaction` interactive form times out after 5 seconds
|
|
251
|
+
|
|
252
|
+
```ts
|
|
253
|
+
// BAD: external call inside transaction exceeds 5s default → "Transaction already closed"
|
|
254
|
+
await prisma.$transaction(async (tx) => {
|
|
255
|
+
const user = await tx.user.findUniqueOrThrow({ where: { id } });
|
|
256
|
+
await sendWelcomeEmail(user.email); // external call
|
|
257
|
+
await tx.user.update({ where: { id }, data: { emailSent: true } });
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// GOOD: external calls outside the transaction
|
|
261
|
+
const user = await prisma.user.findUniqueOrThrow({ where: { id } });
|
|
262
|
+
await sendWelcomeEmail(user.email);
|
|
263
|
+
await prisma.user.update({ where: { id }, data: { emailSent: true } });
|
|
264
|
+
|
|
265
|
+
// Only raise timeout when bulk processing genuinely needs it
|
|
266
|
+
await prisma.$transaction(async (tx) => { ... }, { timeout: 30_000 });
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### `migrate dev` can reset the database
|
|
270
|
+
|
|
271
|
+
`migrate dev` detects schema drift and may prompt to reset the DB, dropping all data.
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# NEVER on shared dev, staging, or production
|
|
275
|
+
npx prisma migrate dev --name add_column
|
|
276
|
+
|
|
277
|
+
# Safe everywhere except local solo dev
|
|
278
|
+
npx prisma migrate deploy
|
|
279
|
+
|
|
280
|
+
# Check drift without applying
|
|
281
|
+
npx prisma migrate diff \
|
|
282
|
+
--from-migrations ./prisma/migrations \
|
|
283
|
+
--to-schema-datamodel ./prisma/schema.prisma \
|
|
284
|
+
--shadow-database-url "$SHADOW_DATABASE_URL"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Manually editing a migration file breaks future deploys
|
|
288
|
+
|
|
289
|
+
Prisma checksums every migration file. Editing after apply causes `P3006 checksum mismatch` on every environment where the original already ran. Create a new migration instead.
|
|
290
|
+
|
|
291
|
+
### Breaking schema changes require multi-step migration
|
|
292
|
+
|
|
293
|
+
Adding `NOT NULL` to an existing column or renaming a column in one migration will lock the table or drop data. Use expand-and-contract:
|
|
294
|
+
|
|
295
|
+
```bash
|
|
296
|
+
# Step 1: create migration locally, then deploy
|
|
297
|
+
npx prisma migrate dev --name add_new_column # local only
|
|
298
|
+
npx prisma migrate deploy # staging / production
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
```ts
|
|
302
|
+
// Step 2: backfill data (run in a script or migration job, not in the shell)
|
|
303
|
+
await prisma.user.updateMany({ data: { newColumn: derivedValue } });
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
# Step 3: create the NOT NULL constraint migration locally, then deploy
|
|
308
|
+
npx prisma migrate dev --name make_new_column_required # local only
|
|
309
|
+
npx prisma migrate deploy # staging / production
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### `@updatedAt` does not fire on `updateMany`
|
|
313
|
+
|
|
314
|
+
`@updatedAt` is set automatically only on `update` and `upsert`. Bulk writes leave it stale.
|
|
315
|
+
|
|
316
|
+
```ts
|
|
317
|
+
// BAD: updatedAt stays at its old value
|
|
318
|
+
await prisma.post.updateMany({ where: { authorId }, data: { published: true } });
|
|
319
|
+
|
|
320
|
+
// GOOD
|
|
321
|
+
await prisma.post.updateMany({
|
|
322
|
+
where: { authorId },
|
|
323
|
+
data: { published: true, updatedAt: new Date() },
|
|
324
|
+
});
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Soft delete + `findUniqueOrThrow` leaks deleted records
|
|
328
|
+
|
|
329
|
+
`findUniqueOrThrow` throws `P2025` only when the row does not exist in the DB. Soft-deleted rows still exist and are returned without error.
|
|
330
|
+
|
|
331
|
+
`findUniqueOrThrow` requires a unique constraint field in `where` — adding `deletedAt: null` alongside `id` breaks the type because `{ id, deletedAt }` is not a compound unique constraint. Use `findFirstOrThrow` instead.
|
|
332
|
+
|
|
333
|
+
```ts
|
|
334
|
+
// BAD: returns soft-deleted user
|
|
335
|
+
const user = await prisma.user.findUniqueOrThrow({ where: { id } });
|
|
336
|
+
|
|
337
|
+
// BAD: Prisma type error — { id, deletedAt } is not a unique constraint
|
|
338
|
+
const user = await prisma.user.findUniqueOrThrow({ where: { id, deletedAt: null } });
|
|
339
|
+
|
|
340
|
+
// GOOD: findFirstOrThrow supports arbitrary where conditions
|
|
341
|
+
const user = await prisma.user.findFirstOrThrow({ where: { id, deletedAt: null } });
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
### `deleteMany` without `where` deletes every row
|
|
345
|
+
|
|
346
|
+
```ts
|
|
347
|
+
// BAD: silently wipes the table
|
|
348
|
+
await prisma.post.deleteMany();
|
|
349
|
+
|
|
350
|
+
// GOOD
|
|
351
|
+
await prisma.post.deleteMany({ where: { authorId: userId } });
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
## Best Practices
|
|
355
|
+
|
|
356
|
+
| Rule | Reason |
|
|
357
|
+
|---|---|
|
|
358
|
+
| `migrate deploy` in CI/CD, `migrate dev` only locally | `migrate dev` can reset the DB on drift |
|
|
359
|
+
| Map entities to response DTOs | Prevents leaking internal fields |
|
|
360
|
+
| Catch `PrismaClientKnownRequestError` at service boundary | Translate to domain errors |
|
|
361
|
+
| Prefer `*OrThrow` methods over manual null checks | Throws P2025 automatically; use `findFirstOrThrow` when filtering non-unique fields |
|
|
362
|
+
| `connection_limit=1` + external pooler in serverless | Prevents connection exhaustion |
|
|
363
|
+
| Always provide `where` on `deleteMany` | Prevents accidental table wipe |
|
|
364
|
+
| Set `updatedAt: new Date()` manually in `updateMany` | `@updatedAt` skips bulk writes |
|
|
365
|
+
|
|
366
|
+
## Related Skills
|
|
367
|
+
|
|
368
|
+
- `nestjs-patterns` — NestJS service layer that integrates Prisma
|
|
369
|
+
- `postgres-patterns` — PostgreSQL-level indexing and connection tuning
|
|
370
|
+
- `database-migrations` — multi-step migration planning for production
|
|
371
|
+
- `backend-patterns` — general API and service layer design
|