🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@double-codeing/flow2spec

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@double-codeing/flow2spec

在业务仓库初始化「文档驱动、可写回知识库」的 AI 协作骨架:项目根 .Knowledge 承载 stock-docs/req-docs 与机读路由,.cursor/.claude/.codex 写入 f2s-* 规则与技能(含 Karpathy 式编码行为准则 f2s-karpathy-guidelines,init 同步 rules / Codex topics / skills);init 只落结构与模板,业务内容由各 f2s-* 技能在对话中维护。

Source
npmnpm
Version
3.0.14
Version published
Weekly downloads
145
95.95%
Maintainers
1
Weekly downloads
 
Created
Source

Flow2Spec — 让 AI 一直知道你在做什么

解决 Cursor / Claude Code 的「失忆症」——用一个命令初始化,让 AI 跨会话记住项目上下文,不用每轮重新交代。

🌐 English · 中 / EN

🎬 在线演示(中文) | English Demo(13 页 HTML PPT, 翻页,S 演讲者模式)

🔧 快速体验

npx @double-codeing/flow2spec@latest init

Before / After

同样一句话,两段对话:

> 改一下评价模板文案库的批量重评分

没有 Flow2Spec

AI: 这个模块的表在哪?
AI: batchReScore 是同步还是异步?
AI: 有没有锁?幂等键是什么?
AI: 返回格式是什么?错误码是多少?
AI: (翻遍 416 个接口、796 份文件、4.7 MB 源码…)

反复介绍 · 反复翻代码 · 反复踩坑

有 Flow2Spec

[matcher 命中] m-product-review-template-library
[加载依赖] 4 个 topic · 约 300 行
AI: 已知 — fire-and-forget
     Redis 锁 smp:product-review:template-library:batch-rescore:lock(TTL 10 分钟)
     单次最多 100 条 · 错误码 101
AI: 开始改,预计 3 处文件。

4.7 MB → 300 行 · 秒级定位到硬约束

Flow2Spec 做三件事

① 跨设备会话记住项目上下文
.Knowledge/ 结构化知识库:路由清单(manifest-routing.json)+ 关键词索引(matchers)+ 主题分片(topics)。AI 启动时只读该读的。

② 路由清单让 AI 不翻仓库,只拿该拿的
每次需求命中 1~4 个 topic,约 300 行。业务的硬约束——锁的 key、错误码、上限——都在 topic 里,AI 不用从源码猜。

③ f2s- 技能改代码顺手更新知识*
/f2s-kb-feat 写功能时同步写 topic,/f2s-kb-fix 修 bug 时更正 topic, /f2s-git-commit 提交前检查 topic 覆盖。改代码就是记知识,没有"单独维护文档"这件事。

上手成本

最小可用集是一个空骨架。

npx @double-codeing/flow2spec@latest init

1 分钟生成目录结构 + 路由配置,空的,直接跑。下次需求命中哪块,写哪块,不提前建设。

真实仓库跑了三个月的数据:

指标数值
对外接口数416
源码体积796 文件 / 4.7 MB / ~10 万行
Flow2Spec 每次加载≈ 300 行(噪声切掉 99%)

什么时候别用

  • 一次性脚本 — 写完就删的东西,直接丢几个 Markdown 给 AI 更快
  • 单人小项目 — 一份 CLAUDE.md 就够,路由和分片的开销大于收益
  • 团队不愿同步 .Knowledge/ — 工具不能替代纪律

详细文档

中文

English

协议

MIT. Copyright © 2026 兰涛

Keywords

flow2spec

FAQs

Package last updated on 18 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts