Contributing to Gherkin AI
First off, thank you for considering contributing to Gherkin AI! It's people like you that make Gherkin AI such a great tool for Specification-Driven Development.
Code of Conduct
By participating in this project, you are expected to uphold our Code of Conduct.
Development Setup
- Fork and clone the repository.
- Install dependencies:
npm install - Build:
npm run build(the tests andscripts/golden-stacks.jsusedist/);npm run devrebuilds on change. - Run tests:
npm test
Architecture & Code Structure
Gherkin AI follows a strict architecture for generation and agent interaction:
- Core (
src/core/): Parsers, Adapters, Stack Detectors, and Constitution handling. - Commands (
src/commands/): Commander CLI interfaces. - Generators (
src/generators/): AST to code compilers (Contracts, Prisma, OpenAPI). - MCP (
src/mcp/): Native Model Context Protocol Server implementations.
Note: We strongly prefer deterministic generators where possible. Only use LLMs (via AgentAdapter) when dealing with ambiguity or semantic gaps.
Pull Request Process
- Ensure your code passes the type check (
npx tsc --noEmit) and the tests (npm test, afternpm run build). - Add E2E test cases in
tests/integration/for any new CLI commands. - Keep PRs focused on a single responsibility.
- If you're introducing breaking changes, describe them clearly in the description.
Releasing
npm releases are published only by .github/workflows/release.yml, when a v<version> tag is pushed. It builds, tests, audits, publishes with provenance and creates the GitHub release with a CycloneDX SBOM. Nothing is published from a developer machine. main only receives commits that CI has already verified:
- Prepare the candidate. Set
versioninpackage.json, date theCHANGELOG.mdsection (## [X.Y.Z] - YYYY-MM-DD; it becomes the release notes), commit, and create the annotated tag locally:git tag -a vX.Y.Z -m "gherkin-ai X.Y.Z". - Preflight.
npm run release:preflight -- vX.Y.Z --tag vX.Y.Zchecks the tagged commit in a clean worktree, as a fresh CI runner sees it:npm ci, build, the golden-builds matrix, the committed JSON Schemas, the type check,npm audit --audit-level=high, the tag againstpackage.json, actionlint, and the quick goldens (CI pipelines and Helm). Run it on Linux (WSL on Windows): Docker Desktop on Windows and macOS hides file-permission differences that the CI runners enforce. - Verify the candidate in CI. Push it to a release branch,
git push origin vX.Y.Z^{commit}:refs/heads/release/X.Y.Z. CI runs every job on it, including all golden builds, beforemainmoves. Wait until the run is green. - Publish. Fast-forward
mainto the candidate and push it, then push the tag:git push origin mainandgit push origin vX.Y.Z.
If CI fails on the release branch, fix it on top of the candidate, move the local tag (git tag -fa vX.Y.Z, allowed only while the tag is not pushed), and repeat from step 2. A pushed tag is never moved: publish a new patch version instead.
Thank you!