跪拜 Guibai
← All articles
Electron

AI Took Over This Open-Source Project: One Sentence In, a Tested PR Out

By 还好还好不是吗 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

This workflow turns "AI writes code, humans test" into "AI writes, tests, and ships" on real platforms, which raises the practical bar for autonomous agents in open-source maintenance. It also gives non-programmers a way to contribute features to Electron apps without touching code, and the reusable pattern is openly documented for other projects.

Summary

MatrixMedia is an open-source Electron tool that syncs video and image posts to Douyin, Kuaishou, Bilibili, Toutiao, WeChat Channels, Xiaohongshu, Tomato, and more. Since v0.14.0, the project has handed its entire development pipeline over to AI agents. A human types a one-line requirement, and the agent edits code, runs unit tests, logs into real platforms through Puppeteer, verifies that a draft actually appears in the backend, reads the failure evidence (screenshots, logs, receipts), fixes its own code, and re-runs until a `draftVerified=true` exit code 0. It then opens a PR with the full test record attached.

The key mechanism is a four-step workflow in a `.agent/` directory, plus a `e2e/run.js` harness that builds, publishes, and collects evidence. The AI uses a non-interactive `--yes` flag to run real uploads and checks on platforms like WeChat Channels. A documented case shows 10 rounds of autonomous iteration to fix an originality-declaration checkbox bug: the AI abandoned two wrong approaches, discovered a shadow-DOM rendering issue, worked around hidden form templates, and fixed a false-positive verification step before converging on polling for a "saved" toast.

This mode removes the need to write or test code by hand, but it is not low-code. The AI produces real JavaScript with unit and e2e test coverage, goes through the normal Git flow, and the entire workflow (`.agent/`, `e2e/`, `AGENTS.md`) is open source. MatrixMedia is now in maintenance mode, but all PRs touching the main publishing pipeline must pass e2e verification, a higher bar than before. Anyone can fork the workflow into their own projects, and non-programmers can request features by simply describing them in natural language.

Takeaways
— MatrixMedia v0.14.0 added a .agent/ directory with an AI-driven workflow: modify code, run unit tests, run e2e on real platforms, read evidence, fix, and repeat until passing.
— The e2e command is `node e2e/run.js -p dy --yes`, where -p selects the platform and --yes is the AI non-interactive mode.
— The AI verifies on actual platforms by logging in, uploading a video, clicking save draft, and checking the backend draft box for the draft.
— In a documented case, the AI ran 10 rounds of e2e to fix a WeChat Channels originality-checkbox bug, discarding two assumptions and converging after two consecutive PASS rounds.
— The AI detected a shadow-DOM re-rendering issue that invalidated ElementHandle references, and switched to real-time queries via evaluate.
— A false positive was caught when a list-page marker matched but a dialog still covered the page; the AI abandoned that verification approach.
— The final fix used a 6-second polling loop to catch the green "saved" toast as the convergence criterion.
— The workflow is open source: .agent/README.md, e2e/run.js, and AGENTS.md are public and can be forked.
— All PRs to the main publishing pipeline must pass e2e verification, raising the quality bar compared to previous human-only unit tests.
— MatrixMedia is in maintenance mode but AI-managed development is its infrastructure for bug fixes and anti-scraping adaptation.
Conclusions

The AI's ability to read screenshots and logs to diagnose issues is what makes this loop work; without visual evidence, the agent would be blind to platform-specific UI changes.

The 10-round case shows that AI can reliably self-correct when given a structured iteration loop, but it still needs a human-defined convergence criterion (the toast signal) to know when to stop.

This model effectively outsources the most tedious part of open-source maintenance, testing against live third-party platforms, to an agent that can run unattended and document its own evidence.

By requiring e2e verification for all PRs, the project has made AI involvement a quality multiplier rather than a shortcut, directly contradicting the stereotype that AI-generated code is less reliable.

The prerequisite of image recognition means this pattern is only as strong as the underlying vision-language model; weak models would fail at the screenshot interpretation step.

Concepts & terms
e2e (end-to-end) testing
A testing approach that runs the full user flow (login, upload, save draft, verify) against a live system, rather than testing isolated units or mocked dependencies.
draftVerified
A boolean flag in the e2e report that indicates whether the saved draft was found in the platform's backend draft box, used as the pass/fail criterion.
shadow DOM
A browser technology that encapsulates a DOM subtree; elements inside a shadow root are not directly accessible via normal queries, which forced the AI to recursively traverse it.
MCP (Model Context Protocol)
An open protocol that lets AI tools like WorkBuddy call external services; MatrixMedia exposes an MCP server so the AI can directly trigger publishing capabilities.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗