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,481 @@
|
|
|
1
|
+
"""007 Quick Scan -- Fast automated security scan of a target directory.
|
|
2
|
+
|
|
3
|
+
Recursively scans files in a target directory for secret patterns, dangerous
|
|
4
|
+
code constructs, permission issues, and oversized files. Produces a scored
|
|
5
|
+
summary report in text or JSON format.
|
|
6
|
+
|
|
7
|
+
Usage:
|
|
8
|
+
python quick_scan.py --target /path/to/project
|
|
9
|
+
python quick_scan.py --target /path/to/project --output json --verbose
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import argparse
|
|
13
|
+
import json
|
|
14
|
+
import os
|
|
15
|
+
import stat
|
|
16
|
+
import sys
|
|
17
|
+
import time
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
# ---------------------------------------------------------------------------
|
|
21
|
+
# Imports from the 007 config hub (same directory)
|
|
22
|
+
# ---------------------------------------------------------------------------
|
|
23
|
+
sys.path.insert(0, str(Path(__file__).resolve().parent))
|
|
24
|
+
|
|
25
|
+
from config import (
|
|
26
|
+
SCANNABLE_EXTENSIONS,
|
|
27
|
+
SKIP_DIRECTORIES,
|
|
28
|
+
SECRET_PATTERNS,
|
|
29
|
+
DANGEROUS_PATTERNS,
|
|
30
|
+
LIMITS,
|
|
31
|
+
SEVERITY,
|
|
32
|
+
ensure_directories,
|
|
33
|
+
get_verdict,
|
|
34
|
+
get_timestamp,
|
|
35
|
+
log_audit_event,
|
|
36
|
+
setup_logging,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
# ---------------------------------------------------------------------------
|
|
40
|
+
# Constants local to the quick scan
|
|
41
|
+
# ---------------------------------------------------------------------------
|
|
42
|
+
|
|
43
|
+
SCORE_DEDUCTIONS = {
|
|
44
|
+
"CRITICAL": 10,
|
|
45
|
+
"HIGH": 5,
|
|
46
|
+
"MEDIUM": 2,
|
|
47
|
+
"LOW": 1,
|
|
48
|
+
"INFO": 0,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
REDACT_KEEP_CHARS = 6 # Number of leading chars to keep in redacted snippets
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
# ---------------------------------------------------------------------------
|
|
55
|
+
# Helpers
|
|
56
|
+
# ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
def _redact(text: str) -> str:
|
|
59
|
+
"""Return a redacted version of *text*, keeping only the first few chars."""
|
|
60
|
+
text = text.strip()
|
|
61
|
+
if len(text) <= REDACT_KEEP_CHARS:
|
|
62
|
+
return text
|
|
63
|
+
return text[:REDACT_KEEP_CHARS] + "****"
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _snippet(line: str, match_start: int, context: int = 40) -> str:
|
|
67
|
+
"""Extract a short redacted snippet around the match position."""
|
|
68
|
+
start = max(0, match_start - context // 2)
|
|
69
|
+
end = min(len(line), match_start + context)
|
|
70
|
+
raw = line[start:end].strip()
|
|
71
|
+
return _redact(raw)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def _should_skip_dir(name: str) -> bool:
|
|
75
|
+
"""Return True if directory *name* should be skipped."""
|
|
76
|
+
return name in SKIP_DIRECTORIES
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def _is_scannable(path: Path) -> bool:
|
|
80
|
+
"""Return True if the file extension is in the SCANNABLE_EXTENSIONS set."""
|
|
81
|
+
# Handle compound suffixes like .env.example
|
|
82
|
+
name = path.name
|
|
83
|
+
for ext in SCANNABLE_EXTENSIONS:
|
|
84
|
+
if name.endswith(ext):
|
|
85
|
+
return True
|
|
86
|
+
# Also check the normal suffix
|
|
87
|
+
return path.suffix.lower() in SCANNABLE_EXTENSIONS
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def _check_permissions(filepath: Path) -> dict | None:
|
|
91
|
+
"""Check for overly permissive file modes on Unix-like systems.
|
|
92
|
+
|
|
93
|
+
Returns a finding dict or None.
|
|
94
|
+
"""
|
|
95
|
+
# Only meaningful on systems that implement os.stat st_mode properly
|
|
96
|
+
if sys.platform == "win32":
|
|
97
|
+
return None
|
|
98
|
+
try:
|
|
99
|
+
mode = filepath.stat().st_mode
|
|
100
|
+
perms = stat.S_IMODE(mode)
|
|
101
|
+
if perms & 0o777 == 0o777:
|
|
102
|
+
return {
|
|
103
|
+
"type": "permission",
|
|
104
|
+
"pattern": "world_rwx_0777",
|
|
105
|
+
"severity": "HIGH",
|
|
106
|
+
"file": str(filepath),
|
|
107
|
+
"line": 0,
|
|
108
|
+
"snippet": f"mode={oct(perms)}",
|
|
109
|
+
}
|
|
110
|
+
if perms & 0o666 == 0o666:
|
|
111
|
+
return {
|
|
112
|
+
"type": "permission",
|
|
113
|
+
"pattern": "world_rw_0666",
|
|
114
|
+
"severity": "MEDIUM",
|
|
115
|
+
"file": str(filepath),
|
|
116
|
+
"line": 0,
|
|
117
|
+
"snippet": f"mode={oct(perms)}",
|
|
118
|
+
}
|
|
119
|
+
except OSError:
|
|
120
|
+
pass
|
|
121
|
+
return None
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# ---------------------------------------------------------------------------
|
|
125
|
+
# Core scanning logic
|
|
126
|
+
# ---------------------------------------------------------------------------
|
|
127
|
+
|
|
128
|
+
def collect_files(target: Path, logger) -> list[Path]:
|
|
129
|
+
"""Walk *target* recursively and return scannable file paths.
|
|
130
|
+
|
|
131
|
+
Respects SKIP_DIRECTORIES and SCANNABLE_EXTENSIONS from config.
|
|
132
|
+
Stops at LIMITS['max_files_per_scan'] with a warning.
|
|
133
|
+
"""
|
|
134
|
+
files: list[Path] = []
|
|
135
|
+
max_files = LIMITS["max_files_per_scan"]
|
|
136
|
+
|
|
137
|
+
for root, dirs, filenames in os.walk(target):
|
|
138
|
+
# Prune skipped directories in-place so os.walk does not descend
|
|
139
|
+
dirs[:] = [d for d in dirs if not _should_skip_dir(d)]
|
|
140
|
+
|
|
141
|
+
for fname in filenames:
|
|
142
|
+
if len(files) >= max_files:
|
|
143
|
+
logger.warning(
|
|
144
|
+
"Reached max_files_per_scan limit (%d). Stopping collection.", max_files
|
|
145
|
+
)
|
|
146
|
+
return files
|
|
147
|
+
|
|
148
|
+
fpath = Path(root) / fname
|
|
149
|
+
if _is_scannable(fpath):
|
|
150
|
+
files.append(fpath)
|
|
151
|
+
|
|
152
|
+
return files
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
def scan_file(filepath: Path, verbose: bool = False, logger=None) -> list[dict]:
|
|
156
|
+
"""Scan a single file for secrets and dangerous patterns.
|
|
157
|
+
|
|
158
|
+
Returns a list of finding dicts.
|
|
159
|
+
"""
|
|
160
|
+
findings: list[dict] = []
|
|
161
|
+
max_findings = LIMITS["max_findings_per_file"]
|
|
162
|
+
|
|
163
|
+
try:
|
|
164
|
+
size = filepath.stat().st_size
|
|
165
|
+
except OSError:
|
|
166
|
+
return findings
|
|
167
|
+
|
|
168
|
+
# Large file check
|
|
169
|
+
if size > LIMITS["max_file_size_bytes"]:
|
|
170
|
+
findings.append({
|
|
171
|
+
"type": "large_file",
|
|
172
|
+
"pattern": "exceeds_max_size",
|
|
173
|
+
"severity": "INFO",
|
|
174
|
+
"file": str(filepath),
|
|
175
|
+
"line": 0,
|
|
176
|
+
"snippet": f"size={size} bytes (limit={LIMITS['max_file_size_bytes']})",
|
|
177
|
+
})
|
|
178
|
+
return findings
|
|
179
|
+
|
|
180
|
+
# Permission check
|
|
181
|
+
perm_finding = _check_permissions(filepath)
|
|
182
|
+
if perm_finding:
|
|
183
|
+
findings.append(perm_finding)
|
|
184
|
+
|
|
185
|
+
# Read file content
|
|
186
|
+
try:
|
|
187
|
+
text = filepath.read_text(encoding="utf-8", errors="replace")
|
|
188
|
+
except OSError as exc:
|
|
189
|
+
if verbose and logger:
|
|
190
|
+
logger.debug("Cannot read %s: %s", filepath, exc)
|
|
191
|
+
return findings
|
|
192
|
+
|
|
193
|
+
lines = text.splitlines()
|
|
194
|
+
|
|
195
|
+
for line_num, line in enumerate(lines, start=1):
|
|
196
|
+
if len(findings) >= max_findings:
|
|
197
|
+
break
|
|
198
|
+
|
|
199
|
+
# -- Secret patterns --
|
|
200
|
+
for pattern_name, regex, severity in SECRET_PATTERNS:
|
|
201
|
+
m = regex.search(line)
|
|
202
|
+
if m:
|
|
203
|
+
findings.append({
|
|
204
|
+
"type": "secret",
|
|
205
|
+
"pattern": pattern_name,
|
|
206
|
+
"severity": severity,
|
|
207
|
+
"file": str(filepath),
|
|
208
|
+
"line": line_num,
|
|
209
|
+
"snippet": _snippet(line, m.start()),
|
|
210
|
+
})
|
|
211
|
+
|
|
212
|
+
# -- Dangerous code patterns --
|
|
213
|
+
for pattern_name, regex, severity in DANGEROUS_PATTERNS:
|
|
214
|
+
m = regex.search(line)
|
|
215
|
+
if m:
|
|
216
|
+
findings.append({
|
|
217
|
+
"type": "dangerous_code",
|
|
218
|
+
"pattern": pattern_name,
|
|
219
|
+
"severity": severity,
|
|
220
|
+
"file": str(filepath),
|
|
221
|
+
"line": line_num,
|
|
222
|
+
"snippet": "",
|
|
223
|
+
})
|
|
224
|
+
|
|
225
|
+
return findings
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
def compute_score(findings: list[dict]) -> int:
|
|
229
|
+
"""Compute a quick score starting at 100, deducting by severity.
|
|
230
|
+
|
|
231
|
+
Returns an integer score clamped between 0 and 100.
|
|
232
|
+
"""
|
|
233
|
+
score = 100
|
|
234
|
+
for f in findings:
|
|
235
|
+
deduction = SCORE_DEDUCTIONS.get(f["severity"], 0)
|
|
236
|
+
score -= deduction
|
|
237
|
+
return max(0, score)
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
# ---------------------------------------------------------------------------
|
|
241
|
+
# Aggregation
|
|
242
|
+
# ---------------------------------------------------------------------------
|
|
243
|
+
|
|
244
|
+
def aggregate_by_severity(findings: list[dict]) -> dict[str, int]:
|
|
245
|
+
"""Count findings per severity level."""
|
|
246
|
+
counts: dict[str, int] = {sev: 0 for sev in SEVERITY}
|
|
247
|
+
for f in findings:
|
|
248
|
+
sev = f.get("severity", "INFO")
|
|
249
|
+
if sev in counts:
|
|
250
|
+
counts[sev] += 1
|
|
251
|
+
return counts
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def top_critical_findings(findings: list[dict], n: int = 10) -> list[dict]:
|
|
255
|
+
"""Return the top *n* most critical findings, sorted by severity weight."""
|
|
256
|
+
sorted_findings = sorted(
|
|
257
|
+
findings,
|
|
258
|
+
key=lambda f: SEVERITY.get(f.get("severity", "INFO"), 0),
|
|
259
|
+
reverse=True,
|
|
260
|
+
)
|
|
261
|
+
return sorted_findings[:n]
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
# ---------------------------------------------------------------------------
|
|
265
|
+
# Report formatters
|
|
266
|
+
# ---------------------------------------------------------------------------
|
|
267
|
+
|
|
268
|
+
def format_text_report(
|
|
269
|
+
target: str,
|
|
270
|
+
total_files: int,
|
|
271
|
+
findings: list[dict],
|
|
272
|
+
severity_counts: dict[str, int],
|
|
273
|
+
score: int,
|
|
274
|
+
verdict: dict,
|
|
275
|
+
elapsed: float,
|
|
276
|
+
) -> str:
|
|
277
|
+
"""Build a human-readable text report."""
|
|
278
|
+
lines: list[str] = []
|
|
279
|
+
|
|
280
|
+
lines.append("=" * 70)
|
|
281
|
+
lines.append(" 007 QUICK SCAN REPORT")
|
|
282
|
+
lines.append("=" * 70)
|
|
283
|
+
lines.append("")
|
|
284
|
+
|
|
285
|
+
# Metadata
|
|
286
|
+
lines.append(f" Target: {target}")
|
|
287
|
+
lines.append(f" Timestamp: {get_timestamp()}")
|
|
288
|
+
lines.append(f" Duration: {elapsed:.2f}s")
|
|
289
|
+
lines.append(f" Files scanned: {total_files}")
|
|
290
|
+
lines.append(f" Total findings: {len(findings)}")
|
|
291
|
+
lines.append("")
|
|
292
|
+
|
|
293
|
+
# Severity breakdown
|
|
294
|
+
lines.append("-" * 70)
|
|
295
|
+
lines.append(" FINDINGS BY SEVERITY")
|
|
296
|
+
lines.append("-" * 70)
|
|
297
|
+
for sev in ("CRITICAL", "HIGH", "MEDIUM", "LOW", "INFO"):
|
|
298
|
+
count = severity_counts.get(sev, 0)
|
|
299
|
+
bar = "#" * min(count, 40)
|
|
300
|
+
lines.append(f" {sev:<10} {count:>5} {bar}")
|
|
301
|
+
lines.append("")
|
|
302
|
+
|
|
303
|
+
# Top critical findings
|
|
304
|
+
top = top_critical_findings(findings)
|
|
305
|
+
if top:
|
|
306
|
+
lines.append("-" * 70)
|
|
307
|
+
lines.append(" TOP FINDINGS (most critical first)")
|
|
308
|
+
lines.append("-" * 70)
|
|
309
|
+
for i, f in enumerate(top, start=1):
|
|
310
|
+
loc = f"{f['file']}:{f['line']}"
|
|
311
|
+
snippet_part = f" [{_redact(f['snippet'])}]" if f.get("snippet") else ""
|
|
312
|
+
lines.append(
|
|
313
|
+
f" {i:>2}. [{f['severity']:<8}] {f['type']}/{f['pattern']}"
|
|
314
|
+
)
|
|
315
|
+
lines.append(
|
|
316
|
+
f" {loc}{snippet_part}"
|
|
317
|
+
)
|
|
318
|
+
lines.append("")
|
|
319
|
+
|
|
320
|
+
# Score and verdict
|
|
321
|
+
lines.append("=" * 70)
|
|
322
|
+
lines.append(f" QUICK SCORE: {score} / 100")
|
|
323
|
+
lines.append(f" VERDICT: {verdict['emoji']} {verdict['label']}")
|
|
324
|
+
lines.append(f" {verdict['description']}")
|
|
325
|
+
lines.append("=" * 70)
|
|
326
|
+
lines.append("")
|
|
327
|
+
|
|
328
|
+
return "\n".join(lines)
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
def build_json_report(
|
|
332
|
+
target: str,
|
|
333
|
+
total_files: int,
|
|
334
|
+
findings: list[dict],
|
|
335
|
+
severity_counts: dict[str, int],
|
|
336
|
+
score: int,
|
|
337
|
+
verdict: dict,
|
|
338
|
+
elapsed: float,
|
|
339
|
+
) -> dict:
|
|
340
|
+
"""Build a structured JSON-serializable report dict."""
|
|
341
|
+
return {
|
|
342
|
+
"scan": "quick_scan",
|
|
343
|
+
"target": target,
|
|
344
|
+
"timestamp": get_timestamp(),
|
|
345
|
+
"duration_seconds": round(elapsed, 3),
|
|
346
|
+
"total_files_scanned": total_files,
|
|
347
|
+
"total_findings": len(findings),
|
|
348
|
+
"severity_counts": severity_counts,
|
|
349
|
+
"score": score,
|
|
350
|
+
"verdict": {
|
|
351
|
+
"label": verdict["label"],
|
|
352
|
+
"description": verdict["description"],
|
|
353
|
+
"emoji": verdict["emoji"],
|
|
354
|
+
},
|
|
355
|
+
"findings": findings,
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
# ---------------------------------------------------------------------------
|
|
360
|
+
# Main entry point
|
|
361
|
+
# ---------------------------------------------------------------------------
|
|
362
|
+
|
|
363
|
+
def run_scan(target_path: str, output_format: str = "text", verbose: bool = False) -> dict:
|
|
364
|
+
"""Execute the quick scan and return the JSON-style report dict.
|
|
365
|
+
|
|
366
|
+
Also prints the report to stdout in the requested format.
|
|
367
|
+
"""
|
|
368
|
+
logger = setup_logging("007-quick-scan")
|
|
369
|
+
ensure_directories()
|
|
370
|
+
|
|
371
|
+
target = Path(target_path).resolve()
|
|
372
|
+
if not target.exists():
|
|
373
|
+
logger.error("Target path does not exist: %s", target)
|
|
374
|
+
sys.exit(1)
|
|
375
|
+
if not target.is_dir():
|
|
376
|
+
logger.error("Target is not a directory: %s", target)
|
|
377
|
+
sys.exit(1)
|
|
378
|
+
|
|
379
|
+
logger.info("Starting quick scan of %s", target)
|
|
380
|
+
start_time = time.time()
|
|
381
|
+
|
|
382
|
+
# Collect files
|
|
383
|
+
files = collect_files(target, logger)
|
|
384
|
+
total_files = len(files)
|
|
385
|
+
logger.info("Collected %d scannable files", total_files)
|
|
386
|
+
|
|
387
|
+
# Scan each file
|
|
388
|
+
all_findings: list[dict] = []
|
|
389
|
+
max_report_findings = LIMITS["max_report_findings"]
|
|
390
|
+
|
|
391
|
+
for fpath in files:
|
|
392
|
+
if len(all_findings) >= max_report_findings:
|
|
393
|
+
logger.warning(
|
|
394
|
+
"Reached max_report_findings limit (%d). Truncating.", max_report_findings
|
|
395
|
+
)
|
|
396
|
+
break
|
|
397
|
+
|
|
398
|
+
file_findings = scan_file(fpath, verbose=verbose, logger=logger)
|
|
399
|
+
remaining = max_report_findings - len(all_findings)
|
|
400
|
+
all_findings.extend(file_findings[:remaining])
|
|
401
|
+
|
|
402
|
+
elapsed = time.time() - start_time
|
|
403
|
+
logger.info(
|
|
404
|
+
"Scan complete: %d files, %d findings in %.2fs",
|
|
405
|
+
total_files, len(all_findings), elapsed,
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
# Aggregation
|
|
409
|
+
severity_counts = aggregate_by_severity(all_findings)
|
|
410
|
+
score = compute_score(all_findings)
|
|
411
|
+
verdict = get_verdict(score)
|
|
412
|
+
|
|
413
|
+
# Audit log
|
|
414
|
+
log_audit_event(
|
|
415
|
+
action="quick_scan",
|
|
416
|
+
target=str(target),
|
|
417
|
+
result=f"score={score}, findings={len(all_findings)}, verdict={verdict['label']}",
|
|
418
|
+
details={
|
|
419
|
+
"total_files": total_files,
|
|
420
|
+
"severity_counts": severity_counts,
|
|
421
|
+
"duration_seconds": round(elapsed, 3),
|
|
422
|
+
},
|
|
423
|
+
)
|
|
424
|
+
|
|
425
|
+
# Build structured report (always, for return value)
|
|
426
|
+
report = build_json_report(
|
|
427
|
+
target=str(target),
|
|
428
|
+
total_files=total_files,
|
|
429
|
+
findings=all_findings,
|
|
430
|
+
severity_counts=severity_counts,
|
|
431
|
+
score=score,
|
|
432
|
+
verdict=verdict,
|
|
433
|
+
elapsed=elapsed,
|
|
434
|
+
)
|
|
435
|
+
|
|
436
|
+
# Output
|
|
437
|
+
if output_format == "json":
|
|
438
|
+
print(json.dumps(report, indent=2, ensure_ascii=False))
|
|
439
|
+
else:
|
|
440
|
+
print(format_text_report(
|
|
441
|
+
target=str(target),
|
|
442
|
+
total_files=total_files,
|
|
443
|
+
findings=all_findings,
|
|
444
|
+
severity_counts=severity_counts,
|
|
445
|
+
score=score,
|
|
446
|
+
verdict=verdict,
|
|
447
|
+
elapsed=elapsed,
|
|
448
|
+
))
|
|
449
|
+
|
|
450
|
+
return report
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
# ---------------------------------------------------------------------------
|
|
454
|
+
# CLI
|
|
455
|
+
# ---------------------------------------------------------------------------
|
|
456
|
+
|
|
457
|
+
if __name__ == "__main__":
|
|
458
|
+
parser = argparse.ArgumentParser(
|
|
459
|
+
description="007 Quick Scan -- Fast automated security scan of a target directory.",
|
|
460
|
+
epilog="Example: python quick_scan.py --target ./my-project --output json --verbose",
|
|
461
|
+
)
|
|
462
|
+
parser.add_argument(
|
|
463
|
+
"--target",
|
|
464
|
+
required=True,
|
|
465
|
+
help="Path to the directory to scan (required).",
|
|
466
|
+
)
|
|
467
|
+
parser.add_argument(
|
|
468
|
+
"--output",
|
|
469
|
+
choices=["text", "json"],
|
|
470
|
+
default="text",
|
|
471
|
+
help="Output format: 'text' (default) or 'json'.",
|
|
472
|
+
)
|
|
473
|
+
parser.add_argument(
|
|
474
|
+
"--verbose",
|
|
475
|
+
action="store_true",
|
|
476
|
+
default=False,
|
|
477
|
+
help="Enable verbose logging (debug-level messages).",
|
|
478
|
+
)
|
|
479
|
+
|
|
480
|
+
args = parser.parse_args()
|
|
481
|
+
run_scan(target_path=args.target, output_format=args.output, verbose=args.verbose)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# 007 Security Skill - Dependencies
|
|
2
|
+
# ==================================
|
|
3
|
+
#
|
|
4
|
+
# The 007 scanners, analyzers, and reporting tools are designed to work
|
|
5
|
+
# entirely with the Python standard library (stdlib). This means:
|
|
6
|
+
#
|
|
7
|
+
# - No pip install required for basic scanning and auditing
|
|
8
|
+
# - Works out of the box on any Python 3.10+ installation
|
|
9
|
+
# - Zero supply-chain risk from third-party dependencies
|
|
10
|
+
# - Portable across Windows, Linux, and macOS
|
|
11
|
+
#
|
|
12
|
+
# Modules used from stdlib:
|
|
13
|
+
# - re (regex-based pattern detection)
|
|
14
|
+
# - json (audit logs, reports, config files)
|
|
15
|
+
# - pathlib (cross-platform path handling)
|
|
16
|
+
# - logging (structured console output)
|
|
17
|
+
# - datetime (timestamps for audit trail)
|
|
18
|
+
# - ast (Python AST analysis for deeper code inspection)
|
|
19
|
+
# - os / os.path (filesystem traversal fallback)
|
|
20
|
+
# - sys (CLI argument handling)
|
|
21
|
+
# - hashlib (file hashing for change detection)
|
|
22
|
+
# - argparse (CLI interface for all scripts)
|
|
23
|
+
# - textwrap (report formatting)
|
|
24
|
+
# - collections (counters, defaultdicts for aggregation)
|
|
25
|
+
#
|
|
26
|
+
# No external dependencies required.
|
|
File without changes
|