f2s-kb-addRules

A knowledge-base rule recorder for turning spoken instructions into organized topics. It decides whether each rule starts a new topic or belongs in an existing one.

In plain words
What is it for?
Use it to save a rule stated in ordinary language, match it to existing knowledge, and update the knowledge-base topic and routing files.
Why use it?
It removes the need to choose files, topics, or routing settings by hand. It keeps user-provided rules separate from source code and task tracking.

Skill for Claude CodeCodex

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 skills/double-coding-lab/flow2spec/f2s-kb-addrules
Any agent
npx skills add double-coding-lab/Flow2Spec --skill f2s-kb-addrules
Clone the repo
git clone --depth 1 https://github.com/double-coding-lab/Flow2Spec

Made for: Claude Code, Codex.

Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,332 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.00075 $0.03332
Opus 5 $0.00037 $0.01666
Sonnet 5 $0.00015 $0.00666
Haiku 4.5 $0.00007 $0.00333

Measured 3d ago against content hash 37c7ce5979fb, 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-addRules 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 3d 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.

.claude/skills/f2s-kb-addRules/SKILL.md · 169 lines

How it starts

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

任务路径:凡 .task/ 落盘与续作,**必须以 rules/f2s-task 解析的 TASK_ROOT 为准(.task.task/<developerId>;config → git → legacy)。下文若仍出现 .task/todo.json / .task/active/,均视为 TASK_ROOT/... 的简写

执行口径:本技能只维护 .Knowledgetopics/index/manifest-routing/matchers 分片),不改配置根 rules/skills,不动业务代码,不创建 .task/(口述规则属于元配置变更,不是业务变更追踪)。

f2s-kb-addRules:用户口述规则进知识库

与既有技能的边界

  • f2s-kb-feat 区分:f2s-kb-feat 强绑「代码实现 + KB 同步」,命中 changeTracking.feat 会创建 .task/;本技能只沉淀规则,不改代码、不追踪任务。
  • f2s-kb-build 区分:f2s-kb-build 输入是 .Knowledge/stock-docs/<file>_终稿.md;本技能输入是用户当场口述的规则文本
  • f2s-kb-add 区分:f2s-kb-add 输入是「多文件源码 / 配置」聚合到 stock-docs;本技能跳过 stock-docs,直接落 topic。

编排(主 / 子 agent)

  • subAgent / switchAgentVerification 语义以统一入口为唯一事实源(Cursor/Clauderules/f2s-flow2spec-unified-entry.*Codex.codex/topics/f2s-flow2spec-unified-entry.md)。本 SKILL 不复述。
  • 默认主 agent 全流程执行——口述规则单条短文,拆子收益低于 context 切换成本。
  • 写权硬约束.Knowledge/manifest-routing.json / .Knowledge/index.md 恒由主 agent 落盘。
  • 落盘侧自验。

输入

  • 一条或一段用户口述的规则文本(自由文本即可,无固定格式)。
  • 用户不需要指定目标主题、文件名、alwaysApply 等参数;由本技能判定与提议。

强制前置:Read 创作侧准则

执行任何步骤前,须先 Read rules/f2s-topic-authoring.* 全文(Cursor/Clauderules/f2s-topic-authoring.mdcCodex.codex/topics/f2s-topic-authoring.md),后续命名 / 骨架 / 依赖判定 / DAG 最小化 / 写盘权属均以该条为准。

步骤 1:意图归一

把用户口述文本归一为可落盘的"规则单元":

  • 抽取约束句式("做 X 时必须 / 禁止 / 优先 Y")或流程描述("X 的处理顺序是 A→B→C");
  • 标识规则适用场景(触发条件、文件路径范围、生命周期阶段等);
  • 不替用户引申、不补未说的边界——口述什么写什么,模糊处保留并在步骤 3 询问。

步骤 2:扫存量主题(必须)

  • Read .Knowledge/manifest-routing.jsontopicPaths 全集;
  • Read .Knowledge/index.md 主题表,按主题 id + 一句话意图扫一遍;
  • 必要时按规则正文中的关键词逐个 Read 候选 topics/<id>.md 头部 10–30 行(不要全文加载所有 topic);
  • 输出候选清单(重合度高 → 低,至多 3 个)作为步骤 3 的输入。

步骤 3:新建 vs 并入判定(必须,与用户确认)

向用户展示候选,按下列分支提议:

  • 高重合(口述规则明显是某存量主题的细化 / 补充 / 例外)→ 提议「并入 topics/<existing>.md」,并指出拟插入位置(章节名 / 段落锚点)。
  • 无重合 / 低重合(找不到合适宿主)→ 提议「新建 topics/<新 id>.md」;新 id 由本技能按规则正文生成 kebab-case,遵循 f2s-topic-authoring 命名约束(无版本后缀、无个人花名、与 index.md 既有标题不冲突)。
  • 跨多个主题(一条口述同时约束 ≥2 个主题)→ 暂停,向用户呈现拆分选项:
    • 选项 A:拆为 ≥2 条规则单元,分别并入对应主题;
    • 选项 B:选主归并到一个主题,其它主题以一行交叉引用提示;
    • 选项 C:新建一个总纲性主题统辖,旧主题加引用——仅在该规则确实横切多个领域时使用。

Read the full file on GitHub · 169 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. 3d ago First seen · 169 lines · 75 tokens per session scan A 37c7ce5979fb

Subscribe to this mod's changes

f2s-kb-addRules is a skill published in the GitHub repository double-coding-lab/Flow2Spec (47 stars, last pushed 5d ago), licensed MIT. It adds 75 tokens to every session and 3,332 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.

obra/superpowers · 37 tokens

auto-perf-optimize

Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.

microsoft/vscode · 62 tokens

chat-perf

Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.

microsoft/vscode · 51 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens