<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nathanael FETUE</title>
    <description>The latest articles on DEV Community by Nathanael FETUE (@nathanff).</description>
    <link>https://dev.to/nathanff</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3860240%2F775ded57-937f-4c3c-9b68-957e57a075b1.png</url>
      <title>DEV Community: Nathanael FETUE</title>
      <link>https://dev.to/nathanff</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nathanff"/>
    <language>en</language>
    <item>
      <title>I built a tool that auto-pushes your accepted LeetCode solutions to GitHub with AI-generated commit messages</title>
      <dc:creator>Nathanael FETUE</dc:creator>
      <pubDate>Sat, 04 Apr 2026 00:47:40 +0000</pubDate>
      <link>https://dev.to/nathanff/i-built-a-tool-that-auto-pushes-your-accepted-leetcode-solutions-to-github-with-ai-generated-commit-4ni9</link>
      <guid>https://dev.to/nathanff/i-built-a-tool-that-auto-pushes-your-accepted-leetcode-solutions-to-github-with-ai-generated-commit-4ni9</guid>
      <description>&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Every time I solved a LeetCode problem, I had to manually copy the solution to GitHub. Boring, repetitive, easy to forget. So I automated it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;leetcode-sync&lt;/strong&gt; is a self-hosted tool that detects when you submit an accepted solution on LeetCode and automatically:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Generates a file header with algorithm explanation + time/space complexity (via Claude AI)&lt;/li&gt;
&lt;li&gt;Creates a descriptive git commit message&lt;/li&gt;
&lt;li&gt;Pushes the file to a structured GitHub repo organized by year and month&lt;/li&gt;
&lt;li&gt;Updates a README with your Easy/Medium/Hard stats&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;Your GitHub repo ends up looking like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;2026/
  04-april/
    20260403_two-sum_easy.py
    20260403_add-two-numbers_medium.cpp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With commit messages like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;solve(easy): two-sum - hash map, time O(n), space O(n)
solve(medium): longest-substring - sliding window, time O(n), space O(k)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And each file has an auto-generated header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
Problem    : Two Sum
Difficulty : Easy
URL        : https://leetcode.com/problems/two-sum/
Approach   : Hash map to store complements. For each number, check if its complement exists. If yes, return indices.
Time       : O(n)
Space      : O(n)
Runtime    : 0 ms
Memory     : 13.4 MB
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  How it works
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;LeetCode submit (Accepted)
    → Tampermonkey userscript (intercepts the request in your browser)
    → POST https://your-server.com/leetcode-sync/submit
    → FastAPI server (running in Docker)
        → Claude API (generates header + commit message)
        → GitHub API (pushes file + updates README)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The interesting technical challenge was intercepting LeetCode's network requests. Chrome's Manifest V3 blocks Tampermonkey from hooking &lt;code&gt;window.fetch&lt;/code&gt; directly — the fix was using &lt;code&gt;unsafeWindow&lt;/code&gt; to access the page's actual fetch and XMLHttpRequest before LeetCode's code runs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;FastAPI&lt;/strong&gt; — lightweight Python server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tampermonkey&lt;/strong&gt; — browser userscript to intercept submissions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude API&lt;/strong&gt; — generates the file headers and commit messages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub API&lt;/strong&gt; — pushes files directly without needing git locally&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;The project is fully open source and self-hosted — your code never goes through any third-party service except the Claude API for generation.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/NathanaelFetue/leetcode-sync" rel="noopener noreferrer"&gt;NathanaelFetue/leetcode-sync&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy to answer questions in the comments.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>python</category>
      <category>github</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
