repository-hygiene
Breaking change: v1.0.0 uses English configuration keys. See docs/MIGRATION.md to rename your
auditoria.yaml.
Audit hygiene for Git repositories. Checks for secrets, broken links, missing references, untracked artifacts, GitHub Actions workflow security, and more.
Installation
# ephemeral (recommended — no global install)
uvx repository-hygiene install .
# persistent
uv tool install repository-hygiene
# or
pip install repository-hygiene
Note: after pip install, run repository-hygiene install . in the
target repository to provision configuration, CI workflow, and the
agent-hygiene-flow skill for the agent roots used by that repository.
To install directly from GitHub (versions not published on PyPI):
pip install git+https://github.com/frederico-mello/repository-hygiene.git
Usage
Initialize repository (install)
repository-hygiene install . # create auditoria.yaml + workflow + skills
repository-hygiene install --force . # overwrite existing files
repository-hygiene install --dry-run . # preview without writing
repository-hygiene install --agents opencode,kilo . # restrict skill destinations
repository-hygiene install-skill . # provision skills only
install creates:
auditoria.yaml— rule configuration and exceptions.github/workflows/repository-hygiene.yml— weekly CI workflow<agent>/skills/agent-hygiene-flow/— agent skill for each selected agent root
Skill provisioning is agent-agnostic: by default the skill goes to every
supported agent root present in the target repository (.opencode,
.kilocode, .kilo, .omp, .hermes), falling back to .opencode when
none exists. --agents (comma-separated, with or without the leading dot)
restricts the selection explicitly, and --dry-run lists every planned
destination. Each destination is evaluated on its own: an existing skill is
skipped unless --force, while missing destinations are still provisioned.
Audit
repository-hygiene . # text report (stdout) + JSON (.repository-hygiene/)
repository-hygiene . --format json # JSON only
repository-hygiene . --format sarif # SARIF only
repository-hygiene . --output audit.txt # write to file
Pre-commit hook
repository-hygiene install --install-hook . # install hook on first run
Blocks commits with error-severity findings in staged content. Warnings
(warning) are displayed but do not block. To skip:
git commit --no-verify
Exit codes
| Code | Audit | Pre-commit hook |
|---|---|---|
| 0 | clean | commit allowed |
| 1 | errors found | commit blocked |
| 2 | invalid config | execution failure |
Configuration
auditoria.yaml at the repository root:
config_version: 1
rules:
tracked_secrets:
enabled: true
severity: error
broken_internal_links:
enabled: true
severity: error
missing_references:
enabled: true
severity: error
untracked_artifacts:
enabled: true
severity: error
empty_gitkeep_directories:
enabled: true
severity: warning
unreferenced_files:
enabled: true
severity: warning
outdated_documentation:
enabled: true
severity: warning
unintegrated_configurations:
enabled: true
severity: warning
stale_openspec_changes:
enabled: true
severity: warning
insecure_workflows:
enabled: true
severity: warning
exceptions:
tracked_secrets:
- .secrets.baseline
- .env.example
untracked_artifacts:
- .git
unreferenced_files:
- .gitignore
- Makefile
Rules
| Rule | Severity | Description |
|---|---|---|
tracked_secrets |
error | Passwords, tokens, and credentials in tracked files |
broken_internal_links |
error | Markdown links pointing to missing files |
missing_references |
error | References to files that do not exist in the repo |
untracked_artifacts |
error | Generated files not covered by .gitignore |
empty_gitkeep_directories |
warning | Directories containing only .gitkeep |
unreferenced_files |
warning | Files not referenced by any other file |
outdated_documentation |
warning | Documentation referencing nonexistent files |
unintegrated_configurations |
warning | Tool config without workflow, command, or docs |
stale_openspec_changes |
warning | OpenSpec changes stalled for 30+ days |
insecure_workflows |
warning | Excessive permissions, actions without pinned version |
GitHub Actions
The generated workflow (repository-hygiene.yml):
- Runs weekly and on push/PR to relevant paths, including every supported
agent root (
.opencode/,.kilocode/,.kilo/,.omp/,.hermes/) - Publishes the report to
$GITHUB_STEP_SUMMARY - Creates/updates a consolidated issue with findings (
error); closes when clean
Minimum permissions:
permissions:
contents: read
issues: write
pull-requests: read
Migration v0.1 to v0.2
| Command v0.1 | Equivalent v0.2+ |
|---|---|
repository-hygiene audit . |
repository-hygiene . |
repository-hygiene install . |
repository-hygiene install . |
repository-hygiene update |
removed |
Development
uv pip install -e . pytest
uv run pytest tests_package/
License
MIT
Metadata
Release files for repository-hygiene 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| repository_hygiene-1.1.1.tar.gz | 27.2 kB | Without provenance | Details for repository_hygiene-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| repository_hygiene-1.1.1-py3-none-any.whl | Python 3 | none | any | Details for repository_hygiene-1.1.1-py3-none-any.whl |
Total release size: 57.2 kB
Release files / repository_hygiene-1.1.1.tar.gz
| Download URL | repository_hygiene-1.1.1.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
898c1f49bc7cbe31a79c2104a01a52c1d114e5be5595ba8442d9883cc7fc5404
|
|
BLAKE2b-256 checksum How to use checksums |
7772d2a6cf7359c3b701e932c596bfa408031dac3ffbc0ae24f11b9b8e963681
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.22
|
Release files / repository_hygiene-1.1.1-py3-none-any.whl
| Download URL | repository_hygiene-1.1.1-py3-none-any.whl |
|---|---|
| Size | 30.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3627fb6ac36b3a6a6c73cb40891419d404511d296c4d522c3b2845021147443
|
|
BLAKE2b-256 checksum How to use checksums |
664fb4ebb431f9a0f00f8293c6573619dffceaa320ebd63d25e1c7d0c5216e15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.22
|
Security for repository-hygiene 1.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.