bps-kit 1.0.1 → 1.0.2
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/package.json +1 -1
- package/templates/.agents/agents/backend-specialist.md +263 -0
- package/templates/.agents/agents/code-archaeologist.md +106 -0
- package/templates/.agents/agents/database-architect.md +226 -0
- package/templates/.agents/agents/debugger.md +225 -0
- package/templates/.agents/agents/devops-engineer.md +242 -0
- package/templates/.agents/agents/documentation-writer.md +104 -0
- package/templates/.agents/agents/explorer-agent.md +73 -0
- package/templates/.agents/agents/frontend-specialist.md +593 -0
- package/templates/.agents/agents/game-developer.md +162 -0
- package/templates/.agents/agents/mobile-developer.md +377 -0
- package/templates/.agents/agents/orchestrator.md +416 -0
- package/templates/.agents/agents/penetration-tester.md +188 -0
- package/templates/.agents/agents/performance-optimizer.md +187 -0
- package/templates/.agents/agents/product-manager.md +112 -0
- package/templates/.agents/agents/product-owner.md +95 -0
- package/templates/.agents/agents/project-planner.md +406 -0
- package/templates/.agents/agents/qa-automation-engineer.md +103 -0
- package/templates/.agents/agents/security-auditor.md +170 -0
- package/templates/.agents/agents/seo-specialist.md +111 -0
- package/templates/.agents/agents/test-engineer.md +158 -0
- package/templates/.agents/rules/GEMINI.md +219 -0
- package/templates/.agents/scripts/auto_preview.py +148 -0
- package/templates/.agents/scripts/checklist.py +217 -0
- package/templates/.agents/scripts/session_manager.py +120 -0
- package/templates/.agents/scripts/verify_all.py +327 -0
- package/templates/.agents/workflows/brainstorm.md +113 -0
- package/templates/.agents/workflows/create.md +59 -0
- package/templates/.agents/workflows/debug.md +103 -0
- package/templates/.agents/workflows/deploy.md +176 -0
- package/templates/.agents/workflows/enhance.md +63 -0
- package/templates/.agents/workflows/orchestrate.md +237 -0
- package/templates/.agents/workflows/plan.md +89 -0
- package/templates/.agents/workflows/preview.md +81 -0
- package/templates/.agents/workflows/setup-brain.md +39 -0
- package/templates/.agents/workflows/status.md +86 -0
- package/templates/.agents/workflows/test.md +144 -0
- package/templates/.agents/workflows/ui-ux-pro-max.md +296 -0
- package/templates/skills_normal/api-patterns/scripts/api_validator.py +211 -0
- package/templates/skills_normal/database-design/scripts/schema_validator.py +172 -0
- package/templates/skills_normal/frontend-design/scripts/accessibility_checker.py +183 -0
- package/templates/skills_normal/frontend-design/scripts/ux_audit.py +722 -0
- package/templates/skills_normal/git-pushing/scripts/smart_commit.sh +19 -0
- package/templates/skills_normal/lint-and-validate/scripts/lint_runner.py +184 -0
- package/templates/skills_normal/lint-and-validate/scripts/type_coverage.py +173 -0
- package/templates/skills_normal/performance-profiling/scripts/lighthouse_audit.py +76 -0
- package/templates/skills_normal/senior-fullstack/scripts/code_quality_analyzer.py +114 -0
- package/templates/skills_normal/senior-fullstack/scripts/fullstack_scaffolder.py +114 -0
- package/templates/skills_normal/senior-fullstack/scripts/project_scaffolder.py +114 -0
- package/templates/skills_normal/seo-fundamentals/scripts/seo_checker.py +219 -0
- package/templates/skills_normal/testing-patterns/scripts/test_runner.py +219 -0
- package/templates/skills_normal/vulnerability-scanner/scripts/security_scan.py +458 -0
- package/templates/vault/007/scripts/config.py +472 -0
- package/templates/vault/007/scripts/full_audit.py +1306 -0
- package/templates/vault/007/scripts/quick_scan.py +481 -0
- package/templates/vault/007/scripts/requirements.txt +26 -0
- package/templates/vault/007/scripts/scanners/__init__.py +0 -0
- package/templates/vault/007/scripts/scanners/dependency_scanner.py +1305 -0
- package/templates/vault/007/scripts/scanners/injection_scanner.py +1104 -0
- package/templates/vault/007/scripts/scanners/secrets_scanner.py +1008 -0
- package/templates/vault/007/scripts/score_calculator.py +693 -0
- package/templates/vault/agent-orchestrator/scripts/match_skills.py +329 -0
- package/templates/vault/agent-orchestrator/scripts/orchestrate.py +304 -0
- package/templates/vault/agent-orchestrator/scripts/requirements.txt +1 -0
- package/templates/vault/agent-orchestrator/scripts/scan_registry.py +508 -0
- package/templates/vault/ai-studio-image/scripts/config.py +613 -0
- package/templates/vault/ai-studio-image/scripts/generate.py +630 -0
- package/templates/vault/ai-studio-image/scripts/prompt_engine.py +424 -0
- package/templates/vault/ai-studio-image/scripts/requirements.txt +4 -0
- package/templates/vault/ai-studio-image/scripts/templates.py +349 -0
- package/templates/vault/android_ui_verification/scripts/verify_ui.sh +32 -0
- package/templates/vault/apify-audience-analysis/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-brand-reputation-monitoring/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-competitor-intelligence/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-content-analytics/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-ecommerce/reference/scripts/package.json +3 -0
- package/templates/vault/apify-ecommerce/reference/scripts/run_actor.js +369 -0
- package/templates/vault/apify-influencer-discovery/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-lead-generation/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-market-research/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-trend-analysis/reference/scripts/run_actor.js +363 -0
- package/templates/vault/apify-ultimate-scraper/reference/scripts/run_actor.js +363 -0
- package/templates/vault/audio-transcriber/scripts/install-requirements.sh +190 -0
- package/templates/vault/audio-transcriber/scripts/transcribe.py +486 -0
- package/templates/vault/claude-monitor/scripts/api_bench.py +240 -0
- package/templates/vault/claude-monitor/scripts/config.py +69 -0
- package/templates/vault/claude-monitor/scripts/health_check.py +362 -0
- package/templates/vault/claude-monitor/scripts/monitor.py +296 -0
- package/templates/vault/content-creator/scripts/brand_voice_analyzer.py +185 -0
- package/templates/vault/content-creator/scripts/seo_optimizer.py +419 -0
- package/templates/vault/context-agent/scripts/active_context.py +227 -0
- package/templates/vault/context-agent/scripts/compressor.py +149 -0
- package/templates/vault/context-agent/scripts/config.py +69 -0
- package/templates/vault/context-agent/scripts/context_loader.py +155 -0
- package/templates/vault/context-agent/scripts/context_manager.py +302 -0
- package/templates/vault/context-agent/scripts/models.py +103 -0
- package/templates/vault/context-agent/scripts/project_registry.py +132 -0
- package/templates/vault/context-agent/scripts/requirements.txt +6 -0
- package/templates/vault/context-agent/scripts/search.py +115 -0
- package/templates/vault/context-agent/scripts/session_parser.py +206 -0
- package/templates/vault/context-agent/scripts/session_summary.py +319 -0
- package/templates/vault/context-guardian/scripts/context_snapshot.py +229 -0
- package/templates/vault/docx/ooxml/scripts/pack.py +159 -0
- package/templates/vault/docx/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/docx/ooxml/scripts/validate.py +69 -0
- package/templates/vault/docx/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/docx/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/docx/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/docx/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/docx/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/docx/scripts/__init__.py +1 -0
- package/templates/vault/docx/scripts/document.py +1276 -0
- package/templates/vault/docx/scripts/templates/comments.xml +3 -0
- package/templates/vault/docx/scripts/templates/commentsExtended.xml +3 -0
- package/templates/vault/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/templates/vault/docx/scripts/templates/commentsIds.xml +3 -0
- package/templates/vault/docx/scripts/templates/people.xml +3 -0
- package/templates/vault/docx/scripts/utilities.py +374 -0
- package/templates/vault/docx-official/ooxml/scripts/pack.py +159 -0
- package/templates/vault/docx-official/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/docx-official/ooxml/scripts/validate.py +69 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/docx-official/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/docx-official/scripts/__init__.py +1 -0
- package/templates/vault/docx-official/scripts/document.py +1276 -0
- package/templates/vault/docx-official/scripts/templates/comments.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/commentsExtended.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/commentsExtensible.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/commentsIds.xml +3 -0
- package/templates/vault/docx-official/scripts/templates/people.xml +3 -0
- package/templates/vault/docx-official/scripts/utilities.py +374 -0
- package/templates/vault/geo-fundamentals/scripts/geo_checker.py +289 -0
- package/templates/vault/helm-chart-scaffolding/scripts/validate-chart.sh +244 -0
- package/templates/vault/i18n-localization/scripts/i18n_checker.py +241 -0
- package/templates/vault/instagram/scripts/account_setup.py +233 -0
- package/templates/vault/instagram/scripts/analyze.py +221 -0
- package/templates/vault/instagram/scripts/api_client.py +444 -0
- package/templates/vault/instagram/scripts/auth.py +411 -0
- package/templates/vault/instagram/scripts/comments.py +160 -0
- package/templates/vault/instagram/scripts/config.py +111 -0
- package/templates/vault/instagram/scripts/db.py +467 -0
- package/templates/vault/instagram/scripts/export.py +138 -0
- package/templates/vault/instagram/scripts/governance.py +233 -0
- package/templates/vault/instagram/scripts/hashtags.py +114 -0
- package/templates/vault/instagram/scripts/insights.py +170 -0
- package/templates/vault/instagram/scripts/media.py +65 -0
- package/templates/vault/instagram/scripts/messages.py +103 -0
- package/templates/vault/instagram/scripts/profile.py +58 -0
- package/templates/vault/instagram/scripts/publish.py +449 -0
- package/templates/vault/instagram/scripts/requirements.txt +5 -0
- package/templates/vault/instagram/scripts/run_all.py +189 -0
- package/templates/vault/instagram/scripts/schedule.py +189 -0
- package/templates/vault/instagram/scripts/serve_api.py +234 -0
- package/templates/vault/instagram/scripts/templates.py +155 -0
- package/templates/vault/junta-leiloeiros/scripts/db.py +216 -0
- package/templates/vault/junta-leiloeiros/scripts/export.py +137 -0
- package/templates/vault/junta-leiloeiros/scripts/requirements.txt +15 -0
- package/templates/vault/junta-leiloeiros/scripts/run_all.py +190 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/__init__.py +4 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/base_scraper.py +209 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/generic_scraper.py +110 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucap.py +110 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/juceac.py +72 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/juceal.py +72 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/juceb.py +68 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucec.py +63 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucema.py +211 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucemg.py +218 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucep.py +70 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepa.py +74 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepar.py +80 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepe.py +78 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucepi.py +69 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucer.py +256 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucerja.py +170 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucern.py +71 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucesc.py +89 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucesp.py +233 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucetins.py +134 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucis_df.py +63 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/jucisrs.py +299 -0
- package/templates/vault/junta-leiloeiros/scripts/scraper/states.py +99 -0
- package/templates/vault/junta-leiloeiros/scripts/serve_api.py +164 -0
- package/templates/vault/junta-leiloeiros/scripts/web_scraper_fallback.py +233 -0
- package/templates/vault/last30days/scripts/last30days.py +521 -0
- package/templates/vault/last30days/scripts/lib/__init__.py +1 -0
- package/templates/vault/last30days/scripts/lib/cache.py +152 -0
- package/templates/vault/last30days/scripts/lib/dates.py +124 -0
- package/templates/vault/last30days/scripts/lib/dedupe.py +120 -0
- package/templates/vault/last30days/scripts/lib/env.py +149 -0
- package/templates/vault/last30days/scripts/lib/http.py +152 -0
- package/templates/vault/last30days/scripts/lib/models.py +175 -0
- package/templates/vault/last30days/scripts/lib/normalize.py +160 -0
- package/templates/vault/last30days/scripts/lib/openai_reddit.py +230 -0
- package/templates/vault/last30days/scripts/lib/reddit_enrich.py +232 -0
- package/templates/vault/last30days/scripts/lib/render.py +383 -0
- package/templates/vault/last30days/scripts/lib/schema.py +336 -0
- package/templates/vault/last30days/scripts/lib/score.py +311 -0
- package/templates/vault/last30days/scripts/lib/ui.py +324 -0
- package/templates/vault/last30days/scripts/lib/websearch.py +401 -0
- package/templates/vault/last30days/scripts/lib/xai_x.py +217 -0
- package/templates/vault/leiloeiro-avaliacao/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-avaliacao/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-edital/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-edital/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-ia/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-ia/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-juridico/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-juridico/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-mercado/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-mercado/scripts/requirements.txt +1 -0
- package/templates/vault/leiloeiro-risco/scripts/governance.py +106 -0
- package/templates/vault/leiloeiro-risco/scripts/requirements.txt +1 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/database.ts +24 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/db.ts +35 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/index.ts +2 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/migrations.ts +31 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/db/schema.sql +8 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/index.ts +44 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/routes/todos.ts +155 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/backend/src/types/index.ts +35 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/App.css +384 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/App.tsx +81 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/api/todos.ts +57 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/ConfirmDialog.tsx +26 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/EmptyState.tsx +8 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/TodoForm.tsx +43 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/TodoItem.tsx +36 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/components/TodoList.tsx +27 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/hooks/useTodos.ts +81 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/index.css +48 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/main.tsx +10 -0
- package/templates/vault/loki-mode/examples/todo-app-generated/frontend/src/vite-env.d.ts +1 -0
- package/templates/vault/loki-mode/scripts/export-to-vibe-kanban.sh +178 -0
- package/templates/vault/loki-mode/scripts/loki-wrapper.sh +281 -0
- package/templates/vault/loki-mode/scripts/take-screenshots.js +55 -0
- package/templates/vault/matematico-tao/scripts/complexity_analyzer.py +544 -0
- package/templates/vault/matematico-tao/scripts/dependency_graph.py +538 -0
- package/templates/vault/mcp-builder/scripts/connections.py +151 -0
- package/templates/vault/mcp-builder/scripts/evaluation.py +373 -0
- package/templates/vault/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/templates/vault/mcp-builder/scripts/requirements.txt +2 -0
- package/templates/vault/mobile-design/scripts/mobile_audit.py +670 -0
- package/templates/vault/notebooklm/scripts/__init__.py +81 -0
- package/templates/vault/notebooklm/scripts/ask_question.py +256 -0
- package/templates/vault/notebooklm/scripts/auth_manager.py +358 -0
- package/templates/vault/notebooklm/scripts/browser_session.py +255 -0
- package/templates/vault/notebooklm/scripts/browser_utils.py +107 -0
- package/templates/vault/notebooklm/scripts/cleanup_manager.py +302 -0
- package/templates/vault/notebooklm/scripts/config.py +44 -0
- package/templates/vault/notebooklm/scripts/notebook_manager.py +410 -0
- package/templates/vault/notebooklm/scripts/run.py +102 -0
- package/templates/vault/notebooklm/scripts/setup_environment.py +204 -0
- package/templates/vault/pdf/scripts/check_bounding_boxes.py +70 -0
- package/templates/vault/pdf/scripts/check_bounding_boxes_test.py +226 -0
- package/templates/vault/pdf/scripts/check_fillable_fields.py +12 -0
- package/templates/vault/pdf/scripts/convert_pdf_to_images.py +35 -0
- package/templates/vault/pdf/scripts/create_validation_image.py +41 -0
- package/templates/vault/pdf/scripts/extract_form_field_info.py +152 -0
- package/templates/vault/pdf/scripts/fill_fillable_fields.py +114 -0
- package/templates/vault/pdf/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/templates/vault/pdf-official/scripts/check_bounding_boxes.py +70 -0
- package/templates/vault/pdf-official/scripts/check_bounding_boxes_test.py +226 -0
- package/templates/vault/pdf-official/scripts/check_fillable_fields.py +12 -0
- package/templates/vault/pdf-official/scripts/convert_pdf_to_images.py +35 -0
- package/templates/vault/pdf-official/scripts/create_validation_image.py +41 -0
- package/templates/vault/pdf-official/scripts/extract_form_field_info.py +152 -0
- package/templates/vault/pdf-official/scripts/fill_fillable_fields.py +114 -0
- package/templates/vault/pdf-official/scripts/fill_pdf_form_with_annotations.py +108 -0
- package/templates/vault/planning-with-files/scripts/check-complete.sh +44 -0
- package/templates/vault/planning-with-files/scripts/init-session.sh +120 -0
- package/templates/vault/pptx/ooxml/scripts/pack.py +159 -0
- package/templates/vault/pptx/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/pptx/ooxml/scripts/validate.py +69 -0
- package/templates/vault/pptx/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/pptx/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/pptx/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/pptx/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/pptx/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/pptx/scripts/html2pptx.js +979 -0
- package/templates/vault/pptx/scripts/inventory.py +1020 -0
- package/templates/vault/pptx/scripts/rearrange.py +231 -0
- package/templates/vault/pptx/scripts/replace.py +385 -0
- package/templates/vault/pptx/scripts/thumbnail.py +450 -0
- package/templates/vault/pptx-official/ooxml/scripts/pack.py +159 -0
- package/templates/vault/pptx-official/ooxml/scripts/unpack.py +29 -0
- package/templates/vault/pptx-official/ooxml/scripts/validate.py +69 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/__init__.py +15 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/base.py +951 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/docx.py +274 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/pptx.py +315 -0
- package/templates/vault/pptx-official/ooxml/scripts/validation/redlining.py +279 -0
- package/templates/vault/pptx-official/scripts/html2pptx.js +979 -0
- package/templates/vault/pptx-official/scripts/inventory.py +1020 -0
- package/templates/vault/pptx-official/scripts/rearrange.py +231 -0
- package/templates/vault/pptx-official/scripts/replace.py +385 -0
- package/templates/vault/pptx-official/scripts/thumbnail.py +450 -0
- package/templates/vault/product-manager-toolkit/scripts/customer_interview_analyzer.py +441 -0
- package/templates/vault/product-manager-toolkit/scripts/rice_prioritizer.py +296 -0
- package/templates/vault/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
- package/templates/vault/scripts/.skill_cache.json +7538 -0
- package/templates/vault/scripts/skill_search.py +228 -0
- package/templates/vault/senior-architect/scripts/architecture_diagram_generator.py +114 -0
- package/templates/vault/senior-architect/scripts/dependency_analyzer.py +114 -0
- package/templates/vault/senior-architect/scripts/project_architect.py +114 -0
- package/templates/vault/shopify-development/scripts/requirements.txt +19 -0
- package/templates/vault/shopify-development/scripts/shopify_graphql.py +428 -0
- package/templates/vault/shopify-development/scripts/shopify_init.py +441 -0
- package/templates/vault/shopify-development/scripts/tests/test_shopify_init.py +379 -0
- package/templates/vault/skill-creator/scripts/init_skill.py +303 -0
- package/templates/vault/skill-creator/scripts/package_skill.py +110 -0
- package/templates/vault/skill-creator/scripts/quick_validate.py +95 -0
- package/templates/vault/skill-installer/scripts/detect_skills.py +318 -0
- package/templates/vault/skill-installer/scripts/install_skill.py +1708 -0
- package/templates/vault/skill-installer/scripts/package_skill.py +417 -0
- package/templates/vault/skill-installer/scripts/requirements.txt +1 -0
- package/templates/vault/skill-installer/scripts/validate_skill.py +430 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/__init__.py +13 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/code_quality.py +247 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/cross_skill.py +134 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/dependencies.py +121 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/documentation.py +189 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/governance_audit.py +153 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/performance.py +164 -0
- package/templates/vault/skill-sentinel/scripts/analyzers/security.py +189 -0
- package/templates/vault/skill-sentinel/scripts/config.py +158 -0
- package/templates/vault/skill-sentinel/scripts/cost_optimizer.py +146 -0
- package/templates/vault/skill-sentinel/scripts/db.py +354 -0
- package/templates/vault/skill-sentinel/scripts/governance.py +58 -0
- package/templates/vault/skill-sentinel/scripts/recommender.py +228 -0
- package/templates/vault/skill-sentinel/scripts/report_generator.py +224 -0
- package/templates/vault/skill-sentinel/scripts/requirements.txt +1 -0
- package/templates/vault/skill-sentinel/scripts/run_audit.py +290 -0
- package/templates/vault/skill-sentinel/scripts/scanner.py +271 -0
- package/templates/vault/stability-ai/scripts/config.py +266 -0
- package/templates/vault/stability-ai/scripts/generate.py +687 -0
- package/templates/vault/stability-ai/scripts/requirements.txt +4 -0
- package/templates/vault/stability-ai/scripts/styles.py +174 -0
- package/templates/vault/telegram/assets/boilerplate/nodejs/src/bot-client.ts +86 -0
- package/templates/vault/telegram/assets/boilerplate/nodejs/src/handlers.ts +79 -0
- package/templates/vault/telegram/assets/boilerplate/nodejs/src/index.ts +32 -0
- package/templates/vault/telegram/scripts/send_message.py +143 -0
- package/templates/vault/telegram/scripts/setup_project.py +103 -0
- package/templates/vault/telegram/scripts/test_bot.py +144 -0
- package/templates/vault/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/templates/vault/ui-ux-pro-max/scripts/__pycache__/core.cpython-314.pyc +0 -0
- package/templates/vault/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-314.pyc +0 -0
- package/templates/vault/ui-ux-pro-max/scripts/core.py +257 -0
- package/templates/vault/ui-ux-pro-max/scripts/design_system.py +487 -0
- package/templates/vault/ui-ux-pro-max/scripts/search.py +76 -0
- package/templates/vault/videodb/scripts/ws_listener.py +204 -0
- package/templates/vault/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/templates/vault/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/templates/vault/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/templates/vault/webapp-testing/scripts/with_server.py +106 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/index.ts +125 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/template-manager.ts +67 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/types.ts +216 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/webhook-handler.ts +173 -0
- package/templates/vault/whatsapp-cloud-api/assets/boilerplate/nodejs/src/whatsapp-client.ts +193 -0
- package/templates/vault/whatsapp-cloud-api/scripts/send_test_message.py +137 -0
- package/templates/vault/whatsapp-cloud-api/scripts/setup_project.py +118 -0
- package/templates/vault/whatsapp-cloud-api/scripts/validate_config.py +190 -0
- package/templates/vault/youtube-summarizer/scripts/extract-transcript.py +65 -0
- package/templates/vault/youtube-summarizer/scripts/install-dependencies.sh +28 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Gerador de relatorios Markdown.
|
|
3
|
+
|
|
4
|
+
Produz relatorio estruturado com resumo executivo, scores por skill,
|
|
5
|
+
findings por severidade, recomendacoes e plano de acao.
|
|
6
|
+
"""
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from datetime import datetime, timezone
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
from typing import Any, Dict, List, Optional
|
|
12
|
+
|
|
13
|
+
from config import DIMENSION_WEIGHTS, REPORTS_DIR, SEVERITY_ORDER, get_score_label
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _severity_icon(severity: str) -> str:
|
|
17
|
+
"""Retorna indicador textual de severidade."""
|
|
18
|
+
icons = {
|
|
19
|
+
"critical": "[CRITICO]",
|
|
20
|
+
"high": "[ALTO]",
|
|
21
|
+
"medium": "[MEDIO]",
|
|
22
|
+
"low": "[BAIXO]",
|
|
23
|
+
"info": "[INFO]",
|
|
24
|
+
}
|
|
25
|
+
return icons.get(severity, "[?]")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _format_score(score: Optional[float]) -> str:
|
|
29
|
+
"""Formata score como string."""
|
|
30
|
+
if score is None:
|
|
31
|
+
return "N/A"
|
|
32
|
+
return f"{score:.0f}"
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def generate_report(
|
|
36
|
+
snapshots: List[Dict[str, Any]],
|
|
37
|
+
findings: List[Dict[str, Any]],
|
|
38
|
+
recommendations: List[Dict[str, Any]],
|
|
39
|
+
overall_score: float,
|
|
40
|
+
previous_snapshots: Optional[List[Dict[str, Any]]] = None,
|
|
41
|
+
) -> str:
|
|
42
|
+
"""Gera relatorio Markdown completo."""
|
|
43
|
+
now = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC")
|
|
44
|
+
lines: List[str] = []
|
|
45
|
+
|
|
46
|
+
# -- Header ----------------------------------------------------------------
|
|
47
|
+
lines.append("# Relatorio Sentinel - Auditoria do Ecossistema de Skills")
|
|
48
|
+
lines.append("")
|
|
49
|
+
lines.append(f"**Data:** {now}")
|
|
50
|
+
lines.append(f"**Skills Analisadas:** {len(snapshots)}")
|
|
51
|
+
lines.append(f"**Score Geral:** {overall_score:.0f}/100 ({get_score_label(overall_score)})")
|
|
52
|
+
lines.append("")
|
|
53
|
+
lines.append("---")
|
|
54
|
+
lines.append("")
|
|
55
|
+
|
|
56
|
+
# -- Resumo Executivo (tabela) ---------------------------------------------
|
|
57
|
+
lines.append("## Resumo Executivo")
|
|
58
|
+
lines.append("")
|
|
59
|
+
lines.append("| Skill | Score | Qualidade | Seguranca | Performance | Governanca | Docs | Deps |")
|
|
60
|
+
lines.append("|-------|-------|-----------|-----------|-------------|------------|------|------|")
|
|
61
|
+
|
|
62
|
+
for snap in sorted(snapshots, key=lambda s: -(s.get("overall_score") or 0)):
|
|
63
|
+
name = snap.get("skill_name", "?")
|
|
64
|
+
overall = _format_score(snap.get("overall_score"))
|
|
65
|
+
cq = _format_score(snap.get("code_quality"))
|
|
66
|
+
sec = _format_score(snap.get("security"))
|
|
67
|
+
perf = _format_score(snap.get("performance"))
|
|
68
|
+
gov = _format_score(snap.get("governance"))
|
|
69
|
+
doc = _format_score(snap.get("documentation"))
|
|
70
|
+
deps = _format_score(snap.get("dependencies"))
|
|
71
|
+
lines.append(f"| {name} | {overall} | {cq} | {sec} | {perf} | {gov} | {doc} | {deps} |")
|
|
72
|
+
|
|
73
|
+
lines.append("")
|
|
74
|
+
|
|
75
|
+
# -- Tendencias (se houver dados anteriores) --------------------------------
|
|
76
|
+
if previous_snapshots:
|
|
77
|
+
lines.append("## Tendencias")
|
|
78
|
+
lines.append("")
|
|
79
|
+
prev_map = {s["skill_name"]: s for s in previous_snapshots}
|
|
80
|
+
for snap in snapshots:
|
|
81
|
+
name = snap.get("skill_name", "?")
|
|
82
|
+
prev = prev_map.get(name)
|
|
83
|
+
if prev:
|
|
84
|
+
curr_score = snap.get("overall_score", 0) or 0
|
|
85
|
+
prev_score = prev.get("overall_score", 0) or 0
|
|
86
|
+
delta = curr_score - prev_score
|
|
87
|
+
if delta > 0:
|
|
88
|
+
trend = f"+{delta:.0f} pts"
|
|
89
|
+
elif delta < 0:
|
|
90
|
+
trend = f"{delta:.0f} pts"
|
|
91
|
+
else:
|
|
92
|
+
trend = "sem alteracao"
|
|
93
|
+
lines.append(f"- **{name}**: {prev_score:.0f} -> {curr_score:.0f} ({trend})")
|
|
94
|
+
lines.append("")
|
|
95
|
+
|
|
96
|
+
# -- Findings por Severidade ------------------------------------------------
|
|
97
|
+
lines.append("## Findings por Severidade")
|
|
98
|
+
lines.append("")
|
|
99
|
+
|
|
100
|
+
# Agrupar
|
|
101
|
+
by_severity: Dict[str, List[Dict[str, Any]]] = {}
|
|
102
|
+
for f in findings:
|
|
103
|
+
sev = f.get("severity", "info")
|
|
104
|
+
by_severity.setdefault(sev, []).append(f)
|
|
105
|
+
|
|
106
|
+
severity_labels = {
|
|
107
|
+
"critical": "Criticos",
|
|
108
|
+
"high": "Altos",
|
|
109
|
+
"medium": "Medios",
|
|
110
|
+
"low": "Baixos",
|
|
111
|
+
"info": "Informativos",
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
for sev in ["critical", "high", "medium", "low", "info"]:
|
|
115
|
+
items = by_severity.get(sev, [])
|
|
116
|
+
label = severity_labels.get(sev, sev)
|
|
117
|
+
lines.append(f"### {label} ({len(items)})")
|
|
118
|
+
lines.append("")
|
|
119
|
+
if not items:
|
|
120
|
+
lines.append("Nenhum.")
|
|
121
|
+
lines.append("")
|
|
122
|
+
continue
|
|
123
|
+
for f in items:
|
|
124
|
+
skill = f.get("skill_name", "?")
|
|
125
|
+
title = f.get("title", "?")
|
|
126
|
+
lines.append(f"- {_severity_icon(sev)} **[{skill}]** {title}")
|
|
127
|
+
if f.get("recommendation"):
|
|
128
|
+
lines.append(f" - Recomendacao: {f['recommendation']}")
|
|
129
|
+
if f.get("file_path"):
|
|
130
|
+
loc = f["file_path"]
|
|
131
|
+
if f.get("line_number"):
|
|
132
|
+
loc += f":{f['line_number']}"
|
|
133
|
+
lines.append(f" - Local: `{loc}`")
|
|
134
|
+
lines.append("")
|
|
135
|
+
|
|
136
|
+
# -- Analise por Skill -----------------------------------------------------
|
|
137
|
+
lines.append("## Analise por Skill")
|
|
138
|
+
lines.append("")
|
|
139
|
+
|
|
140
|
+
for snap in sorted(snapshots, key=lambda s: s.get("skill_name", "")):
|
|
141
|
+
name = snap.get("skill_name", "?")
|
|
142
|
+
overall = snap.get("overall_score", 0)
|
|
143
|
+
lines.append(f"### {name} ({_format_score(overall)}/100 - {get_score_label(overall or 0)})")
|
|
144
|
+
lines.append("")
|
|
145
|
+
lines.append(f"- Arquivos Python: {snap.get('file_count', 0)}")
|
|
146
|
+
lines.append(f"- Linhas de codigo: {snap.get('line_count', 0)}")
|
|
147
|
+
lines.append(f"- Qualidade: {_format_score(snap.get('code_quality'))} | "
|
|
148
|
+
f"Seguranca: {_format_score(snap.get('security'))} | "
|
|
149
|
+
f"Performance: {_format_score(snap.get('performance'))}")
|
|
150
|
+
lines.append(f"- Governanca: {_format_score(snap.get('governance'))} | "
|
|
151
|
+
f"Docs: {_format_score(snap.get('documentation'))} | "
|
|
152
|
+
f"Deps: {_format_score(snap.get('dependencies'))}")
|
|
153
|
+
lines.append("")
|
|
154
|
+
|
|
155
|
+
# Findings desta skill
|
|
156
|
+
skill_findings = [f for f in findings if f.get("skill_name") == name and f.get("severity") != "info"]
|
|
157
|
+
if skill_findings:
|
|
158
|
+
for f in sorted(skill_findings, key=lambda x: SEVERITY_ORDER.get(x.get("severity", "info"), 9)):
|
|
159
|
+
lines.append(f" - {_severity_icon(f['severity'])} {f['title']}")
|
|
160
|
+
else:
|
|
161
|
+
lines.append(" Nenhum finding significativo.")
|
|
162
|
+
lines.append("")
|
|
163
|
+
|
|
164
|
+
# -- Recomendacoes de Novas Skills -----------------------------------------
|
|
165
|
+
if recommendations:
|
|
166
|
+
lines.append("## Recomendacoes de Novas Skills")
|
|
167
|
+
lines.append("")
|
|
168
|
+
for i, rec in enumerate(recommendations, 1):
|
|
169
|
+
name = rec.get("suggested_name", "?")
|
|
170
|
+
priority = rec.get("priority", "?")
|
|
171
|
+
rationale = rec.get("rationale", "")
|
|
172
|
+
caps = rec.get("capabilities", [])
|
|
173
|
+
if isinstance(caps, str):
|
|
174
|
+
caps = [caps]
|
|
175
|
+
lines.append(f"### {i}. {name} (prioridade: {priority})")
|
|
176
|
+
lines.append("")
|
|
177
|
+
lines.append(f"**Razao:** {rationale}")
|
|
178
|
+
lines.append("")
|
|
179
|
+
if caps:
|
|
180
|
+
lines.append(f"**Capacidades:** {', '.join(caps)}")
|
|
181
|
+
lines.append("")
|
|
182
|
+
|
|
183
|
+
# -- Plano de Acao Priorizado ----------------------------------------------
|
|
184
|
+
lines.append("## Plano de Acao Priorizado")
|
|
185
|
+
lines.append("")
|
|
186
|
+
|
|
187
|
+
actionable = [
|
|
188
|
+
f for f in findings
|
|
189
|
+
if f.get("severity") in ("critical", "high", "medium") and f.get("recommendation")
|
|
190
|
+
]
|
|
191
|
+
actionable.sort(key=lambda x: (
|
|
192
|
+
SEVERITY_ORDER.get(x.get("severity", "info"), 9),
|
|
193
|
+
{"low": 0, "medium": 1, "high": 2}.get(x.get("effort", "medium"), 1),
|
|
194
|
+
))
|
|
195
|
+
|
|
196
|
+
if actionable:
|
|
197
|
+
lines.append("| # | Severidade | Skill | Acao | Esforco |")
|
|
198
|
+
lines.append("|---|-----------|-------|------|---------|")
|
|
199
|
+
for i, f in enumerate(actionable[:20], 1):
|
|
200
|
+
sev = f.get("severity", "?")
|
|
201
|
+
skill = f.get("skill_name", "?")
|
|
202
|
+
rec = f.get("recommendation", "?")[:80]
|
|
203
|
+
effort = f.get("effort", "?")
|
|
204
|
+
lines.append(f"| {i} | {sev} | {skill} | {rec} | {effort} |")
|
|
205
|
+
else:
|
|
206
|
+
lines.append("Nenhuma acao prioritaria identificada.")
|
|
207
|
+
|
|
208
|
+
lines.append("")
|
|
209
|
+
lines.append("---")
|
|
210
|
+
lines.append(f"*Gerado por skill-sentinel em {now}*")
|
|
211
|
+
|
|
212
|
+
return "\n".join(lines)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def save_report(content: str, filename: Optional[str] = None) -> str:
|
|
216
|
+
"""Salva relatorio em arquivo e retorna o path."""
|
|
217
|
+
if not filename:
|
|
218
|
+
timestamp = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S")
|
|
219
|
+
filename = f"audit_{timestamp}.md"
|
|
220
|
+
|
|
221
|
+
filepath = REPORTS_DIR / filename
|
|
222
|
+
filepath.parent.mkdir(parents=True, exist_ok=True)
|
|
223
|
+
filepath.write_text(content, encoding="utf-8")
|
|
224
|
+
return str(filepath)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyyaml>=6.0
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CLI principal do Sentinel: orquestra a auditoria completa do ecossistema.
|
|
3
|
+
|
|
4
|
+
Uso:
|
|
5
|
+
python run_audit.py # Auditoria completa
|
|
6
|
+
python run_audit.py --skill instagram # Auditoria de uma skill
|
|
7
|
+
python run_audit.py --recommend # Apenas gap analysis
|
|
8
|
+
python run_audit.py --compare # Comparar com auditoria anterior
|
|
9
|
+
python run_audit.py --history # Ver historico de auditorias
|
|
10
|
+
python run_audit.py --format json # Output em JSON
|
|
11
|
+
"""
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import argparse
|
|
15
|
+
import json
|
|
16
|
+
import sys
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from typing import Any, Dict, List, Optional
|
|
19
|
+
|
|
20
|
+
# Garantir que o diretorio scripts esta no path
|
|
21
|
+
sys.path.insert(0, str(Path(__file__).parent))
|
|
22
|
+
|
|
23
|
+
from config import DIMENSION_WEIGHTS, get_score_label
|
|
24
|
+
from db import Database
|
|
25
|
+
from governance import SentinelGovernance
|
|
26
|
+
from report_generator import generate_report, save_report
|
|
27
|
+
from scanner import SkillScanner
|
|
28
|
+
|
|
29
|
+
# Importar analyzers
|
|
30
|
+
from analyzers import code_quality, security, performance
|
|
31
|
+
from analyzers import governance_audit, documentation, dependencies
|
|
32
|
+
from analyzers import cross_skill as cross_skill_analyzer
|
|
33
|
+
import cost_optimizer
|
|
34
|
+
import recommender
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _compute_overall_score(scores: Dict[str, float]) -> float:
|
|
38
|
+
"""Calcula score composto ponderado."""
|
|
39
|
+
total = 0.0
|
|
40
|
+
weight_sum = 0.0
|
|
41
|
+
for dim, weight in DIMENSION_WEIGHTS.items():
|
|
42
|
+
if dim in scores and scores[dim] is not None:
|
|
43
|
+
total += scores[dim] * weight
|
|
44
|
+
weight_sum += weight
|
|
45
|
+
if weight_sum == 0:
|
|
46
|
+
return 0.0
|
|
47
|
+
return total / weight_sum
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def _run_analyzers(skill_data: Dict[str, Any]) -> Dict[str, Any]:
|
|
51
|
+
"""Executa todos os analyzers em uma skill e retorna resultados."""
|
|
52
|
+
results: Dict[str, Any] = {
|
|
53
|
+
"scores": {},
|
|
54
|
+
"findings": [],
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
analyzers = {
|
|
58
|
+
"code_quality": code_quality.analyze,
|
|
59
|
+
"security": security.analyze,
|
|
60
|
+
"performance": performance.analyze,
|
|
61
|
+
"governance": governance_audit.analyze,
|
|
62
|
+
"documentation": documentation.analyze,
|
|
63
|
+
"dependencies": dependencies.analyze,
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
for dim_name, analyzer_fn in analyzers.items():
|
|
67
|
+
score, findings = analyzer_fn(skill_data)
|
|
68
|
+
results["scores"][dim_name] = score
|
|
69
|
+
results["findings"].extend(findings)
|
|
70
|
+
|
|
71
|
+
# Cost optimizer (findings adicionais, nao eh dimensao de score)
|
|
72
|
+
_, cost_findings = cost_optimizer.analyze(skill_data)
|
|
73
|
+
results["findings"].extend(cost_findings)
|
|
74
|
+
|
|
75
|
+
# Score composto
|
|
76
|
+
results["overall_score"] = _compute_overall_score(results["scores"])
|
|
77
|
+
|
|
78
|
+
return results
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def run_audit(
|
|
82
|
+
skill_filter: Optional[str] = None,
|
|
83
|
+
include_recommendations: bool = True,
|
|
84
|
+
compare_previous: bool = False,
|
|
85
|
+
output_format: str = "markdown",
|
|
86
|
+
) -> Dict[str, Any]:
|
|
87
|
+
"""
|
|
88
|
+
Executa auditoria completa. Retorna dict com resultados.
|
|
89
|
+
"""
|
|
90
|
+
db = Database()
|
|
91
|
+
db.init()
|
|
92
|
+
gov = SentinelGovernance(db)
|
|
93
|
+
|
|
94
|
+
scanner = SkillScanner()
|
|
95
|
+
all_skills = scanner.discover_all()
|
|
96
|
+
|
|
97
|
+
if skill_filter:
|
|
98
|
+
all_skills = [s for s in all_skills if s["name"] == skill_filter]
|
|
99
|
+
if not all_skills:
|
|
100
|
+
return {"error": f"Skill '{skill_filter}' nao encontrada."}
|
|
101
|
+
|
|
102
|
+
gov.log_audit_start([s["name"] for s in all_skills])
|
|
103
|
+
|
|
104
|
+
# Criar audit run
|
|
105
|
+
run_id = db.create_audit_run()
|
|
106
|
+
|
|
107
|
+
# Analisar cada skill
|
|
108
|
+
all_snapshots = []
|
|
109
|
+
all_findings = []
|
|
110
|
+
|
|
111
|
+
for skill_data in all_skills:
|
|
112
|
+
results = _run_analyzers(skill_data)
|
|
113
|
+
|
|
114
|
+
# Salvar snapshot
|
|
115
|
+
snapshot = {
|
|
116
|
+
"skill_name": skill_data["name"],
|
|
117
|
+
"skill_path": skill_data["path"],
|
|
118
|
+
"version": skill_data.get("version", ""),
|
|
119
|
+
"file_count": skill_data.get("file_count", 0),
|
|
120
|
+
"line_count": skill_data.get("line_count", 0),
|
|
121
|
+
"overall_score": results["overall_score"],
|
|
122
|
+
"code_quality": results["scores"].get("code_quality"),
|
|
123
|
+
"security": results["scores"].get("security"),
|
|
124
|
+
"performance": results["scores"].get("performance"),
|
|
125
|
+
"governance": results["scores"].get("governance"),
|
|
126
|
+
"documentation": results["scores"].get("documentation"),
|
|
127
|
+
"dependencies": results["scores"].get("dependencies"),
|
|
128
|
+
"raw_metrics": results["scores"],
|
|
129
|
+
}
|
|
130
|
+
db.insert_skill_snapshot(run_id, snapshot)
|
|
131
|
+
all_snapshots.append(snapshot)
|
|
132
|
+
|
|
133
|
+
# Salvar findings
|
|
134
|
+
db.insert_findings_batch(run_id, results["findings"])
|
|
135
|
+
all_findings.extend(results["findings"])
|
|
136
|
+
|
|
137
|
+
# Score history
|
|
138
|
+
for dim, score in results["scores"].items():
|
|
139
|
+
db.insert_score_history(run_id, skill_data["name"], dim, score)
|
|
140
|
+
|
|
141
|
+
# Cross-skill analysis (se mais de uma skill)
|
|
142
|
+
if len(all_skills) > 1:
|
|
143
|
+
cross_score, cross_findings = cross_skill_analyzer.analyze_cross_skill(all_skills)
|
|
144
|
+
db.insert_findings_batch(run_id, cross_findings)
|
|
145
|
+
all_findings.extend(cross_findings)
|
|
146
|
+
|
|
147
|
+
# Recomendacoes
|
|
148
|
+
all_recommendations = []
|
|
149
|
+
if include_recommendations:
|
|
150
|
+
all_recommendations = recommender.recommend(all_skills)
|
|
151
|
+
for rec in all_recommendations:
|
|
152
|
+
db.insert_recommendation(run_id, rec)
|
|
153
|
+
gov.log_recommendation(rec["suggested_name"], rec.get("priority", "low"))
|
|
154
|
+
|
|
155
|
+
# Score geral do ecossistema
|
|
156
|
+
if all_snapshots:
|
|
157
|
+
ecosystem_score = sum(s["overall_score"] for s in all_snapshots) / len(all_snapshots)
|
|
158
|
+
else:
|
|
159
|
+
ecosystem_score = 0.0
|
|
160
|
+
|
|
161
|
+
# Dados de comparacao
|
|
162
|
+
previous_snapshots = None
|
|
163
|
+
if compare_previous:
|
|
164
|
+
prev_run = db.get_latest_completed_run()
|
|
165
|
+
if prev_run:
|
|
166
|
+
previous_snapshots = db.get_snapshots_for_run(prev_run["id"])
|
|
167
|
+
|
|
168
|
+
# Gerar relatorio
|
|
169
|
+
report_content = generate_report(
|
|
170
|
+
all_snapshots, all_findings, all_recommendations,
|
|
171
|
+
ecosystem_score, previous_snapshots,
|
|
172
|
+
)
|
|
173
|
+
report_path = save_report(report_content)
|
|
174
|
+
|
|
175
|
+
# Completar audit run
|
|
176
|
+
db.complete_audit_run(run_id, len(all_skills), len(all_findings), ecosystem_score, report_path)
|
|
177
|
+
gov.log_audit_complete(run_id, ecosystem_score, len(all_findings))
|
|
178
|
+
|
|
179
|
+
result = {
|
|
180
|
+
"run_id": run_id,
|
|
181
|
+
"skills_scanned": len(all_skills),
|
|
182
|
+
"overall_score": ecosystem_score,
|
|
183
|
+
"score_label": get_score_label(ecosystem_score),
|
|
184
|
+
"total_findings": len(all_findings),
|
|
185
|
+
"findings_by_severity": {},
|
|
186
|
+
"snapshots": all_snapshots,
|
|
187
|
+
"recommendations": all_recommendations,
|
|
188
|
+
"report_path": report_path,
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
# Contar por severidade
|
|
192
|
+
for f in all_findings:
|
|
193
|
+
sev = f.get("severity", "info")
|
|
194
|
+
result["findings_by_severity"][sev] = result["findings_by_severity"].get(sev, 0) + 1
|
|
195
|
+
|
|
196
|
+
return result
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def show_history(db: Database) -> None:
|
|
200
|
+
"""Mostra historico de auditorias."""
|
|
201
|
+
runs = db.get_audit_runs(10)
|
|
202
|
+
if not runs:
|
|
203
|
+
print("Nenhuma auditoria realizada ainda.")
|
|
204
|
+
return
|
|
205
|
+
|
|
206
|
+
print("Historico de Auditorias:")
|
|
207
|
+
print("-" * 70)
|
|
208
|
+
for r in runs:
|
|
209
|
+
score = r.get("overall_score")
|
|
210
|
+
score_str = f"{score:.0f}/100" if score else "N/A"
|
|
211
|
+
print(f" #{r['id']} | {r['started_at'][:19]} | "
|
|
212
|
+
f"{r['status']:10s} | Score: {score_str} | "
|
|
213
|
+
f"Skills: {r['skills_scanned']} | Findings: {r['total_findings']}")
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
def main():
|
|
217
|
+
parser = argparse.ArgumentParser(
|
|
218
|
+
description="Sentinel: Auditoria do ecossistema de skills",
|
|
219
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
220
|
+
epilog="""
|
|
221
|
+
Exemplos:
|
|
222
|
+
python run_audit.py # Auditoria completa
|
|
223
|
+
python run_audit.py --skill instagram # Apenas uma skill
|
|
224
|
+
python run_audit.py --recommend # Apenas recomendacoes
|
|
225
|
+
python run_audit.py --compare # Comparar com anterior
|
|
226
|
+
python run_audit.py --history # Ver historico
|
|
227
|
+
python run_audit.py --format json # Output JSON
|
|
228
|
+
""",
|
|
229
|
+
)
|
|
230
|
+
parser.add_argument("--skill", help="Auditar apenas esta skill")
|
|
231
|
+
parser.add_argument("--recommend", action="store_true", help="Apenas gap analysis e recomendacoes")
|
|
232
|
+
parser.add_argument("--compare", action="store_true", help="Comparar com auditoria anterior")
|
|
233
|
+
parser.add_argument("--history", action="store_true", help="Mostrar historico de auditorias")
|
|
234
|
+
parser.add_argument("--format", choices=["markdown", "json"], default="markdown", help="Formato de output")
|
|
235
|
+
|
|
236
|
+
args = parser.parse_args()
|
|
237
|
+
|
|
238
|
+
if args.history:
|
|
239
|
+
db = Database()
|
|
240
|
+
db.init()
|
|
241
|
+
show_history(db)
|
|
242
|
+
return
|
|
243
|
+
|
|
244
|
+
result = run_audit(
|
|
245
|
+
skill_filter=args.skill,
|
|
246
|
+
include_recommendations=True,
|
|
247
|
+
compare_previous=args.compare,
|
|
248
|
+
output_format=args.format,
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
if "error" in result:
|
|
252
|
+
print(f"Erro: {result['error']}", file=sys.stderr)
|
|
253
|
+
sys.exit(1)
|
|
254
|
+
|
|
255
|
+
if args.format == "json":
|
|
256
|
+
print(json.dumps(result, indent=2, ensure_ascii=False, default=str))
|
|
257
|
+
else:
|
|
258
|
+
# Exibir resumo no terminal
|
|
259
|
+
print(f"\n{'='*60}")
|
|
260
|
+
print(f" SENTINEL - Auditoria do Ecossistema")
|
|
261
|
+
print(f"{'='*60}")
|
|
262
|
+
print(f" Skills analisadas: {result['skills_scanned']}")
|
|
263
|
+
print(f" Score geral: {result['overall_score']:.0f}/100 ({result['score_label']})")
|
|
264
|
+
print(f" Total de findings: {result['total_findings']}")
|
|
265
|
+
|
|
266
|
+
if result.get("findings_by_severity"):
|
|
267
|
+
print(f"\n Por severidade:")
|
|
268
|
+
for sev in ["critical", "high", "medium", "low", "info"]:
|
|
269
|
+
count = result["findings_by_severity"].get(sev, 0)
|
|
270
|
+
if count:
|
|
271
|
+
print(f" {sev:10s}: {count}")
|
|
272
|
+
|
|
273
|
+
print(f"\n Scores por skill:")
|
|
274
|
+
for snap in result.get("snapshots", []):
|
|
275
|
+
name = snap["skill_name"]
|
|
276
|
+
score = snap["overall_score"]
|
|
277
|
+
label = get_score_label(score)
|
|
278
|
+
print(f" {name:25s} {score:5.0f}/100 ({label})")
|
|
279
|
+
|
|
280
|
+
if result.get("recommendations"):
|
|
281
|
+
print(f"\n Recomendacoes de novas skills ({len(result['recommendations'])}):")
|
|
282
|
+
for rec in result["recommendations"][:5]:
|
|
283
|
+
print(f" [{rec.get('priority', '?'):6s}] {rec['suggested_name']}")
|
|
284
|
+
|
|
285
|
+
print(f"\n Relatorio completo: {result['report_path']}")
|
|
286
|
+
print(f"{'='*60}\n")
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
if __name__ == "__main__":
|
|
290
|
+
main()
|