Thanks for wanting to make vstack better.
This guide is short because contributing should be easy. If something here is unclear, that's a bug in this guide — please open an issue.
git clone https://github.com/valani9/vstack.git
cd vstack
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev,all]"
vstack-doctor # confirms your dev install works
pytest -q # 2,097 tests should pass in ~4 secondsThat's it. You're ready to edit code, write a pattern, or fix a bug.
Ranked by impact, lowest barrier first:
| Contribution | Why it matters | Effort |
|---|---|---|
Bug reports with vstack-doctor output |
Catches real install issues we can fix in one PR | 5 min |
| Real failure traces that map onto a pattern | Synthetic traces miss things; real ones don't | 10 min |
| Docs improvements + typo fixes | Every doc page that gets clearer pays compounding interest | varies |
| A new framework adapter (Mastra, Strands, Smolagents) | New users of that framework get vstack for free | 1–2 hours |
| A public-benchmark eval for an existing pattern | Patterns without public evals have no public credibility loop | 2–4 hours |
| A new OB-anchored pattern (rare — most are shipped) | Extends the literature mapping; must cite a named source | 1–2 days |
| An essay that uses or extends a pattern | The essays compound the library's reach | varies |
Each pattern ships five layers:
- README — what the framework is, the citation, the failure mode it addresses, the proposed intervention
- Python library — the runnable code, under
module-N-<scope>/<NN>-<pattern>/lib/ - Runnable demo — a working example on at least one major agent framework
- Public-benchmark eval — a comparison on GAIA, SWE-Bench-multi, AppWorld, AgentBench, or equivalent
- Essay — a Substack-ready write-up of the pattern + its OB anchor
If any of those five is missing, the pattern is half-shipped. Half-shipped patterns dilute the bar.
Open an issue with the feature-request template before writing code — we'll align on whether the framework anchor fits.
Python — 3.11+ · ruff format · ruff check · mypy --strict · pytest
ruff format .
ruff check .
mypy <touched-lib-dir> --strict --ignore-missing-imports
pytest <touched-dir> -qThe mypy command runs per-pattern because each pattern's lib/ is its own logical package (via the force-include build map). Running mypy across all patterns at once hits a "Duplicate module named lib" error.
Comments — default to none. Comment only when why is non-obvious (a workaround, an invariant, a constraint a future reader would miss).
Every published pattern exposes its public surface via __all__ in its package's __init__.py. The promise:
0.x.yreleases — breaking changes allowed inminorbumps (0.x→0.(x+1)). Patch bumps (0.x.y→0.x.(y+1)) are non-breaking.1.x.yand later — strict SemVer. Breaking changes only onmajorbumps, and only after at least oneminorrelease where the API was marked deprecated and emittedDeprecationWarning.
Symbols not listed in __all__ are private. Importing them from a sub-package is supported on a best-effort basis and may change between any two releases.
Patterns merged after 0.1.0 should:
- Use
vstack.aar.get_logger(...)(notlogging.getLogger(...)) so log lines carry the run-id correlation field. - Wrap the body of
run(...)inwith run_context(new_run_id(), pattern="<pkg_name>"):. - Call
record_llm_call(...)after each successful LLM completion with model, token counts (fromclient.last_usage), andelapsed_ms(viatime_call()). - Pass any free-text input from outside the application boundary through
sanitize_for_promptbefore string-formatting it into a prompt template. - Ship a stub-client micro-benchmark in
benchmarks/_perf/patterns/<pattern>.pyso the perf regression harness can detect performance regressions.
These are recommendations, not blockers. Existing patterns are being migrated incrementally — contributors welcome to migrate any.
Adapters live in _adapters/lib/<framework>.py. Each adapter exposes the same shape:
from vstack.registry import all_patterns
def as_<framework>_tools(*, mode: str = "standard") -> list:
"""Return every vstack pattern wrapped as a native <framework> tool."""
...Look at _adapters/lib/langchain.py as the canonical example — every other adapter mirrors its shape.
Then:
# Add the framework's lib to the optional-deps in pyproject.toml
# Add a test in _adapters/tests/test_<framework>.py
pytest _adapters/ -q
mypy _adapters/lib --strict --ignore-missing-importsOpen a PR. The CI matrix already covers Python 3.11–3.13 on Linux + macOS.
- Patterns without a named OB-literature anchor. vstack is specifically the OB-literature-anchored layer. Pure design-pattern proposals belong in projects like Architecting Agentic Communities Using Design Patterns.
- Half-shipped patterns (missing any of the five layers). Better one well-shipped pattern than five half-shipped ones.
- University course internals (slides, exercises, solutions). The library uses public OB-literature concepts only.
- Mocked tests where integration tests are needed. Patterns that touch the LLM client or the file store get real integration tests against the stub LLM + a temp dir.
vstack uses tag-based releases. Process:
- Bump
pyproject.tomlversionand_packaging/vstack/__init__.py__version__together. The release-workflow smoke test verifies they match. - Update
CHANGELOG.mdwith a new## [X.Y.Z] — YYYY-MM-DDsection. - Tag:
git tag vX.Y.Z && git push origin vX.Y.Z. - The Release workflow builds the wheel, publishes to PyPI via Trusted Publisher (OIDC), and creates a GitHub Release with the changelog section rendered into the body.
- The Docker workflow (
workflow_runon Release) builds + pushes multi-arch images to GHCR.
If anything in the release flow surprises you, see .github/workflows/release.yml — it's the source of truth.
- Bugs → open an issue with the bug-report template.
- Feature requests → the feature-request template.
- Usage questions → the question template (often gets a faster answer than email).
- Security disclosures → please use GitHub Security Advisories — not public issues.
Be kind. Disagree with code, not people. Cite your sources. If you're not sure whether something is appropriate, ask.
vstack is MIT-licensed and will stay that way. By contributing, you agree your changes ship under the same license.