f2s-kb-sync

A knowledge-base synchronisation workflow that turns an approved outline into updates for a .Knowledge repository. It plans, merges, builds, and checks those updates while preserving topic versions and routing information.

In plain words
What is it for?
Use it to prepare knowledge changes, merge them into existing topics, create new topics when needed, rebuild the index, and validate the result.
Why use it?
It reduces manual work when adding confirmed material and stops automatic writes when the knowledge base has changed in a conflicting way.

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

Made for: Claude Code, Codex.

Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,959 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.00057 $0.02959
Opus 5 $0.00028 $0.01479
Sonnet 5 $0.00011 $0.00592
Haiku 4.5 $0.00006 $0.00296

Measured 2d ago against content hash 40304f51e78f, 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-sync 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-sync/SKILL.md · 161 lines

How it starts

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

执行口径:本技能只维护 .Knowledge,默认不改配置根 rules/skills

KB 自动合并协议(必须)

本技能不得把“人工执行命令”作为用户流程。用户确认同步大纲后,由 agent 自己完成知识候选生成、合并、构建与校验:

  1. 将已确认的大纲转换为一个或多个 kb-delta 草稿,记录 taskIddeveloperIdbaseRevisionschanges 与证据摘要;没有显式任务目录时可在内存中形成等价对象,不强制为了本技能创建 .taskchanges 可使用 appendBody / replaceBody / updateFrontmatter;确需新主题时使用 createTopic,并可携带 taskRulematcher 让路由一并接入。
  2. 写入 .Knowledge 前,必须用 flow2spec kb plan <delta> 或等价内部能力预演;若 topic revision 不一致,停止自动写入,转入语义合并说明。
  3. 可自动合并时,由 agent 调用 flow2spec kb apply <delta> 或等价内部能力写入 topic,并随后执行 flow2spec kb buildflow2spec kb check
  4. 用户只看到“知识库已同步 / 有语义冲突需确认 / 已跳过入库及原因”,不要求用户手动执行 kb plan/apply/build/check

编排(主 / 子 agent)

  • 两字段(subAgent / switchAgentVerification)语义以统一入口为唯一事实源:Cursor/Claude 读配置根 rules/f2s-flow2spec-unified-entry.*Codex.codex/topics/f2s-flow2spec-unified-entry.md(与上同源,flow2spec init 镜像)。
  • 步骤 1(素材汇总):subAgent=true 时可拆子并行,仅只读汇总,不得落盘。
  • 步骤 2(大纲 + 用户确认):必主 agent 完成,确认权不可下放子 agent。
  • 步骤 3(落盘):subAgent=true 时可按已确认大纲拆子逐项落盘;硬约束:子落盘前必须前置加载近邻 2–3 个主题的开头摘要,做叙事风格对齐。
  • 写权硬约束:manifest-routing.json.Knowledge/index.md 恒由主 agent 单点落盘,禁止下放。
  • 校验:默认落盘侧 agent 自验;本 SKILL 不绑定交叉校验。

f2s-kb-sync(先大纲后写入)

输入(可选)

  1. 用户显式给出“已实现能力列表”
  2. 零输入:由 Agent 基于当前上下文推断
  3. 辅助材料:@ 文件、需求文档、架构说明等

强制流程(不可颠倒)

步骤 1:收集素材(只读)

  • 汇总用户目标、范围、优先级
  • 汇总已实现能力(用户指定 + Agent 推断)
  • 对照现有知识库:
    • .Knowledge/topics/
    • .Knowledge/index.md
    • .Knowledge/manifest-routing.json
    • .Knowledge/matchers/*.json(与路由中 matcherPath 对应的分片)
    • .Knowledge/stock-docs/
  • 主题粒度扫描:对已有 topic 粗扫以下信号,命中时在步骤 2 大纲中列为"建议拆分"(不阻断同步流程):
    • 对应 stock-doc 超过 300–500 行
    • includeAny 词数超过 12 个
    • topic 正文包含超过 3 个不相干职责域的二级标题。

步骤 2:输出《更新大纲》(必须)

大纲至少包含:

  1. 同步目标
  2. 能力清单(用户指定 / Agent 推断 / 合并结果)
  3. 信息来源
  4. 拟改文件清单(精确到路径)
  5. 主题同步计划:说明每个能力是"更新已有主题"还是"创建新主题",并列出 topicId、topic 文件、index 行、manifest/matcher 变更;如涉及 topicMetadata,列出 primary / tags / confidence 候选和证据;无明确证据时写"不分类 / 暂不写入"
  6. 终稿沉淀计划(硬约束):对每一个"新建 / 更新"的 topic,判断其「长文背景 / 详细资料」引用槽位是否已有对应 .Knowledge/stock-docs/*_终稿.md
    • 已有 → 直接引用;
    • 没有但本次同步的能力已经代码落地 → 大纲必须列出"待生成 stock-docs/<能力名>_终稿.md",并注明沉淀来源(对应 req-docs/*_技术方案.md + 已实现代码 + 澄清文档),由本 SKILL 步骤 3 之前先触发 f2s-doc-final 沉淀(或由用户确认后手写),让 topic 指向终稿;
    • 能力仍在 req-docs 待实现阶段、尚无代码 → topic「长文背景」小节暂写占位说明「待代码落地后由 f2s-doc-final 生成 stock-doc 终稿」,禁止在此槽位直接列 req-docs/*
    • 依据见 rules/f2s-topic-authoring.*「长文背景引用的目录边界(硬约束)」。
  7. 不改动范围
  8. 等待用户确认提示

Read the full file on GitHub · 161 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 · 161 lines · 57 tokens per session scan A 40304f51e78f

Subscribe to this mod's changes

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

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 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

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens