MindFlow
or Paper
Simplified Chinese | English
MindFlow is an AI-native autonomous decision system for knowledge management, cognitive evolution, and task execution.
It is not just a multi-agent orchestrator, and it is not just a knowledge base. It is closer to an editable digital persona system: you define a Soul, let the system absorb methodology and working styles that match your standards, internalize them into Capability components, execute work through those capabilities, reflect on outcomes, strengthen cognition, and keep evolving without drifting away from your own principles.

This repository currently provides:
- runtime protocol
- directory rules
- module documentation
- file templates
- learning and review promotion paths
It is not a finished application with a built-in automatic executor, but it is still a complete system design.
The Problem
Individuals and organizations usually face the same problems in knowledge work:
- methodology never truly enters the system
- important preferences, principles, and ways of working stay in people’s heads or scattered documents
- AI drifts easily
- without stable constraints, output drifts away from personal or organizational standards
- knowledge does not automatically become capability
- what gets learned often remains documentation instead of becoming reusable execution units
- task execution and knowledge accumulation are disconnected
- work gets done, but the experience does not become the next stable capability
- ordinary agent workflows can execute, but they do not self-correct under a stable philosophy
- there is no durable mechanism for learning, reflection, and cognitive strengthening
The Solution
MindFlow is designed as a set of stable layers:
Soul
- defines long-term standards, preferences, taboos, and methodological direction
Learning
- reads formal knowledge before work and pushes new knowledge through a reviewed promotion path after work
Mind
- owns system-level cognition such as recognition, analysis, execution, execution control, reflection, and inference
Capability
- turns learning outcomes into executable components
Plan + Step
- turns a task into a formal execution file and runs through file-based handoff
Task State
- persists runtime state so recovery, parallel merge, and resumption are controllable
So the intended system behavior is not “do a task and maybe write some notes after.”
Instead it works like this:
- read formal knowledge under the guidance of
Soul
- recognize and analyze the task through
Mind
- generate a formal
Plan
- execute through
Capability units
- reflect, learn, review, consolidate, and upgrade capability
For stable real execution, MindFlow also requires a formal runtime state surface:
- what phase the task is currently in
- which step is currently active
- which steps are completed, failed, or blocked
- where parallel branches are waiting to merge
- whether the task is ready to enter
Reflection
Step does not only support sequential execution. It also supports parallel execution:
- some
Steps run sequentially
- some
Steps may run in parallel
- parallel branches may expand into multiple concurrent
Tasks or Subagents
- the results of parallel branches still converge through file-based handoff
Design Philosophy
1. Soul comes before intelligence
MindFlow does not pre-fill a worldview, but it requires a Soul structure first.
The purpose is not roleplay. The purpose is to give the system a highest constraint layer:
- what counts as a good result
- which methods are preferred
- what must not be done
- what is worth learning
- what must never be promoted into the system
2. Learning is not document storage, it becomes capability
In MindFlow, the goal of learning is not to pile up documents.
The goal is for approved knowledge to eventually become callable capability.
That means:
- documents are intermediate states
Capability is the formal executable shape of learning
3. Execution is file-driven, not improvisational
MindFlow does not rely on implicit context passing.
It requires:
- a formal
Plan
- multiple
Steps inside the plan
- file handoff through
cache/
- final results written into
_output/
This makes tasks reviewable, auditable, reproducible, and constrainable.
4. Reflection is cognitive strengthening, not just summary
After execution, the system must enter Reflection -> Learning.
This is not just for writing a summary. It is for:
- detecting problems
- identifying what is worth learning
- discovering capability gaps
- strengthening cognition and capability
- preventing the system from drifting away from reality over time
MindFlow is therefore a task system with a built-in self-cultivation loop.
Why MAS Matters Here
The execution layer of MindFlow is effectively MAS.
Not because “multi-agent” sounds advanced, but because real knowledge work naturally requires multiple kinds of capability:
- some capabilities research
- some structure information
- some perform concrete actions
- some evaluate outputs
Breaking work into multiple Capability units coordinated by Plan + Step gives practical advantages:
- clear capability boundaries
- easier maintenance of each unit
- more stable task decomposition
- less context contamination through file-based handoff
- better local reflection and capability upgrade after each task
Plan therefore does not require all Steps to be serial.
When the task fits parallelization, Steps may run in parallel to improve execution efficiency for complex work.
So MindFlow is not “MAS first, then find a use case.”
It is “knowledge work naturally requires capability division, so the execution layer uses MAS.”
Core Flow
When a task is run under the MindFlow protocol, it must follow this flow:
Task -> Learning(Read) -> Recognition -> Analysis -> Planning -> Execution Control -> Reflection -> Learning
Learning(Acquire) may be triggered conditionally during Execution Control (mid-step) or after Reflection (post-reflection) — see SYSTEM.md §Phase Transition Protocol for details.
This means:
Learning(Read)
- reads approved and consolidated formal knowledge
Recognition
- identifies the task and produces
Task Profile
Analysis
- decomposes the task and produces
Analysis Output
Planning
Execution Control
- advances
Steps according to the formal Plan
- manages serial execution, parallel execution, merge, and failure handling
Plan
Step
- calls different
Capability units
- may run sequentially or in parallel
Reflection
- reviews the completed task and produces
Reflection Report
Learning
- moves task experience into the learning pipeline, eventually forming formal knowledge or capability updates
Flow Diagram
Soul
|
constraints on every stage
|
.--------------------------------------------------------.
| | | | |
v v v v v
Task --> Learning(Read) --> Recognition --> Analysis --> Planning
^ |
| v
| Plan
| |
| v
| Execution Control
| |
| v
| Step
| |
| v
| Capabilities
| |
| v
| tasks/{task-id}/_output/
| |
| v
| Reflection
| |
| v
| Learning
| |
| v
'------------------------- Approved Knowledge / Capability Update
The diagram above shows how a task flows through the system, so it is a flow diagram, not the architecture diagram.
Outputs and Materials
Under the current repository rules, MindFlow uses two different result locations:
- default task result directory:
tasks/{task-id}/_output/
- optional publish-back directory:
sources/
Rules:
- the system flow depends on
_output/
Reflection reads _output/ by default
- writing back to
sources/ is only allowed when explicitly declared in Plan
That means:
_output/ is the formal internal task result location
sources/ is the business material and publication location
Two Trees: Protocol and Runtime
MindFlow separates what upstream maintains from what you own.
Protocol Root (git, upstream) Runtime Root (yours, never committed)
MindFlow/ runtime/ (default)
├── README.md ├── mind/
├── README-CN.md │ ├── soul/core.md
├── SYSTEM.md │ └── learning/
├── CLAUDE.md │ ├── knowledge-base/
├── CONTRIBUTING.md │ │ ├── approved/
├── mind/ module docs │ │ ├── drafts/
│ ├── soul/README.md │ │ └── archived/
│ ├── recognition/ │ ├── task-learning/
│ ├── analysis/ │ ├── reviews/
│ ├── planning/ │ ├── knowledge-gaps/
│ ├── execution-control/ │ └── capability-updates/
│ ├── reflection/ ├── capabilities/
│ ├── learning/ ├── tasks/{task-id}/
│ └── inference/ └── sources/
├── capabilities/ TEMPLATE only
├── tasks/ TEMPLATE only
├── sources/README.md
├── templates/ seed for a new runtime
└── runtime/ git-ignored default runtime
The protocol tree is read-only for you: it is maintained upstream, so git pull must never conflict with your own work. Everything durable and continuously edited — Soul, approved knowledge, reviews, task runs, capability definitions, project materials — lives in the Runtime Root instead.
Names are identical in both trees. mind/soul/core.md means the same relative path; only the tree it resolves against changes. Runtime paths resolve against the Runtime Root, protocol paths against the Protocol Root.
Choosing a Runtime Root
Resolution order, recorded in tasks/{task-id}/state.md §Runtime Root so recovery writes back to the same tree:
MINDFLOW_RUNTIME_ROOT, when set
<Protocol Root>/runtime/ — the default
- an explicit path from the caller, for one runtime per project
Initializing a fresh runtime is copying templates/ into it.
Directory Structure
MindFlow/
├── README.md
├── README-CN.md
├── SYSTEM.md
├── CLAUDE.md
├── mind/
│ ├── soul/
│ ├── recognition/
│ ├── analysis/
│ ├── planning/
│ ├── execution-control/
│ ├── reflection/
│ ├── learning/
│ │ ├── learning-read/
│ │ ├── knowledge-base/
│ │ │ ├── approved/
│ │ │ ├── drafts/
│ │ │ └── archived/
│ │ ├── task-learning/
│ │ ├── reviews/
│ │ └── capability-updates/
│ └── inference/
├── capabilities/
├── sources/
├── tasks/
├── templates/
└── runtime/ (git-ignored)
Architecture
┌────────────────────────────────────────────────────────────────────────────┐
│ Entry Layer │
│ User / External Trigger │
└────────────────────────────────┬───────────────────────────────────────────┘
│
v
┌────────────────────────────────────────────────────────────────────────────┐
│ MindFlow Core │
│ │
│ Mind ──┬── Soul │
│ ├── Learning(Read) │
│ ├── Recognition │
│ ├── Analysis <··· Inference (conditional) │
│ ├── Planning │
│ ├── Execution Control │
│ ├── Reflection <··· Inference (conditional) │
│ ├── Learning(Terminal) <··· Inference (conditional) │
│ └── Inference │
└────────────────────────────────┬───────────────────────────────────────────┘
│
┌────────────────────────────┼──────────────────────────────┐
v v v
┌──────────────┐ ┌───────────────────────────────┐ ┌───────────────────────┐
│ Material │ │ Task System │ │ Capability System │
│ Layer │ │ │ │ │
│ Sources ────┼─>│ Task │ │ Capabilities <──┐ │
│ <·· Plan │ │ └─> Learning(Read) │ │ │ │ │
│ (publish- │ │ └─> Recognition │ │ v │ │
│ back) │ │ └─> Analysis │ │ (called by │ │
└──────────────┘ │ └─> Exec │ │ Step) │ │
│ └─>Plan │ └──────┬───────────┘ │
│ Plan ─> Exec │ │ │
│ Ctrl │ │ │
│ Exec Ctrl │ │ │
│ └─> Step ───┼────> Capabilities │
│ │ │ │ │
│ Task Cache <─┼──────┘ │ │
│ Task Output<─┼──────────────┘ │
│ │ │ │
│ v │ │
│ Reflection │ │
│ │ │ │
│ v │ │
│ Reflection Report │ │
└───────────────────┬───────────┘ │
│ │
v │
┌─────────────────────────────────────────────────────────────────────┐ │
│ Learning System │ │
│ │ │
│ Learning(Terminal) │ │
│ └─> Task Learning │ │
│ └─> Draft Knowledge ───> Archived Knowledge │ │
│ └─> Review │ │
│ ├─> Approved Knowledge ──> Learning(Read) │ │
│ └─> Capability Update ──────────────────────────┼──>───┘
│ │
│ Learning(Acquire) — conditional │
│ (triggered by Step or Reflection on knowledge gap) │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ Search (record candidate URLs) │ │
│ │ └─> Fetch & Preserve (save verbatim to raw-sources/) │ │
│ │ └─> raw-sources/src-NNN-slug.md │ │
│ │ └─> Verify (independent subagent) │ │
│ │ └─> passed sources only ──> Task Learn │ │
│ └──────────────
提示:代码过长已自动截断
The diagram above is the architecture diagram. It shows the structural relationship between the core concepts, systems, and artifact layers.
How to Use This Repository
This repository is intended for people or organizations who want to define their own knowledge system, runtime rules, learning chain, and capability evolution mechanism.
Typical usage:
- initialize a Runtime Root by copying
templates/ into it (see §Two Trees above)
- define
Soul in mind/soul/core.md inside that Runtime Root
- define or extend
Capability files under capabilities/ in the Runtime Root
- place project materials in
sources/ in the Runtime Root
- create
tasks/{task-id}/ in the Runtime Root
- run the task according to the formal MindFlow protocol
- let task-end
Learning promote reusable knowledge and capability updates
Every path in steps 2–5 resolves against the Runtime Root, never this repository.
Run It With One Skill (Recommended)
Doing the six steps above by hand means remembering every module’s loading boundary, the state.md transition rules, and every self-check gate yourself. The shortcut is a mindflow skill that lets your AI runtime execute this protocol for you.
The protocol is the skill. Everything lives in one directory, skills/mindflow/: SKILL.md plus SYSTEM.md, CLAUDE.md, CONTRIBUTING.md, the module docs, and the runtime seed. Installing the skill installs the whole protocol, and the skill reads its own directory rather than guessing where a checkout might be.
Install
The skill is one self-contained directory. Point your runtime’s skill directory at it:
git clone https://github.com/neil-wang-global/MindFlow.git ~/.mindflow/MindFlow
ln -s ~/.mindflow/MindFlow/skills/mindflow ~/.dsh/skills/mindflow
Replace ~/.dsh/skills with whatever directory your runtime scans. Then call /mindflow <task description> from any directory.
Because the protocol and the skill are one directory, git pull updates both at once and they can never drift. Your own state is untouched by that pull — it lives in a separate Runtime Root.
What it does for you
- Sync the protocol: pulls latest
main in the directory the skill lives in; when that directory is not a git checkout (the skill was copied out), it skips the pull and says so. Because your state lives in a separate Runtime Root, this pull is not competing with your own edits
- Resolve and initialize the Runtime Root: picks
MINDFLOW_RUNTIME_ROOT if set, otherwise runtime/ inside that checkout, and seeds it from templates/ on first use
- Soul readiness check: while the Runtime Root’s
mind/soul/core.md is still To be defined, it fills the eight fields together with you — that is the highest constraint layer
- Resume instead of restart: if a task’s state is not
completed / cancelled, it continues from the recorded phase per SYSTEM.md §Recovery Protocol, using the Runtime Root recorded in state.md, rather than starting over
- Run the whole main flow:
Learning(Read) -> Recognition -> Analysis -> Planning -> Execution Control -> Reflection -> Learning, including terminal Learning knowledge promotion, knowledge gaps, and capability updates
- Dispatch subagents only where the protocol demands independence:
Learning(Acquire) verification and review-*.md, each with the full mind/soul/core.md from that Runtime Root injected into its prompt
Task artifacts land in {runtime}/tasks/{task-id}/, with formal results in {runtime}/tasks/{task-id}/_output/. Nothing is written back into the protocol tree; the skill does not create commits there by default.
Without the skill
The skill is a Markdown prompt — read it and follow it by hand: skills/mindflow/SKILL.md.
If your runtime supports custom agent instruction files, this repository’s AGENTS.md (and CODEX.md, GEMINI.md, CURSOR.md, and others) are symlinks to the skill’s CLAUDE.md — same protocol, you just have to remember to sync the repo yourself.
Watch It With MindFlow Studio
The skill gives you a terminal conversation. If you would rather see a runtime
at a glance, MindFlow Studio
is a DeepSeek Harness plugin that puts the same Runtime Root behind a workbench:
- every task with its live phase, read straight from
state.md
- the task’s own conversation docked beside the progress, so a question goes to
the run that is producing the answer
- artifact preview with Markdown rendering, and the
Plan with each Step’s
definition next to its live status
- Soul editing, plus read-only knowledge and capability views
Install it with dsh plugin --profile web add mindflow-studio in a profile that
already has the skill set up. Studio reads the same Runtime Root; it never writes
into the protocol tree.
What Makes It Different
MindFlow is different from the following common systems:
- a plain knowledge base
- because it does not stop at storage; it turns approved learning into executable capability
- a plain workflow engine
- because it is constrained by
Soul and has built-in reflection and learning promotion
- a plain agent loop
- because it uses formal artifacts, runtime state, file-based handoff, and a review-controlled promotion path
- a multi-agent orchestrator for its own sake
- because MAS is only the execution layer, not the identity of the whole system
评论