f2s-kb-rm

A maintenance procedure for removing a stock-document's knowledge topics and index links from a project. It updates the project's knowledge files and routing rules.

In plain words
What is it for?
Use it when deleting a document from the project's stock-docs folder and you need to remove its related topics, index entries, routing rules, and dependencies.
Why use it?
It prevents deleted project documents from leaving stale topics, search routes, or dependencies behind. The procedure also handles references to a removed fallback topic.

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

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 908 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.00040 $0.00908
Opus 5 $0.00020 $0.00454
Sonnet 5 $0.00008 $0.00182
Haiku 4.5 $0.00004 $0.00091

Measured 2d ago against content hash d7120b62393f, 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-rm 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.

.claude/skills/f2s-kb-rm/SKILL.md · 62 lines

What it actually says

执行口径:仅维护 .Knowledge,不改配置根 rules/skills

编排(主 / 子 agent)

  • 两字段(subAgent / switchAgentVerification)语义以统一入口为唯一事实源:Cursor/Claude 读配置根 rules/f2s-flow2spec-unified-entry.*Codex.codex/topics/f2s-flow2spec-unified-entry.md(与上同源,flow2spec init 镜像)。不在此复述。
  • 默认主 agent 全流程执行(单点删除拆子收益低)。
  • 拆子阈值:仅当 subAgent=true批量删除一次 ≥ 5 主题时,才拆子执行删除与清引用。
  • 主必控:范围确认、fallbackTopic 重指。
  • 写权硬约束:manifest-routing.json.Knowledge/index.md 恒由主 agent 落盘。
  • 验证:默认落盘侧自验;本 SKILL 不绑定交叉校验。

删除文档对应的项目上下文

输入

  • 一个参数:.Knowledge/stock-docs/<文件名>.md 路径,或可匹配文件名片段。

执行步骤

  1. 读取 .Knowledge/index.md,匹配目标文档相关主题。
  2. 删除对应 .Knowledge/topics/<topic>.md 文件。
  3. .Knowledge/index.md 移除匹配项并写回。
  4. 更新路由清单:
    • .Knowledge/manifest-routing.json:移除失效 topicPathstaskToTopicRulestopicDependenciestopicMetadata 引用
    • 对应 matchers/<matcherId>.json:移除失效规则或 includeAny 词条(与已删 task/matcherId 对齐)
    • 若删除了 fallbackTopic,必须指定新的兜底主题
    • 创作侧准则:本步会调整 topicDependencies(删除被依赖主题或孤儿边),须先 Read rules/f2s-topic-authoring.* 全文(Cursor/Clauderules/f2s-topic-authoring.mdcCodex.codex/topics/f2s-topic-authoring.md),核对 DAG 与最小化约束后再落盘。

输出摘要(必须)

  • 已删除的 topic 文件列表
  • .Knowledge/index.md 删除的条目
  • 路由清单调整的字段
  • 未执行项(若有)

复杂场景示例

用户输入文件名片段「回调」,匹配到 2 个主题文档。

  • 先列出两个候选并要求用户确认删除范围,避免误删。
  • 删除后同步清理路由清单失效引用;若删到了 fallbackTopic,必须先指定新的兜底主题再落盘。
  • 最终摘要中写清:删除了哪些 topic、保留了哪些 topic、为什么。

约束

  • 匹配多义时先询问用户确认。
  • 仅删除命中主题,不影响其它主题。
  • manifest-routing.json.Knowledge/index.md 恒由主 agent 落盘(写权硬约束);范围确认与 fallbackTopic 重指不可下放给子 agent。

完成后自检

  1. 被删 topic 是否仍被 manifest 引用(必须为否)。
  2. index 是否仍存在失效主题路径(必须为否)。
  3. topicMetadata 是否仍引用已删除 topic(必须为否)。
  4. fallbackTopic 是否仍有效。
  5. 未在低于拆子阈值(< 5 主题)时强行拆子;manifest / index 由主单点落盘。
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 · 62 lines · 40 tokens per session scan A d7120b62393f

Subscribe to this mod's changes

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