The user is a product manager, and you are the tech-savvy partner. Frontend design answers "what the user sees and what happens when they click"; this skill answers "what happens behind the scenes and what to do when something unexpected occurs." The output is abackend logic package: a numbered, status-tagged rule table (the traceability key for development, PRD, testing, and review) + when complete, a one-page reader version for the user + a review archive.
Meta-principles
- Every rule carries a case. Rules go to the machine, cases go to the people. A rule without a case is incomprehensible to the user, and review can't catch ambiguity either (the user's own words: "Put cases with the rules too, otherwise reading them is a pain").
- All new multiple-choice questions carry a "timeline-style" case. First tell the concrete story (who, when, did what), then use a table to list "what happens / what you see / the cost" under each option, and finally give a recommendation with a one-line reason (the user's own words: "Without a case, I don't even know what you're trying to do").
- Group things shown to the user by "questions the user will ask," not by system structure. Each card has only one question, one answer, and a short string of small examples; long tables go into the appendix (the user's own words: "It's really tiring to read").
- Don't ask again about what the user personally settled; what hasn't been signed off can't be treated as settled; what AI can decide, don't ask. The user's own words or a signed-off design → inherit; written in a plan / proposal, or decided by AI itself in a previous round → "you haven't signed off on this," and it must be shown to the user; technical details are decided by AI with a one-line notification—but once a technical change alters something the user can perceive (defaults, storage location, retention, wait time, swapping something real for something fake), it turns into a question to ask (user 10-06: "If it needs human confirmation, go get human confirmation").
- Build a clickable simulator for the most convoluted piece of logic. The simulator can also expose your misunderstandings of the user's decisions (in the origin story of this skill, the user discovered on the simulator that "at most 3" had been understood as "normally only dispatch 1").
- Prefer real examples. Use the user's actual local names and accidents that actually happened; when a new feature has no real events, you may construct them, but mark them "constructed."
- Don't overturn what the user has already settled. When a reviewer's suggestion conflicts with an already-settled decision, lay it out, explain the cost clearly, keep it by default, and ask whether they want to change it.
- Numbers are stable and map both ways. Rules use
后-NN; once shown to the user they are not reordered, and voided ones are marked void and not reused. Each rule states which "user touchpoint" it lands on: when there is a UI, it's the frontend state number (A1, C7, F12); when there is no UI, it'sT1…(a column on the acceptance page, a message sent when paused, command-line output); if there really is no touchpoint, write "none: reason." Every frontend state must also be traceable to the rule behind it. - Read the code facts first, then write the rules. Where you write about existing implementation, mark the file and line number in the appendix; for new features, state "no existing code" and don't fabricate evidence. Facts are tagged in three ways: current state / target / to be verified.
First decide: whether to use it, and how deep to go
| Tier | When | Which steps to do | Output |
|---|---|---|---|
| Full package | There are still undecided, user-perceivable rules,andit involves any of the following: cross-module data ownership, rules affecting each other, sync / scheduling, upgrade migration, error degradation, multi-step file writing | Do all of steps 0–6 | Rules md + reader edition HTML (cards, simulator) + business question page + boundary review archived |
| Rules table only | Rules are clear, with only a small number of mutually independent changes (such as "when to rewrite a certain file") | Steps 0 and 1; if there are new multiple-choice questions, or rules that need to be looked over (proposed, newly added user-perceivable rules), do step 2; boundary review is merged into the pre-start check of the development process |
Rules md (build.py just don't put cards.json in) |
| Skip | Technical fixes where user-perceivable behavior does not change (splitting code, speeding things up but with the same result) | — | None; high-risk technical issues go through the development process's review as usual |
The judgment looks at "whether there are undecided business rules, whether the rules affect each other, and the consequences of errors",not at the amount of code, andonly looks at the parts newly added or changed by this change—migration and degradation branches that have long existed in the feature don't count. When unsure, first do it as "rules table only", and if during writing you find the rules are entangled with each other, then upgrade the tier and tell the user. If the project convention is "design-related matters must first ask the user which process to follow", follow the project convention.
- The business is all decided, but there is high-risk multi-step writing / crash recovery: follow "rules table only", but the step table and boundary review must be done, and when needed you can add a simulator for yourself and reviewers to use.
- When doing rules table only, where to put the questions and review: New multiple-choice questions—write a separate
业务题.md; in the dev simplified version, merge into the "Rules" section of1-plan.md(the test checklist directly references后-NN, don't write the same thing twice); in the dev formal version, merge into business confirmation. Boundary review—when standalone, ask another vendor yourself; in the dev process, submit it for review together with the pre-start check.
Confirm division of labor
| Output | User confirmation | Another vendor's model verification | AI decides on its own |
|---|---|---|---|
| New multiple-choice questions | Required: user chooses | When there are many questions that affect each other, check for gaps and ask | Write cases, options, recommendations |
Decisions already made and unchanged (status inherited: the user's original words or a design that has been signed off) |
No longer ask | Check whether the retelling has been distorted | Organize, write out the source |
Written in the plan but you never approved it (status proposed) |
Needs review: view together with the reader edition or business confirmation | Check whether anything that changes what you can perceive is hidden | Mark the source, don't treat as decided |
| Newly added, user-perceivable rules | Required: view together with the reader edition or business confirmation | Check the whole package together | Draft |
Technical rules (status ai): implement the protections for the semantics already decided (atomic writes, locks, validation, idempotency) |
No need | High-risk, cross-module checks | Yes, a one-line notice |
| The technical change alters something you can perceive (defaults, storage location, retention, spending money, authorization, data deletion/retention, extra waiting, replacing something real with something fake) | Yes: turn it into a multiple-choice question | Check | Write cases and recommendations |
| Simulator | Only look at the demo results | Check when the logic is complex | Implement, and verify with the listed inputs / expectations |
| Layout, generated files, numbering format | No need | No need (a waste) | Programmatic check(build.py) |
| Substantive changes after review | Required when behavior or scope has changed | The original reviewer re-reviews the affected rules | Technical fixes; typos are not re-reviewed |
Multi-model checks not worth the effort: reviewing each different format of the same rules separately, having a third party review the second party's comments item by item, reviewing each example separately, checking numbering and empty fields.
Two ways to use it
- Use it standalone: this skill produces the business question page itself and asks another model to review it itself, with the output placed in the
<主题>-后端逻辑/folder. - Use it in the official version of dev-workflow(when orchestrating an already-started task): this skill only deliversthe rules md, the multiple-choice questions to be asked and the rules to be looked over, and the mapping between rules ↔ frontend state;does not separately openconfirmation and review—these are merged into the official version's "business confirmation", where the root orchestrator asks the user uniformly, and boundary review follows the official version's existing review route. The outputis not placed into the frontend design finalization package(the plugin registration finalization package only recognizes the frontend file types), but goes into a separate folder, registered by the root orchestrator as a requirements source.
Workflow
Step 0: Start only when the inputs are complete
- Features with a UI: finalize the frontend first (if not finalized, use page-solution-design first).
- Listalready-decided decisions, and before inheriting, check the source: the user's own words, or a design package the user has signed off on (including the "AI-filled" items in it) →
inherited, write the source, and do not ask again; things written only in a plan / proposal / discussion draft, or decided by the AI itself in the previous round →proposed, write the material's location, and have the user look it over. - Read the code facts. Mark anything unreadable as "to be checked", and split it into two kinds:those affecting the solution(feasibility, authorization, data retention, behavior on failure) must be clarified before encapsulation;those affecting only the implementation locationcan be left to development and written into the handoff.
Step 1: Draft the rules table (the AI does this itself, without showing the user first)
- Write item by item according to the seven blocks (see the table below), each item:
后-NN+ one sentence of rules + one case (chained to the result with →) + user touchpoint + status (new choice, new user-perceivable rule →pending; anything in the solution not yet decided →proposed; Technical rules for implementing the settled semantics →ai; Inheritance →inherited). For blocks with no rules, write the reason for "not applicable". For the writing style, seereferences/规则写法.md。 - User touchpoints: when there is a UI, use frontend state numbers, and write the full set of frontend states into
frontStates; every state must be attached to a rule—existing behavior attaches to the inherited rule,only those that are truly pure display / pure layout / pure interactionare written intofrontOnly, and write the specific reason (you cannot dismiss it with a single sentence like "same as the previous version"); when there is no UI, first list 3–5 candidate touchpoints (terminal output, a certain column on the acceptance page, the message sent when stopping, a certain file),have him confirm them along with the materials given to the user for the first time。 - Multi-step write operations(moving files, writing A first then B, backing up first then deleting) must have a step table written in the rule's
steps: for each step "from which version / before doing it / after doing it / how to verify / how to recognize if it breaks here / how to roll back or continue"; also cross-checkthe recovery path against every exception(for example, when deleting a database, the exception of only putting back the original—was it inherited during recovery). - Time-related rules(caching, refreshing, timeouts, day boundaries) in
timelinewrite the timeline; write one line for each timer there is, and make clear who reaches the point first and what to do after reaching the point (see the rule writing style for a template). rules.jsonis the editing source (to change a rule, change only it); the rule md and the reader version are both generated from it, and the md is for tracing after freezing and is not to be edited by hand.
| Block | What it answers | Common things to define |
|---|---|---|
| ① Data and owners | How many copies of data there are, who writes and who reads | One owner per copy of data; whether what is external is a "computed result"; whether it can be edited by hand; credentials and private paths must not leak |
| ② Loading | What is read when opening | Whether each reads its own or they are serialized; which copy being broken affects only which part; whether one bad file / slow query can drag down the whole thing; whether anything is written when opening |
| ③ Saving | Where each operation writes | How two-step writes are kept consistent; fallback on failure; repeated clicks, multiple windows, multiple processes; step table for multi-step writes |
| ④ Default values and upgrades | What is used if it has never been set, and how it changes after an upgrade | One authoritative copy of default values; how to distinguish changed from unchanged; the scope of restoring defaults |
| ⑤ Execution | How the core rule is computed | Selecting, sorting, counting, upper limits, what happens when there is not enough, mid-course changes, whether the count is reset by changing people or upgrading |
| ⑥ When problems occur | What the user sees and what the system does under each kind of surprise | Continue or stop; what to tell the user when stopping; whether it really stopped after the timeout; where traces are left afterward |
| ⑦ Migration | How the current things transition | What to delete and what to keep; old tasks still running; rollback; which protocols / configurations / documents are changed accordingly |
Step 2: What the user should see, show him first
- Give all three together (see template at
references/业务题模板.md):New multiple-choice question(pendingfor cases where both results are reasonable, write according to Meta-principle 2),Review checklist(proposedand newly added user-perceivable rules, each in one sentence + one example, the user replies "right / wrong, change it to …"), when there is no interface, thecandidate touchpoint table. If the user answers "I don't understand": switch to a story closer to his daily life, without lengthening the explanation. - Write back: for rules the user approves, change status to
confirmed,sourcewrite the original words and date,confirmedTextcopy down the version of the body text he approved; afterward, if the body text changes by even one character,build.pywill require re-confirmation. For what the user says is "wrong", revise it according to his words and then review it once more. - Where to put it: the complete file is merged into the reader version; when only the rules table is produced, write it separately using
业务题.md, the dev brief version is merged into1-plan.md; the dev formal version is handed to the root orchestration and merged into the business confirmation page, with no separate page produced.
Step 3: Reader version (complete file)
cards.jsonGroup by 4–5 user questions, each card attached to its corresponding rule number (rules); small examples useok:/stop:/todo:to mark the result;python3 scripts/build.py <目录>generate HTML and md. Also, when there ispending/proposedadd--draft, and these cards will be marked red ("waiting for you to decide", "you never signed off").- Selection / allocation / counting / time-type logic gets a simulator, and one page can have multiple (one
simfor how to write it, seereferences/模拟器写法.md。 - The generated md contains a "card reconciliation table": check line by line whether the card's one sentence and the rule it is attached to say the same thing——a card must not claim more than the rule(for example, if the rule allows brief inconsistency after power loss, the card must not say "always consistent").
- Self-check by browser screenshot; no horizontal scrolling at phone width.
Step 4: Boundary review (another vendor's model, read-only)
- If Claude wrote it, ask Codex, and vice versa (opening multiple subagents under the same vendor counts only as multiple scenarios, not multiple models). Send it: the list of settled decisions (stating clearly that they may not be overturned), the rules JSON, the frontend state list, and the code paths; have it go through them category by category according to
references/边界清单.md, and output P0 / P1 / P2 + "business questions for the user to decide". - AI first verifies against the source code, then sorts into three categories:what needs you to decide(ask the user using the Step 2 method),what AI fills in(one-sentence list, written into the rules),what is left for development time(written into the handover).
- Closing condition: every P0 and P1 item has a handling conclusion (which rule was changed / why it was not changed) and evidence; for those that changed rule behavior,the original reviewer rechecks the affected rules and adjacent boundaries——adjacent boundaries = the rules in its
related, rules on the same user touchpoint, and rules one step before and after on the same chain; typos and layout are not re-reviewed. Technical issues are not pushed to the user for adjudication. build.pyPassing only means the structure is complete (numbering, references, status, touchpoints, seven blocks), not that the semantics are correct or the boundaries are complete.
Step 5: Discovering that the frontend needs changes (reflow)
If during backend discussion a new state, new interaction, or new copy is discovered: list the impact according to references/回流模板.md (which rules, which frontend states / flows / copy, before-and-after differences, candidate copy) → hand back to frontend design for revision → the useronly needs to focus on the changed parts, but the plugin's sign-off is bound to the entire final package, so frontend design / root orchestration puts theentire new version packageRe-register, sign off → then update the rules (the relevant rules remain before sign-off pending, touchpoints are written as "candidate: W16" and the like, and only drafts are allowed; after sign-off, switch to the formal status number). In the dev formal version, after the new version is signed off, the affected requirement alignment and business confirmation must also be redone according to the plugin's design handoff rules, driven forward by the root orchestration. **Do not directly modify the already-signed-off frontend finalization package.** When there is no interface change, do not touch the frontend package.
Step 6: Packaging
- Packaging conditions: no
pending/proposed(build.pydo not add--draftcan pass); Step 4 is closed-loop; Step 5's reflow has been signed off; the "to be checked" items affecting the plan have been checked; the card reconciliation of the complete file has been verified. - Output goes to
<主题>-后端逻辑/:后端规则-<主题>.md(master copy) + the complete file's后端逻辑-<主题>.html+ README. It sits alongside the frontend finalization package, not inside it. - Process artifacts (business question pages, review originals, old versions) go to
_review/。 - The handoff notes should clearly state: what the user decided (with sources), the pitfalls pointed out by review, and the "to be checked" items left for development.
Templates and tools
- Template:
examples/审核配置/(CodePal review scheduling decoupling, 2026-10-05/06) —rules.json52 items,cards.json23 cards,sim-挑模型.html;python3 scripts/build.py examples/审核配置generated. The sample directory contains rules, cards, the simulator, and generated results, and the generation script can be run in a copy. scripts/build.py: structural checks (numbering and type, the seven blocks have rules or reasons for not being applicable, empty fields, cases have results, status and source, the body's "you need to decide" is consistent with the status, all references, touchpoints are bidirectional, frontend status reverse coverage, cards are attached to rules, the simulator is a file in the data directory and element ids do not collide, finalization must not leave anything pending / undecided), all generated in memory and then written to disk together; output the rules md (including the step table, timeline, card reconciliation, technical details) and the reader version. If there is no cards.json, output only the rules table.references/: rule-writing style, boundary checklist, simulator-writing style, reflow template, business question template.
User signal → action
| The user says | Meaning | Action |
|---|---|---|
| Didn't understand / doesn't know what you're trying to do | The case is not specific enough or there is no case | Retell it with a story from his daily life, and change the options into a "what happens / what you see / cost" table |
| Tiring to read / hard to follow | A long table was laid out according to the system structure | Change it into cards grouped by user question, put technical rules in the appendix, and make the most convoluted part into a simulator |
| This isn't right, is it (pointing at the simulator or a case) | Your understanding of one of his decisions is off | Do not argue; turn the two understandings into a multiple-choice question with examples for him to choose, and after revising, sync the rules, cards, and simulator (for anything involving the interface, follow Step 5's reflow) |
| Are there any missed boundaries | Needs another review | Step 4 |
| Everything is fine / confirmation is done | Can be sealed | Check Step 6's packaging conditions, then seal |
Self-check before delivery
- The tier judgment states the reason; when only the rules table is output, no extra cards or simulator are made
- All seven blocks have been gone through, and those not applicable have "not applicable" written
- Each rule has a number, case, touchpoint, and status; user-decided / inherited / undecided items have sources; constructed examples are marked "constructed"
- Every inherited item was verified against its source as either the user's original words or a signed-off design; items that exist only in the proposal are marked
proposed - Technical changes that alter anything the user can perceive have all been converted into issues
- Multi-step write operations have a step table; time-related rules are written as a timeline
- New multiple-choice questions all include timeline cases and recommendations; answers have been written back and changed to
confirmed - Every frontend state (or touchpoint) can be traced to a rule; every rule specifies its touchpoint
-
build.pyDo not add--draftcan pass; the full-version card reconciliation table has been checked line by line - The simulator has been run with the listed inputs / expectations, and the results match the rules
- Reviewed by another model; P0 / P1 have conclusions and evidence; substantive changes have been re-reviewed by the original reviewer
- The "to be investigated" items affecting the proposal have been clarified; the rest are written into the handover
- Contains no credentials; local paths do not go into external materials