f2s-kb-feedback-closing

A rule for deciding whether a short knowledge-base reminder should be added after answering a question using business source code. It also lists workflows where that reminder must not appear.

In plain words
What is it for?
Use it at the end of source-code investigations, explanations, and troubleshooting answers to decide whether to suggest adding knowledge to the project database.
Why use it?
It prevents duplicate or misplaced suggestions while preserving reusable technical facts that should be recorded.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/double-coding-lab/flow2spec/f2s-kb-feedback-closing
Clone the repo
git clone --depth 1 https://github.com/double-coding-lab/Flow2Spec

Made for: Cursor.

Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,171 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00028 $0.02171
Opus 5 $0.00014 $0.01086
Sonnet 5 $0.00006 $0.00434
Haiku 4.5 $0.00003 $0.00217

Measured 2d ago against content hash 681ae3e4c086, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

f2s-kb-feedback-closing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/f2s-kb-feedback-closing.mdc · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Flow2Spec 知识库反馈收口

本条专管普通问答读取业务源码后的知识库补充建议。只决定最终回答是否需要追加一条极简提示。

适用范围

仅当同时满足以下条件时执行:

  • 本轮是普通问答 / 排查 / 解释
  • 本轮未进入 f2s-* 技能、implement-tech-designf2s-git-commit 或其他已有后续流程;
  • 本轮读取过业务源码,且最终答案引用了源码事实。

禁止:以下两类情形不得输出本规则 case 1~4 中任何一个收口块——

  1. 本轮已进入 f2s-kb-distillf2s-kb-distill 本身就是把本轮知识入库的技能,再贴自己的入库提示既冗余又自指。
  2. 本轮进入过程编排型技能f2s-req-clarify / f2s-req-tech / f2s-req-plan / f2s-doc-arch / f2s-doc-final / f2s-doc-milestone / f2s-doc-pdf。这些技能的产物是面向本次交付的 .Knowledge/req-docs/*docs/* 或任务规划物,读源码是为了产出这些产物本身,不是"顺手补一条通用知识"。哪怕读了源码并将事实写进了澄清 / 方案 / 规划文档,也不追加 distill 提示(澄清 / 方案文档本身归 req-docs,不是 topics / stock-docs 的入库对象;规划物随任务归档;文档类技能已有各自的落盘目标)。

其他 f2s-kb-* 技能(如 f2s-kb-feat / f2s-kb-fix / f2s-kb-sync 等)跑完之后仍按四 case 正常判定:若本轮回答里包含主路径之外、本次 SKILL 未入库的可复用知识事实(典型场景:修 bug 时顺带读了另一模块源码、回答了与本次 SKILL 主体无关的衍生追问),照常输出收口块;agent 据本轮实际写入情况判断,不一刀切。

判断时机与依据

判断时机:在生成最终回答后,基于回答实际包含的知识内容判断,而非读取过程。

判断依据

  • 最终回答中补充了哪些 KB 未写或不够细的知识
  • 这些知识是否属于"可复用知识事实"
  • 而非:读取过程中接触到的所有文件/信息

可复用知识事实包括:

  • 核心机制(如:缓存语义、重试策略、降级逻辑)
  • 状态流转(如:订单状态机、会话生命周期)
  • 返回值 / 错误码契约(如:HTTP 状态码语义、业务错误码含义)
  • 配置开关影响(如:开关 X 影响行为 Y)
  • 失败回退策略(如:主路径失败时的降级方案)
  • 模块边界或调用约定(如:模块 A 调用模块 B 的契约)
  • 数据模型与字段语义(如:关键字段的业务含义)

仅作证据,不触发同步的包括:

  • 行号(如:client.py:51
  • 函数名(如:send_message_to_session()
  • 代码片段(用于演示的具体实现代码)
  • 调用路径(如:A → B → C 的调用链)
  • 为了回答用户追问而展开的局部实现
  • 对 topic 已写事实做源码核验(KB 已写清楚,源码只是印证)

机械门禁

  • 读完首个业务源码文件后,视为本轮已触发 sourceFallbackUsed=true
  • sourceFallbackUsed=true 且最终答案引用源码事实时,发出回答前必须执行本条四 case 自检。
  • 四 case 必须显式表态:每轮收口必须从 case 1~4 中选一个明确输出对应块,不允许悄悄跳过整个收口流程。
  • 判定逻辑:
    • topic 命中 + 最终回答补充了"可复用知识事实" → 走 case 2
    • topic 未命中 + 最终回答补充了"可复用知识事实" → 走 case 1
    • topic 命中 + 最终回答仅包含"证据性内容"(行号/函数名/调用路径) + KB 已写清核心事实 → 走 case 4
    • 若下钻前说明的是机制/契约/流程类知识缺口,答后走 case 2
    • 若下钻前说明的只是证据/源码位置/行号/实现出处缺口,且 topic 已覆盖核心事实,可走 case 4

四种收口

  1. KB 未覆盖 + 源码找到答案:在答案末尾追加:
    > 💡 可用 `f2s-kb-distill` 将本轮知识入库
    >
    > **本轮将入库**:<一句话概要,点名「是什么能力 / 哪个模块 / 哪类知识」,例如:模块 X 的重试机制(首次入库)>
    
    判定条件:没有 topic 覆盖该能力 / 模块 / 问题域,且最终回答补充了可复用知识事实。

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 116 lines · 28 tokens per session scan A 681ae3e4c086

Subscribe to this mod's changes

f2s-kb-feedback-closing is a cursor rule published in the GitHub repository double-coding-lab/Flow2Spec (47 stars, last pushed 4d ago), licensed MIT. It adds 28 tokens to every session and 2,171 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.