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,240 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Claude Monitor — Benchmark de Conectividade API
|
|
4
|
+
|
|
5
|
+
Testa latência e conectividade com a API do Claude.
|
|
6
|
+
Não faz chamadas à API (não precisa de API key).
|
|
7
|
+
Apenas verifica se a rede está funcionando e se o endpoint responde.
|
|
8
|
+
|
|
9
|
+
Uso:
|
|
10
|
+
python api_bench.py # 5 testes de latência
|
|
11
|
+
python api_bench.py --samples 10 # 10 testes
|
|
12
|
+
python api_bench.py --json # Output JSON
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import socket
|
|
17
|
+
import ssl
|
|
18
|
+
import subprocess
|
|
19
|
+
import sys
|
|
20
|
+
import time
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
|
|
23
|
+
try:
|
|
24
|
+
import psutil
|
|
25
|
+
except ImportError:
|
|
26
|
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "psutil", "--quiet"])
|
|
27
|
+
import psutil
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
ENDPOINTS = [
|
|
31
|
+
{"name": "Claude API", "host": "api.anthropic.com", "port": 443},
|
|
32
|
+
{"name": "Anthropic CDN", "host": "cdn.anthropic.com", "port": 443},
|
|
33
|
+
{"name": "Google DNS", "host": "8.8.8.8", "port": 53},
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def test_tcp_latency(host, port, timeout=5):
|
|
38
|
+
"""Testa latência TCP para um host:port."""
|
|
39
|
+
try:
|
|
40
|
+
start = time.time()
|
|
41
|
+
sock = socket.create_connection((host, port), timeout=timeout)
|
|
42
|
+
latency = (time.time() - start) * 1000 # ms
|
|
43
|
+
sock.close()
|
|
44
|
+
return {"reachable": True, "latency_ms": round(latency, 1)}
|
|
45
|
+
except (socket.timeout, socket.error, OSError) as e:
|
|
46
|
+
return {"reachable": False, "latency_ms": None, "error": str(e)}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_tls_handshake(host, port=443, timeout=5):
|
|
50
|
+
"""Testa tempo do handshake TLS."""
|
|
51
|
+
try:
|
|
52
|
+
context = ssl.create_default_context()
|
|
53
|
+
start = time.time()
|
|
54
|
+
with socket.create_connection((host, port), timeout=timeout) as sock:
|
|
55
|
+
with context.wrap_socket(sock, server_hostname=host) as ssock:
|
|
56
|
+
handshake_time = (time.time() - start) * 1000
|
|
57
|
+
return {
|
|
58
|
+
"success": True,
|
|
59
|
+
"handshake_ms": round(handshake_time, 1),
|
|
60
|
+
"tls_version": ssock.version(),
|
|
61
|
+
}
|
|
62
|
+
except Exception as e:
|
|
63
|
+
return {"success": False, "error": str(e)}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def test_dns(hostname):
|
|
67
|
+
"""Testa resolução DNS."""
|
|
68
|
+
try:
|
|
69
|
+
start = time.time()
|
|
70
|
+
ip = socket.gethostbyname(hostname)
|
|
71
|
+
dns_time = (time.time() - start) * 1000
|
|
72
|
+
return {"resolved": True, "ip": ip, "dns_ms": round(dns_time, 1)}
|
|
73
|
+
except socket.gaierror as e:
|
|
74
|
+
return {"resolved": False, "error": str(e)}
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def check_network_interfaces():
|
|
78
|
+
"""Verifica interfaces de rede ativas."""
|
|
79
|
+
stats = psutil.net_if_stats()
|
|
80
|
+
active = []
|
|
81
|
+
for name, info in stats.items():
|
|
82
|
+
if info.isup and info.speed > 0:
|
|
83
|
+
active.append({
|
|
84
|
+
"name": name,
|
|
85
|
+
"speed_mbps": info.speed,
|
|
86
|
+
"mtu": info.mtu,
|
|
87
|
+
})
|
|
88
|
+
return active
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def run_benchmark(samples=5):
|
|
92
|
+
"""Roda o benchmark completo."""
|
|
93
|
+
results = {
|
|
94
|
+
"timestamp": datetime.now().isoformat(),
|
|
95
|
+
"samples": samples,
|
|
96
|
+
"endpoints": [],
|
|
97
|
+
"dns": None,
|
|
98
|
+
"tls": None,
|
|
99
|
+
"network_interfaces": check_network_interfaces(),
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# DNS
|
|
103
|
+
results["dns"] = test_dns("api.anthropic.com")
|
|
104
|
+
|
|
105
|
+
# TLS handshake
|
|
106
|
+
results["tls"] = test_tls_handshake("api.anthropic.com")
|
|
107
|
+
|
|
108
|
+
# Latência por endpoint
|
|
109
|
+
for ep in ENDPOINTS:
|
|
110
|
+
latencies = []
|
|
111
|
+
for _ in range(samples):
|
|
112
|
+
result = test_tcp_latency(ep["host"], ep["port"])
|
|
113
|
+
latencies.append(result)
|
|
114
|
+
time.sleep(0.2)
|
|
115
|
+
|
|
116
|
+
valid = [r["latency_ms"] for r in latencies if r["reachable"] and r["latency_ms"]]
|
|
117
|
+
|
|
118
|
+
ep_result = {
|
|
119
|
+
"name": ep["name"],
|
|
120
|
+
"host": ep["host"],
|
|
121
|
+
"port": ep["port"],
|
|
122
|
+
"tests": latencies,
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if valid:
|
|
126
|
+
ep_result["avg_ms"] = round(sum(valid) / len(valid), 1)
|
|
127
|
+
ep_result["min_ms"] = round(min(valid), 1)
|
|
128
|
+
ep_result["max_ms"] = round(max(valid), 1)
|
|
129
|
+
ep_result["success_rate"] = round(len(valid) / samples * 100, 0)
|
|
130
|
+
else:
|
|
131
|
+
ep_result["avg_ms"] = None
|
|
132
|
+
ep_result["success_rate"] = 0
|
|
133
|
+
|
|
134
|
+
results["endpoints"].append(ep_result)
|
|
135
|
+
|
|
136
|
+
# Diagnóstico
|
|
137
|
+
api_ep = results["endpoints"][0]
|
|
138
|
+
if api_ep.get("avg_ms") is None:
|
|
139
|
+
results["diagnosis"] = {
|
|
140
|
+
"status": "critical",
|
|
141
|
+
"message": "API do Claude INACESSIVEL. Verifique sua conexao de internet.",
|
|
142
|
+
}
|
|
143
|
+
elif api_ep["avg_ms"] > 500:
|
|
144
|
+
results["diagnosis"] = {
|
|
145
|
+
"status": "warning",
|
|
146
|
+
"message": (
|
|
147
|
+
f"Latencia alta para API ({api_ep['avg_ms']}ms). "
|
|
148
|
+
f"Conexao lenta pode causar atrasos no Claude Code."
|
|
149
|
+
),
|
|
150
|
+
}
|
|
151
|
+
elif api_ep["avg_ms"] > 200:
|
|
152
|
+
results["diagnosis"] = {
|
|
153
|
+
"status": "ok",
|
|
154
|
+
"message": (
|
|
155
|
+
f"Latencia moderada ({api_ep['avg_ms']}ms). "
|
|
156
|
+
f"Dentro do aceitavel mas pode ser melhor."
|
|
157
|
+
),
|
|
158
|
+
}
|
|
159
|
+
else:
|
|
160
|
+
results["diagnosis"] = {
|
|
161
|
+
"status": "ok",
|
|
162
|
+
"message": (
|
|
163
|
+
f"Conexao excelente ({api_ep['avg_ms']}ms). "
|
|
164
|
+
f"A rede NAO e o gargalo."
|
|
165
|
+
),
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return results
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def format_results(results):
|
|
172
|
+
"""Formata resultados para exibição."""
|
|
173
|
+
lines = ["## Benchmark de Conectividade\n"]
|
|
174
|
+
|
|
175
|
+
# DNS
|
|
176
|
+
dns = results["dns"]
|
|
177
|
+
if dns.get("resolved"):
|
|
178
|
+
lines.append(f"- DNS: api.anthropic.com -> {dns['ip']} ({dns['dns_ms']}ms)")
|
|
179
|
+
else:
|
|
180
|
+
lines.append(f"- DNS: FALHOU ({dns.get('error', 'desconhecido')})")
|
|
181
|
+
|
|
182
|
+
# TLS
|
|
183
|
+
tls = results["tls"]
|
|
184
|
+
if tls.get("success"):
|
|
185
|
+
lines.append(f"- TLS: {tls['tls_version']} handshake em {tls['handshake_ms']}ms")
|
|
186
|
+
else:
|
|
187
|
+
lines.append(f"- TLS: FALHOU ({tls.get('error', 'desconhecido')})")
|
|
188
|
+
|
|
189
|
+
lines.append("")
|
|
190
|
+
|
|
191
|
+
# Endpoints
|
|
192
|
+
lines.append("### Latencia por Endpoint")
|
|
193
|
+
for ep in results["endpoints"]:
|
|
194
|
+
if ep.get("avg_ms"):
|
|
195
|
+
lines.append(
|
|
196
|
+
f"- **{ep['name']}**: {ep['avg_ms']}ms avg "
|
|
197
|
+
f"(min {ep['min_ms']}ms, max {ep['max_ms']}ms) "
|
|
198
|
+
f"[{ep['success_rate']:.0f}% sucesso]"
|
|
199
|
+
)
|
|
200
|
+
else:
|
|
201
|
+
lines.append(f"- **{ep['name']}**: INACESSIVEL")
|
|
202
|
+
|
|
203
|
+
# Interfaces
|
|
204
|
+
lines.append("\n### Interfaces de Rede")
|
|
205
|
+
for iface in results["network_interfaces"]:
|
|
206
|
+
speed = iface["speed_mbps"]
|
|
207
|
+
if speed >= 1000:
|
|
208
|
+
speed_str = f"{speed/1000:.0f} Gbps"
|
|
209
|
+
else:
|
|
210
|
+
speed_str = f"{speed} Mbps"
|
|
211
|
+
lines.append(f"- {iface['name']}: {speed_str}")
|
|
212
|
+
|
|
213
|
+
# Diagnóstico
|
|
214
|
+
lines.append(f"\n### Diagnostico")
|
|
215
|
+
diag = results["diagnosis"]
|
|
216
|
+
status_map = {"critical": "[!!!]", "warning": "[!]", "ok": "[OK]"}
|
|
217
|
+
lines.append(f"{status_map[diag['status']]} {diag['message']}")
|
|
218
|
+
|
|
219
|
+
return "\n".join(lines)
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def main():
|
|
223
|
+
import argparse
|
|
224
|
+
|
|
225
|
+
parser = argparse.ArgumentParser(description="Claude Monitor - Benchmark de Conectividade")
|
|
226
|
+
parser.add_argument("--samples", type=int, default=5, help="Numero de testes por endpoint")
|
|
227
|
+
parser.add_argument("--json", action="store_true", help="Output JSON")
|
|
228
|
+
args = parser.parse_args()
|
|
229
|
+
|
|
230
|
+
print(f"Testando conectividade ({args.samples} amostras por endpoint)...\n")
|
|
231
|
+
results = run_benchmark(args.samples)
|
|
232
|
+
|
|
233
|
+
if args.json:
|
|
234
|
+
print(json.dumps(results, indent=2, ensure_ascii=False))
|
|
235
|
+
else:
|
|
236
|
+
print(format_results(results))
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
if __name__ == "__main__":
|
|
240
|
+
main()
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Configurações e thresholds para o Claude Monitor.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
# Thresholds de alerta
|
|
6
|
+
THRESHOLDS = {
|
|
7
|
+
"cpu": {
|
|
8
|
+
"ok": 60,
|
|
9
|
+
"warning": 85,
|
|
10
|
+
# acima de warning = critical
|
|
11
|
+
},
|
|
12
|
+
"ram_percent": {
|
|
13
|
+
"ok": 70,
|
|
14
|
+
"warning": 85,
|
|
15
|
+
},
|
|
16
|
+
"browsers_ram_gb": {
|
|
17
|
+
"ok": 3.0,
|
|
18
|
+
"warning": 6.0,
|
|
19
|
+
},
|
|
20
|
+
"browsers_processes": {
|
|
21
|
+
"ok": 30,
|
|
22
|
+
"warning": 60,
|
|
23
|
+
},
|
|
24
|
+
"disk_free_percent": {
|
|
25
|
+
"critical_below": 10,
|
|
26
|
+
"warning_below": 15,
|
|
27
|
+
},
|
|
28
|
+
"network_latency_ms": {
|
|
29
|
+
"ok": 200,
|
|
30
|
+
"warning": 500,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# Nomes de processos de browser conhecidos
|
|
35
|
+
BROWSER_NAMES = ["chrome", "msedge", "firefox", "brave", "opera", "vivaldi"]
|
|
36
|
+
|
|
37
|
+
# Nomes de processos do Claude Code
|
|
38
|
+
CLAUDE_NAMES = ["claude"]
|
|
39
|
+
|
|
40
|
+
# Endpoint para teste de latência
|
|
41
|
+
API_ENDPOINT = "api.anthropic.com"
|
|
42
|
+
|
|
43
|
+
# Monitor defaults
|
|
44
|
+
MONITOR_DEFAULTS = {
|
|
45
|
+
"interval": 30,
|
|
46
|
+
"duration": 300,
|
|
47
|
+
"alert_cpu": 80,
|
|
48
|
+
"alert_ram": 85,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def classify(value, metric_name):
|
|
53
|
+
"""Classifica um valor como 'ok', 'warning' ou 'critical'."""
|
|
54
|
+
t = THRESHOLDS.get(metric_name, {})
|
|
55
|
+
|
|
56
|
+
# Métricas onde "abaixo" é ruim (disco livre)
|
|
57
|
+
if "critical_below" in t:
|
|
58
|
+
if value < t["critical_below"]:
|
|
59
|
+
return "critical"
|
|
60
|
+
elif value < t["warning_below"]:
|
|
61
|
+
return "warning"
|
|
62
|
+
return "ok"
|
|
63
|
+
|
|
64
|
+
# Métricas onde "acima" é ruim (CPU, RAM, latência)
|
|
65
|
+
if value <= t.get("ok", 999999):
|
|
66
|
+
return "ok"
|
|
67
|
+
elif value <= t.get("warning", 999999):
|
|
68
|
+
return "warning"
|
|
69
|
+
return "critical"
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Claude Monitor — Diagnóstico Rápido de Performance
|
|
4
|
+
|
|
5
|
+
Analisa CPU, RAM, browsers, disco e rede em ~3 segundos.
|
|
6
|
+
Identifica o gargalo principal e sugere ações corretivas.
|
|
7
|
+
|
|
8
|
+
Uso:
|
|
9
|
+
python health_check.py # Diagnóstico completo
|
|
10
|
+
python health_check.py --browsers-detail # Detalhe de browsers
|
|
11
|
+
python health_check.py --json # Output JSON puro
|
|
12
|
+
python health_check.py --quick # Só resumo (sem teste de rede)
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
import socket
|
|
18
|
+
import subprocess
|
|
19
|
+
import sys
|
|
20
|
+
import time
|
|
21
|
+
from datetime import datetime
|
|
22
|
+
from pathlib import Path
|
|
23
|
+
|
|
24
|
+
# Garante que psutil está disponível
|
|
25
|
+
try:
|
|
26
|
+
import psutil
|
|
27
|
+
except ImportError:
|
|
28
|
+
print("Instalando psutil...")
|
|
29
|
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "psutil", "--quiet"])
|
|
30
|
+
import psutil
|
|
31
|
+
|
|
32
|
+
# Importa config do mesmo diretório
|
|
33
|
+
sys.path.insert(0, str(Path(__file__).parent))
|
|
34
|
+
from config import (
|
|
35
|
+
BROWSER_NAMES, CLAUDE_NAMES, API_ENDPOINT,
|
|
36
|
+
THRESHOLDS, classify
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def check_cpu():
|
|
41
|
+
"""Verifica uso de CPU."""
|
|
42
|
+
cpu_percent = psutil.cpu_percent(interval=1)
|
|
43
|
+
cpu_count = psutil.cpu_count()
|
|
44
|
+
per_cpu = psutil.cpu_percent(interval=0, percpu=True)
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
"percent": cpu_percent,
|
|
48
|
+
"cores": cpu_count,
|
|
49
|
+
"per_core": per_cpu,
|
|
50
|
+
"status": classify(cpu_percent, "cpu"),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def check_ram():
|
|
55
|
+
"""Verifica uso de RAM."""
|
|
56
|
+
ram = psutil.virtual_memory()
|
|
57
|
+
swap = psutil.swap_memory()
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
"total_gb": round(ram.total / 1024**3, 1),
|
|
61
|
+
"used_gb": round(ram.used / 1024**3, 1),
|
|
62
|
+
"available_gb": round(ram.available / 1024**3, 1),
|
|
63
|
+
"percent": ram.percent,
|
|
64
|
+
"swap_used_gb": round(swap.used / 1024**3, 1),
|
|
65
|
+
"swap_percent": swap.percent,
|
|
66
|
+
"status": classify(ram.percent, "ram_percent"),
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def check_browsers(detail=False):
|
|
71
|
+
"""Verifica processos de browser e consumo de RAM."""
|
|
72
|
+
browsers = {}
|
|
73
|
+
all_procs = []
|
|
74
|
+
|
|
75
|
+
for proc in psutil.process_iter(["pid", "name", "memory_info"]):
|
|
76
|
+
try:
|
|
77
|
+
info = proc.info
|
|
78
|
+
name_lower = info["name"].lower()
|
|
79
|
+
ram_mb = info["memory_info"].rss / 1024**2
|
|
80
|
+
|
|
81
|
+
for bname in BROWSER_NAMES:
|
|
82
|
+
if bname in name_lower:
|
|
83
|
+
if bname not in browsers:
|
|
84
|
+
browsers[bname] = {"count": 0, "ram_mb": 0, "pids": []}
|
|
85
|
+
browsers[bname]["count"] += 1
|
|
86
|
+
browsers[bname]["ram_mb"] += ram_mb
|
|
87
|
+
if detail:
|
|
88
|
+
browsers[bname]["pids"].append({
|
|
89
|
+
"pid": info["pid"],
|
|
90
|
+
"ram_mb": round(ram_mb, 0)
|
|
91
|
+
})
|
|
92
|
+
break
|
|
93
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
94
|
+
pass
|
|
95
|
+
|
|
96
|
+
total_ram_gb = sum(b["ram_mb"] for b in browsers.values()) / 1024
|
|
97
|
+
total_procs = sum(b["count"] for b in browsers.values())
|
|
98
|
+
|
|
99
|
+
# Formata para output
|
|
100
|
+
for bname in browsers:
|
|
101
|
+
browsers[bname]["ram_mb"] = round(browsers[bname]["ram_mb"], 0)
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
"browsers": browsers,
|
|
105
|
+
"total_ram_gb": round(total_ram_gb, 1),
|
|
106
|
+
"total_processes": total_procs,
|
|
107
|
+
"ram_status": classify(total_ram_gb, "browsers_ram_gb"),
|
|
108
|
+
"process_status": classify(total_procs, "browsers_processes"),
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def check_claude_processes():
|
|
113
|
+
"""Verifica processos do Claude Code."""
|
|
114
|
+
claude_procs = []
|
|
115
|
+
total_ram = 0
|
|
116
|
+
|
|
117
|
+
for proc in psutil.process_iter(["pid", "name", "memory_info", "cpu_percent"]):
|
|
118
|
+
try:
|
|
119
|
+
info = proc.info
|
|
120
|
+
name_lower = info["name"].lower()
|
|
121
|
+
|
|
122
|
+
for cname in CLAUDE_NAMES:
|
|
123
|
+
if cname in name_lower:
|
|
124
|
+
ram_mb = info["memory_info"].rss / 1024**2
|
|
125
|
+
claude_procs.append({
|
|
126
|
+
"pid": info["pid"],
|
|
127
|
+
"name": info["name"],
|
|
128
|
+
"ram_mb": round(ram_mb, 0),
|
|
129
|
+
})
|
|
130
|
+
total_ram += ram_mb
|
|
131
|
+
break
|
|
132
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
133
|
+
pass
|
|
134
|
+
|
|
135
|
+
claude_procs.sort(key=lambda x: x["ram_mb"], reverse=True)
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
"count": len(claude_procs),
|
|
139
|
+
"total_ram_gb": round(total_ram / 1024, 1),
|
|
140
|
+
"processes": claude_procs[:10], # Top 10
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def check_disk():
|
|
145
|
+
"""Verifica espaço em disco."""
|
|
146
|
+
disk = psutil.disk_usage("C:/")
|
|
147
|
+
free_percent = 100 - disk.percent
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
"total_gb": round(disk.total / 1024**3, 0),
|
|
151
|
+
"used_gb": round(disk.used / 1024**3, 0),
|
|
152
|
+
"free_gb": round(disk.free / 1024**3, 0),
|
|
153
|
+
"used_percent": disk.percent,
|
|
154
|
+
"free_percent": round(free_percent, 1),
|
|
155
|
+
"status": classify(free_percent, "disk_free_percent"),
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def check_network():
|
|
160
|
+
"""Testa latência até a API do Claude."""
|
|
161
|
+
try:
|
|
162
|
+
start = time.time()
|
|
163
|
+
sock = socket.create_connection((API_ENDPOINT, 443), timeout=5)
|
|
164
|
+
latency_ms = round((time.time() - start) * 1000, 0)
|
|
165
|
+
sock.close()
|
|
166
|
+
|
|
167
|
+
return {
|
|
168
|
+
"latency_ms": latency_ms,
|
|
169
|
+
"endpoint": API_ENDPOINT,
|
|
170
|
+
"reachable": True,
|
|
171
|
+
"status": classify(latency_ms, "network_latency_ms"),
|
|
172
|
+
}
|
|
173
|
+
except (socket.timeout, socket.error, OSError) as e:
|
|
174
|
+
return {
|
|
175
|
+
"latency_ms": None,
|
|
176
|
+
"endpoint": API_ENDPOINT,
|
|
177
|
+
"reachable": False,
|
|
178
|
+
"status": "critical",
|
|
179
|
+
"error": str(e),
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def check_top_processes(n=10):
|
|
184
|
+
"""Lista os N processos que mais consomem RAM."""
|
|
185
|
+
procs = []
|
|
186
|
+
for proc in psutil.process_iter(["pid", "name", "memory_info"]):
|
|
187
|
+
try:
|
|
188
|
+
info = proc.info
|
|
189
|
+
procs.append({
|
|
190
|
+
"name": info["name"],
|
|
191
|
+
"ram_mb": round(info["memory_info"].rss / 1024**2, 0),
|
|
192
|
+
"pid": info["pid"],
|
|
193
|
+
})
|
|
194
|
+
except (psutil.NoSuchProcess, psutil.AccessDenied):
|
|
195
|
+
pass
|
|
196
|
+
|
|
197
|
+
procs.sort(key=lambda x: x["ram_mb"], reverse=True)
|
|
198
|
+
return procs[:n]
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
def diagnose(results):
|
|
202
|
+
"""Analisa os resultados e gera diagnóstico."""
|
|
203
|
+
issues = []
|
|
204
|
+
suggestions = []
|
|
205
|
+
bottleneck = "ok"
|
|
206
|
+
severity = "ok"
|
|
207
|
+
|
|
208
|
+
cpu = results["cpu"]
|
|
209
|
+
ram = results["ram"]
|
|
210
|
+
browsers = results["browsers"]
|
|
211
|
+
disk = results["disk"]
|
|
212
|
+
network = results.get("network", {})
|
|
213
|
+
claude = results["claude"]
|
|
214
|
+
|
|
215
|
+
# CPU
|
|
216
|
+
if cpu["status"] == "critical":
|
|
217
|
+
issues.append(f"CPU a {cpu['percent']}% (CRITICO)")
|
|
218
|
+
suggestions.append("Fechar aplicativos pesados ou abas de browser desnecessarias")
|
|
219
|
+
suggestions.append("Verificar se Windows Update ou antivirus esta rodando em background")
|
|
220
|
+
bottleneck = "cpu"
|
|
221
|
+
severity = "critical"
|
|
222
|
+
elif cpu["status"] == "warning":
|
|
223
|
+
issues.append(f"CPU a {cpu['percent']}% (elevada)")
|
|
224
|
+
suggestions.append("Considerar fechar algumas abas de browser")
|
|
225
|
+
if severity != "critical":
|
|
226
|
+
bottleneck = "cpu"
|
|
227
|
+
severity = "warning"
|
|
228
|
+
|
|
229
|
+
# RAM
|
|
230
|
+
if ram["status"] == "critical":
|
|
231
|
+
issues.append(f"RAM a {ram['percent']}% ({ram['used_gb']} de {ram['total_gb']} GB)")
|
|
232
|
+
suggestions.append("Fechar browsers ou aplicativos para liberar memoria")
|
|
233
|
+
if severity != "critical":
|
|
234
|
+
bottleneck = "ram"
|
|
235
|
+
severity = "critical"
|
|
236
|
+
elif ram["status"] == "warning":
|
|
237
|
+
issues.append(f"RAM a {ram['percent']}% (monitorar)")
|
|
238
|
+
|
|
239
|
+
# Browsers
|
|
240
|
+
if browsers["ram_status"] == "critical":
|
|
241
|
+
issues.append(f"Browsers consumindo {browsers['total_ram_gb']} GB ({browsers['total_processes']} processos)")
|
|
242
|
+
suggestions.append("Fechar abas desnecessarias nos browsers")
|
|
243
|
+
browser_detail = []
|
|
244
|
+
for bname, info in browsers["browsers"].items():
|
|
245
|
+
browser_detail.append(f" - {bname}: {info['count']} processos, {info['ram_mb']:.0f} MB")
|
|
246
|
+
suggestions.append("Detalhamento:\n" + "\n".join(browser_detail))
|
|
247
|
+
if bottleneck == "ok":
|
|
248
|
+
bottleneck = "browsers"
|
|
249
|
+
if severity == "ok":
|
|
250
|
+
severity = "warning"
|
|
251
|
+
elif browsers["ram_status"] == "warning":
|
|
252
|
+
issues.append(f"Browsers usando {browsers['total_ram_gb']} GB (moderado)")
|
|
253
|
+
|
|
254
|
+
# Disco
|
|
255
|
+
if disk["status"] == "critical":
|
|
256
|
+
issues.append(f"Disco quase cheio: apenas {disk['free_gb']:.0f} GB livres ({disk['free_percent']}%)")
|
|
257
|
+
suggestions.append("Limpar arquivos temporarios, cache e lixeira")
|
|
258
|
+
suggestions.append("Verificar pasta Downloads e Temp por arquivos grandes")
|
|
259
|
+
if bottleneck == "ok":
|
|
260
|
+
bottleneck = "disk"
|
|
261
|
+
severity = "warning"
|
|
262
|
+
elif disk["status"] == "warning":
|
|
263
|
+
issues.append(f"Disco com {disk['free_gb']:.0f} GB livres ({disk['free_percent']}%)")
|
|
264
|
+
|
|
265
|
+
# Rede
|
|
266
|
+
if network.get("status") == "critical":
|
|
267
|
+
if not network.get("reachable"):
|
|
268
|
+
issues.append("API do Claude INACESSIVEL")
|
|
269
|
+
suggestions.append("Verificar conexao com internet")
|
|
270
|
+
suggestions.append("Verificar se VPN ou proxy esta bloqueando")
|
|
271
|
+
bottleneck = "network"
|
|
272
|
+
severity = "critical"
|
|
273
|
+
else:
|
|
274
|
+
issues.append(f"Latencia alta para API: {network['latency_ms']}ms")
|
|
275
|
+
suggestions.append("Verificar qualidade da conexao WiFi/cabo")
|
|
276
|
+
if bottleneck == "ok":
|
|
277
|
+
bottleneck = "network"
|
|
278
|
+
severity = "warning"
|
|
279
|
+
|
|
280
|
+
# Claude Code RAM
|
|
281
|
+
if claude["total_ram_gb"] > 8:
|
|
282
|
+
issues.append(f"Claude Code usando {claude['total_ram_gb']} GB ({claude['count']} processos)")
|
|
283
|
+
suggestions.append("Considerar fechar sessoes de conversa antigas no Claude Code")
|
|
284
|
+
|
|
285
|
+
# Tudo ok
|
|
286
|
+
if not issues:
|
|
287
|
+
issues.append("Sistema saudavel, sem gargalos detectados")
|
|
288
|
+
suggestions.append("A lentidao pode ser temporaria (pico na API do Claude)")
|
|
289
|
+
suggestions.append("Tente trocar de sessao novamente em alguns segundos")
|
|
290
|
+
|
|
291
|
+
# Gerar resumo em PT-BR
|
|
292
|
+
summary_lines = ["## Diagnostico de Performance\n"]
|
|
293
|
+
|
|
294
|
+
status_emoji = {"critical": "[!!!]", "warning": "[!]", "ok": "[OK]"}
|
|
295
|
+
summary_lines.append(f"**Status geral: {status_emoji[severity]} {severity.upper()}**\n")
|
|
296
|
+
|
|
297
|
+
if bottleneck != "ok":
|
|
298
|
+
summary_lines.append(f"**Gargalo principal: {bottleneck.upper()}**\n")
|
|
299
|
+
|
|
300
|
+
summary_lines.append("### Problemas detectados:")
|
|
301
|
+
for issue in issues:
|
|
302
|
+
summary_lines.append(f"- {issue}")
|
|
303
|
+
|
|
304
|
+
summary_lines.append("\n### Acoes recomendadas:")
|
|
305
|
+
for i, sug in enumerate(suggestions, 1):
|
|
306
|
+
if "\n" in sug:
|
|
307
|
+
summary_lines.append(f"{i}. {sug}")
|
|
308
|
+
else:
|
|
309
|
+
summary_lines.append(f"{i}. {sug}")
|
|
310
|
+
|
|
311
|
+
summary_lines.append(f"\n### Numeros-chave:")
|
|
312
|
+
summary_lines.append(f"- CPU: {cpu['percent']}% | RAM: {ram['percent']}% ({ram['used_gb']}/{ram['total_gb']} GB)")
|
|
313
|
+
summary_lines.append(f"- Browsers: {browsers['total_processes']} processos, {browsers['total_ram_gb']} GB")
|
|
314
|
+
summary_lines.append(f"- Claude Code: {claude['count']} processos, {claude['total_ram_gb']} GB")
|
|
315
|
+
summary_lines.append(f"- Disco C: {disk['free_gb']:.0f} GB livres ({disk['free_percent']}%)")
|
|
316
|
+
if network.get("latency_ms"):
|
|
317
|
+
summary_lines.append(f"- Latencia API: {network['latency_ms']}ms")
|
|
318
|
+
|
|
319
|
+
return {
|
|
320
|
+
"bottleneck": bottleneck,
|
|
321
|
+
"severity": severity,
|
|
322
|
+
"issues": issues,
|
|
323
|
+
"suggestions": suggestions,
|
|
324
|
+
"summary": "\n".join(summary_lines),
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def main():
|
|
329
|
+
import argparse
|
|
330
|
+
|
|
331
|
+
parser = argparse.ArgumentParser(description="Claude Monitor - Diagnostico Rapido")
|
|
332
|
+
parser.add_argument("--browsers-detail", action="store_true", help="Mostra detalhes por browser")
|
|
333
|
+
parser.add_argument("--json", action="store_true", help="Output em JSON puro")
|
|
334
|
+
parser.add_argument("--quick", action="store_true", help="Pula teste de rede")
|
|
335
|
+
args = parser.parse_args()
|
|
336
|
+
|
|
337
|
+
results = {}
|
|
338
|
+
|
|
339
|
+
# Coleta dados
|
|
340
|
+
results["timestamp"] = datetime.now().isoformat()
|
|
341
|
+
results["cpu"] = check_cpu()
|
|
342
|
+
results["ram"] = check_ram()
|
|
343
|
+
results["browsers"] = check_browsers(detail=args.browsers_detail)
|
|
344
|
+
results["claude"] = check_claude_processes()
|
|
345
|
+
results["disk"] = check_disk()
|
|
346
|
+
results["top_processes"] = check_top_processes(15)
|
|
347
|
+
|
|
348
|
+
if not args.quick:
|
|
349
|
+
results["network"] = check_network()
|
|
350
|
+
|
|
351
|
+
# Diagnóstico
|
|
352
|
+
results["diagnosis"] = diagnose(results)
|
|
353
|
+
|
|
354
|
+
if args.json:
|
|
355
|
+
print(json.dumps(results, indent=2, ensure_ascii=False))
|
|
356
|
+
else:
|
|
357
|
+
print(results["diagnosis"]["summary"])
|
|
358
|
+
print(f"\n(Para output completo em JSON, use: python health_check.py --json)")
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
if __name__ == "__main__":
|
|
362
|
+
main()
|