Scout is a codebase intelligence tool built in Kujo — it turns a local repository into an agent-readable context pack by mapping structure, dependencies, routes, and risk into structured outputs.
It helps agents and humans start from the same map of a codebase: file tree, language breakdown, dependency graph, route/API discovery, security smell detection, review checklist, and reviewable context files. Scout packages repository state; it does not replace human review or guarantee perfect understanding.
The examples in this README are the canonical copyable examples for Scout usage; tests and fixture snapshots are regression contracts, not style models.
kujo run scout.kujo -- . --quickExpected output shape:
Scanning: .
Output: ./results/<project-name>-<timestamp>
Code files analyzed: <count>
Dependencies: <count>
Routes: <count>
Security findings: <count>
Output profile: minimal
Scan manifest: ./results/<project-name>-<timestamp>/scan_manifest.json
Done.
Common variants:
# Scan a specific project with full output artifacts
kujo run scout.kujo -- ../my-project
# Scan with custom output root and depth
kujo run scout.kujo -- ./src -o ./reports -d 3
# Security-focused scan
kujo run scout.kujo -- ./src --skip-deps --skip-routes -o ./security-auditScout runs natively on Kujo with a single entrypoint:
scout.kujo: Primary CLI and active analyzer runtime.
Run with: kujo run scout.kujo -- ...
| File | Description |
|---|---|
FILE_TREE.md |
Recursive directory tree showing files, sizes, and detected languages |
README.md |
Full report with metrics, routes, dependencies, and security findings |
llms.txt |
Compact project overview for context injection into downstream tools |
AGENTS.md |
Structured context for AI coding assistants |
CHECKLIST.md |
Code review checklist with security findings highlighted |
intelligence.json |
Full structured data dump for programmatic consumption |
scan_manifest.json |
Run manifest with schema version, metadata, and artifact pointers |
index.json |
Optional Kennel-compatible package index payload when --kennel-index is enabled |
packages/<name>.json |
Optional Kennel-compatible package metadata payload when --kennel-metadata is enabled |
security.sarif |
Optional SARIF v2.1.0 export when --security-export sarif is enabled |
security.jsonl |
Optional line-delimited security findings when --security-export jsonl is enabled |
Recursively walks directories, skips VCS folders, node_modules, build artifacts, and binary/media files. Returns a structured tree with file sizes and language labels.
Maps 50+ file extensions to language names — including Python, JavaScript/TypeScript, Rust, Go, PHP, Ruby, Java/Kotlin, and additional ecosystems such as Haskell, Zig, Swift, Dart, Elixir, Clojure, Scala, and more.
Parses dependency signals from both source code and ecosystem manifests:
- Python:
import X,from X import Y, pluspyproject.toml([project].dependencies, Poetry dependencies) - JS/TS:
require(),import X from Y, pluspackage.json(dependencies,devDependencies,peerDependencies,optionalDependencies) - PHP:
usestatements, pluscomposer.json(require,require-dev) - Rust:
use,extern crate, plusCargo.tomldependency sections - Go:
import "package", plusgo.modrequireblocks - Ruby:
require,require_relative,gem, plusGemfilegementries - Java/Kotlin:
import,package - Haskell/Zig/Swift/Dart: source import parsing
- Dart:
pubspec.yaml/pubspec.ymldependencies and dev dependencies - Swift: SwiftPM
.package(...)entries inPackage.swift - Elixir: Mix dependency tuples in
mix.exs - Python pip:
requirements.txtandrequirements-*.txt - Kujo:
import X,from X import Y, quoted imports
Finds HTTP route definitions in popular frameworks:
- Python: Flask (
@app.route), FastAPI (@app.get), Django (path(),re_path()) - JS/TS: Express-style handlers (
app.get,router.post) and Next.js file routes (pages/api,app/api/.../route.ts) - PHP: Laravel (
Route::get), Slim ($app->get), Symfony-style route annotations/attributes, and WordPress (register_rest_route,wp_ajax_*,admin_post_*) - Rust: Actix/Axum (
.route("/path")) - Go: Gin (
router.GET),http.HandleFunc - Java/Kotlin: Spring (
@GetMapping,@PostMapping,@RequestMapping) - Kujo:
.route("GET", "/path", handler)
Scans for a baseline set of security patterns: hardcoded credentials/tokens, embedded keys, dangerous execution functions (eval, exec, system), XSS sinks, insecure deserialization, and weak hashes. Findings are categorized by severity (critical / high / medium / low).
Security matching is case-insensitive for common credential/token spellings, dangerous-call matching ignores quoted literals and method-style false positives, and sensitive snippets are redacted before they are written to Markdown, JSON, SARIF, JSONL, baseline fingerprints, or manifests.
Generates standard output files plus optional security exports:
FILE_TREE.md— Visual directory tree with file and directory markersREADME.md— Rich report with all findingsllms.txt— Minimal project context for LLM ingestionAGENTS.md— AI agent instructions with routes and security notesCHECKLIST.md— Actionable review checklist pre-populated with findingsscan_manifest.json— Schema-versioned run metadata and artifact pointers for automationindex.json— Optional Kennel-compatible index payload (schema_version,generated_at,packages)packages/<name>.json— Optional Kennel-compatible package metadata payloadsecurity.sarif— Optional SARIF v2.1.0 security findings exportsecurity.jsonl— Optional JSONL security findings export
| Flag | Description | Default |
|---|---|---|
-o, --output DIR |
Output root directory (run writes to DIR/<project>-<timestamp>/) |
./results |
-d, --max-depth N |
Max directory depth | 6 |
--skip-security |
Skip security smell scan | — |
--security-export F |
Emit security findings as sarif or jsonl (repeatable) |
disabled |
--baseline PATH |
Baseline file used to suppress known findings | scout-baseline.json |
--show-suppressed |
Include suppressed findings in generated outputs | disabled |
--write-baseline |
Write the current finding fingerprints to the baseline file | disabled |
--kennel-index |
Emit a Kennel Stage 2 compatible index.json artifact |
disabled |
--kennel-metadata |
Emit a Kennel Stage 2 compatible packages/<name>.json artifact |
disabled |
--skip-routes |
Skip route discovery | — |
--skip-deps |
Skip dependency analysis | — |
--include PATTERN |
Include only files matching glob (repeatable) | none |
--exclude PATTERN |
Exclude files/directories matching glob (repeatable) | none |
--ignore-file PATH |
Ignore file path relative to target | .scoutignore |
--path-mode MODE |
Path style for outputs (relative|absolute) |
relative |
--output-profile P |
Output profile: full or minimal |
full |
--quick |
Shortcut for --output-profile minimal |
disabled |
-h, --help |
Show help | — |
-v, --version |
Show version | — |
Each scan run creates a timestamped folder:
<output-root>/<project-name>-YYYYMMDD-HHmmss-<epoch-ms>/
By default this is under ./results (inside this repository when run from repo root).
When --quick (or --output-profile minimal) is used, Scout writes a smaller artifact set focused on summary consumption:
README.mdllms.txtintelligence.jsonscan_manifest.json
Scout reads defaults from config.json and resolves runtime behavior with this precedence:
CLI flags > config.json values > built-in hard defaults
Key config sections:
scan: default depth, max file size, ignored directories, include/exclude defaultsoutput: default output directory, path mode, optional Kennel output toggles, optional security export defaultsanalysis: enable/disable dependency/route/security analyzers, metrics collection, and baseline visibility defaults
Common examples:
# Use config defaults as-is
kujo run scout.kujo -- ./project
# Override config depth and output at runtime
kujo run scout.kujo -- ./project -d 2 -o ./tmp/reports
# Override configured baseline path and include suppressed findings
kujo run scout.kujo -- ./project --baseline ./security/scout-baseline.json --show-suppressedscout/
├── scout.kujo # Thin CLI entrypoint that loads runtime core
├── lib/
│ ├── scout_runtime.kujo # Runtime core (CLI parse, walker, analyzers, report writers)
│ ├── path_filters.kujo # Shared slug/path/filter helpers (ARC-004 phase 1)
│ ├── sorting.kujo # Shared deterministic sorting helpers (ARC-004 phase 2)
│ ├── security_exports.kujo # Shared security export and fingerprint helpers (ARC-004 phase 3)
│ └── text_scan.kujo # Shared quote/scanning helpers (ARC-004 phase 4)
├── tests/
│ ├── fixtures/ # Purpose-built parser and regression fixtures
│ └── scripts/ # Executable regression scripts
├── config.json # Default configuration
├── docs/ # Checklists and contributor process docs
└── README.md # This file
Runtime entrypoint remains scout.kujo.
scout.kujo: Thin stable entrypoint (kujo run scout.kujo -- ...)lib/scout_runtime.kujo: Runtime core with CLI parsing, walker, analyzers, and report writerslib/path_filters.kujo: Shared slug/path/filter helpers imported by runtime corelib/sorting.kujo: Shared deterministic sorting helpers imported by runtime corelib/security_exports.kujo: Shared security export and fingerprint helpers imported by runtime corelib/text_scan.kujo: Shared quote/scanning helpers imported by runtime coretests/scripts/run_all_scout_tests.sh: One-command regression entrypointtests/fixtures/: Stable fixtures for analyzer matrix and snapshot testsdocs/SCOUT_EVOLUTION_CHECKLIST.md: Ordered implementation and work-log source of truth
Run the full suite (including slower tests):
tests/scripts/run_all_scout_tests.shForce a non-default Kujo runtime only when needed:
KUJO_BIN=/path/to/kujo tests/scripts/run_all_scout_tests.shRun a fast path for local iteration (skips slow ARC-002 root scan):
SCOUT_SKIP_SLOW=1 tests/scripts/run_all_scout_tests.shRun focused suites:
# Route parser matrix
tests/scripts/test_test002_route_matrix.sh
# Security precision matrix
tests/scripts/test_test003_security_matrix.sh
# Golden artifact snapshots
tests/scripts/test_test005_golden_snapshots.shFor humans and agents scanning this repo:
- Canonical usage examples live in this README, especially Quick Start and Examples.
tests/fixtures/**contains purpose-built regression fixtures; keep those explicit even when they look repetitive.tests/fixtures/test005/snapshots/**contains generated golden outputs; read them to understand contracts, not to copy style.tests/tmp/**andresults/**are generated local outputs and should be excluded from broad cleanup/search sweeps.- There are no known legacy, stale, or expected-fail examples in the current tree; label any future ones in-place with the reason.
Most extension work happens in lib/scout_runtime.kujo and helper modules under lib/:
- Language and manifest discovery: update
LANGUAGE_MAPandMANIFEST_FILES - Route detection: extend language-specific route pattern blocks in the main scan loop
- Security detection: extend
SECURITY_PATTERNS, redaction rules, and supporting helper logic - New artifact outputs: add payload builders and write steps near the output section
- CLI surface area: add flags in the argument parser and mirror defaults in
config.json
When adding new analyzers or outputs, also add:
- A fixture pair (positive/negative) under
tests/fixtures/ - A script-level regression under
tests/scripts/ - Checklist/work-log updates in
docs/SCOUT_EVOLUTION_CHECKLIST.md
- Kujo language runtime with
runsubcommand support (kujo run ...) - Bash-compatible shell for test scripts (
tests/scripts/*.sh) jqavailable inPATHfor JSON assertions in regression scriptspython3withjsonschemainstalled for schema contract validation
Scout regression scripts auto-resolve a compatible Kujo binary and will prefer KUJO_BIN when set.
CI pins Kujo runtime builds to tag v0.14.0 in .github/workflows/repo-checks.yml for deterministic compatibility.
Run these once before local test loops:
# Kujo binary supports script execution mode
kujo run --help >/dev/null
# JSON tooling required by test scripts
jq --version
# Schema validator used by FEAT-003/005/006/007 checks
python3 -c "import jsonschema; print(jsonschema.__version__)"If jsonschema is missing:
python3 -m pip install --user jsonschemakujo run scout.kujo -- .kujo run scout.kujo -- ~/projects/my-app -o ./reports -d 10kujo run scout.kujo -- ./src --skip-deps --skip-routes -o ./security-auditkujo run scout.kujo -- ./api --skip-security --skip-deps -o ./api-routeskujo run scout.kujo -- ./src --security-export sarif --security-export jsonl -o ./security-audit# Generate or refresh baseline fingerprints
kujo run scout.kujo -- ./src --write-baseline --baseline scout-baseline.json
# Run normally with baseline suppression (default baseline path)
kujo run scout.kujo -- ./src
# Show suppressed findings for audit/debug
kujo run scout.kujo -- ./src --show-suppressedkujo run scout.kujo -- ./src --kennel-index -o ./scan-outputkujo run scout.kujo -- ./src --kennel-index --kennel-metadata -o ./scan-outputMIT