← Back to Skills Marketplace
occupythemilkyway

Argus Lite — Code Scanner (Free)

by OccupyTheMilkyWay · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
21
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install argus-lite
Description
Argus Lite — Code Scanner (Free). Scan a single Python file for the top 10 most critical security and bug patterns. A free preview of what Argus Pro does f...
README (SKILL.md)

Argus Lite — Free Code Scanner

Scan one Python file against the top 10 critical security and bug rules.

Free vs Pro

Feature Argus Lite (Free) Argus Pro
Files 1 file only Full directory recursion
Rules 10 (critical/high) 40+ incl. performance
Languages Python only Python + JavaScript
JSON output ❌ ✅ CI-ready
CI exit codes ❌ ✅ FAIL_ON_CRITICAL
Ignore paths ❌ ✅
Deduplication Basic Smart cross-file

👉 Upgrade: openclaw skills install argus-pro — key at ko-fi.com/occupythemilkyway


Step 1 — Install

pip3 install rich --break-system-packages --quiet

Step 2 — Quick security scan (Lite)

import os, re
from pathlib import Path
from rich.console import Console
from rich.table import Table
from rich.panel import Panel
from rich import box

console = Console()

SRC_PATH = os.environ.get("SOURCE_PATH",".").strip()
src      = Path(SRC_PATH)

# Find a single Python file to scan
if src.is_dir():
    py_files = list(src.rglob("*.py"))
    if not py_files:
        console.print(f"[yellow]No .py files found in {SRC_PATH}[/yellow]")
        raise SystemExit(0)
    target = py_files[0]
    if len(py_files) > 1:
        console.print(f"[yellow]ℹ️  Lite scans 1 file at a time. Scanning: {target}\
   (Upgrade to Pro to scan all {len(py_files)} files)[/yellow]\
")
elif src.is_file():
    target = src
else:
    console.print(f"[red]❌ Not found: {SRC_PATH}[/red]")
    raise SystemExit(1)

# Top 10 critical/high rules only (Lite)
RULES = [
    ("PY001","critical","security", r"\beval\s*\(",                           "eval() executes arbitrary code — critical risk.",         "Use ast.literal_eval() for safe evaluation."),
    ("PY002","critical","security", r"\bexec\s*\(",                           "exec() executes arbitrary strings as Python code.",       "Refactor to eliminate dynamic execution."),
    ("PY003","critical","security", r"\bpickle\.loads?\s*\(",                 "pickle.load() with untrusted data → code execution.",     "Use json.loads() instead."),
    ("PY004","high","security",     r"(?i)(password|secret|api_key|token)\s*=\s*['\"].+['\"]","Hardcoded credential detected.",          "Move to environment variables."),
    ("PY005","high","security",     r"shell\s*=\s*True",                      "shell=True in subprocess → command injection risk.",      "Use list arguments: subprocess.run(['cmd','arg'])"),
    ("PY006","high","security",     r"\.execute\s*\(.*(%|\.format\(|f['\"])", "Potential SQL injection via string formatting.",          "Use parameterised queries: cursor.execute(sql,(val,))"),
    ("PY009","medium","bug",        r"except\s*:",                            "Bare except catches SystemExit and KeyboardInterrupt.",   "Use: except Exception: or catch specific types."),
    ("PY016","medium","security",   r"hashlib\.(md5|sha1)\s*\(",              "MD5/SHA1 are cryptographically broken.",                  "Use hashlib.sha256() or bcrypt for passwords."),
    ("PY007","medium","bug",        r"def\s+\w+\s*\([^)]*=\s*\[\s*\]",      "Mutable default argument [] — shared across all calls.",  "Use None as default; init list inside function."),
    ("PY017","high","security",     r"\brandom\.(random|randint|choice)\s*\(","random module is not cryptographically secure.",          "Use secrets module for security-sensitive values."),
]

console.print(Panel.fit(
    f"[bold red]🐛 Argus Lite — Quick Scan[/bold red]\
"
    f"File: [yellow]{target}[/yellow]\
"
    f"[dim]Lite: 1 file, 10 rules — upgrade to Pro for full codebase scanning[/dim]",
    border_style="red"
))

findings = []
try:
    source = target.read_text(encoding="utf-8", errors="replace")
    for lineno, line in enumerate(source.splitlines(), 1):
        for rule_id, sev, category, pattern, message, fix in RULES:
            if re.search(pattern, line):
                findings.append({"id":rule_id,"severity":sev,"category":category,
                                 "line":lineno,"code":line.strip()[:80],"message":message,"fix":fix})
except Exception as e:
    console.print(f"[red]Error reading file: {e}[/red]")
    raise SystemExit(1)

# Deduplicate
seen, unique = set(), []
for f in findings:
    key = (f["id"],f["line"])
    if key not in seen:
        seen.add(key)
        unique.append(f)

SEV_COLOUR = {"critical":"red","high":"orange3","medium":"yellow","low":"dim"}

if not unique:
    console.print(Panel(
        f"[green]✅ No issues in {RULES.__len__()} rule scan![/green]\
"
        f"[dim]Pro scans 40+ rules including performance patterns — upgrade for full coverage.[/dim]",
        border_style="green"
    ))
else:
    tbl = Table(title=f"🔍 {len(unique)} Finding(s) in {target.name}", box=box.ROUNDED, border_style="red")
    tbl.add_column("ID",      width=7,  style="dim")
    tbl.add_column("Sev",     width=9)
    tbl.add_column("Line",    width=6,  justify="right", style="yellow")
    tbl.add_column("Issue",   width=50)
    for fi in unique:
        sc = SEV_COLOUR.get(fi["severity"],"white")
        tbl.add_row(fi["id"],f"[{sc}]{fi['severity'].upper()}[/{sc}]",str(fi["line"]),fi["message"][:48])
    console.print(tbl)

    for fi in [f for f in unique if f["severity"] in ("critical","high")]:
        sc = SEV_COLOUR.get(fi["severity"],"white")
        console.print(Panel(
            f"[dim]Line {fi['line']}:[/dim] [italic]{fi['code']}[/italic]\
\
"
            f"[white]{fi['message']}[/white]\
\
"
            f"[green]Fix:[/green] {fi['fix']}",
            title=f"[{sc}]{fi['severity'].upper()}[/{sc}] — {fi['id']}",
            border_style=sc
        ))

console.print()
console.print(Panel(
    f"[bold yellow]🔓 Want more?[/bold yellow]\
\
"
    f"Argus Pro scans [bold]your entire codebase[/bold] with [bold]40+ rules[/bold] across Python and JavaScript — "
    f"including performance issues, memory leaks, and N+1 query patterns. "
    f"Plus CI-ready JSON output and FAIL_ON_CRITICAL exit codes.\
\
"
    f"[bold cyan]openclaw skills install argus-pro[/bold cyan]\
"
    f"Get your key → [bold]ko-fi.com/occupythemilkyway[/bold]",
    title="Upgrade to Argus Pro",
    border_style="cyan"
))
Usage Guidance
This skill appears safe for local use if you trust the pip package installation step. Prefer running it in a Python virtual environment, set SOURCE_PATH to the exact Python file you want scanned, and be careful sharing results because they may include snippets of your code or secrets.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The stated purpose is to scan one Python file for common security and bug patterns, and the shown instructions implement a local regex-based Python scan.
Instruction Scope
The scanner defaults SOURCE_PATH to '.', and if given a directory it recursively finds Python files but scans only the first one. Users should set SOURCE_PATH to the exact file they intend to scan.
Install Mechanism
The setup asks the user to install the 'rich' package from pip without pinning a version and with '--break-system-packages'. This is user-directed and purpose-aligned, but a virtual environment would be safer.
Credentials
The requested python3/pip3 environment and local file path access are proportionate for a Python code scanner, but scanned source may contain sensitive code or secrets.
Persistence & Privilege
No background service, account credential use, privilege escalation, or ongoing persistence is shown beyond the optional local package installation.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install argus-lite
  3. After installation, invoke the skill by name or use /argus-lite
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial Lite release: 1 file, 10 critical rules, Python only, Pro upsell
Metadata
Slug argus-lite
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Argus Lite — Code Scanner (Free)?

Argus Lite — Code Scanner (Free). Scan a single Python file for the top 10 most critical security and bug patterns. A free preview of what Argus Pro does f... It is an AI Agent Skill for Claude Code / OpenClaw, with 21 downloads so far.

How do I install Argus Lite — Code Scanner (Free)?

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

Is Argus Lite — Code Scanner (Free) free?

Yes, Argus Lite — Code Scanner (Free) is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Argus Lite — Code Scanner (Free) support?

Argus Lite — Code Scanner (Free) is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Argus Lite — Code Scanner (Free)?

It is built and maintained by OccupyTheMilkyWay (@occupythemilkyway); the current version is v1.0.0.

💬 Comments