In late August 2026, a single, unassuming GitHub repository sat on top of the global trending chart — not from a Big Tech lab, not from a funded startup, but from one Chinese developer who had been quietly shipping almost every day since April. The repo is freestylefly/awesome-gpt-image-2, and it carries 26.2k stars, 2.6k forks, and a disarmingly simple pitch: Prompt as Code.
The author is Cang He (苍何), a former Alibaba programmer and Java tech lead at Ant Group. The headline that swept Chinese developer social media reads like a fable for the AI era: "一个前阿里程序员,把'提示词'写成了代码,登顶 GitHub 第一" — "A former Alibaba programmer turned 'prompts' into code and reached #1 on GitHub."
Here's the deeper story behind the project, what it actually gets right, and how you can steal the pattern for your own agents — including a practical way to plug it into NXagents today.
The timeline matters. When OpenAI shipped GPT-Image-2 in early 2026, the frontier of image generation shifted. Suddenly the interesting problem wasn't "can the model make a picture?" — it was "can it make the same picture, twice, on demand, with controllable layout and text?"
Cang He spent the next several months doing something most of us find too boring to sustain: he collected prompts. Not just saved them in a notes app — he reverse-engineered the structure out of them, organized them into categories and reusable templates, and pushed an update almost every day.
The result, according to his own post on Juejin (掘金), was surreal: a friend told him the repo had hit GitHub Trending #2, he posted about it, the post racked up ~600k impressions, the repo gained ~1,700 stars in a single day, and the next day it was #1.
His reflection is worth reading in full, but the core insight is this: "AI lowered the barrier to creation, but it didn't lower the barrier to persistence." The trending position was partly timing and luck — he's honest about that — but the reason there was something to trend at all is that he kept the table set for months.
The phrase is more than marketing. The project's stated goal is to compress prose-style prompts into structured protocols. Instead of a wall of natural language, each case is decomposed into composable parts:
This is the same mental model as writing good code: small, named, reusable pieces instead of one giant unreadable function. For one-off generations, prose is fine. But the moment you need batch generation, template systems, or production workflows, structure beats vibes. That's why the library leans hard into "workflow friendly — designed for agents, scripts, and automation systems."
The repo is organized into 13 categories, each with dozens of real cases pulled from community submissions:
There's also a live gallery at gpt-image2.canghe.ai where you can browse everything, open large previews, copy the full prompt with one click, filter by style or scenario, and even test generation after signing in.
The most important design decision is hiding in plain sight in the repo layout: there's a data/style-library.json, and both the website and the bundled agent skill read from that same single source of truth. One library, two consumers. That's the engineering discipline most prompt collections never bother with.
This is why the project doesn't feel like a pile of .txt files. It ships a real, installable agent skill (gpt-image-2-style-library) that plugs into Claude Code, Codex, and Cursor:
npx skills add freestylefly/awesome-gpt-image-2 \
--skill gpt-image-2-style-library \
--agent claude-code codex --global --yes --copy
There's also a Claude Code plugin marketplace route:
/plugin marketplace add freestylefly/awesome-gpt-image-2
/plugin install gpt-image-2-style-library@awesome-gpt-image-2
Once installed, an agent can be asked something like "Use gpt-image-2-style-library to create an infographic prompt about Codex" — and it will pull the correct style tags, template categories, and scene vocabulary from the library rather than hallucinating them. That's the "prompts as code" thesis made concrete: a machine-readable prompt protocol your agent can import.
The live site is more than a static gallery. It's a real product with auth, billing, and an async generation proxy:
It's also sponsor-supported (APIMart, hiapi, PackyCode, PPToken), which is a good reminder that an open-source prompt library can sustain itself once it's genuinely useful — the sponsors sell API relay and generation services that the library's users naturally want.
Here's where I get to the fun part for readers of the dev-workshop channel. The "Prompt as Code" pattern maps almost one-to-one onto how NXagents agents work, and you can have it running in an afternoon:
The repo's entire magic is that data/style-library.json is machine-readable. Clone it, or just fetch that one file, and turn it into an NXagents prompt-based skill:
skills/gpt-image2-style-library/SKILL.md
The SKILL.md becomes a lookup table: "when asked for a dashboard prompt, use category ui-interfaces, inject these layout tags, this palette, these text-rendering rules." NXagents picks up new skills automatically, so no deploy is needed — just write the file and wait ~30 seconds.
instant_media with structured promptsOnce the skill exists, every image call on the platform can follow the same atomic-schema discipline. Instead of freehand prompts, compose them:
[subject: a SaaS analytics dashboard] + [lighting: soft studio] + [material: glassmorphism, subtle grain] + [layout: 3-panel grid, clear hierarchy] + [detail: realistic axis labels]
NXagents' instant_media accepts a plain prompt, so you can paste the structured template straight in — you get the controllability of the library with the platform's generation backend.
The mistake most people make is duplicating prompts across tools. Follow Cang He's lead: maintain a single style-library.json (or a Markdown table) in your workspace, and have every skill, script, and agent read from it. When you improve a style, you improve it everywhere at once.
If you want to go further than a skill, the gallery concept itself — browse, filter, copy prompt — is a perfect fit for a small NXagents Bun or Alpine app. Supabase-style persistence can be swapped for the platform's SQLite, and the generation step can call whatever image API your agents already use. The repo's own stack is a fine blueprint to reverse-engineer.
Strip away the star count and there's a transferable lesson underneath:
.txt dump is noise. An atomic, composable, JSON-backed protocol is an asset other programs can consume.The #1 spot on GitHub Trending is already moving on to the next repo, as he freely admits. But the project is a clean demonstration that in the AI era, a single persistent developer can build something the whole world notices — and that "prompts" are no longer a throwaway input, but a real engineering artifact.
If you're building on NXagents, the cheapest high-leverage move today is to grab data/style-library.json from the repo and wire it into a skill. Your next generated image will be better for it — and that's the entire point.