Flow2Spec: Skill for Claude Code

.claude/skills/f2s-kb-sync/SKILL.md

f2s-kb-sync is a skill for Claude Code from double-coding-lab/Flow2Spec. It costs 57 tokens per session (3,368 once invoked), scanned A, original, MIT.

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 Code

Written for Claude Code: installed under .claude/. Also seen: mentions subagents; mentions Codex.

This is double-coding-lab/Flow2Spec's own configuration. It tells Claude Code how to work on Flow2Spec itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Flow2Spec configures →

Reuse

Borrowing it

Nothing to install: this file belongs to double-coding-lab/Flow2Spec. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/double-coding-lab/Flow2Spec/main/.claude/skills/f2s-kb-sync/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/double-coding-lab/Flow2Spec

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for f2s-kb-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/double-coding-lab/flow2spec/f2s-kb-sync/github.svg)](https://agentmods.dev/skills/double-coding-lab/flow2spec/f2s-kb-sync)
Your own site
<a href="https://agentmods.dev/skills/double-coding-lab/flow2spec/f2s-kb-sync"><img src="https://agentmods.dev/badge/skills/double-coding-lab/flow2spec/f2s-kb-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for f2s-kb-sync

Your own site · 80×15
<a href="https://agentmods.dev/skills/double-coding-lab/flow2spec/f2s-kb-sync"><img src="https://agentmods.dev/badge/skills/double-coding-lab/flow2spec/f2s-kb-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,368 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00057 $0.03368
Opus 5.5 $0.00023 $0.01347
Sonnet 5.5 $0.00011 $0.00674
Haiku 4.5 $0.00006 $0.00337

Measured 1mo ago against content hash 480905a6d52e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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 · 201 lines

How it starts

The opening of the file, as written. The whole thing — 201 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 草稿,记录 taskId、developerId、baseRevisions、changes 与证据摘要;没有显式任务目录时可在内存中形成等价对象,不强制为了本技能创建 .task。changes 可使用 appendBody / replaceBody / updateFrontmatter;确需新主题时使用 createTopic,并可携带 taskRule 与 matcher 让路由一并接入。
  2. 写入 .Knowledge 前,必须用 flow2spec kb plan <delta> 或等价内部能力预演;若 topic revision 不一致,停止自动写入,转入语义合并说明。
  3. 可自动合并时,由 agent 调用 flow2spec kb apply <delta> 或等价内部能力写入 topic,并随后执行 flow2spec kb build 与 flow2spec 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:输出《更新大纲》(必须)

大纲采用 3 段主体 + 折叠详情结构,让用户一眼看清"入哪 / 改什么 / 不入哪",细节按需展开。目标是信号密度高、视觉焦点在决策点(Issue #38)。

输出骨架(Agent 按此结构填充实际内容):

## 知识库同步大纲

### 📥 入库
- `<topicId>`:<一句话说明改了什么>(→ `.Knowledge/topics/<topic>.md`)
- **新建** `<topicId>`:<能力概述>(→ 新增 topic + matcher + 路由条目)

### 🚫 不入库
- <能力/变更>:<一句话原因>(如"仅代码重构无新语义 / 属于 fix 已在其他 topic 覆盖 / 与既有 topic 重复")

### 是否继续?(y/n)

<details>
<summary>展开查看详情</summary>

**拟改文件**:
- `.Knowledge/topics/<topic>.md`
- `.Knowledge/index.md`
- `.Knowledge/manifest-routing.json`
- `.Knowledge/matchers/<id>.json`

**主题元数据**(如有):
- `<topicId>`:primary=`<type>`,tags=`[...]`,confidence=`<manual|inferred>`

**终稿沉淀**(如需):
- 待生成 `stock-docs/<能力名>_终稿.md`(来源:`req-docs/<方案>.md` + 已实现代码 + 澄清文档)
  依据见 `rules/f2s-topic-authoring.*`「长文背景引用的目录边界(硬约束)」。

**信息来源**:<用户指定 / Agent 推断 / git diff / 目录扫描>

**不改动范围**:<列出本次刻意跳过的项与原因>

</details>

Read the full file on GitHub · 201 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. 1mo ago Changed · +40 lines 480905a6d52e
  2. 1mo ago Changed 9a024fbba371
  3. 1mo 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 (52 stars, last pushed 6d ago), licensed MIT. It adds 57 tokens to every session and 3,368 once invoked, about $0.0002 per session on Opus 5.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

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

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

chronicle

Analyze Copilot session history for standup reports, usage tips, session search, and session reindexing. Use when the user asks for a standup, daily summary, usage tips, workflow recommendations, wants to search or find past sessions by keyword/file/PR, wants to reindex their session store, or asks about deleting…

microsoft/vscode · 72 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

component-fixtures

Use when creating or updating component fixtures for screenshot testing or their shared infrastructure, or when designing UI components to be fixture-friendly. Covers fixture file structure, theming, service setup, CSS scoping, async rendering, validation, and common pitfalls.

microsoft/vscode · 53 tokens