一条提示词让 Claude、Codex 找出应用里的隐式状态机
写代码时状态散在各个变量里,AI 生成的逻辑经常漏掉状态转换,这是很多人踩过的坑。这条提示词丢给 Claude 或 Codex 就能跑,还会按风险排序,直接贴进终端试试,改动成本几乎为零。
博主 berryxia 分享了一条面向 AI 编程工具的提示词:"find all of the implicit state machines in my app"。把这条提示词丢给 Claude 或 Codex,就能让模型扫描代码库,找出没有显式声明的隐式状态机。
隐式状态机是 AI 编程 bug 的常见来源:状态散落在变量、回调或条件分支里,没有集中管理,模型生成代码时容易遗漏状态转换,导致死锁、重复渲染或逻辑跳变。这条提示词会按风险从高到低对找到的状态机排序,开发者可以优先处理高风险项。
这类提示词把调试从"报错后修 bug"提前到"主动审查架构",适合在使用 Claude Code、Codex 等 AI 编程助手的开发流程里作为固定检查步骤。
很吊的一个提示词,专注各种AI Coding Bugs,直接丢给你的Claude 、Codex就行。
Prompt:find all of the implicit state machines in my app
会按照高低风险依次排序~
This report is categorized under AITOP's "How-to" desk, focusing on China's AI industry and domestic foundation model ecosystem. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows. Key entities and technical topics under continuous tracking include 提示词工程, Claude, Codex, 编程助手.
Source attribution: curated from berryxia (@berryxia).