Solutions
Services Our Process Our Methodology
Platform & Resources
Voice AI Platform Case Studies Free Tools Blog Resources
Company
About Us Careers Book Free Consultation โ†’
Public engineering excerpt

Engineering Standards: Public Excerpt

The redacted handbook every RG INSYS engineer follows: how we branch, review, test, ship, and document. If your team has its own standards, we adopt yours; this is the floor, not the ceiling.

Branching strategy

We use trunk-based development on every project: one always-deployable main, feature branches under 48 hours, squash-merged after review. No parallel develop or release branches; they produce drift and merge pain.

Branch names are namespaced (feat/, fix/, chore/) and commit messages follow Conventional Commits, keeping history readable and changelog-friendly.

Feature flags cover anything user-visible that is not ready: merge daily without releasing daily.

Pull request review

Every pull request requires at least one senior reviewer approval; two for authentication, payments, schema, or anything labelled security. Self-merging is disabled on every repo.

Our Claude Code reviewer agent auto-posts the first comment on every PR: diff summary, risk level, obvious smells. A starting point for the human reviewer, not a replacement.

A PR cannot merge until:

  • All CI checks green (lint, typecheck, tests, security scans, build).
  • Explicit approval from a senior human reviewer.
  • A changeset entry for any user-facing or API-facing change.
  • A How to test section another engineer can follow.

PRs stay under 400 lines of diff; larger changes are split or feature-flagged.

Test coverage gates

Enforced in CI: โ‰ฅ80% line coverage on new and changed code, tuned by risk:

  • 90%+ for billing, payments, auth, anything touching money or credentials.
  • 80% default for product features, APIs, business logic.
  • 70% for early-stage prototypes and throwaway internal tooling, raised before production launch.

The gate lives in the test runner (vitest --coverage --coverage.thresholds.lines=80, or the Jest, Pytest, or Go equivalent), with a coverage summary posted on every PR.

We pair coverage with mutation testing on critical paths (Stryker for JS/TS) at least once per release.

CI/CD pipeline structure

Every repo runs the same pipeline; a failing stage stops it.

Stage What runs Trigger Blocks merge?
1. LintESLint, Prettier, Stylelint, ruff/black, gofmtEvery pushYes
2. Typechecktsc --noEmit, mypy, go vetEvery pushYes
3. Unit testsVitest / Jest / Pytest / go testEvery pushYes
4. Integration testsAPI tests against ephemeral DB, contract testsEvery pushYes
5. Security scansSemgrep (SAST), Snyk (dependencies), Trivy (containers), gitleaks (secrets)Every pushYes
6. BuildProduction build, Docker image, artefact uploadEvery pushYes
7. Deploy previewEphemeral preview environment per PROn PR open / updateNo (informational)
8. Deploy stagingStaging environment, smoke testsOn merge to mainNo (post-merge)
9. Manual approvalProduction deploy gateTriggered by release managerYes (for prod)
10. Deploy productionRolling deploy, health checks, auto-rollbackOn approval--

VoIP and FreeSWITCH work adds a containerised SIP test rig running SIPp scenarios; data-heavy work adds migration apply-and-rollback against a staging snapshot.

AI prompt patterns we use

AI-native, not "vibe coding": every engineer uses prompt patterns with Claude Code and Cursor built on tight context, explicit file references, and test-first thinking.

๐Ÿงช

Mirror an existing pattern, test-first

Read @services/jobs.ts. Add `archiveJob` mirroring the soft-delete pattern used by `deleteJob`. Write vitest tests first with table-driven cases for: missing job, already archived, archived by non-owner, success. Then implement.

๐Ÿ”Ž

Bounded refactor with guard rails

Read @routes/auth.ts and @middleware/rbac.ts. Extract role-check logic into a single `requireRole(role)` middleware. Do not change behaviour. Add tests asserting old call sites return identical responses for: admin, user, anon. No edits outside these two files.

๐Ÿ“

Schema migration with reversibility

Read @prisma/schema.prisma. Add `Invoice.voidedAt` (nullable timestamp). Generate the migration AND its `down` reversal. Update @services/invoices.ts to filter voided invoices from the default list query. Tests must cover: list excludes voided, explicit `?includeVoided=true` includes them.

๐Ÿฉบ

Bug reproduction before fix

Read @services/billing.ts. Bug: pro-rated refund double-counts taxes when subscription changed mid-cycle. First, write a failing vitest test that reproduces the bug at the exact boundary. Show me the failing test output. Only then fix.

Open-ended prompts ("build a payments module") produce slop; bounded prompts produce reviewable diffs.

We never paste customer data, secrets, or production logs into an AI tool. Every AI-touched file is human reviewed before merge.

Code review checklist

Posted as a PR template comment; every reviewer walks it before approving.

  • Tests cover happy path + at least 2 edge cases.
  • No secrets, keys, or tokens committed. Verified by gitleaks in CI.
  • Error handling is explicit. No silent catches, no catch (e) {}.
  • Types are narrow. No drive-by any or as unknown as T.
  • Public APIs documented. JSDoc / docstrings on anything externally callable.
  • No leftover console.log, print, or debug breakpoints.
  • Dependency additions justified. One-line reason in the PR description.
  • Schema migrations are reversible. Every up has a working down.
  • Risky changes are feature-flagged. Ship dark, roll out gradually.
  • Accessibility on UI changes. Keyboard reachable, visible focus, axe-core passing.
  • Performance budget respected. No N+1 queries, no synchronous I/O in hot paths.

Definition of Done

One non-negotiable Definition of Done across all client projects. A change ships to production only when:

  1. Reviewed and approved by a senior engineer; a second reviewer for security-sensitive changes.
  2. All unit and integration tests pass in CI on the merged commit.
  3. Coverage thresholds met or exceeded on changed code.
  4. Security scans (SAST, dependency, container, secrets) clean; waivers documented and time-boxed.
  5. Documentation updated: README, API docs, runbooks, affected diagrams.
  6. Deployed to staging and smoke-tested; UI gets an exploratory pass by someone who did not write it.
  7. axe-core accessibility check passing at WCAG 2.2 AA on new screens.
  8. Client stakeholder sign-off against the ticket's acceptance criteria.
  9. Changelog entry for anything externally observable; rollback plan for anything risky.

Anything missing, the ticket goes back. There is no "we'll add the tests later."

What this looks like in numbers

๐Ÿ“ˆ

~80% line coverage

Default floor on new and changed code. Higher for billing, auth, and payments.

โฑ๏ธ

<48h branch life

Feature branches are short. Trunk-based development keeps the team integrated, not stranded.

๐Ÿ›ก๏ธ

0 known criticals

No PR merges with a critical Semgrep, Snyk, or Trivy finding open against the changed code.

๐Ÿ“

1 changeset per PR

Every user-visible change has a changeset entry. Release notes write themselves.

Free consultation, no commitment

Want this rigour on your codebase?

Tell us your stack; we will share the relevant handbook section and how we would apply it.

Book Consultation