Minimal webhook listener that enforces required fields before tickets move to "In Progress."
- Receives a webhook when a ticket state changes
- Checks if the ticket has a trigger label (
interface,contract, etc.) - Validates required fields (Definition of Done, Acceptance Criteria, UX/API link)
- If fields are missing: returns a structured response with what's needed
- If fields are present: allows the transition
This implements Phase 1 from the gatekeeping blueprint. It validates and reports -- your tracker integration adds the revert + comment step.
python gate.py # no dependencies beyond stdlib| Env var | Default | Purpose |
|---|---|---|
TRACKER |
linear |
Tracker adapter (linear, jira, github) |
GATE_PORT |
8090 |
Listen port |
WEBHOOK_SECRET |
(empty) | HMAC secret for signature verification |
The script uses Python's built-in http.server (no external dependencies). It includes parsers for Linear, Jira, and GitHub Issues, each normalizing the webhook payload into a common TicketEvent shape. To add your own tracker:
- Write a
parse_yourtracker(payload) -> TicketEvent | Nonefunction - Add it to the
PARSERSdict - Set
TRACKER=yourtracker
- State revert API calls -- these are tracker-specific and need auth tokens
- Comment posting -- same reason; the response body contains the comment text to post
- Phase 2 scaffolding -- branch creation, doc stubs, draft PRs
- PRDEngine integration -- invoke PRDEngine to auto-generate stubs (see blueprint)
This is a starting point, not a production service. Fork it and wire in your tracker's API.