Share
Embed
Patterns in AI Driven Software Development
Presentation given at the Red Hat 3rd Swiss Dev Confederation, October 27th, 2026.
Adrian Kosmaczewski PRO
October 27, 2026
Transcript
40 slides
-
INTERACTION PATTERNS Patterns in AI Driven Software Development Adrian Kosmaczewski
Senior Architect, Red Hat Switzerland Red Hat -
CLOUD-NATIVE & GENERATIVE AI The Intersection of Cloud-Native Complexity and
Generative AI • Cloud-native power: Red Hat OpenShift, Quarkus, distributed systems. • Rise of generative AI: Open-source models in OpenShift AI, intelligent IDEs like Cursor. Red Hat -
The Intoxicating Promise vs. Uncompilable Code Reality THE PROMISE THE
REALITY Create better software, faster. AI often generates chaotic, uncompilable messes when asked to build scalable Quarkus microservices. • • Accelerated Output: Rapid prototype generation and immediate code scaffolding. Elevated Efficiency: Automating boilerplate to focus on high-level architecture. • Broken Dependencies: Hallucinated annotations and mismatched runtime libraries. • Architectural Drift: Failure to respect Quarkus reactive patterns and cloud-native standards. -
UNSTRUCTURED PROMPTING The Flaws of Vibes-Based Prompting and Completion Bias
01 02 03 Pattern Matching Vibes-Based Prompting Completion Bias LLMs are pattern-matching engines, not software engineers. "Vibes-based" prompting is essentially rolling the dice. AI suffers from completion bias, skipping crucial intermediate steps. -
Structured AI Workflows: Matt Pocock Relentless "Grill Me" Sessions Engage
in rigorous interactive questioning to build and establish complete shared understanding between human and AI models. Test-Driven Development (TDD) Enforce strict TDD practices to establish firm behavioral boundaries and systematically prevent trivial AI "cheating". https://www.aihero.dev/skills -
Structured AI Workflows Lauren Tan's Pstack Framework 1 Cursor Plugin
Integration Pstack operates seamlessly as a dedicated Cursor plugin built specifically for developer workflows. 2 Structured Agent Transformation Transforms unstructured AI coding agents into an engineered, highly predictable, and systematic workflow. 3 Extensive Skill System 23 SKILLS Framework Powerhouse Pstack orchestrates 23 distinct, modular skills. Each skill encodes precise context, execution rules, and domain patterns directly into the IDE agent environment. Leverages specialized operational rules to drive precision across complex development tasks. https://github.com/cursor/plugins/tree/main/pstack Red Hat -
Structured AI Workflows: Addy Osmani's Loop Engineering WARNING: Mitigate "intent
debt" and avoid "cognitive surrender" by enforcing strict human-in-the-loop verification strategies. INNER LOOP OUTER LOOP (Human-Owned Verification) (AI-Owned Execution) Rapid Iteration: Fast, localized execution of low-level tasks, code generation, and scaffolding. Automated Context: Autonomous expansion of instructions using dynamic repository retrieval. High-Speed Drafts: Synthesizes complex modifications quickly, handling routine implementation detail. Strict Verification: Rigorous human review, validation of logic, architectural alignment, and correctness. Intent Preservation: Enforces design intent to stop silent divergence and quality degradation. Strategic Ownership: Maintains total human accountability for system integrity and business outcomes. https://skills.addy.ie/ -
INTERACTION PATTERNS CHIRON CODEX Interaction Patterns for AI-Augmented Development •
Focuses on AI-Augmented Software Development. • Formalizes how developers talk to AI. • https://www.patreon.com/cw/chironcodex Red Hat -
Origin & Gang of Four Analogy Creator & Origin Created
by Dr. Graham Lee, DPhil (University of Oxford) Historical Parallel Analogous to the 1995 "Gang of Four" Design Patterns Core Value Proposition Provides a shared vocabulary for engineering standardized AI interactions and architectural structures -
Standardized Pattern Structure Intent Core goal and target problem statement
addressed by the pattern. Implementation Motivation Business drivers, rationale, and context behind adoption. Examples Technical design, step-by-step guidance, and structure. Real-world usage scenarios, code samples, and reference specs. Consequences Related Patterns Trade-offs, benefits, and architectural implications. Complementary, alternative, or dependency patterns. -
CORE PHILOSOPHY BECOMING A SOFTWARE CENTAUR • Do not outsource
understanding to the computer. • Become a "Software Centaur". • Actively augment expertise by orchestrating AI capabilities. Red Hat -
Pattern Language Formalizing Names for Industry-Wide Communication 01 02 Recognize
Patterns Formalize Names Recognize patterns already in daily use. Formalize names to communicate ideas with colleagues easily. -
Mastering Context: Limits of AI Working Memory 01 02 Working
Memory Capacity Attention Degradation Critical Limitation: AI systems operate within fixed context windows. Context Noise: Irrelevant files confuse self-attention mechanisms. An AI model's working memory bounds its ability to process, retain, and recall instructions simultaneously across large codebases or documents. Including extraneous context dilutes key details, leading to hallucinations, ignored logic, and degraded output quality. -
Semantic Structure Pattern • Domain Alignment: Organize codebase by •
Targeted Context: Helps AI locate relevant problem domain vocabulary, not technological layers. code without pulling unrelated files. -
Guided Navigation Pattern Explicit Search Prompting Explicitly prompt AI to
search specific files. Focus Attention Prevents attention dilution in massive environments. Scope Control Avoids sharing irrelevant source files. -
Clean Slate Pattern Explicit Context Reset Explicitly clear context before
major tasks: Guarantees the LLM operates PRE-TASK ACTION with an unpolluted working memory, freeing capacity for optimal reasoning. Halt Mistake Loops Prevents AI from repeating mistakes: Cuts self-attention loops off SELF-ATTENTION PROTECTION from previous failed attempts, bad code generation, or hallucinatory context. Resource Efficiency Keeps generation time low & focused: Minimizes input token processing LATENCY & FOCUS overhead, directly accelerating response latency while sharpening task fidelity. -
Planning & Discovery Deep Organizational Understanding Software design requires deeply
understanding organizational needs. Model Tendencies AI models inherently choose the path of least resistance. -
Stop & Plan and Disclose Ambiguity Stop and Plan Vibe
plan before you vibe code. Disclose Ambiguity Prompt model to list assumptions and missing information. -
Ask for Alternatives and Model Bake-Off Ask for Alternatives Request
multiple solutions to compare benefits and drawbacks before proceeding with implementation. Bake Off Evaluate interpretations across different assistants or models to uncover optimal trade-offs and edge cases. -
Baby Steps, Defer Details, and Write Down TODOs Baby Steps
Defer Details Write Down TODOs Split large tasks into manageable chunks. Record open questions to maintain focus. Log architectural spikes for later. -
Quality Gates Save Output to File Declarative Artifacts Force AI
to generate intermediate declarative artifacts (PlantUML, architecture records). Repository Storage Save directly to repository. Human Review Creates explicit review points. -
Generate Documentation Pattern Verify implemented behavior via reading guides. AI
Creates Code Reading Guides Automatically generates comprehensive architectural overviews and contextual guides for complex codebases. Details Entry Points & External Interfaces Maps critical API endpoints, system boundaries, and data flow paths for developer review. Behavior Verification Compares requested specification behavior directly against actual code implementation to catch discrepancies. -
Quality Gates Enforce verification controls and trust automated test suites.
Call Out Error Intervene Show explicit visual proof of failure. Stop generation and fix it yourself. Model Reviews Trust the Tests AI evaluates its own work. Let the test suite be the arbiter. -
Replace Vibes with Tools Pattern 01 02 03 Provide reproducible
tools or scripts for deterministic tasks. Reduces context cost. Gives deterministic control over CI/CD pipelines. -
Give Examples Pattern Prefix Constraints Prompts act as prefixes constraining
focus to clear boundaries and operational scope. Annotated Snippets Provide annotated snippets wrapped strictly in explicit <example> tags for parsing accuracy. Structural Mandates Mandates specific implementation structures (e.g., standardized Quarkus REST endpoints). -
Extract Prompt Pattern • Isolated Prompts: Turn corrections into isolated,
reusable prompts. • Clear Steps: Specify steps clearly. • Scoped Execution: Invoke agent without dragging in unrelated context. 01. REUSABILITY Isolated Prompt Templates Turn corrections into isolated, reusable prompts for recurring engineering tasks. 02. PRECISION Explicit Step Logic Specify steps clearly to eliminate ambiguity and guarantee deterministic output. 03. CONTEXT CONTROL Focused Agent Scope Invoke agent without dragging in unrelated context or cluttering memory. -
Model Reflects & Remember What We Did 01 / REFLECTION
02 / PERSISTENCE Model Reflects Remember What We Did AI identifies inflection points and bugs. Record choices to a persistent memory store (markdown or database). -
CENTAUR PATTERNS Fortifying Security with Centaur Patterns Give Examples Replace
Vibes with Tools Mandate security in design. Embed concrete reference architectures, threat models, and secure coding patterns directly into the engineering workflow. Use deterministic analysis tools. Shift from subjective assessments to automated SAST, DAST, and continuous compliance verification routines. Model Reviews You Review Focus on OWASP Top Ten. Systematically evaluate designs against known vulnerability classes and emerging LLM attack vectors. Human oversight is the last defense. Ensure qualified experts validate critical decisions, boundary enforcement, and automated output integrity. -
EXAMPLE Operationalizing Patterns in Cursor • Capture patterns in .mdc
files (.cursor/rules/). • Acts as AI's long-term memory for continuous contextual guidance. .cursor/rules/quarkus-health.mdc --description: Enforce Quarkus health check standards globs: "src/main/java/**/*.java" --- • Example: Enforcing Quarkus health check standards and OpenShift probes. # Quarkus Health & OpenShift Probes - Ensure @Liveness and @Readiness - Use HealthCheckResponseBuilder - Align with OpenShift deployment specs Red Hat -
CONCLUSION Reclaiming Control as a Software Centaur • Treat AI
as a capable junior teammate, not an infallible oracle. • Stop outsourcing understanding. • Reclaim control to rapidly build, test, and deploy resilient Cloud-Native applications. Red Hat