Every design system promises consistency, but the gap between declared components and actual implementation often widens over time. A recent forensic analysis by developer Sammi HK sought to quantify this drift by replaying the last hundred merged changes of a popular open-source document-sharing product. The goal was not to shame a specific team, but to examine real code history to see how often developers bypass existing UI primitives and design tokens in favor of hand-built solutions.
The Forensic Method
The audit employed a strict methodology that examined only the lines added by each change, comparing them against the components and tokens available at that specific point in the commit history. This temporal constraint is crucial: writing a hand-coded button before a Button component existed is evolution, not error. The check flagged two primary issues: hand-built UI where a component already existed (such as a raw div acting as a skeleton loader) and raw values matching existing design tokens (like hard-coded hex codes for colors already defined in the theme).
What the Data Revealed
Of the hundred changes analyzed, nearly all touched UI source code. Four instances were flagged for adding hand-built UI where the corresponding component was already available. The most frequent offender was the loading placeholder, with developers creating grey pulse animations manually despite a dedicated skeleton loader component existing in the codebase. Other cases included raw buttons, inputs, and a toggle built from scratch when a Toggle component was present. Additionally, nine changes introduced raw values that exactly matched existing design tokens, such as spacing steps and z-index layers, effectively bypassing the system’s scale.
The Agent Connection
While the specific changes were not explicitly labeled as AI-generated, the patterns mirror findings from a benchmark of the coding agent Codex. In tests without access to the design system, Codex hand-built UI components that already existed in 22 out of a set of runs, compared to only 5 when it had system access. This suggests that as coding agents become more prevalent, the risk of 'reinventing the wheel' increases if the agent cannot clearly see or respect the existing component library. The drift is not just a human error of haste; it is a structural issue in how tools perceive context.
Key Takeaways
- Replay history to find drift: Analyzing past commits provides concrete evidence of design system adherence or failure, far more valuable than abstract debates.
- Context is critical: Only flag a bypass if the component or token existed at the time the change was made, otherwise you are penalizing early-stage development.
- Distinguish between bypasses and gaps: Values that match nothing are not reuse failures; they are opportunities to expand the design token scale.
- Anonymity protects objectivity: Naming the product invites bias. Focusing on the pattern rather than the team allows for a more honest assessment of developer behavior.
The Bottom Line
Design system drift is not a moral failing but a tooling gap. As we integrate more coding agents into our workflows, we must build checks that enforce reuse on every change, ensuring that the 'speed' of AI does not come at the cost of architectural integrity.