agentleFS
openclawopenclaw/clawscan/AGENTS.md

clawscan

AGENTS.md142 starsChanged 2 months agoMITView on GitHub

ClawScan is a Go CLI for agent-skill security scanning. It runs scanner adapters, preserves their raw JSON evidence, optionally invokes an external judge harness, and supports benchmark/leaderboard workflows for comparing scanner and judge setups. Keep the public CLI general purpose. ClawHub parity helpers may exist in separate commands, but do not add ClawHub-specific flags to cmd/clawscan. - cmd/clawscan/ - public CLI entrypoint. - cmd/verify-clawhub-prompt/ - OpenClaw maintainer parity tooling, separate from the public CLI. - internal/runner/ - scanner adapters, artifact…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository5 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

10 rules. About 1 is common, 4 are distinctive, and 5 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Keep the public CLI general purpose.

    line 10
  2. Very specific:

    Use standard Go formatting.

    line 49
  3. Distinctive:

    Keep package boundaries small and boring.

    line 50
  4. Distinctive:

    Keep scanner evidence raw.

    line 52
  5. Common:

    Add comments only for non-obvious contracts, such as secret redaction, artifact compatibility, or benchmark scoring semantics.

    line 54
  6. Very specific:

    Never add API-key CLI flags.

    line 65
  7. Very specific:

    Run artifacts must record only secret-safe env presence, such as present or missing, never secret values.

    line 67
  8. Distinctive:

    Use conventional commit messages.

    line 107
  9. Very specific:

    Keep generated dist/ changes out of ordinary feature commits unless the task is release-packaging proof.

    line 108
  10. Distinctive:

    After the one-time npm registry bootstrap package, npm releases use trusted publishing from GitHub Actions.

    line 114

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Repository Guidelines

Project Purpose

ClawScan is a Go CLI for agent-skill security scanning. It runs scanner adapters, preserves their raw JSON evidence, optionally invokes an external judge harness, and supports benchmark/leaderboard workflows for comparing scanner and judge setups.

Keep the public CLI general purpose. ClawHub parity helpers may exist in separate commands, but do not add ClawHub-specific flags to cmd/clawscan.

Project Structure

  • cmd/clawscan/ - public CLI entrypoint.
  • cmd/verify-clawhub-prompt/ - OpenClaw maintainer parity tooling, separate from the public CLI.
  • internal/runner/ - scanner adapters, artifact generation, judge execution, benchmark loading, and submission validation.
  • internal/profiles/ - built-in and project-local .clawscan.yml profile resolution.
  • internal/clawhubprompt/ - ClawHub prompt rendering parity support.
  • docs/ - public operator documentation and docs-site source.
  • leaderboard/ - Security Signals submissions, results, and Hugging Face Space support.
  • scripts/ - docs, release, and leaderboard helper scripts.
  • skills/clawscan-cli/ - Codex skill for using this CLI.
  • npm/clawscan/ - npm package wrapper, binary resolver, and package tests.
  • .agents/skills/autoreview/ - structured review closeout helper.
  • dist/ - generated release/docs artifacts. Do not hand-edit it.

Development Commands

  • go test -count=1 ./... - full Go test suite without cached results.
  • go vet ./... - Go static checks.
  • go run ./cmd/clawscan --help - inspect the public help output.
  • go run ./cmd/clawscan ./README.md --scanner clawscan-static --json - secretless smoke test.
  • go run ./cmd/clawscan benchmark SkillTrustBench --limit 1 --scanner clawscan-static --output /tmp/clawscan-benchmark-smoke.json
    • benchmark smoke test.
  • make docs-site - rebuild the generated docs site under dist/docs-site.
  • make release VERSION=v0.0.0-test - build local release archives under dist/.
  • node scripts/build-npm-package.mjs --version v0.0.0 --pack --smoke - build and smoke-test the npm package wrapper.

Coding Style

  • Use standard Go formatting. Run gofmt on touched Go files.
  • Keep package boundaries small and boring; prefer targeted helpers over large cross-cutting abstractions.
  • Keep scanner evidence raw. Scanner adapters should emit the upstream JSON or a small wrapper around skipped/error state, not a normalized policy summary.
  • Add comments only for non-obvious contracts, such as secret redaction, artifact compatibility, or benchmark scoring semantics.

Scanner And Judge Rules

  • Public scanner IDs are part of the CLI surface. The built-in static scanner ID is clawscan-static; do not reintroduce static.
  • Register built-in scanners through the scanner registry instead of adding one-off scanner switches.
  • Scanner adapters should declare required environment variables up front so ClawScan can fail before doing partial work.
  • Never add API-key CLI flags. Credentials belong in environment variables such as VIRUSTOTAL_API_KEY, SNYK_TOKEN, and SOCKET_CLI_API_TOKEN.
  • Run artifacts must record only secret-safe env presence, such as present or missing, never secret values.
  • Command-backed scanners and judges run through the Docker sandbox by default, including SkillSpector. Do not assume host scanner binaries are needed unless the user explicitly chooses --sandbox off.
  • Sandbox env passthrough is an allowlist of variable names, never values. Use --sandbox-env or profile sandbox.env for judge-specific credentials.
  • --judge is an external harness command. Do not add a model-provider framework to ClawScan unless the product direction changes.
  • Judge placeholders and prompt interpolation must fail clearly when they reference a scanner that was not requested.

Profiles And Benchmarks

  • Built-in profiles live in internal/profiles/<profile>/clawscan.yml.
  • Project-local .clawscan.yml / .clawscan.yaml files may shadow built-ins. CLI flags override profile values for a single run.
  • Select the ClawHub production profile explicitly with --profile clawhub. --config <path> without --profile runs every profile in that config.
  • Supported benchmark verdicts are clean, suspicious, and malicious.
  • OpenClaw Security Signals predictions use predictions.jsonl; keep that file lightweight and secret-free.

Verification Expectations

  • For Go behavior changes, run focused tests plus go test -count=1 ./... and go vet ./....
  • For docs/help changes, run make docs-site when generated docs can change.
  • For npm wrapper or release changes, run node --test npm/clawscan/test/*.test.mjs, node --test scripts/build-npm-package.test.mjs, and node scripts/build-npm-package.mjs --version v0.0.0 --pack --smoke.
  • For scanner adapters, add fixture-backed tests and use live API smoke tests only when credentials are already available. Do not print secrets.
  • For leaderboard/submission changes, validate the relevant shell/Python paths and run scripts/validate-security-signals-submissions.sh on a representative fixture when possible.

Commit And Release Notes

  • Use conventional commit messages.
  • Keep generated dist/ changes out of ordinary feature commits unless the task is release-packaging proof.
  • For non-trivial changes, run .agents/skills/autoreview/scripts/autoreview before final handoff.
  • Releases are tag-driven through the GitHub release workflow. Local release archives should match make release VERSION=<version>.
  • After the one-time npm registry bootstrap package, npm releases use trusted publishing from GitHub Actions. Do not add long-lived npm tokens.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.