Evidence-Grounded Codebase Changes

Implement complex changes against verified imports, schemas, and APIs, with small patches and explicit validation evidence.

Development / Engineeringcodebase-changesapi-verification
by AgentVoltv1.0.0
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

Prompt“Build a user payment page that integrates with our existing Stripe account and database schema.”
Beforegeneric AI agent
I can help you build a payment page. You'll need to handle form input for card details, integrate with Stripe's API, and store the transaction details. I'd write code that calls the Stripe API, handles the response, and updates your database. Let me get started on the implementation. I might use a Stripe SDK for the frontend and backend integration. Here's how I'd approach building the page with form handling and API calls.
Afterwith Evidence-Grounded Codebase Changes
PHASE 1: VERIFY EXISTING STRUCTURE
✓ Checked database schema: users table, payments table (has stripe_customer_id, stripe_payment_intent_id)
✓ Checked Stripe keys location: process.env.STRIPE_SECRET_KEY exists, STRIPE_PUBLISHABLE_KEY in env.local
✓ Confirmed existing Stripe methods: stripe.customers.create(), stripe.paymentIntents.create() already used in /api/subscribe

PHASE 2: MAP REQUIRED PIECES
• Frontend: Stripe Elements (CardElement), no custom card field invention
• Backend: PaymentIntents workflow (create → confirm → webhook)
• Database: Link to existing payments table on success
• Error gates: Decline handling, duplicate prevention via idempotency key

PHASE 3: DECOMPOSE (YAGNI ladder)
Remove: Custom Luhn validation (Stripe does this)
Remove: CVV storage (Stripe tokenizes)
Remove: PCI compliance code (using hosted Elements)
Keep: Error boundary around failed intents
Keep: Retry logic for network failures (3 attempts)

PHASE 4: EXECUTE
/* app/components/PaymentForm.tsx */
Uses Stripe Elements CardElement, handlePayment() calls /api/payment
Intents recovery on component unmount, no orphaned intents

/* app/api/payment/route.ts */
Validates existing customer_id, creates intent with idempotency_key
Confirms intent server-side, writes to payments table only on success
Webhook handler at /api/stripe-webhook catches payment_intent.succeeded

PHASE 5: VERIFY
✓ Unit test: Duplicate payment intent + idempotency key → same intent returned
✓ Integration test: Payment flow end-to-end with test card
✓ Error case: Network timeout → payment retried, never duplicated
✓ Database check: All payments wrote payment_intent_id for audit

About this skill

“The code looks right, but that method doesn't exist in our version.” Complex changes fail when generated code assumes imports, misses a permission boundary, or passes tests that never exercise the integration. This workflow checks the actual contracts before editing and follows each change through focused verification.

What it does

  • Confirms existing imports, function signatures, dependency versions, and schema constraints before relying on them.
  • Maps the affected path from entry point through authorization, business logic, persistence, and callers.
  • Breaks multi-file work into small changes with explicit behavioral acceptance checks.
  • Removes speculative abstractions and unnecessary dependencies before implementation.
  • Checks authorization failures, migration compatibility, and partial-write risks when those surfaces are involved.
  • Reports which checks passed, failed, or could not run, without turning a drafted patch into a claim of working software.

What you get

A focused implementation or review grounded in the available project evidence, plus the validation results and any unresolved assumptions. Small requests receive a small answer; risky changes receive the additional investigation they need.

Best for

Developers changing existing authentication, database, migration, or multi-file application code, especially after generated code has introduced nonexistent APIs or missed integration behavior.

SKILL.md preview

SKILL.md
---
name: evidence-grounded-codebase-changes
description: >-
  Implement complex changes in existing projects by confirming real imports, signatures, schemas, and dependency contracts, then applying small patches with behavioral verification. Use when the user says "stop inventing APIs", "make this change safely", "plan before changing the auth flow", "this touches several files", "my generated code keeps importing things that don't exist", "verify this migration", or "check this patch against the actual codebase".
---

# Evidence-Grounded Codebase Changes

… (sign up to view the full skill)
Sign up to view, copy, and install the full skill

More development skills

View all Development skills →