Flow2Spec: Skill for Claude Code

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

f2s-kb-add is a skill for Claude Code from double-coding-lab/Flow2Spec. It costs 55 tokens per session (2,691 once invoked), scanned A, original, MIT.

A workflow for adding an implemented capability to a project knowledge base. It combines information from several source files, creates a draft, and produces final topic, index, and manifest files.

In plain words
What is it for?
Use it to document existing capabilities from multiple files, coordinate parallel source review, merge findings, remove duplicates, and write the resulting knowledge-base files.
Why use it?
It gives large or scattered source material a consistent path into the knowledge base. It also sets rules for when to split reading among helper agents and how to check overlaps or contradictions.

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-add/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-add

README.md
[![agentmods](https://agentmods.dev/badge/skills/double-coding-lab/flow2spec/f2s-kb-add/github.svg)](https://agentmods.dev/skills/double-coding-lab/flow2spec/f2s-kb-add)
Your own site
<a href="https://agentmods.dev/skills/double-coding-lab/flow2spec/f2s-kb-add"><img src="https://agentmods.dev/badge/skills/double-coding-lab/flow2spec/f2s-kb-add/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-add

Your own site · 80×15
<a href="https://agentmods.dev/skills/double-coding-lab/flow2spec/f2s-kb-add"><img src="https://agentmods.dev/badge/skills/double-coding-lab/flow2spec/f2s-kb-add.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,691 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.00055 $0.02691
Opus 5.5 $0.00022 $0.01076
Sonnet 5.5 $0.00011 $0.00538
Haiku 4.5 $0.00006 $0.00269

Measured 1mo ago against content hash b03d7051cbf0, 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-add 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-add/SKILL.md · 133 lines

How it starts

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

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

编排(主 / 子 agent)

  • subAgent / switchAgentVerification 两字段语义以统一入口为唯一事实源:Cursor/Claude 读配置根 rules/f2s-flow2spec-unified-entry.*;Codex 读 .codex/topics/f2s-flow2spec-unified-entry.md(与上同源,flow2spec init 镜像)。
  • 默认不拆子:主会话全流程完成;低于阈值时拆子收益低于 context 切换成本。
  • 拆子阈值(仅当 subAgent=true 且任一满足):① 输入路径 ≥ 5;② 单源文件 > ~3000 行;③ 多路径总量 > ~10000 行。
  • 拆子策略(仅在达到拆子阈值且 subAgent=true 时启用):
    • B 模式(默认,单轮并行):主先产出「inventory(待解析源文档路径清单 + 核心能力名,主手写,禁止子 agent 自行增删)」+「扫描契约(每个源读哪些章节 / 行号范围、禁扫目录、统一产出字段与表头)」→ 子 agent 并行只读按表填写 → 主一轮合并 + 去重 → 写 .Knowledge/stock-docs/<方案名>_初稿.md → 主做用户确认与验收。适合源边界较清晰、中等规模、希望尽快出一版。
    • C 模式(大仓 / 高风险,多轮纠偏):在 B 之前或替代 B 首轮 —— 主先做 inventory → 子并行交表 → 主专做一轮对表(标重合 / 矛盾 / 缺依赖 / 跨源边界)→ 必要时对矛盾点补派小任务或主自读关键点 → 最后主写 / 改定稿。适合多 workspace / monorepo、目录极深、源路径 > 20 条、首轮子表矛盾或空洞明显、多源叙述重合或矛盾严重的场景。
    • 切换判据(任一成立即切到 C):多 workspace / monorepo;目录极深或源路径 > 20 条;首轮子表矛盾 / 空洞明显;多源叙述重合 / 矛盾严重。
  • 子交付硬约束:子 agent 不得自行裁剪源路径范围,必须按主手写 inventory 执行;交付按「子交付 YAML schema」(字段:source / scope / capabilities / cross_refs / pending),禁止散文式回传;子不得写 manifest-routing.json / .Knowledge/index.md;子不得单独宣布「已进知识库」。
  • 主必控:重合判定、终稿定稿、f2s-kb-build 调度、整体验收。
  • 写权硬约束:manifest-routing.json 与 .Knowledge/index.md 恒由主 agent 落盘。
  • 落盘侧自验。

f2s-kb-add:多文件聚合 -> 初稿 -> 终稿 -> 知识路由同步

使用时机

  • 某能力已在代码中落地,但信息分散在多个文件,需沉淀为可检索知识。
  • 与 f2s-doc-arch 区分:doc-arch 产出架构初稿;doc-add 产出“已落地能力”知识沉淀链路。

输入

参数 必填 说明
文件路径列表 是 一个或多个路径(空格/换行/@);支持源码、配置、文档
方案名 否 用于生成 <方案名>_初稿.md、<方案名>_终稿.md
初稿/终稿路径 否 默认放 .Knowledge/stock-docs/

无有效路径时中止并要求用户补充。

步骤 0:重合判定(重要)

执行前先对照:

  • .Knowledge/index.md
  • .Knowledge/topics/*.md
  • .Knowledge/stock-docs/*.md

若已有同主题沉淀,优先原位更新,避免重复主题和重复索引行。

步骤 0.5:多模块检测(输入路径 ≥ 2 时必须执行)

  1. 目录聚合:按路径中的功能层目录(如 src/<模块名>/、顶层目录名)对文件分组。
  2. 判定规则(满足任一即判定为「多模块」):
    • 文件分属 ≥ 2 个不同顶层功能目录(如 auth/、payment/);
    • 用户在输入中明确提及「多个功能 / 不同模块 / 分别处理」等;
    • 文件名前缀明显不同且无共同父目录。
  3. 单模块(未触发判定):不中断,继续步骤 1,按现有单输出逻辑生成 <方案名>_初稿.md。
  4. 多模块(触发判定):暂停,向用户展示分组结果,并询问:
    • 方案 A(推荐):按模块分别生成知识文件 → 每组独立走步骤 1→2→3→4,各自产出 <模块名>_初稿.md / <模块名>_终稿.md;
    • 方案 B(合并):忽略模块边界,合并生成一份 <方案名>_初稿.md(原有行为)。
    • 禁止在未获用户明确选择前默认走方案 B 继续执行。
  5. 单模块但 stock-doc 体量大:若单份输入文档或聚合后的源码超过 300–500 行,或涵盖 3 个以上不相干职责域,建议向用户提示"可拆成多份 focused stock-doc,各自对应独立 topic";用户确认继续则不阻断,但在输出摘要中记录"建议后续拆分"。

Read the full file on GitHub · 133 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 First seen · 133 lines · 55 tokens per session scan A b03d7051cbf0

Subscribe to this mod's changes

f2s-kb-add is a skill published in the GitHub repository double-coding-lab/Flow2Spec (52 stars, last pushed 6d ago), licensed MIT. It adds 55 tokens to every session and 2,691 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

orbit-notion

Open Orbit briefing skill — selected by the Orbit pipeline when Notion is the user's only connected connector, or when the user explicitly scopes their daily digest to Notion. Pulls the past 24 hours of document edits, comments, mentions, and database row changes from the user's authenticated Notion connection and…

nexu-io/open-design · 117 tokens

instrument-data-to-allotrope

Convert laboratory instrument output files (PDF, CSV, Excel, TXT) to Allotrope Simple Model (ASM) JSON format or flattened 2D CSV. Use this skill when scientists need to standardize instrument data for LIMS systems, data lakes, or downstream analysis. Supports auto-detection of instrument types. Outputs include full…

anthropics/knowledge-work-plugins · 123 tokens

apify-youtube-transcript-scraper

Get YouTube captions, timestamped quotations, SRT/VTT and translated transcripts for videos, channels and playlists through the harshmaur/youtube-transcript-scraper Apify Actor.

sickn33/agentic-awesome-skills · 48 tokens

legal-hold

Issue, refresh, release, or report on legal holds — drafts the hold notice as .docx, updates legalhold fields in log.yaml, and calendars the next refresh. Use when the user says "issue a hold", "refresh hold", "release hold", or asks for a portfolio-wide hold status report.

anthropics/claude-for-legal · 68 tokens

baoyu-youtube-transcript

A tool for downloading the written captions, subtitles, chapter information, speaker labels, and cover image from a YouTube video using its URL or ID.

JimLiu/baoyu-skills · 107 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens