KenXiao1/momentum
About
A self-control web app based on CTDP theory.
Web & App DevelopmentMeasured star growth
- in 24h
- 0
- in 7 days
- +1
- in 15 days
- +5
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README_EN.md
OriginalMomentum - A Psychology-Driven Focus Application
For development and verification, see CONTRIBUTING.md; see the documentation index for architecture and domain behavior.
A self-control training tool based on the Chained Time-Delay Protocol (CTDP) theory, designed to help users build powerful habit chains through the "Sacred Seat Principle," the "Principle of Precedent," and the "Linear Time-Delay Principle."
For more details, please see: https://www.zhihu.com/question/19888447/answer/1930799480401293785
You can also read this README on Zhihu: https://zhuanlan.zhihu.com/p/1932530006774505748
✨ Feature Highlights
| Feature | Description |
|---|---|
| 🔗 Chain Task Management | Habit chain system based on CTDP theory |
| 📦 Task Groups/Nested Chains | Combine multiple tasks into groups with cyclic execution |
| 🏛️ RSIP System | Recursive Steady-state Iteration Protocol for personal life rules |
| 🐾 Virtual Pet System | Earn rewards by completing tasks, raise your own pet |
| 🎰 Betting Mode | Optional incentive mechanism for extra motivation |
| ⏱️ Forward Timer | Support for tasks without time limits |
| 🗑️ Recycle Bin | Soft delete mechanism with recovery option |
| 📤 Import/Export | Complete data backup and migration support |
| ☁️ Cloud Sync | Multi-device sync via Supabase |
| 🎨 Glassmorphism UI | Modern frosted glass interface design |
🔀 Tauri Storage Modes (v0.3.2)
tauri-desktopandtauri-mobilenow default to Local mode on first launch.- If Supabase is configured, users see a one-time non-blocking prompt: keep local mode or connect cloud sync.
- Users can switch between Local mode and Cloud mode at any time in settings.
- Mode switching only changes the data source; there is no automatic import/export/merge.
- Virtual pet data remains device-local in both modes and is not synced cross-device.
🎯 Core Concept
Momentum is based on the Chained Time-Delay Protocol (CTDP) theory proposed by Edmond on Zhihu, which uses a mathematical model to solve self-control problems:
$$I = \int_{0}^{\infty} V(\tau) \cdot W(\tau) d\tau$$
Where:
V(τ)is the future value functionW(τ)is the weight discount function
🔬 The Three Core Principles
1. Sacred Seat Principle
By designating a specific trigger action (e.g., "put on noise-canceling headphones," "sit down at the study desk"), you create a "sacred seat." Once this action is triggered, you must complete the focus task in your best possible state. Each time you successfully complete the task, the chain record grows (#1 → #2 → #3...), forming a powerful psychological constraint.
2. Principle of Precedent
When faced with a potential rule violation, you have only two choices:
- Rule as Failure: The chain is reset to zero and you start over from #1.
- Rule as Permitted: The behavior is permanently added to the exception rules and must be allowed in all future instances.
This "case law" mechanism prevents the broken windows effect, allowing the rule boundaries to converge to their most rational state.
3. Linear Time-Delay Principle
This principle overcomes the difficulty of getting started by using a "pre-commitment chain":
- Set a pre-commitment signal (e.g., "snap your fingers").
- After giving the signal, you must start the main task within a specified time.
- This utilizes a time delay to lower the initial resistance to starting the task.
Use It Directly
https://momentumctdp.netlify.app/
📖 User Guide
Create Your First Chain
- Click "Create Your First Chain" or "New Chain."
- Set a name for the chain (e.g., "Learn Python").
- Choose a "Sacred Seat" trigger action (e.g., "Put on noise-canceling headphones").
- Set the task duration.
- Configure the pre-commitment chain settings:
- Pre-commitment signal (e.g., "Snap fingers").
- Pre-commitment duration (e.g., 15 minutes).
- Pre-commitment completion condition (usually the same as the main chain's trigger).
Using the Pre-commitment Feature
- Click "Pre-commit" on the task card.
- Perform the pre-commitment signal (e.g., snap your fingers).
- Fulfill the pre-commitment condition within the specified time.
- You will automatically enter focus mode.
Starting a Task Directly
- Click "Start Task."
- Perform the "Sacred Seat" trigger action.
- Enter the full-screen focus mode.
- Stay focused for the set duration.
Handling Interruptions
When you need to interrupt a task:
- Click "Interrupt/Rule Adjudication."
- Describe the specific behavior.
- Choose how to handle it:
- Rule as Failure: Resets the chain to zero.
- Rule as Permitted: Adds the behavior to the exception rules.
Managing Cards
📦 Task Groups
Task Groups allow you to combine multiple related tasks and execute them in sequence.
Creating a Task Group
- Click "New Task Group"
- Set the group name and description
- Configure time limits (optional)
- Set repeat counts
- Add child task units
Task Group Features
- Cyclic Execution: Child tasks execute in order, automatically moving to the next upon completion
- Time Limits: Set a total time limit for the entire group
- Repeat Control: Each child task can have its own repeat count
- Progress Tracking: Real-time display of current progress and remaining tasks
🏛️ RSIP System
The Recursive Steady-state Iteration Protocol (RSIP) is a personal rule management system that helps you establish and maintain various life rules.
Core Concepts
- Policy Nodes: Represent a life rule or habit
- Hierarchical Structure: Rules can have parent-child relationships, forming a rule tree
- Daily Limits: By default, only one new rule can be added per day to prevent over-commitment
- Violation Rollback: When a rule is violated, the node and all its children are deleted
How to Use
- Enter the RSIP view
- Create root or child nodes
- Set the rule title and description
- Optionally configure a timer
- Follow the rules daily to establish a stable life order
🐾 Virtual Pet System
Complete tasks to earn rewards and raise your exclusive virtual pet.
Pet Growth Stages
- 🥚 Egg (Lv.1-9)
- 🐣 Baby (Lv.10-24)
- 🐥 Child (Lv.25-49)
- 🐤 Teen (Lv.50-74)
- 🐔 Adult (Lv.75-99)
- 🦅 Elder (Lv.100)
Pet Attributes
- Hunger: Increases over time, needs feeding to reduce
- Happiness: Decreases over time, completing tasks increases it
- Health: Affected by hunger and happiness
- Experience: Earned by completing tasks, levels up and evolves
🎰 Betting Mode (Optional)
Add extra incentive mechanisms to your tasks.
- Place bets with points before starting a task
- Earn rewards upon successful completion
- Daily betting limits apply
- Only available in Supabase cloud sync mode
🗑️ Recycle Bin
Accidentally deleted chains can be recovered.
- Deleted chains are moved to the recycle bin
- Can be restored or permanently deleted at any time
- Automatic cleanup of expired items
📤 Import/Export
Complete data management functionality.
- Export all chains, history, RSIP nodes, and exception rules
- Support for incremental merge imports
- Smart ID conflict handling
- Works with both local and cloud modes
🚀 Use Locally
Prerequisites
- Node.js: see
.nvmrcandpackage.json(engines.node) - npm or yarn
- To enable Supabase cloud mode, configure:
VITE_SUPABASE_URLVITE_SUPABASE_ANON_KEY
Installation Steps
- Clone the project
git clone https://github.com/KenXiao1/momentum.git
cd momentum
- Install dependencies
npm install
- Start the development server
npm run dev
- Build for production
npm run build
- Preview the production build
npm run preview
Sponsors
Big love to our sponsors for making continued maintenance possible (๑>◡<๑)ノ ❤️

📄 License
This project is licensed under the GPL-3.0-only license - see the LICENSE file for details.
Completed Features ✅
Chainable Nested Work Units (Task Groups)
- Combine multiple tasks into task groups
- Cyclic execution, time limits, repeat control
Out-of-the-box Presets
- Trigger templates and auxiliary signal templates
- Bilingual support (Chinese/English)
- Exception rule presets
- still working
RSIP Implementation (Recursive Steady-state Iteration Protocol)
- Complete personal rule management system
- Hierarchical structure, daily limits, violation rollback
Virtual Pet System
- 6 growth stages, 100-level progression system
- Hunger, happiness, and health attributes
- Task completion reward mechanism
Betting Mode
- Optional task incentive mechanism
- Points system with daily limits
Recycle Bin
- Soft delete mechanism
- Restore and permanent delete functionality
Import/Export
- Complete data backup and migration
- Incremental merge support
TO DO
- Mobile Optimization
- More Pet Appearances and Animations
- Social Features (Leaderboards, Friends System)
- More Detailed Statistics Dashboard
📞 Contact
If you have any questions or suggestions, please send an email to: [email protected]
My Zhihu Account: https://www.zhihu.com/people/blues-68-53
My personal website: https://kenxiao.netlify.app/
Explore related projects
Loading…