Skylos
Code checks that show their work.
[](https://pypi.org/project/skylos/)


[](https://codecov.io/gh/duriantaco/skylos)

[](https://mcptoplist.com/server/io.github.duriantaco%2Fskylos)
[Command Groups](#command-groups) · [Quick Start](#quick-start) · [Skylos Cloud](#skylos-cloud) · [Docs & Guides](./docs/README.md) · [Website](https://skylos.dev) · [VS Code](./editors/vscode/README.md) · [Discord](https://discord.gg/Ftn9t9tErf)
**English** | [Deutsch](./docs/i18n/README.de.md) | [简体中文](./docs/i18n/README.zh-CN.md)
## What is Skylos?
Skylos is a free, open-source (Apache-2.0) code checker for code written by humans and coding agents (Claude Code, Codex, Cursor). It runs locally on your machine, inside your coding agent's loop, and as a pull-request gate in CI — with no account, no API key, and no LLM required.
Coding agents write code fast, and they repeat the same mistakes: deleting or skipping failing tests, installing packages that don't exist, importing functions nobody wrote, leaving injection bugs or hard-coded secrets behind, and abandoning dead code. Skylos catches all of this in one tool.
## Quick start
```bash
pip install skylos
skylos . -a # run every check locally; nothing leaves your machine
```
---
## Command groups
Skylos has commands for local scanning, coding-agent guardrails, CI gates, release checks, and Skylos Cloud. Everything is split into **8 groups** so you always know where to look:
| # | Group | What it is used for | Key commands | Guide |
|---:|---|---|---|---|
| **1** | [**Start Here & Daily Workflow**](#1-start-here--daily-workflow) | Set up a repository once and open one local page for your codebase map, changes, and check runs every day. | `skylos setup`, `skylos open`, `skylos doctor`, `skylos commands`, `skylos tour` | [Tutorial](./docs/workflow.md) |
| **2** | [**Code Scanning, Cleanup & Reports**](#2-code-scanning-cleanup--reports) | Scan code locally for dead code, security flaws, secrets, vulnerable packages, quality issues, import cycles, and tech debt. | `skylos .`, `skylos . -a`, `skylos lint`, `skylos debt`, `skylos report`, `skylos explain`, `skylos graph`, `skylos secrets-history`, `skylos sbom`, `skylos clean`, `skylos cleanup`, `skylos review`, `skylos suite` | [All commands](./docs/commands.md#2-code-scanning-cleanup--reports) |
| **3** | [**Coding Agent Guardrails**](#3-coding-agent-guardrails) | Check Claude Code, Codex, and Cursor while they work, block fake package installs and secret reads, and verify when they say "done". | `skylos agent install-hooks`, `skylos done`, `skylos verify`, `skylos stack`, `skylos hook`, `skylos agent harden`, `skylos agent recap`, `skylos mcp`, `skylos contract`, `skylos provenance` | [Agent hooks](./docs/agent-hooks.md) · [Done gate](./docs/done-gate.md) |
| **4** | [**AI Review & AI App Safety**](#4-ai-review--ai-app-safety) | Run optional LLM audits and dead-code reviews, or check guardrails and runtime behavior of AI/LLM apps you build. | `skylos discover`, `skylos defend`, `skylos agent init`, `skylos agent test`, `skylos agent scan`, `skylos agent verify`, `skylos agent audit`, `skylos agent remediate`, `skylos key` | [AI review](./docs/ai-review.md) · [AI app safety](./docs/agent-verification.md) |
| **5** | [**CI/CD & Pull Request Gates**](#5-cicd--pull-request-gates) | Block failing PRs, post inline review comments, require human approval on risky edits, and check Postgres migrations in CI. | `skylos cicd init`, `skylos cicd gate`, `skylos cicd review`, `skylos cicd annotate`, `skylos cicd risk-review`, `skylos cicd postgres-check` | [First gated PR](./docs/first-gated-pr.md) · [CI platforms](./docs/ci-platforms.md) |
| **6** | [**Release, Containers & External Scanners**](#6-release-containers--external-scanners) | Check built GPU artifacts, scan pinned container images, verify signed Cloud verdicts before deploy, and compare other scanners. | `skylos preflight`, `skylos image scan`, `skylos verify-verdict`, `skylos ingest`, `skylos compare` | [Release commands](./docs/commands.md#6-release-containers--external-scanners) |
| **7** | [**Config, Baselines & Utilities**](#7-config-baselines--utilities) | Set up config files, freeze existing debt in a baseline, whitelist symbols, manage rules and cache, or migrate from Sonar. | `skylos init`, `skylos baseline`, `skylos whitelist`, `skylos rules`, `skylos cache`, `skylos badge`, `skylos sonar import`, `skylos feedback` | [All commands](./docs/commands.md#7-config-baselines--utilities) |
| **8** | [**Skylos Cloud (Optional)**](#skylos-cloud) | View scans in a team web dashboard, enforce shared PR gates and policies, track decisions, and generate compliance reports. | `skylos cloud`, `skylos login`, `skylos whoami`, `skylos project`, `skylos sync`, `skylos upload --retry`, `skylos credits` | [Cloud guide](./docs/skylos-cloud.md) |
> Need the full command-by-command breakdown? See **[All Commands by Group](./docs/commands.md)** or run `skylos commands`.
---
## See it work
A 20-line Flask app scanned with every check (`skylos . -a --format concise`):
```text
app.py:15 SKY-D211 Possible SQL injection: tainted or string-built query.
app.py:5 SKY-L012 Import from local module 'billing' requests 'issue_refund', but that name is not defined or re-exported there.
app.py:8 SKY-S101 Potential stripe secret detected
requirements.txt:1 SKY-SCA-GHSA-68rp-wp8r-4726 flask@3.1.2: Flask session does not add `Vary: Cookie` header when accessed in some ways
billing.py:1 SKY-U001 unused function: charge_card
```
Every finding names the file, line, and rule ID. Security findings include source-to-sink trace paths; `--format json` outputs the full evidence.
---
## 1. Start Here & Daily Workflow
Use two commands for day-to-day work with or without coding agents:
```bash
skylos setup # once per repo: connects agent hooks/MCP, tests, PR check, and code map
skylos open # every day: opens one local page with your code diagram, change map, and check runs
```
Check your installation and active config anytime with `skylos doctor`, or run `skylos tour` for a quick walkthrough. See the [Setup-to-PR Tutorial](./docs/workflow.md).
---
## 2. Code Scanning, Cleanup & Reports
No account or LLM required. Everything runs locally:
```bash
skylos . # dead code (fast, default)
skylos . -a # every check: security, secrets, dependencies, quality, AI-code mistakes
skylos . -a --diff origin/main # only findings on changed lines
skylos . --coverage-report coverage.xml --min-new-coverage 80 --diff origin/main --gate
skylos . --duplication --max-new-duplication 3 --diff origin/main --gate
skylos . --gate # fail the build when local gate limits are exceeded
skylos . --format pretty # grouped report with code snippets (also: concise, json, sarif)
skylos . --tui # keyboard-driven terminal triage
skylos lint # local import cycles and configured architecture layers
skylos debt . # technical-debt score and hotspot ranking
skylos report . # write a shareable one-page HTML or Markdown report
skylos secrets-history . # scan local Git commit history for leaked credentials
skylos sbom . # export CycloneDX 1.6 or SPDX 2.3 SBOM offline
skylos clean . --dry-run # preview Python dead-code removal (--apply writes edits)
skylos cleanup . --top 5 # prioritized fix queue for you or a coding agent
```
Step through saved security traces with `skylos explain REPORT.json --interactive`, explore call graphs with `skylos graph`, or record local triage decisions with `skylos review`. See [CLI Output Modes](./docs/cli-output.md) and [All Commands — Group 2](./docs/commands.md#2-code-scanning-cleanup--reports).
### What Skylos catches
| Category | Examples |
|---|---|
| AI-code mistakes | Imports of missing functions, invented package APIs, fake/typosquatted packages, impossible versions, unfinished stubs, removed controls |
| Security flaws | SQL injection, XSS, SSRF, path traversal, command injection, unsafe deserialization, ReDoS |
| Secrets | API keys, tokens, private credentials, high-entropy strings, leaked secrets in git history |
| Dependencies | Known CVEs, static reachability (Python, JS/TS, Go, Rust), malicious packages, license policy, offline SBOM |
| Quality | Complexity, deep nesting, duplicate branches, long functions, inconsistent returns, import cycles |
| Test coverage | Overall and refactor-aware new-code line coverage from LCOV, Cobertura, JaCoCo, Go `coverprofile`, and OpenCover ([guide](./docs/test-coverage.md)) |
| Code duplication | Multi-language copy-paste detection with overall and refactor-aware new-code limits ([guide](./docs/code-duplication.md)) |
| Dead code | Unused functions, classes, imports, files, and dependencies (framework-aware: FastAPI, Django, Flask, Next.js, React, Laravel, ...) |
| CI/CD & deployment | Risky GitHub Actions and GitLab CI, Dockerfiles, Docker Compose, systemd, Kubernetes |
| LLM apps | Unsafe tool use, prompt-injection exposure, missing output validation |
Every rule: [Rules Reference](https://docs.skylos.dev/rules-reference) and [Rule Dictionary](./dictionary.md).
---
## 3. Coding Agent Guardrails
Stop coding agents from breaking things **while they work** and **before they claim "done"**:
### Real-time agent hooks
```bash
skylos agent install-hooks # Claude Code
skylos agent install-hooks --codex # Codex
skylos agent install-hooks --cursor # Cursor
```
- **After each edit:** checks changed lines for security bugs, secrets, and AI-code mistakes.
- **Before a file read:** blocks reading files containing hard-coded secrets.
- **Before a package install** (`pip`, `uv`, `npm`, `pnpm`, `bun`, `go`, ...): blocks fake or typosquatted packages.
- **Before a git command:** blocks `--no-verify` and git-hook bypasses.
- **At stop:** blocks "done" while issues introduced by the agent are still open.
Review what hooks caught with `skylos agent recap`, harden agent permissions with `skylos agent harden`, or expose Skylos tools via `skylos mcp`. See [Agent Hooks](./docs/agent-hooks.md).
### Verify the agent is really done
```bash
skylos done --base main
```
`skylos done` compares your branch against `main`, runs your test suite itself, writes a receipt to `.skylos/receipts/`, and blocks:
- deleted, skipped, or weakened tests
- loosened test configs or CI steps
- silenced lint or type checks
- code that special-cases tests to fake a pass
- code left without callers (advisory)
Settings are read from `main` so a branch cannot weaken its own check. pytest runs automatically; other runners need one line in `pyproject.toml` or `skylos.toml`:
```toml
[tool.skylos.done]
test_command = "npm test"
```
Also in this group: `skylos verify` (static AI-code checks, no LLM), `skylos done replay` (prove a test catches a regression), `skylos stack` (verify stacked PRs), and `skylos contract` (project hallucination contracts). See [Done Gate](./docs/done-gate.md) and [All Commands — Group 3](./docs/commands.md#3-coding-agent-guardrails).
---
## 4. AI Review & AI App Safety
### Check the AI/LLM apps you build (no LLM needed)
```bash
skylos discover . # list LLM calls, agent tools, and prompt sites
skylos defend . # score guardrails (OWASP LLM & Agentic Top 10)
skylos defend . --fail-on critical # CI gate
skylos defend . --format md -o evidence.md # shareable evidence report
skylos agent init && skylos agent test # runtime behavior contract testing for your agent
```
### Optional LLM-assisted code review (`pip install "skylos[llm]"`)
```bash
skylos key add # store your model provider key locally
skylos . -a --ai-review # AI double-check of unused code and Python security findings
skylos agent scan . # hybrid static + LLM scan
skylos agent verify . # LLM (or --dead-code-review jev) review of dead-code candidates
skylos agent security-deep . # staged deep security audit
skylos agent remediate . # scan and propose/apply fixes
```
See [Agent Verification](./docs/agent-verification.md), [Agent Behavior Testing](./docs/agent-behavior-testing.md), [AI Review](./docs/ai-review.md), and [Dead-Code Review](./docs/dead-code-review.md).
---