<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohab Tarek on Medium]]></title>
        <description><![CDATA[Stories by Mohab Tarek on Medium]]></description>
        <link>https://medium.com/@MohabTarek?source=rss-66796fe43041------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zzVeFV1QX7SXNscawRGUXQ@2x.jpeg</url>
            <title>Stories by Mohab Tarek on Medium</title>
            <link>https://medium.com/@MohabTarek?source=rss-66796fe43041------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 21:44:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@MohabTarek/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building an AI Harness at Enterprise Scale]]></title>
            <link>https://medium.com/@MohabTarek/building-an-ai-harness-at-enterprise-scale-aa0a2f2ffb44?source=rss-66796fe43041------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa0a2f2ffb44</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[enterprise-architecture]]></category>
            <dc:creator><![CDATA[Mohab Tarek]]></dc:creator>
            <pubDate>Mon, 02 Nov 2026 23:09:21 GMT</pubDate>
            <atom:updated>2026-11-02T23:42:57.092Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Lessons from building reusable AI engineering practices across teams, platforms, and development tools.</blockquote><p>AI can help write code quickly. But enterprise software is not only code.</p><p>A change also has to fit a project’s architecture, follow security and testing expectations, respect how a team delivers software, and leave enough evidence for someone to review it. Across an enterprise, those expectations are shared in some places and different in others.</p><p>That is the problem I wanted an AI harness to address. It brings the model together with the context around the work: project knowledge, enterprise standards, reusable workflows, tools, validation, telemetry, and human review. The model can generate or explain; the harness helps make the work relevant, bounded, and inspectable.</p><p>The goal was to make that way of working reusable. A team should be able to open its project, understand how the help was produced, decide whether the result belongs in its codebase, and improve the practice as it learns from it.</p><p>Making that experience work across teams was the challenge. Each team brings a different codebase, delivery cycle, and decisions you weren’t there to make. Some expectations are documented. Others are carried by people who know why a module works the way it does or why a change needs extra review.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*1vfHTBiOv1qUdQ6bhBELKg@2x.jpeg" /></figure><p>An AI assistant needs enough of that understanding to be useful. The developer needs enough visibility to judge its work.</p><p>I started from that problem. Making the foundation reusable required more than connecting tools. Engineering expectations needed to be explicit, project knowledge grounded in evidence, and results open to inspection and improvement.</p><p>Understanding how these pieces would fit into different teams’ daily work was where much of the learning began.</p><p><strong>The Boundaries That Make Reuse Possible</strong></p><blockquote>We had to separate what the organization expects from what the project actually does, especially when existing code and standards don’t agree</blockquote><p>One of the first decisions was to establish what each type of context could tell the agent.</p><p>Enterprise standards describe expectations around coding, architecture, security, and testing. Project knowledge describes the application as it exists: its modules, dependencies, contracts, and recorded decisions.</p><p>An existing code pattern can be useful evidence without becoming an approved rule. If the code and standards disagree, the agent should make that visible rather than silently choose one.</p><p>Building something reusable also meant understanding how teams develop software: how work starts, requirements become clear, changes get reviewed, and releases are prepared.</p><p>These processes can look similar at a high level but work differently day to day.</p><p>Discussions with different teams revealed those differences. One may need clearer requirements, another better project knowledge, while another struggles with review or release preparation.</p><p>Existing standards gave us a starting point, but applying them consistently was another challenge. An architecture rule needs to influence a proposed change. A testing requirement needs to connect to the right checks. Adding a document to a repository doesn’t establish that connection.</p><p>Some practices weren’t documented at all. They existed as team knowledge, decisions held by experienced developers, or expectations interpreted differently across projects.</p><p>Making those practices usable by an agent exposed gaps we had to address with the relevant people, establishing baselines, reviews, and ownership. Where standards already existed, we focused on preserving them rather than introducing alternatives.</p><p>This pushed me to study industry practices around architecture, testing, security, and quality more carefully, then understand how they applied to our projects.</p><p>I also became more conscious of the reasoning behind standards: what they protect, when they apply, and how they relate to project-specific decisions.</p><p><strong>When the Code Becomes Context</strong></p><blockquote>Extracting project knowledge wasn’t enough. We needed to verify it against the codebase, keep unknowns visible, and retrieve only what was relevant to the task</blockquote><p>A standard cannot tell an agent which module owns a particular behavior or why one service depends on another.</p><p>That is where the project knowledge base came in.</p><p>I started looking at how we could extract useful knowledge directly from the codebase: module boundaries, dependencies, contracts, architecture decisions, patterns, and validation commands.</p><p>The challenge wasn’t just extraction. It was organizing that information so agents could retrieve what mattered without repeatedly exploring the entire codebase.</p><p>This also supported token optimization. Instead of loading unrelated context, an index could direct the agent to relevant module knowledge and the source files it needed to inspect.</p><p>That knowledge needs updating as code changes, and important claims still require verification against their sources.</p><p>During extraction, we found that generating documentation was only part of the problem. We also needed to distinguish confirmed knowledge from assumptions.</p><p>Where did a statement come from? Was the module properly inspected? Did we establish the execution order of a workflow or only identify dependencies?</p><p>For example, identifying a dependency between two modules doesn’t necessarily establish their runtime execution sequence. We couldn’t treat every extracted relationship as a confirmed architecture fact.</p><p>We introduced clearer records for evidence, unknowns, and partial progress. Incomplete extraction remained visible, and we distinguished document validation from proving that the knowledge was useful on real engineering tasks.</p><p>Context selection presented a similar challenge. A Kotlin file alone doesn’t tell you whether the work belongs to Android or a backend service.</p><p>The workflow needed to identify the project root and platform, retrieve relevant project knowledge, and then select the appropriate skills and standards.</p><p><strong>One Workflow, Many Engineering Frameworks</strong></p><blockquote>We kept workflows shared across platforms while using selected skills to bring in the engineering practices specific to each technology</blockquote><p>Supporting different platforms raised another question: how much of the workflow could remain shared?</p><p>A review still needs to understand the change, inspect evidence, identify problems, and report uncertainty. The specific checks depend on the platform.</p><p>That is where skills fit. A skill holds focused guidance the agent can use during its work. The workflow owns the steps and permissions; selected skills provide the engineering knowledge.</p><p>I also found it useful to separate platform knowledge from project knowledge.</p><p>A platform skill covers language idioms, lifecycle behavior, testing practices, and performance concerns. The project knowledge base explains how a particular application uses them.</p><p>The workflow retains its responsibilities across platforms, while selected skills provide the relevant technical guidance. The full mapping covers other supported platforms, with additional skills loaded only when needed.</p><p>This allowed us to reuse workflows without assuming that every platform follows the same engineering practices.</p><p><strong>Turning Judgment into Guidance</strong></p><blockquote>We started turning engineering practices from areas like performance, testing, and architecture into guidance agents could apply during development</blockquote><p>The engineering basics still matter. Understanding a platform’s lifecycle, choosing appropriate tests, maintaining module boundaries, and investigating performance require engineering judgment.</p><p>I wanted more of that knowledge available during an agent’s work, in a form developers could inspect and improve.</p><p>Performance is a good example.</p><p>A performance skill can guide the agent through establishing a baseline, selecting appropriate measurements, investigating causes, making a focused change, and measuring again.</p><p>The tools and metrics differ across backend, web, and mobile, but the engineering approach remains consistent.</p><p>Lessons from real investigations can become reusable guidance when their conditions, evidence, and limitations are clear.</p><p>The challenge is deciding what knowledge is general enough to share and what should remain project-specific.</p><p><strong>Build, Borrow, or Adapt?</strong></p><blockquote>Before introducing a new skill, I wanted to understand what already existed, what could be reused, and where additional guidance was actually needed</blockquote><p>As the number of potential skills grew, I had to think more carefully about when we actually needed a new one.</p><p>I didn’t want a skill for every prompt or team preference. That would introduce overlapping guidance and increase maintenance.</p><p>I started using a few considerations: Is the knowledge repeated? Does it have a clear responsibility? Can it support multiple workflows or teams? Can we verify its guidance?</p><p>A skill should capture an engineering practice: what to inspect, what evidence to collect, which constraints matter, and what a good result looks like.</p><p>But building from scratch isn’t always the best option.</p><p>Existing skills, including community contributions, already cover many platform-specific practices. Reusing them keeps the foundation smaller and avoids maintaining duplicate guidance.</p><p>Before adopting one, I examine how it is selected, its assumptions about tools and project structure, the standards it follows, and what it allows an agent to change.</p><p>Sometimes it fits directly. Other times, it needs adaptation for a local command, architecture constraint, testing convention, or measurement source.</p><p>I prefer focused adaptations over copying and rewriting an entire skill, while preserving source attribution and licensing.</p><p>Creating a new skill makes sense when existing guidance leaves a recurring gap, combines unrelated responsibilities, or conflicts with enterprise standards or project reality.</p><p>Even then, I try to keep the scope narrow. Sometimes adding a reference to an existing skill is enough.</p><p>The next step is testing it on a bounded task. Does it select the right context, guide the agent toward useful evidence, produce a reviewable result, and coexist with other guidance?</p><p>Those results help us decide whether to keep, adapt, or discard it.</p><p>This gave me a more consistent way to manage the skills while keeping their purpose focused on engineering practices.</p><p><strong>Close to the Code, Close to the Developer</strong></p><blockquote>Supporting multiple AI assistants meant making sure the entire workflow could execute in the selected environment, not just its entry point</blockquote><p>I wanted developers to use the harness inside their repositories, with relevant files and proposed changes available for inspection.</p><p>Reusable workflows and skills needed to work through supported IDE and assistant integrations without requiring every team to maintain separate copies of the same guidance.</p><p>One problem showed us that supporting multiple tools wasn’t just about providing different entry points.</p><p>A knowledge workflow could start in Copilot and later reach a step that expected OpenCode, a different tool for running agents. If OpenCode wasn’t available, the workflow stopped, even though the developer had started in a supported environment.</p><p>The workflow was accessible through Copilot but couldn’t necessarily execute from start to finish. We had treated entry-point compatibility differently from compatibility across the full workflow.</p><p>We improved how workflows respected the developer’s selected environment, including handoffs and recovery instructions.</p><p>It changed how I thought about tool independence. Making instructions available across assistants isn’t enough if later steps introduce unexpected dependencies.</p><p>Setup and updates needed similar attention. Teams had to understand what the shared foundation managed and what remained under their project ownership.</p><p>We also needed to preserve partial progress. If a later step failed, the developer should retain completed artifacts, the last successful checkpoint, and instructions for continuing.</p><p>These details directly affect whether the harness fits into a developer’s normal working day.</p><p><strong>Where Judgment Stays Human</strong></p><blockquote>We made checks and completion criteria explicit so developers could see what was validated, what remained uncertain, and what still required their decision</blockquote><p>Keeping the experience close to the code also means keeping the developer involved in decisions.</p><p>They need enough evidence to evaluate proposed changes, applicable standards, executed checks, and remaining uncertainty.</p><p>I wanted workflows to carry more responsibility without developers having to repeat every safeguard in their prompts.</p><p>For example, requesting a code review should automatically bring in coding standards, architecture compliance, and relevant review checks.</p><p>We made steps, permissions, and completion criteria more explicit. What must run? What can the agent change? What evidence must it return? How should incomplete execution be reported?</p><p>A completed result needs a defined meaning. Tests that couldn’t run shouldn’t appear as passed, and blockers should include completed work and the conditions needed to continue.</p><p>One practical example was reviewing actual staged changes before a commit.</p><p>An earlier review can become outdated as implementation continues. The final review evidence needs to reflect what is being committed, not an earlier version.</p><p>These checks support engineering judgment but don’t replace it.</p><p>Passing validation doesn’t establish that the behavior meets the requirements, the design is appropriate, or the remaining risks are acceptable.</p><p>Human review and approval remain part of the process.</p><p><strong>Deterministic Boundaries, Probabilistic Work</strong></p><blockquote>We made routing, permissions, and validation rule-based where possible, while treating model reasoning as something that still needed evidence and evaluation</blockquote><p>One implementation decision became especially important: separating what we could enforce through deterministic rules from what depended on the model’s reasoning.</p><p>Some parts of the harness can be made deterministic through explicit configuration and rules. Project and platform routing, workflow phases, permissions, mutation boundaries, result shapes, and validation contracts can follow predictable behavior. We can exercise these with routing checks, unit tests, fixtures, result validators, and architecture checks.</p><p>Context selection needs more care. When the project, platform, or required skills are selected through explicit rules, that behavior can be tested for consistency. When the model interprets code or requirements to decide which knowledge is relevant, the selection remains probabilistic.</p><p>The model’s work is different. It interprets requirements, connects evidence, proposes plans or code, explains trade-offs, and handles ambiguity. Even with the same guidance, those outputs can vary. More detailed instructions can improve consistency, but they cannot guarantee the correctness of the reasoning.</p><p>This distinction influenced how we approached testing.</p><p>For deterministic components, we could define expected inputs and outputs, then use contract tests, routing self-tests, fixtures, and regression checks.</p><p>For model-driven behavior, we needed representative engineering tasks, evaluation criteria, evidence review, and human judgment. We could assess whether the agent selected appropriate knowledge, respected constraints, identified uncertainty, and produced a useful result, without assuming every run would produce identical output.</p><p>The aim was to establish reliable controls around the model’s work. Where rules could enforce a behavior, we used them. Where the model needed to interpret or decide, the workflow required evidence and validation appropriate to that uncertainty.</p><p>This gave us a clearer way to decide what could be tested through fixed contracts and what needed broader engineering evaluation.</p><p><strong>The Work Behind the Feature</strong></p><blockquote>We made routing, permissions, and validation rule-based where possible, while treating model reasoning as something that still needed evidence and evaluation</blockquote><p>Once we had more structure around changes and validation, I also wanted to understand the effort behind AI-assisted development.</p><p>A developer should be able to look back at a feature and identify which activities used AI, which tools or agents were involved, what token usage was measured, and what resulted from that work.</p><p>We connected activity records to features, specifications, tickets, or pull requests. Planning, implementation, and review could have separate records associated with the same feature, with usage attached where telemetry was available.</p><p>The challenge was making those records meaningful without overstating their accuracy.</p><p>A session covering several features doesn’t automatically provide an exact token split. We needed clear feature references, protection against duplicate imports, and a way to keep missing measurements unknown.</p><p>Telemetry also depends on the integration. An activity log doesn’t mean every supported tool provides measured token usage.</p><p>This visibility can help developers investigate repeated context loading, unclear requirements, retries, or review corrections, then compare that effort with the quality and validation of the outcome.</p><p>Token consumption alone isn’t a measure of engineering effectiveness. It’s one source of information for understanding development cost and improving the workflow.</p><p><strong>When the Framework Writes, Governs, and Tests Itself</strong></p><blockquote>Using the harness to develop itself helped us find integration issues, but passing its own checks wasn’t enough to establish correctness</blockquote><p>We also used the harness to develop the harness itself.</p><p>Planning, specifications, workflow changes, skills, and validation were developed using the same foundation we were building.</p><p>This allowed us to exercise it against real engineering tasks rather than isolated examples.</p><p>For a workflow or skill change, the framework had to identify its own project context, select the right guidance, modify the correct files, respect contribution boundaries, and produce reviewable artifacts.</p><p>The process connected planning to implementation: load context, select skills, produce a plan or change, execute unit tests and focused validators, review workflow and architecture, and record the outcome.</p><p>Working this way exposed practical issues that isolated tests might not reveal. A routing decision could lead to the wrong guidance, a workflow handoff could lose important context, or a validation step could report success without covering the intended change.</p><p>We could investigate these problems directly in the framework’s own development process, update the relevant workflow or checks, and exercise them again.</p><p>There was also a challenge in evaluating changes to the foundation itself. The generation and validation steps could share the same incorrect assumptions, particularly when the framework helped update its own instructions or validators.</p><p>We therefore kept human review focused on the actual changes and their architectural implications, including whether new behavior belonged in an existing workflow or required a separate capability.</p><p>Using the harness on itself gave us regular opportunities to find integration problems and improve the developer experience. We treated those runs as practical engineering evidence, alongside independent review, rather than as proof that the framework could validate all its own decisions.</p><p><strong>The Real Work Starts After Setup</strong></p><blockquote>Trying the workflows on a small, real task helped us understand what worked for a team and what needed to change before wider adoption</blockquote><p>After using the foundation in our own engineering work, another challenge was fitting it into other teams’ development cycles.</p><p>A setup command is useful, but developers still need to understand where the harness fits, what it changes, and why it is worth adopting.</p><p>I found that explaining everything at once could make it harder to know where to begin.</p><p>The approach I came to value was starting with a small, real engineering task.</p><p>Choose a problem the team recognizes. Understand how they handle it today. Apply the relevant workflow, inspect the result, and discuss what helped or created friction.</p><p>We included this in the adoption guidance: start with a bounded pilot, agree on success criteria, and evaluate engineering evidence alongside developer feedback before expanding.</p><p>Those discussions exposed things that weren’t obvious from the implementation.</p><p>A developer’s hesitation might come from unclear documentation, uncertainty about what the agent could change, or a workflow that didn’t fit the team’s delivery process.</p><p>Addressing those concerns required understanding their experience, not simply adding more instructions or capabilities.</p><p><strong>Open the Walls</strong></p><blockquote>Opening the foundation to contributions meant giving developers a way to propose changes, challenge decisions, and improve the shared implementation through review</blockquote><p>Beyond making the harness usable, I wanted developers to understand how it was built and have a way to improve it.</p><p>They could inspect an agent’s instructions, follow its workflows and skills, understand the standards behind a check, examine execution scripts, and review changes through pull requests.</p><p>We use an internal contribution model where engineers across the company can inspect the implementation, question decisions, and propose improvements.</p><p>Contributions don’t have to be major features. They can start with an unclear instruction, missing example, workflow improvement, or platform-specific practice another team understands well.</p><p>But good ideas can still overlap or conflict.</p><p>As more developers contribute, we need clear ownership and a way to evaluate changes against existing architecture and standards.</p><p>Our contribution process includes technical validation and human review.</p><p>Unit tests and focused validators help detect regressions and contract violations. Reviewers assess workflow design, architecture impact, and overlap with existing capabilities.</p><p>A change can pass its tests and still introduce an unnecessary abstraction.</p><p>We encountered a practical example of this.</p><p>We initially introduced a separate agent for bug triage. During review, feedback suggested incorporating the capability into the existing diagnosis workflow.</p><p>Maintaining two paths for closely related responsibilities would introduce unnecessary overlap. We changed the design, making bug triage a mode within the diagnosis workflow instead.</p><p>The original contribution remained useful. Review helped us find a better place for it.</p><p>That experience reinforced what I wanted from the contribution model: developers should be able to propose ideas, challenge designs, and influence outcomes without having to defend the original implementation.</p><p>Recording decisions also matters. Others can inspect the proposal, feedback, and reasoning behind the change.</p><p>A predictable process helps contributors understand how ideas are evaluated, conflicts resolved, and decisions made, while maintaining consistency across teams.</p><p><strong>When Adoption Becomes Shared Work</strong></p><blockquote>As more teams contributed their engineering experience, we could improve shared practices while keeping room for differences between projects</blockquote><p>As the implementation became more visible, teams had something concrete to inspect and discuss: context selection, workflows, validation, and where human decisions remained.</p><p>Engineering practices previously understood within individual teams could be documented, reviewed, and considered for wider adoption.</p><p>Contributions also brought knowledge from platforms, projects, and delivery processes I wouldn’t have encountered through my own work.</p><p>Developers could challenge assumptions, suggest better checks, share platform knowledge, or explain why a workflow didn’t fit their delivery cycle.</p><p>Those discussions helped identify where the shared approach worked and where flexibility was needed.</p><p>This changed how I thought about encouraging AI adoption.</p><p>A developer could start with one engineering practice they knew well, document it as guidance, validate it on a real task, and bring the evidence back for review.</p><p>Teams could participate in shaping the foundation rather than only using what had already been built.</p><p>Their feedback and contributions became part of the next version.</p><p><strong>What I Am Still Learning</strong></p><blockquote>Working with different teams taught me that making something technically reusable is only part of the challenge. Understanding how people work matters just as much.</blockquote><p>Working across teams required me to improve how I communicated technical decisions, understood different development cycles, and distinguished shared practices from project-specific decisions.</p><p>It also pushed me to study engineering standards more carefully and think beyond whether an approach worked in one project.</p><p>The technical implementation and collaboration influenced each other throughout the journey.</p><p>Discussions exposed assumptions I hadn’t considered. Review feedback changed architectural decisions. Contributions introduced practices we could reuse more widely.</p><p>I also learned that making a foundation technically reusable doesn’t automatically make it easy to adopt. Understanding team challenges and involving developers in decisions are equally important.</p><p>There is still more to do, particularly around measuring engineering outcomes, evaluating adoption, and identifying where teams need support.</p><p>If I were encouraging someone to build something similar, I’d start with one team and one part of their development cycle.</p><p>Understand the challenges, make relevant engineering practices explicit, build a small workflow, and evaluate the results together.</p><p>That brings me back to the question I started with: can another team pick up this way of working, understand how it produces results, and improve it without depending on the people who built it?</p><p>That’s still how I want to evaluate the foundation as more teams use it. Not only whether workflows execute successfully, but whether developers can understand their decisions, validate results, and contribute improvements.</p><p>I’m still learning how to make that work better across teams.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa0a2f2ffb44" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>