Pluvy getting started
This guide is for developers adopting Pluvy. It covers installing the CLI, configuring a policy for a target repository, running day-to-day checks, triaging existing findings, and running the gate after every code task.
Pluvy is a read-only, parser-backed engineering policy gate: no run mode modifies, stages, restores, deletes or rewrites source files, and none of them changes Git configuration.
Quick start
Section titled “Quick start”From the root of the Git repository you want to check:
uv tool install pluvymkdir -p .pluvyecho '{"version": 2, "include": ["src/*", "tests/*"], "checkers": {}}' > .pluvy/pluvy.jsonpluvy --allThe output lists one finding per line, then a summary. For a src/app.py that declares
def load(value: Any) -> Any and a test that calls load(1) and then asserts True:
src/app.py:4:17: type.annotation: Preserve a concrete contract instead of Anysrc/app.py:4:17: type.broad: Do not erase contracts with typing.Anysrc/app.py:4:25: type.annotation: Preserve a concrete contract instead of Anysrc/app.py:4:25: type.broad: Do not erase contracts with typing.Anytests/test_app.py:5:5: warning: unused.return: Return value from 'load' is discardedtests/test_app.py:6:5: test.tautology: Assertion in test_load cannot fail because it restates the same expression or a literal true. Assert an independently produced value or outcome instead.Diagnostic scope: full_files.Usage reference scope: 2 files.Architecture all: 2 files; 6 findings.Each finding reads path:line:column: rule: message. A warning: prefix before the rule marks a
warning, which never changes the exit code. Python typing.Any triggers both type.annotation and
type.broad, so each position appears twice. The final line summarizes the run mode, audited file
count and total findings. Because error-level findings are present, this run exits 1—the normal
initial baseline on an existing codebase; see
First full audit of an existing repository.
If your sources live outside src/ and tests/, update include: --all exits 2 when include
matches no supported source files. After reviewing the initial audit, commit .pluvy/pluvy.json and
gate new changes against a base commit such as pluvy --base origin/main. The sections below cover
each step in detail.
Installation
Section titled “Installation”Prerequisites
Section titled “Prerequisites”- Python 3.12 or later.
uvis recommended for managing an isolated tool environment; see the uv installation guide.
Installation from PyPI
Section titled “Installation from PyPI”Install the CLI from PyPI:
uv tool install pluvyWithout uv, install with pip:
python -m pip install pluvyTo run once without installing, use uvx pluvy --all.
uv tool install places pluvy in uv’s executable directory (uv tool dir --bin, typically
~/.local/bin); run uv tool update-shell if that directory is not yet on your PATH. pip
installs pluvy into the target Python environment’s scripts directory. Pass --force to
uv tool install when replacing an existing uv tool installation of the same name.
Obtaining the source
Section titled “Obtaining the source”The PyPI package ships the CLI only. Sample policies under examples/ and the agent skill under
.agents/skills/pluvy/ live in the GitHub repository; clone
it when you need them. Below, /path/to/pluvy refers to that local checkout. Replace pluvy with
/path/to/pluvy in either install command to install unreleased changes from source.
Verification
Section titled “Verification”pluvy --helppluvy --root /path/to/project --allpluvy --help confirms the installation and lists the supported flags: --root (default .),
--config (default .pluvy/pluvy.json), --format (text or json), and one required mode from
--all, --staged or --base. The second command audits /path/to/project. If that repository
does not have a policy file yet, the command exits 2 and reports the missing file—create the
policy as shown in Configuration and run the check again.
Obtaining the skill
Section titled “Obtaining the skill”Copy .agents/skills/pluvy/ from a repository checkout into the target project’s skills directory.
See Agent integration for supported layouts.
Configuration
Section titled “Configuration”Establishing a repository policy
Section titled “Establishing a repository policy”Every target repository commits its own .pluvy/pluvy.json (resolved relative to --root in all
modes). Pluvy has no subcommand that generates or initializes a policy; write and commit the file
directly. The CLI defines only --all, --staged, --base, --root, --config and --format,
plus -h, --help.
You can start either by copying the sample policy to
.pluvy/pluvy.json and adapting its paths, or by writing a minimal policy where an empty (or
omitted) checkers object leaves all 22 checkers enabled with their defaults:
{"version": 2, "include": ["src/*", "tests/*"], "exclude": [], "checkers": {}}Common settings to layer in as needed:
include/exclude: select which files participate in all checks (case-sensitive,*spans/, paths relative to the repository root).ownersunderarchitecture.owner: assign a single accountable owner to every selected file.boundariesunderarchitecture.import: forbid specific cross-layer dependency directions.function_size: set maxima for function lines, statements, complexity, nesting and parameters.
When building up from a minimal policy, apply one step at a time and inspect the output before moving on:
- Set
includeandexcludeto match the repository’s source and test directories. - Run
pluvy --allto establish a baseline. Existing repositories usually exit1(see First full audit of an existing repository); if no supported source files match,--allexits2so you can fixincludefirst. - Declare
ownersunderarchitecture.ownerfor all selected files. - Add
boundariesunderarchitecture.import. - Tune
function_sizelimits or declare project serializers undertype.broad.encodingwhere justified.
Threshold, exclusion, owner and boundary edits are policy changes: review each one with a full
--all audit as described next rather than using it to silence findings.
Discipline for changing the policy
Section titled “Discipline for changing the policy”Changing thresholds, exclusions, owners, boundaries or checker enabled flags is an architecture
decision, not a way to clear findings. Both the initial policy and every later revision require a
full --all audit and human review before commit. While .pluvy/pluvy.json has staged changes in
the Git index, --staged exits 2 rather than checking staged code against an unreviewed policy.
Once committed, the revised policy takes effect immediately. If a pre-commit hook runs
pluvy --staged, commit the reviewed policy change in its own commit and bypass the hook for that
commit only (for example with git commit --no-verify).
See Checker configuration for all options, per-language coverage and analysis limits.
Running
Section titled “Running”Pass exactly one of the three mutually exclusive modes (--all, --staged or --base <commit>):
--all: audits every working-tree file matched by the policy, including Git-ignored files, exposing all existing debt.--base <commit>: compares<commit>against the working tree, including untracked files (new files are audited in full).--staged: reads only staged index blobs and the staged policy, ignoring unstaged working-tree edits.
Canonical commands:
pluvy --allpluvy --stagedpluvy --base <commit>pluvy --root /path/to/project --allpluvy --all --format json--root defaults to the current directory (and must be the repository root in Git modes);
--config defaults to .pluvy/pluvy.json. They combine as
pluvy --root /path/to/project --config .pluvy/pluvy.json --all.
Exit codes:
| Exit code | Meaning |
|---|---|
0 |
No error-level findings; warnings do not change the exit code |
1 |
At least one error-level finding |
2 |
Configuration, encoding, filesystem or Git failure (including --staged while a policy change is staged) |
Change modes (--base and --staged) parse full file snapshots for cross-reference resolution,
then filter reported findings to affected definitions and module statements: editing inside a
function selects the entire function (including decorators and signature), editing a class header
selects the class, editing a module statement selects that statement, pure deletions keep a nearby
line anchor, and untracked files are audited in full. File ownership and placement rules still apply
to every changed file. Reports distinguish full_files from affected_definitions_and_statements
via scope.
Additional runtime rules:
- An empty
--allrun fails as a configuration error (exit2), whereas an empty change run reports0files and exits0. - Syntax errors emit a warning on
stderrwithout changing the exit code; enabled rules continue on the recovered tree, so results on broken syntax may be incomplete. --format jsonoutputsmode,scope,files,usage_files,disabled_checkersandfindings(each withseverity). Treat the JSON fields as implementation-defined across minor upgrades rather than a frozen external schema.
Troubleshooting
Section titled “Troubleshooting”| Output | Cause | What to do |
|---|---|---|
Architecture gate error: [Errno 2] No such file or directory: '.../.pluvy/pluvy.json' |
No policy under --root, or the command ran from a subdirectory |
Add the policy, run from the repository root, or pass --root |
Architecture gate error: fatal: Needed a single revision |
The --base commit does not exist (for example --base HEAD before the first commit) |
Create an initial commit first, or run --all |
Architecture gate error: Policy changed in index; review it and run --all before adoption |
--staged ran with a staged policy edit |
Commit the reviewed policy separately per Discipline for changing the policy |
Architecture base: 0 files; 0 findings. with exit 0 |
No diff against the chosen base (for example --base HEAD after committing task changes) |
Not a valid pass: rerun against the parent of the task’s first commit |
Triage
Section titled “Triage”The three disposition paths
Section titled “The three disposition paths”- Fix the code first: a finding indicates a broken contract or boundary, so repairing the code is the default response.
- Approved next-line suppression (all supported languages): Python (
#) and Go, Java, Rust and the JavaScript/TypeScript family (//) accept a standalone next-line directive naming one exact diagnostic ID and a reason. Use this only when explicit human approval was granted beforehand: the reason records that approval rather than proving safety, and reviewers must revisit it if the code’s role changes. Block comments, wildcards, rule lists and missing reasons fail withtype.suppression. Full syntax and rules: Approved next-line diagnostic exceptions. - Policy revision: changing thresholds, exclusions or owners requires a standalone
--allaudit and architecture review; never weaken the policy to manufacture a passing run.
Debt semantics
Section titled “Debt semantics”--all surfaces repository-wide debt, while --base scopes findings to definitions and statements
touched by a change; one mode cannot substitute for the other:
0: no error-level findings in this run’s scope; warnings may be present.1: at least one error-level finding in this run’s scope; address each finding before completing the task.2: the gate could not complete (configuration, encoding, filesystem or Git failure); fix the configuration or environment error first, then rerun the gate.
First full audit of an existing repository
Section titled “First full audit of an existing repository”On an existing codebase, the first pluvy --all run after creating a policy normally exits 1.
Treat that output as your baseline inventory rather than a tool error:
- Inspect the findings and fix genuine contract or test defects first.
- Where findings reflect accepted legacy debt or default limits that do not fit the codebase,
adjust thresholds, exclusions or owners deliberately, then rerun
--alland review. - Record which findings were fixed, which were accepted via policy configuration, and the review decision.
Per-task gating
Section titled “Per-task gating”Run Pluvy once at the end of every code task—before reporting the work complete—and report the mode,
exit code, error/warning counts and key findings truthfully; the same standard applies to human and
agent changes. The command-selection table (uncommitted edits, task commits, unknown start commit,
and --staged scope), binding gate rules, post-run checks and report format are defined in the
pluvy skill. Always check the file count on the summary line
(Architecture base: N files; M findings.): 0 files when code actually changed means the --base
commit was chosen too late and does not count as a pass.
Agent integration
Section titled “Agent integration”The skill bundle lives under .agents/skills/pluvy/ in a repository checkout (SKILL.md plus
references/). Three integration options are supported:
- Standard skills directory: copy
.agents/skills/pluvy/into the target project’s or user’s skills directory so compatible agents discover and load it automatically. - Agent-specific directory adaptation: when an agent reads instructions only from its own
directory, choose copy versus symlink based on where that directory lives:
- Inside the repository (
--root): apart from built-in infrastructure directories such asnode_modulesor.venv, which are always skipped, a directory symlink is tolerated during directory enumeration only if the policy proves no selected file can exist below its path or an ancestor. Either noincludepattern reaches below it or anexcludepattern covers every descendant (include: ["src/*", "tests/*"]orexclude: [".claude/*"]). Pluvy never resolves the symlink target when deciding scope. Otherwise, including under the defaultinclude: ["**"], copy the directory and re-copy it when its source updates. Out-of-scope directory symlinks never affect--allor--baseenumeration and emit no warning. An in-scope directory symlink fails with exit code2(Refusing to traverse symlink directory) and is never skipped or downgraded to a warning. Pruning does not cover direct reads, so--basestill refuses a symlink that Git lists as a selected changed or untracked source. Neither--allnor--baseusage traversal consults.gitignore(Running), so a Git-ignored in-scope directory symlink still fails with exit code2;--stagednever walks the disk.--basewalks the disk for usage evidence only when at least one selected changed or untracked current source is present (deletions alone do not count) and anunused.*checker is enabled; a0 filesrun skips that walk, and an exit-00 filesreport does not validate expected changes (Per-task gating). See the agent integration notes for exact pruning rules. - Outside
--root(such as a user-level skills directory): a symlink works cleanly and keeps a single source of truth.
- Inside the repository (
- AGENTS.md pointer snippet: for agents that read
AGENTS.md, paste the snippet below into that file manually (never auto-rewrite a user’sAGENTS.md):
<!-- pluvy skill pointer -->When adopting, configuring, or running pluvy, or triaging its findings,first read `.agents/skills/pluvy/SKILL.md` and follow it.For the general integration paths and limits, see
agent integration notes. Agents reading
the published documentation over HTTP can fetch /llms.txt for a structured index, /llms-full.txt
for the single-file plain-text corpus, or append .md to any documentation URL (for example
/docs/getting-started.md).