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,403 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: redis-patterns
|
|
3
|
+
description: Redis data structure patterns, caching strategies, distributed locks, rate limiting, pub/sub, and connection management for production applications.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Redis Patterns
|
|
8
|
+
|
|
9
|
+
Quick reference for Redis best practices across common backend use cases.
|
|
10
|
+
|
|
11
|
+
## How It Works
|
|
12
|
+
|
|
13
|
+
Redis is an in-memory data structure store that supports strings, hashes, lists, sets, sorted sets, streams, and more. Individual Redis commands are atomic on a single instance; multi-step workflows require Lua scripts, MULTI/EXEC transactions, or explicit synchronization to stay atomic. Data is optionally persisted via RDB snapshots or AOF logs. Clients communicate over TCP using the RESP protocol; connection pools are essential to avoid per-request handshake overhead.
|
|
14
|
+
|
|
15
|
+
## When to Activate
|
|
16
|
+
|
|
17
|
+
- Adding caching to an application
|
|
18
|
+
- Implementing rate limiting or throttling
|
|
19
|
+
- Building distributed locks or coordination
|
|
20
|
+
- Setting up session or token storage
|
|
21
|
+
- Using Pub/Sub or Redis Streams for messaging
|
|
22
|
+
- Configuring Redis in production (pooling, eviction, clustering)
|
|
23
|
+
|
|
24
|
+
## Data Structure Cheat Sheet
|
|
25
|
+
|
|
26
|
+
| Use Case | Structure | Example Key |
|
|
27
|
+
|----------|-----------|-------------|
|
|
28
|
+
| Simple cache | String | `product:123` |
|
|
29
|
+
| User session | Hash | `session:abc` |
|
|
30
|
+
| Leaderboard | Sorted Set | `scores:weekly` |
|
|
31
|
+
| Unique visitors | Set | `visitors:2024-01-01` |
|
|
32
|
+
| Activity feed | List | `feed:user:456` |
|
|
33
|
+
| Event stream | Stream | `events:orders` |
|
|
34
|
+
| Counters / rate limits | String (INCR) | `ratelimit:user:123` |
|
|
35
|
+
| Bloom filter / HLL | HyperLogLog | `hll:pageviews` |
|
|
36
|
+
|
|
37
|
+
## Core Patterns
|
|
38
|
+
|
|
39
|
+
### Cache-Aside (Lazy Loading)
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
import redis
|
|
43
|
+
import json
|
|
44
|
+
|
|
45
|
+
r = redis.Redis(host='localhost', port=6379, decode_responses=True)
|
|
46
|
+
|
|
47
|
+
def get_product(product_id: int):
|
|
48
|
+
cache_key = f"product:{product_id}"
|
|
49
|
+
cached = r.get(cache_key)
|
|
50
|
+
|
|
51
|
+
if cached:
|
|
52
|
+
return json.loads(cached)
|
|
53
|
+
|
|
54
|
+
product = db.query("SELECT * FROM products WHERE id = %s", product_id)
|
|
55
|
+
r.setex(cache_key, 3600, json.dumps(product)) # TTL: 1 hour
|
|
56
|
+
return product
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Write-Through Cache
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
def update_product(product_id: int, data: dict):
|
|
63
|
+
# Write to DB first
|
|
64
|
+
db.execute("UPDATE products SET ... WHERE id = %s", product_id)
|
|
65
|
+
|
|
66
|
+
# Immediately update cache
|
|
67
|
+
cache_key = f"product:{product_id}"
|
|
68
|
+
r.setex(cache_key, 3600, json.dumps(data))
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Cache Invalidation
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
# Tag-based invalidation — group related keys under a set
|
|
75
|
+
def cache_product(product_id: int, category_id: int, data: dict):
|
|
76
|
+
key = f"product:{product_id}"
|
|
77
|
+
tag = f"tag:category:{category_id}"
|
|
78
|
+
pipe = r.pipeline(transaction=True)
|
|
79
|
+
pipe.setex(key, 3600, json.dumps(data))
|
|
80
|
+
pipe.sadd(tag, key)
|
|
81
|
+
pipe.expire(tag, 3600)
|
|
82
|
+
pipe.execute()
|
|
83
|
+
|
|
84
|
+
def invalidate_category(category_id: int):
|
|
85
|
+
tag = f"tag:category:{category_id}"
|
|
86
|
+
keys = r.smembers(tag)
|
|
87
|
+
if keys:
|
|
88
|
+
r.delete(*keys)
|
|
89
|
+
r.delete(tag)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Session Storage
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
import time
|
|
96
|
+
import uuid
|
|
97
|
+
|
|
98
|
+
def create_session(user_id: int, ttl: int = 86400) -> str:
|
|
99
|
+
session_id = str(uuid.uuid4())
|
|
100
|
+
key = f"session:{session_id}"
|
|
101
|
+
pipe = r.pipeline(transaction=True)
|
|
102
|
+
pipe.hset(key, mapping={
|
|
103
|
+
"user_id": user_id,
|
|
104
|
+
"created_at": int(time.time()),
|
|
105
|
+
})
|
|
106
|
+
pipe.expire(key, ttl)
|
|
107
|
+
pipe.execute()
|
|
108
|
+
return session_id
|
|
109
|
+
|
|
110
|
+
def get_session(session_id: str) -> dict | None:
|
|
111
|
+
data = r.hgetall(f"session:{session_id}")
|
|
112
|
+
return data if data else None
|
|
113
|
+
|
|
114
|
+
def delete_session(session_id: str):
|
|
115
|
+
r.delete(f"session:{session_id}")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Rate Limiting
|
|
119
|
+
|
|
120
|
+
### Fixed Window (Simple)
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
def is_rate_limited(user_id: int, limit: int = 100, window: int = 60) -> bool:
|
|
124
|
+
key = f"ratelimit:{user_id}:{int(time.time()) // window}"
|
|
125
|
+
pipe = r.pipeline(transaction=True)
|
|
126
|
+
pipe.incr(key)
|
|
127
|
+
pipe.expire(key, window)
|
|
128
|
+
count, _ = pipe.execute()
|
|
129
|
+
return count > limit
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Sliding Window (Lua — Atomic)
|
|
133
|
+
|
|
134
|
+
```lua
|
|
135
|
+
-- sliding_window.lua
|
|
136
|
+
local key = KEYS[1]
|
|
137
|
+
local now = tonumber(ARGV[1])
|
|
138
|
+
local window = tonumber(ARGV[2])
|
|
139
|
+
local limit = tonumber(ARGV[3])
|
|
140
|
+
|
|
141
|
+
redis.call('ZREMRANGEBYSCORE', key, 0, now - window)
|
|
142
|
+
local count = redis.call('ZCARD', key)
|
|
143
|
+
|
|
144
|
+
if count < limit then
|
|
145
|
+
-- Use unique member (now + sequence) to avoid collisions within the same millisecond
|
|
146
|
+
local seq_key = key .. ':seq'
|
|
147
|
+
local seq = redis.call('INCR', seq_key)
|
|
148
|
+
redis.call('EXPIRE', seq_key, math.ceil(window / 1000))
|
|
149
|
+
redis.call('ZADD', key, now, now .. '-' .. seq)
|
|
150
|
+
redis.call('EXPIRE', key, math.ceil(window / 1000))
|
|
151
|
+
return 1
|
|
152
|
+
end
|
|
153
|
+
return 0
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
sliding_window = r.register_script(open('sliding_window.lua').read())
|
|
158
|
+
|
|
159
|
+
def allow_request(user_id: int) -> bool:
|
|
160
|
+
key = f"ratelimit:sliding:{user_id}"
|
|
161
|
+
now = int(time.time() * 1000)
|
|
162
|
+
return bool(sliding_window(keys=[key], args=[now, 60000, 100]))
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
## Distributed Locks
|
|
166
|
+
|
|
167
|
+
### Distributed Lock (Single Node — SET NX PX)
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
import uuid
|
|
171
|
+
|
|
172
|
+
def acquire_lock(resource: str, ttl_ms: int = 5000) -> str | None:
|
|
173
|
+
lock_key = f"lock:{resource}"
|
|
174
|
+
token = str(uuid.uuid4())
|
|
175
|
+
acquired = r.set(lock_key, token, px=ttl_ms, nx=True)
|
|
176
|
+
return token if acquired else None
|
|
177
|
+
|
|
178
|
+
def release_lock(resource: str, token: str) -> bool:
|
|
179
|
+
release_script = """
|
|
180
|
+
if redis.call('get', KEYS[1]) == ARGV[1] then
|
|
181
|
+
return redis.call('del', KEYS[1])
|
|
182
|
+
else
|
|
183
|
+
return 0
|
|
184
|
+
end
|
|
185
|
+
"""
|
|
186
|
+
result = r.eval(release_script, 1, f"lock:{resource}", token)
|
|
187
|
+
return bool(result)
|
|
188
|
+
|
|
189
|
+
# Usage
|
|
190
|
+
token = acquire_lock("order:payment:123")
|
|
191
|
+
if token:
|
|
192
|
+
try:
|
|
193
|
+
process_payment()
|
|
194
|
+
finally:
|
|
195
|
+
release_lock("order:payment:123", token)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
> For multi-node setups use the `redlock-py` library which implements the full Redlock algorithm.
|
|
199
|
+
|
|
200
|
+
## Pub/Sub & Streams
|
|
201
|
+
|
|
202
|
+
### Pub/Sub (Fire-and-Forget)
|
|
203
|
+
|
|
204
|
+
```python
|
|
205
|
+
# Publisher
|
|
206
|
+
def publish_event(channel: str, payload: dict):
|
|
207
|
+
r.publish(channel, json.dumps(payload))
|
|
208
|
+
|
|
209
|
+
# Subscriber (blocking — run in separate thread/process)
|
|
210
|
+
def subscribe_events(channel: str):
|
|
211
|
+
pubsub = r.pubsub()
|
|
212
|
+
pubsub.subscribe(channel)
|
|
213
|
+
for message in pubsub.listen():
|
|
214
|
+
if message['type'] == 'message':
|
|
215
|
+
handle(json.loads(message['data']))
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Redis Streams (Durable Queue)
|
|
219
|
+
|
|
220
|
+
```python
|
|
221
|
+
# Producer
|
|
222
|
+
def emit(stream: str, event: dict):
|
|
223
|
+
r.xadd(stream, event, maxlen=10000) # Cap stream length
|
|
224
|
+
|
|
225
|
+
# Consumer group — guarantees at-least-once delivery
|
|
226
|
+
try:
|
|
227
|
+
r.xgroup_create('events:orders', 'processor', id='0', mkstream=True)
|
|
228
|
+
except Exception:
|
|
229
|
+
pass # Group already exists
|
|
230
|
+
|
|
231
|
+
def consume(stream: str, group: str, consumer: str):
|
|
232
|
+
while True:
|
|
233
|
+
messages = r.xreadgroup(group, consumer, {stream: '>'}, count=10, block=2000)
|
|
234
|
+
for _, entries in (messages or []):
|
|
235
|
+
for msg_id, data in entries:
|
|
236
|
+
process(data)
|
|
237
|
+
r.xack(stream, group, msg_id)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
> Prefer **Streams** over Pub/Sub when you need delivery guarantees, consumer groups, or replay.
|
|
241
|
+
|
|
242
|
+
## Key Design
|
|
243
|
+
|
|
244
|
+
### Naming Conventions
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
# Pattern: resource:id:field
|
|
248
|
+
user:123:profile
|
|
249
|
+
order:456:status
|
|
250
|
+
cache:product:789
|
|
251
|
+
|
|
252
|
+
# Pattern: namespace:resource:id
|
|
253
|
+
myapp:session:abc123
|
|
254
|
+
myapp:ratelimit:user:123
|
|
255
|
+
|
|
256
|
+
# Pattern: resource:date (time-bound keys)
|
|
257
|
+
stats:pageviews:2024-01-01
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### TTL Strategy
|
|
261
|
+
|
|
262
|
+
| Data Type | Suggested TTL |
|
|
263
|
+
|-----------|--------------|
|
|
264
|
+
| User session | 24h (`86400`) |
|
|
265
|
+
| API response cache | 5–15 min |
|
|
266
|
+
| Rate limit window | Match window size |
|
|
267
|
+
| Short-lived tokens | 5–10 min |
|
|
268
|
+
| Leaderboard | 1h–24h |
|
|
269
|
+
| Static/reference data | 1h–1 week |
|
|
270
|
+
|
|
271
|
+
Always set a TTL. Keys without TTL accumulate indefinitely and cause memory pressure.
|
|
272
|
+
|
|
273
|
+
## Connection Management
|
|
274
|
+
|
|
275
|
+
### Connection Pooling
|
|
276
|
+
|
|
277
|
+
```python
|
|
278
|
+
from redis import ConnectionPool, Redis
|
|
279
|
+
|
|
280
|
+
pool = ConnectionPool(
|
|
281
|
+
host='localhost',
|
|
282
|
+
port=6379,
|
|
283
|
+
db=0,
|
|
284
|
+
max_connections=20,
|
|
285
|
+
decode_responses=True,
|
|
286
|
+
socket_connect_timeout=2,
|
|
287
|
+
socket_timeout=2,
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
r = Redis(connection_pool=pool)
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Cluster Mode
|
|
294
|
+
|
|
295
|
+
```python
|
|
296
|
+
from redis.cluster import RedisCluster
|
|
297
|
+
|
|
298
|
+
r = RedisCluster(
|
|
299
|
+
startup_nodes=[{"host": "redis-1", "port": 6379}],
|
|
300
|
+
decode_responses=True,
|
|
301
|
+
skip_full_coverage_check=True,
|
|
302
|
+
)
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### Sentinel (High Availability)
|
|
306
|
+
|
|
307
|
+
```python
|
|
308
|
+
from redis.sentinel import Sentinel
|
|
309
|
+
|
|
310
|
+
sentinel = Sentinel(
|
|
311
|
+
[('sentinel-1', 26379), ('sentinel-2', 26379)],
|
|
312
|
+
socket_timeout=0.5,
|
|
313
|
+
)
|
|
314
|
+
master = sentinel.master_for('mymaster', decode_responses=True)
|
|
315
|
+
replica = sentinel.slave_for('mymaster', decode_responses=True)
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Eviction Policies
|
|
319
|
+
|
|
320
|
+
| Policy | Behavior | Best For |
|
|
321
|
+
|--------|----------|----------|
|
|
322
|
+
| `noeviction` | Error on write when full | Queues / critical data |
|
|
323
|
+
| `allkeys-lru` | Evict least recently used | General cache |
|
|
324
|
+
| `volatile-lru` | LRU only among keys with TTL | Mixed data store |
|
|
325
|
+
| `allkeys-lfu` | Evict least frequently used | Skewed access patterns |
|
|
326
|
+
| `volatile-ttl` | Evict soonest-to-expire | Prioritize long-lived data |
|
|
327
|
+
|
|
328
|
+
Set via `redis.conf`: `maxmemory-policy allkeys-lru`
|
|
329
|
+
|
|
330
|
+
## Anti-Patterns
|
|
331
|
+
|
|
332
|
+
| Anti-Pattern | Problem | Fix |
|
|
333
|
+
|---|---|---|
|
|
334
|
+
| Keys with no TTL | Memory grows unbounded | Always set TTL |
|
|
335
|
+
| `KEYS *` in production | Blocks the server (O(N)) | Use `SCAN` cursor |
|
|
336
|
+
| Storing large blobs (>100KB) | Slow serialization, memory pressure | Store reference + fetch from object store |
|
|
337
|
+
| Single Redis for everything | No isolation between cache & queue | Use separate DBs or instances |
|
|
338
|
+
| Ignoring connection pool limits | Connection exhaustion under load | Size pool to workload |
|
|
339
|
+
| Not handling cache miss stampede | Thundering herd on cold start | Use locks or probabilistic early expiry |
|
|
340
|
+
| `FLUSHALL` without thought | Wipes entire instance | Scope deletes by key pattern |
|
|
341
|
+
|
|
342
|
+
### Cache Miss Stampede Prevention
|
|
343
|
+
|
|
344
|
+
```python
|
|
345
|
+
import threading
|
|
346
|
+
|
|
347
|
+
_locks: dict[str, threading.Lock] = {}
|
|
348
|
+
_locks_mutex = threading.Lock()
|
|
349
|
+
|
|
350
|
+
def get_with_lock(key: str, fetch_fn, ttl: int = 300):
|
|
351
|
+
cached = r.get(key)
|
|
352
|
+
if cached:
|
|
353
|
+
return json.loads(cached)
|
|
354
|
+
|
|
355
|
+
with _locks_mutex:
|
|
356
|
+
if key not in _locks:
|
|
357
|
+
_locks[key] = threading.Lock()
|
|
358
|
+
lock = _locks[key]
|
|
359
|
+
with lock:
|
|
360
|
+
cached = r.get(key) # Re-check after acquiring lock
|
|
361
|
+
if cached:
|
|
362
|
+
return json.loads(cached)
|
|
363
|
+
value = fetch_fn()
|
|
364
|
+
r.setex(key, ttl, json.dumps(value))
|
|
365
|
+
return value
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
> Note: for multi-process deployments, replace the in-process lock with `acquire_lock`/`release_lock` from the Distributed Locks section above.
|
|
369
|
+
|
|
370
|
+
## Examples
|
|
371
|
+
|
|
372
|
+
**Add caching to a Django/Flask API endpoint:**
|
|
373
|
+
Use cache-aside with `setex` and a 5-minute TTL on the response. Key on the request parameters.
|
|
374
|
+
|
|
375
|
+
**Rate-limit an API by user:**
|
|
376
|
+
Use fixed-window with `pipeline(transaction=True)` for low-traffic endpoints; use sliding-window Lua for accurate per-user throttling.
|
|
377
|
+
|
|
378
|
+
**Coordinate a background job across workers:**
|
|
379
|
+
Use `acquire_lock` with a TTL that exceeds the expected job duration. Always release in a `finally` block.
|
|
380
|
+
|
|
381
|
+
**Fan-out notifications to multiple subscribers:**
|
|
382
|
+
Use Pub/Sub for fire-and-forget. Switch to Streams if you need guaranteed delivery or replay for late consumers.
|
|
383
|
+
|
|
384
|
+
## Quick Reference
|
|
385
|
+
|
|
386
|
+
| Pattern | When to Use |
|
|
387
|
+
|---------|-------------|
|
|
388
|
+
| Cache-aside | Read-heavy, tolerate slight staleness |
|
|
389
|
+
| Write-through | Strong consistency required |
|
|
390
|
+
| Distributed lock | Prevent concurrent access to a resource |
|
|
391
|
+
| Sliding window rate limit | Accurate per-user throttling |
|
|
392
|
+
| Redis Streams | Durable event queue with consumer groups |
|
|
393
|
+
| Pub/Sub | Broadcast with no delivery guarantees needed |
|
|
394
|
+
| Sorted Set leaderboard | Ranked scoring, pagination |
|
|
395
|
+
| HyperLogLog | Approximate unique count at low memory |
|
|
396
|
+
|
|
397
|
+
## Related
|
|
398
|
+
|
|
399
|
+
- Skill: `postgres-patterns` — relational data patterns
|
|
400
|
+
- Skill: `backend-patterns` — API and service layer patterns
|
|
401
|
+
- Skill: `database-migrations` — schema versioning
|
|
402
|
+
- Skill: `django-patterns` — Django cache framework integration
|
|
403
|
+
- Agent: `database-reviewer` — full database review workflow
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pubmed-database
|
|
3
|
+
description: Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.
|
|
4
|
+
origin: community
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# PubMed Database
|
|
8
|
+
|
|
9
|
+
Use this skill when a task needs biomedical literature from PubMed rather than
|
|
10
|
+
general web search.
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Searching MEDLINE or life-sciences literature.
|
|
15
|
+
- Building PubMed queries with MeSH terms, field tags, dates, or article types.
|
|
16
|
+
- Looking up PMIDs, abstracts, publication metadata, or related citations.
|
|
17
|
+
- Running systematic-review search passes that need repeatable search strings.
|
|
18
|
+
- Using NCBI E-utilities directly from Python, shell, or another HTTP client.
|
|
19
|
+
|
|
20
|
+
## Query Construction
|
|
21
|
+
|
|
22
|
+
Start with the research question, split it into concepts, then combine concepts
|
|
23
|
+
with Boolean operators.
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
concept_1 AND concept_2 AND filter
|
|
27
|
+
synonym_a OR synonym_b
|
|
28
|
+
NOT exclusion_term
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Useful PubMed field tags:
|
|
32
|
+
|
|
33
|
+
- `[ti]`: title
|
|
34
|
+
- `[ab]`: abstract
|
|
35
|
+
- `[tiab]`: title or abstract
|
|
36
|
+
- `[au]`: author
|
|
37
|
+
- `[ta]`: journal title abbreviation
|
|
38
|
+
- `[mh]`: MeSH term
|
|
39
|
+
- `[majr]`: major MeSH topic
|
|
40
|
+
- `[pt]`: publication type
|
|
41
|
+
- `[dp]`: date of publication
|
|
42
|
+
- `[la]`: language
|
|
43
|
+
|
|
44
|
+
Examples:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
diabetes mellitus[mh] AND treatment[tiab] AND systematic review[pt] AND 2023:2026[dp]
|
|
48
|
+
(metformin[nm] OR insulin[nm]) AND diabetes mellitus, type 2[mh] AND randomized controlled trial[pt]
|
|
49
|
+
smith ja[au] AND cancer[tiab] AND 2026[dp] AND english[la]
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## MeSH and Subheadings
|
|
53
|
+
|
|
54
|
+
Prefer MeSH when the concept has a stable controlled-vocabulary term. Combine
|
|
55
|
+
MeSH with title/abstract terms when the topic is new or terminology varies.
|
|
56
|
+
|
|
57
|
+
Correct subheading syntax puts the subheading before the field tag:
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
diabetes mellitus, type 2/drug therapy[mh]
|
|
61
|
+
cardiovascular diseases/prevention & control[mh]
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Use `[majr]` only when the topic must be central to the paper. It can improve
|
|
65
|
+
precision but may miss relevant work.
|
|
66
|
+
|
|
67
|
+
## Filters
|
|
68
|
+
|
|
69
|
+
Publication types:
|
|
70
|
+
|
|
71
|
+
- `clinical trial[pt]`
|
|
72
|
+
- `meta-analysis[pt]`
|
|
73
|
+
- `randomized controlled trial[pt]`
|
|
74
|
+
- `review[pt]`
|
|
75
|
+
- `systematic review[pt]`
|
|
76
|
+
- `guideline[pt]`
|
|
77
|
+
|
|
78
|
+
Date filters:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
2026[dp]
|
|
82
|
+
2020:2026[dp]
|
|
83
|
+
2026/03/15[dp]
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Availability filters:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
free full text[sb]
|
|
90
|
+
hasabstract[text]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## E-utilities Workflow
|
|
94
|
+
|
|
95
|
+
NCBI E-utilities supports repeatable API workflows:
|
|
96
|
+
|
|
97
|
+
1. `esearch.fcgi`: search and return PMIDs.
|
|
98
|
+
2. `esummary.fcgi`: return lightweight article metadata.
|
|
99
|
+
3. `efetch.fcgi`: fetch abstracts or full records in XML, MEDLINE, or text.
|
|
100
|
+
4. `elink.fcgi`: find related articles and linked resources.
|
|
101
|
+
|
|
102
|
+
Use an email and API key for production scripts. Store API keys in environment
|
|
103
|
+
variables, never in committed files or command history.
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
import os
|
|
107
|
+
import time
|
|
108
|
+
import requests
|
|
109
|
+
|
|
110
|
+
BASE = "https://eutils.ncbi.nlm.nih.gov/entrez/eutils"
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def esearch(query: str, retmax: int = 20) -> list[str]:
|
|
114
|
+
params = {
|
|
115
|
+
"db": "pubmed",
|
|
116
|
+
"term": query,
|
|
117
|
+
"retmode": "json",
|
|
118
|
+
"retmax": retmax,
|
|
119
|
+
"tool": "ecc-pubmed-search",
|
|
120
|
+
"email": os.environ.get("NCBI_EMAIL", ""),
|
|
121
|
+
}
|
|
122
|
+
api_key = os.environ.get("NCBI_API_KEY")
|
|
123
|
+
if api_key:
|
|
124
|
+
params["api_key"] = api_key
|
|
125
|
+
|
|
126
|
+
response = requests.get(f"{BASE}/esearch.fcgi", params=params, timeout=30)
|
|
127
|
+
response.raise_for_status()
|
|
128
|
+
time.sleep(0.35)
|
|
129
|
+
return response.json()["esearchresult"]["idlist"]
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
pmids = esearch("hypertension[mh] AND randomized controlled trial[pt] AND 2024:2026[dp]")
|
|
133
|
+
print(pmids)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For batches, prefer NCBI history server parameters (`usehistory=y`,
|
|
137
|
+
`WebEnv`, `query_key`) instead of passing very long PMID lists through URLs.
|
|
138
|
+
|
|
139
|
+
## Output Discipline
|
|
140
|
+
|
|
141
|
+
For each search pass, record:
|
|
142
|
+
|
|
143
|
+
- exact search string
|
|
144
|
+
- database searched
|
|
145
|
+
- date searched
|
|
146
|
+
- filters used
|
|
147
|
+
- result count
|
|
148
|
+
- export format
|
|
149
|
+
- any manual exclusions
|
|
150
|
+
|
|
151
|
+
Example:
|
|
152
|
+
|
|
153
|
+
```markdown
|
|
154
|
+
| Database | Date searched | Query | Filters | Results |
|
|
155
|
+
| --- | --- | --- | --- | ---: |
|
|
156
|
+
| PubMed | 2026-05-11 | `sickle cell disease[mh] AND CRISPR[tiab]` | 2020:2026[dp], English | 42 |
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Review Checklist
|
|
160
|
+
|
|
161
|
+
- Are field tags valid PubMed tags?
|
|
162
|
+
- Are MeSH terms paired with free-text synonyms for newer topics?
|
|
163
|
+
- Is the date range explicit and appropriate?
|
|
164
|
+
- Does the search log include enough detail to reproduce the query?
|
|
165
|
+
- Are API keys loaded from the environment?
|
|
166
|
+
- Does HTTP code call `raise_for_status()` or otherwise handle non-200
|
|
167
|
+
responses before parsing?
|
|
168
|
+
- Are rate limits respected?
|
|
169
|
+
|
|
170
|
+
## References
|
|
171
|
+
|
|
172
|
+
- [PubMed help](https://pubmed.ncbi.nlm.nih.gov/help/)
|
|
173
|
+
- [NCBI E-utilities documentation](https://www.ncbi.nlm.nih.gov/books/NBK25501/)
|
|
174
|
+
- [NCBI API key guidance](https://support.nlm.nih.gov/kbArticle/?pn=KA-05317)
|
|
175
|
+
- NCBI support: <eutilities@ncbi.nlm.nih.gov>
|