flowsim
Skill0 starsChanged 39 days agoMITView on GitHub
Trace the claimed flow from a plan or task through the source code and report mismatches. This is a structured code-review pass formatted as a narrative execution trace — the goal is to surface "the plan said X but the code does Y" gaps that test suites and evals miss. Use during the /sdlc fix loop, after implementing a feature, or ad hoc when a plan and its implementation feel misaligned. Invoke via /flowsim or when the user says "trace the flow", "verify the plan matches", "walk through what actually happens".
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- brainstormSkill
- brainstorm-teamSkill
- code-tourSkill
- dead-code-reviewSkill
- docstring-syncSkill
- gotchaSkill
- plan-htmlSkill
- repo-healthSkill
- repo-onboardingSkill
- sdlcSkill
- sdlc-statusSkill
- taskSkill
- test-checkSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 2 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Before tracing, look for plans/flowsim-<feature-slug>.json from a previous run (or docs/plans/flowsim-<feature-slug>.json in a skill repo — …
- Very specific: line 60
If plans/flowsim-<feature-slug>.json does not exist, proceed normally — no cache, every flow is traced fresh.
- Very specific: line 78
Every anchor must be a real
file:linereference: If you can't find one, mark MISSING. - Very specific: line 84
If .claude/project.json has eval.features_dir and results exist for this feature:
- Distinctive: line 87
No eval for this flow → note "no eval coverage for this flow".
- Very specific: line 109
Write the cache: After producing the report, write the flows array plus a written_at timestamp to plans/flowsim-<feature-slug>.json (or …
- Distinctive: line 125
Three hops max by default: If the plan implies a 5-hop flow, split it into two flows of 3 hops each.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flowsim — plan vs. implementation flow verification
Framing
This is NOT a program simulator. It's a structured code review formatted as a narrative trace: "the plan claims X → grep/read the code → report what actually happens". Flowsim keeps the scope tight on purpose.
Inputs
Also called inline by /sdlc Stage 5 (as its flow axis) whenever a parent plan
is available.
- Plan source: a
plans/brainstorm-<slug>.mdfile, aplans/tasks/task-N-<slug>.mdfile, or a TASKS.md row. The plan must describe at least one flow: entry point → steps → outcome. Skill-repo detection (same idiom/sdlcuses): if.claude-plugin/marketplace.jsonexists at repo root, the plan lives atdocs/plans/<slug>.mdinstead — resolve the plan there, and resolve the cache (step 0 and step 4 below) beside it indocs/plans/too, so both steps agree on one location. - Optional:
--max-hops N(default 3) — how many function/module jumps to follow per flow. - Optional:
--focus <module>— restrict tracing to one module (useful for large features). - Optional:
--force— ignore the prior-run cache (see Flow step 0) and re-trace every flow. - Optional signal: latest test results as corroborating evidence. Two sources, either counts:
- eval results at
<eval.features_dir>/<feature>/results.json(script/eval-runner features), and/or test.unitresults (app-package features whose coverage was routed to the project's native unit suite — see/sdlcStage 3). A passing unit test exercising a traced flow corroborates it; a failing one is a pre-existing mismatch. Flowsim degrades to mostly-grep only when neither source exists — having unit results (not just eval results) keeps the trace meaningful for the common app-code feature.
- eval results at
Flow
0. Check the prior-run cache
Before tracing, look for plans/flowsim-<feature-slug>.json from a previous run (or
docs/plans/flowsim-<feature-slug>.json in a skill repo — see the skill-repo detection note
above). If it exists and --force was NOT passed:
- Load the prior flows array.
- For each prior flow with
status: "MATCH"and every step anchored to a realfile:line, check whether any of those anchor files have been modified since the cache was written (compare cache file mtime against each anchor file's mtime). - If no anchor files have changed: mark that flow as
cached-MATCHand skip re-tracing it in step 2. It carries through to the report unchanged. - If any anchor file has changed, or the flow had any non-MATCH status: re-trace from scratch in step 2.
This trims re-runs after a fix loop — flows whose code paths were not touched by the fix do not need to be re-walked.
If plans/flowsim-<feature-slug>.json does not exist, proceed normally — no
cache, every flow is traced fresh.
1. Extract claimed flows
From the plan, identify each distinct flow — a user/system action and its claimed path. List each flow as a numbered item. Stop here and ask the user to confirm if the plan is vague enough that you'd be guessing at the flows — do not invent flows that the plan didn't claim.
2. Trace each flow through the code
Skip any flow marked cached-MATCH in step 0 — its prior trace is reused as-is.
For every other flow, walk through up to --max-hops steps. At each hop, record:
- Claimed step: what the plan says happens.
- Code anchor: file path + line number + function/symbol name. Found via grep/read.
- Actual behavior: one sentence on what the code does at that anchor.
- Status:
MATCH/MISMATCH/UNCLEAR/MISSING.
Rules:
- Every anchor must be a real
file:linereference. If you can't find one, markMISSING. - Follow the actual call chain, not what the plan hopes for. If the plan says A→B→C but the code does A→D→C, report A→D→C and flag
MISMATCHat step 2. - Stop at
--max-hopseven if the chain continues. Note this as "truncated at hop N — continue manually if needed".
3. Cross-reference with evals and tests
If .claude/project.json has eval.features_dir and results exist for this feature:
- A passing eval that exercises the traced flow → note as "corroborated by eval
<name>". - A failing eval → flag as "pre-existing failure:
<test>— may indicate theMISMATCHis known". - No eval for this flow → note "no eval coverage for this flow".
Also check the test.unit / test.e2e config for tests matching the flow's surface (e.g., a POST /api/orders flow should have a route test). Don't re-run them — just note whether they exist.
4. Report
Produce a markdown block:
## Flowsim: <feature name>
### Flow 1: <one-line description>
| # | Claimed | Anchor | Actual | Status |
|---|---------|--------|--------|--------|
| 2 | Validates payload via OrderSchema | `api/schemas/order.py:10` `OrderSchema` | Schema exists but missing `payment_method` field | **MISMATCH** |
**Summary**: Flow 1 deviates from the plan at step 2, corroborated by a failing eval.
### Flow 2: ...Write the cache. After producing the report, write the flows array plus a written_at
timestamp to plans/flowsim-<feature-slug>.json (or docs/plans/flowsim-<feature-slug>.json
in a skill repo — the same location step 0 read from), creating that directory first if it
doesn't exist. This is the cache step 0 of the next run reads, so a fresh run always leaves
one behind — including a cached-MATCH run, so the written_at mtime advances and a later
run's staleness check has a current baseline to compare against.
{
"flows": [ /* the per-flow status/steps this run produced, including any carried-through cached-MATCH entries */ ],
"written_at": "2026-09-20T00:00:00Z"
}Output limits
- Three hops max by default. If the plan implies a 5-hop flow, split it into two flows of 3 hops each.
- Never edits source. Flowsim writes its own cache file (above) and nothing else — it never touches the code it's tracing. Hand findings to the user (or, when running inside the pipeline, to Stage 5's fix loop).
- Cap output at ~60 lines of markdown unless there are many flows. A 200-line flowsim report is a sign the plan is too ambitious for one feature.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

