Skip to main content

Development toolchain for requirement-traceable software projects

Project description

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:

  1. Detect your project's languages (Python, Dart, TypeScript, Docker)
  2. Generate a .anspar-wf.toml config file
  3. Create git hooks in .githooks/ and point core.hooksPath to them
  4. Offer to install any missing external tools at pinned versions
  5. 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/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anspar_wf-0.2.1.tar.gz (165.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anspar_wf-0.2.1-py3-none-any.whl (213.7 kB view details)

Uploaded Python 3

File details

Details for the file anspar_wf-0.2.1.tar.gz.

File metadata

  • Download URL: anspar_wf-0.2.1.tar.gz
  • Upload date:
  • Size: 165.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for anspar_wf-0.2.1.tar.gz
Algorithm Hash digest
SHA256 01e3c4930fa608a71f3148cd208a6ee1907fdde4dd5b515251fa61298dbca432
MD5 8441cc1ebeeebc8847700c96fb9469e2
BLAKE2b-256 7039deba53a0c52b6378fdbcc7ac82cb7b8d55e0c1d2287ae43ac226fb42b25f

See more details on using hashes here.

File details

Details for the file anspar_wf-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: anspar_wf-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 213.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for anspar_wf-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1532f3e02d15f086d5dcd50f209473c0bacc74a3df2dfb8e831891ec141d0f19
MD5 23d2b00ae0fc6026efac78cd8415cb82
BLAKE2b-256 a5aceb5f0aedc25e3cfd39c68d97df3aca00f87ae62239262e207f5255effee9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page