novahiz 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE.md +46 -0
- package/README.md +123 -0
- package/adapters/README.md +13 -0
- package/adapters/opencode/agent/novahiz-agent.md +31 -0
- package/adapters/opencode/commands/novahiz-clean.md +15 -0
- package/adapters/opencode/commands/novahiz-doctor.md +9 -0
- package/adapters/opencode/commands/novahiz-plan.md +24 -0
- package/adapters/opencode/commands/novahiz-status.md +11 -0
- package/adapters/opencode/instructions.md +69 -0
- package/adapters/opencode/novahiz.ts +266 -0
- package/bin/novahiz.cmd +2 -0
- package/bin/novahiz.mjs +7 -0
- package/bundled-skills/AGENTS.md +50 -0
- package/bundled-skills/LICENSE +21 -0
- package/bundled-skills/README.md +202 -0
- package/bundled-skills/SKILL.md +313 -0
- package/bundled-skills/a11y-audit/SKILL.md +211 -0
- package/bundled-skills/a11y-audit/assets/sample-component.tsx +51 -0
- package/bundled-skills/a11y-audit/expected_outputs/sample-contrast-output.txt +39 -0
- package/bundled-skills/a11y-audit/expected_outputs/sample-scan-output.json +34 -0
- package/bundled-skills/a11y-audit/expected_outputs/sample-scan-report.md +63 -0
- package/bundled-skills/a11y-audit/references/aria-patterns.md +223 -0
- package/bundled-skills/a11y-audit/references/audit-report-template.md +46 -0
- package/bundled-skills/a11y-audit/references/ci-cd-integration.md +127 -0
- package/bundled-skills/a11y-audit/references/color-contrast-guide.md +83 -0
- package/bundled-skills/a11y-audit/references/examples-by-framework.md +312 -0
- package/bundled-skills/a11y-audit/references/framework-a11y-patterns.md +661 -0
- package/bundled-skills/a11y-audit/references/testing-checklist.md +41 -0
- package/bundled-skills/a11y-audit/references/wcag-22-new-criteria.md +79 -0
- package/bundled-skills/a11y-audit/references/wcag-quick-ref.md +113 -0
- package/bundled-skills/a11y-audit/scripts/a11y_scanner.py +684 -0
- package/bundled-skills/a11y-audit/scripts/contrast_checker.py +504 -0
- package/bundled-skills/ab-testing/SKILL.md +353 -0
- package/bundled-skills/ab-testing/evals/evals.json +105 -0
- package/bundled-skills/ab-testing/references/sample-size-guide.md +263 -0
- package/bundled-skills/ab-testing/references/test-templates.md +277 -0
- package/bundled-skills/ad-creative/SKILL.md +425 -0
- package/bundled-skills/ad-creative/assets/creative-review-template.html +400 -0
- package/bundled-skills/ad-creative/evals/evals.json +217 -0
- package/bundled-skills/ad-creative/references/creative-review-page.md +106 -0
- package/bundled-skills/ad-creative/references/creative-roadmap.md +118 -0
- package/bundled-skills/ad-creative/references/generative-tools.md +637 -0
- package/bundled-skills/ad-creative/references/hook-system.md +115 -0
- package/bundled-skills/ad-creative/references/imessage-video-ads.md +201 -0
- package/bundled-skills/ad-creative/references/meta-creative-formats.md +114 -0
- package/bundled-skills/ad-creative/references/motion-video-ads.md +126 -0
- package/bundled-skills/ad-creative/references/platform-specs.md +213 -0
- package/bundled-skills/ad-creative/references/short-form-video-specs.md +213 -0
- package/bundled-skills/ad-creative/references/static-ad-templates.md +308 -0
- package/bundled-skills/ads/SKILL.md +499 -0
- package/bundled-skills/ads/evals/evals.json +157 -0
- package/bundled-skills/ads/references/abm-playbook.md +93 -0
- package/bundled-skills/ads/references/ad-copy-templates.md +207 -0
- package/bundled-skills/ads/references/audience-targeting.md +243 -0
- package/bundled-skills/ads/references/audit-guardrails.md +83 -0
- package/bundled-skills/ads/references/b2b-paid-playbook.md +115 -0
- package/bundled-skills/ads/references/conversion-tracking.md +361 -0
- package/bundled-skills/ads/references/creative-research-automation.md +103 -0
- package/bundled-skills/ads/references/google-ads-audit-checklist.md +84 -0
- package/bundled-skills/ads/references/google-search-playbook.md +120 -0
- package/bundled-skills/ads/references/linkedin-b2b-playbook.md +107 -0
- package/bundled-skills/ads/references/meta-decision-system.md +176 -0
- package/bundled-skills/ads/references/payback-period.md +69 -0
- package/bundled-skills/ads/references/platform-setup-checklists.md +277 -0
- package/bundled-skills/ads/references/rsa-output-spec.md +88 -0
- package/bundled-skills/adversarial-reviewer/SKILL.md +247 -0
- package/bundled-skills/agent-device/SKILL.md +20 -0
- package/bundled-skills/ai-seo/SKILL.md +488 -0
- package/bundled-skills/ai-seo/evals/evals.json +135 -0
- package/bundled-skills/ai-seo/references/agent-readiness.md +57 -0
- package/bundled-skills/ai-seo/references/citations-vs-recommendations.md +85 -0
- package/bundled-skills/ai-seo/references/content-patterns.md +287 -0
- package/bundled-skills/ai-seo/references/content-types.md +71 -0
- package/bundled-skills/ai-seo/references/format-volatility.md +98 -0
- package/bundled-skills/ai-seo/references/okf.md +104 -0
- package/bundled-skills/ai-seo/references/platform-ranking-factors.md +154 -0
- package/bundled-skills/ai-seo/references/youtube-ai-citations.md +60 -0
- package/bundled-skills/analytics/SKILL.md +310 -0
- package/bundled-skills/analytics/evals/evals.json +90 -0
- package/bundled-skills/analytics/references/event-library.md +260 -0
- package/bundled-skills/analytics/references/ga4-implementation.md +300 -0
- package/bundled-skills/analytics/references/gtm-implementation.md +390 -0
- package/bundled-skills/android-emulator/SKILL.md +32 -0
- package/bundled-skills/anti-AI-design/SKILL.md +189 -0
- package/bundled-skills/anti-pattern-detector/SKILL.md +185 -0
- package/bundled-skills/anti-pattern-detector/references/async-network-patterns.md +581 -0
- package/bundled-skills/anti-pattern-detector/references/build-deploy-patterns.md +554 -0
- package/bundled-skills/anti-pattern-detector/references/cache-patterns.md +446 -0
- package/bundled-skills/anti-pattern-detector/references/cloud-infra-patterns.md +538 -0
- package/bundled-skills/anti-pattern-detector/references/concurrency-patterns.md +558 -0
- package/bundled-skills/anti-pattern-detector/references/language-specific-patterns.md +740 -0
- package/bundled-skills/anti-pattern-detector/references/monitoring-patterns.md +456 -0
- package/bundled-skills/api-design-reviewer/SKILL.md +433 -0
- package/bundled-skills/api-design-reviewer/references/api_antipatterns.md +680 -0
- package/bundled-skills/api-design-reviewer/references/rest_design_rules.md +487 -0
- package/bundled-skills/api-design-reviewer/scripts/api_linter.py +956 -0
- package/bundled-skills/api-design-reviewer/scripts/api_scorecard.py +1661 -0
- package/bundled-skills/api-design-reviewer/scripts/breaking_change_detector.py +1102 -0
- package/bundled-skills/apple-hig-expert/SKILL.md +108 -0
- package/bundled-skills/apple-hig-expert/references/accessibility.md +55 -0
- package/bundled-skills/apple-hig-expert/references/platform-specifics.md +48 -0
- package/bundled-skills/apple-hig-expert/references/visual-design.md +69 -0
- package/bundled-skills/apple-hig-expert/scripts/hig_checker.py +97 -0
- package/bundled-skills/apple-hig-expert/templates/hig-audit-template.md +83 -0
- package/bundled-skills/build-graph/SKILL.md +38 -0
- package/bundled-skills/claude-history-ingest/SKILL.md +463 -0
- package/bundled-skills/claude-history-ingest/references/claude-data-format.md +118 -0
- package/bundled-skills/clean-code/SKILL.md +99 -0
- package/bundled-skills/code-reviewer/README.md +92 -0
- package/bundled-skills/code-reviewer/SKILL.md +183 -0
- package/bundled-skills/code-reviewer/assets/sample_c_clean.c +71 -0
- package/bundled-skills/code-reviewer/assets/sample_c_smells.c +66 -0
- package/bundled-skills/code-reviewer/assets/sample_csharp_clean.cs +100 -0
- package/bundled-skills/code-reviewer/assets/sample_csharp_smells.cs +78 -0
- package/bundled-skills/code-reviewer/assets/sample_java_clean.java +55 -0
- package/bundled-skills/code-reviewer/assets/sample_java_smells.java +56 -0
- package/bundled-skills/code-reviewer/expected_outputs/sample_c_clean_quality.json +65 -0
- package/bundled-skills/code-reviewer/expected_outputs/sample_c_smells_quality.json +155 -0
- package/bundled-skills/code-reviewer/expected_outputs/sample_csharp_clean_quality.json +135 -0
- package/bundled-skills/code-reviewer/expected_outputs/sample_csharp_smells_quality.json +143 -0
- package/bundled-skills/code-reviewer/expected_outputs/sample_java_clean_quality.json +53 -0
- package/bundled-skills/code-reviewer/expected_outputs/sample_java_smells_quality.json +83 -0
- package/bundled-skills/code-reviewer/languages/c.md +103 -0
- package/bundled-skills/code-reviewer/languages/cpp.md +103 -0
- package/bundled-skills/code-reviewer/languages/csharp.md +97 -0
- package/bundled-skills/code-reviewer/languages/dart.md +108 -0
- package/bundled-skills/code-reviewer/languages/go.md +92 -0
- package/bundled-skills/code-reviewer/languages/java.md +103 -0
- package/bundled-skills/code-reviewer/languages/kotlin.md +88 -0
- package/bundled-skills/code-reviewer/languages/php.md +109 -0
- package/bundled-skills/code-reviewer/languages/python.md +94 -0
- package/bundled-skills/code-reviewer/languages/ruby.md +105 -0
- package/bundled-skills/code-reviewer/languages/rust.md +99 -0
- package/bundled-skills/code-reviewer/languages/swift.md +88 -0
- package/bundled-skills/code-reviewer/languages/typescript.md +97 -0
- package/bundled-skills/code-reviewer/rules/universal.md +49 -0
- package/bundled-skills/code-reviewer/scripts/code_quality_checker.py +1020 -0
- package/bundled-skills/code-reviewer/scripts/pr_analyzer.py +535 -0
- package/bundled-skills/code-reviewer/scripts/review_report_generator.py +505 -0
- package/bundled-skills/code-understand/SKILL.md +90 -0
- package/bundled-skills/codex-history-ingest/SKILL.md +248 -0
- package/bundled-skills/codex-history-ingest/references/codex-data-format.md +82 -0
- package/bundled-skills/cold-email/SKILL.md +159 -0
- package/bundled-skills/cold-email/evals/evals.json +94 -0
- package/bundled-skills/cold-email/references/benchmarks.md +83 -0
- package/bundled-skills/cold-email/references/follow-up-sequences.md +81 -0
- package/bundled-skills/cold-email/references/frameworks.md +90 -0
- package/bundled-skills/cold-email/references/personalization.md +79 -0
- package/bundled-skills/cold-email/references/subject-lines.md +53 -0
- package/bundled-skills/competitor-profiling/SKILL.md +415 -0
- package/bundled-skills/competitor-profiling/evals/evals.json +85 -0
- package/bundled-skills/competitor-profiling/references/templates.md +167 -0
- package/bundled-skills/competitor-profiling/references/tool-reference.md +179 -0
- package/bundled-skills/computer-use/SKILL.md +41 -0
- package/bundled-skills/content-strategy/SKILL.md +439 -0
- package/bundled-skills/content-strategy/evals/evals.json +116 -0
- package/bundled-skills/content-strategy/references/content-distribution.md +83 -0
- package/bundled-skills/content-strategy/references/headless-cms.md +194 -0
- package/bundled-skills/copilot-history-ingest/SKILL.md +376 -0
- package/bundled-skills/copilot-history-ingest/references/copilot-data-format.md +321 -0
- package/bundled-skills/copy-editing/SKILL.md +457 -0
- package/bundled-skills/copy-editing/evals/evals.json +89 -0
- package/bundled-skills/copy-editing/references/checklist.md +66 -0
- package/bundled-skills/copy-editing/references/content-refresh.md +38 -0
- package/bundled-skills/copy-editing/references/plain-english-alternatives.md +394 -0
- package/bundled-skills/copywriting/SKILL.md +256 -0
- package/bundled-skills/copywriting/evals/evals.json +126 -0
- package/bundled-skills/copywriting/references/copy-frameworks.md +433 -0
- package/bundled-skills/copywriting/references/natural-transitions.md +272 -0
- package/bundled-skills/cro/SKILL.md +187 -0
- package/bundled-skills/cro/evals/evals.json +111 -0
- package/bundled-skills/cro/references/experiments.md +248 -0
- package/bundled-skills/cro/references/form.md +422 -0
- package/bundled-skills/cross-linker/SKILL.md +309 -0
- package/bundled-skills/customer-research/SKILL.md +305 -0
- package/bundled-skills/customer-research/evals/evals.json +176 -0
- package/bundled-skills/customer-research/references/interviews-and-surveys.md +155 -0
- package/bundled-skills/customer-research/references/source-guides.md +401 -0
- package/bundled-skills/daily-update/SKILL.md +223 -0
- package/bundled-skills/dart-add-unit-test/SKILL.md +122 -0
- package/bundled-skills/dart-build-cli-app/SKILL.md +185 -0
- package/bundled-skills/dart-collect-coverage/SKILL.md +141 -0
- package/bundled-skills/dart-fix-runtime-errors/SKILL.md +166 -0
- package/bundled-skills/dart-generate-test-mocks/SKILL.md +155 -0
- package/bundled-skills/dart-migrate-to-checks-package/SKILL.md +528 -0
- package/bundled-skills/dart-resolve-package-conflicts/SKILL.md +116 -0
- package/bundled-skills/dart-run-static-analysis/SKILL.md +104 -0
- package/bundled-skills/dart-setup-ffi-assets/SKILL.md +419 -0
- package/bundled-skills/dart-use-doc-examples/SKILL.md +96 -0
- package/bundled-skills/dart-use-ffigen/SKILL.md +218 -0
- package/bundled-skills/dart-use-pattern-matching/SKILL.md +146 -0
- package/bundled-skills/dart-use-primary-constructors/SKILL.md +262 -0
- package/bundled-skills/dart-write-documentation/SKILL.md +136 -0
- package/bundled-skills/database-designer/README.md +388 -0
- package/bundled-skills/database-designer/SKILL.md +314 -0
- package/bundled-skills/database-designer/assets/sample_query_patterns.json +375 -0
- package/bundled-skills/database-designer/assets/sample_schema.json +372 -0
- package/bundled-skills/database-designer/assets/sample_schema.sql +207 -0
- package/bundled-skills/database-designer/expected_outputs/index_optimization_sample.txt +60 -0
- package/bundled-skills/database-designer/expected_outputs/migration_sample.txt +124 -0
- package/bundled-skills/database-designer/expected_outputs/schema_analysis_sample.txt +222 -0
- package/bundled-skills/database-designer/index_optimizer.py +926 -0
- package/bundled-skills/database-designer/migration_generator.py +1199 -0
- package/bundled-skills/database-designer/references/database-design-reference.md +476 -0
- package/bundled-skills/database-designer/references/database_selection_decision_tree.md +373 -0
- package/bundled-skills/database-designer/references/index_strategy_patterns.md +424 -0
- package/bundled-skills/database-designer/references/normalization_guide.md +354 -0
- package/bundled-skills/database-designer/schema_analyzer.py +982 -0
- package/bundled-skills/debug-issue/SKILL.md +28 -0
- package/bundled-skills/defuddle/SKILL.md +41 -0
- package/bundled-skills/dependency-auditor/README.md +524 -0
- package/bundled-skills/dependency-auditor/SKILL.md +85 -0
- package/bundled-skills/dependency-auditor/assets/sample_go.mod +53 -0
- package/bundled-skills/dependency-auditor/assets/sample_package.json +72 -0
- package/bundled-skills/dependency-auditor/assets/sample_requirements.txt +71 -0
- package/bundled-skills/dependency-auditor/expected_outputs/sample_license_report.txt +37 -0
- package/bundled-skills/dependency-auditor/expected_outputs/sample_upgrade_plan.txt +59 -0
- package/bundled-skills/dependency-auditor/expected_outputs/sample_vulnerability_report.json +71 -0
- package/bundled-skills/dependency-auditor/references/dependency_management_best_practices.md +643 -0
- package/bundled-skills/dependency-auditor/references/license_compatibility_matrix.md +238 -0
- package/bundled-skills/dependency-auditor/references/vulnerability_assessment_guide.md +461 -0
- package/bundled-skills/dependency-auditor/scripts/dep_scanner.py +794 -0
- package/bundled-skills/dependency-auditor/scripts/license_checker.py +996 -0
- package/bundled-skills/dependency-auditor/scripts/upgrade_planner.py +1029 -0
- package/bundled-skills/dependency-auditor/test-inventory.json +421 -0
- package/bundled-skills/dependency-auditor/test-project/package.json +72 -0
- package/bundled-skills/design-taste-frontend/SKILL.md +247 -0
- package/bundled-skills/dogfood/SKILL.md +27 -0
- package/bundled-skills/eas-app-stores/SKILL.md +176 -0
- package/bundled-skills/eas-app-stores/agents/openai.yaml +4 -0
- package/bundled-skills/eas-app-stores/references/app-store-metadata.md +497 -0
- package/bundled-skills/eas-app-stores/references/ios-app-store.md +376 -0
- package/bundled-skills/eas-app-stores/references/native-ios.md +167 -0
- package/bundled-skills/eas-app-stores/references/play-store.md +244 -0
- package/bundled-skills/eas-app-stores/references/testflight.md +62 -0
- package/bundled-skills/eas-app-stores/references/workflows.md +120 -0
- package/bundled-skills/eas-hosting/SKILL.md +431 -0
- package/bundled-skills/eas-hosting/agents/openai.yaml +4 -0
- package/bundled-skills/eas-observe/SKILL.md +54 -0
- package/bundled-skills/eas-observe/agents/openai.yaml +4 -0
- package/bundled-skills/eas-observe/references/metrics.md +98 -0
- package/bundled-skills/eas-observe/references/queries.md +403 -0
- package/bundled-skills/eas-observe/references/setup.md +476 -0
- package/bundled-skills/eas-observe/references/third-party.md +136 -0
- package/bundled-skills/eas-simulator/SKILL.md +208 -0
- package/bundled-skills/eas-simulator/agents/openai.yaml +4 -0
- package/bundled-skills/eas-simulator/references/controllers.md +106 -0
- package/bundled-skills/eas-simulator/references/run-your-app.md +224 -0
- package/bundled-skills/eas-simulator/references/troubleshooting.md +44 -0
- package/bundled-skills/eas-update/SKILL.md +146 -0
- package/bundled-skills/eas-update/agents/openai.yaml +4 -0
- package/bundled-skills/eas-update-insights/SKILL.md +238 -0
- package/bundled-skills/eas-update-insights/agents/openai.yaml +4 -0
- package/bundled-skills/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/bundled-skills/eas-update-insights/references/update-insights-schema.md +69 -0
- package/bundled-skills/eas-workflows/SKILL.md +99 -0
- package/bundled-skills/eas-workflows/agents/openai.yaml +4 -0
- package/bundled-skills/eas-workflows/scripts/fetch.js +109 -0
- package/bundled-skills/eas-workflows/scripts/package.json +6 -0
- package/bundled-skills/emails/SKILL.md +311 -0
- package/bundled-skills/emails/evals/evals.json +93 -0
- package/bundled-skills/emails/references/copy-guidelines.md +113 -0
- package/bundled-skills/emails/references/email-types.md +515 -0
- package/bundled-skills/emails/references/sequence-templates.md +168 -0
- package/bundled-skills/engineering-standards/SKILL.md +736 -0
- package/bundled-skills/env-secrets-manager/SKILL.md +260 -0
- package/bundled-skills/env-secrets-manager/references/secret-patterns.md +41 -0
- package/bundled-skills/env-secrets-manager/references/validation-detection-rotation.md +358 -0
- package/bundled-skills/env-secrets-manager/scripts/env_auditor.py +145 -0
- package/bundled-skills/explore-codebase/SKILL.md +29 -0
- package/bundled-skills/expo-animation/LICENSE +21 -0
- package/bundled-skills/expo-animation/RECIPES.md +385 -0
- package/bundled-skills/expo-animation/SKILL.md +267 -0
- package/bundled-skills/expo-animation/agents/openai.yaml +4 -0
- package/bundled-skills/expo-app-clip/SKILL.md +290 -0
- package/bundled-skills/expo-app-clip/agents/openai.yaml +4 -0
- package/bundled-skills/expo-app-clip/references/native-module.md +96 -0
- package/bundled-skills/expo-brownfield/SKILL.md +62 -0
- package/bundled-skills/expo-brownfield/agents/openai.yaml +4 -0
- package/bundled-skills/expo-brownfield/references/brownfield-integrated.md +526 -0
- package/bundled-skills/expo-brownfield/references/brownfield-isolated.md +451 -0
- package/bundled-skills/expo-brownfield/references/comparison.md +63 -0
- package/bundled-skills/expo-brownfield/references/troubleshooting.md +88 -0
- package/bundled-skills/expo-data-fetching/SKILL.md +478 -0
- package/bundled-skills/expo-data-fetching/agents/openai.yaml +4 -0
- package/bundled-skills/expo-data-fetching/references/expo-router-loaders.md +341 -0
- package/bundled-skills/expo-data-fetching/references/offline-and-cancellation.md +68 -0
- package/bundled-skills/expo-design-system/SKILL.md +376 -0
- package/bundled-skills/expo-design-system/agents/openai.yaml +4 -0
- package/bundled-skills/expo-design-system/references/audit.md +190 -0
- package/bundled-skills/expo-design-system/references/native-slop.md +74 -0
- package/bundled-skills/expo-dev-client/SKILL.md +182 -0
- package/bundled-skills/expo-dev-client/agents/openai.yaml +4 -0
- package/bundled-skills/expo-dom/SKILL.md +425 -0
- package/bundled-skills/expo-dom/agents/openai.yaml +4 -0
- package/bundled-skills/expo-examples/SKILL.md +106 -0
- package/bundled-skills/expo-examples/agents/openai.yaml +4 -0
- package/bundled-skills/expo-examples/references/catalog.md +105 -0
- package/bundled-skills/expo-migrate-module/SKILL.md +113 -0
- package/bundled-skills/expo-migrate-module/agents/openai.yaml +4 -0
- package/bundled-skills/expo-migrate-module/references/compatibility.md +73 -0
- package/bundled-skills/expo-migrate-module/references/example.md +212 -0
- package/bundled-skills/expo-migrate-module/references/migration-map.md +306 -0
- package/bundled-skills/expo-module/SKILL.md +151 -0
- package/bundled-skills/expo-module/agents/openai.yaml +4 -0
- package/bundled-skills/expo-module/references/config-plugin.md +90 -0
- package/bundled-skills/expo-module/references/create-expo-module.md +206 -0
- package/bundled-skills/expo-module/references/lifecycle.md +127 -0
- package/bundled-skills/expo-module/references/module-config.md +48 -0
- package/bundled-skills/expo-module/references/native-module.md +286 -0
- package/bundled-skills/expo-module/references/native-view.md +171 -0
- package/bundled-skills/expo-native-ui/SKILL.md +201 -0
- package/bundled-skills/expo-native-ui/agents/openai.yaml +4 -0
- package/bundled-skills/expo-native-ui/references/controls.md +231 -0
- package/bundled-skills/expo-native-ui/references/gradients.md +106 -0
- package/bundled-skills/expo-native-ui/references/icons.md +232 -0
- package/bundled-skills/expo-native-ui/references/media.md +193 -0
- package/bundled-skills/expo-native-ui/references/storage.md +121 -0
- package/bundled-skills/expo-native-ui/references/visual-effects.md +198 -0
- package/bundled-skills/expo-native-ui/references/webgpu-three.md +605 -0
- package/bundled-skills/expo-overview/SKILL.md +115 -0
- package/bundled-skills/expo-overview/agents/openai.yaml +4 -0
- package/bundled-skills/expo-project-structure/SKILL.md +114 -0
- package/bundled-skills/expo-project-structure/agents/openai.yaml +4 -0
- package/bundled-skills/expo-router/SKILL.md +240 -0
- package/bundled-skills/expo-router/agents/openai.yaml +4 -0
- package/bundled-skills/expo-router/references/form-sheet.md +253 -0
- package/bundled-skills/expo-router/references/route-structure.md +229 -0
- package/bundled-skills/expo-router/references/search.md +248 -0
- package/bundled-skills/expo-router/references/tabs.md +433 -0
- package/bundled-skills/expo-router/references/toolbar-and-headers.md +284 -0
- package/bundled-skills/expo-router/references/zoom-transitions.md +158 -0
- package/bundled-skills/expo-skill-eval/SKILL.md +314 -0
- package/bundled-skills/expo-skill-eval/agents/visual-grader.md +52 -0
- package/bundled-skills/expo-skill-eval/references/design-rubric.md +45 -0
- package/bundled-skills/expo-skill-eval/references/runtime-matrix.md +34 -0
- package/bundled-skills/expo-skill-eval/scripts/check-static.sh +64 -0
- package/bundled-skills/expo-skill-eval/scripts/clean-fixture.sh +56 -0
- package/bundled-skills/expo-skill-eval/scripts/generate_viewer.py +450 -0
- package/bundled-skills/expo-skill-eval/scripts/latest-sdk.sh +46 -0
- package/bundled-skills/expo-skill-eval/scripts/make-fixture.sh +95 -0
- package/bundled-skills/expo-skill-eval/scripts/make-workspace.sh +31 -0
- package/bundled-skills/expo-skill-eval/scripts/snapshot-android.sh +284 -0
- package/bundled-skills/expo-skill-eval/scripts/snapshot-ios.sh +132 -0
- package/bundled-skills/expo-skill-eval/scripts/snapshot-web.sh +61 -0
- package/bundled-skills/expo-skill-feedback/SKILL.md +87 -0
- package/bundled-skills/expo-skill-feedback/agents/openai.yaml +4 -0
- package/bundled-skills/expo-skill-feedback/scripts/skill-event.cjs +180 -0
- package/bundled-skills/expo-skill-feedback/scripts/telemetry.cjs +65 -0
- package/bundled-skills/expo-skill-feedback/scripts/telemetry_common.cjs +171 -0
- package/bundled-skills/expo-ui/SKILL.md +101 -0
- package/bundled-skills/expo-ui/agents/openai.yaml +4 -0
- package/bundled-skills/expo-ui/references/drop-in-replacements.md +27 -0
- package/bundled-skills/expo-ui/references/jetpack-compose.md +73 -0
- package/bundled-skills/expo-ui/references/swift-ui.md +73 -0
- package/bundled-skills/expo-ui/references/universal.md +104 -0
- package/bundled-skills/expo-ui/scripts/list-components.js +193 -0
- package/bundled-skills/expo-upgrade/SKILL.md +150 -0
- package/bundled-skills/expo-upgrade/agents/openai.yaml +4 -0
- package/bundled-skills/expo-upgrade/references/expo-av-to-audio.md +132 -0
- package/bundled-skills/expo-upgrade/references/expo-av-to-video.md +160 -0
- package/bundled-skills/expo-upgrade/references/native-tabs.md +124 -0
- package/bundled-skills/expo-upgrade/references/new-architecture.md +79 -0
- package/bundled-skills/expo-upgrade/references/react-19.md +79 -0
- package/bundled-skills/expo-upgrade/references/react-compiler.md +59 -0
- package/bundled-skills/expo-upgrade/references/react-navigation-to-expo-router.md +61 -0
- package/bundled-skills/expo-web-to-native/SKILL.md +91 -0
- package/bundled-skills/expo-web-to-native/agents/openai.yaml +4 -0
- package/bundled-skills/expo-web-to-native/references/false-friends.md +119 -0
- package/bundled-skills/expo-web-to-native/references/native-patterns.md +39 -0
- package/bundled-skills/expo-web-to-native/references/run-as-goal.md +48 -0
- package/bundled-skills/expo-web-to-native/references/verify-on-device.md +45 -0
- package/bundled-skills/find-skills/SKILL.md +141 -0
- package/bundled-skills/fix/SKILL.md +113 -0
- package/bundled-skills/fix/flaky-taxonomy.md +134 -0
- package/bundled-skills/flutter-add-integration-test/SKILL.md +163 -0
- package/bundled-skills/flutter-add-widget-preview/SKILL.md +145 -0
- package/bundled-skills/flutter-add-widget-test/SKILL.md +154 -0
- package/bundled-skills/flutter-apply-architecture-best-practices/SKILL.md +162 -0
- package/bundled-skills/flutter-build-responsive-layout/SKILL.md +139 -0
- package/bundled-skills/flutter-fix-layout-issues/SKILL.md +130 -0
- package/bundled-skills/flutter-implement-json-serialization/SKILL.md +153 -0
- package/bundled-skills/flutter-setup-declarative-routing/SKILL.md +255 -0
- package/bundled-skills/flutter-setup-localization/SKILL.md +210 -0
- package/bundled-skills/flutter-use-http-package/SKILL.md +174 -0
- package/bundled-skills/gate/SKILL.md +13 -0
- package/bundled-skills/graph-colorize/SKILL.md +180 -0
- package/bundled-skills/hermes-history-ingest/SKILL.md +239 -0
- package/bundled-skills/hermes-history-ingest/references/hermes-data-format.md +131 -0
- package/bundled-skills/humanizer/SKILL.md +374 -0
- package/bundled-skills/impeccable/SKILL.md +89 -0
- package/bundled-skills/impeccable/reference/adapt.md +312 -0
- package/bundled-skills/impeccable/reference/adapt.native.md +58 -0
- package/bundled-skills/impeccable/reference/android.md +46 -0
- package/bundled-skills/impeccable/reference/animate.md +89 -0
- package/bundled-skills/impeccable/reference/audit.md +136 -0
- package/bundled-skills/impeccable/reference/audit.native.md +139 -0
- package/bundled-skills/impeccable/reference/bolder.md +33 -0
- package/bundled-skills/impeccable/reference/clarify.md +94 -0
- package/bundled-skills/impeccable/reference/colorize.md +86 -0
- package/bundled-skills/impeccable/reference/craft-floor.md +44 -0
- package/bundled-skills/impeccable/reference/craft.md +5 -0
- package/bundled-skills/impeccable/reference/critique.md +806 -0
- package/bundled-skills/impeccable/reference/degraded/asset-producer.md +37 -0
- package/bundled-skills/impeccable/reference/degraded/documenter.md +24 -0
- package/bundled-skills/impeccable/reference/degraded/finish-reviewer.md +38 -0
- package/bundled-skills/impeccable/reference/degraded/manual-edit-applier.md +92 -0
- package/bundled-skills/impeccable/reference/delight.md +70 -0
- package/bundled-skills/impeccable/reference/distill.md +111 -0
- package/bundled-skills/impeccable/reference/doctor.md +54 -0
- package/bundled-skills/impeccable/reference/document.md +416 -0
- package/bundled-skills/impeccable/reference/extract.md +69 -0
- package/bundled-skills/impeccable/reference/harden.md +336 -0
- package/bundled-skills/impeccable/reference/hooks.md +111 -0
- package/bundled-skills/impeccable/reference/init.md +131 -0
- package/bundled-skills/impeccable/reference/ios.md +51 -0
- package/bundled-skills/impeccable/reference/layout.md +84 -0
- package/bundled-skills/impeccable/reference/live-setup.md +104 -0
- package/bundled-skills/impeccable/reference/live.md +325 -0
- package/bundled-skills/impeccable/reference/new-work.md +145 -0
- package/bundled-skills/impeccable/reference/onboard.md +234 -0
- package/bundled-skills/impeccable/reference/operate.md +61 -0
- package/bundled-skills/impeccable/reference/optimize.md +258 -0
- package/bundled-skills/impeccable/reference/overdrive.md +127 -0
- package/bundled-skills/impeccable/reference/polish.md +105 -0
- package/bundled-skills/impeccable/reference/quieter.md +99 -0
- package/bundled-skills/impeccable/reference/routing.md +24 -0
- package/bundled-skills/impeccable/reference/shape.md +59 -0
- package/bundled-skills/impeccable/reference/typeset.md +80 -0
- package/bundled-skills/impeccable/reference/visualize.md +46 -0
- package/bundled-skills/impeccable/scripts/VERSION +1 -0
- package/bundled-skills/impeccable/scripts/bin/windows-x64/impeccable.exe +0 -0
- package/bundled-skills/impeccable/scripts/command-metadata.json +94 -0
- package/bundled-skills/impeccable/scripts/data/font-index-failures.json +121 -0
- package/bundled-skills/impeccable/scripts/data/font-index.json +1 -0
- package/bundled-skills/impeccable/scripts/impeccable +206 -0
- package/bundled-skills/impeccable/scripts/impeccable.cmd +214 -0
- package/bundled-skills/impeccable/scripts/live-browser-dom.js +167 -0
- package/bundled-skills/impeccable/scripts/live-browser-ignores.js +242 -0
- package/bundled-skills/impeccable/scripts/live-browser-session.js +144 -0
- package/bundled-skills/impeccable/scripts/live-browser.js +12990 -0
- package/bundled-skills/impeccable/scripts/modern-screenshot.umd.js +14 -0
- package/bundled-skills/impl-validator/SKILL.md +118 -0
- package/bundled-skills/ios-simulator/SKILL.md +32 -0
- package/bundled-skills/json-canvas/SKILL.md +244 -0
- package/bundled-skills/json-canvas/references/EXAMPLES.md +329 -0
- package/bundled-skills/launch/SKILL.md +381 -0
- package/bundled-skills/launch/evals/evals.json +106 -0
- package/bundled-skills/llm-wiki/SKILL.md +661 -0
- package/bundled-skills/llm-wiki/references/WRITING.md +28 -0
- package/bundled-skills/llm-wiki/references/karpathy-pattern.md +45 -0
- package/bundled-skills/marketing-plan/SKILL.md +300 -0
- package/bundled-skills/marketing-plan/evals/evals.json +112 -0
- package/bundled-skills/marketing-plan/references/aarrr-framework.md +180 -0
- package/bundled-skills/marketing-plan/references/budget-planning.md +168 -0
- package/bundled-skills/marketing-plan/references/client-types.md +373 -0
- package/bundled-skills/marketing-plan/references/current-state-rubric.md +255 -0
- package/bundled-skills/marketing-plan/references/example-quietude.md +972 -0
- package/bundled-skills/marketing-plan/references/funding-stage-unlocks.md +230 -0
- package/bundled-skills/marketing-plan/references/growth-patterns.md +190 -0
- package/bundled-skills/marketing-plan/references/idea-cross-reference.md +265 -0
- package/bundled-skills/marketing-plan/references/measurement-framework.md +213 -0
- package/bundled-skills/marketing-plan/references/methodology.md +363 -0
- package/bundled-skills/marketing-plan/references/ops-stack-mapping.md +197 -0
- package/bundled-skills/marketing-plan/references/plan-template.md +494 -0
- package/bundled-skills/marketing-plan/references/team-and-agency-model.md +278 -0
- package/bundled-skills/marketing-psychology/SKILL.md +455 -0
- package/bundled-skills/marketing-psychology/evals/evals.json +88 -0
- package/bundled-skills/mcp-server-builder/README.md +50 -0
- package/bundled-skills/mcp-server-builder/SKILL.md +100 -0
- package/bundled-skills/mcp-server-builder/references/openapi-extraction-guide.md +34 -0
- package/bundled-skills/mcp-server-builder/references/production-hardening-guide.md +78 -0
- package/bundled-skills/mcp-server-builder/references/python-server-template.md +22 -0
- package/bundled-skills/mcp-server-builder/references/typescript-server-template.md +19 -0
- package/bundled-skills/mcp-server-builder/references/validation-checklist.md +30 -0
- package/bundled-skills/mcp-server-builder/scripts/mcp_validator.py +186 -0
- package/bundled-skills/mcp-server-builder/scripts/openapi_to_mcp.py +284 -0
- package/bundled-skills/memory/SKILL.md +10 -0
- package/bundled-skills/memory-bridge/SKILL.md +163 -0
- package/bundled-skills/memory-save/SKILL.md +88 -0
- package/bundled-skills/migrate/SKILL.md +135 -0
- package/bundled-skills/migrate/cypress-mapping.md +79 -0
- package/bundled-skills/migrate/selenium-mapping.md +94 -0
- package/bundled-skills/novahiz-analyse/SKILL.md +74 -0
- package/bundled-skills/novahiz-audit/SKILL.md +75 -0
- package/bundled-skills/novahiz-clarify/SKILL.md +94 -0
- package/bundled-skills/novahiz-converge/SKILL.md +76 -0
- package/bundled-skills/novahiz-gate/SKILL.md +82 -0
- package/bundled-skills/novahiz-implement/SKILL.md +80 -0
- package/bundled-skills/novahiz-memory/SKILL.md +58 -0
- package/bundled-skills/novahiz-plan/SKILL.md +100 -0
- package/bundled-skills/novahiz-planner/SKILL.md +104 -0
- package/bundled-skills/novahiz-task/SKILL.md +105 -0
- package/bundled-skills/obsidian-bases/SKILL.md +499 -0
- package/bundled-skills/obsidian-bases/references/FUNCTIONS_REFERENCE.md +173 -0
- package/bundled-skills/obsidian-cli/SKILL.md +106 -0
- package/bundled-skills/obsidian-layout-adjustment/SKILL.md +226 -0
- package/bundled-skills/obsidian-layout-adjustment/evals/evals.json +53 -0
- package/bundled-skills/obsidian-layout-adjustment/references/workflow-reference.md +212 -0
- package/bundled-skills/obsidian-markdown/SKILL.md +196 -0
- package/bundled-skills/obsidian-markdown/references/CALLOUTS.md +58 -0
- package/bundled-skills/obsidian-markdown/references/EMBEDS.md +70 -0
- package/bundled-skills/obsidian-markdown/references/PROPERTIES.md +61 -0
- package/bundled-skills/offers/SKILL.md +155 -0
- package/bundled-skills/offers/evals/evals.json +21 -0
- package/bundled-skills/offers/references/bonus-stacking.md +150 -0
- package/bundled-skills/offers/references/examples.md +215 -0
- package/bundled-skills/offers/references/guarantee-design.md +172 -0
- package/bundled-skills/offers/references/offer-anatomy.md +203 -0
- package/bundled-skills/offers/references/offer-formats.md +240 -0
- package/bundled-skills/offers/references/saas-offers.md +116 -0
- package/bundled-skills/offers/references/scarcity-urgency.md +175 -0
- package/bundled-skills/offers/references/value-equation.md +134 -0
- package/bundled-skills/onboarding/SKILL.md +261 -0
- package/bundled-skills/onboarding/evals/evals.json +108 -0
- package/bundled-skills/onboarding/references/activation-models.md +57 -0
- package/bundled-skills/onboarding/references/experiments.md +258 -0
- package/bundled-skills/onboarding/references/minimum-path-to-value.md +49 -0
- package/bundled-skills/openclaw-history-ingest/SKILL.md +257 -0
- package/bundled-skills/openclaw-history-ingest/references/openclaw-data-format.md +154 -0
- package/bundled-skills/orchestration/SKILL.md +69 -0
- package/bundled-skills/pi-history-ingest/SKILL.md +312 -0
- package/bundled-skills/playwright-agent/SKILL.md +142 -0
- package/bundled-skills/postgresql-optimization/SKILL.md +179 -0
- package/bundled-skills/pricing/SKILL.md +295 -0
- package/bundled-skills/pricing/evals/evals.json +119 -0
- package/bundled-skills/pricing/references/pricing-models.md +66 -0
- package/bundled-skills/pricing/references/pricing-page-teardown.md +85 -0
- package/bundled-skills/pricing/references/research-methods.md +152 -0
- package/bundled-skills/pricing/references/tier-structure.md +232 -0
- package/bundled-skills/product-marketing/SKILL.md +255 -0
- package/bundled-skills/product-marketing/evals/evals.json +98 -0
- package/bundled-skills/prospecting/SKILL.md +262 -0
- package/bundled-skills/prospecting/evals/evals.json +122 -0
- package/bundled-skills/prospecting/references/b2b-prospecting.md +106 -0
- package/bundled-skills/prospecting/references/compliance.md +123 -0
- package/bundled-skills/prospecting/references/data-sources.md +287 -0
- package/bundled-skills/prospecting/references/demand-signals.md +129 -0
- package/bundled-skills/prospecting/references/local-prospecting.md +165 -0
- package/bundled-skills/prospecting/references/saas-prospecting.md +123 -0
- package/bundled-skills/refactor-safely/SKILL.md +29 -0
- package/bundled-skills/review-changes/SKILL.md +30 -0
- package/bundled-skills/review-delta/SKILL.md +46 -0
- package/bundled-skills/review-pr/SKILL.md +66 -0
- package/bundled-skills/sales-enablement/SKILL.md +359 -0
- package/bundled-skills/sales-enablement/evals/evals.json +91 -0
- package/bundled-skills/sales-enablement/references/deck-frameworks.md +263 -0
- package/bundled-skills/sales-enablement/references/demo-scripts.md +355 -0
- package/bundled-skills/sales-enablement/references/objection-library.md +270 -0
- package/bundled-skills/sales-enablement/references/one-pager-templates.md +208 -0
- package/bundled-skills/security-guidance/SKILL.md +161 -0
- package/bundled-skills/security-guidance/references/pretooluse_hook_canon.md +141 -0
- package/bundled-skills/senior-architect/SKILL.md +343 -0
- package/bundled-skills/senior-architect/references/architecture_patterns.md +470 -0
- package/bundled-skills/senior-architect/references/system_design_workflows.md +536 -0
- package/bundled-skills/senior-architect/references/tech_decision_guide.md +412 -0
- package/bundled-skills/senior-architect/scripts/architecture_diagram_generator.py +660 -0
- package/bundled-skills/senior-architect/scripts/dependency_analyzer.py +615 -0
- package/bundled-skills/senior-architect/scripts/project_architect.py +749 -0
- package/bundled-skills/senior-backend/SKILL.md +467 -0
- package/bundled-skills/senior-backend/profiles/django-monolith.json +57 -0
- package/bundled-skills/senior-backend/profiles/fastapi-python.json +58 -0
- package/bundled-skills/senior-backend/profiles/go-or-rust-microservice.json +62 -0
- package/bundled-skills/senior-backend/profiles/node-express.json +57 -0
- package/bundled-skills/senior-backend/references/api_design_patterns.md +530 -0
- package/bundled-skills/senior-backend/references/backend_security_practices.md +1075 -0
- package/bundled-skills/senior-backend/references/composition_map.md +58 -0
- package/bundled-skills/senior-backend/references/database_optimization_guide.md +593 -0
- package/bundled-skills/senior-backend/references/forcing_questions.md +100 -0
- package/bundled-skills/senior-backend/scripts/api_load_tester.py +607 -0
- package/bundled-skills/senior-backend/scripts/api_scaffolder.py +645 -0
- package/bundled-skills/senior-backend/scripts/backend_decision_engine.py +397 -0
- package/bundled-skills/senior-backend/scripts/database_migration_tool.py +858 -0
- package/bundled-skills/seo-audit/SKILL.md +499 -0
- package/bundled-skills/seo-audit/evals/evals.json +136 -0
- package/bundled-skills/seo-audit/references/ai-writing-detection.md +200 -0
- package/bundled-skills/seo-audit/references/international-seo.md +230 -0
- package/bundled-skills/session-brain/SKILL.md +101 -0
- package/bundled-skills/session-search/SKILL.md +97 -0
- package/bundled-skills/skill-creator/LICENSE.txt +202 -0
- package/bundled-skills/skill-creator/SKILL.md +485 -0
- package/bundled-skills/skill-creator/agents/analyzer.md +274 -0
- package/bundled-skills/skill-creator/agents/comparator.md +202 -0
- package/bundled-skills/skill-creator/agents/grader.md +223 -0
- package/bundled-skills/skill-creator/assets/eval_review.html +146 -0
- package/bundled-skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/bundled-skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/bundled-skills/skill-creator/references/schemas.md +430 -0
- package/bundled-skills/skill-creator/scripts/__init__.py +0 -0
- package/bundled-skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/bundled-skills/skill-creator/scripts/generate_report.py +326 -0
- package/bundled-skills/skill-creator/scripts/improve_description.py +247 -0
- package/bundled-skills/skill-creator/scripts/package_skill.py +136 -0
- package/bundled-skills/skill-creator/scripts/quick_validate.py +103 -0
- package/bundled-skills/skill-creator/scripts/run_eval.py +310 -0
- package/bundled-skills/skill-creator/scripts/run_loop.py +328 -0
- package/bundled-skills/skill-creator/scripts/utils.py +47 -0
- package/bundled-skills/social/SKILL.md +413 -0
- package/bundled-skills/social/evals/evals.json +107 -0
- package/bundled-skills/social/references/carousel-frameworks.md +141 -0
- package/bundled-skills/social/references/listening-sources-template.md +123 -0
- package/bundled-skills/social/references/listening.md +283 -0
- package/bundled-skills/social/references/platform-limits.md +110 -0
- package/bundled-skills/social/references/platforms.md +170 -0
- package/bundled-skills/social/references/post-templates.md +179 -0
- package/bundled-skills/social/references/reverse-engineering.md +195 -0
- package/bundled-skills/social/references/short-form-video.md +237 -0
- package/bundled-skills/spec-driven-workflow/SKILL.md +333 -0
- package/bundled-skills/spec-driven-workflow/references/acceptance_criteria_patterns.md +497 -0
- package/bundled-skills/spec-driven-workflow/references/bounded_autonomy_rules.md +273 -0
- package/bundled-skills/spec-driven-workflow/references/spec_format_guide.md +531 -0
- package/bundled-skills/spec-driven-workflow/scripts/spec_generator.py +338 -0
- package/bundled-skills/spec-driven-workflow/scripts/spec_validator.py +461 -0
- package/bundled-skills/spec-driven-workflow/scripts/test_extractor.py +431 -0
- package/bundled-skills/supabase/CHANGELOG.md +78 -0
- package/bundled-skills/supabase/SKILL.md +149 -0
- package/bundled-skills/supabase/assets/feedback-issue-template.md +17 -0
- package/bundled-skills/supabase/references/skill-feedback.md +17 -0
- package/bundled-skills/supabase-postgres-best-practices/CHANGELOG.md +73 -0
- package/bundled-skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/bundled-skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
- package/bundled-skills/supabase-postgres-best-practices/references/_sections.md +39 -0
- package/bundled-skills/supabase-postgres-best-practices/references/_template.md +34 -0
- package/bundled-skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/bundled-skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/bundled-skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/bundled-skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/bundled-skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/bundled-skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/bundled-skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/bundled-skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/bundled-skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/bundled-skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/bundled-skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/bundled-skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/bundled-skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/bundled-skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/bundled-skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/bundled-skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/bundled-skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/bundled-skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/bundled-skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/bundled-skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
- package/bundled-skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/bundled-skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/bundled-skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
- package/bundled-skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/bundled-skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/bundled-skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/bundled-skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/bundled-skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/bundled-skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/bundled-skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/bundled-skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
- package/bundled-skills/tag-taxonomy/SKILL.md +218 -0
- package/bundled-skills/typescript-expert/SKILL.md +431 -0
- package/bundled-skills/typescript-expert/references/tsconfig-strict.json +45 -0
- package/bundled-skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/bundled-skills/typescript-expert/references/utility-types.ts +335 -0
- package/bundled-skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/bundled-skills/ui-design-system/SKILL.md +379 -0
- package/bundled-skills/ui-design-system/assets/design_system_doc_template.md +180 -0
- package/bundled-skills/ui-design-system/references/component-architecture.md +396 -0
- package/bundled-skills/ui-design-system/references/developer-handoff.md +509 -0
- package/bundled-skills/ui-design-system/references/responsive-calculations.md +390 -0
- package/bundled-skills/ui-design-system/references/token-generation.md +324 -0
- package/bundled-skills/ui-design-system/scripts/design_token_generator.py +590 -0
- package/bundled-skills/vault-skill-factory/SKILL.md +143 -0
- package/bundled-skills/video/SKILL.md +346 -0
- package/bundled-skills/video/evals/evals.json +103 -0
- package/bundled-skills/video/references/ai-video-prompting.md +175 -0
- package/bundled-skills/video/references/edit-anatomy.md +84 -0
- package/bundled-skills/wiki-agent/SKILL.md +322 -0
- package/bundled-skills/wiki-capture/SKILL.md +337 -0
- package/bundled-skills/wiki-capture/references/RAW-FORMAT.md +115 -0
- package/bundled-skills/wiki-context-pack/SKILL.md +89 -0
- package/bundled-skills/wiki-dashboard/SKILL.md +472 -0
- package/bundled-skills/wiki-dedup/SKILL.md +320 -0
- package/bundled-skills/wiki-digest/SKILL.md +243 -0
- package/bundled-skills/wiki-export/SKILL.md +445 -0
- package/bundled-skills/wiki-history-ingest/SKILL.md +61 -0
- package/bundled-skills/wiki-import/SKILL.md +276 -0
- package/bundled-skills/wiki-ingest/SKILL.md +563 -0
- package/bundled-skills/wiki-ingest/references/ingest-prompts.md +54 -0
- package/bundled-skills/wiki-ingest/references/pageindex.md +72 -0
- package/bundled-skills/wiki-ingest/references/url-sources.md +295 -0
- package/bundled-skills/wiki-lint/SKILL.md +643 -0
- package/bundled-skills/wiki-narrate/SKILL.md +120 -0
- package/bundled-skills/wiki-narrate/references/voices.md +29 -0
- package/bundled-skills/wiki-query/SKILL.md +307 -0
- package/bundled-skills/wiki-rebuild/SKILL.md +212 -0
- package/bundled-skills/wiki-research/SKILL.md +319 -0
- package/bundled-skills/wiki-setup/SKILL.md +359 -0
- package/bundled-skills/wiki-stage-commit/SKILL.md +164 -0
- package/bundled-skills/wiki-status/SKILL.md +556 -0
- package/bundled-skills/wiki-switch/SKILL.md +115 -0
- package/bundled-skills/wiki-synthesize/SKILL.md +212 -0
- package/bundled-skills/wiki-update/SKILL.md +271 -0
- package/bundled-skills/write-a-skill/SKILL.md +141 -0
- package/bundled-skills/write-a-skill/references/companion_tooling.md +67 -0
- package/bundled-skills/write-a-skill/references/description_design_patterns.md +139 -0
- package/bundled-skills/write-a-skill/references/progressive_disclosure_principles.md +89 -0
- package/bundled-skills/write-a-skill/references/quality_gates_for_skills.md +158 -0
- package/bundled-skills/write-a-skill/scripts/skill_description_validator.py +255 -0
- package/bundled-skills/write-a-skill/scripts/skill_review_checklist_runner.py +268 -0
- package/bundled-skills/write-a-skill/scripts/skill_structure_validator.py +277 -0
- package/bundled-skills/zero-hallucination-coder/SKILL.md +271 -0
- package/catalog/categories.json +1030 -0
- package/catalog/overrides.json +525 -0
- package/catalog/providers.json +145 -0
- package/catalog/rules.json +112 -0
- package/docs/ARCHITECTURE.md +82 -0
- package/docs/CONSTITUTION.md +60 -0
- package/docs/EXECUTION.md +79 -0
- package/docs/HARNESSES.md +38 -0
- package/docs/INSTALL.md +123 -0
- package/docs/PROVIDERS.md +128 -0
- package/docs/ROADMAPS.md +74 -0
- package/docs/RULES.md +85 -0
- package/docs/TOKENS.md +48 -0
- package/install/bootstrap.mjs +273 -0
- package/install/install.mjs +466 -0
- package/install/install.ps1 +3 -0
- package/install/install.sh +4 -0
- package/install/lib.mjs +198 -0
- package/install/prompt.mjs +16 -0
- package/install/uninstall.mjs +109 -0
- package/mcp/novahiz-tools/README.md +26 -0
- package/mcp/novahiz-tools/index.mjs +452 -0
- package/novahiz.config.example.json +39 -0
- package/package.json +76 -0
- package/skills/a11y-audit/SKILL.md +211 -0
- package/skills/a11y-audit/assets/sample-component.tsx +51 -0
- package/skills/a11y-audit/expected_outputs/sample-contrast-output.txt +39 -0
- package/skills/a11y-audit/expected_outputs/sample-scan-output.json +34 -0
- package/skills/a11y-audit/expected_outputs/sample-scan-report.md +63 -0
- package/skills/a11y-audit/references/aria-patterns.md +223 -0
- package/skills/a11y-audit/references/audit-report-template.md +46 -0
- package/skills/a11y-audit/references/ci-cd-integration.md +127 -0
- package/skills/a11y-audit/references/color-contrast-guide.md +83 -0
- package/skills/a11y-audit/references/examples-by-framework.md +312 -0
- package/skills/a11y-audit/references/framework-a11y-patterns.md +661 -0
- package/skills/a11y-audit/references/testing-checklist.md +41 -0
- package/skills/a11y-audit/references/wcag-22-new-criteria.md +79 -0
- package/skills/a11y-audit/references/wcag-quick-ref.md +113 -0
- package/skills/a11y-audit/scripts/a11y_scanner.py +684 -0
- package/skills/a11y-audit/scripts/contrast_checker.py +504 -0
- package/skills/adversarial-reviewer/SKILL.md +247 -0
- package/skills/ai-security/SKILL.md +364 -0
- package/skills/ai-security/references/atlas-coverage.md +150 -0
- package/skills/ai-security/scripts/ai_threat_scanner.py +564 -0
- package/skills/anti-AI-design/SKILL.md +189 -0
- package/skills/anti-pattern-detector/SKILL.md +185 -0
- package/skills/anti-pattern-detector/references/async-network-patterns.md +581 -0
- package/skills/anti-pattern-detector/references/build-deploy-patterns.md +554 -0
- package/skills/anti-pattern-detector/references/cache-patterns.md +446 -0
- package/skills/anti-pattern-detector/references/cloud-infra-patterns.md +538 -0
- package/skills/anti-pattern-detector/references/concurrency-patterns.md +558 -0
- package/skills/anti-pattern-detector/references/language-specific-patterns.md +740 -0
- package/skills/anti-pattern-detector/references/monitoring-patterns.md +456 -0
- package/skills/api-design-reviewer/SKILL.md +433 -0
- package/skills/api-design-reviewer/references/api_antipatterns.md +680 -0
- package/skills/api-design-reviewer/references/rest_design_rules.md +487 -0
- package/skills/api-design-reviewer/scripts/api_linter.py +956 -0
- package/skills/api-design-reviewer/scripts/api_scorecard.py +1661 -0
- package/skills/api-design-reviewer/scripts/breaking_change_detector.py +1102 -0
- package/skills/apple-hig-expert/SKILL.md +108 -0
- package/skills/apple-hig-expert/references/accessibility.md +55 -0
- package/skills/apple-hig-expert/references/platform-specifics.md +48 -0
- package/skills/apple-hig-expert/references/visual-design.md +69 -0
- package/skills/apple-hig-expert/scripts/hig_checker.py +97 -0
- package/skills/apple-hig-expert/templates/hig-audit-template.md +83 -0
- package/skills/clean-code/SKILL.md +99 -0
- package/skills/code-reviewer/README.md +92 -0
- package/skills/code-reviewer/SKILL.md +183 -0
- package/skills/code-reviewer/assets/sample_c_clean.c +71 -0
- package/skills/code-reviewer/assets/sample_c_smells.c +66 -0
- package/skills/code-reviewer/assets/sample_csharp_clean.cs +100 -0
- package/skills/code-reviewer/assets/sample_csharp_smells.cs +78 -0
- package/skills/code-reviewer/assets/sample_java_clean.java +55 -0
- package/skills/code-reviewer/assets/sample_java_smells.java +56 -0
- package/skills/code-reviewer/expected_outputs/sample_c_clean_quality.json +65 -0
- package/skills/code-reviewer/expected_outputs/sample_c_smells_quality.json +155 -0
- package/skills/code-reviewer/expected_outputs/sample_csharp_clean_quality.json +135 -0
- package/skills/code-reviewer/expected_outputs/sample_csharp_smells_quality.json +143 -0
- package/skills/code-reviewer/expected_outputs/sample_java_clean_quality.json +53 -0
- package/skills/code-reviewer/expected_outputs/sample_java_smells_quality.json +83 -0
- package/skills/code-reviewer/languages/c.md +103 -0
- package/skills/code-reviewer/languages/cpp.md +103 -0
- package/skills/code-reviewer/languages/csharp.md +97 -0
- package/skills/code-reviewer/languages/dart.md +108 -0
- package/skills/code-reviewer/languages/go.md +92 -0
- package/skills/code-reviewer/languages/java.md +103 -0
- package/skills/code-reviewer/languages/kotlin.md +88 -0
- package/skills/code-reviewer/languages/php.md +109 -0
- package/skills/code-reviewer/languages/python.md +94 -0
- package/skills/code-reviewer/languages/ruby.md +105 -0
- package/skills/code-reviewer/languages/rust.md +99 -0
- package/skills/code-reviewer/languages/swift.md +88 -0
- package/skills/code-reviewer/languages/typescript.md +97 -0
- package/skills/code-reviewer/rules/universal.md +49 -0
- package/skills/code-reviewer/scripts/code_quality_checker.py +1020 -0
- package/skills/code-reviewer/scripts/pr_analyzer.py +535 -0
- package/skills/code-reviewer/scripts/review_report_generator.py +505 -0
- package/skills/code-understand/SKILL.md +90 -0
- package/skills/database-designer/README.md +388 -0
- package/skills/database-designer/SKILL.md +314 -0
- package/skills/database-designer/assets/sample_query_patterns.json +375 -0
- package/skills/database-designer/assets/sample_schema.json +372 -0
- package/skills/database-designer/assets/sample_schema.sql +207 -0
- package/skills/database-designer/expected_outputs/index_optimization_sample.txt +60 -0
- package/skills/database-designer/expected_outputs/migration_sample.txt +124 -0
- package/skills/database-designer/expected_outputs/schema_analysis_sample.txt +222 -0
- package/skills/database-designer/index_optimizer.py +926 -0
- package/skills/database-designer/migration_generator.py +1199 -0
- package/skills/database-designer/references/database-design-reference.md +476 -0
- package/skills/database-designer/references/database_selection_decision_tree.md +373 -0
- package/skills/database-designer/references/index_strategy_patterns.md +424 -0
- package/skills/database-designer/references/normalization_guide.md +354 -0
- package/skills/database-designer/schema_analyzer.py +982 -0
- package/skills/defuddle/SKILL.md +41 -0
- package/skills/dependency-auditor/README.md +524 -0
- package/skills/dependency-auditor/SKILL.md +85 -0
- package/skills/dependency-auditor/assets/sample_go.mod +53 -0
- package/skills/dependency-auditor/assets/sample_package.json +72 -0
- package/skills/dependency-auditor/assets/sample_requirements.txt +71 -0
- package/skills/dependency-auditor/expected_outputs/sample_license_report.txt +37 -0
- package/skills/dependency-auditor/expected_outputs/sample_upgrade_plan.txt +59 -0
- package/skills/dependency-auditor/expected_outputs/sample_vulnerability_report.json +71 -0
- package/skills/dependency-auditor/references/dependency_management_best_practices.md +643 -0
- package/skills/dependency-auditor/references/license_compatibility_matrix.md +238 -0
- package/skills/dependency-auditor/references/vulnerability_assessment_guide.md +461 -0
- package/skills/dependency-auditor/scripts/dep_scanner.py +794 -0
- package/skills/dependency-auditor/scripts/license_checker.py +996 -0
- package/skills/dependency-auditor/scripts/upgrade_planner.py +1029 -0
- package/skills/dependency-auditor/test-inventory.json +421 -0
- package/skills/dependency-auditor/test-project/package.json +72 -0
- package/skills/design-taste-frontend/SKILL.md +247 -0
- package/skills/engineering-standards/SKILL.md +736 -0
- package/skills/env-secrets-manager/SKILL.md +260 -0
- package/skills/env-secrets-manager/references/secret-patterns.md +41 -0
- package/skills/env-secrets-manager/references/validation-detection-rotation.md +358 -0
- package/skills/env-secrets-manager/scripts/env_auditor.py +145 -0
- package/skills/fix/SKILL.md +113 -0
- package/skills/fix/flaky-taxonomy.md +134 -0
- package/skills/gate/SKILL.md +13 -0
- package/skills/humanizer/SKILL.md +374 -0
- package/skills/mcp-server-builder/README.md +50 -0
- package/skills/mcp-server-builder/SKILL.md +100 -0
- package/skills/mcp-server-builder/references/openapi-extraction-guide.md +34 -0
- package/skills/mcp-server-builder/references/production-hardening-guide.md +78 -0
- package/skills/mcp-server-builder/references/python-server-template.md +22 -0
- package/skills/mcp-server-builder/references/typescript-server-template.md +19 -0
- package/skills/mcp-server-builder/references/validation-checklist.md +30 -0
- package/skills/mcp-server-builder/scripts/mcp_validator.py +186 -0
- package/skills/mcp-server-builder/scripts/openapi_to_mcp.py +284 -0
- package/skills/memory/SKILL.md +10 -0
- package/skills/migrate/SKILL.md +135 -0
- package/skills/migrate/cypress-mapping.md +79 -0
- package/skills/migrate/selenium-mapping.md +94 -0
- package/skills/novahiz-analyse/SKILL.md +74 -0
- package/skills/novahiz-audit/SKILL.md +75 -0
- package/skills/novahiz-clarify/SKILL.md +94 -0
- package/skills/novahiz-converge/SKILL.md +76 -0
- package/skills/novahiz-gate/SKILL.md +82 -0
- package/skills/novahiz-implement/SKILL.md +80 -0
- package/skills/novahiz-memory/SKILL.md +58 -0
- package/skills/novahiz-plan/SKILL.md +99 -0
- package/skills/novahiz-planner/SKILL.md +104 -0
- package/skills/novahiz-task/SKILL.md +105 -0
- package/skills/playwright-agent/SKILL.md +142 -0
- package/skills/postgresql-optimization/SKILL.md +179 -0
- package/skills/review-changes/SKILL.md +30 -0
- package/skills/security-guidance/SKILL.md +160 -0
- package/skills/security-guidance/references/pretooluse_hook_canon.md +141 -0
- package/skills/senior-architect/SKILL.md +343 -0
- package/skills/senior-architect/references/architecture_patterns.md +470 -0
- package/skills/senior-architect/references/system_design_workflows.md +536 -0
- package/skills/senior-architect/references/tech_decision_guide.md +412 -0
- package/skills/senior-architect/scripts/architecture_diagram_generator.py +660 -0
- package/skills/senior-architect/scripts/dependency_analyzer.py +615 -0
- package/skills/senior-architect/scripts/project_architect.py +749 -0
- package/skills/senior-backend/SKILL.md +467 -0
- package/skills/senior-backend/profiles/django-monolith.json +57 -0
- package/skills/senior-backend/profiles/fastapi-python.json +58 -0
- package/skills/senior-backend/profiles/go-or-rust-microservice.json +62 -0
- package/skills/senior-backend/profiles/node-express.json +57 -0
- package/skills/senior-backend/references/api_design_patterns.md +530 -0
- package/skills/senior-backend/references/backend_security_practices.md +1075 -0
- package/skills/senior-backend/references/composition_map.md +58 -0
- package/skills/senior-backend/references/database_optimization_guide.md +593 -0
- package/skills/senior-backend/references/forcing_questions.md +100 -0
- package/skills/senior-backend/scripts/api_load_tester.py +607 -0
- package/skills/senior-backend/scripts/api_scaffolder.py +645 -0
- package/skills/senior-backend/scripts/backend_decision_engine.py +397 -0
- package/skills/senior-backend/scripts/database_migration_tool.py +858 -0
- package/skills/senior-secops/SKILL.md +505 -0
- package/skills/senior-secops/references/compliance_requirements.md +792 -0
- package/skills/senior-secops/references/security_standards.md +718 -0
- package/skills/senior-secops/references/vulnerability_management_guide.md +487 -0
- package/skills/senior-secops/scripts/compliance_checker.py +1107 -0
- package/skills/senior-secops/scripts/security_scanner.py +471 -0
- package/skills/senior-secops/scripts/vulnerability_assessor.py +563 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +485 -0
- package/skills/skill-creator/agents/analyzer.md +274 -0
- package/skills/skill-creator/agents/comparator.md +202 -0
- package/skills/skill-creator/agents/grader.md +223 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +247 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +310 -0
- package/skills/skill-creator/scripts/run_loop.py +328 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
- package/skills/spec-driven-workflow/SKILL.md +333 -0
- package/skills/spec-driven-workflow/references/acceptance_criteria_patterns.md +497 -0
- package/skills/spec-driven-workflow/references/bounded_autonomy_rules.md +273 -0
- package/skills/spec-driven-workflow/references/spec_format_guide.md +531 -0
- package/skills/spec-driven-workflow/scripts/spec_generator.py +338 -0
- package/skills/spec-driven-workflow/scripts/spec_validator.py +461 -0
- package/skills/spec-driven-workflow/scripts/test_extractor.py +431 -0
- package/skills/supabase/CHANGELOG.md +78 -0
- package/skills/supabase/SKILL.md +149 -0
- package/skills/supabase/assets/feedback-issue-template.md +17 -0
- package/skills/supabase/references/skill-feedback.md +17 -0
- package/skills/supabase-postgres-best-practices/CHANGELOG.md +73 -0
- package/skills/supabase-postgres-best-practices/SKILL.md +64 -0
- package/skills/supabase-postgres-best-practices/references/_contributing.md +170 -0
- package/skills/supabase-postgres-best-practices/references/_sections.md +39 -0
- package/skills/supabase-postgres-best-practices/references/_template.md +34 -0
- package/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +55 -0
- package/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +49 -0
- package/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +46 -0
- package/skills/supabase-postgres-best-practices/references/conn-limits.md +44 -0
- package/skills/supabase-postgres-best-practices/references/conn-pooling.md +41 -0
- package/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +46 -0
- package/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +54 -0
- package/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +53 -0
- package/skills/supabase-postgres-best-practices/references/data-pagination.md +50 -0
- package/skills/supabase-postgres-best-practices/references/data-upsert.md +50 -0
- package/skills/supabase-postgres-best-practices/references/lock-advisory.md +56 -0
- package/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +68 -0
- package/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +50 -0
- package/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +54 -0
- package/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +45 -0
- package/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +55 -0
- package/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +55 -0
- package/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +44 -0
- package/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +40 -0
- package/skills/supabase-postgres-best-practices/references/query-index-types.md +48 -0
- package/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +43 -0
- package/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +45 -0
- package/skills/supabase-postgres-best-practices/references/schema-constraints.md +80 -0
- package/skills/supabase-postgres-best-practices/references/schema-data-types.md +46 -0
- package/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +59 -0
- package/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +55 -0
- package/skills/supabase-postgres-best-practices/references/schema-partitioning.md +55 -0
- package/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +61 -0
- package/skills/supabase-postgres-best-practices/references/security-privileges.md +54 -0
- package/skills/supabase-postgres-best-practices/references/security-rls-basics.md +50 -0
- package/skills/supabase-postgres-best-practices/references/security-rls-performance.md +63 -0
- package/skills/typescript-expert/SKILL.md +431 -0
- package/skills/typescript-expert/references/tsconfig-strict.json +45 -0
- package/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/skills/typescript-expert/references/utility-types.ts +335 -0
- package/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/skills/ui-design-system/SKILL.md +379 -0
- package/skills/ui-design-system/assets/design_system_doc_template.md +180 -0
- package/skills/ui-design-system/references/component-architecture.md +396 -0
- package/skills/ui-design-system/references/developer-handoff.md +509 -0
- package/skills/ui-design-system/references/responsive-calculations.md +390 -0
- package/skills/ui-design-system/references/token-generation.md +324 -0
- package/skills/ui-design-system/scripts/design_token_generator.py +590 -0
- package/skills/write-a-skill/SKILL.md +141 -0
- package/skills/write-a-skill/references/companion_tooling.md +67 -0
- package/skills/write-a-skill/references/description_design_patterns.md +139 -0
- package/skills/write-a-skill/references/progressive_disclosure_principles.md +89 -0
- package/skills/write-a-skill/references/quality_gates_for_skills.md +158 -0
- package/skills/write-a-skill/scripts/skill_description_validator.py +255 -0
- package/skills/write-a-skill/scripts/skill_review_checklist_runner.py +268 -0
- package/skills/write-a-skill/scripts/skill_structure_validator.py +277 -0
- package/skills/zero-hallucination-coder/SKILL.md +271 -0
- package/src/catalog.ts +266 -0
- package/src/classify.ts +201 -0
- package/src/cli.ts +115 -0
- package/src/commands/clean.ts +114 -0
- package/src/commands/context.ts +130 -0
- package/src/commands/doctor.ts +191 -0
- package/src/commands/gate.ts +192 -0
- package/src/commands/inspect.ts +296 -0
- package/src/commands/report.ts +85 -0
- package/src/commands/task.ts +310 -0
- package/src/commands/tokens.ts +85 -0
- package/src/content.ts +70 -0
- package/src/db.ts +143 -0
- package/src/deps.ts +36 -0
- package/src/exec.ts +85 -0
- package/src/gate.ts +261 -0
- package/src/ledger.ts +468 -0
- package/src/providers.ts +52 -0
- package/src/relevance.ts +73 -0
- package/src/render.ts +107 -0
- package/src/spec.ts +306 -0
- package/src/targets.ts +296 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,982 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Database Schema Analyzer
|
|
4
|
+
|
|
5
|
+
Analyzes SQL DDL statements and JSON schema definitions for:
|
|
6
|
+
- Normalization level compliance (1NF-BCNF)
|
|
7
|
+
- Missing constraints (FK, NOT NULL, UNIQUE)
|
|
8
|
+
- Data type issues and antipatterns
|
|
9
|
+
- Naming convention violations
|
|
10
|
+
- Missing indexes on foreign key columns
|
|
11
|
+
- Table relationship mapping
|
|
12
|
+
- Generates Mermaid ERD diagrams
|
|
13
|
+
|
|
14
|
+
Input: SQL DDL file or JSON schema definition
|
|
15
|
+
Output: Analysis report + Mermaid ERD + recommendations
|
|
16
|
+
|
|
17
|
+
Usage:
|
|
18
|
+
python schema_analyzer.py --input schema.sql --output-format json
|
|
19
|
+
python schema_analyzer.py --input schema.json --output-format text
|
|
20
|
+
python schema_analyzer.py --input schema.sql --generate-erd --output analysis.json
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
import argparse
|
|
24
|
+
import json
|
|
25
|
+
import re
|
|
26
|
+
import sys
|
|
27
|
+
from collections import defaultdict, namedtuple
|
|
28
|
+
from typing import Dict, List, Set, Tuple, Optional, Any
|
|
29
|
+
from dataclasses import dataclass, asdict
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@dataclass
|
|
33
|
+
class Column:
|
|
34
|
+
name: str
|
|
35
|
+
data_type: str
|
|
36
|
+
nullable: bool = True
|
|
37
|
+
primary_key: bool = False
|
|
38
|
+
unique: bool = False
|
|
39
|
+
foreign_key: Optional[str] = None
|
|
40
|
+
default_value: Optional[str] = None
|
|
41
|
+
check_constraint: Optional[str] = None
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@dataclass
|
|
45
|
+
class Index:
|
|
46
|
+
name: str
|
|
47
|
+
table: str
|
|
48
|
+
columns: List[str]
|
|
49
|
+
unique: bool = False
|
|
50
|
+
index_type: str = "btree"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
@dataclass
|
|
54
|
+
class Table:
|
|
55
|
+
name: str
|
|
56
|
+
columns: List[Column]
|
|
57
|
+
primary_key: List[str]
|
|
58
|
+
foreign_keys: List[Tuple[str, str]] # (column, referenced_table.column)
|
|
59
|
+
unique_constraints: List[List[str]]
|
|
60
|
+
check_constraints: Dict[str, str]
|
|
61
|
+
indexes: List[Index]
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
@dataclass
|
|
65
|
+
class NormalizationIssue:
|
|
66
|
+
table: str
|
|
67
|
+
issue_type: str
|
|
68
|
+
severity: str
|
|
69
|
+
description: str
|
|
70
|
+
suggestion: str
|
|
71
|
+
columns_affected: List[str]
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@dataclass
|
|
75
|
+
class DataTypeIssue:
|
|
76
|
+
table: str
|
|
77
|
+
column: str
|
|
78
|
+
current_type: str
|
|
79
|
+
issue: str
|
|
80
|
+
suggested_type: str
|
|
81
|
+
rationale: str
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@dataclass
|
|
85
|
+
class ConstraintIssue:
|
|
86
|
+
table: str
|
|
87
|
+
issue_type: str
|
|
88
|
+
severity: str
|
|
89
|
+
description: str
|
|
90
|
+
suggestion: str
|
|
91
|
+
columns_affected: List[str]
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
@dataclass
|
|
95
|
+
class NamingIssue:
|
|
96
|
+
table: str
|
|
97
|
+
column: Optional[str]
|
|
98
|
+
issue: str
|
|
99
|
+
current_name: str
|
|
100
|
+
suggested_name: str
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class SchemaAnalyzer:
|
|
104
|
+
def __init__(self):
|
|
105
|
+
self.tables: Dict[str, Table] = {}
|
|
106
|
+
self.normalization_issues: List[NormalizationIssue] = []
|
|
107
|
+
self.datatype_issues: List[DataTypeIssue] = []
|
|
108
|
+
self.constraint_issues: List[ConstraintIssue] = []
|
|
109
|
+
self.naming_issues: List[NamingIssue] = []
|
|
110
|
+
|
|
111
|
+
# Data type antipatterns
|
|
112
|
+
self.varchar_255_pattern = re.compile(r'VARCHAR\(255\)', re.IGNORECASE)
|
|
113
|
+
self.bad_datetime_patterns = [
|
|
114
|
+
re.compile(r'VARCHAR\(\d+\)', re.IGNORECASE),
|
|
115
|
+
re.compile(r'CHAR\(\d+\)', re.IGNORECASE)
|
|
116
|
+
]
|
|
117
|
+
|
|
118
|
+
# Naming conventions
|
|
119
|
+
self.table_naming_pattern = re.compile(r'^[a-z][a-z0-9_]*[a-z0-9]$')
|
|
120
|
+
self.column_naming_pattern = re.compile(r'^[a-z][a-z0-9_]*[a-z0-9]$')
|
|
121
|
+
|
|
122
|
+
def parse_sql_ddl(self, ddl_content: str) -> None:
|
|
123
|
+
"""Parse SQL DDL statements and extract schema information."""
|
|
124
|
+
# Remove comments and normalize whitespace
|
|
125
|
+
ddl_content = re.sub(r'--.*$', '', ddl_content, flags=re.MULTILINE)
|
|
126
|
+
ddl_content = re.sub(r'/\*.*?\*/', '', ddl_content, flags=re.DOTALL)
|
|
127
|
+
ddl_content = re.sub(r'\s+', ' ', ddl_content.strip())
|
|
128
|
+
|
|
129
|
+
# Extract CREATE TABLE statements
|
|
130
|
+
create_table_pattern = re.compile(
|
|
131
|
+
r'CREATE\s+TABLE\s+(\w+)\s*\(\s*(.*?)\s*\)',
|
|
132
|
+
re.IGNORECASE | re.DOTALL
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
for match in create_table_pattern.finditer(ddl_content):
|
|
136
|
+
table_name = match.group(1).lower()
|
|
137
|
+
table_definition = match.group(2)
|
|
138
|
+
|
|
139
|
+
table = self._parse_table_definition(table_name, table_definition)
|
|
140
|
+
self.tables[table_name] = table
|
|
141
|
+
|
|
142
|
+
# Extract CREATE INDEX statements
|
|
143
|
+
self._parse_indexes(ddl_content)
|
|
144
|
+
|
|
145
|
+
def _parse_table_definition(self, table_name: str, definition: str) -> Table:
|
|
146
|
+
"""Parse individual table definition."""
|
|
147
|
+
columns = []
|
|
148
|
+
primary_key = []
|
|
149
|
+
foreign_keys = []
|
|
150
|
+
unique_constraints = []
|
|
151
|
+
check_constraints = {}
|
|
152
|
+
|
|
153
|
+
# Split by commas, but handle nested parentheses
|
|
154
|
+
parts = self._split_table_parts(definition)
|
|
155
|
+
|
|
156
|
+
for part in parts:
|
|
157
|
+
part = part.strip()
|
|
158
|
+
if not part:
|
|
159
|
+
continue
|
|
160
|
+
|
|
161
|
+
if part.upper().startswith('PRIMARY KEY'):
|
|
162
|
+
primary_key = self._parse_primary_key(part)
|
|
163
|
+
elif part.upper().startswith('FOREIGN KEY'):
|
|
164
|
+
fk = self._parse_foreign_key(part)
|
|
165
|
+
if fk:
|
|
166
|
+
foreign_keys.append(fk)
|
|
167
|
+
elif part.upper().startswith('UNIQUE'):
|
|
168
|
+
unique = self._parse_unique_constraint(part)
|
|
169
|
+
if unique:
|
|
170
|
+
unique_constraints.append(unique)
|
|
171
|
+
elif part.upper().startswith('CHECK'):
|
|
172
|
+
check = self._parse_check_constraint(part)
|
|
173
|
+
if check:
|
|
174
|
+
check_constraints.update(check)
|
|
175
|
+
else:
|
|
176
|
+
# Column definition
|
|
177
|
+
column = self._parse_column_definition(part)
|
|
178
|
+
if column:
|
|
179
|
+
columns.append(column)
|
|
180
|
+
if column.primary_key:
|
|
181
|
+
primary_key.append(column.name)
|
|
182
|
+
|
|
183
|
+
return Table(
|
|
184
|
+
name=table_name,
|
|
185
|
+
columns=columns,
|
|
186
|
+
primary_key=primary_key,
|
|
187
|
+
foreign_keys=foreign_keys,
|
|
188
|
+
unique_constraints=unique_constraints,
|
|
189
|
+
check_constraints=check_constraints,
|
|
190
|
+
indexes=[]
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
def _split_table_parts(self, definition: str) -> List[str]:
|
|
194
|
+
"""Split table definition by commas, respecting nested parentheses."""
|
|
195
|
+
parts = []
|
|
196
|
+
current_part = ""
|
|
197
|
+
paren_count = 0
|
|
198
|
+
|
|
199
|
+
for char in definition:
|
|
200
|
+
if char == '(':
|
|
201
|
+
paren_count += 1
|
|
202
|
+
elif char == ')':
|
|
203
|
+
paren_count -= 1
|
|
204
|
+
elif char == ',' and paren_count == 0:
|
|
205
|
+
parts.append(current_part.strip())
|
|
206
|
+
current_part = ""
|
|
207
|
+
continue
|
|
208
|
+
|
|
209
|
+
current_part += char
|
|
210
|
+
|
|
211
|
+
if current_part.strip():
|
|
212
|
+
parts.append(current_part.strip())
|
|
213
|
+
|
|
214
|
+
return parts
|
|
215
|
+
|
|
216
|
+
def _parse_column_definition(self, definition: str) -> Optional[Column]:
|
|
217
|
+
"""Parse individual column definition."""
|
|
218
|
+
# Pattern for column definition
|
|
219
|
+
pattern = re.compile(
|
|
220
|
+
r'(\w+)\s+([A-Z]+(?:\(\d+(?:,\d+)?\))?)\s*(.*)',
|
|
221
|
+
re.IGNORECASE
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
match = pattern.match(definition.strip())
|
|
225
|
+
if not match:
|
|
226
|
+
return None
|
|
227
|
+
|
|
228
|
+
column_name = match.group(1).lower()
|
|
229
|
+
data_type = match.group(2).upper()
|
|
230
|
+
constraints = match.group(3).upper() if match.group(3) else ""
|
|
231
|
+
|
|
232
|
+
column = Column(
|
|
233
|
+
name=column_name,
|
|
234
|
+
data_type=data_type,
|
|
235
|
+
nullable='NOT NULL' not in constraints,
|
|
236
|
+
primary_key='PRIMARY KEY' in constraints,
|
|
237
|
+
unique='UNIQUE' in constraints
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
# Parse foreign key reference
|
|
241
|
+
fk_pattern = re.compile(r'REFERENCES\s+(\w+)\s*\(\s*(\w+)\s*\)', re.IGNORECASE)
|
|
242
|
+
fk_match = fk_pattern.search(constraints)
|
|
243
|
+
if fk_match:
|
|
244
|
+
column.foreign_key = f"{fk_match.group(1).lower()}.{fk_match.group(2).lower()}"
|
|
245
|
+
|
|
246
|
+
# Parse default value
|
|
247
|
+
default_pattern = re.compile(r'DEFAULT\s+([^,\s]+)', re.IGNORECASE)
|
|
248
|
+
default_match = default_pattern.search(constraints)
|
|
249
|
+
if default_match:
|
|
250
|
+
column.default_value = default_match.group(1)
|
|
251
|
+
|
|
252
|
+
return column
|
|
253
|
+
|
|
254
|
+
def _parse_primary_key(self, definition: str) -> List[str]:
|
|
255
|
+
"""Parse PRIMARY KEY constraint."""
|
|
256
|
+
pattern = re.compile(r'PRIMARY\s+KEY\s*\(\s*(.*?)\s*\)', re.IGNORECASE)
|
|
257
|
+
match = pattern.search(definition)
|
|
258
|
+
if match:
|
|
259
|
+
columns = [col.strip().lower() for col in match.group(1).split(',')]
|
|
260
|
+
return columns
|
|
261
|
+
return []
|
|
262
|
+
|
|
263
|
+
def _parse_foreign_key(self, definition: str) -> Optional[Tuple[str, str]]:
|
|
264
|
+
"""Parse FOREIGN KEY constraint."""
|
|
265
|
+
pattern = re.compile(
|
|
266
|
+
r'FOREIGN\s+KEY\s*\(\s*(\w+)\s*\)\s+REFERENCES\s+(\w+)\s*\(\s*(\w+)\s*\)',
|
|
267
|
+
re.IGNORECASE
|
|
268
|
+
)
|
|
269
|
+
match = pattern.search(definition)
|
|
270
|
+
if match:
|
|
271
|
+
column = match.group(1).lower()
|
|
272
|
+
ref_table = match.group(2).lower()
|
|
273
|
+
ref_column = match.group(3).lower()
|
|
274
|
+
return (column, f"{ref_table}.{ref_column}")
|
|
275
|
+
return None
|
|
276
|
+
|
|
277
|
+
def _parse_unique_constraint(self, definition: str) -> Optional[List[str]]:
|
|
278
|
+
"""Parse UNIQUE constraint."""
|
|
279
|
+
pattern = re.compile(r'UNIQUE\s*\(\s*(.*?)\s*\)', re.IGNORECASE)
|
|
280
|
+
match = pattern.search(definition)
|
|
281
|
+
if match:
|
|
282
|
+
columns = [col.strip().lower() for col in match.group(1).split(',')]
|
|
283
|
+
return columns
|
|
284
|
+
return None
|
|
285
|
+
|
|
286
|
+
def _parse_check_constraint(self, definition: str) -> Optional[Dict[str, str]]:
|
|
287
|
+
"""Parse CHECK constraint."""
|
|
288
|
+
pattern = re.compile(r'CHECK\s*\(\s*(.*?)\s*\)', re.IGNORECASE)
|
|
289
|
+
match = pattern.search(definition)
|
|
290
|
+
if match:
|
|
291
|
+
constraint_name = f"check_constraint_{len(self.tables)}"
|
|
292
|
+
return {constraint_name: match.group(1)}
|
|
293
|
+
return None
|
|
294
|
+
|
|
295
|
+
def _parse_indexes(self, ddl_content: str) -> None:
|
|
296
|
+
"""Parse CREATE INDEX statements."""
|
|
297
|
+
index_pattern = re.compile(
|
|
298
|
+
r'CREATE\s+(?:(UNIQUE)\s+)?INDEX\s+(\w+)\s+ON\s+(\w+)\s*\(\s*(.*?)\s*\)',
|
|
299
|
+
re.IGNORECASE
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
for match in index_pattern.finditer(ddl_content):
|
|
303
|
+
unique = match.group(1) is not None
|
|
304
|
+
index_name = match.group(2).lower()
|
|
305
|
+
table_name = match.group(3).lower()
|
|
306
|
+
columns_str = match.group(4)
|
|
307
|
+
|
|
308
|
+
columns = [col.strip().lower() for col in columns_str.split(',')]
|
|
309
|
+
|
|
310
|
+
index = Index(
|
|
311
|
+
name=index_name,
|
|
312
|
+
table=table_name,
|
|
313
|
+
columns=columns,
|
|
314
|
+
unique=unique
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
if table_name in self.tables:
|
|
318
|
+
self.tables[table_name].indexes.append(index)
|
|
319
|
+
|
|
320
|
+
def parse_json_schema(self, json_content: str) -> None:
|
|
321
|
+
"""Parse JSON schema definition."""
|
|
322
|
+
try:
|
|
323
|
+
schema = json.loads(json_content)
|
|
324
|
+
|
|
325
|
+
if 'tables' not in schema:
|
|
326
|
+
raise ValueError("JSON schema must contain 'tables' key")
|
|
327
|
+
|
|
328
|
+
for table_name, table_def in schema['tables'].items():
|
|
329
|
+
table = self._parse_json_table(table_name.lower(), table_def)
|
|
330
|
+
self.tables[table_name.lower()] = table
|
|
331
|
+
|
|
332
|
+
except json.JSONDecodeError as e:
|
|
333
|
+
raise ValueError(f"Invalid JSON: {e}")
|
|
334
|
+
|
|
335
|
+
def _parse_json_table(self, table_name: str, table_def: Dict[str, Any]) -> Table:
|
|
336
|
+
"""Parse JSON table definition."""
|
|
337
|
+
columns = []
|
|
338
|
+
primary_key = table_def.get('primary_key', [])
|
|
339
|
+
foreign_keys = []
|
|
340
|
+
unique_constraints = table_def.get('unique_constraints', [])
|
|
341
|
+
check_constraints = table_def.get('check_constraints', {})
|
|
342
|
+
|
|
343
|
+
for col_name, col_def in table_def.get('columns', {}).items():
|
|
344
|
+
column = Column(
|
|
345
|
+
name=col_name.lower(),
|
|
346
|
+
data_type=col_def.get('type', 'VARCHAR(255)').upper(),
|
|
347
|
+
nullable=col_def.get('nullable', True),
|
|
348
|
+
primary_key=col_name.lower() in [pk.lower() for pk in primary_key],
|
|
349
|
+
unique=col_def.get('unique', False),
|
|
350
|
+
foreign_key=col_def.get('foreign_key'),
|
|
351
|
+
default_value=col_def.get('default')
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
columns.append(column)
|
|
355
|
+
|
|
356
|
+
if column.foreign_key:
|
|
357
|
+
foreign_keys.append((column.name, column.foreign_key))
|
|
358
|
+
|
|
359
|
+
return Table(
|
|
360
|
+
name=table_name,
|
|
361
|
+
columns=columns,
|
|
362
|
+
primary_key=[pk.lower() for pk in primary_key],
|
|
363
|
+
foreign_keys=foreign_keys,
|
|
364
|
+
unique_constraints=unique_constraints,
|
|
365
|
+
check_constraints=check_constraints,
|
|
366
|
+
indexes=[]
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
def analyze_normalization(self) -> None:
|
|
370
|
+
"""Analyze normalization compliance."""
|
|
371
|
+
for table_name, table in self.tables.items():
|
|
372
|
+
self._check_first_normal_form(table)
|
|
373
|
+
self._check_second_normal_form(table)
|
|
374
|
+
self._check_third_normal_form(table)
|
|
375
|
+
self._check_bcnf(table)
|
|
376
|
+
|
|
377
|
+
def _check_first_normal_form(self, table: Table) -> None:
|
|
378
|
+
"""Check First Normal Form compliance."""
|
|
379
|
+
# Check for atomic values (no arrays or delimited strings)
|
|
380
|
+
for column in table.columns:
|
|
381
|
+
if any(pattern in column.data_type.upper() for pattern in ['ARRAY', 'JSON', 'TEXT']):
|
|
382
|
+
if 'JSON' in column.data_type.upper():
|
|
383
|
+
# JSON columns can violate 1NF if storing arrays
|
|
384
|
+
self.normalization_issues.append(NormalizationIssue(
|
|
385
|
+
table=table.name,
|
|
386
|
+
issue_type="1NF_VIOLATION",
|
|
387
|
+
severity="WARNING",
|
|
388
|
+
description=f"Column '{column.name}' uses JSON type which may contain non-atomic values",
|
|
389
|
+
suggestion="Consider normalizing JSON arrays into separate tables",
|
|
390
|
+
columns_affected=[column.name]
|
|
391
|
+
))
|
|
392
|
+
|
|
393
|
+
# Check for potential delimited values in VARCHAR/TEXT
|
|
394
|
+
if column.data_type.upper().startswith(('VARCHAR', 'CHAR', 'TEXT')):
|
|
395
|
+
if any(delimiter in column.name.lower() for delimiter in ['list', 'array', 'tags', 'items']):
|
|
396
|
+
self.normalization_issues.append(NormalizationIssue(
|
|
397
|
+
table=table.name,
|
|
398
|
+
issue_type="1NF_VIOLATION",
|
|
399
|
+
severity="HIGH",
|
|
400
|
+
description=f"Column '{column.name}' appears to store delimited values",
|
|
401
|
+
suggestion="Create separate table for individual values with foreign key relationship",
|
|
402
|
+
columns_affected=[column.name]
|
|
403
|
+
))
|
|
404
|
+
|
|
405
|
+
def _check_second_normal_form(self, table: Table) -> None:
|
|
406
|
+
"""Check Second Normal Form compliance."""
|
|
407
|
+
if len(table.primary_key) <= 1:
|
|
408
|
+
return # 2NF only applies to tables with composite primary keys
|
|
409
|
+
|
|
410
|
+
# Look for potential partial dependencies
|
|
411
|
+
non_key_columns = [col for col in table.columns if col.name not in table.primary_key]
|
|
412
|
+
|
|
413
|
+
for column in non_key_columns:
|
|
414
|
+
# Heuristic: columns that seem related to only part of the composite key
|
|
415
|
+
for pk_part in table.primary_key:
|
|
416
|
+
if pk_part in column.name or column.name.startswith(pk_part.split('_')[0]):
|
|
417
|
+
self.normalization_issues.append(NormalizationIssue(
|
|
418
|
+
table=table.name,
|
|
419
|
+
issue_type="2NF_VIOLATION",
|
|
420
|
+
severity="MEDIUM",
|
|
421
|
+
description=f"Column '{column.name}' may have partial dependency on '{pk_part}'",
|
|
422
|
+
suggestion=f"Consider moving '{column.name}' to a separate table related to '{pk_part}'",
|
|
423
|
+
columns_affected=[column.name, pk_part]
|
|
424
|
+
))
|
|
425
|
+
break
|
|
426
|
+
|
|
427
|
+
def _check_third_normal_form(self, table: Table) -> None:
|
|
428
|
+
"""Check Third Normal Form compliance."""
|
|
429
|
+
# Look for transitive dependencies
|
|
430
|
+
non_key_columns = [col for col in table.columns if col.name not in table.primary_key]
|
|
431
|
+
|
|
432
|
+
# Group columns by potential entities they describe
|
|
433
|
+
entity_groups = defaultdict(list)
|
|
434
|
+
for column in non_key_columns:
|
|
435
|
+
# Simple heuristic: group by prefix before underscore
|
|
436
|
+
prefix = column.name.split('_')[0]
|
|
437
|
+
if prefix != column.name: # Has underscore
|
|
438
|
+
entity_groups[prefix].append(column.name)
|
|
439
|
+
|
|
440
|
+
for entity, columns in entity_groups.items():
|
|
441
|
+
if len(columns) > 1 and entity != table.name.split('_')[0]:
|
|
442
|
+
# Potential entity that should be in its own table
|
|
443
|
+
id_column = f"{entity}_id"
|
|
444
|
+
if id_column in [col.name for col in table.columns]:
|
|
445
|
+
self.normalization_issues.append(NormalizationIssue(
|
|
446
|
+
table=table.name,
|
|
447
|
+
issue_type="3NF_VIOLATION",
|
|
448
|
+
severity="MEDIUM",
|
|
449
|
+
description=f"Columns {columns} may have transitive dependency through '{id_column}'",
|
|
450
|
+
suggestion=f"Consider creating separate '{entity}' table with these columns",
|
|
451
|
+
columns_affected=columns + [id_column]
|
|
452
|
+
))
|
|
453
|
+
|
|
454
|
+
def _check_bcnf(self, table: Table) -> None:
|
|
455
|
+
"""Check Boyce-Codd Normal Form compliance."""
|
|
456
|
+
# BCNF violations are complex to detect without functional dependencies
|
|
457
|
+
# Provide general guidance for composite keys
|
|
458
|
+
if len(table.primary_key) > 2:
|
|
459
|
+
self.normalization_issues.append(NormalizationIssue(
|
|
460
|
+
table=table.name,
|
|
461
|
+
issue_type="BCNF_WARNING",
|
|
462
|
+
severity="LOW",
|
|
463
|
+
description=f"Table has composite primary key with {len(table.primary_key)} columns",
|
|
464
|
+
suggestion="Review functional dependencies to ensure BCNF compliance",
|
|
465
|
+
columns_affected=table.primary_key
|
|
466
|
+
))
|
|
467
|
+
|
|
468
|
+
def analyze_data_types(self) -> None:
|
|
469
|
+
"""Analyze data type usage for antipatterns."""
|
|
470
|
+
for table_name, table in self.tables.items():
|
|
471
|
+
for column in table.columns:
|
|
472
|
+
self._check_varchar_255_antipattern(table.name, column)
|
|
473
|
+
self._check_inappropriate_types(table.name, column)
|
|
474
|
+
self._check_size_optimization(table.name, column)
|
|
475
|
+
|
|
476
|
+
def _check_varchar_255_antipattern(self, table_name: str, column: Column) -> None:
|
|
477
|
+
"""Check for VARCHAR(255) antipattern."""
|
|
478
|
+
if self.varchar_255_pattern.match(column.data_type):
|
|
479
|
+
self.datatype_issues.append(DataTypeIssue(
|
|
480
|
+
table=table_name,
|
|
481
|
+
column=column.name,
|
|
482
|
+
current_type=column.data_type,
|
|
483
|
+
issue="VARCHAR(255) antipattern",
|
|
484
|
+
suggested_type="Appropriately sized VARCHAR or TEXT",
|
|
485
|
+
rationale="VARCHAR(255) is often used as default without considering actual data length requirements"
|
|
486
|
+
))
|
|
487
|
+
|
|
488
|
+
def _check_inappropriate_types(self, table_name: str, column: Column) -> None:
|
|
489
|
+
"""Check for inappropriate data types."""
|
|
490
|
+
# Date/time stored as string
|
|
491
|
+
if column.name.lower() in ['date', 'time', 'created', 'updated', 'modified', 'timestamp']:
|
|
492
|
+
if column.data_type.upper().startswith(('VARCHAR', 'CHAR', 'TEXT')):
|
|
493
|
+
self.datatype_issues.append(DataTypeIssue(
|
|
494
|
+
table=table_name,
|
|
495
|
+
column=column.name,
|
|
496
|
+
current_type=column.data_type,
|
|
497
|
+
issue="Date/time stored as string",
|
|
498
|
+
suggested_type="TIMESTAMP, DATE, or TIME",
|
|
499
|
+
rationale="Proper date/time types enable date arithmetic and indexing optimization"
|
|
500
|
+
))
|
|
501
|
+
|
|
502
|
+
# Boolean stored as string/integer
|
|
503
|
+
if column.name.lower() in ['active', 'enabled', 'deleted', 'visible', 'published']:
|
|
504
|
+
if not column.data_type.upper().startswith('BOOL'):
|
|
505
|
+
self.datatype_issues.append(DataTypeIssue(
|
|
506
|
+
table=table_name,
|
|
507
|
+
column=column.name,
|
|
508
|
+
current_type=column.data_type,
|
|
509
|
+
issue="Boolean value stored as non-boolean type",
|
|
510
|
+
suggested_type="BOOLEAN",
|
|
511
|
+
rationale="Boolean type is more explicit and can be more storage efficient"
|
|
512
|
+
))
|
|
513
|
+
|
|
514
|
+
# Numeric IDs as VARCHAR
|
|
515
|
+
if column.name.lower().endswith('_id') or column.name.lower() == 'id':
|
|
516
|
+
if column.data_type.upper().startswith(('VARCHAR', 'CHAR')):
|
|
517
|
+
self.datatype_issues.append(DataTypeIssue(
|
|
518
|
+
table=table_name,
|
|
519
|
+
column=column.name,
|
|
520
|
+
current_type=column.data_type,
|
|
521
|
+
issue="Numeric ID stored as string",
|
|
522
|
+
suggested_type="INTEGER, BIGINT, or UUID",
|
|
523
|
+
rationale="Numeric types are more efficient for ID columns and enable better indexing"
|
|
524
|
+
))
|
|
525
|
+
|
|
526
|
+
def _check_size_optimization(self, table_name: str, column: Column) -> None:
|
|
527
|
+
"""Check for size optimization opportunities."""
|
|
528
|
+
# Oversized integer types
|
|
529
|
+
if column.data_type.upper() == 'BIGINT':
|
|
530
|
+
if not any(keyword in column.name.lower() for keyword in ['timestamp', 'big', 'large', 'count']):
|
|
531
|
+
self.datatype_issues.append(DataTypeIssue(
|
|
532
|
+
table=table_name,
|
|
533
|
+
column=column.name,
|
|
534
|
+
current_type=column.data_type,
|
|
535
|
+
issue="Potentially oversized integer type",
|
|
536
|
+
suggested_type="INTEGER",
|
|
537
|
+
rationale="INTEGER is sufficient for most ID and count fields unless very large values are expected"
|
|
538
|
+
))
|
|
539
|
+
|
|
540
|
+
def analyze_constraints(self) -> None:
|
|
541
|
+
"""Analyze missing constraints."""
|
|
542
|
+
for table_name, table in self.tables.items():
|
|
543
|
+
self._check_missing_primary_key(table)
|
|
544
|
+
self._check_missing_foreign_key_constraints(table)
|
|
545
|
+
self._check_missing_not_null_constraints(table)
|
|
546
|
+
self._check_missing_unique_constraints(table)
|
|
547
|
+
self._check_missing_check_constraints(table)
|
|
548
|
+
|
|
549
|
+
def _check_missing_primary_key(self, table: Table) -> None:
|
|
550
|
+
"""Check for missing primary key."""
|
|
551
|
+
if not table.primary_key:
|
|
552
|
+
self.constraint_issues.append(ConstraintIssue(
|
|
553
|
+
table=table.name,
|
|
554
|
+
issue_type="MISSING_PRIMARY_KEY",
|
|
555
|
+
severity="HIGH",
|
|
556
|
+
description="Table has no primary key defined",
|
|
557
|
+
suggestion="Add a primary key column (e.g., 'id' with auto-increment)",
|
|
558
|
+
columns_affected=[]
|
|
559
|
+
))
|
|
560
|
+
|
|
561
|
+
def _check_missing_foreign_key_constraints(self, table: Table) -> None:
|
|
562
|
+
"""Check for missing foreign key constraints."""
|
|
563
|
+
for column in table.columns:
|
|
564
|
+
if column.name.endswith('_id') and column.name != 'id':
|
|
565
|
+
# Potential foreign key column
|
|
566
|
+
if not column.foreign_key:
|
|
567
|
+
referenced_table = column.name[:-3] # Remove '_id' suffix
|
|
568
|
+
if referenced_table in self.tables or referenced_table + 's' in self.tables:
|
|
569
|
+
self.constraint_issues.append(ConstraintIssue(
|
|
570
|
+
table=table.name,
|
|
571
|
+
issue_type="MISSING_FOREIGN_KEY",
|
|
572
|
+
severity="MEDIUM",
|
|
573
|
+
description=f"Column '{column.name}' appears to be a foreign key but has no constraint",
|
|
574
|
+
suggestion=f"Add foreign key constraint referencing {referenced_table} table",
|
|
575
|
+
columns_affected=[column.name]
|
|
576
|
+
))
|
|
577
|
+
|
|
578
|
+
def _check_missing_not_null_constraints(self, table: Table) -> None:
|
|
579
|
+
"""Check for missing NOT NULL constraints."""
|
|
580
|
+
for column in table.columns:
|
|
581
|
+
if column.nullable and column.name in ['email', 'name', 'title', 'status']:
|
|
582
|
+
self.constraint_issues.append(ConstraintIssue(
|
|
583
|
+
table=table.name,
|
|
584
|
+
issue_type="MISSING_NOT_NULL",
|
|
585
|
+
severity="LOW",
|
|
586
|
+
description=f"Column '{column.name}' allows NULL but typically should not",
|
|
587
|
+
suggestion=f"Consider adding NOT NULL constraint to '{column.name}'",
|
|
588
|
+
columns_affected=[column.name]
|
|
589
|
+
))
|
|
590
|
+
|
|
591
|
+
def _check_missing_unique_constraints(self, table: Table) -> None:
|
|
592
|
+
"""Check for missing unique constraints."""
|
|
593
|
+
for column in table.columns:
|
|
594
|
+
if column.name in ['email', 'username', 'slug', 'code'] and not column.unique:
|
|
595
|
+
if column.name not in table.primary_key:
|
|
596
|
+
self.constraint_issues.append(ConstraintIssue(
|
|
597
|
+
table=table.name,
|
|
598
|
+
issue_type="MISSING_UNIQUE",
|
|
599
|
+
severity="MEDIUM",
|
|
600
|
+
description=f"Column '{column.name}' should likely have UNIQUE constraint",
|
|
601
|
+
suggestion=f"Add UNIQUE constraint to '{column.name}'",
|
|
602
|
+
columns_affected=[column.name]
|
|
603
|
+
))
|
|
604
|
+
|
|
605
|
+
def _check_missing_check_constraints(self, table: Table) -> None:
|
|
606
|
+
"""Check for missing check constraints."""
|
|
607
|
+
for column in table.columns:
|
|
608
|
+
# Email format validation
|
|
609
|
+
if column.name == 'email' and 'email' not in str(table.check_constraints):
|
|
610
|
+
self.constraint_issues.append(ConstraintIssue(
|
|
611
|
+
table=table.name,
|
|
612
|
+
issue_type="MISSING_CHECK_CONSTRAINT",
|
|
613
|
+
severity="LOW",
|
|
614
|
+
description=f"Email column lacks format validation",
|
|
615
|
+
suggestion="Add CHECK constraint for email format validation",
|
|
616
|
+
columns_affected=[column.name]
|
|
617
|
+
))
|
|
618
|
+
|
|
619
|
+
# Positive values for counts, prices, etc.
|
|
620
|
+
if column.name.lower() in ['price', 'amount', 'count', 'quantity', 'age']:
|
|
621
|
+
if column.name not in str(table.check_constraints):
|
|
622
|
+
self.constraint_issues.append(ConstraintIssue(
|
|
623
|
+
table=table.name,
|
|
624
|
+
issue_type="MISSING_CHECK_CONSTRAINT",
|
|
625
|
+
severity="LOW",
|
|
626
|
+
description=f"Column '{column.name}' should validate positive values",
|
|
627
|
+
suggestion=f"Add CHECK constraint: {column.name} > 0",
|
|
628
|
+
columns_affected=[column.name]
|
|
629
|
+
))
|
|
630
|
+
|
|
631
|
+
def analyze_naming_conventions(self) -> None:
|
|
632
|
+
"""Analyze naming convention compliance."""
|
|
633
|
+
for table_name, table in self.tables.items():
|
|
634
|
+
self._check_table_naming(table_name)
|
|
635
|
+
for column in table.columns:
|
|
636
|
+
self._check_column_naming(table_name, column.name)
|
|
637
|
+
|
|
638
|
+
def _check_table_naming(self, table_name: str) -> None:
|
|
639
|
+
"""Check table naming conventions."""
|
|
640
|
+
if not self.table_naming_pattern.match(table_name):
|
|
641
|
+
suggested_name = self._suggest_table_name(table_name)
|
|
642
|
+
self.naming_issues.append(NamingIssue(
|
|
643
|
+
table=table_name,
|
|
644
|
+
column=None,
|
|
645
|
+
issue="Invalid table naming convention",
|
|
646
|
+
current_name=table_name,
|
|
647
|
+
suggested_name=suggested_name
|
|
648
|
+
))
|
|
649
|
+
|
|
650
|
+
# Check for plural naming
|
|
651
|
+
if not table_name.endswith('s') and table_name not in ['data', 'information']:
|
|
652
|
+
self.naming_issues.append(NamingIssue(
|
|
653
|
+
table=table_name,
|
|
654
|
+
column=None,
|
|
655
|
+
issue="Table name should be plural",
|
|
656
|
+
current_name=table_name,
|
|
657
|
+
suggested_name=table_name + 's'
|
|
658
|
+
))
|
|
659
|
+
|
|
660
|
+
def _check_column_naming(self, table_name: str, column_name: str) -> None:
|
|
661
|
+
"""Check column naming conventions."""
|
|
662
|
+
if not self.column_naming_pattern.match(column_name):
|
|
663
|
+
suggested_name = self._suggest_column_name(column_name)
|
|
664
|
+
self.naming_issues.append(NamingIssue(
|
|
665
|
+
table=table_name,
|
|
666
|
+
column=column_name,
|
|
667
|
+
issue="Invalid column naming convention",
|
|
668
|
+
current_name=column_name,
|
|
669
|
+
suggested_name=suggested_name
|
|
670
|
+
))
|
|
671
|
+
|
|
672
|
+
def _suggest_table_name(self, table_name: str) -> str:
|
|
673
|
+
"""Suggest corrected table name."""
|
|
674
|
+
# Convert to snake_case and make plural
|
|
675
|
+
name = re.sub(r'([A-Z])', r'_\1', table_name).lower().strip('_')
|
|
676
|
+
return name + 's' if not name.endswith('s') else name
|
|
677
|
+
|
|
678
|
+
def _suggest_column_name(self, column_name: str) -> str:
|
|
679
|
+
"""Suggest corrected column name."""
|
|
680
|
+
# Convert to snake_case
|
|
681
|
+
return re.sub(r'([A-Z])', r'_\1', column_name).lower().strip('_')
|
|
682
|
+
|
|
683
|
+
def check_missing_indexes(self) -> List[Dict[str, Any]]:
|
|
684
|
+
"""Check for missing indexes on foreign key columns."""
|
|
685
|
+
missing_indexes = []
|
|
686
|
+
|
|
687
|
+
for table_name, table in self.tables.items():
|
|
688
|
+
existing_indexed_columns = set()
|
|
689
|
+
|
|
690
|
+
# Collect existing indexed columns
|
|
691
|
+
for index in table.indexes:
|
|
692
|
+
existing_indexed_columns.update(index.columns)
|
|
693
|
+
|
|
694
|
+
# Primary key columns are automatically indexed
|
|
695
|
+
existing_indexed_columns.update(table.primary_key)
|
|
696
|
+
|
|
697
|
+
# Check foreign key columns
|
|
698
|
+
for column in table.columns:
|
|
699
|
+
if column.foreign_key and column.name not in existing_indexed_columns:
|
|
700
|
+
missing_indexes.append({
|
|
701
|
+
'table': table_name,
|
|
702
|
+
'column': column.name,
|
|
703
|
+
'type': 'foreign_key',
|
|
704
|
+
'suggestion': f"CREATE INDEX idx_{table_name}_{column.name} ON {table_name} ({column.name});"
|
|
705
|
+
})
|
|
706
|
+
|
|
707
|
+
return missing_indexes
|
|
708
|
+
|
|
709
|
+
def generate_mermaid_erd(self) -> str:
|
|
710
|
+
"""Generate Mermaid ERD diagram."""
|
|
711
|
+
erd_lines = ["erDiagram"]
|
|
712
|
+
|
|
713
|
+
# Add table definitions
|
|
714
|
+
for table_name, table in self.tables.items():
|
|
715
|
+
erd_lines.append(f" {table_name.upper()} {{")
|
|
716
|
+
|
|
717
|
+
for column in table.columns:
|
|
718
|
+
data_type = column.data_type
|
|
719
|
+
constraints = []
|
|
720
|
+
|
|
721
|
+
if column.primary_key:
|
|
722
|
+
constraints.append("PK")
|
|
723
|
+
if column.foreign_key:
|
|
724
|
+
constraints.append("FK")
|
|
725
|
+
if not column.nullable:
|
|
726
|
+
constraints.append("NOT NULL")
|
|
727
|
+
if column.unique:
|
|
728
|
+
constraints.append("UNIQUE")
|
|
729
|
+
|
|
730
|
+
constraint_str = " ".join(constraints)
|
|
731
|
+
if constraint_str:
|
|
732
|
+
constraint_str = f" \"{constraint_str}\""
|
|
733
|
+
|
|
734
|
+
erd_lines.append(f" {data_type} {column.name}{constraint_str}")
|
|
735
|
+
|
|
736
|
+
erd_lines.append(" }")
|
|
737
|
+
|
|
738
|
+
# Add relationships
|
|
739
|
+
relationships = set()
|
|
740
|
+
for table_name, table in self.tables.items():
|
|
741
|
+
for column in table.columns:
|
|
742
|
+
if column.foreign_key:
|
|
743
|
+
ref_table = column.foreign_key.split('.')[0]
|
|
744
|
+
if ref_table in self.tables:
|
|
745
|
+
relationship = f" {ref_table.upper()} ||--o{{ {table_name.upper()} : has"
|
|
746
|
+
relationships.add(relationship)
|
|
747
|
+
|
|
748
|
+
erd_lines.extend(sorted(relationships))
|
|
749
|
+
|
|
750
|
+
return "\n".join(erd_lines)
|
|
751
|
+
|
|
752
|
+
def get_analysis_summary(self) -> Dict[str, Any]:
|
|
753
|
+
"""Get comprehensive analysis summary."""
|
|
754
|
+
return {
|
|
755
|
+
"schema_overview": {
|
|
756
|
+
"total_tables": len(self.tables),
|
|
757
|
+
"total_columns": sum(len(table.columns) for table in self.tables.values()),
|
|
758
|
+
"tables_with_primary_keys": len([t for t in self.tables.values() if t.primary_key]),
|
|
759
|
+
"total_foreign_keys": sum(len(table.foreign_keys) for table in self.tables.values()),
|
|
760
|
+
"total_indexes": sum(len(table.indexes) for table in self.tables.values())
|
|
761
|
+
},
|
|
762
|
+
"normalization_analysis": {
|
|
763
|
+
"total_issues": len(self.normalization_issues),
|
|
764
|
+
"by_severity": {
|
|
765
|
+
"high": len([i for i in self.normalization_issues if i.severity == "HIGH"]),
|
|
766
|
+
"medium": len([i for i in self.normalization_issues if i.severity == "MEDIUM"]),
|
|
767
|
+
"low": len([i for i in self.normalization_issues if i.severity == "LOW"]),
|
|
768
|
+
"warning": len([i for i in self.normalization_issues if i.severity == "WARNING"])
|
|
769
|
+
},
|
|
770
|
+
"issues": [asdict(issue) for issue in self.normalization_issues]
|
|
771
|
+
},
|
|
772
|
+
"data_type_analysis": {
|
|
773
|
+
"total_issues": len(self.datatype_issues),
|
|
774
|
+
"issues": [asdict(issue) for issue in self.datatype_issues]
|
|
775
|
+
},
|
|
776
|
+
"constraint_analysis": {
|
|
777
|
+
"total_issues": len(self.constraint_issues),
|
|
778
|
+
"by_severity": {
|
|
779
|
+
"high": len([i for i in self.constraint_issues if i.severity == "HIGH"]),
|
|
780
|
+
"medium": len([i for i in self.constraint_issues if i.severity == "MEDIUM"]),
|
|
781
|
+
"low": len([i for i in self.constraint_issues if i.severity == "LOW"])
|
|
782
|
+
},
|
|
783
|
+
"issues": [asdict(issue) for issue in self.constraint_issues]
|
|
784
|
+
},
|
|
785
|
+
"naming_analysis": {
|
|
786
|
+
"total_issues": len(self.naming_issues),
|
|
787
|
+
"issues": [asdict(issue) for issue in self.naming_issues]
|
|
788
|
+
},
|
|
789
|
+
"missing_indexes": self.check_missing_indexes(),
|
|
790
|
+
"recommendations": self._generate_recommendations()
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
def _generate_recommendations(self) -> List[str]:
|
|
794
|
+
"""Generate high-level recommendations."""
|
|
795
|
+
recommendations = []
|
|
796
|
+
|
|
797
|
+
# High severity issues
|
|
798
|
+
high_severity_issues = [
|
|
799
|
+
i for i in self.normalization_issues + self.constraint_issues
|
|
800
|
+
if i.severity == "HIGH"
|
|
801
|
+
]
|
|
802
|
+
|
|
803
|
+
if high_severity_issues:
|
|
804
|
+
recommendations.append(f"Address {len(high_severity_issues)} high-severity issues immediately")
|
|
805
|
+
|
|
806
|
+
# Missing primary keys
|
|
807
|
+
tables_without_pk = [name for name, table in self.tables.items() if not table.primary_key]
|
|
808
|
+
if tables_without_pk:
|
|
809
|
+
recommendations.append(f"Add primary keys to tables: {', '.join(tables_without_pk)}")
|
|
810
|
+
|
|
811
|
+
# Data type improvements
|
|
812
|
+
varchar_255_issues = [i for i in self.datatype_issues if "VARCHAR(255)" in i.issue]
|
|
813
|
+
if varchar_255_issues:
|
|
814
|
+
recommendations.append(f"Review {len(varchar_255_issues)} VARCHAR(255) columns for right-sizing")
|
|
815
|
+
|
|
816
|
+
# Missing foreign keys
|
|
817
|
+
missing_fks = [i for i in self.constraint_issues if i.issue_type == "MISSING_FOREIGN_KEY"]
|
|
818
|
+
if missing_fks:
|
|
819
|
+
recommendations.append(f"Consider adding {len(missing_fks)} foreign key constraints for referential integrity")
|
|
820
|
+
|
|
821
|
+
# Normalization improvements
|
|
822
|
+
normalization_issues_count = len(self.normalization_issues)
|
|
823
|
+
if normalization_issues_count > 0:
|
|
824
|
+
recommendations.append(f"Review {normalization_issues_count} normalization issues for schema optimization")
|
|
825
|
+
|
|
826
|
+
return recommendations
|
|
827
|
+
|
|
828
|
+
def format_text_report(self, analysis: Dict[str, Any]) -> str:
|
|
829
|
+
"""Format analysis as human-readable text report."""
|
|
830
|
+
lines = []
|
|
831
|
+
lines.append("DATABASE SCHEMA ANALYSIS REPORT")
|
|
832
|
+
lines.append("=" * 50)
|
|
833
|
+
lines.append("")
|
|
834
|
+
|
|
835
|
+
# Overview
|
|
836
|
+
overview = analysis["schema_overview"]
|
|
837
|
+
lines.append("SCHEMA OVERVIEW")
|
|
838
|
+
lines.append("-" * 15)
|
|
839
|
+
lines.append(f"Total Tables: {overview['total_tables']}")
|
|
840
|
+
lines.append(f"Total Columns: {overview['total_columns']}")
|
|
841
|
+
lines.append(f"Tables with Primary Keys: {overview['tables_with_primary_keys']}")
|
|
842
|
+
lines.append(f"Total Foreign Keys: {overview['total_foreign_keys']}")
|
|
843
|
+
lines.append(f"Total Indexes: {overview['total_indexes']}")
|
|
844
|
+
lines.append("")
|
|
845
|
+
|
|
846
|
+
# Recommendations
|
|
847
|
+
if analysis["recommendations"]:
|
|
848
|
+
lines.append("KEY RECOMMENDATIONS")
|
|
849
|
+
lines.append("-" * 18)
|
|
850
|
+
for i, rec in enumerate(analysis["recommendations"], 1):
|
|
851
|
+
lines.append(f"{i}. {rec}")
|
|
852
|
+
lines.append("")
|
|
853
|
+
|
|
854
|
+
# Normalization Issues
|
|
855
|
+
norm_analysis = analysis["normalization_analysis"]
|
|
856
|
+
if norm_analysis["total_issues"] > 0:
|
|
857
|
+
lines.append(f"NORMALIZATION ISSUES ({norm_analysis['total_issues']} total)")
|
|
858
|
+
lines.append("-" * 25)
|
|
859
|
+
severity_counts = norm_analysis["by_severity"]
|
|
860
|
+
lines.append(f"High: {severity_counts['high']}, Medium: {severity_counts['medium']}, "
|
|
861
|
+
f"Low: {severity_counts['low']}, Warning: {severity_counts['warning']}")
|
|
862
|
+
lines.append("")
|
|
863
|
+
|
|
864
|
+
for issue in norm_analysis["issues"][:5]: # Show first 5
|
|
865
|
+
lines.append(f"• {issue['table']}: {issue['description']}")
|
|
866
|
+
lines.append(f" Suggestion: {issue['suggestion']}")
|
|
867
|
+
lines.append("")
|
|
868
|
+
|
|
869
|
+
# Data Type Issues
|
|
870
|
+
dt_analysis = analysis["data_type_analysis"]
|
|
871
|
+
if dt_analysis["total_issues"] > 0:
|
|
872
|
+
lines.append(f"DATA TYPE ISSUES ({dt_analysis['total_issues']} total)")
|
|
873
|
+
lines.append("-" * 20)
|
|
874
|
+
for issue in dt_analysis["issues"][:5]: # Show first 5
|
|
875
|
+
lines.append(f"• {issue['table']}.{issue['column']}: {issue['issue']}")
|
|
876
|
+
lines.append(f" Current: {issue['current_type']} → Suggested: {issue['suggested_type']}")
|
|
877
|
+
lines.append(f" Rationale: {issue['rationale']}")
|
|
878
|
+
lines.append("")
|
|
879
|
+
|
|
880
|
+
# Constraint Issues
|
|
881
|
+
const_analysis = analysis["constraint_analysis"]
|
|
882
|
+
if const_analysis["total_issues"] > 0:
|
|
883
|
+
lines.append(f"CONSTRAINT ISSUES ({const_analysis['total_issues']} total)")
|
|
884
|
+
lines.append("-" * 20)
|
|
885
|
+
severity_counts = const_analysis["by_severity"]
|
|
886
|
+
lines.append(f"High: {severity_counts['high']}, Medium: {severity_counts['medium']}, "
|
|
887
|
+
f"Low: {severity_counts['low']}")
|
|
888
|
+
lines.append("")
|
|
889
|
+
|
|
890
|
+
for issue in const_analysis["issues"][:5]: # Show first 5
|
|
891
|
+
lines.append(f"• {issue['table']}: {issue['description']}")
|
|
892
|
+
lines.append(f" Suggestion: {issue['suggestion']}")
|
|
893
|
+
lines.append("")
|
|
894
|
+
|
|
895
|
+
# Missing Indexes
|
|
896
|
+
missing_idx = analysis["missing_indexes"]
|
|
897
|
+
if missing_idx:
|
|
898
|
+
lines.append(f"MISSING INDEXES ({len(missing_idx)} total)")
|
|
899
|
+
lines.append("-" * 17)
|
|
900
|
+
for idx in missing_idx[:5]: # Show first 5
|
|
901
|
+
lines.append(f"• {idx['table']}.{idx['column']} ({idx['type']})")
|
|
902
|
+
lines.append(f" SQL: {idx['suggestion']}")
|
|
903
|
+
lines.append("")
|
|
904
|
+
|
|
905
|
+
return "\n".join(lines)
|
|
906
|
+
|
|
907
|
+
|
|
908
|
+
def main():
|
|
909
|
+
parser = argparse.ArgumentParser(description="Analyze database schema for design issues and generate ERD")
|
|
910
|
+
parser.add_argument("--input", "-i", required=True, help="Input file (SQL DDL or JSON schema)")
|
|
911
|
+
parser.add_argument("--output", "-o", help="Output file (default: stdout)")
|
|
912
|
+
parser.add_argument("--output-format", "-f", choices=["json", "text"], default="text",
|
|
913
|
+
help="Output format")
|
|
914
|
+
parser.add_argument("--generate-erd", "-e", action="store_true", help="Include Mermaid ERD in output")
|
|
915
|
+
parser.add_argument("--erd-only", action="store_true", help="Output only the Mermaid ERD")
|
|
916
|
+
|
|
917
|
+
args = parser.parse_args()
|
|
918
|
+
|
|
919
|
+
try:
|
|
920
|
+
# Read input file
|
|
921
|
+
with open(args.input, 'r') as f:
|
|
922
|
+
content = f.read()
|
|
923
|
+
|
|
924
|
+
# Initialize analyzer
|
|
925
|
+
analyzer = SchemaAnalyzer()
|
|
926
|
+
|
|
927
|
+
# Parse input based on file extension
|
|
928
|
+
if args.input.lower().endswith('.json'):
|
|
929
|
+
analyzer.parse_json_schema(content)
|
|
930
|
+
else:
|
|
931
|
+
analyzer.parse_sql_ddl(content)
|
|
932
|
+
|
|
933
|
+
if not analyzer.tables:
|
|
934
|
+
print("Error: No tables found in input file", file=sys.stderr)
|
|
935
|
+
return 1
|
|
936
|
+
|
|
937
|
+
if args.erd_only:
|
|
938
|
+
# Output only ERD
|
|
939
|
+
erd = analyzer.generate_mermaid_erd()
|
|
940
|
+
if args.output:
|
|
941
|
+
with open(args.output, 'w') as f:
|
|
942
|
+
f.write(erd)
|
|
943
|
+
else:
|
|
944
|
+
print(erd)
|
|
945
|
+
return 0
|
|
946
|
+
|
|
947
|
+
# Perform analysis
|
|
948
|
+
analyzer.analyze_normalization()
|
|
949
|
+
analyzer.analyze_data_types()
|
|
950
|
+
analyzer.analyze_constraints()
|
|
951
|
+
analyzer.analyze_naming_conventions()
|
|
952
|
+
|
|
953
|
+
# Generate report
|
|
954
|
+
analysis = analyzer.get_analysis_summary()
|
|
955
|
+
|
|
956
|
+
if args.generate_erd:
|
|
957
|
+
analysis["mermaid_erd"] = analyzer.generate_mermaid_erd()
|
|
958
|
+
|
|
959
|
+
# Output results
|
|
960
|
+
if args.output_format == "json":
|
|
961
|
+
output = json.dumps(analysis, indent=2)
|
|
962
|
+
else:
|
|
963
|
+
output = analyzer.format_text_report(analysis)
|
|
964
|
+
if args.generate_erd:
|
|
965
|
+
output += "\n\nMERMAID ERD\n" + "=" * 11 + "\n"
|
|
966
|
+
output += analysis["mermaid_erd"]
|
|
967
|
+
|
|
968
|
+
if args.output:
|
|
969
|
+
with open(args.output, 'w') as f:
|
|
970
|
+
f.write(output)
|
|
971
|
+
else:
|
|
972
|
+
print(output)
|
|
973
|
+
|
|
974
|
+
return 0
|
|
975
|
+
|
|
976
|
+
except Exception as e:
|
|
977
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
978
|
+
return 1
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
if __name__ == "__main__":
|
|
982
|
+
sys.exit(main())
|