Console Patrol

# ConsolePatrol Skill ## Name `console-patrol` ## Description 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. ## When to Use Use this skill when the user asks to: - "Check for console errors" - "Scan pages for warnings" - "Audit a web app" - "Find issues in the application" - "Debug console output" - Fixing React/antd/Element UI warnings ## Prerequisites The skill uses `console-patrol` package: ```bash pip install console-patrol playwright install chromium ``` ## Core Workflow ### 1. Quick Scan (Recommended) ```python from console_patrol import ConsolePatrol patrol = ConsolePatrol() result = patrol.scan( url="http://localhost:3000", routes=[ "http://localhost:3000/", "http://localhost:3000/dashboard", "http://localhost:3000/settings", ], wait_time=2.0, ) print(f"Issues found: {result.report.total_issues}") for issue in result.issues: print(f"[{issue.severity.value}] {issue.rule_id}") print(f" Fix: {issue.suggestion}") ``` ### 2. Auto-Discover Routes ```python from console_patrol import ConsolePatrol patrol = ConsolePatrol() result = patrol.scan( url="http://localhost:3000", router_type="react", base_path="/admin", auto_discover=True, # Auto-discover common routes ) ``` ### 3. With Framework Auto-Detection ```python result = patrol.scan( url="http://localhost:3000", routes=["http://localhost:3000/"], detect_framework=True, # Auto-detect UI framework ) print(f"Detected: {result.framework_info.ui_framework}") ``` ### 4. CLI Usage ```bash # Scan with auto-discovery console-patrol scan http://localhost:3000 --router-type react --auto-discover # Scan specific routes console-patrol scan http://localhost:3000 --routes "/,/dashboard,/about" # With screenshots on errors console-patrol scan http://localhost:3000 --screenshot # Output formats console-patrol scan http://localhost:3000 --format markdown ``` ## Detection Rules ### Severity Levels | Level | Meaning | Exit Code | |-------|---------|-----------| | P0 | Fatal (crashes, JS exceptions) | 2 | | P1 | Warning (framework issues) | 1 | | P2 | Hint (code smell) | 0 | ### Built-in Rules #### Ant Design - `antd-useForm-unhooked` (P1): `form.getFieldValue()` called outside Form - `antd-modal-context` (P1): Static modal in React 18 - `antd-tree-missing-keys` (P1): Tree wildcard keys - `antd-table-duplicate-key` (P0): Duplicate key in Table #### React - `react-uncaught-error` (P0): Uncaught JS exception - `react-chunk-load-error` (P0): Module load failure - `react-hooks-rules` (P1): Hooks violation - `react-list-missing-key` (P2): Missing key prop ## Response Format When issues are found, respond with: ``` ## ConsolePatrol Scan Results **Pages Scanned:** N **Total Issues:** N | Severity | Count | |----------|-------| | P0 (Fatal) | N | | P1 (Warning) | N | | P2 (Hint) | N | ### Issues **[P0] react-uncaught-error** - Message: Error description - Location: page URL - Fix: Suggestion **[P1] antd-useForm-unhooked** - Message: Error description - Location: page URL - Fix: Use state instead of form.getFieldValue() in render ``` ## Important Notes 1. **Wait Time**: Default 2s after page load. Increase for SPAs with lazy loading. 2. **Screenshots**: Use `--screenshot` flag to capture error screenshots. 3. **Frameworks**: Pass `--frameworks antd,react` to limit rule scope. 4. **Exit Codes**: Use in CI/CD: `if [ $? -gt 0 ]; then echo "Issues found"; fi` ## Installation for Agent If `console-patrol` is not installed: ```python import subprocess subprocess.run(["pip", "install", "console-patrol"], check=True) subprocess.run(["playwright", "install", "chromium"], check=True) ``` ## Edge Cases - **Page not loading**: Timeout is 30s by default. Check if dev server is running. - **No issues found**: Report success, no action needed. - **P0 issues**: Always highlight as critical, suggest immediate fix. - **Framework not detected**: Use default rules (antd, react, element).

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Console Patrol" with this command: npx skills add zhzgao/console-patrol

ConsolePatrol Skill

Name

console-patrol

Description

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.

When to Use

Use this skill when the user asks to:

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

Prerequisites

The skill uses console-patrol package:

pip install console-patrol
playwright install chromium

Core Workflow

1. Quick Scan (Recommended)

from console_patrol import ConsolePatrol

patrol = ConsolePatrol()
result = patrol.scan(
    url="http://localhost:3000",
    routes=[
        "http://localhost:3000/",
        "http://localhost:3000/dashboard",
        "http://localhost:3000/settings",
    ],
    wait_time=2.0,
)

print(f"Issues found: {result.report.total_issues}")
for issue in result.issues:
    print(f"[{issue.severity.value}] {issue.rule_id}")
    print(f"  Fix: {issue.suggestion}")

2. Auto-Discover Routes

from console_patrol import ConsolePatrol

patrol = ConsolePatrol()
result = patrol.scan(
    url="http://localhost:3000",
    router_type="react",
    base_path="/admin",
    auto_discover=True,  # Auto-discover common routes
)

3. With Framework Auto-Detection

result = patrol.scan(
    url="http://localhost:3000",
    routes=["http://localhost:3000/"],
    detect_framework=True,  # Auto-detect UI framework
)
print(f"Detected: {result.framework_info.ui_framework}")

4. CLI Usage

# Scan with auto-discovery
console-patrol scan http://localhost:3000 --router-type react --auto-discover

# Scan specific routes
console-patrol scan http://localhost:3000 --routes "/,/dashboard,/about"

# With screenshots on errors
console-patrol scan http://localhost:3000 --screenshot

# Output formats
console-patrol scan http://localhost:3000 --format markdown

Detection Rules

Severity Levels

LevelMeaningExit Code
P0Fatal (crashes, JS exceptions)2
P1Warning (framework issues)1
P2Hint (code smell)0

Built-in Rules

Ant Design

  • antd-useForm-unhooked (P1): form.getFieldValue() called outside Form
  • antd-modal-context (P1): Static modal in React 18
  • antd-tree-missing-keys (P1): Tree wildcard keys
  • antd-table-duplicate-key (P0): Duplicate key in Table

React

  • react-uncaught-error (P0): Uncaught JS exception
  • react-chunk-load-error (P0): Module load failure
  • react-hooks-rules (P1): Hooks violation
  • react-list-missing-key (P2): Missing key prop

Response Format

When issues are found, respond with:

## ConsolePatrol Scan Results

**Pages Scanned:** N
**Total Issues:** N

| Severity | Count |
|----------|-------|
| P0 (Fatal) | N |
| P1 (Warning) | N |
| P2 (Hint) | N |

### Issues

**[P0] react-uncaught-error**
- Message: Error description
- Location: page URL
- Fix: Suggestion

**[P1] antd-useForm-unhooked**
- Message: Error description
- Location: page URL
- Fix: Use state instead of form.getFieldValue() in render

Important Notes

  1. Wait Time: Default 2s after page load. Increase for SPAs with lazy loading.
  2. Screenshots: Use --screenshot flag to capture error screenshots.
  3. Frameworks: Pass --frameworks antd,react to limit rule scope.
  4. Exit Codes: Use in CI/CD: if [ $? -gt 0 ]; then echo "Issues found"; fi

Installation for Agent

If console-patrol is not installed:

import subprocess
subprocess.run(["pip", "install", "console-patrol"], check=True)
subprocess.run(["playwright", "install", "chromium"], check=True)

Edge Cases

  • Page not loading: Timeout is 30s by default. Check if dev server is running.
  • No issues found: Report success, no action needed.
  • P0 issues: Always highlight as critical, suggest immediate fix.
  • Framework not detected: Use default rules (antd, react, element).

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

GigaChat (Sber AI) Proxy

Integrate GigaChat (Sber AI) with OpenClaw via gpt2giga proxy

Registry SourceRecently Updated
3600smvlx
General

TencentCloud Video Face Fusion

通过提取两张人脸核心特征并实现自然融合,支持多种风格适配,提升创意互动性和内容传播力,广泛应用于创意营销、娱乐互动和社交分享场景。

Registry SourceRecently Updated
General

TencentCloud Image Face Fusion

图片人脸融合(专业版)为同步接口,支持自定义美颜、人脸增强、牙齿增强、拉脸等参数,最高支持8K分辨率,有多个模型类型供选择。

Registry SourceRecently Updated
General

YoudaoNote News

有道云笔记资讯推送:基于收藏笔记分析关注话题,推送最新相关资讯。支持对话触发与每日定时推送(如早上9点)。触发词:资讯推送、设置资讯推送、生成资讯推送。

Registry SourceRecently Updated
1.5K1lephix