Gold Standard Feature Planning: Using AI Skills as Architectural Gates.
How five lightweight architectural gates catch blast-radius bugs and test blind spots before a single file changes, then verify the finished diff with a sceptical audit.
On this page
AI coding agents have made writing code surprisingly cheap, which also means they’ve made writing the wrong code surprisingly fast. Give a capable agent a one-sentence feature idea, glance over a ten-bullet plan, and say “go ahead”, and you’ll usually have working happy-path code inside fifteen minutes. What tends to follow is half a day of unpicking side effects you never saw coming. A background job triggers your new hook on every bulk edit, a proxy layer strips out a field you were relying on, or a soft-delete cascades into data loss while your mocked tests stay cheerfully green.
I’ve been in software engineering for thirty years and architecture for twelve, and I’ve still fallen into the “looks straightforward, let’s just build it” trap more times than I care to admit. What’s changed the game for me with AI-assisted development isn’t cleverer prompting while the code is being written. It’s moving twenty minutes of structured, codebase-grounded interrogation to the left, before the first file is touched, and pairing it with a sceptical audit once the work is done.
The cleanest way I’ve found to make that repeatable is to turn each deep review lens into a reusable SKILL.md file (a plain Markdown instruction set and checklist that Agent Skills-compatible coding tools load on demand, and that other tools can use directly as project rules or review prompts). Instead of hoping I remember to ask the right awkward questions on a busy Tuesday afternoon, I run the agent through a small set of named gates that read the actual repository, check real callers and schemas, and tell me where the plan is going to hurt.
To make this concrete, I’ll walk through the pipeline using a real feature I planned recently for a desktop and cloud note-taking application: paid-tier version history, keeping up to ten previous iterations of a Markdown document. On paper, it sounds like a neat afternoon job. Under the hood, the app runs across a local SQLite database, a self-hosted remote server, a cloud PostgreSQL database with object storage, an edge proxy, and a desktop offline caching layer. That’s where “neat afternoon jobs” go to get interesting.
Five Gates, Not Fifteen
Nobody wants a bureaucratic checklist that turns a small improvement into a committee meeting. The trick is to keep the pipeline small and make sure each gate hunts for a different class of problem:
| Stage | Skill or Pass | What It Actually Catches |
|---|---|---|
| 1. Shape | Feature-shaping pass | Building the wrong abstraction in the first place |
| 2. De-risk | impact-review .zip ↓ |
First- and second-order ripples across the real codebase |
| 3. Tighten | UX edge-states and ambiguity check | Unhappy UI states and vague spec language |
| 4. Verify design | test-coverage-review .zip ↓ |
Test-pyramid blind spots and over-mocked verification |
| 5. Audit and compound | check-your-work .zip ↓, live smoke check, and memory sync |
Implementation shortcuts, visual rough edges, and repeating old mistakes |
Stages 1 and 3 are quick conversational passes, while Stages 2, 4, and 5 are packaged as reusable SKILL.md archives. Let’s see what happened when I ran that “simple” ten-version Markdown history idea through each stage. You can also download all three skills as zip archives further down the page.
Stage 1: Feature Shaping (Are We Building the Right Thing?)
Before anyone opens a migration file, it’s worth stepping back and asking whether the feature belongs in the shape you first imagined. Where should this state live, which domain owns it, and does the idea survive contact with how the application actually behaves?
In our case, running a feature-shaping pass against the codebase immediately exposed a snag that would have ruined the whole feature if we’d coded first and thought later. The Markdown editor autosaves after 1.5 seconds of pause. If you naively keep “the last ten writes”, a user typing a thoughtful document for two minutes burns through all ten slots on half-finished sentences and loses yesterday’s draft before they’ve even finished their coffee.
That single observation forced a simpler question: what does a user actually think of as a “version” when they edit a document? Usually it’s opening the document, working on it, and leaving it to do something else (plus any moment an AI assistant or plugin edits it for them). That led to a much cleaner Copy-on-First-Write model keyed by an editing session ID: opening a document creates zero writes, the first edit in a session anchors the pre-session copy, all subsequent autosaves in that session are ignored for history, and navigating away rotates the session ID.
The same shaping pass also revealed that our cloud storage layer already wrote immutable document revisions to object storage and retained superseded copies for thirty days. Rather than inventing a second cloud storage pipeline, we could flag the pre-edit revision as a history checkpoint inside the existing commit transaction, adding zero extra uploads, and exempt the newest ten checkpoints from the thirty-day cleanup job. Locally, storing compressed snapshots in SQLite keyed by an immutable document UUID kept users’ synced Markdown folders free of hidden version files (if you’ve ever watched cloud folder sync argue with a hidden .git directory, you know why that matters).
You need this top-down pass before you analyse blast radius. Otherwise you can spend an hour brilliantly de-risking the blast radius of the wrong abstraction.
Stage 2: Impact Review (What Ripples Across the Real Codebase?)
Once the shape makes sense, the next pass flips from top-down to bottom-up. An impact-review download .zip ↓ skill puts the agent in read-only mode with a strict rule: no guessing. It has to search the actual repository for callers, database triggers, proxies, caches, background jobs, and UI hosts, checking both first-order (direct touchpoints) and second-order (one or two hops downstream) effects across functional and non-functional dimensions.
Running impact-review via three parallel read-only subagent passes (cloud stack, local backend, and frontend client) surfaced five critical catches and five high-severity ones before a single line of code existed:
- We had the wrong frontend save owner. My initial plan assumed the main notes view owned saves, whereas normal editing actually ran through a shared editor component mounted across eight different views, modals, and panels. On top of that, switching views in the app only hid the container rather than unmounting it, so “end session on unmount” would never have fired.
- Our new session ID would have been stripped twice on its way to the cloud. Both the desktop offline gateway and the edge worker constructed whitelisted request payloads on document updates. Without threading the field through both hops, cloud session grouping would have silently stopped working.
- Soft-delete and restore would have orphaned every single snapshot. Moving a document to Trash removed its active metadata row, and restoring it from Trash inserted a fresh row that minted a brand-new UUID. An
ON DELETE CASCADEforeign key would have wiped history on Trash, and even without one, restoring a document from Trash would have severed it from all ten of its previous versions. - Converting a folder or workspace to end-to-end encryption would have leaked plaintext history. Encryption preserved the document’s UUID while replacing the plaintext file on disk, meaning ten unencrypted snapshots would have remained readable in the database unless purged both in application code and via database triggers. Meanwhile, password-locked documents still stored plaintext Markdown underneath, so an unguarded diff preview would have let someone read a locked document without unlocking it.
- Our existing paid-tier middleware returned HTTP
200 []onGETrequests. Reusing it on the version-list endpoint would have made a downgraded free user see “No versions yet” instead of a clear403entitlement boundary.
The same scan also caught nine background housekeeping callers sharing the document-save service (link rewrites on rename, bulk tag updates, highlight syncs, and background migrations) that would have quietly evicted real user versions unless snapshotting was strictly opt-in. On the database side, it flagged a lock-order deadlock vector between document commits and the thirty-day cleanup cron, along with a missing partial index for that job. It also spotted two product-level traps: storage quotas blocking Restore when a workspace was full, and a main-thread UI freeze if someone diffed two 5 MiB documents without a complexity cap and collapsed hunks.
Equally valuable was the Confirmed Safe list: with file and line citations, the agent verified that search indexes, resurfacing feeds, shared read projections, and exports all joined strictly on the live document revision and couldn’t leak older iterations. Knowing what you don’t have to worry about saves almost as much time as catching what you do.
Stage 3: Tightening UX Edge-States, Spec Clarity, and Rollout
Technical blast-radius scans catch system bugs, not product ambiguity or rollout friction. Before locking the plan, I do a short tightening pass focused on three things AI plans routinely gloss over:
- The unhappy UI states. What does Version History show on a brand-new document with zero previous iterations? What happens when a user hits
Cmd+Zstraight after restoring an older version? (We decided Restore should clear the editor’s undo stack, treating the restored document as a fresh slate while keeping the pre-restore state safely tucked away as snapshot #1.) What does the user see if they’re offline with unsynced edits, or if the document is locked? - Weasel words in the spec. Phrases like “handle errors appropriately”, “update relevant callers”, or “add tests” are where coding agents start improvising. Replacing every vague sentence with exact status codes, exact file paths, and explicit non-goals takes five minutes and prevents most mid-build drift.
- Day-2 operability. For features that touch schemas or distributed edge layers, this is also where I double-check expand-contract migration ordering, mixed client/server compatibility during rolling deploys, and whether a 2 a.m. rollback leaves the database intact.
Stage 4: Test Coverage Review (Right-Sizing the Pyramid)
Most AI implementation plans finish with a polite, slightly hollow paragraph saying “add unit and integration tests”. To fix that, I built a test-coverage-review download .zip ↓ skill that inspects the repository’s actual test scripts, database fixtures, contract suites, and browser workflows, then audits the plan across every layer of the test pyramid: Unit, Contract/Architecture, Real-DB Integration, Transport/Edge/Gateway, Browser E2E, and Non-Functional checks.
Even after our thorough impact-review, running test-coverage-review against the updated plan picked up six real blind spots:
- Migration and row-level security parity: We’d forgotten to include our schema parity checks, SQLite and PostgreSQL smoke boots, and a test running under the actual restricted database runtime role to prove cross-tenant isolation on the new table.
- Internal boundary and forged-ID negative controls: We needed explicit tests proving that new internal backend endpoints returned
404from outside the edge worker, and that requesting Document B’s revision ID under Document A’s path (or forging another user’s owner ID) was rejected. - Failure injection and non-mocked triggers: We needed a PostgreSQL savepoint fault-injection test proving a database error during snapshot capture never poisoned an already-published object write, stale-precondition
409Restore tests, and direct SQL tests proving the encryption-purge triggers fired even if application code was bypassed. - Multi-host browser parity: We’d decided to expose Version History across every mounted document editor in the app, yet the browser test plan only checked the primary view.
- Frontmatter preservation edge cases: Preserving a document’s current YAML frontmatter metadata when restoring an older snapshot sounds tidy until you hit CRLF line endings, mixed key casing, quoted names with colons, or a document with no frontmatter at all. Those belong in fast millisecond unit tests, not slow browser runs.
- Resource and downstream assertions: Explicit checks that listing versions transferred zero body bytes, that switching views triggered zero network requests, and that search, resurfacing, and exports still returned only the latest document after multiple iterations.
Notice the recurring theme there: put each test in the cheapest layer that still tests the real boundary, and never let a mocked unit test pretend to cover a real database trigger or proxy hop.
Stage 5: After the Code Is Written
On the version history feature, those four pre-code gates gave us a plan we could hand to an implementing agent without crossed fingers. Once a feature’s code and tests are written, implementation tends to be pleasantly boring, which is exactly what you want from software engineering. Still, green tests on the first pass aren’t the finish line, so every feature closes with the same three post-code checks:
- Run an adversarial post-implementation review (
check-your-workdownload .zip ↓). Before committing, I run a four-hat zero-trust audit (Security, System and Performance, Code and Boundary, and Test Architect) against the actual diff and executed test output. Its job is to assume the implementing agent cut a corner, missed a null check, or wrote a test that mocks out the exact bug it claims to prevent. - Click through the live app. Automated suites are brilliant, yet they rarely notice a slightly cramped modal in dark mode or a sluggish transition against a real database. Five minutes of honest dogfooding catches the human rough edges.
- Feed lessons back into AI memory. Update architecture docs and ownership manifests, and capture any surprising repository quirk in your project instructions or skills. Do that consistently and your AI setup compounds: every trap you pay to learn once becomes a guardrail for every feature that follows.
Download the three architectural gate skills
Each archive extracts into a self-contained skill folder containing its SKILL.md instructions and reference checklists. Drop them straight into your coding agent’s skills directory (or paste the Markdown into your project rules or review prompt if your tool doesn’t support Agent Skills folders) and invoke them against any feature plan or diff.
impact-review
Read-only blast-radius scan that traces first- and second-order ripples across callers, schemas, proxies, jobs, and UI hosts before coding starts.
SKILL.md · impact-checklists.md
Download impact-review.ziptest-coverage-review
Audits a proposed plan against your actual test infrastructure to close blind spots across every layer of the test pyramid.
SKILL.md · pyramid-matrix.md
Download test-coverage-review.zipcheck-your-work
Adversarial four-hat review (Security, System & Performance, Code & Boundary, and Test Architect) run against the finished diff and test output.
SKILL.md · adversarial-probes.md
Download check-your-work.zipKnowing When to Lighten the Load
None of this means you should run five architectural gates before changing a button label or fixing a one-line typo. Match the rigour to the blast radius. For an isolated bug fix, write the fix, add a focused regression test, run check-your-work, and commit. For any feature that touches persistence, permissions, tiers, multiple UI surfaces, or sync boundaries, running the full pipeline pays for itself on the very first run.
On that Markdown version history feature, roughly twenty minutes of parallel pre-code skill runs caught five critical bugs, five high-severity ripples, and six test-pyramid gaps before a single file in the repository changed. When I ran impact-review and test-coverage-review against the real codebase on Iteration 1 of a subsequent plan for end-to-end encrypted cloud vault sync, they paid off massively again:
- Impact Review Verdict (
BLOCK: Redesign Needed): Surfaced six Critical and six High/Medium findings on Iteration 1 as written, all with deterministic mitigations ready for Iteration 2. Notably, finding[IMP-5]resolved our main open design question around whether vault keys could be derived from the user’s account password. By tracing the exact lines in our Electron main process and cloud sign-in handlers, it proved that OAuth PKCE authentication runs in the external OS browser, so Electron never sees the login password and a dedicated Vault Encryption Passphrase with a 256-bit Sync Recovery Key is mandatory. - Test Coverage Review Verdict (
INSUFFICIENT: Gaps Block Implementation): Exposed the blind spots in Iteration 1’s four-test sketch and added ten concrete pyramid and static-contract checks ([TCR-1]to[TCR-10]), mapped directly onto our existing Miniflare andworkerdedge suite, restricted PostgreSQL row-level security runtime role, Electron Chrome DevTools Protocol (CDP) harness, and static architecture fitness tests.
That’s not process for process’s sake; it’s buying yourself a calm afternoon instead of an unplanned weekend debugging session. AI doesn’t replace engineering discipline. When you encode your architectural instincts into reusable skills, it lets you apply that discipline consistently to every feature you ship.