Skip to content

Add wire-contract CI gate and agent review workflow skills - #1326

Open
ebma wants to merge 3 commits into
stagingfrom
claude/review-workflow-tooling
Open

Add wire-contract CI gate and agent review workflow skills#1326
ebma wants to merge 3 commits into
stagingfrom
claude/review-workflow-tooling

Conversation

@ebma

@ebma ebma commented Aug 8, 2026

Copy link
Copy Markdown
Member

Motivation

An analysis of our recent development sessions showed two systematic weaknesses:

  1. Regression safety for live integrators rested on reviews alone. Reviews are probabilistic — each pass (Claude, Codex, Copilot) samples the finding space differently, which is why repeated reviews kept finding new issues. Breaking changes to the partner-facing surface need a deterministic gate, not a hopeful one.
  2. The review loop was manual toil. Every feedback round meant ferrying review URLs between sessions, re-explaining the same review approach, and re-triaging by hand.

This PR adds a deterministic wire-contract gate plus four repo-level agent skills that encode the review/feedback workflow we kept reinventing per session.

Wire-contract gate (deterministic)

  • scripts/wire-contract/generate-report.ts renders the typed partner-facing surface — the shared endpoint request/response types (packages/shared/src/endpoints) and the public SDK API (packages/sdk/src/index.ts) — into docs/api/wire-contract.snapshot.md (checked in, ~5.8k lines).
  • Types declared in-repo are expanded structurally (enums with values, unions sorted, Record<FiatToken, …> resolved), so a change to a transitively referenced type surfaces in the snapshot even when no endpoint file was edited. External types (viem, polkadot, lib) are kept by name.
  • bun run wire-contract:check fails when the snapshot is stale; bun run wire-contract:update regenerates it. CI runs the check in the build job, so every partner-facing change becomes an explicit, reviewable diff in the PR that made it.
  • Tests cover exact fixture output (enums/optionals/cycles/tuples/Record), determinism across program instances, and a no-filesystem-path-leak guard. Sorting is code-unit based so macOS and Linux produce identical snapshots.

Note: the SDK entry resolves @vortexfi/shared through its built declarations — run bun run build:shared before regenerating when shared changed (CI's build job already does).

Agent skills (.claude/skills/)

  • /vortex-review — multi-lens deep review: parallel finder agents with Vortex-specific lenses (financial integrity, phase-recovery/idempotency, presigned-tx identity, silent failures, partner surface, migrations vs deployed schema, corridor-matrix consistency, test adequacy), looped until two consecutive rounds find nothing new, every finding adversarially verified before it is reported. Review-only; never edits code.
  • /address-feedback <review-url> — one feedback round in one command: fetch the review via gh, verify each finding against the code, fix agreed items with regression tests, run the repo gates, push, and report a full disposition table. Business decisions are surfaced, never guessed.
  • /babysit-pr <PR#> — watches an open PR: reacts to new reviews and CI failures, pushes mechanical fixes, re-requests Copilot review after addressing a round, and notifies on business decisions or mergeability. Never merges.
  • /ship — the pipeline: plan (with explicit decision questions, human gate 1) → implement with tests → /vortex-review until dry → PR + Copilot review + /babysit-pr. Merge remains human gate 2.

.gitignore gets a !.claude/skills/ exception so the skills are version-controlled and available in worktree sessions once this lands on staging.

Verification

  • cd scripts/wire-contract && bun test — 3 pass.
  • bun run wire-contract:check — snapshot up to date.
  • bun run verify — clean.

ebma added 3 commits August 8, 2026 10:21
Reviews are probabilistic; live integrator breakage should be caught
deterministically. The gate renders the shared endpoint types and the
public SDK API into a structurally expanded snapshot, so any change to
what partners consume - including transitive type/enum drift - fails CI
until the snapshot is regenerated and the diff is reviewed on purpose.
vortex-review encodes the multi-lens finder fleet with loop-until-dry
and adversarial verification; address-feedback turns one PR review
round into a single verify-fix-gate-push command.
ship chains plan approval, implementation with tests, vortex-review
until dry, and PR creation; babysit-pr watches an open PR and reacts
to new reviews and CI failures so feedback rounds need no ferrying.
@ebma
ebma requested a balanced review from Copilot August 8, 2026 08:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a CI-enforced partner API snapshot generator and reusable agent workflows for reviewing and shipping changes.

Changes:

  • Generates and verifies shared/SDK wire-contract snapshots.
  • Adds serializer fixtures and CI coverage.
  • Adds four PR review and delivery skills.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.gitignore Tracks shared Claude skills.
.github/workflows/ci.yml Runs wire-contract tests and checks.
.claude/skills/address-feedback/SKILL.md Defines feedback handling.
.claude/skills/babysit-pr/SKILL.md Defines PR monitoring.
.claude/skills/ship/SKILL.md Defines end-to-end delivery.
.claude/skills/vortex-review/SKILL.md Defines deep review workflow.
docs/api/README.md Documents the snapshot.
docs/api/wire-contract.snapshot.md Captures the generated public contract.
package.json Adds snapshot commands.
scripts/wire-contract/generate-report.ts Implements contract serialization.
scripts/wire-contract/generate-report.test.ts Tests serializer output.
scripts/wire-contract/fixtures/fixture-surface.ts Provides serializer fixtures.
scripts/wire-contract/fixtures/tsconfig.json Configures fixture compilation.
Suppressed comments (1)

.claude/skills/address-feedback/SKILL.md:17

  • gh pr view --json reviews,commits returns review summaries but not their inline review comments, so the bare-PR flow silently drops inline findings. Fetch the paginated review-comments endpoint too and retain comments whose pull_request_review_id belongs to reviews submitted since the last push.
- Bare PR number → fetch all reviews and review comments submitted since the last push
  (`gh pr view <n> --json reviews,commits`).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +284 to +285
if (resolved.flags & (ts.SymbolFlags.Interface | ts.SymbolFlags.TypeAlias)) {
return serializeType(ctx, ctx.checker.getDeclaredTypeOfSymbol(resolved), 0);
Comment on lines +12 to +15
- `.../pull/<n>#pullrequestreview-<id>` URL →
`gh api repos/{owner}/{repo}/pulls/<n>/reviews/<id>` for the body and
`gh api repos/{owner}/{repo}/pulls/<n>/comments` filtered by `pull_request_review_id`
for the inline comments.
Comment on lines +16 to +18
- Record a baseline to diff against on every wake-up (persist it in a scratch state
file): head SHA, review ids, review-comment ids, issue-comment ids, CI runs —
`gh pr view <n> --json headRefOid,reviews,comments,statusCheckRollup`.
Comment on lines +108 to +109
const returnType = serializeType(ctx, signature.getReturnType(), depth + 1);
return `(${parameters.join(", ")}) => ${returnType}`;
Comment on lines +138 to +140
const optional = (property.flags & ts.SymbolFlags.Optional) !== 0;
const propertyType = serializeType(ctx, typeOfSymbol(ctx, property), depth + 1, { dropUndefined: optional });
lines.push(`${property.name}${optional ? "?" : ""}: ${propertyType};`);
@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 4d607b9
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6a76e8497f2ccc000789e6ad
😎 Deploy Preview https://deploy-preview-1326--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for vrtx-dashboard ready!

Name Link
🔨 Latest commit 4d607b9
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6a76e8495df15500085aa54f
😎 Deploy Preview https://deploy-preview-1326--vrtx-dashboard.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 8, 2026

Copy link
Copy Markdown

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 4d607b9
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6a76e8493ada5d000898b1eb
😎 Deploy Preview https://deploy-preview-1326--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants