{"slug": "how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851", "title": "How I Built a Serverless PR Gatekeeper with Kiro Specs, Steering Rules, and 851 Automated Tests", "summary": "A developer built BlastGuard, a serverless pull request gatekeeper on AWS that combines a TypeScript Compiler AST dependency crawler, a deterministic Terraform/CDK FinOps pricing and security rule engine, and Amazon Bedrock synthesis, backed by 851 automated tests. The project kept generative AI strictly downstream of deterministic static analyzers so hallucinated file paths or model throttling cannot break the check, with Bedrock's Nova 2 Lite model producing review summaries only when available and a rule-based fallback otherwise. The developer used Kiro IDE specs and steering files to enforce architecture and UI boundaries across a three-package TypeScript monorepo.", "body_md": "Standard CI linters catch syntax errors and formatting drift, yet two expensive regressions regularly slip through pull request reviews:\n\nFor **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.\n\n`.kiro/` Directory:\nAn 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.\n\nEngineering 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:\n\n`.kiro/specs/`)\nInstead 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.\n\n`.kiro/steering/architecture.md`)\nI used `.kiro/steering/architecture.md` to enforce hard system boundaries across every Kiro session:\n\n`/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`)\nTo 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", "url": "https://wpnews.pro/news/how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851", "canonical_source": "https://dev.to/fahadyy/how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851-automated-tests-3cid", "published_at": "2026-12-03 21:01:08+00:00", "updated_at": "2026-12-03 21:16:02.454871+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-agents", "ai-infrastructure"], "entities": ["BlastGuard", "Kiro IDE", "Amazon Bedrock", "AWS", "Amazon Nova 2 Lite", "GitHub", "AWS CDK", "DynamoDB"], "also_reported_by": [], "takeaway": "Keep generative AI strictly downstream of deterministic static analyzers and add a rule-based fallback summary so model throttling or hallucinated file paths never produce 500 errors or false PR failures.", "recommendation": {"advice": "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.", "playbook": "agent-architecture", "playbook_url": "https://wpnews.pro/playbooks/agent-architecture"}, "alternates": {"html": "https://wpnews.pro/news/how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851", "markdown": "https://wpnews.pro/news/how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851.md", "text": "https://wpnews.pro/news/how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851.txt", "jsonld": "https://wpnews.pro/news/how-i-built-a-serverless-pr-gatekeeper-with-kiro-specs-steering-rules-and-851.jsonld"}}