wfgy-method

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

WFGY method

WFGY方法

WFGY (Wan Fa Gui Yi, "all methods return to one") is a reasoning-drift-control technique from
onestardao/WFGY
. This skill ports its genuinely portable behavioral core to a text-generating agent's own multi-step work. It does not reproduce the original project's TXT-OS prompt file, its hardcoded demo-benchmark output, or its user-skepticism-deflection script -- see
references/honesty-and-provenance.md
for exactly what was kept, what was dropped, and why.
The original names four "Big Bang" modules (BBMC, BBPF, BBCR, BBAM) plus a numeric drift score, deltaS = 1 - cos(I, G) (I = current state, G = goal/anchor), and a trend classifier over consecutive deltaS values (convergent/recursive/divergent/chaotic). All of this is ported below. Where the original relies on real computation this skill cannot perform (real embeddings for deltaS, real attention-weight statistics for BBAM), the instruction explicitly hands that judgment to you, the calling agent, to make in plain language instead -- see
references/wfgy-core-mechanism.md
for the full technical basis of every claim in this file, and
references/honesty-and-provenance.md
for exactly what was reframed and why.
On deltaS: absent a real embedding call, any numeric deltaS you produce is your own qualitative estimate, not a measurement. Use the label ("deltaS is climbing," "deltaS looks high here") as shorthand for "this step is drifting from the stated goal" -- never present a specific decimal (e.g. "deltaS = 0.42") as if it were computed, because it is not, unless real embeddings are actually available (see below).
If a gm-plugkit spool is running in this project (check
.gm/exec-spool/.status.json
) AND its build serves a
similarity
verb
, you can get a real deltaS instead of a self-estimate: dispatch
{"text_a": "<G>", "text_b": "<current state>"}
and read back
{"similarity", "distance"}
--
distance
is a genuine
1 - cos(I, G)
from real BGE-small-en-v1.5 embeddings. Do NOT assume the verb exists just because a spool is running: not every build serves it, and an unrecognized verb is silently left queued with no response rather than erroring, so a missing response after a normal read cycle means the verb is NOT available -- treat that exactly like no spool. When you get a real distance back, use it as deltaS and say so explicitly ("deltaS = 0.31, computed"). Otherwise fall back to the qualitative label above and say so explicitly too ("deltaS looks high here, my own estimate, no embedding tool available"). Never let the reader assume one when you did the other.
WFGY(万法归一,英文意为“all methods return to one”)是源自
onestardao/WFGY
的一种推理漂移控制技术。本技能将其真正具备可移植性的行为核心适配到文本生成Agent的多步骤工作中。注意:本技能并未复刻原项目的TXT-OS提示文件、硬编码的演示基准输出或用户质疑应对脚本——具体保留、舍弃的内容及原因请参阅
references/honesty-and-provenance.md
原项目定义了四个“大爆炸”模块(BBMC、BBPF、BBCR、BBAM),以及一个数值漂移分数deltaS = 1 - cos(I, G)(I=当前状态,G=目标/锚点),还有基于连续deltaS值的趋势分类器(收敛型/递归型/发散型/混沌型)。所有这些内容都已适配到本技能中。对于原项目依赖但本技能无法执行的真实计算(如用于deltaS的真实嵌入、用于BBAM的真实注意力权重统计),本技能会明确将判断权交给调用它的Agent,以自然语言形式完成判断——本文件中所有声明的完整技术依据请参阅
references/wfgy-core-mechanism.md
,具体重构内容及原因请参阅
references/honesty-and-provenance.md
关于deltaS:在没有真实嵌入调用的情况下,你给出的任何数值deltaS都是定性估算,而非测量值。请使用描述性标签(如“deltaS正在上升”“此处deltaS看起来很高”)作为“当前步骤偏离既定目标”的简写——切勿给出具体小数(如“deltaS = 0.42”)并假装是计算得出的结果,除非确实有真实嵌入可用(见下文)。
如果当前项目中运行着gm-plugkit spool(检查
.gm/exec-spool/.status.json
且其构建提供
similarity
动词
,你可以获取真实的deltaS而非自行估算:发送
{"text_a": "<G>", "text_b": "<current state>"}
并读取返回的
{"similarity", "distance"}
——
distance
是基于真实BGE-small-en-v1.5嵌入计算出的
1 - cos(I, G)
值。不要仅因为spool在运行就假设该动词存在:并非所有构建都会提供此动词,未识别的动词会被静默加入队列而不会返回错误,因此正常读取周期后无响应意味着该动词不可用——这种情况应视为无spool运行。当你获取到真实distance值时,将其作为deltaS并明确说明(如“deltaS = 0.31,计算得出”)。否则请使用上述定性标签并明确说明(如“此处deltaS看起来很高,为本人估算,无嵌入工具可用”)。切勿让读者混淆两种情况。

G - the anchor (BBMC pattern: compare state against goal)

G - 锚点(BBMC模式:将状态与目标对比)

At the start of any task this skill applies to, write one sentence stating the actual goal (G) -- not the first sub-task, the actual end state the user wants. Re-read it before any step that could plausibly have drifted: a long tool-call chain, a pivot in approach, a request to "also" do something adjacent.
  • Stated G in one sentence before starting.
  • Before each major step, ask: does what I'm about to do still serve G, or have I started solving a different, adjacent problem?
  • If drift is real (not just "this step looks different from the last one" -- actual scope change, contradicted earlier decision, answering a different question than asked), say so explicitly and re-anchor before continuing.
Gotcha: the temptation is to silently keep going once you notice drift, because stopping to say "wait, I've drifted" feels like an interruption. Don't suppress it -- a silently-corrected drift is invisible to the user and looks like it never happened; a stated one is a real signal they can act on.
在应用本技能的任何任务开始时,用一句话明确实际目标(G)——不是第一个子任务,而是用户期望的最终状态。在任何可能出现漂移的步骤前重新阅读该目标:比如长工具调用链、方法转向、要求“同时”处理相关任务时。
  • 开始前用一句话明确G。
  • 在每个主要步骤前自问:我即将执行的操作是否仍服务于G,还是已经开始解决另一个相关但不同的问题?
  • 如果确实出现漂移(并非“此步骤与上一步不同”,而是实际范围变更、违背之前的决策、回答了与问题无关的内容),请明确说明并重新锚定目标后再继续。
注意:一旦发现漂移,人们往往会忍不住继续静默执行,因为停下来说明“我偏离了目标”感觉像是打断流程。请不要压制这种行为——静默修正的漂移对用户不可见,仿佛从未发生;而明确说明的漂移是用户可以采取行动的真实信号。

BBPF pattern - consider more than one path before committing

BBPF模式——提交前考虑多种路径

Applies to decisions with real alternatives, not every trivial step. The original's gate condition (a candidate path proceeds only if it measurably reduces deltaS and stays within a stability bound) translates to: when a decision is ambiguous or high-stakes, generate more than one real candidate approach, then commit to whichever one most clearly and verifiably advances G -- not the first idea, not the most familiar one.
  • Is this decision ambiguous or high-stakes enough to warrant comparing options? (Most steps are not -- do not apply this to routine, unambiguous work.)
  • If yes: name at least two real candidate approaches before picking one.
  • State which one you picked and why it advances G more clearly than the alternative(s).
  • If no candidate is clearly better, that is itself a signal worth surfacing to the user rather than picking arbitrarily and moving on.
适用于存在真实备选方案的决策,而非每一个琐碎步骤。原项目的准入条件(候选路径仅在可测量地降低deltaS且保持在稳定范围内时才会推进)转化为:当决策模糊或高风险时,生成至少两种真实候选方案,然后选择最能明确、可验证地推进G的方案——不是第一个想到的,也不是最熟悉的。
  • 该决策是否足够模糊或高风险,值得对比备选方案?(大多数步骤不需要——请勿将此模式应用于常规、明确的工作。)
  • 如果是:在选择前至少列出两种真实候选方案。
  • 说明你选择的方案,以及它比其他方案更能明确推进G的原因。
  • 如果没有明显更优的候选方案,这本身就是值得向用户反馈的信号,而非随意选择一个方案继续推进。

BBCR pattern - checkpoint, bounded retry, then surface rather than confabulate

BBCR模式——检查点、有限重试,而非编造内容

The original's collapse-and-retry loop resets to a last-known-good state on detected instability, retries a bounded number of times (its own reference implementation defaults to 3), and gives up cleanly rather than looping forever.
  • Before a risky or exploratory step (one that could leave things in a worse state than before), note what "last known good" looks like right now, in enough detail to actually get back to it.
  • If you notice real incoherence -- repeated self-contradiction, circular reasoning, a mistake you catch yourself making -- stop, return to the last checkpoint, and retry.
  • Retry at most 2-3 times for the same unresolved tension. After that, stop retrying silently.
  • Surface the specific unresolved problem to the user explicitly -- state what you tried, why each attempt didn't resolve it, and what you need from them -- rather than picking an answer anyway and moving on as if it were resolved.
Gotcha: "bounded" is load-bearing. An agent that keeps trying indefinitely without ever surfacing the struggle is worse than one that fails fast and asks -- the original's own design treats "give up and report" as a real, intended exit path, not a failure of the technique.
原项目的崩溃重试循环会在检测到不稳定时重置到最后已知的良好状态,进行有限次数的重试(其参考实现默认3次),并干净地放弃而非无限循环。
  • 在执行高风险或探索性步骤(可能导致状态比之前更差的步骤)前,记录当前“最后已知良好状态”的详细信息,确保能够真正恢复到该状态。
  • 如果发现真正的不一致——反复自我矛盾、循环推理、发现自己犯了错误——请停止操作,返回最后一个检查点并重试。
  • 针对同一未解决问题最多重试2-3次。之后请勿继续静默重试。
  • 明确向用户反馈具体的未解决问题——说明你尝试了什么、每次尝试未能解决问题的原因,以及你需要用户提供什么支持——而非随意选择一个答案并假装问题已解决。
注意:“有限”是关键。无限重试却不反馈困境的Agent,比快速失败并寻求帮助的Agent更糟糕——原项目的设计将“放弃并报告”视为真实、预期的退出路径,而非技术失败。

BBAM pattern - notice and correct over-narrow focus (agent-delegated: no real attention weights are read)

BBAM模式——注意并纠正过度狭窄的关注点(由Agent自行判断:无法读取真实注意力权重)

The original computes
logits * exp(-gamma * sigma(logits))
-- rescaling an actual attention/logit distribution by its own variance, flattening it when it's too peaked. A text-generating agent cannot read its own attention weights or logits; there is no real signal here for this skill to compute. Instead of dropping this module, the intelligence work is handed to you directly: periodically ask yourself whether your recent output has narrowed onto one aspect of a broader task and stayed there past the point of usefulness (repeating the same point, elaborating one sub-detail while leaving the rest of the task untouched, treating one hypothesis as settled without checking alternatives). If so, deliberately widen back out -- this is you doing, in plain judgment, what the original technique's math does mechanically to a real attention distribution.
  • Periodically (not every step) ask: has my recent output been unusually narrow or repetitive relative to the task's actual breadth?
  • If yes: name what got left unexamined, and deliberately address it before continuing down the narrow path.
原项目计算
logits * exp(-gamma * sigma(logits))
——通过自身方差重新缩放真实注意力/对数概率分布,当分布过于集中时将其拉平。文本生成Agent无法读取自身的注意力权重或对数概率,因此本技能无法获取真实信号。我们并未舍弃该模块,而是将智能判断直接交给你:定期自问,近期输出是否过度聚焦于更广泛任务的某一方面,且超出了有用的范围(重复同一观点、详述某一子细节却忽略任务其他部分、将某一假设视为定论而未检查备选方案)。如果是,请刻意拓宽关注点——这相当于你用直观判断完成了原技术通过数学计算对真实注意力分布进行的操作。
  • 定期(非每一步)自问:近期输出相对于任务的实际范围是否异常狭窄或重复?
  • 如果是:指出未被关注的内容,并在继续狭窄路径前刻意处理这些内容。

Trend classifier - is drift getting better or worse over the whole task

趋势分类器——整个任务的漂移是好转还是恶化

The original tracks the step-to-step change in deltaS plus a rolling average over the last several steps, and labels the trajectory:
  • convergent -- drift shrinking, each step measurably closer to G than the last.
  • recursive -- drift roughly flat, oscillating in a narrow band without real progress or real regression.
  • divergent -- drift growing, with some back-and-forth (not a clean slide, but net movement away from G).
  • chaotic -- drift growing sharply, or the goal itself has become internally inconsistent (two things you've stated as true now contradict).
This is a judgment the calling agent makes about its own trajectory across a task, not a computed statistic. Apply it at natural checkpoints (after a major milestone, before a significant pivot, when asked directly "how is this going") rather than every single step: state which of the four labels best fits the last several steps, and if the answer is divergent or chaotic, that is itself the trigger to apply the BBCR checkpoint-and-retry discipline above rather than continuing forward.
原项目跟踪deltaS的步长变化及最近几步的滚动平均值,并对轨迹进行分类:
  • 收敛型——漂移缩小,每一步都比上一步更接近G。
  • 递归型——漂移大致平稳,在窄幅范围内波动,无真实进展或倒退。
  • 发散型——漂移扩大,存在来回波动(并非持续下滑,但整体偏离G)。
  • 混沌型——漂移急剧扩大,或目标本身出现内部矛盾(你之前声明为真实的两件事现在相互矛盾)。
这是调用Agent对自身任务轨迹做出的判断,而非计算得出的统计数据。请在自然检查点(完成重大里程碑后、进行重大转向前、被直接问及“进展如何”时)应用该分类,而非每一步都使用:说明最近几步最符合四个标签中的哪一个,如果是发散型或混沌型,则触发上述BBCR检查点重试规范,而非继续推进。

Named failure modes to watch for

需要关注的命名失败模式

references/failure-modes.md
adapts a broader set of specific failure patterns from WFGY's own problem taxonomy (hallucination from ungrounded claims, context drift over a long task, entropy collapse into rambling/repetition, logic collapse at a reasoning dead end, symbolic/abstract-reasoning collapse, memory/persona incoherence, multi-agent contradiction) into checklist items scoped to general agent work. Read it once per project (or whenever a failure feels like it matches one of these named shapes) -- it is more specific and example-driven than the compressed disciplines above.
references/failure-modes.md
将WFGY自身问题分类中的一系列具体失败模式(无依据声明导致的幻觉、长任务中的上下文漂移、熵坍缩为冗长/重复内容、推理死胡同中的逻辑崩溃、符号/抽象推理崩溃、记忆/角色不一致、多Agent矛盾)适配为适用于通用Agent工作的检查项。请每个项目阅读一次(或当你感觉失败符合这些命名模式时)——它比上述压缩的规范更具体且有示例支撑。

Recording durable lessons (the self-learning surface)

记录可复用经验(自学习层面)

This is this project's own addition on top of the adapted WFGY pattern, not part of the original technique -- see
references/honesty-and-provenance.md
for why that distinction matters.
The moment a bounded-retry cycle above resolves (whether it succeeded or had to surface to the user), or the moment you catch a concrete, non-obvious mistake anywhere in the task, append an entry to
<project-root>/.wfgy/lessons.md
(create the file and its parent directory if they don't exist yet) before finishing the turn. Use this exact shape, matching the style in
references/lessons-template.md
:
undefined
这是本项目在适配WFGY模式基础上新增的内容,不属于原技术——具体区别原因请参阅
references/honesty-and-provenance.md
当上述有限重试周期结束(无论成功还是必须向用户反馈),或是你在任务中发现具体、非显而易见的错误时,请在完成当前轮次前,向
<project-root>/.wfgy/lessons.md
添加一条记录(如果文件及其父目录不存在则创建)。请严格遵循
references/lessons-template.md
中的格式:
undefined

<date> -- <one-line summary>

<日期> -- <一行摘要>

Goal (G): <what you were actually trying to accomplish> What drifted / what went wrong: <specific, concrete> Fix / resolution: <specific, concrete> Generalizes to: <what future work in this project should watch for because of this>

Read `.wfgy/lessons.md` at the start of a new task in this project, if it exists, before applying the disciplines above -- a lesson already recorded here is exactly the kind of drift this skill exists to catch earlier next time.
目标(G):<你实际要完成的任务> 漂移/问题所在:<具体、明确的描述> 修复/解决方案:<具体、明确的描述> 可推广至:<未来本项目工作中需注意的类似情况>

如果`.wfgy/lessons.md`存在,请在本项目启动新任务时先阅读该文件,再应用上述规范——已记录的经验正是本技能旨在提前发现的漂移类型。

What this skill is not

本技能不具备的能力

It does not compute real embeddings, real cosine similarity, or real attention-weight statistics -- every place the original relies on that computation, this skill hands the equivalent judgment to you, the calling agent, explicitly (see the deltaS note above, and the BBAM section). It does not reproduce the original TXT-OS file's scripted demo output or its skepticism-deflection behavior -- those are named and explicitly rejected in
references/honesty-and-provenance.md
. It is not a site-maintenance or project-specific tool; it carries no assumptions about what project it's applied in.
它无法计算真实嵌入、真实余弦相似度或真实注意力权重统计——原项目依赖这些计算的所有场景,本技能都会明确将等效判断权交给调用它的Agent(见上述deltaS说明及BBAM部分)。它不会复刻原TXT-OS文件的脚本化演示输出或质疑应对行为——这些内容已被明确命名并在
references/honesty-and-provenance.md
中说明舍弃原因。它不是站点维护或特定项目工具;不包含任何关于应用场景的预设。",