OpenAI Codex Fully Autonomous Programming: A Complete Record of Building a WeChat Pay Membership Mini Program from Scratch

Using OpenAI Codex to autonomously build a complete WeChat Pay mini program via Goal Coding.
This article documents a developer's full journey using OpenAI Codex's Goal Coding mode to autonomously build a commercial-grade WeChat Mini Program with membership tiers, WeChat Pay integration, and an admin dashboard. It covers the technical architecture, the HTML-first prototyping strategy, 7-8 hours of autonomous AI development, key pain points, and a cost analysis showing orders-of-magnitude savings over traditional outsourcing.
Introduction: Goal Coding — A More Radical AI Development Paradigm Than Vibe Coding
While most developers are still collaborating with AI through Vibe Coding (chatting while writing code), a more radical development paradigm is emerging — Goal Coding. Set the goal, let AI handle fully automated development and testing, and humans don't need to write a single line of code.
Vibe Coding was a concept coined by former OpenAI researcher and Tesla AI Director Andrej Karpathy in early 2025, describing a collaborative model where developers guide AI to generate code step by step through natural language conversation. In this mode, humans are still deeply involved in every decision — reviewing code, suggesting modifications, and iterating feature by feature. Goal Coding takes this a step further. Its core philosophy shifts the human role from "step-by-step guide" to "goal setter." Developers only need to define the end goal and acceptance criteria, while AI autonomously plans task decomposition, code implementation, test verification, and bug fixing in a complete closed loop. Behind this paradigm shift is a leap in AI Agent capabilities — evolving from single-turn conversational code completion to autonomous agents with long-term planning, environment awareness, and self-correction abilities.
This article documents a developer's complete journey using OpenAI Codex to build a membership mini program with WeChat Pay integration from scratch. This isn't a simple demo — it's a full commercial-grade application featuring a membership system, online events, WeChat Pay, and an admin dashboard.
Technical Architecture and Preparation
Technology Stack
The developer chose the following tech stack for this WeChat Mini Program:
- Frontend Framework: Vue + Vite, using WeChat Mini Program's native syntax
- UI Components: TDesign component library + Tailwind CSS
- Backend Services: Tencent CloudBase
- Payments: WeChat Pay
- AI Development Tool: OpenAI Codex (with Computer Use capability)
OpenAI Codex is a cloud-based AI programming Agent launched by OpenAI in 2025. It runs in a sandboxed cloud environment and can autonomously execute terminal commands, read and write files, and run tests. The Computer Use capability is a key breakthrough — it allows AI to operate graphical interfaces just like a human: moving the mouse, clicking buttons, filling out forms, and taking screenshots. This technology was first demonstrated by Anthropic in Claude, and OpenAI subsequently integrated similar capabilities into its Agent products. In this case, Computer Use enabled Codex to automatically handle GUI interactions during development, such as clicking authorization popups, previewing results in developer tools, and taking screenshots to verify UI rendering — significantly reducing the need for human intervention.
The reason for not using WeChat Developer Tools' built-in templates directly was that this tech stack offers a better developer experience, and Tencent CloudBase provides AI-friendly toolchains like CLI, MCP, and Skills that Codex can call directly. Tencent CloudBase is a Serverless backend service platform provided by Tencent Cloud, specifically designed for WeChat Mini Programs and similar applications. It offers one-stop backend capabilities including cloud functions, cloud databases, and cloud storage, eliminating the need for developers to set up and maintain their own servers. The CLI (Command Line Interface) mentioned here allows deployment and management operations through terminal commands — a naturally AI-friendly interface. MCP (Model Context Protocol) is an open standard proposed by Anthropic, designed to provide AI models with a unified protocol for interacting with external tools and data sources. Tencent CloudBase has adapted to this protocol, allowing AI to directly invoke various cloud development services. Skills are predefined capability modules that essentially serve as "operation manuals" for AI, telling it how to correctly call a specific platform's APIs and services.
Steps That Still Require Manual Human Action
Although the goal was to have AI complete all development work, the WeChat Mini Program ecosystem still has numerous steps that must be performed manually by humans:
- Mini Program Registration: Requires an email not previously registered for an official account; names are frequently taken
- Enterprise Verification and Filing: Personal mini programs cannot integrate WeChat Pay; commercial use requires enterprise verification
- Obtaining the App ID: Retrieved from the Mini Program admin dashboard
- Setting Up the Cloud Development Environment: Tencent CloudBase offers a 6-month free trial
- Registering a WeChat Pay Merchant Account: And linking it to the Mini Program's App ID

Among these, WeChat Pay integration is the core step for mini program monetization and one of the most complex manual operations in the entire process. Developers first need to register a merchant account on the WeChat Pay Merchant Platform, submitting enterprise qualification materials such as business licenses and legal representative ID cards. Review typically takes 1-3 business days. After the merchant account is approved, it must be linked to the mini program's App ID — this requires initiating a linking request on the WeChat Pay Merchant Platform and then confirming it in the Mini Program admin dashboard. Additionally, using WeChat Pay within the cloud development environment requires extra authorization configuration — enabling the WeChat Pay feature in the CloudBase console and confirming authorization in the WeChat Pay Merchant Assistant mini program. The entire chain involves at least three different management platforms, each with independent permission verification mechanisms, which explains why this part remains difficult to automate with AI.
Interestingly, if the mini program integrates AI features, algorithm filing is also required. When using domestic models (such as DeepSeek), you can directly use their existing algorithm filing materials for submission.
Detailed Codex Fully Automated Development Process
Step 1: Project Initialization
The developer created an empty folder, then provided Codex with essential information like the environment ID and App ID, asking it to automatically complete:
- Creating the project scaffold
- Installing all dependencies
- Installing the CloudBase CLI and MCP
- Configuring the development environment

Codex activated its Computer Use capability, automatically operating the interface and clicking authorization popups. While a few steps still required manual confirmation, AI was able to autonomously complete most operations.
Step 2: Requirements Analysis and UI Prototype Generation
The developer handed the requirements document provided by a friend directly to the AI, asking it to generate a structured requirements document and MVP version plan. Then came a key technique — generating HTML prototypes first, then converting them to mini program code.
This "HTML first, mini program second" strategy works because of the distribution difference in AI training data. The internet contains massive amounts of HTML/CSS web code and corresponding visual output data, so AI models have extremely rich training data in web frontend development. As a result, the quality and aesthetics of generated HTML pages far exceed those of directly generated mini program code. Although WeChat Mini Programs use a web-like tech stack (WXML is similar to HTML, WXSS is similar to CSS), their component system, styling conventions, and APIs have unique characteristics, and training data is relatively scarce. By first letting AI complete the visual design in its strongest domain — HTML — and then using the finalized design as a reference for conversion to mini program code, the developer effectively decomposed a difficult problem ("from requirements to mini program UI") into two relatively simpler sub-problems: "from requirements to HTML UI" and "from HTML UI to mini program UI." This step-by-step strategy has universal methodological value in AI-assisted development.
The developer requested three different design styles and ultimately chose the "black and gold" style, making adjustments based on UI reference images provided by the friend.

Step 3: Goal Mode Fully Automated Development
This was the most critical phase of the entire process. The developer used Codex's Goal feature, setting the complete objective and letting AI run autonomously:
- Converting UI prototypes to mini program code
- Implementing all business features
- Integrating WeChat Pay
- Developing the admin dashboard
- Automated testing and bug fixing
The AI ran autonomously for approximately 7-8 hours, completing the following work:
- Implementing the basic UI based on prototypes (~1 hour)
- Discovering that the original design was missing several pages and automatically adding 28 core screens
- Implementing the complete membership system, event registration, payment, and other features
- Repeatedly taking screenshots to verify and fix bugs
Development Results and Lessons Learned
Final Mini Program Features

The final mini program implemented the following feature modules:
- Member profile management with phone number binding
- Membership tiers and benefits display
- Online events listing and registration
- WeChat Pay (verified with real successful payments)
- Admin event management dashboard
- Beta version publishing and sharing
Major Pain Points During Development
- Low UI conversion efficiency: When AI converted prototypes to mini program code, a significant amount of time was spent on screenshot verification and UI fine-tuning — this area likely needs dedicated Skills optimization
- Mock data issues: AI-implemented interfaces initially all used mock data, requiring additional instructions to switch to real data integration
- Cloud function deployment: MCP-based deployment failed; CLI deployment ultimately succeeded
- WeChat Pay authorization: Required separate authorization across the CloudBase console, WeChat Pay Merchant Assistant, and other platforms — a tedious process
- Login functionality: Repeatedly encountered issues, requiring multiple rounds of bug feedback to fix
AI Development Cost Analysis
- Time cost: Preparation (registration, verification, etc.) took several days; AI development ran for 7-8 hours
- Token consumption: Approximately 40% of a ChatGPT Pro weekly quota, equivalent to 5-6 Plus subscriptions' weekly quota
- Monetary cost: Far lower than outsourced development, but token costs are still not negligible
Tokens are the basic unit used by large language models to measure input and output text volume — roughly 1-1.5 tokens per English word, and about 1-2 tokens per Chinese character. In Goal Coding mode, AI needs to perform extensive autonomous reasoning, code generation, error analysis, and self-correction, with each interaction round consuming large amounts of tokens. The article mentions consuming 40% of a ChatGPT Pro (monthly fee $200) weekly quota, which by proportion estimates to approximately $26-30 in token consumption. While this cost may seem significant, compared to the outsourced development cost of a complete mini program with membership system, WeChat Pay, and admin dashboard (typically ¥20,000-50,000 RMB), AI development's cost advantage is orders of magnitude better. However, it's worth noting that as AI Agent runtime increases, token consumption doesn't grow linearly — context window accumulation, repeated screenshot verification, and bug-fix loops all accelerate token consumption. This is a key cost bottleneck that current Goal Coding mode needs to optimize.
Conclusion and Outlook: The Future of Autonomous AI Programming
This experiment proved several key points:
Goal Coding's feasibility has been initially validated. While AI still can't perfectly complete an entire development project in one go, the potential of autonomous AI programming is already very clear — it can take screenshots to verify, discover omissions, add features, and fix bugs on its own.
The WeChat Mini Program ecosystem is still not AI-development friendly. Compared to pure web development (where a single prompt can go from requirements to deployment), mini programs have too many steps requiring human intervention. This also means that whoever can first automate these steps will gain a tremendous efficiency advantage in mini program development.
AI development ROI is already evident. Even accounting for token costs and the parts requiring human intervention, for a complete mini program with payment functionality, an AI cost of a few hundred yuan compared to tens of thousands in outsourcing fees already represents outstanding value.
Related articles

DeepSWE Benchmark Deep Dive: Exposing SWE-Bench Flaws and the True Coding Ability Rankings
Deep dive into how DeepSWE exposes SWE-Bench Pro's data contamination and cheating issues. GPT-5.5 leads at 70%, open-source models lag far behind. Covers results, cost comparisons, and practical developer advice.

Guide to Building a Second Brain with Claude AI: The Four-C Framework for Your Personal AI Operating System
Learn how to build an AI second brain with Claude using the Four-C Framework (Context, Connection, Capability, Cadence) to create a personal AI operating system with practical examples.

Zero-Code Mini Program Development with Codex: Building 7 Features in 5 Days — A Hands-On Story
A creator used OpenAI Codex to build an image editing mini program with 7 features in 5 days — zero coding. Learn about Codex's AI capabilities and tips for getting started.