Cookbook: CI Guard
This is the baseline recipe for teams that want one deterministic command for local verification and CI gating.
Scenario
You want to stop duplicating shell logic across local scripts and CI YAML.
qp.yaml Recipe
project: service
default: check
tasks:
fmt:
desc: Check formatting
cmd: test -z "$(gofmt -l .)"
safety: safe
lint:
desc: Run static analysis
cmd: golangci-lint run
safety: safe
test:
desc: Run unit tests
cmd: go test ./...
error_format: go_test
safety: safe
cache:
enabled: true
paths:
- go.mod
- go.sum
- cmd/**/*.go
- internal/**/*.go
check:
desc: Primary verification pipeline
run: par(fmt, lint, test)
guards:
ci:
steps: [check]Local Workflow
qp check
qp guard ciDevelopers run the same checks as CI, with identical status semantics.
CI Workflow
qp guard ci --json --eventsWhy both flags:
--jsongives structured final status.--eventsgives per-step timeline for richer logs.
Add A CI Task Wrapper (Optional)
tasks:
ci:
desc: CI entrypoint
cmd: qp guard ci --jsonThen CI config only needs:
qp ciCommon Extensions
- Add
arch-checktask into guard steps. - Add integration test task under profile gating.
- Add retry policy to flaky external checks.