openclaw-node-harness 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +184 -0
- package/bin/discord-read.js +228 -0
- package/bin/fleet-deploy.js +365 -0
- package/bin/lane-watchdog.js +232 -0
- package/bin/mesh-agent.js +714 -0
- package/bin/mesh-bridge.js +535 -0
- package/bin/mesh-deploy-listener.js +322 -0
- package/bin/mesh-deploy.js +1048 -0
- package/bin/mesh-health-publisher.js +247 -0
- package/bin/mesh-task-daemon.js +451 -0
- package/bin/mesh-tool-discord.js +293 -0
- package/bin/mesh.js +649 -0
- package/boot/manifest.yaml +187 -0
- package/cli.js +35 -0
- package/config/daemon.json.template +16 -0
- package/config/obsidian-sync.json.template +39 -0
- package/config/openclaw.json.template +124 -0
- package/config/transcript-sources.json.template +22 -0
- package/identity/AGENTS.md +201 -0
- package/identity/CLAUDE.md +64 -0
- package/identity/DELEGATION.md +304 -0
- package/identity/HEARTBEAT.md +163 -0
- package/identity/MEMORY_SPEC.md +368 -0
- package/identity/PRINCIPLES.md +81 -0
- package/identity/SOUL.md +48 -0
- package/identity/TOOLS.md +47 -0
- package/install.sh +895 -0
- package/lib/agent-activity.js +390 -0
- package/lib/kanban-io.js +352 -0
- package/lib/mesh-registry.js +194 -0
- package/lib/mesh-roles.js +13 -0
- package/lib/mesh-tasks.js +306 -0
- package/lib/nats-resolve.js +108 -0
- package/mission-control/README.md +36 -0
- package/mission-control/drizzle/0000_simple_silhouette.sql +62 -0
- package/mission-control/drizzle/meta/0000_snapshot.json +413 -0
- package/mission-control/drizzle/meta/_journal.json +13 -0
- package/mission-control/drizzle.config.ts +13 -0
- package/mission-control/eslint.config.mjs +18 -0
- package/mission-control/next.config.ts +7 -0
- package/mission-control/package-lock.json +10518 -0
- package/mission-control/package.json +49 -0
- package/mission-control/postcss.config.mjs +7 -0
- package/mission-control/public/file.svg +1 -0
- package/mission-control/public/globe.svg +1 -0
- package/mission-control/public/next.svg +1 -0
- package/mission-control/public/vercel.svg +1 -0
- package/mission-control/public/window.svg +1 -0
- package/mission-control/scripts/enrich-descriptions.js +193 -0
- package/mission-control/scripts/gen-chronology.js +102 -0
- package/mission-control/scripts/import-pipeline-v2.js +523 -0
- package/mission-control/scripts/import-pipeline.js +295 -0
- package/mission-control/src/app/api/activity/live/route.ts +27 -0
- package/mission-control/src/app/api/activity/route.ts +47 -0
- package/mission-control/src/app/api/burndown/route.ts +112 -0
- package/mission-control/src/app/api/critical-path/route.ts +159 -0
- package/mission-control/src/app/api/dependencies/route.ts +176 -0
- package/mission-control/src/app/api/memory/categories/route.ts +93 -0
- package/mission-control/src/app/api/memory/consolidate/route.ts +107 -0
- package/mission-control/src/app/api/memory/doc/route.ts +89 -0
- package/mission-control/src/app/api/memory/flush/route.ts +129 -0
- package/mission-control/src/app/api/memory/graph/route.ts +105 -0
- package/mission-control/src/app/api/memory/items/route.ts +86 -0
- package/mission-control/src/app/api/memory/list/route.ts +48 -0
- package/mission-control/src/app/api/memory/retrieve/route.ts +51 -0
- package/mission-control/src/app/api/memory/search/route.ts +143 -0
- package/mission-control/src/app/api/memory/sync/route.ts +23 -0
- package/mission-control/src/app/api/memory/wikilinks/route.ts +75 -0
- package/mission-control/src/app/api/mesh/events/route.ts +67 -0
- package/mission-control/src/app/api/mesh/nodes/route.ts +221 -0
- package/mission-control/src/app/api/mesh/tokens/route.ts +133 -0
- package/mission-control/src/app/api/projects/route.ts +102 -0
- package/mission-control/src/app/api/resolve-path/route.ts +92 -0
- package/mission-control/src/app/api/scheduler/tick/route.ts +38 -0
- package/mission-control/src/app/api/scheduler/waves/route.ts +54 -0
- package/mission-control/src/app/api/screenshot/route.ts +127 -0
- package/mission-control/src/app/api/settings/gateway/route.ts +92 -0
- package/mission-control/src/app/api/skills/[id]/health/route.ts +57 -0
- package/mission-control/src/app/api/skills/list/route.ts +41 -0
- package/mission-control/src/app/api/souls/[id]/evolution/route.ts +253 -0
- package/mission-control/src/app/api/souls/[id]/prompt/route.ts +205 -0
- package/mission-control/src/app/api/souls/[id]/propagate/route.ts +146 -0
- package/mission-control/src/app/api/souls/route.ts +174 -0
- package/mission-control/src/app/api/tasks/[id]/handoff/route.ts +115 -0
- package/mission-control/src/app/api/tasks/[id]/route.ts +266 -0
- package/mission-control/src/app/api/tasks/[id]/tree/route.ts +94 -0
- package/mission-control/src/app/api/tasks/route.ts +253 -0
- package/mission-control/src/app/api/tts/route.ts +47 -0
- package/mission-control/src/app/api/workspace/files/route.ts +88 -0
- package/mission-control/src/app/api/workspace/read/route.ts +73 -0
- package/mission-control/src/app/burndown/page.tsx +309 -0
- package/mission-control/src/app/calendar/page.tsx +839 -0
- package/mission-control/src/app/favicon.ico +0 -0
- package/mission-control/src/app/globals.css +67 -0
- package/mission-control/src/app/graph/page.tsx +352 -0
- package/mission-control/src/app/layout.tsx +35 -0
- package/mission-control/src/app/live/page.tsx +232 -0
- package/mission-control/src/app/memory/page.tsx +154 -0
- package/mission-control/src/app/mesh/page.tsx +457 -0
- package/mission-control/src/app/obsidian/page.tsx +252 -0
- package/mission-control/src/app/page.tsx +70 -0
- package/mission-control/src/app/roadmap/page.tsx +1757 -0
- package/mission-control/src/app/settings/page.tsx +260 -0
- package/mission-control/src/app/souls/page.tsx +573 -0
- package/mission-control/src/components/board/activity-timeline.tsx +96 -0
- package/mission-control/src/components/board/daily-board.tsx +373 -0
- package/mission-control/src/components/board/kanban-board.tsx +364 -0
- package/mission-control/src/components/board/kanban-column.tsx +105 -0
- package/mission-control/src/components/board/live-stream.tsx +116 -0
- package/mission-control/src/components/board/skill-health-card.tsx +128 -0
- package/mission-control/src/components/board/status-banner.tsx +124 -0
- package/mission-control/src/components/board/task-card.tsx +454 -0
- package/mission-control/src/components/board/unified-task-dialog.tsx +1043 -0
- package/mission-control/src/components/layout/resizable-layout.tsx +68 -0
- package/mission-control/src/components/layout/sidebar.tsx +90 -0
- package/mission-control/src/components/live/audio-spectrum.tsx +106 -0
- package/mission-control/src/components/live/chat-bubble.tsx +52 -0
- package/mission-control/src/components/live/chat-input.tsx +92 -0
- package/mission-control/src/components/memory/doc-reader.tsx +172 -0
- package/mission-control/src/components/memory/memory-list.tsx +169 -0
- package/mission-control/src/components/memory/search-bar.tsx +67 -0
- package/mission-control/src/components/memory/search-results.tsx +149 -0
- package/mission-control/src/components/obsidian/backlinks-panel.tsx +52 -0
- package/mission-control/src/components/obsidian/file-tree.tsx +186 -0
- package/mission-control/src/components/obsidian/local-graph.tsx +107 -0
- package/mission-control/src/components/obsidian/obsidian-graph.tsx +192 -0
- package/mission-control/src/components/obsidian/obsidian-reader.tsx +246 -0
- package/mission-control/src/lib/activity.ts +29 -0
- package/mission-control/src/lib/config.ts +21 -0
- package/mission-control/src/lib/db/index.ts +429 -0
- package/mission-control/src/lib/db/schema.ts +218 -0
- package/mission-control/src/lib/gateway-notify.ts +113 -0
- package/mission-control/src/lib/hooks.ts +536 -0
- package/mission-control/src/lib/memory/categories.ts +125 -0
- package/mission-control/src/lib/memory/entities.ts +482 -0
- package/mission-control/src/lib/memory/extract.ts +369 -0
- package/mission-control/src/lib/memory/retrieval.ts +281 -0
- package/mission-control/src/lib/memory/wikilinks.ts +147 -0
- package/mission-control/src/lib/nats.ts +126 -0
- package/mission-control/src/lib/parsers/clawvault-doc.ts +98 -0
- package/mission-control/src/lib/parsers/daily-log.ts +73 -0
- package/mission-control/src/lib/parsers/memory-md.ts +81 -0
- package/mission-control/src/lib/parsers/task-markdown.ts +459 -0
- package/mission-control/src/lib/parsers/transcript.ts +209 -0
- package/mission-control/src/lib/scheduler.ts +394 -0
- package/mission-control/src/lib/speech/use-speech-pipeline.ts +176 -0
- package/mission-control/src/lib/sync/memory.ts +224 -0
- package/mission-control/src/lib/sync/tasks.ts +271 -0
- package/mission-control/src/lib/tts/edge.ts +31 -0
- package/mission-control/src/lib/tts/google.ts +78 -0
- package/mission-control/src/lib/tts/index.ts +39 -0
- package/mission-control/src/lib/tts/types.ts +18 -0
- package/mission-control/tsconfig.json +42 -0
- package/obsidian-vault/.obsidian/app.json +10 -0
- package/obsidian-vault/.obsidian/community-plugins.json +8 -0
- package/obsidian-vault/.obsidian/graph.json +40 -0
- package/obsidian-vault/.obsidian/plugins/obsidian-local-rest-api/main.js +58769 -0
- package/obsidian-vault/.obsidian/plugins/obsidian-local-rest-api/manifest.json +10 -0
- package/obsidian-vault/.obsidian/plugins/obsidian-local-rest-api/styles.css +47 -0
- package/obsidian-vault/00-meta/.gitkeep +0 -0
- package/obsidian-vault/01-architecture/.gitkeep +0 -0
- package/obsidian-vault/02-smart-contracts/.gitkeep +0 -0
- package/obsidian-vault/03-backend/.gitkeep +0 -0
- package/obsidian-vault/04-mobile/.gitkeep +0 -0
- package/obsidian-vault/05-ar-mapping/.gitkeep +0 -0
- package/obsidian-vault/06-3d-assets/.gitkeep +0 -0
- package/obsidian-vault/07-sound-music/.gitkeep +0 -0
- package/obsidian-vault/08-lore/.gitkeep +0 -0
- package/obsidian-vault/09-quests-playthrough/.gitkeep +0 -0
- package/obsidian-vault/10-economy/.gitkeep +0 -0
- package/obsidian-vault/11-nft-assets/.gitkeep +0 -0
- package/obsidian-vault/12-nft-mechanics/.gitkeep +0 -0
- package/obsidian-vault/13-dao-guild-social/.gitkeep +0 -0
- package/obsidian-vault/14-game-progression/.gitkeep +0 -0
- package/obsidian-vault/15-analytics/.gitkeep +0 -0
- package/obsidian-vault/16-security/.gitkeep +0 -0
- package/obsidian-vault/17-devops/.gitkeep +0 -0
- package/obsidian-vault/18-marketplace/.gitkeep +0 -0
- package/obsidian-vault/19-decisions/.gitkeep +0 -0
- package/obsidian-vault/20-business-strategy/.gitkeep +0 -0
- package/obsidian-vault/21-legal-regulatory/.gitkeep +0 -0
- package/obsidian-vault/nodes/.gitkeep +0 -0
- package/openclaw.env.example +17 -0
- package/package.json +45 -0
- package/services/launchd/ai.openclaw.gateway.plist +59 -0
- package/services/launchd/ai.openclaw.lane-watchdog.plist +32 -0
- package/services/launchd/ai.openclaw.log-rotate.plist +28 -0
- package/services/launchd/ai.openclaw.memory-daemon.plist +36 -0
- package/services/launchd/ai.openclaw.mesh-agent.plist +38 -0
- package/services/launchd/ai.openclaw.mesh-bridge.plist +36 -0
- package/services/launchd/ai.openclaw.mesh-deploy-listener.plist +33 -0
- package/services/launchd/ai.openclaw.mesh-health-publisher.plist +29 -0
- package/services/launchd/ai.openclaw.mesh-task-daemon.plist +36 -0
- package/services/launchd/ai.openclaw.mesh-tool-discord.plist +36 -0
- package/services/launchd/ai.openclaw.mission-control.plist +41 -0
- package/services/service-manifest.json +13 -0
- package/services/systemd/openclaw-gateway.service +21 -0
- package/services/systemd/openclaw-lane-watchdog.service +21 -0
- package/services/systemd/openclaw-log-rotate.service +13 -0
- package/services/systemd/openclaw-log-rotate.timer +9 -0
- package/services/systemd/openclaw-memory-daemon.service +21 -0
- package/services/systemd/openclaw-mesh-agent.service +19 -0
- package/services/systemd/openclaw-mesh-bridge.service +21 -0
- package/services/systemd/openclaw-mesh-deploy-listener.service +23 -0
- package/services/systemd/openclaw-mesh-health-publisher.service +21 -0
- package/services/systemd/openclaw-mesh-task-daemon.service +21 -0
- package/services/systemd/openclaw-mesh-tool-discord.service +21 -0
- package/services/systemd/openclaw-mission-control.service +22 -0
- package/skills/1password/.clawhub/origin.json +7 -0
- package/skills/1password/SKILL.md +63 -0
- package/skills/1password/references/cli-examples.md +29 -0
- package/skills/1password/references/get-started.md +17 -0
- package/skills/acquisition-channel-advisor/SKILL.md +643 -0
- package/skills/acquisition-channel-advisor/examples/conversation-flow.md +531 -0
- package/skills/agent-browser/.clawhub/origin.json +7 -0
- package/skills/agent-browser/CONTRIBUTING.md +63 -0
- package/skills/agent-browser/SKILL.md +338 -0
- package/skills/agentic-compass/.clawhub/origin.json +7 -0
- package/skills/agentic-compass/README.md +96 -0
- package/skills/agentic-compass/SKILL.md +112 -0
- package/skills/agentic-compass/references/README.md +5 -0
- package/skills/agentic-compass/scripts/agentic-compass.py +196 -0
- package/skills/arcane-dev-ops/SKILL.md +61 -0
- package/skills/arcane-dev-ops/references/checklist.md +22 -0
- package/skills/arcane-dev-ops/references/validation-cases.md +11 -0
- package/skills/arcane-dev-ops/scripts/prepush_check.sh +41 -0
- package/skills/auto-updater/.clawhub/origin.json +7 -0
- package/skills/auto-updater/SKILL.md +158 -0
- package/skills/auto-updater/references/agent-guide.md +152 -0
- package/skills/auto-updater/references/summary-examples.md +109 -0
- package/skills/business-health-diagnostic/SKILL.md +782 -0
- package/skills/byterover/.clawhub/origin.json +7 -0
- package/skills/byterover/SKILL.md +105 -0
- package/skills/byterover/TROUBLESHOOTING.md +50 -0
- package/skills/byterover/WORKFLOWS.md +229 -0
- package/skills/capability-evolver/.clawhub/origin.json +7 -0
- package/skills/capability-evolver/CONTRIBUTING.md +11 -0
- package/skills/capability-evolver/README.md +157 -0
- package/skills/capability-evolver/README.zh-CN.md +112 -0
- package/skills/capability-evolver/SKILL.md +93 -0
- package/skills/capability-evolver/assets/gep/capsules.json +5 -0
- package/skills/capability-evolver/assets/gep/genes.json +104 -0
- package/skills/capability-evolver/index.js +59 -0
- package/skills/capability-evolver/package.json +22 -0
- package/skills/capability-evolver/scripts/analyze_by_skill.js +121 -0
- package/skills/capability-evolver/scripts/build_public.js +350 -0
- package/skills/capability-evolver/scripts/export_history.js +98 -0
- package/skills/capability-evolver/scripts/extract_log.js +85 -0
- package/skills/capability-evolver/scripts/generate_history.js +75 -0
- package/skills/capability-evolver/scripts/human_report.js +147 -0
- package/skills/capability-evolver/scripts/publish_public.js +516 -0
- package/skills/capability-evolver/scripts/suggest_version.js +89 -0
- package/skills/capability-evolver/src/evolve.js +594 -0
- package/skills/capability-evolver/src/gep/assetStore.js +204 -0
- package/skills/capability-evolver/src/gep/candidates.js +134 -0
- package/skills/capability-evolver/src/gep/paths.js +23 -0
- package/skills/capability-evolver/src/gep/prompt.js +254 -0
- package/skills/capability-evolver/src/gep/selector.js +89 -0
- package/skills/capability-evolver/src/gep/signals.js +27 -0
- package/skills/cc-godmode/.clawhub/origin.json +7 -0
- package/skills/cc-godmode/CHANGELOG.md +66 -0
- package/skills/cc-godmode/README.md +293 -0
- package/skills/cc-godmode/SKILL.md +242 -0
- package/skills/cc-godmode/docs/AGENTS.md +332 -0
- package/skills/cc-godmode/docs/MIGRATION.md +206 -0
- package/skills/cc-godmode/docs/TROUBLESHOOTING.md +357 -0
- package/skills/cc-godmode/docs/WORKFLOWS.md +329 -0
- package/skills/cc-godmode/references/agents.md +433 -0
- package/skills/cc-godmode/scripts/build-skill.js +232 -0
- package/skills/clawdbot-filesystem/.clawhub/origin.json +7 -0
- package/skills/clawdbot-filesystem/LICENSE.md +21 -0
- package/skills/clawdbot-filesystem/README.md +322 -0
- package/skills/clawdbot-filesystem/SKILL.md +219 -0
- package/skills/clawdbot-filesystem/config.json +41 -0
- package/skills/clawdbot-filesystem/package.json +69 -0
- package/skills/clawdbot-security-check/.clawhub/origin.json +7 -0
- package/skills/clawdbot-security-check/README.md +168 -0
- package/skills/clawdbot-security-check/SKILL.md +145 -0
- package/skills/clawdbot-security-check/references/audit-checks.md +521 -0
- package/skills/clawdbot-security-check/skill.json +42 -0
- package/skills/clawddocs/.clawhub/origin.json +7 -0
- package/skills/clawddocs/SKILL.md +176 -0
- package/skills/clawddocs/package.json +9 -0
- package/skills/clawddocs/scripts/build-index.sh +17 -0
- package/skills/clawddocs/scripts/cache.sh +13 -0
- package/skills/clawddocs/scripts/fetch-doc.sh +7 -0
- package/skills/clawddocs/scripts/recent.sh +5 -0
- package/skills/clawddocs/scripts/search.sh +8 -0
- package/skills/clawddocs/scripts/sitemap.sh +23 -0
- package/skills/clawddocs/scripts/track-changes.sh +16 -0
- package/skills/clawddocs/snippets/common-configs.md +69 -0
- package/skills/clawguard/.clawhub/origin.json +7 -0
- package/skills/clawguard/SKILL.md +137 -0
- package/skills/company-research/SKILL.md +393 -0
- package/skills/company-research/examples/sample.md +164 -0
- package/skills/company-research/template.md +60 -0
- package/skills/crypto-price/.clawhub/origin.json +7 -0
- package/skills/crypto-price/ARCHITECTURE.md +437 -0
- package/skills/crypto-price/README.md +194 -0
- package/skills/crypto-price/SKILL.md +61 -0
- package/skills/crypto-price/requirements.txt +1 -0
- package/skills/crypto-price/scripts/get_price_chart.py +988 -0
- package/skills/customer-journey-map/SKILL.md +343 -0
- package/skills/customer-journey-map/examples/sample.md +33 -0
- package/skills/customer-journey-map/template.md +28 -0
- package/skills/customer-journey-mapping-workshop/SKILL.md +522 -0
- package/skills/deep-research/.clawhub/origin.json +7 -0
- package/skills/deep-research/SKILL.md +93 -0
- package/skills/deep-research/rules/logic.md +32 -0
- package/skills/discord-telegram-triage/SKILL.md +59 -0
- package/skills/discord-telegram-triage/references/discord-runbook.md +28 -0
- package/skills/discord-telegram-triage/references/validation-cases.md +11 -0
- package/skills/discord-telegram-triage/scripts/triage_snapshot.sh +23 -0
- package/skills/discovery-interview-prep/SKILL.md +408 -0
- package/skills/discovery-process/SKILL.md +503 -0
- package/skills/discovery-process/examples/sample.md +60 -0
- package/skills/discovery-process/template.md +39 -0
- package/skills/dist/arcane-dev-ops.skill +0 -0
- package/skills/dist/discord-telegram-triage.skill +0 -0
- package/skills/dist/founder-brief-summarizer.skill +0 -0
- package/skills/epic-breakdown-advisor/SKILL.md +664 -0
- package/skills/epic-hypothesis/SKILL.md +285 -0
- package/skills/epic-hypothesis/examples/sample.md +104 -0
- package/skills/epic-hypothesis/template.md +30 -0
- package/skills/excel/.clawhub/origin.json +7 -0
- package/skills/excel/SKILL.md +332 -0
- package/skills/excel/scripts/excel.py +1120 -0
- package/skills/fast-browser-use/.clawhub/origin.json +7 -0
- package/skills/fast-browser-use/CODEBUDDY.md +142 -0
- package/skills/fast-browser-use/Cargo.toml +77 -0
- package/skills/fast-browser-use/README.md +62 -0
- package/skills/fast-browser-use/SKILL.md +217 -0
- package/skills/fast-browser-use/package-lock.json +28 -0
- package/skills/fast-browser-use/package.json +8 -0
- package/skills/fast-browser-use/rustfmt.toml +10 -0
- package/skills/fast-browser-use/src/bin/cli.rs +373 -0
- package/skills/fast-browser-use/src/bin/mcp_server.rs +203 -0
- package/skills/fast-browser-use/src/browser/config.rs +136 -0
- package/skills/fast-browser-use/src/browser/debug.rs +16 -0
- package/skills/fast-browser-use/src/browser/mod.rs +61 -0
- package/skills/fast-browser-use/src/browser/session.rs +478 -0
- package/skills/fast-browser-use/src/dom/element.rs +442 -0
- package/skills/fast-browser-use/src/dom/extract_dom.js +849 -0
- package/skills/fast-browser-use/src/dom/mod.rs +14 -0
- package/skills/fast-browser-use/src/dom/tree.rs +296 -0
- package/skills/fast-browser-use/src/dom/yaml.rs +149 -0
- package/skills/fast-browser-use/src/error.rs +115 -0
- package/skills/fast-browser-use/src/lib.rs +17 -0
- package/skills/fast-browser-use/src/mcp/handler.rs +63 -0
- package/skills/fast-browser-use/src/mcp/mod.rs +81 -0
- package/skills/fast-browser-use/src/tools/Readability.min.js +1480 -0
- package/skills/fast-browser-use/src/tools/annotate.rs +165 -0
- package/skills/fast-browser-use/src/tools/click.rs +84 -0
- package/skills/fast-browser-use/src/tools/close.rs +35 -0
- package/skills/fast-browser-use/src/tools/close_tab.rs +45 -0
- package/skills/fast-browser-use/src/tools/convert_to_markdown.js +117 -0
- package/skills/fast-browser-use/src/tools/cookies.rs +58 -0
- package/skills/fast-browser-use/src/tools/debug.rs +44 -0
- package/skills/fast-browser-use/src/tools/evaluate.rs +40 -0
- package/skills/fast-browser-use/src/tools/extract.rs +66 -0
- package/skills/fast-browser-use/src/tools/go_back.rs +35 -0
- package/skills/fast-browser-use/src/tools/go_forward.rs +35 -0
- package/skills/fast-browser-use/src/tools/hover.js +33 -0
- package/skills/fast-browser-use/src/tools/hover.rs +97 -0
- package/skills/fast-browser-use/src/tools/html_to_markdown.rs +99 -0
- package/skills/fast-browser-use/src/tools/input.rs +93 -0
- package/skills/fast-browser-use/src/tools/local_storage.rs +159 -0
- package/skills/fast-browser-use/src/tools/markdown.rs +181 -0
- package/skills/fast-browser-use/src/tools/mod.rs +326 -0
- package/skills/fast-browser-use/src/tools/navigate.rs +55 -0
- package/skills/fast-browser-use/src/tools/new_tab.rs +60 -0
- package/skills/fast-browser-use/src/tools/press_key.rs +78 -0
- package/skills/fast-browser-use/src/tools/read_links.rs +59 -0
- package/skills/fast-browser-use/src/tools/readability_script.rs +8 -0
- package/skills/fast-browser-use/src/tools/screenshot.rs +47 -0
- package/skills/fast-browser-use/src/tools/scroll.js +22 -0
- package/skills/fast-browser-use/src/tools/scroll.rs +95 -0
- package/skills/fast-browser-use/src/tools/select.js +23 -0
- package/skills/fast-browser-use/src/tools/select.rs +129 -0
- package/skills/fast-browser-use/src/tools/sitemap.rs +426 -0
- package/skills/fast-browser-use/src/tools/snapshot.rs +324 -0
- package/skills/fast-browser-use/src/tools/switch_tab.rs +69 -0
- package/skills/fast-browser-use/src/tools/tab_list.rs +76 -0
- package/skills/fast-browser-use/src/tools/utils.rs +92 -0
- package/skills/fast-browser-use/src/tools/wait.rs +53 -0
- package/skills/fast-browser-use/test_auth.json +3 -0
- package/skills/fast-browser-use/test_state.json +6 -0
- package/skills/fast-browser-use/tests/browser_tools_integration.rs +233 -0
- package/skills/fast-browser-use/tests/cli_recipes_integration.rs +112 -0
- package/skills/fast-browser-use/tests/cookies_integration.rs +56 -0
- package/skills/fast-browser-use/tests/debug_integration.rs +83 -0
- package/skills/fast-browser-use/tests/dom_integration.rs +170 -0
- package/skills/fast-browser-use/tests/local_storage_integration.rs +75 -0
- package/skills/fast-browser-use/tests/markdown_integration.rs +448 -0
- package/skills/fast-browser-use/tests/navigation_integration.rs +241 -0
- package/skills/fast-browser-use/tests/sitemap_integration.rs +326 -0
- package/skills/fast-browser-use/tests/tab_management_integration.rs +300 -0
- package/skills/feature-investment-advisor/SKILL.md +639 -0
- package/skills/feature-investment-advisor/examples/conversation-flow.md +538 -0
- package/skills/finance-based-pricing-advisor/SKILL.md +763 -0
- package/skills/finance-metrics-quickref/SKILL.md +309 -0
- package/skills/find-skills/.clawhub/origin.json +7 -0
- package/skills/find-skills/SKILL.md +143 -0
- package/skills/flavor-text-writer/SKILL.md +27 -0
- package/skills/founder-brief-summarizer/SKILL.md +52 -0
- package/skills/founder-brief-summarizer/references/response-templates.md +15 -0
- package/skills/founder-brief-summarizer/references/validation-cases.md +11 -0
- package/skills/founder-brief-summarizer/scripts/brief_template.sh +28 -0
- package/skills/frontend-design/.clawhub/origin.json +7 -0
- package/skills/frontend-design/LICENSE.txt +190 -0
- package/skills/frontend-design/SKILL.md +53 -0
- package/skills/gemini/.clawhub/origin.json +7 -0
- package/skills/gemini/SKILL.md +33 -0
- package/skills/gemini-deep-research/.clawhub/origin.json +7 -0
- package/skills/gemini-deep-research/SKILL.md +78 -0
- package/skills/gemini-deep-research/scripts/deep_research.py +176 -0
- package/skills/git-essentials/.clawhub/origin.json +7 -0
- package/skills/git-essentials/SKILL.md +239 -0
- package/skills/git-essentials/references/advanced.md +211 -0
- package/skills/github/.clawhub/origin.json +7 -0
- package/skills/github/SKILL.md +57 -0
- package/skills/google-drive/.clawhub/origin.json +7 -0
- package/skills/google-drive/LICENSE.txt +21 -0
- package/skills/google-drive/SKILL.md +320 -0
- package/skills/growth-loop/SKILL.md +270 -0
- package/skills/growth-loop/_meta.json +9 -0
- package/skills/growth-loop/references/diagnosis-framework.md +84 -0
- package/skills/growth-loop/references/platform-benchmarks.md +79 -0
- package/skills/growth-loop/scripts/init-campaign.sh +274 -0
- package/skills/humanize-ai-text/.clawhub/origin.json +7 -0
- package/skills/humanize-ai-text/SKILL.md +192 -0
- package/skills/humanize-ai-text/scripts/compare.py +58 -0
- package/skills/humanize-ai-text/scripts/detect.py +160 -0
- package/skills/humanize-ai-text/scripts/patterns.json +191 -0
- package/skills/humanize-ai-text/scripts/transform.py +127 -0
- package/skills/humanizer/.clawhub/origin.json +7 -0
- package/skills/humanizer/README.md +82 -0
- package/skills/humanizer/SKILL.md +443 -0
- package/skills/jobs-to-be-done/SKILL.md +378 -0
- package/skills/jobs-to-be-done/examples/sample.md +80 -0
- package/skills/jobs-to-be-done/template.md +65 -0
- package/skills/lean-ux-canvas/SKILL.md +561 -0
- package/skills/lean-ux-canvas/examples/sample.md +88 -0
- package/skills/lean-ux-canvas/template.md +32 -0
- package/skills/markdown-formatter/.clawhub/origin.json +7 -0
- package/skills/markdown-formatter/README.md +137 -0
- package/skills/markdown-formatter/SKILL.md +369 -0
- package/skills/markdown-formatter/config.json +20 -0
- package/skills/markdown-formatter/index.js +439 -0
- package/skills/markdown-formatter/package.json +23 -0
- package/skills/markdown-formatter/test.js +23 -0
- package/skills/marketing-mode/.clawhub/origin.json +7 -0
- package/skills/marketing-mode/README.md +49 -0
- package/skills/marketing-mode/SKILL.md +703 -0
- package/skills/marketing-mode/mode-prompt.md +39 -0
- package/skills/marketing-mode/skill.json +51 -0
- package/skills/memory-hygiene/.clawhub/origin.json +7 -0
- package/skills/memory-hygiene/SKILL.md +91 -0
- package/skills/memory-setup/.clawhub/origin.json +7 -0
- package/skills/memory-setup/SKILL.md +180 -0
- package/skills/memorylayer/.clawhub/origin.json +7 -0
- package/skills/memorylayer/README.md +197 -0
- package/skills/memorylayer/SKILL.md +227 -0
- package/skills/memorylayer/examples/agent-integration.js +145 -0
- package/skills/memorylayer/examples/basic-usage.js +87 -0
- package/skills/memorylayer/examples/token-savings-demo.js +183 -0
- package/skills/memorylayer/index.js +115 -0
- package/skills/memorylayer/package-lock.json +295 -0
- package/skills/memorylayer/package.json +27 -0
- package/skills/memorylayer/python/memorylayer_skill.py +230 -0
- package/skills/memorylayer/python/requirements.txt +7 -0
- package/skills/mesh/SKILL.md +184 -0
- package/skills/model-usage/.clawhub/origin.json +7 -0
- package/skills/model-usage/SKILL.md +54 -0
- package/skills/model-usage/references/codexbar-cli.md +28 -0
- package/skills/model-usage/scripts/model_usage.py +310 -0
- package/skills/moltbook-interact/.clawhub/origin.json +7 -0
- package/skills/moltbook-interact/INSTALL.md +139 -0
- package/skills/moltbook-interact/README.md +198 -0
- package/skills/moltbook-interact/SKILL.md +72 -0
- package/skills/moltbook-interact/references/api.md +106 -0
- package/skills/moltbook-interact/scripts/moltbook.sh +142 -0
- package/skills/moltbook-registry/.clawhub/origin.json +7 -0
- package/skills/moltbook-registry/README.md +26 -0
- package/skills/moltbook-registry/SKILL.md +82 -0
- package/skills/moltbook-registry/index.js +180 -0
- package/skills/moltbook-registry/package.json +11 -0
- package/skills/mythril-scanner/SKILL.md +27 -0
- package/skills/n8n/.clawhub/origin.json +7 -0
- package/skills/n8n/SKILL.md +141 -0
- package/skills/n8n/references/api.md +156 -0
- package/skills/n8n/scripts/n8n_api.py +158 -0
- package/skills/n8n-workflow-automation/.clawhub/origin.json +7 -0
- package/skills/n8n-workflow-automation/SKILL.md +103 -0
- package/skills/n8n-workflow-automation/assets/runbook-template.md +32 -0
- package/skills/narrative-designer/SKILL.md +27 -0
- package/skills/ontology/.clawhub/origin.json +7 -0
- package/skills/ontology/SKILL.md +236 -0
- package/skills/ontology/references/queries.md +211 -0
- package/skills/ontology/references/schema.md +322 -0
- package/skills/ontology/scripts/ontology.py +374 -0
- package/skills/openai-image-gen/.clawhub/origin.json +7 -0
- package/skills/openai-image-gen/SKILL.md +45 -0
- package/skills/openai-image-gen/scripts/gen.py +227 -0
- package/skills/openclaw-agent-optimize/.clawhub/origin.json +7 -0
- package/skills/openclaw-agent-optimize/SKILL.md +33 -0
- package/skills/openclaw-agent-optimize/references/agent-orchestration.md +20 -0
- package/skills/openclaw-agent-optimize/references/context-management.md +15 -0
- package/skills/openclaw-agent-optimize/references/continuous-learning.md +14 -0
- package/skills/openclaw-agent-optimize/references/cron-optimization.md +16 -0
- package/skills/openclaw-agent-optimize/references/memory-patterns.md +14 -0
- package/skills/openclaw-agent-optimize/references/model-selection.md +18 -0
- package/skills/openclaw-skill-scanner/.clawhub/origin.json +7 -0
- package/skills/openclaw-skill-scanner/SKILL.md +88 -0
- package/skills/openclaw-skill-scanner/install-hook.sh +294 -0
- package/skills/openclaw-skill-scanner/report-template.md +53 -0
- package/skills/openclaw-skill-scanner/scanner.py +929 -0
- package/skills/openclaw-skill-scanner/whitelist.json +18 -0
- package/skills/opportunity-solution-tree/SKILL.md +428 -0
- package/skills/opportunity-solution-tree/examples/sample.md +104 -0
- package/skills/opportunity-solution-tree/template.md +33 -0
- package/skills/pdf/.clawhub/origin.json +7 -0
- package/skills/pdf/SKILL.md +304 -0
- package/skills/pestel-analysis/SKILL.md +384 -0
- package/skills/pestel-analysis/examples/sample.md +143 -0
- package/skills/pestel-analysis/template.md +53 -0
- package/skills/pol-probe/SKILL.md +217 -0
- package/skills/pol-probe/examples/sample.md +136 -0
- package/skills/pol-probe/template.md +59 -0
- package/skills/pol-probe-advisor/SKILL.md +492 -0
- package/skills/positioning-statement/SKILL.md +229 -0
- package/skills/positioning-statement/examples/sample.md +51 -0
- package/skills/positioning-statement/template.md +25 -0
- package/skills/positioning-workshop/SKILL.md +424 -0
- package/skills/prd-development/SKILL.md +654 -0
- package/skills/prd-development/examples/sample.md +43 -0
- package/skills/prd-development/template.md +55 -0
- package/skills/press-release/SKILL.md +277 -0
- package/skills/press-release/examples/sample.md +73 -0
- package/skills/press-release/template.md +39 -0
- package/skills/prioritization-advisor/SKILL.md +451 -0
- package/skills/proactive-messages/.clawhub/origin.json +7 -0
- package/skills/proactive-messages/SKILL.md +91 -0
- package/skills/problem-framing-canvas/SKILL.md +466 -0
- package/skills/problem-framing-canvas/examples/sample.md +58 -0
- package/skills/problem-framing-canvas/template.md +22 -0
- package/skills/problem-statement/SKILL.md +255 -0
- package/skills/problem-statement/examples/sample.md +82 -0
- package/skills/problem-statement/template.md +37 -0
- package/skills/product-strategy-session/SKILL.md +434 -0
- package/skills/product-strategy-session/examples/sample.md +67 -0
- package/skills/product-strategy-session/template.md +38 -0
- package/skills/prompt-guard/.clawhub/origin.json +7 -0
- package/skills/prompt-guard/ARCHITECTURE.md +364 -0
- package/skills/prompt-guard/CHANGELOG.md +200 -0
- package/skills/prompt-guard/README.md +215 -0
- package/skills/prompt-guard/SECURITY.md +66 -0
- package/skills/prompt-guard/SKILL.md +174 -0
- package/skills/prompt-guard/blog/how-i-secured-my-ai-agent.md +185 -0
- package/skills/prompt-guard/config.example.yaml +56 -0
- package/skills/prompt-guard/references/detection-patterns.md +298 -0
- package/skills/prompt-guard/requirements.txt +1 -0
- package/skills/prompt-guard/scripts/analyze_log.py +224 -0
- package/skills/prompt-guard/scripts/audit.py +344 -0
- package/skills/prompt-guard/scripts/detect.py +1587 -0
- package/skills/prompt-guard/scripts/hivefence.py +345 -0
- package/skills/proto-persona/SKILL.md +336 -0
- package/skills/proto-persona/examples/sample.md +97 -0
- package/skills/proto-persona/template.md +45 -0
- package/skills/recommendation-canvas/SKILL.md +382 -0
- package/skills/recommendation-canvas/examples/sample.md +94 -0
- package/skills/recommendation-canvas/template.md +86 -0
- package/skills/refactor-suggest/.clawhub/origin.json +7 -0
- package/skills/refactor-suggest/SKILL.md +94 -0
- package/skills/roadmap-planning/SKILL.md +506 -0
- package/skills/roadmap-planning/examples/sample.md +62 -0
- package/skills/roadmap-planning/template.md +30 -0
- package/skills/saas-economics-efficiency-metrics/SKILL.md +694 -0
- package/skills/saas-economics-efficiency-metrics/examples/cash-trap.md +365 -0
- package/skills/saas-economics-efficiency-metrics/examples/healthy-unit-economics.md +279 -0
- package/skills/saas-economics-efficiency-metrics/template.md +263 -0
- package/skills/saas-revenue-growth-metrics/SKILL.md +629 -0
- package/skills/saas-revenue-growth-metrics/examples/healthy-saas.md +131 -0
- package/skills/saas-revenue-growth-metrics/examples/warning-signs.md +229 -0
- package/skills/saas-revenue-growth-metrics/template.md +192 -0
- package/skills/save-money/.clawhub/origin.json +7 -0
- package/skills/save-money/SKILL.md +173 -0
- package/skills/scripts/golden_skills_v3.sh +32 -0
- package/skills/search/.clawhub/origin.json +7 -0
- package/skills/search/SKILL.md +18 -0
- package/skills/search/skill.json +1 -0
- package/skills/second-brain/.clawhub/origin.json +7 -0
- package/skills/second-brain/SKILL.md +278 -0
- package/skills/second-brain/scripts/ensue-api.sh +37 -0
- package/skills/self-improving-agent/.clawhub/origin.json +7 -0
- package/skills/self-improving-agent/.learnings/ERRORS.md +5 -0
- package/skills/self-improving-agent/.learnings/FEATURE_REQUESTS.md +5 -0
- package/skills/self-improving-agent/.learnings/LEARNINGS.md +5 -0
- package/skills/self-improving-agent/SKILL.md +130 -0
- package/skills/self-improving-agent/assets/LEARNINGS.md +45 -0
- package/skills/self-improving-agent/assets/SKILL-TEMPLATE.md +177 -0
- package/skills/self-improving-agent/hooks/openclaw/HOOK.md +23 -0
- package/skills/self-improving-agent/hooks/openclaw/handler.js +56 -0
- package/skills/self-improving-agent/hooks/openclaw/handler.ts +62 -0
- package/skills/self-improving-agent/references/examples.md +374 -0
- package/skills/self-improving-agent/references/hooks-setup.md +223 -0
- package/skills/self-improving-agent/references/openclaw-integration.md +248 -0
- package/skills/self-improving-agent/references/templates.md +480 -0
- package/skills/self-improving-agent/scripts/activator.sh +20 -0
- package/skills/self-improving-agent/scripts/error-detector.sh +55 -0
- package/skills/self-improving-agent/scripts/extract-skill.sh +203 -0
- package/skills/self-improving-agent-1-0-2/.clawhub/origin.json +7 -0
- package/skills/self-improving-agent-1-0-2/SKILL.md +562 -0
- package/skills/self-improving-agent-1-0-2/assets/LEARNINGS.md +45 -0
- package/skills/self-improving-agent-1-0-2/assets/SKILL-TEMPLATE.md +182 -0
- package/skills/self-improving-agent-1-0-2/references/clawdbot-integration.md +311 -0
- package/skills/self-improving-agent-1-0-2/references/examples.md +374 -0
- package/skills/self-improving-agent-1-0-2/references/hooks-setup.md +223 -0
- package/skills/self-improving-agent-1-0-2/scripts/activator.sh +20 -0
- package/skills/self-improving-agent-1-0-2/scripts/error-detector.sh +55 -0
- package/skills/self-improving-agent-1-0-2/scripts/extract-skill.sh +203 -0
- package/skills/self-love-confidence/.clawhub/origin.json +7 -0
- package/skills/self-love-confidence/SKILL.md +79 -0
- package/skills/self-reflection/.clawhub/origin.json +7 -0
- package/skills/self-reflection/README.md +292 -0
- package/skills/self-reflection/SKILL.md +110 -0
- package/skills/self-reflection/self-reflection.example.json +6 -0
- package/skills/slither-analyzer/SKILL.md +27 -0
- package/skills/solidity-audit/SKILL.md +27 -0
- package/skills/soulcraft/.clawhub/origin.json +7 -0
- package/skills/soulcraft/README.md +123 -0
- package/skills/soulcraft/SKILL.md +340 -0
- package/skills/soulcraft/references/question-bank.md +154 -0
- package/skills/soulcraft/references/soul-examples.md +207 -0
- package/skills/soulcraft/research/RESEARCH_REPORT.md +317 -0
- package/skills/spotify-player/.clawhub/origin.json +7 -0
- package/skills/spotify-player/SKILL.md +44 -0
- package/skills/storyboard/SKILL.md +259 -0
- package/skills/storyboard/examples/sample.md +71 -0
- package/skills/storyboard/template.md +41 -0
- package/skills/summarize/.clawhub/origin.json +7 -0
- package/skills/summarize/SKILL.md +59 -0
- package/skills/superdesign/.clawhub/origin.json +7 -0
- package/skills/superdesign/SKILL.md +224 -0
- package/skills/tam-sam-som-calculator/SKILL.md +399 -0
- package/skills/tam-sam-som-calculator/examples/sample.md +142 -0
- package/skills/tam-sam-som-calculator/scripts/market-sizing.py +95 -0
- package/skills/tam-sam-som-calculator/template.md +35 -0
- package/skills/tavily-search/.clawhub/origin.json +7 -0
- package/skills/tavily-search/SKILL.md +49 -0
- package/skills/tavily-search/scripts/extract.mjs +59 -0
- package/skills/tavily-search/scripts/search.mjs +101 -0
- package/skills/twitter/SKILL.md +74 -0
- package/skills/twitter/_meta.json +9 -0
- package/skills/twitter/references/validation-cases.md +53 -0
- package/skills/twitter/scripts/twitter.sh +421 -0
- package/skills/ui-ux-pro-max/.clawhub/origin.json +7 -0
- package/skills/ui-ux-pro-max/SKILL.md +54 -0
- package/skills/ui-ux-pro-max/assets/data/charts.csv +26 -0
- package/skills/ui-ux-pro-max/assets/data/colors.csv +97 -0
- package/skills/ui-ux-pro-max/assets/data/icons.csv +101 -0
- package/skills/ui-ux-pro-max/assets/data/landing.csv +31 -0
- package/skills/ui-ux-pro-max/assets/data/products.csv +97 -0
- package/skills/ui-ux-pro-max/assets/data/react-performance.csv +45 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/astro.csv +54 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/flutter.csv +53 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/html-tailwind.csv +56 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/jetpack-compose.csv +53 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/nextjs.csv +53 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/nuxt-ui.csv +51 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/nuxtjs.csv +59 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/react-native.csv +52 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/react.csv +54 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/shadcn.csv +61 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/svelte.csv +54 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/swiftui.csv +51 -0
- package/skills/ui-ux-pro-max/assets/data/stacks/vue.csv +50 -0
- package/skills/ui-ux-pro-max/assets/data/styles.csv +68 -0
- package/skills/ui-ux-pro-max/assets/data/typography.csv +58 -0
- package/skills/ui-ux-pro-max/assets/data/ui-reasoning.csv +101 -0
- package/skills/ui-ux-pro-max/assets/data/ux-guidelines.csv +100 -0
- package/skills/ui-ux-pro-max/assets/data/web-interface.csv +31 -0
- package/skills/ui-ux-pro-max/references/upstream-README.md +488 -0
- package/skills/ui-ux-pro-max/references/upstream-skill-content.md +288 -0
- package/skills/ui-ux-pro-max/scripts/__init__.py +0 -0
- package/skills/ui-ux-pro-max/scripts/core.py +253 -0
- package/skills/ui-ux-pro-max/scripts/design_system.py +1071 -0
- package/skills/ui-ux-pro-max/scripts/search.py +111 -0
- package/skills/user-story/SKILL.md +272 -0
- package/skills/user-story/examples/sample.md +110 -0
- package/skills/user-story/scripts/user-story-template.py +65 -0
- package/skills/user-story/template.md +32 -0
- package/skills/user-story-mapping/SKILL.md +296 -0
- package/skills/user-story-mapping/examples/sample.md +77 -0
- package/skills/user-story-mapping/template.md +41 -0
- package/skills/user-story-mapping-workshop/SKILL.md +485 -0
- package/skills/user-story-mapping-workshop/template.md +28 -0
- package/skills/user-story-splitting/SKILL.md +313 -0
- package/skills/user-story-splitting/examples/sample.md +147 -0
- package/skills/user-story-splitting/template.md +37 -0
- package/skills/wacli/.clawhub/origin.json +7 -0
- package/skills/wacli/SKILL.md +53 -0
- package/skills/web-search/.clawhub/origin.json +7 -0
- package/skills/web-search/SKILL.md +151 -0
- package/skills/web-search/references/api-details.md +207 -0
- package/skills/web-search/scripts/search.py +576 -0
- package/skills/workshop-facilitation/SKILL.md +88 -0
- package/skills/world-builder/SKILL.md +27 -0
- package/souls/blockchain-auditor/PRINCIPLES.md +75 -0
- package/souls/blockchain-auditor/SOUL.md +56 -0
- package/souls/blockchain-auditor/capabilities.json +33 -0
- package/souls/blockchain-auditor/evolution/capsules.json +4 -0
- package/souls/blockchain-auditor/evolution/events.jsonl +1 -0
- package/souls/blockchain-auditor/evolution/genes.json +62 -0
- package/souls/daedalus/PRINCIPLES.md +78 -0
- package/souls/daedalus/SOUL.md +48 -0
- package/souls/daedalus/capabilities.json +46 -0
- package/souls/identity-architect/PRINCIPLES.md +83 -0
- package/souls/identity-architect/SOUL.md +66 -0
- package/souls/identity-architect/capabilities.json +38 -0
- package/souls/identity-architect/evolution/capsules.json +4 -0
- package/souls/identity-architect/evolution/events.jsonl +0 -0
- package/souls/identity-architect/evolution/genes.json +4 -0
- package/souls/infra-ops/PRINCIPLES.md +77 -0
- package/souls/infra-ops/SOUL.md +56 -0
- package/souls/infra-ops/capabilities.json +33 -0
- package/souls/infra-ops/evolution/capsules.json +4 -0
- package/souls/infra-ops/evolution/events.jsonl +0 -0
- package/souls/infra-ops/evolution/genes.json +4 -0
- package/souls/lore-writer/PRINCIPLES.md +74 -0
- package/souls/lore-writer/SOUL.md +54 -0
- package/souls/lore-writer/capabilities.json +37 -0
- package/souls/lore-writer/evolution/capsules.json +4 -0
- package/souls/lore-writer/evolution/events.jsonl +0 -0
- package/souls/lore-writer/evolution/genes.json +4 -0
- package/souls/qa-evidence/PRINCIPLES.md +97 -0
- package/souls/qa-evidence/SOUL.md +66 -0
- package/souls/qa-evidence/capabilities.json +32 -0
- package/souls/qa-evidence/evolution/capsules.json +4 -0
- package/souls/qa-evidence/evolution/events.jsonl +0 -0
- package/souls/qa-evidence/evolution/genes.json +4 -0
- package/souls/registry.json +211 -0
- package/souls/sync-registry.js +65 -0
- package/uninstall.sh +102 -0
- package/workspace-bin/auto-checkpoint +60 -0
- package/workspace-bin/clawvault-access-control +65 -0
- package/workspace-bin/clawvault-local +28 -0
- package/workspace-bin/compile-boot +494 -0
- package/workspace-bin/daily-log-writer.mjs +251 -0
- package/workspace-bin/evolve +540 -0
- package/workspace-bin/fitness_score.py +395 -0
- package/workspace-bin/hooks/pre-commit +80 -0
- package/workspace-bin/install-daemon +299 -0
- package/workspace-bin/lane-watchdog.js +232 -0
- package/workspace-bin/lib/__init__.py +0 -0
- package/workspace-bin/lib/frontmatter.py +114 -0
- package/workspace-bin/memory-daemon.mjs +879 -0
- package/workspace-bin/memory-maintenance.mjs +531 -0
- package/workspace-bin/mesh-bridge.mjs +154 -0
- package/workspace-bin/multi-review +130 -0
- package/workspace-bin/obsidian +125 -0
- package/workspace-bin/obsidian-sync.mjs +888 -0
- package/workspace-bin/openclaw-register-source +102 -0
- package/workspace-bin/proactive-scan +147 -0
- package/workspace-bin/quality-gate +175 -0
- package/workspace-bin/screenshot +96 -0
- package/workspace-bin/session-recap +453 -0
- package/workspace-bin/skill-audit +494 -0
- package/workspace-bin/skill-quality-check +134 -0
- package/workspace-bin/skill-routing-eval +599 -0
- package/workspace-bin/soul-prompt +251 -0
- package/workspace-bin/subagent-audit.mjs +267 -0
- package/workspace-bin/test-multi-soul-workflow +130 -0
- package/workspace-bin/trust-registry +465 -0
- package/workspace-docs/AGENTS.md +201 -0
- package/workspace-docs/CLAUDE.md +64 -0
- package/workspace-docs/PRINCIPLES.md +81 -0
- package/workspace-docs/SOUL.md +48 -0
|
@@ -0,0 +1,929 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Skill Scanner — Scans OpenClaw skills for malicious patterns.
|
|
4
|
+
|
|
5
|
+
Usage:
|
|
6
|
+
python3 scanner.py # Scan all installed skills
|
|
7
|
+
python3 scanner.py --skill <name> # Scan a specific skill
|
|
8
|
+
python3 scanner.py --file <path> # Scan a specific file
|
|
9
|
+
python3 scanner.py --pre-install <slug> # Pre-install scan
|
|
10
|
+
python3 scanner.py --json # JSON output
|
|
11
|
+
python3 scanner.py --report <path> # Generate markdown report
|
|
12
|
+
|
|
13
|
+
No external dependencies — stdlib only.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
import re
|
|
17
|
+
import os
|
|
18
|
+
import sys
|
|
19
|
+
import json
|
|
20
|
+
import argparse
|
|
21
|
+
import tempfile
|
|
22
|
+
import shutil
|
|
23
|
+
import subprocess
|
|
24
|
+
from pathlib import Path
|
|
25
|
+
from datetime import datetime, timezone
|
|
26
|
+
|
|
27
|
+
# ─── Constants ───────────────────────────────────────────────────────────────
|
|
28
|
+
|
|
29
|
+
VERSION = "1.0.0"
|
|
30
|
+
DEFAULT_SKILLS_DIR = Path.home() / ".openclaw" / "workspace" / "skills"
|
|
31
|
+
SCANNER_DIR = Path(__file__).parent.resolve()
|
|
32
|
+
WHITELIST_FILE = SCANNER_DIR / "whitelist.json"
|
|
33
|
+
REPORT_TEMPLATE = SCANNER_DIR / "report-template.md"
|
|
34
|
+
SCANNABLE_EXTENSIONS = {".py", ".sh", ".js", ".ts", ".bash", ".zsh", ".rb", ".pl", ".php", ".md", ".yml", ".yaml", ".json", ".toml", ".cfg", ".ini", ".conf", ".env", ".txt"}
|
|
35
|
+
|
|
36
|
+
# ─── Colors ──────────────────────────────────────────────────────────────────
|
|
37
|
+
|
|
38
|
+
class C:
|
|
39
|
+
"""ANSI color codes."""
|
|
40
|
+
RED = "\033[91m"
|
|
41
|
+
GREEN = "\033[92m"
|
|
42
|
+
YELLOW = "\033[93m"
|
|
43
|
+
BLUE = "\033[94m"
|
|
44
|
+
MAGENTA = "\033[95m"
|
|
45
|
+
CYAN = "\033[96m"
|
|
46
|
+
WHITE = "\033[97m"
|
|
47
|
+
BOLD = "\033[1m"
|
|
48
|
+
DIM = "\033[2m"
|
|
49
|
+
RESET = "\033[0m"
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def disable(cls):
|
|
53
|
+
for attr in ("RED", "GREEN", "YELLOW", "BLUE", "MAGENTA", "CYAN", "WHITE", "BOLD", "DIM", "RESET"):
|
|
54
|
+
setattr(cls, attr, "")
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# ─── Detection Patterns ─────────────────────────────────────────────────────
|
|
58
|
+
|
|
59
|
+
# Each pattern: (name, severity, regex, description)
|
|
60
|
+
# severity: "critical" (25pts), "high" (15pts), "medium" (8pts), "low" (3pts)
|
|
61
|
+
|
|
62
|
+
PATTERNS = [
|
|
63
|
+
# === CRITICAL (25 points each) ===
|
|
64
|
+
(
|
|
65
|
+
"base64_exec",
|
|
66
|
+
"critical",
|
|
67
|
+
re.compile(
|
|
68
|
+
r"""(?:eval|exec|bash|sh|python|perl|ruby|system)\s*[\(\s]*['"]?[A-Za-z0-9+/=]{40,}""",
|
|
69
|
+
re.IGNORECASE,
|
|
70
|
+
),
|
|
71
|
+
"Base64-encoded payload near code execution function",
|
|
72
|
+
),
|
|
73
|
+
(
|
|
74
|
+
"base64_decode_exec",
|
|
75
|
+
"critical",
|
|
76
|
+
re.compile(
|
|
77
|
+
r"""base64[._](?:b64)?decode\s*\(.*?\).*?(?:exec|eval|system|popen|subprocess)""",
|
|
78
|
+
re.IGNORECASE | re.DOTALL,
|
|
79
|
+
),
|
|
80
|
+
"Base64 decode piped into code execution",
|
|
81
|
+
),
|
|
82
|
+
(
|
|
83
|
+
"reverse_shell",
|
|
84
|
+
"critical",
|
|
85
|
+
re.compile(
|
|
86
|
+
r"""(?:bash\s+-i\s+>&|\/dev\/tcp\/|nc\s+-[elp]|ncat\s+-|mkfifo\s+.*?\bsh\b|python.*?socket.*?connect|socat\s+)""",
|
|
87
|
+
re.IGNORECASE,
|
|
88
|
+
),
|
|
89
|
+
"Reverse shell pattern detected",
|
|
90
|
+
),
|
|
91
|
+
(
|
|
92
|
+
"curl_pipe_shell",
|
|
93
|
+
"critical",
|
|
94
|
+
re.compile(
|
|
95
|
+
r"""(?:curl|wget)\s+[^\n|]*?\|\s*(?:ba)?sh""",
|
|
96
|
+
re.IGNORECASE,
|
|
97
|
+
),
|
|
98
|
+
"Remote script piped directly to shell (curl/wget | bash)",
|
|
99
|
+
),
|
|
100
|
+
(
|
|
101
|
+
"raw_ip_http",
|
|
102
|
+
"high",
|
|
103
|
+
re.compile(
|
|
104
|
+
r"""https?://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}""",
|
|
105
|
+
re.IGNORECASE,
|
|
106
|
+
),
|
|
107
|
+
"HTTP connection to raw IP address (no domain)",
|
|
108
|
+
),
|
|
109
|
+
|
|
110
|
+
# === HIGH (15 points each) ===
|
|
111
|
+
(
|
|
112
|
+
"eval_exec_dynamic",
|
|
113
|
+
"high",
|
|
114
|
+
re.compile(
|
|
115
|
+
r"""\beval\s*\(\s*(?['"]\s*\))""",
|
|
116
|
+
re.IGNORECASE,
|
|
117
|
+
),
|
|
118
|
+
"Dynamic eval() call — can execute arbitrary code",
|
|
119
|
+
),
|
|
120
|
+
(
|
|
121
|
+
"os_system_call",
|
|
122
|
+
"high",
|
|
123
|
+
re.compile(
|
|
124
|
+
r"""os\.system\s*\(""",
|
|
125
|
+
),
|
|
126
|
+
"os.system() call — runs shell commands",
|
|
127
|
+
),
|
|
128
|
+
(
|
|
129
|
+
"subprocess_shell",
|
|
130
|
+
"high",
|
|
131
|
+
re.compile(
|
|
132
|
+
r"""subprocess\.(?:call|run|Popen|check_output|check_call)\s*\([^)]*shell\s*=\s*True""",
|
|
133
|
+
re.DOTALL,
|
|
134
|
+
),
|
|
135
|
+
"subprocess with shell=True — command injection risk",
|
|
136
|
+
),
|
|
137
|
+
(
|
|
138
|
+
"password_archive",
|
|
139
|
+
"high",
|
|
140
|
+
re.compile(
|
|
141
|
+
r"""(?:--password|--passphrase|-p\s+\S+).*?(?:\.zip|\.tar|\.7z|\.rar)|\b(?:zip|tar|7z)\b.*?(?:--password|-p\s)""",
|
|
142
|
+
re.IGNORECASE,
|
|
143
|
+
),
|
|
144
|
+
"Password-protected archive operation",
|
|
145
|
+
),
|
|
146
|
+
(
|
|
147
|
+
"webhook_exfil",
|
|
148
|
+
"high",
|
|
149
|
+
re.compile(
|
|
150
|
+
r"""(?:webhook\.site|requestbin\.com|hookbin\.com|pipedream\.net|beeceptor\.com|requestcatcher\.com|burpcollaborator)""",
|
|
151
|
+
re.IGNORECASE,
|
|
152
|
+
),
|
|
153
|
+
"Known data exfiltration endpoint",
|
|
154
|
+
),
|
|
155
|
+
(
|
|
156
|
+
"env_exfil",
|
|
157
|
+
"high",
|
|
158
|
+
re.compile(
|
|
159
|
+
r"""(?:open|read|load).*?\.env\b.*?(?:requests?\.|urllib|http|curl|wget|socket|send|post|fetch)""",
|
|
160
|
+
re.IGNORECASE | re.DOTALL,
|
|
161
|
+
),
|
|
162
|
+
"Reading .env file with network send capability",
|
|
163
|
+
),
|
|
164
|
+
(
|
|
165
|
+
"api_key_grab",
|
|
166
|
+
"high",
|
|
167
|
+
re.compile(
|
|
168
|
+
r"""(?:os\.environ|process\.env).*?(?:API.?KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL).*?(?:requests?\.|urllib|http|curl|fetch|send|post|socket)""",
|
|
169
|
+
re.IGNORECASE | re.DOTALL,
|
|
170
|
+
),
|
|
171
|
+
"API key/secret read and potential exfiltration",
|
|
172
|
+
),
|
|
173
|
+
|
|
174
|
+
# === MEDIUM (8 points each) ===
|
|
175
|
+
(
|
|
176
|
+
"obfuscated_url",
|
|
177
|
+
"medium",
|
|
178
|
+
re.compile(
|
|
179
|
+
r"""(?:rentry\.co|pastebin\.com|hastebin\.com|paste\.ee|dpaste\.org|ix\.io|termbin\.com|0x0\.st|transfer\.sh)""",
|
|
180
|
+
re.IGNORECASE,
|
|
181
|
+
),
|
|
182
|
+
"Obfuscated URL / paste service (potential redirector)",
|
|
183
|
+
),
|
|
184
|
+
(
|
|
185
|
+
"fake_dependency",
|
|
186
|
+
"medium",
|
|
187
|
+
re.compile(
|
|
188
|
+
r"""(?:openclaw-core|openclaw-sdk|openclaw-utils|openclaw-lib|claw-internal|clawhub-api)""",
|
|
189
|
+
re.IGNORECASE,
|
|
190
|
+
),
|
|
191
|
+
"Reference to non-existent / fake dependency",
|
|
192
|
+
),
|
|
193
|
+
(
|
|
194
|
+
"hidden_file_create",
|
|
195
|
+
"medium",
|
|
196
|
+
re.compile(
|
|
197
|
+
r"""(?:open|write|create|touch|mkdir)\s*[\(]?\s*['"]\.(?!env|gitignore|gitkeep|dockerignore|eslintrc|prettierrc|npmrc|editorconfig)\w+""",
|
|
198
|
+
re.IGNORECASE,
|
|
199
|
+
),
|
|
200
|
+
"Hidden dotfile creation (potential persistence)",
|
|
201
|
+
),
|
|
202
|
+
(
|
|
203
|
+
"crypto_mining",
|
|
204
|
+
"medium",
|
|
205
|
+
re.compile(
|
|
206
|
+
r"""(?:xmrig|stratum\+tcp|coinhive|cryptonight|monero.*?pool|minergate|nicehash|ethermine|f2pool|antpool|hashrate)""",
|
|
207
|
+
re.IGNORECASE,
|
|
208
|
+
),
|
|
209
|
+
"Crypto mining indicator",
|
|
210
|
+
),
|
|
211
|
+
(
|
|
212
|
+
"chmod_executable",
|
|
213
|
+
"medium",
|
|
214
|
+
re.compile(
|
|
215
|
+
r"""chmod\s+[+0-7]*[xX7]""",
|
|
216
|
+
),
|
|
217
|
+
"Making file executable (chmod +x)",
|
|
218
|
+
),
|
|
219
|
+
(
|
|
220
|
+
"cron_persistence",
|
|
221
|
+
"medium",
|
|
222
|
+
re.compile(
|
|
223
|
+
r"""crontab\s|/etc/cron|systemctl\s+enable|\.service\s""",
|
|
224
|
+
re.IGNORECASE,
|
|
225
|
+
),
|
|
226
|
+
"Persistence mechanism (cron/systemd)",
|
|
227
|
+
),
|
|
228
|
+
(
|
|
229
|
+
"dns_exfil",
|
|
230
|
+
"medium",
|
|
231
|
+
re.compile(
|
|
232
|
+
r"""(?:nslookup|dig)\s+.*?\$|socket\.getaddrinfo.*?\bvar\b""",
|
|
233
|
+
re.IGNORECASE,
|
|
234
|
+
),
|
|
235
|
+
"Potential DNS exfiltration",
|
|
236
|
+
),
|
|
237
|
+
(
|
|
238
|
+
"encoded_string_long",
|
|
239
|
+
"medium",
|
|
240
|
+
re.compile(
|
|
241
|
+
r"""['"]\s*[A-Za-z0-9+/]{80,}={0,2}\s*['"]""",
|
|
242
|
+
),
|
|
243
|
+
"Long base64-encoded string (potential hidden payload)",
|
|
244
|
+
),
|
|
245
|
+
|
|
246
|
+
# === LOW (3 points each) ===
|
|
247
|
+
(
|
|
248
|
+
"exec_function",
|
|
249
|
+
"low",
|
|
250
|
+
re.compile(
|
|
251
|
+
r"""\bexec\s*\(""",
|
|
252
|
+
),
|
|
253
|
+
"exec() function call",
|
|
254
|
+
),
|
|
255
|
+
(
|
|
256
|
+
"subprocess_basic",
|
|
257
|
+
"low",
|
|
258
|
+
re.compile(
|
|
259
|
+
r"""subprocess\.(?:call|run|Popen|check_output|check_call)\s*\(""",
|
|
260
|
+
),
|
|
261
|
+
"subprocess usage (review arguments)",
|
|
262
|
+
),
|
|
263
|
+
(
|
|
264
|
+
"network_request",
|
|
265
|
+
"low",
|
|
266
|
+
re.compile(
|
|
267
|
+
r"""(?:requests?\.(?:get|post|put|delete|patch)|urllib\.request|http\.client|fetch\s*\()""",
|
|
268
|
+
re.IGNORECASE,
|
|
269
|
+
),
|
|
270
|
+
"Network request (verify destination)",
|
|
271
|
+
),
|
|
272
|
+
(
|
|
273
|
+
"file_write",
|
|
274
|
+
"low",
|
|
275
|
+
re.compile(
|
|
276
|
+
r"""open\s*\([^)]*['\"]w['\"]""",
|
|
277
|
+
),
|
|
278
|
+
"File write operation",
|
|
279
|
+
),
|
|
280
|
+
(
|
|
281
|
+
"env_access",
|
|
282
|
+
"low",
|
|
283
|
+
re.compile(
|
|
284
|
+
r"""os\.environ\.get|os\.getenv|process\.env\.""",
|
|
285
|
+
),
|
|
286
|
+
"Environment variable access",
|
|
287
|
+
),
|
|
288
|
+
(
|
|
289
|
+
"hardcoded_ip",
|
|
290
|
+
"low",
|
|
291
|
+
re.compile(
|
|
292
|
+
r"""\b(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b""",
|
|
293
|
+
),
|
|
294
|
+
"Hardcoded IP address",
|
|
295
|
+
),
|
|
296
|
+
]
|
|
297
|
+
|
|
298
|
+
SEVERITY_SCORES = {
|
|
299
|
+
"critical": 25,
|
|
300
|
+
"high": 15,
|
|
301
|
+
"medium": 8,
|
|
302
|
+
"low": 3,
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
SEVERITY_COLORS = {
|
|
306
|
+
"critical": C.RED,
|
|
307
|
+
"high": C.RED,
|
|
308
|
+
"medium": C.YELLOW,
|
|
309
|
+
"low": C.CYAN,
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
SEVERITY_ICONS = {
|
|
313
|
+
"critical": "🔴",
|
|
314
|
+
"high": "🟠",
|
|
315
|
+
"medium": "🟡",
|
|
316
|
+
"low": "🔵",
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
# ─── Whitelist / Blacklist ───────────────────────────────────────────────────
|
|
321
|
+
|
|
322
|
+
def load_lists():
|
|
323
|
+
"""Load whitelist and blacklist from whitelist.json."""
|
|
324
|
+
if not WHITELIST_FILE.exists():
|
|
325
|
+
return {}, {}
|
|
326
|
+
with open(WHITELIST_FILE) as f:
|
|
327
|
+
data = json.load(f)
|
|
328
|
+
whitelist = {item["slug"]: item.get("reason", "") for item in data.get("whitelisted", [])}
|
|
329
|
+
blacklist = {item["slug"]: item for item in data.get("blacklisted", [])}
|
|
330
|
+
return whitelist, blacklist
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
# ─── Scanner Core ────────────────────────────────────────────────────────────
|
|
334
|
+
|
|
335
|
+
class Finding:
|
|
336
|
+
"""A single finding from scanning."""
|
|
337
|
+
def __init__(self, pattern_name, severity, description, file_path, line_num, line_text, match_text):
|
|
338
|
+
self.pattern_name = pattern_name
|
|
339
|
+
self.severity = severity
|
|
340
|
+
self.description = description
|
|
341
|
+
self.file_path = file_path
|
|
342
|
+
self.line_num = line_num
|
|
343
|
+
self.line_text = line_text.strip()
|
|
344
|
+
self.match_text = match_text.strip()[:120]
|
|
345
|
+
self.score = SEVERITY_SCORES.get(severity, 3)
|
|
346
|
+
|
|
347
|
+
def to_dict(self):
|
|
348
|
+
return {
|
|
349
|
+
"pattern": self.pattern_name,
|
|
350
|
+
"severity": self.severity,
|
|
351
|
+
"description": self.description,
|
|
352
|
+
"file": str(self.file_path),
|
|
353
|
+
"line": self.line_num,
|
|
354
|
+
"line_text": self.line_text[:200],
|
|
355
|
+
"match": self.match_text,
|
|
356
|
+
"score": self.score,
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
class SkillReport:
|
|
361
|
+
"""Scan results for a single skill."""
|
|
362
|
+
def __init__(self, skill_name, skill_path):
|
|
363
|
+
self.skill_name = skill_name
|
|
364
|
+
self.skill_path = skill_path
|
|
365
|
+
self.findings = []
|
|
366
|
+
self.files_scanned = 0
|
|
367
|
+
self.is_whitelisted = False
|
|
368
|
+
self.whitelist_reason = ""
|
|
369
|
+
self.is_blacklisted = False
|
|
370
|
+
self.blacklist_info = {}
|
|
371
|
+
|
|
372
|
+
@property
|
|
373
|
+
def risk_score(self):
|
|
374
|
+
if self.is_blacklisted:
|
|
375
|
+
return 100
|
|
376
|
+
raw = sum(f.score for f in self.findings)
|
|
377
|
+
return min(100, raw)
|
|
378
|
+
|
|
379
|
+
@property
|
|
380
|
+
def status(self):
|
|
381
|
+
score = self.risk_score
|
|
382
|
+
if score < 30:
|
|
383
|
+
return "clean"
|
|
384
|
+
elif score < 70:
|
|
385
|
+
return "suspicious"
|
|
386
|
+
else:
|
|
387
|
+
return "dangerous"
|
|
388
|
+
|
|
389
|
+
@property
|
|
390
|
+
def status_emoji(self):
|
|
391
|
+
return {"clean": "🟢", "suspicious": "🟡", "dangerous": "🔴"}[self.status]
|
|
392
|
+
|
|
393
|
+
@property
|
|
394
|
+
def status_color(self):
|
|
395
|
+
return {"clean": C.GREEN, "suspicious": C.YELLOW, "dangerous": C.RED}[self.status]
|
|
396
|
+
|
|
397
|
+
def to_dict(self):
|
|
398
|
+
return {
|
|
399
|
+
"skill": self.skill_name,
|
|
400
|
+
"path": str(self.skill_path),
|
|
401
|
+
"risk_score": self.risk_score,
|
|
402
|
+
"status": self.status,
|
|
403
|
+
"files_scanned": self.files_scanned,
|
|
404
|
+
"is_whitelisted": self.is_whitelisted,
|
|
405
|
+
"whitelist_reason": self.whitelist_reason,
|
|
406
|
+
"is_blacklisted": self.is_blacklisted,
|
|
407
|
+
"blacklist_info": self.blacklist_info,
|
|
408
|
+
"findings": [f.to_dict() for f in self.findings],
|
|
409
|
+
"finding_count": len(self.findings),
|
|
410
|
+
"critical_count": len([f for f in self.findings if f.severity == "critical"]),
|
|
411
|
+
"high_count": len([f for f in self.findings if f.severity == "high"]),
|
|
412
|
+
"medium_count": len([f for f in self.findings if f.severity == "medium"]),
|
|
413
|
+
"low_count": len([f for f in self.findings if f.severity == "low"]),
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
def _is_self(file_path):
|
|
418
|
+
"""Check if this file is part of skill-scanner itself."""
|
|
419
|
+
try:
|
|
420
|
+
return file_path.resolve().is_relative_to(SCANNER_DIR)
|
|
421
|
+
except (AttributeError, TypeError):
|
|
422
|
+
# Python < 3.9 fallback
|
|
423
|
+
try:
|
|
424
|
+
file_path.resolve().relative_to(SCANNER_DIR)
|
|
425
|
+
return True
|
|
426
|
+
except ValueError:
|
|
427
|
+
return False
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
def _is_doc_line(file_path, stripped, severity):
|
|
431
|
+
"""Check if a line is documentation/comment that shouldn't be flagged (unless critical)."""
|
|
432
|
+
suffix = file_path.suffix.lower() if hasattr(file_path, 'suffix') else ""
|
|
433
|
+
name = file_path.name if hasattr(file_path, 'name') else str(file_path)
|
|
434
|
+
|
|
435
|
+
# In markdown/doc files, skip table rows, list items, headers, and code block fences
|
|
436
|
+
if suffix in (".md", ".txt", ".rst") or name in ("README", "CHANGELOG", "LICENSE"):
|
|
437
|
+
if stripped.startswith(("|", "- ", "* ", "#", "```", "> ")):
|
|
438
|
+
return True
|
|
439
|
+
# Skip lines that are clearly documentation examples
|
|
440
|
+
if severity not in ("critical",):
|
|
441
|
+
return True # In markdown, only flag critical patterns
|
|
442
|
+
|
|
443
|
+
# In JSON data files, skip string values (but still flag critical)
|
|
444
|
+
if suffix == ".json" and severity not in ("critical", "high"):
|
|
445
|
+
return True
|
|
446
|
+
|
|
447
|
+
# In any file, skip pure comment lines for non-critical
|
|
448
|
+
if severity not in ("critical", "high"):
|
|
449
|
+
if stripped.startswith(("#", "//", "/*", "*", "<!--")):
|
|
450
|
+
return True
|
|
451
|
+
|
|
452
|
+
return False
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
def scan_file(file_path, findings_list, relative_to=None):
|
|
456
|
+
"""Scan a single file for suspicious patterns."""
|
|
457
|
+
try:
|
|
458
|
+
with open(file_path, "r", errors="ignore") as f:
|
|
459
|
+
content = f.read()
|
|
460
|
+
lines = content.split("\n")
|
|
461
|
+
except (IOError, OSError):
|
|
462
|
+
return 0
|
|
463
|
+
|
|
464
|
+
display_path = file_path
|
|
465
|
+
if relative_to:
|
|
466
|
+
try:
|
|
467
|
+
display_path = file_path.relative_to(relative_to)
|
|
468
|
+
except ValueError:
|
|
469
|
+
pass
|
|
470
|
+
|
|
471
|
+
line_count = 0
|
|
472
|
+
for line_num, line in enumerate(lines, 1):
|
|
473
|
+
# Skip comments in some cases (but still scan — malware hides in comments too)
|
|
474
|
+
for pattern_name, severity, regex, description in PATTERNS:
|
|
475
|
+
match = regex.search(line)
|
|
476
|
+
if match:
|
|
477
|
+
# Avoid self-detection: skip if file is in skill-scanner
|
|
478
|
+
if _is_self(file_path):
|
|
479
|
+
continue
|
|
480
|
+
# Skip markdown documentation lines (tables, list items, headers, code block markers)
|
|
481
|
+
stripped = line.strip()
|
|
482
|
+
if _is_doc_line(file_path, stripped, severity):
|
|
483
|
+
continue
|
|
484
|
+
findings_list.append(Finding(
|
|
485
|
+
pattern_name=pattern_name,
|
|
486
|
+
severity=severity,
|
|
487
|
+
description=description,
|
|
488
|
+
file_path=display_path,
|
|
489
|
+
line_num=line_num,
|
|
490
|
+
line_text=line,
|
|
491
|
+
match_text=match.group(0),
|
|
492
|
+
))
|
|
493
|
+
line_count += 1
|
|
494
|
+
|
|
495
|
+
# Also scan multi-line patterns across the whole content
|
|
496
|
+
for pattern_name, severity, regex, description in PATTERNS:
|
|
497
|
+
if "DOTALL" in str(regex.flags) or regex.flags & re.DOTALL:
|
|
498
|
+
for match in regex.finditer(content):
|
|
499
|
+
# Find which line the match starts on
|
|
500
|
+
start = match.start()
|
|
501
|
+
line_num = content[:start].count("\n") + 1
|
|
502
|
+
line_text = lines[line_num - 1] if line_num <= len(lines) else ""
|
|
503
|
+
|
|
504
|
+
if _is_self(file_path):
|
|
505
|
+
continue
|
|
506
|
+
|
|
507
|
+
# Skip documentation lines for multi-line matches too
|
|
508
|
+
stripped_ml = line_text.strip()
|
|
509
|
+
if _is_doc_line(file_path, stripped_ml, severity):
|
|
510
|
+
continue
|
|
511
|
+
|
|
512
|
+
# Check for duplicates
|
|
513
|
+
already_found = False
|
|
514
|
+
for existing in findings_list:
|
|
515
|
+
if (existing.pattern_name == pattern_name and
|
|
516
|
+
existing.file_path == display_path and
|
|
517
|
+
existing.line_num == line_num):
|
|
518
|
+
already_found = True
|
|
519
|
+
break
|
|
520
|
+
if not already_found:
|
|
521
|
+
findings_list.append(Finding(
|
|
522
|
+
pattern_name=pattern_name,
|
|
523
|
+
severity=severity,
|
|
524
|
+
description=description,
|
|
525
|
+
file_path=display_path,
|
|
526
|
+
line_num=line_num,
|
|
527
|
+
line_text=line_text,
|
|
528
|
+
match_text=match.group(0)[:120],
|
|
529
|
+
))
|
|
530
|
+
|
|
531
|
+
return 1 # scanned 1 file
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
def scan_skill(skill_path, whitelist, blacklist):
|
|
535
|
+
"""Scan an entire skill directory."""
|
|
536
|
+
skill_path = Path(skill_path)
|
|
537
|
+
skill_name = skill_path.name
|
|
538
|
+
|
|
539
|
+
report = SkillReport(skill_name, skill_path)
|
|
540
|
+
|
|
541
|
+
# Check blacklist
|
|
542
|
+
if skill_name in blacklist:
|
|
543
|
+
report.is_blacklisted = True
|
|
544
|
+
report.blacklist_info = blacklist[skill_name]
|
|
545
|
+
return report
|
|
546
|
+
|
|
547
|
+
# Check whitelist
|
|
548
|
+
if skill_name in whitelist:
|
|
549
|
+
report.is_whitelisted = True
|
|
550
|
+
report.whitelist_reason = whitelist[skill_name]
|
|
551
|
+
|
|
552
|
+
# Scan all scannable files
|
|
553
|
+
for root, dirs, files in os.walk(skill_path):
|
|
554
|
+
# Skip hidden directories and common non-code dirs
|
|
555
|
+
dirs[:] = [d for d in dirs if not d.startswith(".") and d not in ("node_modules", "__pycache__", ".git", "venv")]
|
|
556
|
+
for filename in files:
|
|
557
|
+
fp = Path(root) / filename
|
|
558
|
+
suffix = fp.suffix.lower()
|
|
559
|
+
# Scan known extensions + extensionless files (shell scripts)
|
|
560
|
+
if suffix in SCANNABLE_EXTENSIONS or suffix == "" or filename in ("Makefile", "Dockerfile", "Vagrantfile"):
|
|
561
|
+
scanned = scan_file(fp, report.findings, relative_to=skill_path)
|
|
562
|
+
report.files_scanned += scanned
|
|
563
|
+
|
|
564
|
+
return report
|
|
565
|
+
|
|
566
|
+
|
|
567
|
+
def scan_single_file(file_path):
|
|
568
|
+
"""Scan a single file and return a pseudo-report."""
|
|
569
|
+
file_path = Path(file_path).resolve()
|
|
570
|
+
report = SkillReport(file_path.name, file_path.parent)
|
|
571
|
+
scanned = scan_file(file_path, report.findings)
|
|
572
|
+
report.files_scanned = scanned
|
|
573
|
+
return report
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
# ─── Output Formatting ──────────────────────────────────────────────────────
|
|
577
|
+
|
|
578
|
+
def print_banner():
|
|
579
|
+
print(f"""
|
|
580
|
+
{C.CYAN}{C.BOLD}╔══════════════════════════════════════════════════╗
|
|
581
|
+
║ 🦞 Skill Scanner v{VERSION} ║
|
|
582
|
+
║ OpenClaw Security Analysis Tool ║
|
|
583
|
+
╚══════════════════════════════════════════════════╝{C.RESET}
|
|
584
|
+
""")
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
def print_report(report, verbose=True):
|
|
588
|
+
"""Print a colored terminal report for a skill."""
|
|
589
|
+
sc = report.status_color
|
|
590
|
+
emoji = report.status_emoji
|
|
591
|
+
|
|
592
|
+
# Header
|
|
593
|
+
label = report.status.upper()
|
|
594
|
+
extra = ""
|
|
595
|
+
if report.is_whitelisted:
|
|
596
|
+
extra = f" {C.DIM}(whitelisted: {report.whitelist_reason}){C.RESET}"
|
|
597
|
+
if report.is_blacklisted:
|
|
598
|
+
extra = f" {C.RED}{C.BOLD}⚠ BLACKLISTED: {report.blacklist_info.get('reason', 'Known malicious')}{C.RESET}"
|
|
599
|
+
|
|
600
|
+
print(f"{C.BOLD}{'─' * 55}{C.RESET}")
|
|
601
|
+
print(f"{emoji} {C.BOLD}{report.skill_name}{C.RESET} "
|
|
602
|
+
f"Score: {sc}{C.BOLD}{report.risk_score}/100{C.RESET} "
|
|
603
|
+
f"Status: {sc}{label}{C.RESET}{extra}")
|
|
604
|
+
print(f" {C.DIM}Files scanned: {report.files_scanned} | Findings: {len(report.findings)}{C.RESET}")
|
|
605
|
+
|
|
606
|
+
if report.is_blacklisted:
|
|
607
|
+
reporter = report.blacklist_info.get("reporter", "unknown")
|
|
608
|
+
print(f" {C.RED}Reported by: {reporter}{C.RESET}")
|
|
609
|
+
print()
|
|
610
|
+
return
|
|
611
|
+
|
|
612
|
+
if not report.findings:
|
|
613
|
+
print(f" {C.GREEN}✓ No suspicious patterns found{C.RESET}")
|
|
614
|
+
print()
|
|
615
|
+
return
|
|
616
|
+
|
|
617
|
+
if verbose:
|
|
618
|
+
# Group findings by severity
|
|
619
|
+
for sev in ("critical", "high", "medium", "low"):
|
|
620
|
+
sev_findings = [f for f in report.findings if f.severity == sev]
|
|
621
|
+
if not sev_findings:
|
|
622
|
+
continue
|
|
623
|
+
color = SEVERITY_COLORS[sev]
|
|
624
|
+
icon = SEVERITY_ICONS[sev]
|
|
625
|
+
print(f"\n {color}{C.BOLD}{icon} {sev.upper()} ({len(sev_findings)}):{C.RESET}")
|
|
626
|
+
for f in sev_findings:
|
|
627
|
+
print(f" {color} → {f.description}{C.RESET}")
|
|
628
|
+
print(f" {C.DIM}{f.file_path}:{f.line_num}{C.RESET}")
|
|
629
|
+
# Truncate long lines
|
|
630
|
+
display_line = f.line_text[:100]
|
|
631
|
+
if len(f.line_text) > 100:
|
|
632
|
+
display_line += "..."
|
|
633
|
+
print(f" {C.DIM} {display_line}{C.RESET}")
|
|
634
|
+
else:
|
|
635
|
+
# Compact output
|
|
636
|
+
crit = len([f for f in report.findings if f.severity == "critical"])
|
|
637
|
+
high = len([f for f in report.findings if f.severity == "high"])
|
|
638
|
+
med = len([f for f in report.findings if f.severity == "medium"])
|
|
639
|
+
low = len([f for f in report.findings if f.severity == "low"])
|
|
640
|
+
parts = []
|
|
641
|
+
if crit:
|
|
642
|
+
parts.append(f"{C.RED}{crit} critical{C.RESET}")
|
|
643
|
+
if high:
|
|
644
|
+
parts.append(f"{C.RED}{high} high{C.RESET}")
|
|
645
|
+
if med:
|
|
646
|
+
parts.append(f"{C.YELLOW}{med} medium{C.RESET}")
|
|
647
|
+
if low:
|
|
648
|
+
parts.append(f"{C.CYAN}{low} low{C.RESET}")
|
|
649
|
+
print(f" Findings: {', '.join(parts)}")
|
|
650
|
+
|
|
651
|
+
print()
|
|
652
|
+
|
|
653
|
+
|
|
654
|
+
def print_summary(reports):
|
|
655
|
+
"""Print overall scan summary."""
|
|
656
|
+
total = len(reports)
|
|
657
|
+
clean = len([r for r in reports if r.status == "clean"])
|
|
658
|
+
suspicious = len([r for r in reports if r.status == "suspicious"])
|
|
659
|
+
dangerous = len([r for r in reports if r.status == "dangerous"])
|
|
660
|
+
total_findings = sum(len(r.findings) for r in reports)
|
|
661
|
+
total_files = sum(r.files_scanned for r in reports)
|
|
662
|
+
|
|
663
|
+
print(f"{C.BOLD}{'═' * 55}{C.RESET}")
|
|
664
|
+
print(f"{C.BOLD}📊 SCAN SUMMARY{C.RESET}")
|
|
665
|
+
print(f"{C.BOLD}{'═' * 55}{C.RESET}")
|
|
666
|
+
print(f" Skills scanned: {total}")
|
|
667
|
+
print(f" Files scanned: {total_files}")
|
|
668
|
+
print(f" Total findings: {total_findings}")
|
|
669
|
+
print()
|
|
670
|
+
print(f" {C.GREEN}🟢 Clean: {clean}{C.RESET}")
|
|
671
|
+
print(f" {C.YELLOW}🟡 Suspicious: {suspicious}{C.RESET}")
|
|
672
|
+
print(f" {C.RED}🔴 Dangerous: {dangerous}{C.RESET}")
|
|
673
|
+
print(f"{C.BOLD}{'═' * 55}{C.RESET}")
|
|
674
|
+
|
|
675
|
+
if dangerous > 0:
|
|
676
|
+
print(f"\n{C.RED}{C.BOLD}⚠ {dangerous} DANGEROUS SKILL(S) DETECTED — review immediately!{C.RESET}")
|
|
677
|
+
elif suspicious > 0:
|
|
678
|
+
print(f"\n{C.YELLOW}⚠ {suspicious} suspicious skill(s) — review recommended.{C.RESET}")
|
|
679
|
+
else:
|
|
680
|
+
print(f"\n{C.GREEN}✓ All skills look clean!{C.RESET}")
|
|
681
|
+
print()
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
def generate_markdown_report(reports):
|
|
685
|
+
"""Generate a markdown report string."""
|
|
686
|
+
now = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC")
|
|
687
|
+
total_files = sum(r.files_scanned for r in reports)
|
|
688
|
+
total_findings = sum(len(r.findings) for r in reports)
|
|
689
|
+
clean = len([r for r in reports if r.status == "clean"])
|
|
690
|
+
suspicious = len([r for r in reports if r.status == "suspicious"])
|
|
691
|
+
dangerous = len([r for r in reports if r.status == "dangerous"])
|
|
692
|
+
|
|
693
|
+
lines = [
|
|
694
|
+
f"# 🔍 Skill Scanner Report",
|
|
695
|
+
f"",
|
|
696
|
+
f"**Scan Date:** {now}",
|
|
697
|
+
f"**Scanner Version:** {VERSION}",
|
|
698
|
+
f"",
|
|
699
|
+
f"---",
|
|
700
|
+
f"",
|
|
701
|
+
f"## Summary",
|
|
702
|
+
f"",
|
|
703
|
+
f"| Metric | Value |",
|
|
704
|
+
f"|---|---|",
|
|
705
|
+
f"| Skills Scanned | {len(reports)} |",
|
|
706
|
+
f"| Files Scanned | {total_files} |",
|
|
707
|
+
f"| Total Findings | {total_findings} |",
|
|
708
|
+
f"| 🟢 Clean | {clean} |",
|
|
709
|
+
f"| 🟡 Suspicious | {suspicious} |",
|
|
710
|
+
f"| 🔴 Dangerous | {dangerous} |",
|
|
711
|
+
f"",
|
|
712
|
+
f"---",
|
|
713
|
+
f"",
|
|
714
|
+
f"## Results",
|
|
715
|
+
f"",
|
|
716
|
+
]
|
|
717
|
+
|
|
718
|
+
for report in sorted(reports, key=lambda r: -r.risk_score):
|
|
719
|
+
emoji = report.status_emoji
|
|
720
|
+
lines.append(f"### {emoji} {report.skill_name} — Score: {report.risk_score}/100 ({report.status.upper()})")
|
|
721
|
+
lines.append(f"")
|
|
722
|
+
|
|
723
|
+
if report.is_blacklisted:
|
|
724
|
+
lines.append(f"**⚠ BLACKLISTED:** {report.blacklist_info.get('reason', 'Known malicious')}")
|
|
725
|
+
lines.append(f"")
|
|
726
|
+
continue
|
|
727
|
+
|
|
728
|
+
if report.is_whitelisted:
|
|
729
|
+
lines.append(f"*Whitelisted: {report.whitelist_reason}*")
|
|
730
|
+
lines.append(f"")
|
|
731
|
+
|
|
732
|
+
lines.append(f"Files scanned: {report.files_scanned}")
|
|
733
|
+
lines.append(f"")
|
|
734
|
+
|
|
735
|
+
if not report.findings:
|
|
736
|
+
lines.append(f"✅ No suspicious patterns found.")
|
|
737
|
+
lines.append(f"")
|
|
738
|
+
continue
|
|
739
|
+
|
|
740
|
+
lines.append(f"| Severity | Pattern | File | Line | Description |")
|
|
741
|
+
lines.append(f"|---|---|---|---|---|")
|
|
742
|
+
for f in sorted(report.findings, key=lambda x: ("critical", "high", "medium", "low").index(x.severity)):
|
|
743
|
+
lines.append(f"| {f.severity.upper()} | `{f.pattern_name}` | `{f.file_path}` | {f.line_num} | {f.description} |")
|
|
744
|
+
lines.append(f"")
|
|
745
|
+
|
|
746
|
+
lines.append(f"---")
|
|
747
|
+
lines.append(f"*Generated by skill-scanner v{VERSION}*")
|
|
748
|
+
return "\n".join(lines)
|
|
749
|
+
|
|
750
|
+
|
|
751
|
+
def output_json(reports):
|
|
752
|
+
"""Output results as JSON."""
|
|
753
|
+
data = {
|
|
754
|
+
"scanner_version": VERSION,
|
|
755
|
+
"scan_date": datetime.now(timezone.utc).isoformat(),
|
|
756
|
+
"summary": {
|
|
757
|
+
"total_skills": len(reports),
|
|
758
|
+
"total_files": sum(r.files_scanned for r in reports),
|
|
759
|
+
"total_findings": sum(len(r.findings) for r in reports),
|
|
760
|
+
"clean": len([r for r in reports if r.status == "clean"]),
|
|
761
|
+
"suspicious": len([r for r in reports if r.status == "suspicious"]),
|
|
762
|
+
"dangerous": len([r for r in reports if r.status == "dangerous"]),
|
|
763
|
+
},
|
|
764
|
+
"skills": [r.to_dict() for r in reports],
|
|
765
|
+
}
|
|
766
|
+
print(json.dumps(data, indent=2))
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
# ─── Pre-install Scan ────────────────────────────────────────────────────────
|
|
770
|
+
|
|
771
|
+
def pre_install_scan(slug, json_output=False):
|
|
772
|
+
"""Download a skill to temp dir, scan it, report, cleanup."""
|
|
773
|
+
print(f"{C.CYAN}📦 Pre-install scan for: {slug}{C.RESET}")
|
|
774
|
+
print(f"{C.DIM} Downloading to temporary directory...{C.RESET}")
|
|
775
|
+
|
|
776
|
+
whitelist, blacklist = load_lists()
|
|
777
|
+
|
|
778
|
+
# Check blacklist immediately
|
|
779
|
+
if slug in blacklist:
|
|
780
|
+
info = blacklist[slug]
|
|
781
|
+
print(f"\n{C.RED}{C.BOLD}🚫 BLOCKED — '{slug}' is BLACKLISTED{C.RESET}")
|
|
782
|
+
print(f"{C.RED} Reason: {info.get('reason', 'Known malicious')}{C.RESET}")
|
|
783
|
+
print(f"{C.RED} Reporter: {info.get('reporter', 'unknown')}{C.RESET}")
|
|
784
|
+
print(f"\n{C.RED} This skill will NOT be installed.{C.RESET}\n")
|
|
785
|
+
return None
|
|
786
|
+
|
|
787
|
+
# Create temp directory and attempt install
|
|
788
|
+
tmpdir = tempfile.mkdtemp(prefix="skill-scan-")
|
|
789
|
+
skill_path = Path(tmpdir) / slug
|
|
790
|
+
|
|
791
|
+
try:
|
|
792
|
+
# Try to use openclaw to install to temp
|
|
793
|
+
result = subprocess.run(
|
|
794
|
+
["openclaw", "hub", "install", slug, "--dir", tmpdir],
|
|
795
|
+
capture_output=True, text=True, timeout=60
|
|
796
|
+
)
|
|
797
|
+
|
|
798
|
+
if not skill_path.exists():
|
|
799
|
+
# Maybe installed with different name or flat
|
|
800
|
+
contents = list(Path(tmpdir).iterdir())
|
|
801
|
+
if contents:
|
|
802
|
+
skill_path = contents[0] if contents[0].is_dir() else Path(tmpdir)
|
|
803
|
+
else:
|
|
804
|
+
print(f"{C.RED}✗ Failed to download skill '{slug}'{C.RESET}")
|
|
805
|
+
print(f"{C.DIM} {result.stderr or result.stdout}{C.RESET}")
|
|
806
|
+
return None
|
|
807
|
+
|
|
808
|
+
report = scan_skill(skill_path, whitelist, blacklist)
|
|
809
|
+
|
|
810
|
+
if json_output:
|
|
811
|
+
output_json([report])
|
|
812
|
+
else:
|
|
813
|
+
print_banner()
|
|
814
|
+
print(f"{C.CYAN}Pre-install scan results:{C.RESET}\n")
|
|
815
|
+
print_report(report)
|
|
816
|
+
print_summary([report])
|
|
817
|
+
|
|
818
|
+
return report
|
|
819
|
+
|
|
820
|
+
except FileNotFoundError:
|
|
821
|
+
print(f"{C.RED}✗ 'openclaw' command not found. Cannot pre-install scan.{C.RESET}")
|
|
822
|
+
print(f"{C.DIM} Install OpenClaw CLI or manually place the skill in the temp dir.{C.RESET}")
|
|
823
|
+
return None
|
|
824
|
+
except subprocess.TimeoutExpired:
|
|
825
|
+
print(f"{C.RED}✗ Download timed out for '{slug}'{C.RESET}")
|
|
826
|
+
return None
|
|
827
|
+
finally:
|
|
828
|
+
# Cleanup
|
|
829
|
+
shutil.rmtree(tmpdir, ignore_errors=True)
|
|
830
|
+
|
|
831
|
+
|
|
832
|
+
# ─── Main ────────────────────────────────────────────────────────────────────
|
|
833
|
+
|
|
834
|
+
def main():
|
|
835
|
+
parser = argparse.ArgumentParser(
|
|
836
|
+
description="🦞 Skill Scanner — Scan OpenClaw skills for malicious patterns",
|
|
837
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
838
|
+
)
|
|
839
|
+
parser.add_argument("--skill", "-s", help="Scan a specific skill by name")
|
|
840
|
+
parser.add_argument("--file", "-f", help="Scan a specific file")
|
|
841
|
+
parser.add_argument("--pre-install", "-p", dest="pre_install", help="Pre-install scan a ClawHub slug")
|
|
842
|
+
parser.add_argument("--json", "-j", action="store_true", help="Output results as JSON")
|
|
843
|
+
parser.add_argument("--report", "-r", help="Save markdown report to file")
|
|
844
|
+
parser.add_argument("--dir", "-d", default=str(DEFAULT_SKILLS_DIR), help="Skills directory to scan")
|
|
845
|
+
parser.add_argument("--no-color", action="store_true", help="Disable colored output")
|
|
846
|
+
parser.add_argument("--verbose", "-v", action="store_true", default=True, help="Verbose output (default)")
|
|
847
|
+
parser.add_argument("--compact", "-c", action="store_true", help="Compact output")
|
|
848
|
+
|
|
849
|
+
args = parser.parse_args()
|
|
850
|
+
|
|
851
|
+
if args.no_color or args.json:
|
|
852
|
+
C.disable()
|
|
853
|
+
|
|
854
|
+
verbose = not args.compact
|
|
855
|
+
|
|
856
|
+
# Pre-install scan mode
|
|
857
|
+
if args.pre_install:
|
|
858
|
+
report = pre_install_scan(args.pre_install, args.json)
|
|
859
|
+
if report and args.report:
|
|
860
|
+
md = generate_markdown_report([report])
|
|
861
|
+
with open(args.report, "w") as f:
|
|
862
|
+
f.write(md)
|
|
863
|
+
print(f"{C.GREEN}Report saved to {args.report}{C.RESET}")
|
|
864
|
+
sys.exit(0 if (report and report.risk_score < 70) else 1)
|
|
865
|
+
|
|
866
|
+
# Single file scan mode
|
|
867
|
+
if args.file:
|
|
868
|
+
file_path = Path(args.file).resolve()
|
|
869
|
+
if not file_path.exists():
|
|
870
|
+
print(f"{C.RED}✗ File not found: {args.file}{C.RESET}")
|
|
871
|
+
sys.exit(1)
|
|
872
|
+
report = scan_single_file(file_path)
|
|
873
|
+
if args.json:
|
|
874
|
+
output_json([report])
|
|
875
|
+
else:
|
|
876
|
+
print_banner()
|
|
877
|
+
print_report(report, verbose)
|
|
878
|
+
print_summary([report])
|
|
879
|
+
sys.exit(0 if report.risk_score < 70 else 1)
|
|
880
|
+
|
|
881
|
+
# Load whitelist/blacklist
|
|
882
|
+
whitelist, blacklist = load_lists()
|
|
883
|
+
skills_dir = Path(args.dir)
|
|
884
|
+
|
|
885
|
+
if not skills_dir.exists():
|
|
886
|
+
print(f"{C.RED}✗ Skills directory not found: {skills_dir}{C.RESET}")
|
|
887
|
+
sys.exit(1)
|
|
888
|
+
|
|
889
|
+
# Specific skill scan
|
|
890
|
+
if args.skill:
|
|
891
|
+
skill_path = skills_dir / args.skill
|
|
892
|
+
if not skill_path.exists():
|
|
893
|
+
print(f"{C.RED}✗ Skill not found: {args.skill}{C.RESET}")
|
|
894
|
+
sys.exit(1)
|
|
895
|
+
reports = [scan_skill(skill_path, whitelist, blacklist)]
|
|
896
|
+
else:
|
|
897
|
+
# Scan all skills
|
|
898
|
+
reports = []
|
|
899
|
+
for item in sorted(skills_dir.iterdir()):
|
|
900
|
+
if item.is_dir() and not item.name.startswith("."):
|
|
901
|
+
reports.append(scan_skill(item, whitelist, blacklist))
|
|
902
|
+
|
|
903
|
+
if not reports:
|
|
904
|
+
print(f"{C.YELLOW}No skills found to scan.{C.RESET}")
|
|
905
|
+
sys.exit(0)
|
|
906
|
+
|
|
907
|
+
# Output
|
|
908
|
+
if args.json:
|
|
909
|
+
output_json(reports)
|
|
910
|
+
else:
|
|
911
|
+
print_banner()
|
|
912
|
+
for report in sorted(reports, key=lambda r: -r.risk_score):
|
|
913
|
+
print_report(report, verbose)
|
|
914
|
+
print_summary(reports)
|
|
915
|
+
|
|
916
|
+
# Save markdown report if requested
|
|
917
|
+
if args.report:
|
|
918
|
+
md = generate_markdown_report(reports)
|
|
919
|
+
with open(args.report, "w") as f:
|
|
920
|
+
f.write(md)
|
|
921
|
+
print(f"{C.GREEN}📄 Report saved to {args.report}{C.RESET}")
|
|
922
|
+
|
|
923
|
+
# Exit code based on worst result
|
|
924
|
+
worst = max(r.risk_score for r in reports) if reports else 0
|
|
925
|
+
sys.exit(0 if worst < 70 else 1)
|
|
926
|
+
|
|
927
|
+
|
|
928
|
+
if __name__ == "__main__":
|
|
929
|
+
main()
|