Back to KB
Difficulty
Intermediate
Read Time
9 min

Teaching agents product design at Vercel

By Codcompass TeamΒ·Β·9 min read

Codifying Product Intent: A Repository-First Framework for Agent-Aligned UI

Current Situation Analysis

Coding agents have reached a level of proficiency where they can generate functional UI components rapidly. However, a critical disconnect remains between syntactic correctness and product intent. Agents operate on the codebase as their primary context window. When a developer asks an agent to "build a settings modal," the agent analyzes existing components, prop interfaces, and styling tokens. It produces code that compiles and renders.

The failure mode is semantic. The agent cannot distinguish between a component that exists because it is the optimal solution and one that exists due to a legacy constraint, a temporary workaround, or a specific business rule that was never documented in code. The reasoning behind product decisionsβ€”why a modal requires two-step confirmation, why a specific error state triggers a redirect, or why copy must avoid certain terminologyβ€”resides in design reviews, Slack threads, Figma comments, and tribal knowledge. To an agent, this context is invisible.

This creates a "Context Gap." As teams adopt agents for UI work, they risk scaling inconsistencies. Agents will replicate patterns found in the codebase without understanding the underlying product logic. A team might ship a feature that works technically but violates accessibility standards, brand voice, or user flow expectations because the agent lacked the governing constraints.

The industry often treats design systems and coding agents as separate domains. Design systems provide tokens and components; agents write code. The missing layer is the explicit codification of product decisions. Without this, agents are effectively guessing at product requirements based on historical code, which may be outdated or suboptimal.

WOW Moment: Key Findings

The shift from implicit product knowledge to explicit repository-based governance fundamentally changes how agents interact with UI development. By treating product decisions as version-controlled artifacts, teams transform agents from pattern-matching code generators into intent-aware collaborators.

The following comparison illustrates the operational difference between traditional knowledge management and a repository-first approach:

DimensionImplicit Knowledge (Status Quo)Explicit Repository Knowledge (Codified)
Context SourceSlack, Figma, PR comments, Tribal memoryreferences/ directory, manifest.yaml, exemplars/
Agent AccessNone; agents hallucinate or copy code blindlyDeterministic; agents load directives via skill routing
Update MechanismMeetings, ad-hoc messages, design updatesPull requests, lint checks, review loops
AuditabilityLow; decisions scattered across toolsHigh; every guideline change is versioned and reviewed
Failure ModeAgent produces "correct" code that violates product intentAgent flags conflicts or requests clarification based on explicit rules
ScalabilityDegrades as team grows; knowledge silos formImproves as repository grows; single source of truth

This finding matters because it enables deterministic UI generation. When product intent is codified, agents can validate their output against explicit constraints before writing code. This reduces review cycles, prevents regression of product standards, and allows teams to scale agent usage without sacrificing design quality.

Core Solution

The solution is a Product-as-Code framework. This approach treats product decisions, interaction patterns, and quality standards as first-class citizens in the repository, structured for machine consumption by agents while remaining readable for humans.

Architecture Overview

The framework consists of three integrated components:

  1. Agent Skill Manifest: Defines the skill's scope, routing logic, and operating contract. This file instructs the agent on when to activate, what modes are available, and how to resolve conflicts.
  2. Reference Library: A structured directory containing decision frameworks, state inventories, copy standards, and surface-specific guidelines. These files provide the "why" behind UI patterns.
  3. Exemplar Repository: A collection of approved pull requests and patterns that demonstrate correct implementation. This serves a

πŸŽ‰ Mid-Year Sale β€” Unlock Full Article

Base plan from just $4.99/mo or $49/yr

Sign in to read the full article and unlock all 635+ tutorials.

Sign In / Register β€” Start Free Trial

7-day free trial Β· Cancel anytime Β· 30-day money-back