← 返回 Skills 市场
zhzgao

Console Patrol

作者 ThatsD · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
91
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install console-patrol
功能描述
Automatically scans web apps for console errors and warnings, providing framework-specific diagnostics and fix suggestions for React, Ant Design, and Element...
使用说明 (SKILL.md)

ConsolePatrol Skill\r

\r

Name\r

\r console-patrol\r \r

Description\r

\r AI-First Console Error & Warning Detector for Web Applications. Automatically scans web pages to detect console errors and warnings, with framework-specific rules for Ant Design, React, and Element UI.\r \r

When to Use\r

\r Use this skill when the user asks to:\r

  • "Check for console errors"\r
  • "Scan pages for warnings"\r
  • "Audit a web app"\r
  • "Find issues in the application"\r
  • "Debug console output"\r
  • Fixing React/antd/Element UI warnings\r \r

Prerequisites\r

\r The skill uses console-patrol package:\r \r

pip install console-patrol\r
playwright install chromium\r
```\r
\r
## Core Workflow\r
\r
### 1. Quick Scan (Recommended)\r
\r
```python\r
from console_patrol import ConsolePatrol\r
\r
patrol = ConsolePatrol()\r
result = patrol.scan(\r
    url="http://localhost:3000",\r
    routes=[\r
        "http://localhost:3000/",\r
        "http://localhost:3000/dashboard",\r
        "http://localhost:3000/settings",\r
    ],\r
    wait_time=2.0,\r
)\r
\r
print(f"Issues found: {result.report.total_issues}")\r
for issue in result.issues:\r
    print(f"[{issue.severity.value}] {issue.rule_id}")\r
    print(f"  Fix: {issue.suggestion}")\r
```\r
\r
### 2. Auto-Discover Routes\r
\r
```python\r
from console_patrol import ConsolePatrol\r
\r
patrol = ConsolePatrol()\r
result = patrol.scan(\r
    url="http://localhost:3000",\r
    router_type="react",\r
    base_path="/admin",\r
    auto_discover=True,  # Auto-discover common routes\r
)\r
```\r
\r
### 3. With Framework Auto-Detection\r
\r
```python\r
result = patrol.scan(\r
    url="http://localhost:3000",\r
    routes=["http://localhost:3000/"],\r
    detect_framework=True,  # Auto-detect UI framework\r
)\r
print(f"Detected: {result.framework_info.ui_framework}")\r
```\r
\r
### 4. CLI Usage\r
\r
```bash\r
# Scan with auto-discovery\r
console-patrol scan http://localhost:3000 --router-type react --auto-discover\r
\r
# Scan specific routes\r
console-patrol scan http://localhost:3000 --routes "/,/dashboard,/about"\r
\r
# With screenshots on errors\r
console-patrol scan http://localhost:3000 --screenshot\r
\r
# Output formats\r
console-patrol scan http://localhost:3000 --format markdown\r
```\r
\r
## Detection Rules\r
\r
### Severity Levels\r
\r
| Level | Meaning | Exit Code |\r
|-------|---------|-----------|\r
| P0 | Fatal (crashes, JS exceptions) | 2 |\r
| P1 | Warning (framework issues) | 1 |\r
| P2 | Hint (code smell) | 0 |\r
\r
### Built-in Rules\r
\r
#### Ant Design\r
- `antd-useForm-unhooked` (P1): `form.getFieldValue()` called outside Form\r
- `antd-modal-context` (P1): Static modal in React 18\r
- `antd-tree-missing-keys` (P1): Tree wildcard keys\r
- `antd-table-duplicate-key` (P0): Duplicate key in Table\r
\r
#### React\r
- `react-uncaught-error` (P0): Uncaught JS exception\r
- `react-chunk-load-error` (P0): Module load failure\r
- `react-hooks-rules` (P1): Hooks violation\r
- `react-list-missing-key` (P2): Missing key prop\r
\r
## Response Format\r
\r
When issues are found, respond with:\r
\r
```\r
## ConsolePatrol Scan Results\r
\r
**Pages Scanned:** N\r
**Total Issues:** N\r
\r
| Severity | Count |\r
|----------|-------|\r
| P0 (Fatal) | N |\r
| P1 (Warning) | N |\r
| P2 (Hint) | N |\r
\r
### Issues\r
\r
**[P0] react-uncaught-error**\r
- Message: Error description\r
- Location: page URL\r
- Fix: Suggestion\r
\r
**[P1] antd-useForm-unhooked**\r
- Message: Error description\r
- Location: page URL\r
- Fix: Use state instead of form.getFieldValue() in render\r
```\r
\r
## Important Notes\r
\r
1. **Wait Time**: Default 2s after page load. Increase for SPAs with lazy loading.\r
2. **Screenshots**: Use `--screenshot` flag to capture error screenshots.\r
3. **Frameworks**: Pass `--frameworks antd,react` to limit rule scope.\r
4. **Exit Codes**: Use in CI/CD: `if [ $? -gt 0 ]; then echo "Issues found"; fi`\r
\r
## Installation for Agent\r
\r
If `console-patrol` is not installed:\r
\r
```python\r
import subprocess\r
subprocess.run(["pip", "install", "console-patrol"], check=True)\r
subprocess.run(["playwright", "install", "chromium"], check=True)\r
```\r
\r
## Edge Cases\r
\r
- **Page not loading**: Timeout is 30s by default. Check if dev server is running.\r
- **No issues found**: Report success, no action needed.\r
- **P0 issues**: Always highlight as critical, suggest immediate fix.\r
- **Framework not detected**: Use default rules (antd, react, element).\r
安全使用建议
This skill's purpose and code examples are coherent, but it asks the agent to install a PyPI package ('console-patrol') and Playwright/Chromium at runtime without providing a source URL, package version, checksums, or homepage. Before installing, verify the package provenance (PyPI project page, GitHub repo, maintainer), prefer a pinned version and checksum, and run installs in an isolated environment (virtualenv or sandbox) to avoid altering system-wide Python or downloading untrusted binaries. If you cannot verify the package/source, avoid running the automatic pip/playwright install and ask the skill's author for a signed release or official upstream link. Also be cautious about scanning arbitrary remote URLs (possible sensitive-target scanning or SSRF) and consider limiting scanning to trusted hosts or local development instances.
功能分析
Type: OpenClaw Skill Name: console-patrol Version: 0.1.0 The skill automates web application debugging by scanning for console errors using the `console-patrol` library and Playwright. It explicitly instructs the agent to perform shell-based dependency installation (`pip install`) and network-based scanning of URLs (`SKILL.md`). While these capabilities are aligned with the stated diagnostic purpose, the combination of automated package installation and arbitrary network access via a headless browser introduces significant risks, such as supply chain attacks or SSRF, if the agent is directed toward sensitive internal endpoints.
能力评估
Purpose & Capability
Name, description, and runtime examples align: a console-scanning tool reasonably needs a Python package and a headless browser (Playwright/Chromium) to execute scans and capture console output.
Instruction Scope
SKILL.md tells the agent to run pip install console-patrol and playwright install chromium (including example subprocess.run code). Those runtime install instructions will download and execute third-party code and binaries and will allow the skill to fetch arbitrary URLs supplied for scanning. The instructions do not constrain where packages/binaries are installed (system vs virtualenv) or limit target URLs, which broadens the skill's runtime effects.
Install Mechanism
There is no formal install spec; instead the README instructs the agent to pip install a package named 'console-patrol' and run Playwright's installer. Installing from PyPI and downloading Chromium are reasonable for the functionality but risky without provenance: pip packages can execute arbitrary code during install, and Playwright will download large browser binaries. No package version pinning, checksums, or official upstream links/homepage are provided.
Credentials
The skill does not request environment variables, credentials, or config paths — proportional to the stated purpose. However, runtime installation will modify the agent environment (install packages/binaries), which is a side effect not declared in metadata.
Persistence & Privilege
always is false and the skill is user-invocable (normal). The SKILL.md explicitly instructs installing packages and browser binaries, which creates persistent files on disk and may change the agent environment; this is expected for such a tool but increases the blast radius compared to an instruction-only skill that makes no on-disk changes.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install console-patrol
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /console-patrol 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release of console-patrol skill. - Detects and reports console errors and warnings on web applications. - Supports framework-specific rules for Ant Design, React, and Element UI. - Provides CLI and Python API for scanning URLs and routes, with auto-discovery and framework detection options. - Categorizes findings by severity (P0: Fatal, P1: Warning, P2: Hint) with built-in detection rules. - Includes response formats and usage guides for both end-users and automated workflows.
元数据
Slug console-patrol
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Console Patrol 是什么?

Automatically scans web apps for console errors and warnings, providing framework-specific diagnostics and fix suggestions for React, Ant Design, and Element... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 91 次。

如何安装 Console Patrol?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install console-patrol」即可一键安装,无需额外配置。

Console Patrol 是免费的吗?

是的,Console Patrol 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Console Patrol 支持哪些平台?

Console Patrol 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Console Patrol?

由 ThatsD(@zhzgao)开发并维护,当前版本 v0.1.0。

💬 留言讨论