agentleFS
zhaji2333zhaji2333/CkSKILLS/.agents/skills/web-logic-race/SKILL.md

web-logic-race

Skill155 starsChanged 12 days agoMITView on GitHub

业务逻辑与并发竞态专项。当出现支付/下单/退款/提现/优惠券/积分/库存/审批/会员/抽奖/邀请等业务功能,或状态可跳变、金额参数可控、可重放时调用。

The file

Files
SKILL.md

web-logic-race — 业务逻辑与并发竞态专项

何时调用

  • 支付/下单/退款/提现
  • 优惠券/积分/红包/会员/订阅
  • 库存/秒杀/抽奖/邀请
  • 审批/工单/状态流
  • 并发/重放/幂等

30 秒分诊

  1. 先建业务状态机与角色矩阵(谁能做什么、状态怎么流)
  2. 列金额/数量/状态/时间/身份 五类可控参数
  3. 单次逻辑:改金额/数量/状态/身份
  4. 并发:同一资源两请求同时发,看是否破坏不变量

首枪顺序

  • 下单只传 product_id:服务端不校验应付金额 → 直接买
  • 数量/价格负数、小数、0 元、超大数、精度截断
  • 优惠券:重复领取/叠加/复用/并发
  • 退款/提现:金额可改、负数、并发多退
  • 订单状态跳变:未支付→已支付(改状态参/伪造回调)
  • 并发抢最后一件/最后一张券(竞态)
  • 审批越级/改审批人 id/跳过节点
  • 邀请拉新:自邀/批量注册/改邀请人
  • 导出/批量接口:改分页大小/换他人 id

知识库索引(按需开小块,禁通读)

文件用途大小
knowledge/business-logic-race-01-一、业务逻辑建模-先理解再测试.md业务建模1.0KB
knowledge/business-logic-race-03-三、业务逻辑漏洞攻击套路.md攻击套路0.6KB
knowledge/business-logic-race-04-四、并发与竞态专项.md并发竞态0.8KB
knowledge/logic-test.md真实 SRC 逻辑战法6.5KB
knowledge/race-condition-test.md竞态实战大全0.7KB
knowledge/business-logic-race-02-二、支付-资金类场景表-全景.md资金场景表0.9KB

其余 6 个知识块(按标题搜,禁止通读):ls knowledge/;原始清单见 ../../../docs/MIGRATION.md。

相关

  • web-auth-access / web-api-protocol

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.