Slide 1

Slide 1 text

Quality Gates in the Age of Agentic Coding Ensuring code quality while harnessing the speed of AI-assisted development by Helio Medeiros

Slide 2

Slide 2 text

The old-new safety. After vibecoding and co-creating with AI, I've been saved over and over by quality gates. As we embrace AI collaboration, the safety nets beneath us become more critical than ever before.

Slide 3

Slide 3 text

Why This Matters Agentic coding is remarkably fast, but inherently fragile AI lacks awareness of architecture debt, edge cases, and retry logic nuances Traditional engineering practices matter more, not less, in the AI era Without guardrails, velocity becomes a liability rather than an asset

Slide 4

Slide 4 text

What Are Quality Gates? A quality gate acts as a checkpoint that validates your code meets specific criteria before allowing it to progress to the next stage in your development pipeline. Effective gates serve as safety barriers that protect both the codebase and the engineers working within it, especially when code generation speeds have increased dramatically. 1 Code Style Consistent formatting and adherence to team standards 2 Test Coverage Sufficient tests to validate behaviour across edge cases 3 Security Scans No known vulnerabilities or injection vectors 4 Maintainability Code that future humans (and AI) can understand

Slide 5

Slide 5 text

Common Quality Gates Gate Purpose Linting Enforce code style and catch syntax errors early Unit tests Validate behaviour and protect against regressions Static analysis Detect complexity, code smells and potential bugs Security checks Prevent known vulnerabilities from entering production Dependency checks Avoid disallowed libraries and vulnerable packages Each gate provides a specific type of protection, creating multiple layers of defence against defects.

Slide 6

Slide 6 text

GenAI Prompts for Individual Quality Gates Help me set up code linting and auto-formatting for my [TECHNOLOGY] project. I need: - Popular linter configuration (ESLint, Pylint, golangci-lint, etc.) - Auto-formatter setup (Prettier, Black, gofmt, etc.) - Git hook integration for pre-commit validation - IDE integration instructions - Team-shareable configuration files Linting & Formatting Configure comprehensive test coverage checking for [TECHNOLOGY]. Include: - Coverage tools setup (Jest, pytest-cov, go test -cover, JaCoCo) - Minimum threshold configuration (80%+ recommended) - Coverage reports in multiple formats (HTML, XML, JSON) - Integration with git hooks to block low-coverage commits - CI/CD pipeline integration Test Coverage

Slide 7

Slide 7 text

GenAI Prompts for Individual Quality Gates Implement security vulnerability scanning for [TECHNOLOGY] project: - Dependency vulnerability scanning (npm audit, safety, snyk) - Static application security testing (SAST) tools - Secret detection in code and commits - License compliance checking - Integration with pre-commit hooks and CI/CD Security Scanning Set up static code analysis for [TECHNOLOGY] to catch: - Code complexity metrics (cyclomatic complexity, cognitive complexity) - Code smells and anti-patterns - Technical debt indicators - Performance bottlenecks - Maintainability scores - Integration with git hooks and IDE Static Code Analysis

Slide 8

Slide 8 text

The Agentic Coding Flow Prompt AI Describe what you need and wait for code generation Accept Code Take the AI-generated solution with minimal review Auto-commit Commit changes without running tests locally Auto-push Push to repository without additional checks No testing? No review? No safeguards?

Slide 9

Slide 9 text

The Risks Limited Context AI lacks system-wide architectural understanding and project history Pattern Propagation Bad patterns can be reused and spread throughout the codebase Main Branch Pollution Changes go straight to main without proper validation steps Cascading Failures Small mistakes become significant problems at scale

Slide 10

Slide 10 text

Git Commit & Push Recap git add . git commit -m "fix: retry logic" git push origin main Each step is a signal: "I believe this is safe." But when working with AI-generated code, are you truly confident in that assertion? Or are you passing responsibility to future you and your teammates?

Slide 11

Slide 11 text

What Are Git Hooks? Git hooks are scripts that run automatically at specific points in your git workflow, acting as enforcers of your quality gates. They intercept git commands and can either allow them to proceed or stop them based on whether your code passes specific checks. pre-commit Runs before a commit is created, ideal for linting and formatting commit-msg Validates commit message format for consistency pre-push Executes before code is pushed to remote, perfect for tests

Slide 12

Slide 12 text

How to Configure Git Hooks cd .git/hooks touch pre-commit chmod +x pre-commit #!/bin/sh npm run lint npm test Sample script: These simple scripts can be the difference between a stable codebase and a chaotic one, especially when collaborating with AI. npx husky add .husky/pre-commit \ "npm run lint && npm test" Modern tools like Husky make hook management even easier:

Slide 13

Slide 13 text

GenAI Prompt for Project-Aware Hook Configuration This comprehensive prompt enables AI assistants to analyze your existing setup and build intelligent git hooks tailored to your project. You are an expert DevOps engineer and code analyst. I need you to analyze my project and create intelligent git hooks. Please: **STEP 1: Project Analysis** Examine my project structure, package files, and existing configurations to identify: - Programming language(s) and frameworks in use - Existing quality tools already configured (linters, formatters, test runners) - Build system and dependency management - Current CI/CD setup (if any) - Testing framework and coverage tools - Security tools and static analyzers **STEP 2: Gap Analysis** Compare my current setup against industry best practices and identify: - Missing quality gates that should be implemented - Existing tools that need better integration - Performance optimization opportunities - Team workflow improvements **STEP 3: Hook Strategy Design** Recommend the optimal hook strategy: - Which checks should run on pre-commit vs pre-push - How to balance speed vs thoroughness - Fallback strategies for different development scenarios - Integration with existing CI/CD pipelines **STEP 4: Implementation** Generate production-ready hook scripts that: - Use existing project tools and configurations - Add missing quality gates with sensible defaults - Implement fail-fast with clear error messages - Include performance optimizations (parallel execution, caching) - Are cross-platform compatible - Include setup instructions for the entire team Please analyze the project first, then provide the complete implementation with explanations for each decision. This detailed prompt ensures the AI understands your context and delivers robust, integrated quality gates, rather than generic configurations.

Slide 14

Slide 14 text

Hooks + Quality Gates When combined effectively, git hooks and quality gates create a powerful safety system that: Catches issues early in the development cycle Prevents regressions and security vulnerabilities Protects your team from silent failures and technical debt Allows you to move quickly while maintaining stability Offers immediate feedback on AI-generated code quality

Slide 15

Slide 15 text

Final Thoughts 10x Productivity Boost AI helps you write more code with less effort 85% Issue Reduction Quality gates help you ship better, more reliable code 100% Automation Git hooks do the checking when you forget As AI code generation becomes more powerful, our quality gates must evolve in parallel.

Slide 16

Slide 16 text

Try This Prompt Act as my AI engineer. List the quality gates I should check before committing this change. You're not fighting the future. You're guiding it. Embrace AI-assisted development, but surround it with thoughtful quality gates.