<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-let-ai-refactor-everything-here-s-what-happened-dhihs2wox" -->

---
title: I Let AI Refactor Everything — Here's What Happened
description: The new theme engine is in. The design token system is designed. Now comes the part no one  wants to do manually — ripping out every legacy dynamic resource...
canonical: https://daily.dev/posts/i-let-ai-refactor-everything-here-s-what-happened-dhihs2wox
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I Let AI Refactor Everything — Here's What Happened | daily.dev
og:description: The new theme engine is in. The design token system is designed. Now comes the part no one  wants to do manually — ripping out every legacy dynamic resource...
og:url: https://daily.dev/posts/i-let-ai-refactor-everything-here-s-what-happened-dhihs2wox
og:image: https://api.daily.dev/og/posts/DHIHs2wOX.png
og:image:alt: I Let AI Refactor Everything — Here's What Happened
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Let AI Refactor Everything — Here's What Happened

**[AngelSix](https://daily.dev/sources/angelsix)** · 47 min read · 0 upvotes · 0 comments

## Summary

The new theme engine is in. The design token system is designed. Now comes the part no one 
wants to do manually — ripping out every legacy dynamic resource across every control and 
replacing it with the new token system. In this episode, I use AI agents to do the grunt work 
so I don't have to.

But this isn't vibe coding. The key is the prompt. I walk through exactly how I primed and 
instructed the AI — surgically, precisely — so it executed the migration without going off the 
rails. The AI even surprised me with a markup extension solution I hadn't thought of. This is 
Dev + AI working as it should: human in full control, AI doing the heavy lifting.

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU'LL LEARN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• How to structure an AI prompt to do precise, surgical code migration — not vague generation
• Why priming your AI agent with context before the task changes everything
• What happened when a local AI tried to grant itself admin access — and why security layers matter
• How the AI handled replacing all legacy dynamic resources with the new design token system
• Iterative prompting: how to guide the AI through questions and scope changes in real-time
• The unexpected markup extension solution the AI came up with — and why it was the right call
• How to use value converters for asymmetric padding/margin scenarios in the token system
• What a one-hour AI-assisted dev cycle looks like vs days of manual migration
• When to let AI make decisions vs when to pull it back — staying in control throughout

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⏱ TIMESTAMPS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[0:00]  – Introduction — the new theme engine & design token system recap
[0:47]  – What the design token system gives us: surface, on-surface, semantic naming
[1:33]  – The problem: manual migration across every control would take days
[2:25]  – The solution: AI agents as a surgical migration tool
[4:45]  – The AI agent tool — chat view, Kanban board, and security features
[6:01]  – Crafting the initial migration prompt — exactly what I told the AI
[9:26]  – ⚠️ The rogue AI moment — local model tries to get admin access
[12:05] – AI starts executing, asks clarifying questions, user provides guidance
[16:19] – First pass complete: button spinner migrated, user reviews accuracy
[18:32] – Expanding the task: full reskin across all controls + delete orphaned files
[27:49] – Second pass done — AI raises questions about remaining base resources
[28:51] – Brainstorming: tokenisation approach vs value converters for complex padding
[36:04] – AI proposes final approach, user approves parallel execution
[44:51] – Final outcome: clean minimal theme structure + the markup extension surprise
[47:20] – Reflections on AI-assisted development — what this changes going forward

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔗 LINKS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▶ Part 1 – Setup: https://www.youtube.com/watch?v=rUKlQnjU0tc
▶ Part 2 – Buttons: https://www.youtube.com/watch?v=oKjk6pyyARI
▶ Part 3 – Button Spinner Anatomy: https://www.youtube.com/watch?v=WMaTbXkvm9g
▶ Part 4 – Designing a Theme System: https://www.youtube.com/watch?v=I5halHoNfH0
▶ Part 5 – Checkbox Anatomy: https://www.youtube.com/watch?v=uIimnwjITT0
▶ Part 6 – Checkbox Styling: https://www.youtube.com/watch?v=uv1bNrfCjtY
▶ Part 7 – Theme Engine From Scratch: https://www.youtube.com/watch?v=NXz8hwITg5U
▶ Part 8 – Design Token System: https://www.youtube.com/watch?v=QMVdxRZqaU8
📺 Full Series Playlist: https://www.youtube.com/playlist?list=PLrW43fNmjaQVE2vDBeWD8QYIm06w6bKyO
💾 Source Code: https://github.com/angelsix/youtube/tree/develop/AvaloniaThemeLab
🌐 AngelSix: https://www.angelsix.com

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📺 SERIES: Avalonia UI Theming – Hand Coded From Scratch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

#avalonia #avaloniaui #xaml #csharp #dotnet #aiagent #aitools #softwaretutorial #coding

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=5-p_fnOi0As>

---

[View this post on daily.dev](https://daily.dev/posts/i-let-ai-refactor-everything-here-s-what-happened-dhihs2wox)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I Let AI Refactor Everything — Here's What Happened","url":"https://daily.dev/posts/i-let-ai-refactor-everything-here-s-what-happened-dhihs2wox","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-let-ai-refactor-everything-here-s-what-happened-dhihs2wox"},"datePublished":"2026-10-04T13:04:29.115Z","dateModified":"2026-10-04T21:52:19.687Z","description":"The new theme engine is in. The design token system is designed. Now comes the part no one \nwants to do manually — ripping out every legacy dynamic resource...","image":"https://i.ytimg.com/vi/5-p_fnOi0As/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/5-p_fnOi0As/sddefault.jpg","isAccessibleForFree":true,"articleSection":"AngelSix","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"AngelSix","logo":"https://media.daily.dev/image/upload/s--h1ikmN_u--/f_auto,q_auto/v1791119063/logos/angelsix?_a=BAMAMicg0","url":"https://daily.dev/sources/angelsix"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-let-ai-refactor-everything-here-s-what-happened-dhihs2wox","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"","timeRequired":"PT47M","video":{"@type":"VideoObject","name":"I Let AI Refactor Everything — Here's What Happened","description":"The new theme engine is in. The design token system is designed. Now comes the part no one \nwants to do manually — ripping out every legacy dynamic resource...","thumbnailUrl":"https://i.ytimg.com/vi/5-p_fnOi0As/sddefault.jpg","uploadDate":"2026-10-04T13:04:29.115Z","duration":"PT47M","url":"https://api.daily.dev/r/DHIHs2wOX","embedUrl":"https://www.youtube.com/embed/5-p_fnOi0As"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AngelSix","item":"https://daily.dev/sources/angelsix"},{"@type":"ListItem","position":3,"name":"I Let AI Refactor Everything — Here's What Happened"}]}
```

