← Back to Skills Marketplace
suhteevah

errorlens

by suhteevah · GitHub ↗ · v1.0.1 · MIT-0
darwinlinuxwin32 ✓ Security Clean
97
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install errorlens
Description
Error handling & exception safety analyzer -- scans codebases for empty catches, swallowed exceptions, missing error boundaries, unhandled rejections, generi...
README (SKILL.md)

\r \r

ErrorLens -- Error Handling & Exception Safety Analyzer\r

\r ErrorLens scans codebases for dangerous error handling patterns: empty catch blocks, swallowed exceptions, missing error boundaries, unhandled promise rejections, generic error types, missing finally blocks, bare except clauses, error message information leaks, unchecked error returns, and missing error propagation. Covers JS/TS, Python, Java, Go, Rust, and C#. Uses regex-based pattern matching against 90+ error handling anti-patterns, lefthook for git hook integration, and produces markdown reports with actionable remediation recommendations. 100% local. Zero telemetry.\r \r

Commands\r

\r

Free Tier (No license required)\r

\r

errorlens scan [file|directory]\r

One-shot error handling scan of files or directories.\r \r How to execute:\r

bash "\x3CSKILL_DIR>/scripts/errorlens.sh" scan [target]\r
```\r
\r
**What it does:**\r
1. Accepts a file path or directory (defaults to current directory)\r
2. Discovers all source files (skips .git, node_modules, binaries, images, .min.js)\r
3. Runs 90+ error handling pattern checks against each file\r
4. Respects .gitignore and allowlist files\r
5. Calculates an error safety score (0-100) per file and overall\r
6. Grades: A (90-100), B (80-89), C (70-79), D (60-69), F (\x3C60)\r
7. Outputs findings with: file, line number, check ID, severity, description, recommendation\r
8. Exit code 0 if score >= 70, exit code 1 if too many issues found\r
9. Free tier limited to 5 files per scan\r
\r
**Example usage scenarios:**\r
- "Scan my code for error handling issues" -> runs `errorlens scan .`\r
- "Check this file for empty catch blocks" -> runs `errorlens scan src/api.ts`\r
- "Find swallowed exceptions in my project" -> runs `errorlens scan src/`\r
- "Are there unsafe error patterns in my code?" -> runs `errorlens scan .`\r
- "Check for missing error boundaries" -> runs `errorlens scan .`\r
\r
#### `errorlens hook`\r
Install git pre-commit hooks that scan staged files for error handling issues before every commit.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/errorlens.sh" hook install\r
```\r
\r
**What it does:**\r
1. Copies lefthook config to project root\r
2. Installs lefthook pre-commit hook\r
3. On every commit: scans all staged files for error handling issues, blocks commit if critical/high findings, shows remediation advice\r
\r
#### `errorlens report [directory]`\r
Generate a markdown error handling report with findings, severity breakdown, and remediation steps.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/errorlens.sh" report [directory]\r
```\r
\r
**What it does:**\r
1. Runs full scan of the directory\r
2. Generates a formatted markdown report from template\r
3. Includes per-file breakdowns, error safety scores, remediation priority\r
4. Output suitable for code reviews and quality audits\r
\r
### Pro Tier ($19/user/month -- requires ERRORLENS_LICENSE_KEY)\r
\r
#### `errorlens watch [directory]`\r
Continuous monitoring mode that watches for file changes and re-scans automatically.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/errorlens.sh" watch [directory]\r
```\r
\r
**What it does:**\r
1. Validates Pro+ license\r
2. Watches directory for file modifications\r
3. Re-scans changed files automatically on save\r
4. Displays live error handling score updates\r
5. Useful for development-time feedback\r
\r
#### `errorlens ci [directory]`\r
CI/CD integration mode with strict exit codes and machine-readable output.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/errorlens.sh" ci [directory]\r
```\r
\r
**What it does:**\r
1. Validates Pro+ license\r
2. Runs full scan with no file limit\r
3. Outputs findings in CI-friendly format\r
4. Exit code 0 = pass (score >= 70), 1 = fail\r
5. Supports severity threshold configuration\r
6. Suitable for GitHub Actions, GitLab CI, Jenkins, etc.\r
\r
### Team Tier ($39/user/month -- requires ERRORLENS_LICENSE_KEY with team tier)\r
\r
#### `errorlens team-report [directory]`\r
Aggregate team-level error handling metrics and trends.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/errorlens.sh" team-report [directory]\r
```\r
\r
**What it does:**\r
1. Validates Team+ license\r
2. Scans entire directory with full pattern set\r
3. Generates aggregate metrics per category (EC, SE, EB, GE, RP, IL)\r
4. Shows per-directory breakdown for team ownership analysis\r
5. Includes trend data if previous baselines exist\r
6. Reports team-wide error handling maturity score\r
\r
#### `errorlens baseline [directory]`\r
Establish a baseline of known error handling issues for incremental improvement tracking.\r
\r
**How to execute:**\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/errorlens.sh" baseline [directory]\r
```\r
\r
**What it does:**\r
1. Validates Team+ license\r
2. Scans directory and records all current findings as baseline\r
3. Saves baseline to .errorlens-baseline.json\r
4. Future scans only report NEW issues not in the baseline\r
5. Useful for legacy codebases with known accepted patterns\r
6. Enables incremental error handling improvement tracking\r
\r
#### `errorlens status`\r
Show license and configuration information.\r
\r
```bash\r
bash "\x3CSKILL_DIR>/scripts/errorlens.sh" status\r
```\r
\r
## Detected Error Handling Patterns\r
\r
ErrorLens detects 90+ error handling anti-patterns across 6 categories:\r
\r
| Category | Examples | Severity |\r
|----------|----------|----------|\r
| **Empty Catches (EC)** | Empty catch blocks in JS/TS/Java/C#/Python, catch with only comments, catch with only pass, catch-all without logging | Critical/High |\r
| **Swallowed Exceptions (SE)** | Catch blocks that don't rethrow/log, exception variable unused, catch that returns null/undefined/false silently, ignored error callbacks | Critical/High |\r
| **Error Boundaries (EB)** | Missing React error boundaries, missing Express error middleware, missing global handlers, unhandled promise rejections, window.onerror | High/Medium |\r
| **Generic Errors (GE)** | Throwing generic Error/Exception, bare except in Python, catching Throwable in Java, catching Object in TS, overly broad error types | High/Medium |\r
| **Resource & Propagation (RP)** | Missing finally for resource cleanup, unchecked error returns in Go, missing error propagation (? in Rust), ignored Result types, missing defer/close | High/Medium |\r
| **Information Leak (IL)** | Stack traces in HTTP responses, error.message in API responses, console.error with sensitive data, verbose errors in production, raw exception details to users | High/Medium |\r
\r
## Configuration\r
\r
Users can configure ErrorLens in `~/.openclaw/openclaw.json`:\r
\r
```json\r
{\r
  "skills": {\r
    "entries": {\r
      "errorlens": {\r
        "enabled": true,\r
        "apiKey": "YOUR_LICENSE_KEY_HERE",\r
        "config": {\r
          "severityThreshold": "high",\r
          "ignorePatterns": ["**/test/**", "**/fixtures/**", "**/*.test.*"],\r
          "ignoreChecks": [],\r
          "allowlistFile": ".errorlens-allowlist",\r
          "reportFormat": "markdown"\r
        }\r
      }\r
    }\r
  }\r
}\r
```\r
\r
## Important Notes\r
\r
- **Free tier** works immediately with no configuration\r
- **All scanning happens locally** -- no code is sent to external servers\r
- **License validation is offline** -- no phone-home or network calls\r
- Pattern matching only -- no AST parsing, no external dependencies beyond bash\r
- Supports scanning all file types in a single pass\r
- Git hooks use **lefthook** which must be installed (see install metadata above)\r
- Exit codes: 0 = clean (score >= 70), 1 = issues detected (for CI/CD integration)\r
\r
## Error Handling\r
\r
- If lefthook is not installed and user tries `hook install`, prompt to install it\r
- If license key is invalid or expired, show clear message with link to https://errorlens.pages.dev/renew\r
- If a file is binary, skip it automatically with no warning\r
- If no scannable files found in target, report clean scan with info message\r
- If .errorlens-allowlist is missing, skip allowlist filtering gracefully\r
\r
## When to Use ErrorLens\r
\r
The user might say things like:\r
- "Scan my code for error handling issues"\r
- "Find empty catch blocks in my project"\r
- "Check for swallowed exceptions"\r
- "Are there missing error boundaries?"\r
- "Scan for unsafe error patterns"\r
- "Find unhandled promise rejections"\r
- "Check if my error handling is correct"\r
- "Detect bare except clauses"\r
- "Run an error handling audit"\r
- "Set up pre-commit hooks for error handling"\r
- "Generate an error handling report"\r
- "Find catch blocks that don't rethrow"\r
- "Check for generic error types"\r
- "Scan for information leaks in error messages"\r
- "Audit my code for exception safety"\r
- "Find missing finally blocks"\r
- "Check for unchecked error returns in Go"\r
- "Baseline existing error handling issues"\r
Usage Guidance
This skill appears to do what it claims: a local, regex-based error-handling scanner with optional pre-commit hooks and license-gated features. Before installing or enabling hooks you should: (1) inspect the shipped scripts (patterns.sh, analyzer.sh, license.sh) — hooks will execute those scripts on every commit; (2) keep your license key in the environment or ~/.openclaw/openclaw.json as described and only provide a key intended for ErrorLens; (3) ensure you trust the lefthook tool (brew install lefthook) and verify any appended lefthook.yml changes in your repo. Nothing in the code attempts network exfiltration, but installing the pre-commit hook gives the skill's code execution on commits, so enable hooks only for repositories you trust.
Capability Analysis
Type: OpenClaw Skill Name: errorlens Version: 1.0.1 ErrorLens is a static analysis tool designed to identify error handling anti-patterns (e.g., empty catches, swallowed exceptions, information leaks) across multiple programming languages. The skill bundle consists of shell scripts (analyzer.sh, errorlens.sh) that perform local regex-based scanning using a comprehensive set of patterns defined in patterns.sh. It includes legitimate features such as git hook integration via lefthook and markdown report generation. The license validation logic in license.sh is performed offline via JWT decoding, and there is no evidence of data exfiltration, telemetry, or malicious execution.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
Name, description, and included scripts implement a local regex-based error-handling scanner, pre-commit hook integration (lefthook), reporting, watch/CI/team modes gated behind a license key. Required binaries (git, bash, python3, jq) and the brew lefthook install are proportionate to the described functionality.
Instruction Scope
Runtime instructions source and execute the shipped bash scripts (patterns.sh, analyzer.sh, license.sh). The pre-commit hook installs run those local scripts from $HOME/.openclaw/skills/errorlens or project lefthook.yml; thus commits will execute code from the skill directory. The analyzer reads ~/.openclaw/openclaw.json (to find a configured license key) and optional .errorlens-allowlist/.errorlens-baseline files in the repo. There are no network calls or external endpoints in the scripts; however, installing the hook grants the skill's code the ability to run on every git commit, so you must trust the shipped scripts before enabling hooks.
Install Mechanism
Install spec uses a single brew formula (lefthook), which is a known git-hook manager. No downloads from untrusted URLs or archive extraction are present. The skill's own files are supplied in the bundle (scripts, patterns, config).
Credentials
The only credential surface is ERRORLENS_LICENSE_KEY (primaryEnv) used to enable Pro/Team features; that is consistent with the pro/team features described. The license module reads the key from the environment or from ~/.openclaw/openclaw.json; it does not attempt to read unrelated secrets. An optional CLAWHUB_JWT_SECRET is only used to verify JWT signatures if present — not required for normal operation.
Persistence & Privilege
always:false and user-invocable:true (normal). Installing hooks writes/edits lefthook.yml in the repository and calls lefthook install; the skill does not request permanent platform-wide privileges beyond adding hooks to repos the user chooses. Because hooks execute the skill's scripts on commit, installing hooks grants those scripts execution on future commits — review the code before enabling hooks.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install errorlens
  3. After installation, invoke the skill by name or use /errorlens
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Fix: declare all deps, JWT verification, configPaths
v1.0.0
Initial release of ErrorLens – Error handling & exception safety analyzer - Scans codebases for empty catches, swallowed exceptions, missing error boundaries, unhandled rejections, generic error types, and unsafe error patterns across JS/TS, Python, Java, Go, Rust, and C#. - Detects 90+ error handling anti-patterns using regex-based pattern matching. - Integrates with git via pre-commit hooks (lefthook) and produces actionable markdown reports. - Offers free, Pro, and Team tiers, with CLI commands for scanning, reporting, CI integration, baseline establishment, and team metrics. - 100% local scanning with zero telemetry; all code analysis happens offline.
Metadata
Slug errorlens
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is errorlens?

Error handling & exception safety analyzer -- scans codebases for empty catches, swallowed exceptions, missing error boundaries, unhandled rejections, generi... It is an AI Agent Skill for Claude Code / OpenClaw, with 97 downloads so far.

How do I install errorlens?

Run "/install errorlens" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is errorlens free?

Yes, errorlens is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does errorlens support?

errorlens is cross-platform and runs anywhere OpenClaw / Claude Code is available (darwin, linux, win32).

Who created errorlens?

It is built and maintained by suhteevah (@suhteevah); the current version is v1.0.1.

💬 Comments