claudecode-omc 5.6.5 → 5.6.7
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/h5-to-swiftui/SKILL.md +201 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/README.md +176 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/h5-twin/index.html +52 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/h5-twin/style.css +133 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin/Package.swift +26 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin/Sources/CalibrationScreen/CalibrationScreen.swift +142 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin-divergent/Package.swift +32 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/swiftui-twin-divergent/Sources/CalibrationScreenDivergent/CalibrationScreenDivergent.swift +122 -0
- package/.local/skills/h5-to-swiftui/assets/calibration/tokens.json +42 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/index.html +14 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/package.json +20 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/public/api/articles/001.json +96 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/public/api/articles/index.json +89 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/App.jsx +22 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/App.module.css +11 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/ArticleCard.jsx +53 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/ArticleCard.module.css +139 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/NavBar.jsx +37 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/NavBar.module.css +72 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TagCloud.jsx +30 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TagCloud.module.css +50 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TrendChart.jsx +159 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/components/TrendChart.module.css +21 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/main.jsx +12 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/ArticleScreen.jsx +182 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/ArticleScreen.module.css +294 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/FeedScreen.jsx +147 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/screens/FeedScreen.module.css +161 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/styles/global.css +50 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/src/styles/tokens.css +103 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-react/vite.config.js +6 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/data/tasks.js +67 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/index.html +26 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/router.js +73 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/screens/detail.js +164 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/screens/home.js +53 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/screens/list.js +87 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/styles/app.css +342 -0
- package/.local/skills/h5-to-swiftui/assets/sample-h5-vanilla/styles/tokens.css +68 -0
- package/.local/skills/h5-to-swiftui/references/css-to-swiftui-map.md +205 -0
- package/.local/skills/h5-to-swiftui/references/design-token-extraction.md +209 -0
- package/.local/skills/h5-to-swiftui/references/high-risk-triage.md +209 -0
- package/.local/skills/h5-to-swiftui/references/render-equivalence-calibration.md +193 -0
- package/.local/skills/h5-to-swiftui/references/stack-detection.md +160 -0
- package/.local/skills/h5-to-swiftui/references/visual-diff-loop-protocol.md +365 -0
- package/.local/skills/h5-to-swiftui/scripts/_calib-consts.mjs +150 -0
- package/.local/skills/h5-to-swiftui/scripts/_imglib.mjs +547 -0
- package/.local/skills/h5-to-swiftui/scripts/_provenance.mjs +123 -0
- package/.local/skills/h5-to-swiftui/scripts/calibrate-render.mjs +625 -0
- package/.local/skills/h5-to-swiftui/scripts/capture-reference.mjs +386 -0
- package/.local/skills/h5-to-swiftui/scripts/detect-stack.mjs +305 -0
- package/.local/skills/h5-to-swiftui/scripts/evaluate-convergence.mjs +1093 -0
- package/.local/skills/h5-to-swiftui/scripts/extract-tokens.mjs +600 -0
- package/.local/skills/h5-to-swiftui/scripts/mark-overlay.mjs +379 -0
- package/.local/skills/h5-to-swiftui/scripts/pixel-diff.mjs +530 -0
- package/.local/skills/h5-to-swiftui/scripts/sim-screenshot.sh +544 -0
- 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/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,412 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mysql-patterns
|
|
3
|
+
description: MySQL and MariaDB schema, query, indexing, transaction, replication, and connection-pool patterns for production backends.
|
|
4
|
+
origin: ECC
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# MySQL Patterns
|
|
8
|
+
|
|
9
|
+
Use this skill when working on MySQL or MariaDB schema design, migrations,
|
|
10
|
+
slow-query investigation, queue-style transactions, connection pools, or
|
|
11
|
+
production database configuration. Prefer exact version checks before applying a
|
|
12
|
+
feature-specific pattern because MySQL and MariaDB have diverged in several SQL
|
|
13
|
+
details.
|
|
14
|
+
|
|
15
|
+
## Activation
|
|
16
|
+
|
|
17
|
+
- Designing MySQL or MariaDB tables, indexes, and constraints
|
|
18
|
+
- Reviewing migrations before they run on large production tables
|
|
19
|
+
- Debugging slow queries, lock waits, deadlocks, or connection exhaustion
|
|
20
|
+
- Adding keyset pagination, upserts, full-text search, JSON columns, or queues
|
|
21
|
+
- Configuring application connection pools, read replicas, TLS, or slow logs
|
|
22
|
+
|
|
23
|
+
## Version Check
|
|
24
|
+
|
|
25
|
+
Start by identifying the engine and version:
|
|
26
|
+
|
|
27
|
+
```sql
|
|
28
|
+
SELECT VERSION();
|
|
29
|
+
SHOW VARIABLES LIKE 'version_comment';
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Keep MySQL and MariaDB guidance separate when syntax differs:
|
|
33
|
+
|
|
34
|
+
- MySQL documents row aliases as the replacement for `VALUES(col)` in
|
|
35
|
+
`ON DUPLICATE KEY UPDATE`; `VALUES(col)` is deprecated there.
|
|
36
|
+
- MariaDB documents `VALUES(col)` as the supported way to reference inserted
|
|
37
|
+
values in `ON DUPLICATE KEY UPDATE`; use it for cross-engine compatibility.
|
|
38
|
+
- `SKIP LOCKED` is appropriate for queue-like work only. It skips locked rows
|
|
39
|
+
and can return an inconsistent view, so do not use it for general accounting
|
|
40
|
+
or integrity-sensitive reads.
|
|
41
|
+
|
|
42
|
+
## Schema Defaults
|
|
43
|
+
|
|
44
|
+
```sql
|
|
45
|
+
CREATE TABLE orders (
|
|
46
|
+
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
47
|
+
account_id BIGINT UNSIGNED NOT NULL,
|
|
48
|
+
status VARCHAR(32) NOT NULL,
|
|
49
|
+
total DECIMAL(15, 2) NOT NULL,
|
|
50
|
+
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
51
|
+
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
52
|
+
deleted_at DATETIME NULL,
|
|
53
|
+
PRIMARY KEY (id),
|
|
54
|
+
KEY idx_orders_account_status_created (account_id, status, created_at),
|
|
55
|
+
KEY idx_orders_active (account_id, deleted_at)
|
|
56
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Default choices:
|
|
60
|
+
|
|
61
|
+
| Use Case | Prefer | Avoid |
|
|
62
|
+
| --- | --- | --- |
|
|
63
|
+
| Surrogate primary keys | `BIGINT UNSIGNED AUTO_INCREMENT` | `INT` for tables that can grow beyond 2B rows |
|
|
64
|
+
| UUID lookup keys | `BINARY(16)` with conversion helpers | `VARCHAR(36)` primary keys on hot tables |
|
|
65
|
+
| Money and exact quantities | `DECIMAL(p, s)` | `FLOAT` or `DOUBLE` |
|
|
66
|
+
| User-facing text | `utf8mb4` tables and indexes | MySQL `utf8` / `utf8mb3` defaults |
|
|
67
|
+
| Application timestamps | `DATETIME` with UTC managed by the app | Assuming `DATETIME` stores time zone metadata |
|
|
68
|
+
| Soft deletes | `deleted_at DATETIME NULL` plus scoped indexes | Filtering soft-deleted rows without an index |
|
|
69
|
+
| Extensible status values | lookup table or constrained `VARCHAR` | `ENUM` when values change often |
|
|
70
|
+
|
|
71
|
+
## Indexing
|
|
72
|
+
|
|
73
|
+
Composite index order usually follows equality predicates first, then range or
|
|
74
|
+
sort columns:
|
|
75
|
+
|
|
76
|
+
```sql
|
|
77
|
+
CREATE INDEX idx_orders_account_status_created
|
|
78
|
+
ON orders (account_id, status, created_at);
|
|
79
|
+
|
|
80
|
+
SELECT id, total
|
|
81
|
+
FROM orders
|
|
82
|
+
WHERE account_id = ?
|
|
83
|
+
AND status = 'pending'
|
|
84
|
+
AND created_at >= ?
|
|
85
|
+
ORDER BY created_at DESC
|
|
86
|
+
LIMIT 50;
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Use `EXPLAIN` before adding or changing an index:
|
|
90
|
+
|
|
91
|
+
```sql
|
|
92
|
+
EXPLAIN
|
|
93
|
+
SELECT id, total
|
|
94
|
+
FROM orders
|
|
95
|
+
WHERE account_id = 123 AND status = 'pending'
|
|
96
|
+
ORDER BY created_at DESC
|
|
97
|
+
LIMIT 50;
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Signals to investigate:
|
|
101
|
+
|
|
102
|
+
| Field | Risk Signal |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| `type` | `ALL` on a large table |
|
|
105
|
+
| `key` | `NULL` when a selective predicate exists |
|
|
106
|
+
| `rows` | Very high row estimate for an interactive path |
|
|
107
|
+
| `Extra` | `Using temporary`, `Using filesort`, or broad `Using where` |
|
|
108
|
+
|
|
109
|
+
Avoid adding indexes blindly. Each index increases write cost, migration time,
|
|
110
|
+
backup size, and buffer-pool pressure.
|
|
111
|
+
|
|
112
|
+
## Query Patterns
|
|
113
|
+
|
|
114
|
+
### Upsert
|
|
115
|
+
|
|
116
|
+
Cross-engine-compatible form:
|
|
117
|
+
|
|
118
|
+
```sql
|
|
119
|
+
INSERT INTO user_settings (user_id, setting_key, setting_value)
|
|
120
|
+
VALUES (?, ?, ?)
|
|
121
|
+
ON DUPLICATE KEY UPDATE
|
|
122
|
+
setting_value = VALUES(setting_value),
|
|
123
|
+
updated_at = CURRENT_TIMESTAMP;
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
MySQL row-alias form:
|
|
127
|
+
|
|
128
|
+
```sql
|
|
129
|
+
INSERT INTO user_settings (user_id, setting_key, setting_value)
|
|
130
|
+
VALUES (?, ?, ?) AS new
|
|
131
|
+
ON DUPLICATE KEY UPDATE
|
|
132
|
+
setting_value = new.setting_value,
|
|
133
|
+
updated_at = CURRENT_TIMESTAMP;
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Use the row-alias form only after confirming the target is MySQL. Use
|
|
137
|
+
`VALUES(col)` for MariaDB or mixed MySQL/MariaDB fleets.
|
|
138
|
+
|
|
139
|
+
### Keyset Pagination
|
|
140
|
+
|
|
141
|
+
```sql
|
|
142
|
+
SELECT id, name, created_at
|
|
143
|
+
FROM products
|
|
144
|
+
WHERE (created_at, id) < (?, ?)
|
|
145
|
+
ORDER BY created_at DESC, id DESC
|
|
146
|
+
LIMIT 50;
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Back it with an index that matches the cursor:
|
|
150
|
+
|
|
151
|
+
```sql
|
|
152
|
+
CREATE INDEX idx_products_created_id ON products (created_at, id);
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Do not use deep `OFFSET` pagination on large tables; it makes the server scan
|
|
156
|
+
and discard rows before returning the page.
|
|
157
|
+
|
|
158
|
+
### JSON Fields
|
|
159
|
+
|
|
160
|
+
Use JSON columns for extension data, not for fields that need heavy relational
|
|
161
|
+
filtering or constraints.
|
|
162
|
+
|
|
163
|
+
```sql
|
|
164
|
+
CREATE TABLE events (
|
|
165
|
+
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
|
166
|
+
payload JSON NOT NULL,
|
|
167
|
+
event_type VARCHAR(64)
|
|
168
|
+
GENERATED ALWAYS AS (JSON_UNQUOTE(JSON_EXTRACT(payload, '$.type'))) STORED,
|
|
169
|
+
KEY idx_events_type (event_type)
|
|
170
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
For frequently queried JSON paths, expose a generated column and index that
|
|
174
|
+
column. Keep foreign keys, ownership, tenancy, and lifecycle fields relational.
|
|
175
|
+
|
|
176
|
+
### Full-Text Search
|
|
177
|
+
|
|
178
|
+
```sql
|
|
179
|
+
ALTER TABLE articles ADD FULLTEXT KEY ft_articles_title_body (title, body);
|
|
180
|
+
|
|
181
|
+
SELECT id, title, MATCH(title, body) AGAINST (? IN NATURAL LANGUAGE MODE) AS score
|
|
182
|
+
FROM articles
|
|
183
|
+
WHERE MATCH(title, body) AGAINST (? IN NATURAL LANGUAGE MODE)
|
|
184
|
+
ORDER BY score DESC
|
|
185
|
+
LIMIT 20;
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Use external search when you need typo tolerance, complex ranking, cross-table
|
|
189
|
+
facets, or language-specific analysis beyond built-in full-text behavior.
|
|
190
|
+
|
|
191
|
+
## Transactions
|
|
192
|
+
|
|
193
|
+
Keep transactions short and lock rows in a consistent order:
|
|
194
|
+
|
|
195
|
+
```sql
|
|
196
|
+
START TRANSACTION;
|
|
197
|
+
|
|
198
|
+
SELECT id, balance
|
|
199
|
+
FROM accounts
|
|
200
|
+
WHERE id IN (?, ?)
|
|
201
|
+
ORDER BY id
|
|
202
|
+
FOR UPDATE;
|
|
203
|
+
|
|
204
|
+
UPDATE accounts SET balance = balance - ? WHERE id = ?;
|
|
205
|
+
UPDATE accounts SET balance = balance + ? WHERE id = ?;
|
|
206
|
+
|
|
207
|
+
COMMIT;
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Deadlock and lock-wait checklist:
|
|
211
|
+
|
|
212
|
+
- Lock rows in a deterministic order across code paths.
|
|
213
|
+
- Do external API calls before opening the transaction, not inside it.
|
|
214
|
+
- Add indexes for predicates used in `UPDATE`, `DELETE`, and locking reads.
|
|
215
|
+
- On deadlock, roll back and retry the whole transaction with a bounded retry
|
|
216
|
+
budget.
|
|
217
|
+
- Capture `SHOW ENGINE INNODB STATUS\G` soon after a deadlock; it is overwritten
|
|
218
|
+
by later events.
|
|
219
|
+
|
|
220
|
+
Queue-style worker claim:
|
|
221
|
+
|
|
222
|
+
```sql
|
|
223
|
+
START TRANSACTION;
|
|
224
|
+
|
|
225
|
+
SELECT id
|
|
226
|
+
FROM jobs
|
|
227
|
+
WHERE status = 'pending'
|
|
228
|
+
ORDER BY created_at
|
|
229
|
+
LIMIT 1
|
|
230
|
+
FOR UPDATE SKIP LOCKED;
|
|
231
|
+
|
|
232
|
+
UPDATE jobs
|
|
233
|
+
SET status = 'processing', started_at = CURRENT_TIMESTAMP
|
|
234
|
+
WHERE id = ?;
|
|
235
|
+
|
|
236
|
+
COMMIT;
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Use `SKIP LOCKED` only for queue-like workloads where skipping a locked row is
|
|
240
|
+
acceptable. It is not a replacement for normal transactional consistency.
|
|
241
|
+
|
|
242
|
+
## Connection Pools
|
|
243
|
+
|
|
244
|
+
SQLAlchemy example:
|
|
245
|
+
|
|
246
|
+
```python
|
|
247
|
+
from sqlalchemy import create_engine
|
|
248
|
+
|
|
249
|
+
engine = create_engine(
|
|
250
|
+
"mysql+mysqlconnector://app:secret@db.internal/app",
|
|
251
|
+
pool_size=10,
|
|
252
|
+
max_overflow=5,
|
|
253
|
+
pool_timeout=30,
|
|
254
|
+
pool_recycle=240,
|
|
255
|
+
pool_pre_ping=True,
|
|
256
|
+
connect_args={"connect_timeout": 5},
|
|
257
|
+
)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Node.js `mysql2` example:
|
|
261
|
+
|
|
262
|
+
```javascript
|
|
263
|
+
import mysql from 'mysql2/promise';
|
|
264
|
+
|
|
265
|
+
const pool = mysql.createPool({
|
|
266
|
+
host: process.env.DB_HOST,
|
|
267
|
+
user: process.env.DB_USER,
|
|
268
|
+
password: process.env.DB_PASSWORD,
|
|
269
|
+
database: process.env.DB_NAME,
|
|
270
|
+
waitForConnections: true,
|
|
271
|
+
connectionLimit: 10,
|
|
272
|
+
queueLimit: 0,
|
|
273
|
+
enableKeepAlive: true,
|
|
274
|
+
keepAliveInitialDelay: 30000,
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
const [rows] = await pool.execute(
|
|
278
|
+
'SELECT id, total FROM orders WHERE account_id = ? LIMIT 50',
|
|
279
|
+
[accountId],
|
|
280
|
+
);
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
Keep application pool recycling below the server `wait_timeout`. If the server
|
|
284
|
+
uses `wait_timeout = 300`, a `pool_recycle` around 240 seconds is coherent;
|
|
285
|
+
`pool_pre_ping` still helps recover from network and failover events.
|
|
286
|
+
|
|
287
|
+
## Diagnostics
|
|
288
|
+
|
|
289
|
+
Useful first-pass commands:
|
|
290
|
+
|
|
291
|
+
```sql
|
|
292
|
+
SHOW FULL PROCESSLIST;
|
|
293
|
+
SHOW ENGINE INNODB STATUS\G;
|
|
294
|
+
SHOW VARIABLES LIKE 'slow_query_log';
|
|
295
|
+
SHOW VARIABLES LIKE 'long_query_time';
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Enable the slow log in a controlled environment:
|
|
299
|
+
|
|
300
|
+
```sql
|
|
301
|
+
SET GLOBAL slow_query_log = 'ON';
|
|
302
|
+
SET GLOBAL long_query_time = 1;
|
|
303
|
+
SET GLOBAL log_queries_not_using_indexes = 'ON';
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
Use `EXPLAIN ANALYZE` only when it is safe to execute the query. It runs the
|
|
307
|
+
statement and can be expensive on production-sized data.
|
|
308
|
+
|
|
309
|
+
## Replication
|
|
310
|
+
|
|
311
|
+
Read replicas can lag. Do not route read-your-own-write paths, checkout flows,
|
|
312
|
+
permission checks, or idempotency-key reads to a replica immediately after a
|
|
313
|
+
write.
|
|
314
|
+
|
|
315
|
+
```sql
|
|
316
|
+
-- MySQL legacy terminology, still common in existing fleets
|
|
317
|
+
SHOW SLAVE STATUS\G;
|
|
318
|
+
|
|
319
|
+
-- Newer terminology where supported
|
|
320
|
+
SHOW REPLICA STATUS\G;
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Check the engine/version before standardizing on one command. Monitor replica
|
|
324
|
+
SQL thread health, IO thread health, and lag, not just whether the TCP
|
|
325
|
+
connection is alive.
|
|
326
|
+
|
|
327
|
+
## Security
|
|
328
|
+
|
|
329
|
+
```sql
|
|
330
|
+
CREATE USER 'app'@'%' IDENTIFIED BY 'use-a-secret-manager';
|
|
331
|
+
GRANT SELECT, INSERT, UPDATE, DELETE ON appdb.* TO 'app'@'%';
|
|
332
|
+
|
|
333
|
+
ALTER USER 'app'@'%' REQUIRE SSL;
|
|
334
|
+
|
|
335
|
+
SELECT user, host
|
|
336
|
+
FROM mysql.user
|
|
337
|
+
WHERE user = '';
|
|
338
|
+
|
|
339
|
+
DROP USER IF EXISTS ''@'localhost';
|
|
340
|
+
DROP USER IF EXISTS ''@'%';
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Security review points:
|
|
344
|
+
|
|
345
|
+
- Do not grant `ALL PRIVILEGES` or `*.*` to application users.
|
|
346
|
+
- Require TLS for application users when traffic crosses hosts or networks.
|
|
347
|
+
- Store credentials in the platform secret manager, not in examples, scripts, or
|
|
348
|
+
repository files.
|
|
349
|
+
- Separate migration/admin users from runtime application users.
|
|
350
|
+
- Audit public network exposure and bind addresses before tuning performance.
|
|
351
|
+
|
|
352
|
+
## Configuration
|
|
353
|
+
|
|
354
|
+
Example starting point for a dedicated database host:
|
|
355
|
+
|
|
356
|
+
```ini
|
|
357
|
+
[mysqld]
|
|
358
|
+
innodb_buffer_pool_size = 4G
|
|
359
|
+
innodb_flush_log_at_trx_commit = 1
|
|
360
|
+
sync_binlog = 1
|
|
361
|
+
|
|
362
|
+
max_connections = 300
|
|
363
|
+
thread_cache_size = 50
|
|
364
|
+
|
|
365
|
+
wait_timeout = 300
|
|
366
|
+
interactive_timeout = 300
|
|
367
|
+
innodb_lock_wait_timeout = 10
|
|
368
|
+
|
|
369
|
+
slow_query_log = ON
|
|
370
|
+
long_query_time = 1
|
|
371
|
+
log_queries_not_using_indexes = ON
|
|
372
|
+
|
|
373
|
+
log_bin = mysql-bin
|
|
374
|
+
binlog_format = ROW
|
|
375
|
+
binlog_expire_logs_seconds = 604800
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
Treat configuration values as a prompt for review, not a universal preset. Size
|
|
379
|
+
memory, connections, log retention, and durability settings from workload,
|
|
380
|
+
hardware, backup policy, and recovery objectives.
|
|
381
|
+
|
|
382
|
+
## Anti-Patterns
|
|
383
|
+
|
|
384
|
+
| Anti-Pattern | Risk | Better Pattern |
|
|
385
|
+
| --- | --- | --- |
|
|
386
|
+
| `SELECT *` in hot paths | Over-fetching and brittle clients | Select explicit columns |
|
|
387
|
+
| Deep `OFFSET` pagination | Linear scans and slow pages | Keyset pagination |
|
|
388
|
+
| No index on foreign-key joins | Slow joins and lock-heavy deletes | Index FK columns intentionally |
|
|
389
|
+
| Long transactions | Lock waits and large undo history | Commit small units of work |
|
|
390
|
+
| Direct DML against `mysql.user` | Grant-table corruption risk | Use `CREATE USER`, `ALTER USER`, `DROP USER` |
|
|
391
|
+
| Application user with admin grants | High blast radius | Least-privilege runtime user |
|
|
392
|
+
| Pool recycle above `wait_timeout` | Stale pooled connections | Recycle below timeout and pre-ping |
|
|
393
|
+
| Replica reads after writes | Stale user-facing state | Pin read-after-write flows to primary |
|
|
394
|
+
|
|
395
|
+
## Output Expectations
|
|
396
|
+
|
|
397
|
+
When this skill is used for review, return:
|
|
398
|
+
|
|
399
|
+
1. Engine/version assumptions.
|
|
400
|
+
2. Highest-risk correctness, lock, security, and migration issues.
|
|
401
|
+
3. Exact SQL or code changes for the safe path.
|
|
402
|
+
4. Validation plan: `EXPLAIN`, migration dry run, lock/deadlock check, and
|
|
403
|
+
rollback criteria.
|
|
404
|
+
5. Any MySQL/MariaDB syntax differences that affect the recommendation.
|
|
405
|
+
|
|
406
|
+
## Related
|
|
407
|
+
|
|
408
|
+
- Skill: `postgres-patterns` - PostgreSQL-specific schema and query patterns
|
|
409
|
+
- Skill: `database-migrations` - migration planning and rollout safety
|
|
410
|
+
- Skill: `backend-patterns` - API and service-layer patterns
|
|
411
|
+
- Skill: `security-review` - secret handling, auth, and least privilege
|
|
412
|
+
- Agent: `database-reviewer` - broader database review workflow
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: netmiko-ssh-automation
|
|
3
|
+
description: Safe Python Netmiko patterns for read-only collection, bounded batch SSH, TextFSM parsing, guarded config changes, timeouts, and network automation error handling.
|
|
4
|
+
origin: community
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Netmiko SSH Automation
|
|
8
|
+
|
|
9
|
+
Use this skill when writing or reviewing Python automation that connects to
|
|
10
|
+
network devices with Netmiko. Keep the default path read-only; config changes
|
|
11
|
+
need a separate change window, peer review, and rollback plan.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- Collecting `show` command output across routers, switches, or firewalls.
|
|
16
|
+
- Building a small audit script for interface, routing, or config evidence.
|
|
17
|
+
- Adding timeouts and exception handling to network SSH scripts.
|
|
18
|
+
- Parsing command output with TextFSM when a template exists.
|
|
19
|
+
- Reviewing automation before it touches production devices.
|
|
20
|
+
|
|
21
|
+
## Safety Defaults
|
|
22
|
+
|
|
23
|
+
- Start with read-only `send_command()` collection.
|
|
24
|
+
- Keep inventory small and explicit; do not sweep whole address ranges.
|
|
25
|
+
- Use environment variables, a vault, or `getpass`; never hardcode credentials.
|
|
26
|
+
- Set connection and read timeouts.
|
|
27
|
+
- Limit concurrency so older devices are not overloaded.
|
|
28
|
+
- Require an explicit operator flag before `send_config_set()`.
|
|
29
|
+
- Do not call `save_config()` until the change has been verified and approved.
|
|
30
|
+
|
|
31
|
+
## Read-Only Connection Pattern
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import os
|
|
35
|
+
from getpass import getpass
|
|
36
|
+
from netmiko import ConnectHandler
|
|
37
|
+
from netmiko.exceptions import (
|
|
38
|
+
NetmikoAuthenticationException,
|
|
39
|
+
NetmikoTimeoutException,
|
|
40
|
+
ReadTimeout,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
device = {
|
|
44
|
+
"device_type": "cisco_ios",
|
|
45
|
+
"host": "192.0.2.10",
|
|
46
|
+
"username": os.environ.get("NETMIKO_USERNAME") or input("Username: "),
|
|
47
|
+
"password": os.environ.get("NETMIKO_PASSWORD") or getpass("Password: "),
|
|
48
|
+
"secret": os.environ.get("NETMIKO_ENABLE_SECRET"),
|
|
49
|
+
"conn_timeout": 10,
|
|
50
|
+
"auth_timeout": 20,
|
|
51
|
+
"banner_timeout": 15,
|
|
52
|
+
"read_timeout_override": 30,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
try:
|
|
56
|
+
with ConnectHandler(**device) as conn:
|
|
57
|
+
if device.get("secret") and not conn.check_enable_mode():
|
|
58
|
+
conn.enable()
|
|
59
|
+
output = conn.send_command("show ip interface brief", read_timeout=30)
|
|
60
|
+
print(output)
|
|
61
|
+
except NetmikoAuthenticationException:
|
|
62
|
+
print("Authentication failed")
|
|
63
|
+
except NetmikoTimeoutException:
|
|
64
|
+
print("SSH connection timed out")
|
|
65
|
+
except ReadTimeout:
|
|
66
|
+
print("Command read timed out")
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Use placeholder addresses from documentation ranges in examples. Keep real
|
|
70
|
+
inventory in an ignored local file or a secrets-managed system.
|
|
71
|
+
|
|
72
|
+
## Batch Collection
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from concurrent.futures import ThreadPoolExecutor, as_completed
|
|
76
|
+
from typing import Any
|
|
77
|
+
|
|
78
|
+
def collect_show(device: dict[str, Any], command: str) -> dict[str, Any]:
|
|
79
|
+
host = device["host"]
|
|
80
|
+
try:
|
|
81
|
+
with ConnectHandler(**device) as conn:
|
|
82
|
+
output = conn.send_command(command, read_timeout=45)
|
|
83
|
+
return {"host": host, "ok": True, "output": output}
|
|
84
|
+
except (NetmikoAuthenticationException, NetmikoTimeoutException, ReadTimeout) as exc:
|
|
85
|
+
return {"host": host, "ok": False, "error": type(exc).__name__}
|
|
86
|
+
|
|
87
|
+
results = []
|
|
88
|
+
with ThreadPoolExecutor(max_workers=8) as pool:
|
|
89
|
+
futures = [pool.submit(collect_show, device, "show version") for device in devices]
|
|
90
|
+
for future in as_completed(futures):
|
|
91
|
+
results.append(future.result())
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Keep `max_workers` low unless the device estate and AAA systems are known to
|
|
95
|
+
handle higher connection volume.
|
|
96
|
+
|
|
97
|
+
## Structured Parsing
|
|
98
|
+
|
|
99
|
+
Netmiko can ask TextFSM, TTP, or Genie to parse supported command output. Treat
|
|
100
|
+
parser output as an optimization, not the only evidence path.
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
with ConnectHandler(**device) as conn:
|
|
104
|
+
parsed = conn.send_command(
|
|
105
|
+
"show ip interface brief",
|
|
106
|
+
use_textfsm=True,
|
|
107
|
+
raise_parsing_error=False,
|
|
108
|
+
read_timeout=30,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
if isinstance(parsed, str):
|
|
112
|
+
print("No parser template matched; store raw output for review")
|
|
113
|
+
else:
|
|
114
|
+
for row in parsed:
|
|
115
|
+
print(row)
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
If parsing drives a blocking decision, keep the raw command output alongside
|
|
119
|
+
the parsed result so an operator can inspect mismatches.
|
|
120
|
+
|
|
121
|
+
## Guarded Config Pattern
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
import os
|
|
125
|
+
|
|
126
|
+
commands = [
|
|
127
|
+
"interface GigabitEthernet0/1",
|
|
128
|
+
"description CHANGE-1234 UPLINK-TO-CORE",
|
|
129
|
+
]
|
|
130
|
+
|
|
131
|
+
apply_changes = os.environ.get("APPLY_NETWORK_CHANGES") == "1"
|
|
132
|
+
|
|
133
|
+
if not apply_changes:
|
|
134
|
+
print("Dry run only. Candidate commands:")
|
|
135
|
+
print("\n".join(commands))
|
|
136
|
+
else:
|
|
137
|
+
with ConnectHandler(**device) as conn:
|
|
138
|
+
conn.enable()
|
|
139
|
+
before = conn.send_command("show running-config interface GigabitEthernet0/1")
|
|
140
|
+
output = conn.send_config_set(commands)
|
|
141
|
+
after = conn.send_command("show running-config interface GigabitEthernet0/1")
|
|
142
|
+
print(before)
|
|
143
|
+
print(output)
|
|
144
|
+
print(after)
|
|
145
|
+
print("Verify behavior before saving startup config.")
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Saving the config is a separate approval step. In production, include a rollback
|
|
149
|
+
snippet and capture before/after evidence in the change record.
|
|
150
|
+
|
|
151
|
+
## Review Checklist
|
|
152
|
+
|
|
153
|
+
- Does the script identify an explicit inventory source?
|
|
154
|
+
- Are credentials absent from source, logs, and exception messages?
|
|
155
|
+
- Are `conn_timeout`, `auth_timeout`, and command `read_timeout` set?
|
|
156
|
+
- Are failures reported per device without stopping the whole batch?
|
|
157
|
+
- Does the script avoid broad scans and unbounded concurrency?
|
|
158
|
+
- Are config changes behind a dry-run or explicit operator flag?
|
|
159
|
+
- Is `save_config()` separate from the initial push and tied to verification?
|
|
160
|
+
|
|
161
|
+
## Anti-Patterns
|
|
162
|
+
|
|
163
|
+
- Hardcoding passwords, enable secrets, or private keys in source.
|
|
164
|
+
- Sending config commands as the default code path.
|
|
165
|
+
- Running automation against a CIDR range instead of a reviewed inventory.
|
|
166
|
+
- Logging full running configs to shared systems without sanitization.
|
|
167
|
+
- Treating parser success as proof that the device state is correct.
|
|
168
|
+
|
|
169
|
+
## See Also
|
|
170
|
+
|
|
171
|
+
- Skill: `cisco-ios-patterns`
|
|
172
|
+
- Skill: `network-config-validation`
|
|
173
|
+
- Skill: `network-interface-health`
|