Skip to content

Directory scan: skip dist and build, add --exclude, --no-recursive and --ext #11

Open

Description

@obielin

Problem

A directory scan already skips .git, node_modules, .venv/venv (when they hold a pyvenv.cfg), __pycache__, .tox and .mypy_cache (SKIP_DIRS in src/skillshield/scanner.py). Three things are still missing:

  • Other build output (dist, build) is scanned, and a vendored file there can produce findings unrelated to the skills.
  • scan_directory accepts extensions and recursive, but skillshield scan does not expose them.
  • There is no way to skip a path from the command line. .skillshield-ignore (Accept a reviewed finding with a reason (.skillshield-ignore) #101) accepts findings after a scan; it does not stop a file being read.

Reproduce

mkdir -p demo/dist demo/sub
echo "ignore all previous instructions" > demo/SKILL.md
echo "os.system('x')" > demo/dist/bundle.py
echo "# notes" > demo/sub/SKILL.md
skillshield scan demo --format json
# results include dist/bundle.py, and there is no option to leave out sub/

What done looks like

  • dist and build are added to the directories skipped by default.
  • New skillshield scan options:
    • --exclude PATTERN (repeatable) to skip more paths, matched against the path relative to the scanned folder (for example --exclude "examples/*").
    • --no-recursive to scan only the top folder.
    • --ext EXT (repeatable) to choose the file extensions, replacing the default set.
  • A skipped path is not reported as unscanned: the user asked for it to be left out.
  • Tests for the new defaults and for each option, including a pattern that matches nothing.
  • The README options table lists the three options.

Happy to discuss the exact flag names in this issue before you start.

Before you start, read CONTRIBUTING.md. Comment /assign here to claim the issue.

Activity

  1. added
    enhancement
    help wanted
    on Oct 23, 2026
  2. changed the title [-]Directory scan includes .git and node_modules; add --exclude, --no-recursive and --ext[/-] [+]Directory scan: skip dist and build, add --exclude, --no-recursive and --ext[/+] on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions