~/flow2spec · zsh · 01:00:00

Has Your AI
Lost Its Memory?

Flow2Spec · Keep Your AI Always in Context

An AI collaboration framework · Memory Coding

  • Cross-device sessions remember project context
  • Internal routing manifest — AI fetches only what it needs
  • f2s-* skills update knowledge as you code, always fresh
Lan Tao·2026.05·Frontend Team
  • Opening: Has your AI lost its memory?
  • Memory Coding: encode memory in the repo; four rings (knowledge / task / rules / skills) — do not collapse to three
  • The KB is only the knowledge ring; Flow2Spec three product things: resume context, routed reads, f2s keeps code + KB in sync (do not mix counts with four rings)
  • Slide 5: Memory Coding · four rings
session · diff · image-material-library / merge

Same Request, Two Conversations

Real ask, spanning Repo B (API) + Repo C (admin) — "merge the image material library with the image model management into one." Touches DDL, service extraction, admin menu merge, legacy compatibility.

Without Flow2Spec
> Merge image material library and image model management into one library

AI: Which repos are these two modules in?
AI: Separate tables? Any data migration needed?
AI: Is the old templateUuid field still referenced anywhere?
AI: Which endpoint stays? What's the naming prefix?
AI: Admin menu — merge or keep both entries?
AI: (Digging through DB / service / handler / menu across 3 repos...)
Repeated context probes · Repeated code scans · Legacy pitfalls
With Flow2Spec
> Merge image material library and image model management into one library

[matcher hit] m-image-model-dispatcher
[cross-repo deps] Repo B · Repo C · 4 topics
AI: Known — B: image_model / image_material tables to merge
     C: admin menu "Model Mgr" + "Material Mgr" collapse into one
     Legacy: templateUuid field goes nullable (see §3.2)
     Naming: keep imageMaterial* endpoints · retain provider param
AI: Start · 5 edits on B · 3 on C · one topic chain.
Cross 3 KBs → 300-line topic · constraints & legacy notes ready
  • Real cross-repo ask: merge image material library + image model mgmt (Repo B + Repo C)
  • Without: probes tables, migration, menu naming, legacy fields — code scan across 3 repos
  • With: one matcher → 4 cross-repo topics → DDL / naming / legacy all in topics
  • Line: not a smarter model — context is right, and cross-repo
stats · 4 real production repos · 2026-09

Not a Concept — It's Daily Reality

Four real production repos · scale spans 40× · all on the same Flow2Spec stack. Still only ~300 lines of matched topics loaded per turn.

Repo A · Frontend main (3 yr)
1012 source files · 129K LOC
43 topics · 43 matchers · 46 stock-docs · 65 req-docs
27 authors · 3 mo 2786 commits · 43 archived tasks
➜ 129K LOC → ~hundreds of lines per turn · 27 devs zero task collision
Repo B · API service (serverless)
213 source files · 26K LOC
25 topics · 23 matchers · 14 stock-docs · 54 req-docs
solo dev · 3 mo 185 commits · 11 archived tasks
➜ req-doc ~4× stock-doc → impl-driven · no docs-first ceremony
Repo C · B-side admin
73 source files · 5788 LOC
20 topics · 18 matchers · 6 stock-docs · 5 req-docs
solo dev · 3 mo 180 commits · 19 archived tasks
➜ 5K LOC · still 20 topics → not overkill, discipline scales down
Repo D · C-side app (serverless)
28 source files · 3174 LOC
15 topics · 14 matchers · 2 stock-docs · 1 req-doc
2 authors · 3 mo 76 commits · 7 archived tasks
➜ 3K-LOC seedling · already 15 topics → onboard early, decay never
// summary 4 repos combined: 1326 files · 165K LOC · 103 topics · 98 matchers · 193 distilled docs · 80 archived tasks — 3K to 130K lines all work. Not just for big projects.
  • 4 real repos, scale from 3K to 129K LOC (40× span)
  • Repo A: 43 topics / 27 authors / 2786 commits — real team collab
  • Combined 103 topics · 98 matchers · 193 docs · 80 archived tasks
  • Still ~300 lines of matched topics per turn
why not · openspec · superpowers · rag-kb · ohmyclaude · spec-kit

Bring Your Pain, Read Across

Five same-lane alternatives × five real pain points. Each cell describes what actually happens — no checkmarks. Match your pain to the tool that catches it, including where Flow2Spec doesn't.

// pain point
OpenSpec
Superpowers
/ ohMyClaude
/ cursorrules
RAG
vector DB
Spec Kit
/ Kiro / BMAD
Claude Memory
model-native
Flow2Spec
Spec keeps up?
Code drifts silently
sync is manual
No project knowledge, N/A
Reindex only if you remember to
Generated once
code moves on, spec doesn't
Wiped when model swaps
kb-feat/fix ties code to the knowledge base kb-sync manual full resync anytime kb-add ingest any module on demand
Read cost on big repo?
Whole spec, every turn
All prompts, no project scope
Similarity guesses
fails silently
Longer spec, slower each turn
Doesn't read code
Matcher + dep chain
a few hundred lines
Layered / precise?
Flat single doc
anchors by hand
Generic skills
no project layers
keyword-coarse
Flat chunks
similarity ≠ precision
Layers frozen at gen time
no growing deps
Flat memory items
model picks, uncontrolled
3 layers topic / stock-doc / code
progressive · stop when enough
Swap IDE / model?
Yes, sync still manual
Locked to one IDE
Claude or Cursor
Yes, but answers stay probabilistic
Yes, some wrappers fight the IDE
Model-locked
swap model, lose memory
Rules + knowledge + skillsnatively load in each client (incl. DeepSeek Harness)
Resume session?
No task state
No task state
No task state
No task state
Model memory
new device / account resets
.task/ keyword hit → resume checklist 80 archived tasks
Diffable / reviewable?
Yes, spec is Markdown
Skills diffable
project knowledge N/A
Index opaque, only rebuild
Spec diffable, but doesn't chase code
Not diffable
not reviewable
not shareable
.Knowledge/ all in-repo full team review
// where Flow2Spec falls short Skip syncing the KB · it still decays — tools can't replace discipline; the gap gate just lets you hear the crack.
  • Compare on pains, not vendors: spec-drift / read-cost / IDE-swap / session-drop / diff-review
  • Each rival has multiple × — cells describe what actually happens
  • F is not perfect: steep vocab, delayed payoff, still rots if you stop
  • Honest close: F catches these 5 pains, not "wins" against everyone
architecture · memory-coding · four rings

One Diagram · Memory Coding · Four Rings

Knowledge layer follows the project · Rules layer follows the tool · Different lifecycles, keeping them separate is the most fundamental decision.

Memory Coding Encode what must be remembered into the committed repo — not the model or chat. In the diagram below, .Knowledge/ is the knowledge ring; the task ring, rules ring, and skills ring share the rest. Knowledge ring .Knowledge/ · manifest Task ring .task/ · resume Rules ring rules · read · act Skills ring f2s-* · maintain & trigger ≠ model Memory · ≠ bare RAG · Flow2Spec ≠ KB-only
KNOWLEDGE LAYER · Memory Coding · Knowledge ring
.Knowledge/
Routing + matchers + topics + stock/req docs
manifest-routing.json matchers/*.json topics/*.md stock-docs/*.md req-docs/*.md
Knowledge ring · layered memory progressive · stop when enough
L0 manifest → L1 matchers → L2 topics → L3 stock / req

Topic match ≠ read every doc · docs ≠ skip code. AI judges if context is enough for this step; expand one precise layer on gap — minimal load, not open everything.

topicMetadata · topic classes
featurecapability moduleengineering module configswitches policyprocess/rules/gates

Metadata has primary, optional tags, and confidence; it supports inventory, audits, and reading expectations, not execution force.

Skills→Knowledge f2s syncs manifest/topics · Rules→Knowledge→Ship manifest routes reads · code from requirements
RULES RING · Memory Coding
.cursor/ · .claude/ · .codex/
Follows the tool · how to read & act (routing, gap gate, constraints)
.cursor/rules/*.mdc .claude/rules/*.md .codex/AGENTS.md AGENTS.md
Rules↔Skills f2s-* within bounds · steps follow unified entry
SKILLS RING · Memory Coding
skills/ · f2s-*
Follows the tool · maintain KB & trigger flows
.claude/skills/*/SKILL.md .codex/skills/ f2s-kb-feat · fix · sync f2s-git-commit
Skills→Task f2s-task checklists · Ship trace changeTracking + feat/fix sync to disk
TASK RING · Memory Coding
.task/
Follows the repo · cross-session resume · todo · checklist
todo.json active/*/task.md context.md user-todos.md completed/
  • Memory Coding: durable, reviewable memory in git
  • Four rings: knowledge .Knowledge/ · task .task/ · rules ring · skills ring (separate rules vs skills)
  • Layered memory: progressive · stop when enough; match ≠ read all docs; expand one layer on gap
  • Topic classes: feature / module / config / policy; type guides reading expectations, while execution force comes from the topic body
  • Rules & skills: side-by-side boxes, divider in the middle; no ↑↓ arrows
  • Horizontal + vertical read on slide 7
  • Flow2Spec ≠ RAG-only product
feature · 01 / 03 · progressive load

Progressive Loading · Check the Index First, Then Open the Book

User says "modify the batch rescore for the review template library" — four steps: check the index first, then open the book:

match
m-product-review-
template-library
Hits the matcher, reads only this one shard
→
expand
+3 dependency topics
common / platform / toClient auto-resolved
→
verify
Gap check
Low confidence → clarify with user first
→
act
Start coding
Estimated 3 files · with hard constraints
What you load is what you don't load — 4.7 MB source → 300 lines of topics. It's not about making AI smarter — it's about cutting the noise.
  • match → expand → verify → act four-step flow
  • One matcher shard at a time — no whole-repo grep by default
  • Clarify when confidence is low
  • Line: MB-scale repo → hundreds of lines of topics — cut noise, not magic IQ
knowledge ring · horizontal + vertical

Horizontal + Vertical · Narrow Then Stack

Two reads on the knowledge ring: horizontal L0→L3 via match → expand → verify → act; vertical topicDependencies stacks conventions to domain rules.

Horizontal · L0 → L3
L0 manifest → L1 matchers → L2 topics → L3 stock / req
match → expand → verify → act

One matcher shard per utterance — no whole-repo grep; clarify when unsure.

Vertical · topicDependencies

You only said "product review" — manifest stacks four topic layers:

└─
common-modules-context ctx · responseData · QMQ · getDb · DB field conventions 79 lines
  └─
social-media-platform-context Business B-side subdomain · 3-repo split · @sm/* aliases 79 lines
    └─
social-media-toclient-whitelist C-side checkUidAndWhiteList · UID isolation · error codes 39 lines
      └─
product-review-template-library Domain rules · Redis lock · AI scoring · domain exceptions 67 lines
Horizontal cuts noise · vertical deps at topic level — declare once, no silent failure.
  • Vertical chain: topicDependencies expands four topic layers
  • Dependencies at topic level: declare once, every task inherits
  • No silent failure when a dependency is missing
case · groupon × coupon · hard-constraints

Every Topic Is a Guardrail Against AI Mistakes

Another storyline: group buying + general coupons. These constraints can never be guessed by AI "reading code" — written in topics, they block errors directly.

groupon · 01

joinGroupon · Same-Transaction Dual Write

Group join record + user stats table MUST be committed within the same sequelize.transaction().
NEVER write the join record first then open another transaction for stats — under concurrency, maxUserJoins will drift.
groupon · 02

maxUserTeamLeader · Isolated by Type

Team leader cap only counts groups of the current activity type,
cross-type counts do NOT accumulate; source of truth is QConfig groupon-setting.json · validField / maxUserJoins / needNewGuest must be read before any changes.
coupon · 03

Frontend Only Passes activityCode

Public API does not accept promotionId; backend resolves promotionId + couponConfigId via activityCode, all changes must go through @/utils/couponHelper.js.
Leaking promotionId allows unpublished campaigns to be enumerated.
coupon · 04

status Priority 0 > 1 > 2

Coupon claim status semantics: 0=failed · 1=success · 2=already claimed · 3=sold out · 4=not eligible.
When merging multi-source statuses, MUST follow priority 0>1>2>3>4 — not max, not min.
  • Last slide: breadth; this slide: density
  • Groupon dual-write throttling, coupon status priority — not guessable from code
  • Pitfall → f2s-kb-fix → topic → block the next mistake
  • KB grows with delivery, not a two-week doc dump upfront
feature · 03 / 03 · resume-across-sessions

Session Dropped · AI Picks Up Where It Left Off

A real task spanning three layers, 9 steps, completed across multiple sessions — shut down anytime, next time just say "continue."

.task/completed/20260511-product_review_review_publish_flow/task.md
# product_review_review_publish_flow
  • Step 1: Generate technical spec (API layer + B-side)
  • Step 2: API layer · Add 5 fields to article table
  • Step 3: Modify article creation endpoint
  • Step 4: Modify review endpoint (state transition: approved → pending publish)
  • Step 5: New article publish endpoint (backfill post link + partner code)
  • Step 6: B-side · Modify list/detail endpoints
  • Step 7: B-side · Modify edit endpoint
  • Step 8: Sync knowledge base
  • Step 9: Commit code

// Resume Experience

Next session, just say "help me continue the article publish flow" —
Keywords match the task in todo.json, AI reads out the remaining steps, auto-loads skill rules, and resumes from the last breakpoint.
LLMs have no cross-session memory · We use a .task/todo.json to explicitly bring it back.
user-todos.md also persists things only the user can do offline (run DDL, flip switches, deploy).
// .task/ · task ring
.task/
├── todo.json              ← Task index · keyword match to resume
├── active/
│   └── template_ai_score/
│       ├── task.md        ← Checklist ([x] = progress)
│       ├── context.md     ← Files involved · reference links
│       └── user-todos.md  ← User offline tasks (DDL · deploy)
└── completed/
    └── 20260511-product_review_review_publish_flow/
        ├── task.md        ← All ✅
        ├── context.md
        └── user-todos.md
todo.json → Keyword match → Read task.md remaining steps → Resume from breakpoint
  • Real task: three repos · 9 steps · multiple sessions
  • Say “continue” → todo.json match → resume task.md
  • user-todos.md for DDL, flags, release — human-only items on disk
  • Task ring is part of Memory Coding
collaboration · 27 authors · developerId isolation

Team Collab · Isolated Tasks, Shared Knowledge

Repo A · 27 authors · 2786 commits in 3 months. Task lists split by developerId; .Knowledge/ remains a single shared source.

// flow2spec.config.json (identical across 4 repos)
{
  "subAgent": true,
  "switchAgentVerification": true,
  "intentRecognition": true,
  "changeTracking": { "feat": true, "implement": true },
  "collaboration": { "enabled": true }
}
// .task/ isolated by developerId
.task/
├── alice/
│   ├── todo.json
│   ├── active/backfill_topics_for_reservation.../
│   └── completed/  ← 12 items
├── bob/
│   ├── todo.json
│   └── completed/  ← 8 items
└── charlie/
    └── completed/  ← 5 items

.Knowledge/ stays a shared team source
Collab scale
Repo A · 3 mo · 27 authors
Commit density
2786 commits · 43 archived tasks
Enabled
subAgent · switchAgentVerification · 100% on 4 repos
// key point Sub-agent writes → main-agent verifies; developerId isolates .task/ so concurrent revs never clash; shared topic single-source, private tasks stay separate.
  • Repo A: 27 authors, 2786 commits, 43 archived tasks — real team
  • collaboration.enabled=true + developerId isolates .task/
  • switchAgentVerification=true — cross-agent validation
  • Shared source is .Knowledge/, not task state
4 repos · same flow2spec stack · 40× scale span

4 Repos · Same Stack

From 3K-line C-side app to 129K-line frontend main — topic count grows roughly linearly. Not just for big projects.

Repo
Scale
topic / matcher
docs (stock / req)
archived tasks
3 mo commits
Repo AFrontend main · 3 yr
1012 files · 129K LOC
43 / 43
46 / 65
43 · 27 authors
2786
Repo BAPI service (serverless)
213 files · 26K LOC
25 / 23
14 / 54
11 · solo
185
Repo CB-side admin
73 files · 5788 LOC
20 / 18
6 / 5
19 · solo
180
Repo DC-side app (serverless)
28 files · 3174 LOC
15 / 14
2 / 1
7 · 2 authors
76
Total
1326 files · 165K LOC
103 / 98
68 / 125
80
3227
// observation Scale spans 40×; topics grow from 15 to 43. req-docs always outnumber stock-docs — proof the KB is iteration-driven, not a one-shot dump.
  • Cross-repo comparison: scale, topics, matchers, docs, tasks, commits
  • 40× scale span, topic count grows roughly linearly
  • req-docs outnumber stock-docs → iteration-driven
  • Combined 103 topics · 98 matchers · 193 docs · 80 archived · 3227 commits
onboarding · progressive-kb

Build as You Go · No Need to Finish First

The minimum viable set is 1 manifest entry + 1 matcher + 1 topic — the rest **grows with your requirements**.

init1 minute
Scaffold the Skeleton
# Generate .Knowledge/ + tool configs
$ npx @double-coding/flow2spec@latest init
Empty manifest-routing.json
Ready to run — zero knowledge written
→
First UseOne requirement
Seed Your First Knowledge
# 1. Whole-repo view
/f2s-doc-arch

# 2. Pre-ingest the modules you'll touch
/f2s-kb-add src/services/product-review
Whole-repo view + topics for the target modules
→ before real changes, the agent reads focused facts
→
DailyCode → Record → Commit
Development Loop
# One command for the full loop: code + record + commit check
/f2s-kb-feat    # New feature → code + topic synced to KB
/f2s-kb-fix     # Bug fix → update topic to prevent recurrence
/f2s-git-commit # Pre-commit check: topic coverage + commit format
Code, record knowledge, commit check — all in one flow
Knowledge base **grows with the business**, never decays
→
MaintenanceAs needed
Health Check · Alignment
# Code got ahead / merge conflict
/f2s-kb-sync   # Sync capabilities to KB — outline first, then persist
/f2s-kb-merge  # Handle context conflicts after rebase/merge
kb-sync: backfill KB after implementation lands
kb-merge: resolve knowledge conflicts after branch merges
// Knowledge Base + Project Config + Built-in Rule Topics
.Knowledge/ + Config
.Knowledge/
├── manifest-routing.json         ← Routing table
├── matchers/
│   └── *.json                       ← Keyword shards
├── topics/
│   └── <topic>.md                   ← Topic knowledge
├── stock-docs/
│   └── *.md                        ← Existing docs
└── req-docs/
    └── *.md                        ← Requirements + specs

flow2spec.config.json
├── subAgent: true/false              ← Sub-agent toggle
└── switchAgentVerification           ← Cross-verification
    changeTracking.feat/fix/implement ← Change tracking
.claude/rules/ · .cursor/rules/ (mirror synced)
f2s-* Built-in Rule Topics (package template → init persists)
├── f2s-config-check.md           ← Skill pre-flight mandatory step
├── f2s-knowledge-preflight.md    ← KB-first read constraint
├── f2s-karpathy-guidelines.md    ← Karpathy coding guidelines
├── f2s-task.md                    ← Change tracking spec
└── f2s-flow2spec-unified-entry.md ← Knowledge read order

init scaffolds → f2s-* skills grow with requirements → gap gate prevents silent drift
"Do I need to write all docs before I can use it?"→ init runs on day one — zero docs, no blockers
"How much is enough?"→ Start with 1 topic + 1 matcher — the gap gate will tell you
"Steep learning curve for the format?"→ No manual writing — f2s-* skills write, edit, and verify for you
"What if I write it but it doesn't work?"→ Add one, test one — matcher hit = verified
"Do I need to migrate the whole legacy project?"→ Nope. init the skeleton → next requirement hits a module, write that module
  • You do not need two weeks of docs first
  • Minimum: one route + one matcher + one topic
  • init in ~1 min; feat/fix daily; commit checks KB coverage
  • Write the slice you hit next — no big-bang migration
skills · command-map · 4 primary + 3 secondary

Command map

4 daily drivers cover ~80% · the rest fire on demand. flow2spec init lays scaffolding; with intentRecognition on, these triggers don't need a manual /f2s-* — plain natural language routes automatically.

daily · most frequent
f2s-kb-feat
Add feature · code + build topic
For new features. Code first, then guide topic + matcher + deps; changeTracking.feat auto-opens .task/.
"add a feature …" · "new capability …"
daily · most frequent
f2s-kb-fix
Fix bug · patch + prevent
For bug fixes. After code fix, encode the trap into a topic; AI won't step on it again nearby. Gap gate flags gaps.
"fix …" · "this should be …"
wrap-up · required
f2s-git-commit
3 gates · nothing slips
Enforces on commit: conflict scan · KB coverage · emoji + Conventional. No add -A, no hook-skip, no auto-push.
"commit" · "let's commit"
big-req entry
req-clarify → req-tech
Clarify → tech spec
For large requests. Two-batch clarify, self-check KB gaps, then produce tech spec + DDL if needed. Then implement-tech-design.
"clarify this …" · "make a tech spec …"
// the rest, on demand
Bootstrap / upgrade
flow2spec init new repo scaffold · f2s-kb-upgrade align legacy routes & matchers
Docs in
f2s-doc-pdf PDF→MD · f2s-doc-final finalize · f2s-doc-arch architecture · f2s-doc-milestone milestone
// KB upkeep · the trio
f2s-kb-distill
Extract during chat
While debugging or Q&A, capture reusable facts into KB inline — auto-decides "new topic" vs "extend existing"; no context switch.
"remember this in the KB"
f2s-kb-add
Bulk multi-file ingest
Sink existing capabilities in one pass — feed N docs/files at once, auto-generate draft → final → topic + matcher + routing.
"ingest these existing docs"
f2s-kb-sync
Global sync · catch-all safety net
Forgot to run kb-feat/fix? No problem — scans shipped capabilities, proposes a KB update outline; you confirm before write. Last-line-of-defense.
"sync the KB globally"
Rest: f2s-kb-addRules capture rules · f2s-kb-build finals→routing · f2s-kb-merge merge conflicts · f2s-kb-rm remove topic · f2s-req-plan task plan fallback
  • Command map — 4 daily drivers, rest on demand, don't memorize twenty skills
  • Primary 4: kb-feat · kb-fix · git-commit · req-clarify→req-tech
  • Secondary 3: bootstrap / docs / upkeep — one-line skim during talk
  • init lays scaffolding; business KB grows through f2s flows
live · demo · routemap

Real Case · Review Template Library

One main line, 6 steps end-to-end · with 10+ feat/fix micro-iterations along the way, all growing on the same knowledge chain.

1
/f2s-req-clarify "Build a template library for AI-polished user articles, with AI scoring for both templates and articles, readable from both B-side and C-side"
Clarification is "batch questions → you answer → AI cross-checks KB for gaps → another batch" iterative, not one-question-one-answer:
Round 1 · 12 questions at once
AI: Scope (ops-only editing? C-side template selection for posts? Version history? Dedup?) · Data shape (tags in separate table or inline? Many-to-many? Plain text or rich text? 3000 chars by character count? Image array — how many? Placeholders?) · Matching (U⊆L full coverage vs max intersection? When does weight +1? Can offline/deleted items be matched?)
Me: Answer all at once.
↓ AI self-check · Cross-references answers against 4-layer topics + stock-docs
Cross-checks product-review / common-modules / social-media-platform existing facts: discovers (a) batch method doesn't say whether to backfill on short count, (b) tie-breaking not specified, (c) image upload utility not named, (d) new endpoint or reuse existing not confirmed → follows up.
Round 2 · 4 follow-up questions targeting gaps
AI: Should needCount backfill when short? When |L| is minimum-equal, what's the tiebreaker? Image upload — reuse admin utils or new? B/C endpoints from scratch (currently 0)?
Me: No backfill, return as-is · Break ties by usage weight · Reuse admin utils · Both B/C from scratch.
→ AI cross-checks KB again, no gaps remaining → finalized as req-docs/product-review_template-library_req-clarify.md (10 sections · U⊆L three-tier rules) + companion product-review_article-publish-flow_tech-spec.md (postType / imageUrls / publishStatus transitions)
2
/f2s-req-tech matcher hit m-product-review-template-library
Auto-loads 4-layer topic dependencies (common-modules → social-media → product-review → template-library), produces req-docs/product-review_template-library_tech-spec.md + 5 DDLs (template library / tags / relations / scoring rules / agent prompt).
3
Once the spec is finalized, just say "implement this tech spec" or "continue" · Creates .task/active/template_ai_score/
No commands to memorize — reads the tech spec from req-docs/, AI triggers f2s-implement-tech-design, auto-splits into 8-step checklist: create scoring rules table → model → aiScoreHelper (mock first) → 4 CRUDs + serverless registration → fire-and-forget scoring on insert → batch rescore endpoint → list/detail pass-through aiScore → KB sync. Each step checked off, interruption-safe.
4
/f2s-kb-feat Describe the need = Implementation + Auto KB entry
c1d2e3f · Add rpAiForPeta
Me: Format is field mapping; model, endpoint, and apiKey are passed from the client — server only forwards + validates format
AI: Implement rpAiForPeta(fields, model, apiKey, endpoint) · Extract fields by mapping → build prompt → call specified model · model whitelist gpt-4o-mini / deepseek-chat · endpoint must be whitelisted domain · timeout 30s
→ topic "rpAiForPeta" mapping rules / client params / whitelist / timeout constraints
f4a5b6c · C-side: Add image upload method
Me: Upload images before posting to get CDN URLs, max 10MB per image, max 9 per upload
AI: POST /api/c/upload/image · Restrict formats to jpg/png/webp · Auth reuses posting token · base64 direct upload forbidden
→ topic "C-side image upload" endpoint path / limits / auth
a7b8c9d · User-uploaded articles also need scoring
Me: Not just the template library — user-uploaded articles need AI scoring too
AI: scoreContent is already generic → add scoring call to posting endpoint · results go to new user_article_score table, not the template library table
→ topic "scoring system" addendum: user article scoring → separate table
5
/f2s-kb-fix 3 iterations all through the same entry · each time updating the topic
① c8d9e0f1 · Scoring missed the title field
Me: Ops complained that scores fluctuate wildly for same content — I checked and scoreContent was only passing content to the Agent, title was completely missing
AI: Update to scoreContent(title, content, model?), include title as separate context in the prompt. Patch all six handler call sites. Update topic?
→ topic "scoring input structure" adds new row: title: string · required · used by Agent to understand topic intent
② 2a3b4c5d · scoreContentBatch: sequential → concurrent
Me: Batch rescore for 10 items takes 90 seconds — this method shouldn't wait one by one
AI: for-await changed to Promise.all for concurrent execution, tested 10 items in 9 seconds. Also extracted AI_BUSY error code from literal to _enum — prevents future scattering.
→ topic "batch rescore timing" changed from "sequential" to "concurrent" + added Redis mutex lock section (prevents concurrent avalanche)
③ 6e7f8a9b · Tag soft-delete → hard-delete
Me: After soft-deleting tags, the relation table still has stale data — queries occasionally return deleted tags. Switching to hard-delete.
AI: Changed tag deletion to hard-delete + transactional cleanup of commerce_review_template_library_tag_rel. Topic "tag lifecycle" previously said "soft-delete retained 180 days" — updated to "hard-delete + transactional relation cleanup."
→ topic corrected: delete semantics = hard-delete + transactional relation cleanup (old soft-delete description deprecated)
6
/f2s-git-commit Commit gate · conflict scan / KB coverage check / emoji + Conventional
Pre-commit enforces three checks: ① Conflict marker scan ② Topic covers new fields ✓ ③ First line 🚀 feat(product-review): template library + AI scoring · No add -A · No skipping hooks · No auto-push. B-side admin UI in a separate repo follows the same workflow.
One main line, 6 steps end-to-end · with 10+ micro-iterations all growing on the same knowledge chain.
  • Case: review template library → 17 APIs / ~4 days (scroll; pick highlights)
  • ① f2s-req-clarify: batch Q → answers → gap check → second round
  • ② f2s-req-tech: four-layer deps + tech doc + 5 DDL files
  • ③ Implement: “continue” → implement-tech-design + 8-step checklist
  • ④ f2s-kb-feat / ⑤ f2s-kb-fix: code + topics stay aligned
  • ⑥ f2s-git-commit: three checks; no auto push
honest · dont-use-when

Honest Talk · When NOT to Use It

Flow2Spec trades structural investment for long-term compound returns. In these three scenarios, the investment doesn't pay off — don't force it.

×
Throwaway Scripts · Temp Tools
For things you'll delete after writing, just toss a few Markdown files at AI — that's faster. Knowledge base maintenance is pure overhead.
×
Solo Small Projects · No Multi-Platform Needs
Just you, one AI, one machine — a single CLAUDE.md is enough. Routing and sharding overhead outweighs the benefit.
×
Team Won't Sync .Knowledge/
If code changes without syncing skills, the knowledge base decays anyway. Tools can't replace discipline — f2s-* only lowers the "cost of syncing."
  • Saying when not to use it builds trust
  • ① One-off scripts
  • ② Solo tiny repo — one CLAUDE.md may be enough
  • ③ Team will not maintain .Knowledge/ — discipline beats tooling
~/flow2spec · end · 02:00:00
// the takeaway

It's not about making AI smarter,
it's about keeping AI always aware of what you're working on

repo·github.com/double-coding-lab/Flow2Spec
install·npx @double-coding/flow2spec@latest init
upgrade·say f2s-kb-upgrade in chat (KB template upgrade, not init alone)
contact·Lan Tao
  • Close: context, not a smarter model
  • github.com/double-coding-lab/Flow2Spec · npx @double-coding/flow2spec@latest init
  • Existing projects: f2s-kb-upgrade for template alignment — init is not upgrade
  • Try it · issues · chat after the talk