anspar-wf
Add standardized git hooks, linting, and development workflow to any project.
anspar-wf generates config-driven git hooks (pre-commit, commit-msg, pre-push) tailored to your project's languages and tools. It auto-detects your stack, installs the right linters and scanners at pinned versions, and keeps everything up to date as your config or anspar-wf itself evolves.
Quick Start
pip install anspar-wf
cd ~/your-project
anspar-wf init
That's it. init will:
- Detect your project's languages (Python, Dart, TypeScript, Docker)
- Generate a
.anspar-wf.tomlconfig file - Create git hooks in
.githooks/and pointcore.hooksPathto them - Offer to install any missing external tools at pinned versions
- Optionally set up Claude Code integration (session-start hook, plugins)
Edit .anspar-wf.toml to customize, then run anspar-wf upgrade to regenerate hooks.
Commands
| Command | Description |
|---|---|
anspar-wf init [PATH] |
First-time project setup: config, hooks, tools |
anspar-wf upgrade [PATH] |
Update hooks after config or version changes |
anspar-wf version [PATH] |
Show anspar-wf and project version info |
anspar-wf version check [PATH] |
Health check: config, hook drift, tool versions |
What You Get
Git Hooks
pre-commit — Runs on every commit:
- Branch protection (block direct commits to main/master)
- Secret scanning via gitleaks
- Language-specific linting (ruff for Python, dart analyze, eslint, hadolint)
- Markdown linting
commit-msg — Validates commit messages:
- Require ticket references (e.g.,
CUR-123) - Optionally require requirement references (e.g.,
REQ-d00042)
pre-push — Runs before pushing:
- PR-aware blocking (warn vs block depending on PR state)
- Full test suite execution
- Secret scanning across all commits being pushed
- Language-specific checks (ruff, pytest, dart format/analyze)
post-commit — Optional post-commit automation
External Tools
Managed at pinned versions via versions.lock:
| Tool | Purpose |
|---|---|
| gitleaks | Secret detection |
| ruff | Python linter |
| elspais | Requirement validation and traceability |
| squawk | PostgreSQL migration linter |
| markdownlint-cli | Documentation linting |
During init, anspar-wf checks which tools are missing or outdated and offers to install them.
Upgrading
When you update anspar-wf or change .anspar-wf.toml, run:
anspar-wf upgrade
Upgrade uses three-way comparison (stored hash vs. on-disk vs. target) to safely update hooks while preserving any local tweaks you've made. If there's a conflict (you modified a hook and a new version is available), it reports the conflict and shows a diff.
Claude Code Plugins (Optional)
Three plugins for developers using Claude Code:
- workflow — Ticket lifecycle management, branch protection, task-switch detection
- spec-compliance — AI-powered content validation for spec/ files
- plugin-wizard — Scaffold new Claude Code plugins
Plugins are automatically registered during init if Claude Code is detected (.claude/settings.json exists), and kept in sync during upgrade.
CI Integration
- name: Setup anspar-wf
run: |
pip install anspar-wf
anspar-wf init .
Or just verify an already-initialized project:
- name: Check tool versions
run: anspar-wf version check .
Development
pip install -e ".[dev]"
pytest
ruff check src/
Metadata
Release files for anspar-wf 0.2.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 |
|---|---|---|---|---|
| anspar_wf-0.2.1.tar.gz | 165.9 kB | Without provenance | Details for anspar_wf-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anspar_wf-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for anspar_wf-0.2.1-py3-none-any.whl |
Total release size: 379.6 kB
Release files / anspar_wf-0.2.1.tar.gz
| Download URL | anspar_wf-0.2.1.tar.gz |
|---|---|
| Size | 165.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01e3c4930fa608a71f3148cd208a6ee1907fdde4dd5b515251fa61298dbca432
|
|
BLAKE2b-256 checksum How to use checksums |
7039deba53a0c52b6378fdbcc7ac82cb7b8d55e0c1d2287ae43ac226fb42b25f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Release files / anspar_wf-0.2.1-py3-none-any.whl
| Download URL | anspar_wf-0.2.1-py3-none-any.whl |
|---|---|
| Size | 213.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1532f3e02d15f086d5dcd50f209473c0bacc74a3df2dfb8e831891ec141d0f19
|
|
BLAKE2b-256 checksum How to use checksums |
a5aceb5f0aedc25e3cfd39c68d97df3aca00f87ae62239262e207f5255effee9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.12
|
Security for anspar-wf 0.2.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.