| name | scan-codebase |
| description | Run the deterministic codebase scanner (core/components/plays/codify/lib/scan.py) over one or more repository roots and produce a bounded scan-index.json under STM. This skill is the sole structured-input producer for every infer-*-from-code skill. No LLM is involved — it shells out to scan.py and records status. Used exclusively by the /codify play. |
| version | 0.1.0 |
| user-invocable | false |
| model | sonnet |
| allowed-tools | Read, Write, Grep, Glob |
| deprecated | true |
| deprecated_note | #434 ProductOS realignment — superseded by the command model; retained for Phase E reference, not installed |
scan-codebase
Called by the /codify play before any inference agent dispatches. Produces scan-index.json in STM. The index is the only structured-input that downstream inference skills consume.
Purpose
Garura's /codify play is a brownfield bootstrap — it reverse-engineers a product's LTM from an existing codebase. Before any LLM inference runs, a deterministic scan extracts structured facts: manifest data, directory tree, git signals, framework idioms, frontend detection, ADR harvest, config surface. That scan is this skill's job. Agents must never navigate source code as their primary input — they reason over the scan-index this skill produces.
Input
Receive from the /codify play orchestrator via JSON contract.
repo_roots (list[path], required) — one or more absolute repository root paths to scan. Multi-repo monorepos pass multiple entries.
output_path (path, required) — {stm_base}/{issue}/evidence/codify/scan-index.json
size_limit_mb (int, optional, default 10) — soft cap on scan-index.json size; scan writes a partial index with scan_status: budget_exhausted on breach.
time_limit_seconds (int, optional, default 600) — soft cap on wall-clock duration.
extra_ignore (list[str], optional) — additional ignore globs beyond the built-in list (node_modules, dist, .git, etc.).
Process
1. Validate inputs
- Confirm every entry in
repo_roots is an absolute path to an existing directory. Missing or non-directory → structured failure with what_failed: invalid_repo_root and the offending path.
- Confirm
output_path parent directory is writable. If parent does not exist, create it. Failure to create → structured failure with what_failed: stm_path_unwritable.
- Confirm Python 3.8+ is on PATH. Missing → structured failure with
what_failed: python_missing.
- Confirm
scan.py exists at core/components/plays/codify/lib/scan.py relative to repo root. Missing → structured failure with what_failed: scan_script_missing.
2. Invoke scan.py
Build the command line:
python3 core/components/plays/codify/lib/scan.py \
--output <output_path> \
--size-limit-mb <size_limit_mb> \
--time-limit-s <time_limit_seconds> \
--path <root_1> [--path <root_2> ...] \
[--ignore <pattern> ...]