# How I Built a Serverless PR Gatekeeper with Kiro Specs, Steering Rules, and 851 Automated Tests

> Source: <https://dev.to/fahadyy/how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851-automated-tests-3cid>
> Published: 2026-12-03 21:01:08+00:00

**Recommendation:** Gate LLM output behind deterministic AST and rule-engine checks, and pair Bedrock synthesis with a rule-based fallback so throttling or disabled models still return structured summaries.
More in the playbook "Designing agent systems": <https://wpnews.pro/playbooks/agent-architecture>

Standard CI linters catch syntax errors and formatting drift, yet two expensive regressions regularly slip through pull request reviews:

For **Kiroween 2026** (Frankenstein category), I built **BlastGuard** solo—a serverless pull request gatekeeper that stitches together a TypeScript Compiler AST dependency crawler, a deterministic `us-east-1` Terraform/CDK FinOps pricing and security rule engine, and Amazon Bedrock synthesis on AWS.

`.kiro/` Directory:
An LLM alone cannot be trusted as a pull request check: if it hallucinates impacted file paths or fails when an upstream model throttles, developers disable it immediately. To make BlastGuard reliable, generative AI had to stay strictly downstream of deterministic static analyzers.

Engineering a 3-package TypeScript monorepo (`infra/`, `backend/`, `web/`) solo under a hackathon deadline meant keeping strict boundaries between AWS CDK infrastructure, static AST/Terraform parsers, Bedrock fallback logic, and the React dashboard. **Kiro IDE** kept those invariants intact from day one through four workflows:

`.kiro/specs/`)
Instead of prompting ad-hoc files into existence, I defined formal requirements, system design, and 15 incremental implementation tasks inside `.kiro/specs/` before writing application code. Every acceptance criterion—such as bounding AST traversal depth, caching scan results by commit SHA in DynamoDB, and rejecting private IP ranges before outbound fetches—mapped directly to automated tests.

`.kiro/steering/architecture.md`)
I used `.kiro/steering/architecture.md` to enforce hard system boundaries across every Kiro session:

`/api/*`) with strict `HSTS` and `X-Content-Type-Options` headers to AWS API Gateway, while GitHub webhooks post directly to `POST /api/webhook` so raw request bytes remain intact for `X-Hub-Signature-256` HMAC verification.`us.amazon.nova-2-lite-v1:0`) synthesizes concise review summaries when available, while a deterministic rule-based summary engine guarantees structured output with zero `500` errors if Bedrock is throttled or disabled.`gsi1`) and AWS SSM `SecureString` parameters.`.kiro/steering/ui-system.md`)
To keep the dashboard fast and scannable rather than cluttered with generic card templates, `.kiro/steering/ui-system.md` enforced custom dark-mode tokens, tabular numerals (`tabular-nums`) for cost deltas and impacted file counts, severity noise filtering, keyboard shortcuts (`/` to focus PR input, `1–3` to switch
