@thanhvn14/csvibe 0.1.4 ā 0.1.5
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/.github/agents/schemas/base-output.schema.json +88 -0
- package/.github/agents/schemas/brainstorm-output.schema.json +88 -0
- package/.github/agents/schemas/scout-output.schema.json +60 -0
- package/.github/agents/scripts/fetch-copilot-tools.js +245 -0
- package/.github/agents/scripts/lib/parse-agent-file.js +275 -0
- package/.github/agents/scripts/package-lock.json +78 -0
- package/.github/agents/scripts/package.json +22 -0
- package/.github/agents/scripts/schemas/agent-frontmatter.schema.json +83 -0
- package/.github/agents/scripts/validate-agent-all.js +157 -0
- package/.github/agents/scripts/validate-agent-frontmatter.js +96 -0
- package/.github/agents/scripts/validate-agent-handoffs.js +169 -0
- package/.github/agents/scripts/validate-agent-output.js +157 -0
- package/.github/agents/scripts/validate-agent-tools.js +278 -0
- package/.github/skills/.env.example +100 -0
- package/.github/skills/.install-state.json +23 -0
- package/.github/skills/README.md +149 -0
- package/.github/skills/ai-multimodal/.env.example +204 -0
- package/.github/skills/ai-multimodal/scripts/.coverage +0 -0
- package/.github/skills/ai-multimodal/scripts/check_setup.py +305 -0
- package/.github/skills/ai-multimodal/scripts/document_converter.py +395 -0
- package/.github/skills/ai-multimodal/scripts/gemini_batch_process.py +1184 -0
- package/.github/skills/ai-multimodal/scripts/media_optimizer.py +506 -0
- package/.github/skills/ai-multimodal/scripts/requirements.txt +26 -0
- package/.github/skills/better-auth/scripts/.coverage +0 -0
- package/.github/skills/better-auth/scripts/better_auth_init.py +521 -0
- package/.github/skills/better-auth/scripts/requirements.txt +15 -0
- package/.github/skills/chrome-devtools/scripts/README.md +272 -0
- package/.github/skills/chrome-devtools/scripts/__tests__/selector.test.js +210 -0
- package/.github/skills/chrome-devtools/scripts/aria-snapshot.js +362 -0
- package/.github/skills/chrome-devtools/scripts/click.js +83 -0
- package/.github/skills/chrome-devtools/scripts/console.js +79 -0
- package/.github/skills/chrome-devtools/scripts/evaluate.js +53 -0
- package/.github/skills/chrome-devtools/scripts/fill.js +76 -0
- package/.github/skills/chrome-devtools/scripts/inject-auth.js +229 -0
- package/.github/skills/chrome-devtools/scripts/install-deps.sh +181 -0
- package/.github/skills/chrome-devtools/scripts/install.sh +83 -0
- package/.github/skills/chrome-devtools/scripts/lib/browser.js +318 -0
- package/.github/skills/chrome-devtools/scripts/lib/selector.js +178 -0
- package/.github/skills/chrome-devtools/scripts/navigate.js +54 -0
- package/.github/skills/chrome-devtools/scripts/network.js +106 -0
- package/.github/skills/chrome-devtools/scripts/package-lock.json +1589 -0
- package/.github/skills/chrome-devtools/scripts/package.json +16 -0
- package/.github/skills/chrome-devtools/scripts/performance.js +149 -0
- package/.github/skills/chrome-devtools/scripts/screenshot.js +198 -0
- package/.github/skills/chrome-devtools/scripts/select-ref.js +131 -0
- package/.github/skills/chrome-devtools/scripts/snapshot.js +135 -0
- package/.github/skills/common/README.md +120 -0
- package/.github/skills/common/api_key_helper.py +411 -0
- package/.github/skills/common/api_key_rotator.py +248 -0
- package/.github/skills/databases/scripts/.coverage +0 -0
- package/.github/skills/databases/scripts/db_backup.py +502 -0
- package/.github/skills/databases/scripts/db_migrate.py +425 -0
- package/.github/skills/databases/scripts/db_performance_check.py +456 -0
- package/.github/skills/databases/scripts/requirements.txt +20 -0
- package/.github/skills/debugging/scripts/find-polluter.sh +63 -0
- package/.github/skills/devops/.env.example +76 -0
- package/.github/skills/devops/scripts/cloudflare_deploy.py +269 -0
- package/.github/skills/devops/scripts/docker_optimize.py +331 -0
- package/.github/skills/devops/scripts/requirements.txt +20 -0
- package/.github/skills/docs-seeker/.env.example +15 -0
- package/.github/skills/docs-seeker/package.json +25 -0
- package/.github/skills/docs-seeker/scripts/analyze-llms-txt.js +211 -0
- package/.github/skills/docs-seeker/scripts/detect-topic.js +172 -0
- package/.github/skills/docs-seeker/scripts/fetch-docs.js +213 -0
- package/.github/skills/docs-seeker/scripts/utils/env-loader.js +94 -0
- package/.github/skills/document-skills/docx/LICENSE.txt +30 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.github/skills/document-skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/pack.py +159 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/unpack.py +29 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/validate.py +69 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/validation/__init__.py +15 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/validation/base.py +951 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/validation/docx.py +274 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/validation/pptx.py +315 -0
- package/.github/skills/document-skills/docx/ooxml/scripts/validation/redlining.py +279 -0
- package/.github/skills/document-skills/docx/scripts/__init__.py +1 -0
- package/.github/skills/document-skills/docx/scripts/document.py +1276 -0
- package/.github/skills/document-skills/docx/scripts/templates/comments.xml +3 -0
- package/.github/skills/document-skills/docx/scripts/templates/commentsExtended.xml +3 -0
- package/.github/skills/document-skills/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/.github/skills/document-skills/docx/scripts/templates/commentsIds.xml +3 -0
- package/.github/skills/document-skills/docx/scripts/templates/people.xml +3 -0
- package/.github/skills/document-skills/docx/scripts/utilities.py +374 -0
- package/.github/skills/document-skills/pdf/LICENSE.txt +30 -0
- package/.github/skills/document-skills/pdf/scripts/check_bounding_boxes.py +70 -0
- package/.github/skills/document-skills/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/.github/skills/document-skills/pdf/scripts/check_fillable_fields.py +12 -0
- package/.github/skills/document-skills/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/.github/skills/document-skills/pdf/scripts/create_validation_image.py +41 -0
- package/.github/skills/document-skills/pdf/scripts/extract_form_field_info.py +152 -0
- package/.github/skills/document-skills/pdf/scripts/fill_fillable_fields.py +114 -0
- package/.github/skills/document-skills/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/.github/skills/document-skills/pptx/LICENSE.txt +30 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/mce/mc.xsd +75 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +560 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +67 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +14 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/.github/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/pack.py +159 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/unpack.py +29 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/validate.py +69 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/validation/base.py +951 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/.github/skills/document-skills/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/.github/skills/document-skills/pptx/scripts/html2pptx.js +979 -0
- package/.github/skills/document-skills/pptx/scripts/inventory.py +1020 -0
- package/.github/skills/document-skills/pptx/scripts/rearrange.py +231 -0
- package/.github/skills/document-skills/pptx/scripts/replace.py +385 -0
- package/.github/skills/document-skills/pptx/scripts/thumbnail.py +450 -0
- package/.github/skills/document-skills/xlsx/LICENSE.txt +30 -0
- package/.github/skills/document-skills/xlsx/recalc.py +190 -0
- package/.github/skills/install.ps1 +1220 -0
- package/.github/skills/install.sh +1032 -0
- package/.github/skills/markdown-novel-viewer/assets/directory-browser.css +215 -0
- package/.github/skills/markdown-novel-viewer/assets/favicon.png +0 -0
- package/.github/skills/markdown-novel-viewer/assets/novel-theme.css +818 -0
- package/.github/skills/markdown-novel-viewer/assets/reader.js +262 -0
- package/.github/skills/markdown-novel-viewer/assets/template.html +80 -0
- package/.github/skills/markdown-novel-viewer/package-lock.json +146 -0
- package/.github/skills/markdown-novel-viewer/package.json +15 -0
- package/.github/skills/markdown-novel-viewer/scripts/lib/http-server.cjs +434 -0
- package/.github/skills/markdown-novel-viewer/scripts/lib/markdown-renderer.cjs +272 -0
- package/.github/skills/markdown-novel-viewer/scripts/lib/plan-navigator.cjs +509 -0
- package/.github/skills/markdown-novel-viewer/scripts/lib/port-finder.cjs +48 -0
- package/.github/skills/markdown-novel-viewer/scripts/lib/process-mgr.cjs +150 -0
- package/.github/skills/markdown-novel-viewer/scripts/server.cjs +411 -0
- package/.github/skills/mcp-builder/LICENSE.txt +202 -0
- package/.github/skills/mcp-builder/scripts/connections.py +151 -0
- package/.github/skills/mcp-builder/scripts/evaluation.py +373 -0
- package/.github/skills/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/.github/skills/mcp-builder/scripts/requirements.txt +2 -0
- package/.github/skills/mcp-management/README.md +219 -0
- package/.github/skills/mcp-management/assets/tools.json +3146 -0
- package/.github/skills/mcp-management/package-lock.json +6 -0
- package/.github/skills/mcp-management/scripts/.env.example +10 -0
- package/.github/skills/mcp-management/scripts/cli.ts +195 -0
- package/.github/skills/mcp-management/scripts/dist/analyze-tools.js +70 -0
- package/.github/skills/mcp-management/scripts/dist/cli.js +160 -0
- package/.github/skills/mcp-management/scripts/dist/mcp-client.js +183 -0
- package/.github/skills/mcp-management/scripts/mcp-client.ts +230 -0
- package/.github/skills/mcp-management/scripts/package.json +20 -0
- package/.github/skills/media-processing/scripts/README.md +111 -0
- package/.github/skills/media-processing/scripts/batch-remove-background.sh +124 -0
- package/.github/skills/media-processing/scripts/batch_resize.py +342 -0
- package/.github/skills/media-processing/scripts/media_convert.py +311 -0
- package/.github/skills/media-processing/scripts/remove-background.sh +96 -0
- package/.github/skills/media-processing/scripts/remove-bg-node.js +158 -0
- package/.github/skills/media-processing/scripts/requirements.txt +24 -0
- package/.github/skills/media-processing/scripts/video_optimize.py +414 -0
- package/.github/skills/payment-integration/README.md +185 -0
- package/.github/skills/payment-integration/scripts/.env.example +20 -0
- package/.github/skills/payment-integration/scripts/checkout-helper.js +244 -0
- package/.github/skills/payment-integration/scripts/package.json +17 -0
- package/.github/skills/payment-integration/scripts/polar-webhook-verify.js +202 -0
- package/.github/skills/payment-integration/scripts/sepay-webhook-verify.js +193 -0
- package/.github/skills/payment-integration/scripts/test-scripts.js +237 -0
- package/.github/skills/plans-kanban/assets/dashboard-template.html +119 -0
- package/.github/skills/plans-kanban/assets/dashboard.css +1594 -0
- package/.github/skills/plans-kanban/assets/dashboard.js +596 -0
- package/.github/skills/plans-kanban/assets/favicon.png +0 -0
- package/.github/skills/plans-kanban/package-lock.json +123 -0
- package/.github/skills/plans-kanban/package.json +13 -0
- package/.github/skills/plans-kanban/scripts/lib/dashboard-renderer.cjs +884 -0
- package/.github/skills/plans-kanban/scripts/lib/http-server.cjs +310 -0
- package/.github/skills/plans-kanban/scripts/lib/plan-metadata-extractor.cjs +489 -0
- package/.github/skills/plans-kanban/scripts/lib/plan-parser.cjs +175 -0
- package/.github/skills/plans-kanban/scripts/lib/plan-scanner.cjs +272 -0
- package/.github/skills/plans-kanban/scripts/lib/port-finder.cjs +48 -0
- package/.github/skills/plans-kanban/scripts/lib/process-mgr.cjs +128 -0
- package/.github/skills/plans-kanban/scripts/server.cjs +260 -0
- package/.github/skills/repomix/scripts/.coverage +0 -0
- package/.github/skills/repomix/scripts/README.md +179 -0
- package/.github/skills/repomix/scripts/repomix_batch.py +455 -0
- package/.github/skills/repomix/scripts/repos.example.json +15 -0
- package/.github/skills/repomix/scripts/requirements.txt +15 -0
- package/.github/skills/scout-validation/scripts/lib/broad-pattern-detector.cjs +124 -0
- package/.github/skills/scout-validation/scripts/lib/path-checker.cjs +66 -0
- package/.github/skills/scout-validation/scripts/lib/schema-validator.cjs +45 -0
- package/.github/skills/scout-validation/scripts/package.json +11 -0
- package/.github/skills/scout-validation/scripts/validate-scout-output.cjs +219 -0
- package/.github/skills/scout-validation/test/broad-pattern-output.json +18 -0
- package/.github/skills/scout-validation/test/invalid-path-output.json +18 -0
- package/.github/skills/scout-validation/test/valid-scout-output.json +26 -0
- package/.github/skills/sequential-thinking/.env.example +8 -0
- package/.github/skills/sequential-thinking/README.md +183 -0
- package/.github/skills/sequential-thinking/package.json +31 -0
- package/.github/skills/sequential-thinking/scripts/format-thought.js +159 -0
- package/.github/skills/sequential-thinking/scripts/process-thought.js +236 -0
- package/.github/skills/shopify/README.md +66 -0
- package/.github/skills/shopify/scripts/.coverage +0 -0
- package/.github/skills/shopify/scripts/requirements.txt +19 -0
- package/.github/skills/shopify/scripts/shopify_init.py +423 -0
- package/.github/skills/skill-creator/LICENSE.txt +202 -0
- package/.github/skills/skill-creator/scripts/init_skill.py +303 -0
- package/.github/skills/skill-creator/scripts/package_skill.py +110 -0
- package/.github/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/.github/skills/ui-styling/LICENSE.txt +202 -0
- package/.github/skills/ui-styling/canvas-fonts/ArsenalSC-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/ArsenalSC-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/BigShoulders-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/BigShoulders-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/BigShoulders-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Boldonse-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Boldonse-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/BricolageGrotesque-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/CrimsonPro-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/CrimsonPro-Italic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/CrimsonPro-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/CrimsonPro-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/DMMono-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/DMMono-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/EricaOne-OFL.txt +94 -0
- package/.github/skills/ui-styling/canvas-fonts/EricaOne-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/GeistMono-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/GeistMono-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/GeistMono-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Gloock-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Gloock-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/IBMPlexMono-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/IBMPlexMono-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/IBMPlexMono-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/IBMPlexSerif-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/IBMPlexSerif-BoldItalic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/IBMPlexSerif-Italic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/IBMPlexSerif-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/InstrumentSans-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Italiana-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Italiana-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/JetBrainsMono-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Jura-Light.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Jura-Medium.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Jura-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/LibreBaskerville-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/LibreBaskerville-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Lora-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Lora-BoldItalic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Lora-Italic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Lora-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Lora-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/NationalPark-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/NationalPark-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/NationalPark-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/NothingYouCouldDo-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Outfit-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Outfit-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Outfit-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/PixelifySans-Medium.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/PixelifySans-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/PoiretOne-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/PoiretOne-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/RedHatMono-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/RedHatMono-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/RedHatMono-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Silkscreen-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Silkscreen-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/SmoochSans-Medium.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/SmoochSans-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Tektur-Medium.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/Tektur-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/Tektur-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/WorkSans-Bold.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/WorkSans-BoldItalic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/WorkSans-Italic.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/WorkSans-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/WorkSans-Regular.ttf +0 -0
- package/.github/skills/ui-styling/canvas-fonts/YoungSerif-OFL.txt +93 -0
- package/.github/skills/ui-styling/canvas-fonts/YoungSerif-Regular.ttf +0 -0
- package/.github/skills/ui-styling/scripts/.coverage +0 -0
- package/.github/skills/ui-styling/scripts/requirements.txt +17 -0
- package/.github/skills/ui-styling/scripts/shadcn_add.py +292 -0
- package/.github/skills/ui-styling/scripts/tailwind_config_gen.py +456 -0
- package/.github/skills/ui-ux-pro-max/data/charts.csv +26 -0
- package/.github/skills/ui-ux-pro-max/data/colors.csv +97 -0
- package/.github/skills/ui-ux-pro-max/data/landing.csv +31 -0
- package/.github/skills/ui-ux-pro-max/data/products.csv +97 -0
- package/.github/skills/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/html-tailwind.csv +51 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.github/skills/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.github/skills/ui-ux-pro-max/data/styles.csv +59 -0
- package/.github/skills/ui-ux-pro-max/data/typography.csv +58 -0
- package/.github/skills/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.github/skills/ui-ux-pro-max/scripts/core.py +236 -0
- package/.github/skills/ui-ux-pro-max/scripts/search.py +76 -0
- package/.github/skills/web-frameworks/scripts/.coverage +0 -0
- package/.github/skills/web-frameworks/scripts/__init__.py +0 -0
- package/.github/skills/web-frameworks/scripts/nextjs_init.py +547 -0
- package/.github/skills/web-frameworks/scripts/requirements.txt +16 -0
- package/.github/skills/web-frameworks/scripts/turborepo_migrate.py +394 -0
- package/dist/config/constants.d.ts +2 -0
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +4 -1
- package/dist/config/constants.js.map +1 -1
- package/dist/domains/github/github-client.d.ts +5 -0
- package/dist/domains/github/github-client.d.ts.map +1 -1
- package/dist/domains/github/github-client.js +44 -0
- package/dist/domains/github/github-client.js.map +1 -1
- package/dist/utils/downloader.d.ts +3 -1
- package/dist/utils/downloader.d.ts.map +1 -1
- package/dist/utils/downloader.js +48 -11
- package/dist/utils/downloader.js.map +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Common Skill Utilities
|
|
2
|
+
|
|
3
|
+
This directory contains shared utilities used across multiple skills.
|
|
4
|
+
|
|
5
|
+
## API Key Helper
|
|
6
|
+
|
|
7
|
+
`api_key_helper.py` provides standardized configuration for all Gemini-based skills, supporting both Google AI Studio and Vertex AI endpoints.
|
|
8
|
+
|
|
9
|
+
### Usage in Skills
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
import sys
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
# Add common directory to path
|
|
16
|
+
common_dir = Path(__file__).parent.parent.parent / 'common'
|
|
17
|
+
sys.path.insert(0, str(common_dir))
|
|
18
|
+
|
|
19
|
+
from api_key_helper import get_api_key_or_exit
|
|
20
|
+
|
|
21
|
+
# Get API key with automatic error handling
|
|
22
|
+
api_key = get_api_key_or_exit()
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### API Key Lookup Order
|
|
26
|
+
|
|
27
|
+
The helper checks for `GEMINI_API_KEY` in this order:
|
|
28
|
+
|
|
29
|
+
1. **Process environment variable** (recommended for development)
|
|
30
|
+
```bash
|
|
31
|
+
export GEMINI_API_KEY='your-api-key'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
2. **Project root `.env` file**
|
|
35
|
+
```bash
|
|
36
|
+
echo 'GEMINI_API_KEY=your-api-key' > .env
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. **.claude/.env file**
|
|
40
|
+
```bash
|
|
41
|
+
echo 'GEMINI_API_KEY=your-api-key' > %USERPROFILE%/.claude/.env
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
4. **.claude/skills/.env file** (shared across all Gemini skills)
|
|
45
|
+
```bash
|
|
46
|
+
echo 'GEMINI_API_KEY=your-api-key' > %USERPROFILE%/.claude/skills/.env
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
5. **Skill directory `.env` file**
|
|
50
|
+
```bash
|
|
51
|
+
echo 'GEMINI_API_KEY=your-api-key' > %USERPROFILE%/.claude/skills/your-skill/.env
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Vertex AI Support
|
|
55
|
+
|
|
56
|
+
To use Vertex AI instead of Google AI Studio:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Enable Vertex AI
|
|
60
|
+
export GEMINI_USE_VERTEX=true
|
|
61
|
+
export VERTEX_PROJECT_ID=your-gcp-project-id
|
|
62
|
+
export VERTEX_LOCATION=us-central1 # Optional, defaults to us-central1
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Or in `.env` file:
|
|
66
|
+
```
|
|
67
|
+
GEMINI_USE_VERTEX=true
|
|
68
|
+
VERTEX_PROJECT_ID=your-gcp-project-id
|
|
69
|
+
VERTEX_LOCATION=us-central1
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Using get_client() Helper
|
|
73
|
+
|
|
74
|
+
For automatic client selection (AI Studio or Vertex AI):
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
from api_key_helper import get_client
|
|
78
|
+
|
|
79
|
+
# Get appropriate client based on configuration
|
|
80
|
+
client_info = get_client()
|
|
81
|
+
|
|
82
|
+
if client_info['type'] == 'vertex':
|
|
83
|
+
# Using Vertex AI
|
|
84
|
+
from vertexai.generative_models import GenerativeModel
|
|
85
|
+
model = GenerativeModel('gemini-2.5-flash')
|
|
86
|
+
response = model.generate_content("Hello")
|
|
87
|
+
else:
|
|
88
|
+
# Using AI Studio
|
|
89
|
+
client = client_info['client']
|
|
90
|
+
response = client.models.generate_content(
|
|
91
|
+
model='gemini-2.5-flash',
|
|
92
|
+
contents="Hello"
|
|
93
|
+
)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Using get_vertex_config() Helper
|
|
97
|
+
|
|
98
|
+
For checking Vertex AI configuration:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
from api_key_helper import get_vertex_config
|
|
102
|
+
|
|
103
|
+
vertex_config = get_vertex_config()
|
|
104
|
+
if vertex_config['use_vertex']:
|
|
105
|
+
print(f"Using Vertex AI")
|
|
106
|
+
print(f"Project: {vertex_config['project_id']}")
|
|
107
|
+
print(f"Location: {vertex_config['location']}")
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Error Handling
|
|
111
|
+
|
|
112
|
+
If the API key is not found, the helper will:
|
|
113
|
+
- Print a clear error message
|
|
114
|
+
- Show all available methods to set the API key
|
|
115
|
+
- Provide the URL to obtain an API key
|
|
116
|
+
- Exit with status code 1
|
|
117
|
+
|
|
118
|
+
For Vertex AI, if `VERTEX_PROJECT_ID` is missing when `GEMINI_USE_VERTEX=true`, the helper will provide clear instructions.
|
|
119
|
+
|
|
120
|
+
This ensures users get immediate, actionable feedback when configuration is missing.
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Common API Key Detection Helper for Gemini Skills
|
|
4
|
+
|
|
5
|
+
Supports both Google AI Studio and Vertex AI endpoints.
|
|
6
|
+
|
|
7
|
+
API Key Detection Order:
|
|
8
|
+
1. Process environment variable
|
|
9
|
+
2. Project root .env file
|
|
10
|
+
3. ./.claude/.env
|
|
11
|
+
4. ./.claude/skills/.env
|
|
12
|
+
5. Skill directory .env file
|
|
13
|
+
|
|
14
|
+
Vertex AI Configuration:
|
|
15
|
+
- GEMINI_USE_VERTEX: Set to "true" to use Vertex AI endpoint
|
|
16
|
+
- VERTEX_PROJECT_ID: GCP project ID (required for Vertex AI)
|
|
17
|
+
- VERTEX_LOCATION: GCP region (default: us-central1)
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
import os
|
|
21
|
+
import re
|
|
22
|
+
import sys
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
from typing import Optional, Dict, Any, List
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def find_api_key(skill_dir: Optional[Path] = None) -> Optional[str]:
|
|
28
|
+
"""
|
|
29
|
+
Find GEMINI_API_KEY using 5-step lookup:
|
|
30
|
+
1. Process environment
|
|
31
|
+
2. Project root .env
|
|
32
|
+
3. ./.claude/.env
|
|
33
|
+
4. ./.claude/skills/.env
|
|
34
|
+
5. Skill directory .env
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
skill_dir: Path to skill directory (optional, auto-detected if None)
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
API key string or None if not found
|
|
41
|
+
"""
|
|
42
|
+
# Step 1: Check process environment
|
|
43
|
+
api_key = os.getenv('GEMINI_API_KEY')
|
|
44
|
+
if api_key:
|
|
45
|
+
print("ā Using API key from environment variable", file=sys.stderr)
|
|
46
|
+
return api_key
|
|
47
|
+
|
|
48
|
+
# Determine paths
|
|
49
|
+
if skill_dir is None:
|
|
50
|
+
skill_dir = Path(__file__).parent.parent
|
|
51
|
+
project_dir = skill_dir.parent.parent.parent # 3 levels up from skill dir
|
|
52
|
+
|
|
53
|
+
# Step 2: Check project root .env
|
|
54
|
+
project_env = project_dir / '.env'
|
|
55
|
+
if project_env.exists():
|
|
56
|
+
api_key = load_env_file(project_env)
|
|
57
|
+
if api_key:
|
|
58
|
+
print(f"ā Using API key from {project_env}", file=sys.stderr)
|
|
59
|
+
return api_key
|
|
60
|
+
|
|
61
|
+
# Step 3: Check ./.claude/.env
|
|
62
|
+
claude_env = project_dir / '.claude' / '.env'
|
|
63
|
+
if claude_env.exists():
|
|
64
|
+
api_key = load_env_file(claude_env)
|
|
65
|
+
if api_key:
|
|
66
|
+
print(f"ā Using API key from {claude_env}", file=sys.stderr)
|
|
67
|
+
return api_key
|
|
68
|
+
|
|
69
|
+
# Step 4: Check ./.claude/skills/.env
|
|
70
|
+
claude_skills_env = project_dir / '.claude' / 'skills' / '.env'
|
|
71
|
+
if claude_skills_env.exists():
|
|
72
|
+
api_key = load_env_file(claude_skills_env)
|
|
73
|
+
if api_key:
|
|
74
|
+
print(f"ā Using API key from {claude_skills_env}", file=sys.stderr)
|
|
75
|
+
return api_key
|
|
76
|
+
|
|
77
|
+
# Step 5: Check skill directory .env
|
|
78
|
+
skill_env = skill_dir / '.env'
|
|
79
|
+
if skill_env.exists():
|
|
80
|
+
api_key = load_env_file(skill_env)
|
|
81
|
+
if api_key:
|
|
82
|
+
print(f"ā Using API key from {skill_env}", file=sys.stderr)
|
|
83
|
+
return api_key
|
|
84
|
+
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def load_env_file(env_path: Path) -> Optional[str]:
|
|
89
|
+
"""
|
|
90
|
+
Load GEMINI_API_KEY from .env file
|
|
91
|
+
|
|
92
|
+
Args:
|
|
93
|
+
env_path: Path to .env file
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
API key or None
|
|
97
|
+
"""
|
|
98
|
+
try:
|
|
99
|
+
with open(env_path, 'r') as f:
|
|
100
|
+
for line in f:
|
|
101
|
+
line = line.strip()
|
|
102
|
+
if line.startswith('GEMINI_API_KEY='):
|
|
103
|
+
# Extract value, removing quotes if present
|
|
104
|
+
value = line.split('=', 1)[1].strip()
|
|
105
|
+
value = value.strip('"').strip("'")
|
|
106
|
+
if value:
|
|
107
|
+
return value
|
|
108
|
+
except Exception as e:
|
|
109
|
+
print(f"Warning: Error reading {env_path}: {e}", file=sys.stderr)
|
|
110
|
+
|
|
111
|
+
return None
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def load_env_var(env_path: Path, var_name: str) -> Optional[str]:
|
|
115
|
+
"""
|
|
116
|
+
Load a specific environment variable from .env file
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
env_path: Path to .env file
|
|
120
|
+
var_name: Name of the environment variable
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
Variable value or None
|
|
124
|
+
"""
|
|
125
|
+
try:
|
|
126
|
+
with open(env_path, 'r') as f:
|
|
127
|
+
for line in f:
|
|
128
|
+
line = line.strip()
|
|
129
|
+
if line.startswith(f'{var_name}='):
|
|
130
|
+
value = line.split('=', 1)[1].strip()
|
|
131
|
+
value = value.strip('"').strip("'")
|
|
132
|
+
if value:
|
|
133
|
+
return value
|
|
134
|
+
except Exception as e:
|
|
135
|
+
print(f"Warning: Error reading {env_path}: {e}", file=sys.stderr)
|
|
136
|
+
|
|
137
|
+
return None
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def find_env_var(var_name: str, skill_dir: Optional[Path] = None) -> Optional[str]:
|
|
141
|
+
"""
|
|
142
|
+
Find environment variable using 5-step lookup (same as API key)
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
var_name: Name of environment variable
|
|
146
|
+
skill_dir: Path to skill directory (optional)
|
|
147
|
+
|
|
148
|
+
Returns:
|
|
149
|
+
Variable value or None
|
|
150
|
+
"""
|
|
151
|
+
# Step 1: Check process environment
|
|
152
|
+
value = os.getenv(var_name)
|
|
153
|
+
if value:
|
|
154
|
+
return value
|
|
155
|
+
|
|
156
|
+
# Determine paths
|
|
157
|
+
if skill_dir is None:
|
|
158
|
+
skill_dir = Path(__file__).parent.parent
|
|
159
|
+
project_dir = skill_dir.parent.parent.parent
|
|
160
|
+
|
|
161
|
+
# Step 2-5: Check .env files in order
|
|
162
|
+
env_files = [
|
|
163
|
+
project_dir / '.env',
|
|
164
|
+
project_dir / '.claude' / '.env',
|
|
165
|
+
project_dir / '.claude' / 'skills' / '.env',
|
|
166
|
+
skill_dir / '.env'
|
|
167
|
+
]
|
|
168
|
+
|
|
169
|
+
for env_path in env_files:
|
|
170
|
+
if env_path.exists():
|
|
171
|
+
value = load_env_var(env_path, var_name)
|
|
172
|
+
if value:
|
|
173
|
+
return value
|
|
174
|
+
|
|
175
|
+
return None
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def find_all_api_keys(skill_dir: Optional[Path] = None) -> List[str]:
|
|
179
|
+
"""
|
|
180
|
+
Find all Gemini API keys for rotation.
|
|
181
|
+
|
|
182
|
+
Searches for:
|
|
183
|
+
- GEMINI_API_KEY (primary, required)
|
|
184
|
+
- GEMINI_API_KEY_2, GEMINI_API_KEY_3, ... (additional, optional)
|
|
185
|
+
|
|
186
|
+
Uses the same 5-step lookup as find_api_key().
|
|
187
|
+
|
|
188
|
+
Args:
|
|
189
|
+
skill_dir: Path to skill directory (optional, auto-detected if None)
|
|
190
|
+
|
|
191
|
+
Returns:
|
|
192
|
+
List of API keys (may be empty if none found)
|
|
193
|
+
"""
|
|
194
|
+
keys: List[str] = []
|
|
195
|
+
seen: set = set() # Deduplicate keys
|
|
196
|
+
|
|
197
|
+
# Determine paths
|
|
198
|
+
if skill_dir is None:
|
|
199
|
+
skill_dir = Path(__file__).parent.parent
|
|
200
|
+
project_dir = skill_dir.parent.parent.parent
|
|
201
|
+
|
|
202
|
+
# Collect all .env file paths in priority order
|
|
203
|
+
env_files = [
|
|
204
|
+
project_dir / '.env',
|
|
205
|
+
project_dir / '.claude' / '.env',
|
|
206
|
+
project_dir / '.claude' / 'skills' / '.env',
|
|
207
|
+
skill_dir / '.env'
|
|
208
|
+
]
|
|
209
|
+
|
|
210
|
+
def add_key(key: Optional[str]) -> None:
|
|
211
|
+
"""Add key if valid and not duplicate."""
|
|
212
|
+
if key and key not in seen:
|
|
213
|
+
seen.add(key)
|
|
214
|
+
keys.append(key)
|
|
215
|
+
|
|
216
|
+
# Step 1: Check process environment for all GEMINI_API_KEY* vars
|
|
217
|
+
for env_key, value in os.environ.items():
|
|
218
|
+
if env_key == 'GEMINI_API_KEY' or re.match(r'^GEMINI_API_KEY_\d+$', env_key):
|
|
219
|
+
add_key(value)
|
|
220
|
+
|
|
221
|
+
# Step 2-5: Check .env files
|
|
222
|
+
for env_path in env_files:
|
|
223
|
+
if not env_path.exists():
|
|
224
|
+
continue
|
|
225
|
+
|
|
226
|
+
# Load all GEMINI_API_KEY* from this file
|
|
227
|
+
file_keys = _load_all_api_keys_from_file(env_path)
|
|
228
|
+
for key in file_keys:
|
|
229
|
+
add_key(key)
|
|
230
|
+
|
|
231
|
+
return keys
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def _load_all_api_keys_from_file(env_path: Path) -> List[str]:
|
|
235
|
+
"""
|
|
236
|
+
Load all GEMINI_API_KEY* variables from an .env file.
|
|
237
|
+
|
|
238
|
+
Args:
|
|
239
|
+
env_path: Path to .env file
|
|
240
|
+
|
|
241
|
+
Returns:
|
|
242
|
+
List of API keys found in the file
|
|
243
|
+
"""
|
|
244
|
+
keys: List[str] = []
|
|
245
|
+
pattern = re.compile(r'^GEMINI_API_KEY(_\d+)?=(.+)$')
|
|
246
|
+
|
|
247
|
+
try:
|
|
248
|
+
with open(env_path, 'r') as f:
|
|
249
|
+
for line in f:
|
|
250
|
+
line = line.strip()
|
|
251
|
+
if line.startswith('#') or not line:
|
|
252
|
+
continue
|
|
253
|
+
|
|
254
|
+
match = pattern.match(line)
|
|
255
|
+
if match:
|
|
256
|
+
value = match.group(2).strip()
|
|
257
|
+
# Remove quotes if present
|
|
258
|
+
value = value.strip('"').strip("'")
|
|
259
|
+
if value and value != 'your_api_key_here':
|
|
260
|
+
keys.append(value)
|
|
261
|
+
except Exception as e:
|
|
262
|
+
print(f"Warning: Error reading {env_path}: {e}", file=sys.stderr)
|
|
263
|
+
|
|
264
|
+
return keys
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
def get_key_rotator(skill_dir: Optional[Path] = None, verbose: bool = False):
|
|
268
|
+
"""
|
|
269
|
+
Get a KeyRotator instance with all available API keys.
|
|
270
|
+
|
|
271
|
+
Args:
|
|
272
|
+
skill_dir: Path to skill directory (optional)
|
|
273
|
+
verbose: Whether to enable verbose logging
|
|
274
|
+
|
|
275
|
+
Returns:
|
|
276
|
+
KeyRotator instance or None if no keys found
|
|
277
|
+
"""
|
|
278
|
+
# Import here to avoid circular dependency
|
|
279
|
+
from api_key_rotator import KeyRotator
|
|
280
|
+
|
|
281
|
+
keys = find_all_api_keys(skill_dir)
|
|
282
|
+
if not keys:
|
|
283
|
+
return None
|
|
284
|
+
|
|
285
|
+
return KeyRotator(keys=keys, verbose=verbose)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def get_vertex_config(skill_dir: Optional[Path] = None) -> Dict[str, Any]:
|
|
289
|
+
"""
|
|
290
|
+
Get Vertex AI configuration from environment variables
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
skill_dir: Path to skill directory (optional)
|
|
294
|
+
|
|
295
|
+
Returns:
|
|
296
|
+
Dictionary with Vertex AI configuration:
|
|
297
|
+
{
|
|
298
|
+
'use_vertex': bool,
|
|
299
|
+
'project_id': str or None,
|
|
300
|
+
'location': str (default: 'us-central1')
|
|
301
|
+
}
|
|
302
|
+
"""
|
|
303
|
+
use_vertex_str = find_env_var('GEMINI_USE_VERTEX', skill_dir)
|
|
304
|
+
use_vertex = use_vertex_str and use_vertex_str.lower() in ('true', '1', 'yes')
|
|
305
|
+
|
|
306
|
+
config = {
|
|
307
|
+
'use_vertex': use_vertex,
|
|
308
|
+
'project_id': find_env_var('VERTEX_PROJECT_ID', skill_dir) if use_vertex else None,
|
|
309
|
+
'location': find_env_var('VERTEX_LOCATION', skill_dir) or 'us-central1'
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
return config
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
def get_api_key_or_exit(skill_dir: Optional[Path] = None) -> str:
|
|
316
|
+
"""
|
|
317
|
+
Get API key or exit with helpful error message
|
|
318
|
+
|
|
319
|
+
Args:
|
|
320
|
+
skill_dir: Path to skill directory (optional, auto-detected if None)
|
|
321
|
+
|
|
322
|
+
Returns:
|
|
323
|
+
API key string
|
|
324
|
+
"""
|
|
325
|
+
api_key = find_api_key(skill_dir)
|
|
326
|
+
|
|
327
|
+
if not api_key:
|
|
328
|
+
print("\nā Error: GEMINI_API_KEY not found!", file=sys.stderr)
|
|
329
|
+
print("\nš Please set your API key using one of these methods (in priority order):", file=sys.stderr)
|
|
330
|
+
|
|
331
|
+
if skill_dir is None:
|
|
332
|
+
skill_dir = Path(__file__).parent.parent
|
|
333
|
+
project_dir = skill_dir.parent.parent.parent
|
|
334
|
+
|
|
335
|
+
print("\n1ļøā£ Environment variable (recommended for development):", file=sys.stderr)
|
|
336
|
+
print(" export GEMINI_API_KEY='your-api-key'", file=sys.stderr)
|
|
337
|
+
|
|
338
|
+
print("\n2ļøā£ Project root .env file:", file=sys.stderr)
|
|
339
|
+
print(f" echo 'GEMINI_API_KEY=your-api-key' > {project_dir}/.env", file=sys.stderr)
|
|
340
|
+
|
|
341
|
+
print("\n3ļøā£ .claude/.env file:", file=sys.stderr)
|
|
342
|
+
print(f" echo 'GEMINI_API_KEY=your-api-key' > {project_dir}/.claude/.env", file=sys.stderr)
|
|
343
|
+
|
|
344
|
+
print("\n4ļøā£ .claude/skills/.env file (shared across all Gemini skills):", file=sys.stderr)
|
|
345
|
+
print(f" echo 'GEMINI_API_KEY=your-api-key' > {project_dir}/.claude/skills/.env", file=sys.stderr)
|
|
346
|
+
|
|
347
|
+
print("\n5ļøā£ Skill directory .env file:", file=sys.stderr)
|
|
348
|
+
print(f" echo 'GEMINI_API_KEY=your-api-key' > {skill_dir}/.env", file=sys.stderr)
|
|
349
|
+
|
|
350
|
+
print("\nš Get your API key at: https://aistudio.google.com/apikey", file=sys.stderr)
|
|
351
|
+
print("\nš” Tip: Add .env files to .gitignore to avoid committing API keys", file=sys.stderr)
|
|
352
|
+
sys.exit(1)
|
|
353
|
+
|
|
354
|
+
return api_key
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def get_client(skill_dir: Optional[Path] = None):
|
|
358
|
+
"""
|
|
359
|
+
Get appropriate Gemini client (AI Studio or Vertex AI)
|
|
360
|
+
|
|
361
|
+
Args:
|
|
362
|
+
skill_dir: Path to skill directory (optional)
|
|
363
|
+
|
|
364
|
+
Returns:
|
|
365
|
+
genai.Client or vertexai client
|
|
366
|
+
"""
|
|
367
|
+
vertex_config = get_vertex_config(skill_dir)
|
|
368
|
+
|
|
369
|
+
if vertex_config['use_vertex']:
|
|
370
|
+
# Use Vertex AI
|
|
371
|
+
import vertexai
|
|
372
|
+
from vertexai.generative_models import GenerativeModel
|
|
373
|
+
|
|
374
|
+
if not vertex_config['project_id']:
|
|
375
|
+
print("\nā Error: VERTEX_PROJECT_ID required when GEMINI_USE_VERTEX=true!", file=sys.stderr)
|
|
376
|
+
print("\nš Set your GCP project ID:", file=sys.stderr)
|
|
377
|
+
print(" export VERTEX_PROJECT_ID='your-project-id'", file=sys.stderr)
|
|
378
|
+
print(" Or add to .env file: VERTEX_PROJECT_ID=your-project-id", file=sys.stderr)
|
|
379
|
+
sys.exit(1)
|
|
380
|
+
|
|
381
|
+
print(f"ā Using Vertex AI endpoint", file=sys.stderr)
|
|
382
|
+
print(f" Project: {vertex_config['project_id']}", file=sys.stderr)
|
|
383
|
+
print(f" Location: {vertex_config['location']}", file=sys.stderr)
|
|
384
|
+
|
|
385
|
+
vertexai.init(
|
|
386
|
+
project=vertex_config['project_id'],
|
|
387
|
+
location=vertex_config['location']
|
|
388
|
+
)
|
|
389
|
+
|
|
390
|
+
return {'type': 'vertex', 'config': vertex_config}
|
|
391
|
+
else:
|
|
392
|
+
# Use AI Studio
|
|
393
|
+
from google import genai
|
|
394
|
+
|
|
395
|
+
api_key = get_api_key_or_exit(skill_dir)
|
|
396
|
+
client = genai.Client(api_key=api_key)
|
|
397
|
+
|
|
398
|
+
return {'type': 'aistudio', 'client': client}
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
if __name__ == '__main__':
|
|
402
|
+
# Test the API key detection
|
|
403
|
+
api_key = get_api_key_or_exit()
|
|
404
|
+
print(f"ā Found API key: {api_key[:8]}..." + "*" * (len(api_key) - 8))
|
|
405
|
+
|
|
406
|
+
# Test Vertex AI config
|
|
407
|
+
vertex_config = get_vertex_config()
|
|
408
|
+
if vertex_config['use_vertex']:
|
|
409
|
+
print(f"\nā Vertex AI enabled:")
|
|
410
|
+
print(f" Project: {vertex_config['project_id']}")
|
|
411
|
+
print(f" Location: {vertex_config['location']}")
|