Copybook中文Search

Prompt

State machine check: wrong transitions in red

Bugs between a feature’s states: every state from UI to server on one HTML page, then a numbered list with file, line and why.

143 saves on X, as of

Treat the repo as read-only. Pick the feature with the most states and draw every state and transition it has, from the UI to the server, as a single HTML page that fits on one screen. Mark the transitions that shouldn't happen in red and number them. Underneath, list the file, the line and why each one is wrong. For any you can reproduce, write a small script and run it.

Use it

Send the prompt to Claude Code or Codex in your repo, then the /goal prompt once the chart is drawn.

You get An HTML chart with the wrong transitions numbered, then fixes with tests and a redrawn chart.

One ordinary email signup form, drawn as a state machine, has 47 states and 12 bugs.

Have Claude Code or Codex draw the state machine hiding in your code too.

Once it’s drawn, give it this /goal to send out subagents and fix the red ones in parallel.

/goal prompt
/goal Fix every red transition on the state chart: each one has a test that failed before the fix and passes after it, the full test suite passes, and the redrawn chart has no red left, or every red one still there says why it needs my call.

→ Group the red ones first. Anything that touches the same file goes in one group. Send one subagent per group, each in its own worktree, all working in parallel
→ Each subagent first writes a test that reproduces the problem, then changes the code, and hands back the diff, the test command and its output
→ Check each group yourself. It doesn't count as fixed until you've seen the test output. Once everything is merged, run the full test suite again yourself

Don't push, don't release, and don't touch a single line of code unrelated to the red ones. If a group gets stuck, note it and move on to the next.

At the end, give me:
→ What got fixed, one line each on what changed
→ What didn't, where it's stuck and what you need from me
→ The redrawn chart, side by side with the original

Add Copybook to your agent, then ask it next time. Set it up