cli-audit-shell — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited cli-audit-shell (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Optimization: This skill uses on-demand loading. Heavy content lives in references/ and is loaded only when needed.Language rule: Skill instructions are written in English. This skill targets Bash scripts exclusively. When generating user-facing output, detect the project's primary language (from README, comments, docs, commit messages) and produce the report in that language. If the project is bilingual, ask the user which language to use before proceeding.
"Shell should only be used for small utilities or simple wrapper scripts." — Google Shell Style Guide
file:line reference. No vague "the script could be better"set -e, redundant package checks, injections in heredocs)references/anti-patterns.md in findingsreferences/tooling-ladder.md../gotchas.md before producing output to avoid known mistakes$ARGUMENTS is the target to audit (file path, directory, or empty for auto-detect).
.sh file: audit that file deeply.sh files and shebanged scripts in it**/*.sh + grep #!/bin/bash or #!/usr/bin/env bash)Score each dimension 0.0-1.0, then compute a weighted SQI. Read references/categories.md for detailed checklists per category.
| # | Category | Weight | Key question | ||
|---|---|---|---|---|---|
| S1 | Strict Mode Coherence | 12% | Is set -euo pipefail used AND is code compatible with it? No dead fallbacks? | ||
| S2 | Error Surfaces & Return Values | 12% | Are return values checked? No `\ | \ | true? No swallowed 2>/dev/null`? |
| S3 | Logging & Observability | 8% | Uses logger(1) or structured output? Timestamps? Severity levels? | ||
| S4 | Stderr Hygiene | 5% | Errors to stderr, output to stdout? No blanket 2>/dev/null? | ||
| S5 | Variable Discipline | 10% | local in functions? No unquoted expansions? No injection in heredocs? | ||
| S6 | Quoting & Expansion | 8% | "${var}" not $var? Arrays for lists? "$@" not $*? | ||
| S7 | Control Flow & Structure | 8% | main() pattern? Functions near top? Early returns? Max depth 3? | ||
| S8 | Naming Conventions | 5% | lower_snake_case functions? UPPER_CASE constants? :: for packages? | ||
| S9 | CLI Ergonomics | 10% | getopts/getopt for options? --help? Single entry point vs N scripts? S9 follows the canonical surface mapping in ../shared/cli-ergonomics.md (Laws 1-3 applied to shell). | ||
| S10 | Idempotency & Safety | 10% | Check-before-create? No destructive assumptions? readonly for constants? | ||
| S11 | Namespace & Env Hygiene | 7% | Env vars prefixed by project? No global pollution? local everywhere? | ||
| S12 | Security & Injection | 5% | No eval? No unquoted user input in commands? No shell injection in env blocks? |
Glob for shell scripts: **/*.sh, **/Makefile, shebanged files. For broad audit, prioritize: entry points (setup.sh, install.sh, deploy.sh), longest scripts, most-changed scripts (git log).
Detect output language: git log --oneline -10 + head -20 README.md. Report in the project's language (French commits → French report).
Classify each script:
| Type | Characteristics | Adjusted expectations |
|---|---|---|
| Installer/bootstrap | Runs as root, creates users/mounts | S10 (idempotency) weight ×1.5, S12 (security) weight ×1.5 |
| Library (sourced) | Has .sh extension, no shebang exec | S8 (naming) weight ×1.5, S9 (CLI) weight ×0 |
| Wrapper/glue | < 50 lines, calls other tools | Lighter audit overall, S7 (structure) weight ×0.5 |
| Build/CI script | In .github/, .gitlab-ci/, Makefile | S2 (errors) weight ×1.5 |
shellcheck -x -S style <file>If shellcheck is not installed, note it and proceed with manual analysis. Shellcheck findings go into the report but don't duplicate them in the dimension scores — this skill adds what shellcheck cannot see.
Read references/categories.md for detailed checks. For each category: collect evidence, assign score 0.0-1.0, note specific file:line findings.
Read references/anti-patterns.md for named anti-patterns with detection heuristics. These are the semantic patterns shellcheck cannot find.
Read references/tooling-ladder.md for the complexity-adapted tooling decision tree. Flag scripts that use sed/awk for YAML when they should use yq/kustomize. Flag scripts that use kustomize for a 3-variable substitution when sed would suffice.
Read references/scoring.md for the SQI formula, severity classification, and benchmarks.
SQI = Sigma(wi x si) / Sigma(wi) x 10Finding tier and confidence semantics are canonical in ../shared/triage.md (Tier 3/2/1 + GRADE + triangulation). S-dimension findings carry tier and confidence so cli-cycle can aggregate without re-parsing.
# Shell Audit -- {project-name}
**Target**: [file/directory] | **Scripts found**: [N] | **Date**: [date]
**SQI Score**: X.X/10 -- {verdict}
**Shellcheck**: [N warnings, M errors] (or "not available")
## Scores by Category
| # | Category | Weight | Score | Weighted | Key findings |
|---|----------|--------|-------|----------|-------------|
| S1-S12 rows with 0.0-1.0 scores... |
| | **SQI** | **100%** | | **X.X/10** | |
## Anti-Patterns Detected
| # | Pattern | Severity | File:Line | Recommendation |
## Critical Violations (must fix)
### [Category]: [violation title]
- **File**: `path/to/file:123`
- **What**: [description]
- **Why**: [named principle it violates + Google Shell Style Guide reference]
- **Fix**: [concrete code suggestion]
## Flags (should fix)
[same format]
## Tooling Recommendations
| Current tool | Used for | Recommended | Why |
[complexity-adapted tooling analysis]
## Good Practices Found
[positive reinforcement]
## Recommended Next Steps
1. [highest-impact fix first]
2. [second]
3. [third]cli-forge-infracli-audit-test for thatcli-audit-tangle for call graph analysis| Skill | Relationship |
|---|---|
cli-audit-code | Scores code quality generically. cli-audit-shell goes deep on bash semantics |
cli-forge-infra | Audits infra config and ops patterns. cli-audit-shell audits the scripts themselves |
cli-audit-tangle | Detects structural coupling. cli-audit-shell detects bash-specific structural issues |
cli-forge-pipeline | Optimizes CI/CD pipelines. cli-audit-shell audits shell scripts used in CI |
cli-cycle | Should call cli-audit-shell as part of full project review when shell scripts exist; emit .claude/cli-audit-shell.json per ../shared/result-schema.md for orchestrator aggregation |
| Condition detected | Recommend | Why |
|---|---|---|
| Sed on YAML/JSON (AP7 Sed Surgeon) | /cli-forge-infra | Tooling ladder assessment, kustomize/yq recommendation |
| Multiple scripts without getopts (AP8 Script Hydra) | /cli-audit-wizard | UX audit of the setup/init flow |
| Shell injection risk in env blocks (AP9) | /cli-audit-code on the consuming code | Verify the sourcing code validates inputs |
| Scripts are CI/CD entrypoints | /cli-forge-pipeline | Pipeline-level optimization |
| Script > 100 lines with god functions | /cli-audit-tangle | Topology analysis for split points |
Rule: Recommend, don't auto-execute.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.