惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Troy Hunt's Blog
Blog — PlanetScale
Blog — PlanetScale
Engineering at Meta
Engineering at Meta
F
Full Disclosure
Recorded Future
Recorded Future
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
博客园_首页
博客园 - 叶小钗
MongoDB | Blog
MongoDB | Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
H
Hacker News: Front Page
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
博客园 - 司徒正美
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
Cloudbric
Cloudbric
PCI Perspectives
PCI Perspectives
有赞技术团队
有赞技术团队
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
TaoSecurity Blog
TaoSecurity Blog
L
Lohrmann on Cybersecurity
量子位
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tailwind CSS Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
B
Blog RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
大猫的无限游戏
大猫的无限游戏
P
Proofpoint News Feed
N
News and Events Feed by Topic
罗磊的独立博客
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
T
Tor Project blog
IT之家
IT之家
M
MIT News - Artificial intelligence
S
Security @ Cisco Blogs
O
OpenAI News
AI
AI
S
Securelist
Simon Willison's Weblog
Simon Willison's Weblog
The Last Watchdog
The Last Watchdog
月光博客
月光博客
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
After 8 Months with Codex CLI, Here Is My Advanced AI Coding Workflow
Mariner · 2026-06-23 · via DEV Community

Introduction

Hi, I’m Haijun, a Full-Stack Developer | AI Enthusiast | Indie Developer.

It has been a while since I last wrote an article.

I have been genuinely busy recently, mainly pushing forward AI projects inside the company. From requirement breakdown, solution design, frontend and backend development, to Agent workflows, RAG, API integration, and production debugging, I have basically been carrying many parts forward on my own. Fortunately, I have had a reliable teammate fighting alongside me: Codex.

Since last year, my feelings about AI tools have become stronger and stronger: things are changing incredibly fast.

Last year, we already felt that a major AI update every four or five months was pretty intense. Now it is different. Many capabilities are reshaped almost every one or two months. Models are changing, tools are changing, and the way we build software is changing as well.

In the past, we talked about whether AI could help us write code. Now the more practical question has become: can you turn AI into a stable, controllable, and reusable engineering workflow?

I have been exploring Codex CLI for about 8 months. During this time, I have used it to build quite a few projects and stepped into many traps.

Sometimes it is very smart. Sometimes it does strange things. Sometimes it is unbelievably efficient. But if you do not give it boundaries, it can also make things unnecessarily complicated.

So in this article, I want to share the advanced Codex CLI workflow I have summarized over the past 8 months. This is a practical AI coding productivity system that I have repeatedly used, adjusted, and stabilized in real projects.

A Fixed Engineering Workflow

Task context, AGENTS.md, configuration, MCP, Skills, and automation are the key paths to improving Codex stability.

Project rules go into AGENTS.md

Personal default configuration goes into ~/.codex/config.toml

Repeated tasks become Skills

External context is handled by MCP

Complex tasks should be planned before execution

Frontend tasks should use screenshots + Playwright feedback loops

Risky tasks should be controlled through review / diff / sandbox

Stable tasks can be automated with codex exec

Exploring the Capability Boundaries of Codex CLI

Local Code Agent Capabilities

Codex CLI is not just a tool for generating code snippets. It can read repositories, edit files, and run commands inside the directory you choose.

New feature development

Bug investigation

Frontend page implementation

Component refactoring

API integration

Test coverage

Code review

Documentation generation

Script automation

Project structure understanding

Technical debt analysis

The more vague, cross-module, or high-impact a task is, the more you should first let Codex plan, locate relevant files, and confirm boundaries before asking it to modify code.

Enter Plan mode first. Let Codex collect context, ask questions, and form a plan before implementation.

Understanding Images and Rebuilding Frontend Pages

Codex officially supports adding images to the initial prompt with -i or --image. You can attach one or more images. Multiple images can be separated by commas or passed repeatedly. Common formats such as PNG and JPEG are supported.

codex -i ./screenshots/home.png "Please analyze this frontend screenshot and implement the corresponding page in the current project."

The boundary here is important: images provide the visual target, but they do not replace engineering context.

If you only provide one screenshot, Codex can usually produce an approximate result. If you provide multiple page states and detailed screenshots, the reconstruction becomes much more stable.

A more efficient way to use it:

codex \
  --sandbox workspace-write \
  --ask-for-approval on-request \
  -i ./screenshots/home-desktop.png \
  -i ./screenshots/home-mobile.png \
  "Please implement the homepage in the current project based on these two screenshots.

First, read the project structure and confirm the routing, component directories, styling approach, design system, and existing page implementations.
Then analyze the layout, component hierarchy, spacing, typography, colors, and responsive rules in the screenshots.
During implementation, prioritize reusing existing components, tokens, Tailwind configuration, and project conventions. Do not create a separate visual style.
After completion, run lint, typecheck, and build.
Finally, explain: which files were changed, which parts were inferred from the screenshots, and which visual differences still need manual confirmation."

Playwright Visual Feedback Loop

We can combine Codex with Playwright, allowing it to open a real browser, compare the implementation with the reference image, and iterate on layout and behavior across different screen sizes.

A complete and efficient workflow looks like this:

Reference image → Implement page → Start local server → Open browser → Compare screenshots → Fix → Check again

The prompt can be written like this:

codex -i ./references/home.png "
Please implement the page shown in this reference image and use Playwright for visual verification.

Requirements:
1. First confirm how to start the local development server for this project.
2. After implementing the page, start the service.
3. Use Playwright to open the page and take a screenshot.
4. Compare the reference image with the current screenshot and fix obvious differences.
5. Check at least two breakpoints: desktop and mobile.
6. Finally, output the difference summary and verification result.
"

My Practical Workflow

Screenshot-to-Page Workflow

Do not let it start coding immediately. First, ask Codex to analyze the image elements.

codex -i ./screenshots/home.png "
Do not modify code yet.
Please analyze this screenshot and combine it with the current project structure. Output:
1. Page structure
2. Component breakdown
3. Mapping to the existing styling system
4. Components that should be added or reused
5. Screenshot details that may be unclear
6. Implementation plan
"

Then let it implement the plan:

codex resume --last "
Implement the page according to the previous plan.
Make small incremental changes and prioritize reusing existing components.
After completion, run lint, typecheck, and build.
If there are visual differences, explain the reason.
"

Automatically Comparing the Current Result with the Target Image and Fixing Differences

You can first let Codex implement a version based on the image, then use the following prompt to let it automatically compare and fix the differences.

codex resume --last \
  -i ./references/target.png \
  -i ./screenshots/current.png \
  "The first image is the target design. The second image is the current implementation.
Please compare the differences and only fix visual issues. Do not refactor unrelated code.

Focus on:
1. Overall page proportions
2. Top spacing
3. Title font size and weight
4. Card border radius, shadow, and border
5. Button size and position
6. Mobile breakpoint
7. Whether there is horizontal overflow

After completion, run the checks and output the changes made."

Bug Investigation Workflow

This step is very important. If it is not handled properly, the whole system can become messy, and the more you change, the more chaotic it gets.

We can provide the error logs and the affected scope. The clearer the context, the more stable Codex’s understanding and modifications will be. Once there is a defined scope, it is less likely to make random changes.

The Codex logs are in History.log.

Please investigate and fix this issue based on the logs.

Working method:

1. Do not modify code first.

2. Find potentially related pages, components, state management, API requests, and style files.

3. Explain the 2-3 most likely causes.

4. If the project can be run, try to reproduce the issue.

5. After confirming the root cause, make the smallest possible change.

6. Run relevant checks after the change.

7. Finally, explain the root cause, changed files, and verification method.

Large Refactoring Workflow

Especially when modifying legacy projects, never let AI directly rewrite everything. Legacy projects are already complex enough, and AI also needs time to understand them.

I usually split the work into four layers. This is much more stable.

Understand the current state -----> Identify risks -----> Create migration plan -----> Execute in batches

The prompt can be written like this:

codex "
I am preparing to refactor the component structure of the current project. Do not modify code yet.

Please output:
1. Current component directory structure and main responsibilities
2. Duplicate code and possible abstraction points
3. High-risk files
4. Recommended target directory structure
5. Phased migration plan
6. Verification method for each phase
7. Areas that should not be changed right now
"

Self-Review Workflow

Codex CLI has /review, which can review the workspace, a commit, or a branch-based diff. According to the official description, it reads the diff as an independent reviewer and outputs prioritized, actionable issues without modifying the working tree.

You can also use your own custom review standard, or use Codex review.

My prompt looks like this:

codex "
Please review the current uncommitted changes.
Focus on:
1. Whether there are behavioral regressions
2. Whether there are type risks
3. Whether responsive behavior is broken
4. Whether unrelated files were modified
5. Whether there are maintainability issues
6. Whether necessary tests are missing

Only output high-risk issues and suggested fixes. Do not modify code.
"

MCP-Enhanced Workflow

We can use external MCP servers to extend Codex’s capabilities.

For example, if we want to implement designs from design files, we can use Figma MCP. If we want to develop based on the latest documentation, we can use Context7 MCP.

Installation and usage are also simple:

codex mcp add context7 -- npx -y @upstash/context7-mcp

Skills Workflow

For prompts that we use frequently, we can extract them into Skills.

In real development, you can directly use these Skills and only provide the variable parts. Codex can then develop based on the workflow you previously extracted.

Skills can be divided into system-level and project-level Skills.

If a Skill is general-purpose, you can put it globally. If it is only frequently used in the current project, you can package it as a Skill and place it inside .agents/skills in your project.

When using Codex, it can recognize your intent and call the corresponding Skill. You can also explicitly tell it which Skill to use.

For example:

codex "
Use the haijun skill to implement this page.
"

Final Thoughts

I want to share one real feeling.

Many people feel that using AI to write code is unstable. The problem is not necessarily the tool itself. The problem may be that we are still using it as if we are simply “submitting requirements,” instead of managing it the way we would manage a teammate.

If you do not provide project background, it can only guess.

If you do not provide boundaries, it may modify things randomly.

If you do not provide verification standards, it does not know what “done” means.

If you do not make the final judgment yourself, it may hand you a solution that seems runnable but is not actually reliable.

The upper limit of AI depends on the professional ability and cognitive ability of the person using it.

I used Cursor for a long time before. Later, I also used Claude Code for a while. Claude Code is indeed very powerful. In many cases, it is impressive. But for users in China, the restrictions are quite obvious, and the stability and long-term sustainability of using it were not ideal for me.

Later, I gradually switched to Codex CLI. I have now used it for more than half a year. I can even say that it has become one of the most important collaboration tools in my daily development work.

Over the past few months, it has helped me complete many things: writing pages, modifying components, investigating bugs, refactoring projects, organizing architecture, designing Agent tools, optimizing RAG pipelines, generating documentation, and performing pre-launch checks.

It is not just helping me “write code.” It is more like helping me reorganize many parts of the development process.

But the premise is: you need to give it a workflow.

So I am becoming more and more certain about one thing:

In the future, the real gap will not come from who knows how to use a specific AI tool. It will come from who can turn AI tools into their own engineering system, content system, business system, and even a personal capability amplifier.