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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| repository_hygiene-1.1.0.tar.gz | 27.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repository_hygiene-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.2 kB
Release files / repository_hygiene-1.1.0.tar.gz
| Download URL | repository_hygiene-1.1.0.tar.gz |
|---|---|
| Size | 27.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aed10057ebea53691c13d034580ef28dd86493875710b2afa108d0e6771d4c7b
|
|
BLAKE2b-256 checksum How to use checksums |
1b2ddd6d6574da3b4616ab627df08ee6fa1eb2cfe69d050bafce1668d7374993
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.21
|
Release files / repository_hygiene-1.1.0-py3-none-any.whl
| Download URL | repository_hygiene-1.1.0-py3-none-any.whl |
|---|---|
| Size | 30.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e77646fbe69124b65d15bd6e7712a3cd8cdfb7fe70cce3a7d090b456a66255e4
|
|
BLAKE2b-256 checksum How to use checksums |
6b749132a78952768d41ab69ad5a1b1251f9d3649106a01cc408a00eb7e3dbef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.21
|