Flow2Spec: Skill for Claude Code

.claude/skills/f2s-doc-arch/SKILL.md

f2s-doc-arch is a skill for Claude Code from double-coding-lab/Flow2Spec. It costs 53 tokens per session (2,963 once invoked), scanned A, original, MIT.

A Chinese-language workflow for creating a first draft of a project's architecture documentation from user-provided material or a code scan. The document describes the project's entry points and important modules without requiring a fixed format.

In plain words
What is it for?
Drafting architecture notes, inventorying project entry points and modules, documenting deep or multi-project repositories, and preparing material for a later knowledge-base workflow.
Why use it?
It turns scattered explanations or source code into an understandable architecture overview. It also defines how the main agent and helper agents should divide scanning and writing responsibilities.

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-doc-arch/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-doc-arch

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/double-coding-lab/flow2spec/f2s-doc-arch"><img src="https://agentmods.dev/badge/skills/double-coding-lab/flow2spec/f2s-doc-arch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,963 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Prompt Injection · line 27
    Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
    Fix: Remove the large whitespace padding (blank-line blocks or long space runs) and review any content hidden below or to the right of it. Keep skill files compact and reviewable so no instructions can be
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.00053 $0.02963
Opus 5.5 $0.00021 $0.01185
Sonnet 5.5 $0.00011 $0.00593
Haiku 4.5 $0.00005 $0.00296

Measured 1mo ago against content hash b905c9f7ff30, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

f2s-doc-arch 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-doc-arch/SKILL.md · 131 lines

How it starts

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

执行口径:本技能产物默认写入 .Knowledge/stock-docs/,后续由知识库技能链(如 f2s-doc-final、f2s-kb-build)同步到 .Knowledge/topics/index/manifest。

编排(主 / 子 agent)

  • subAgent / switchAgentVerification 两字段语义以统一入口为唯一事实源:Cursor/Claude 读配置根 rules/f2s-flow2spec-unified-entry.*;Codex 读 .codex/topics/f2s-flow2spec-unified-entry.md(与上同源,flow2spec init 镜像)。本节不复述。
  • 当 subAgent=true 时,从以下两种子策略择一:
    • B 模式(默认,单轮并行):主先产出「inventory(入口 + 核心模块名,主手写)」+「扫描契约(可读路径 / 禁扫目录 / 统一产出字段)」→ 子 agent 并行只读扫表 → 主一轮合并去重 → 写 stock-docs 初稿 → 用户确认与验收在主 agent 内完成。
    • C 模式(多轮纠偏):切换判据为以下任一 —— 多 workspace / monorepo、目录极深或源路径 > 20 条、首轮子表矛盾或空洞明显、多源叙述重合 / 矛盾严重。
  • 子交付硬约束:子 agent 不得自行裁剪目录范围,必须按主手写 inventory 执行;子交付按「子交付 YAML schema」(字段:source / scope / cross_refs / pending),禁止散文式回传。
  • 写权硬约束:.Knowledge/index.md / manifest-routing.json 恒由主 agent 落盘,子 agent 不得触碰。
  • 落盘侧自验;本 SKILL 不绑定交叉校验。

生成项目架构说明(初稿)

本技能用于帮助用户生成项目架构的文档说明,产出形态类似初稿:无固定格式规范,以描述清楚为目标。用户可提供纯文字说明、已有文档,或在不提供时由 AI 扫描代码生成(不推荐,仅作兜底)。

与 f2s-kb-add 的分工:本技能只负责「架构说明类初稿」这一环,默认不在同一技能内写终稿、不直接执行 f2s-kb-build。若用户在工作中要把已做好的能力依据多份相关文件路径一次解析进知识库(初稿→终稿→topics/index/manifest),应使用 f2s-kb-add,勿用本技能冒充该流程。


入参(均可选)

参数 说明
第一个参数 可选。可为以下之一:一段纯文字说明(直接写在命令后)、本地文档路径(如 .Knowledge/stock-docs/xxx.md、.Knowledge/req-docs/README.md、README.md)。不传则进入「无输入」流程。
第二个参数 可选。输出路径;可指定目录,文件名固定为 项目架构初稿.md。默认 .Knowledge/stock-docs/项目架构初稿.md。

注意:不传任何说明或文档时,将使用 AI 扫描项目代码与目录 生成架构说明初稿,不保证质量。执行时必须先提示用户:「是否确认不传递参数,仍使用 AI 扫描代码生成?(不保证质量)」,仅当用户明确确认后才继续。


执行流程

1. 若用户提供了说明或文档

  1. 读取与理解
    • 若第一参数是文档路径:在配置根的父目录下按路径读取该文件内容(支持 .md、.txt 等文本格式)。
    • 若第一参数是纯文字说明:直接以用户输入为「用户说明」。
  2. 结合项目补充
    • 根据用户说明中的代码路径、模块名、入口等线索,结合配置根的父目录下的实际目录结构、关键文件(如 package.json、入口文件、配置文件)进行归纳与补全。
    • 若用户说明较宽泛(如只说了「一个后台系统」),主动引导用户补充:主要代码路径、模块/包划分、入口与启动方式、与外部系统的边界等,便于生成更贴合的架构说明。
  3. 生成初稿
    • 若启用拆子(B 模式),子 agent 必须按主手写 inventory 执行扫描,交付遵循子交付 YAML schema。
    • 产出一份项目架构说明:可包含但不限于:项目定位、技术栈、目录/模块划分、关键路径与入口、配置与部署要点、与文档产物阶段的对应说明(若适用)。
    • 无固定格式:采用清晰的标题与段落即可,不强制套用《终稿模版》。
  4. 输出
    • 默认写入 .Knowledge/stock-docs/项目架构初稿.md,一级标题固定为 # 项目架构初稿;第二参数的文件名按下文命名约定归一化。
    • 若目录不存在则先创建。

Read the full file on GitHub · 131 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 · +2 lines b905c9f7ff30
  2. 1mo ago First seen · 129 lines · 53 tokens per session scan A 709e56cddce3

Subscribe to this mod's changes

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