pulse-framework-cli 0.4.9 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/cursor/pulse.mdc +118 -126
package/package.json
CHANGED
|
@@ -4,174 +4,166 @@ globs: *
|
|
|
4
4
|
alwaysApply: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# ⛔⛔⛔ MANDATORY
|
|
7
|
+
# ⛔⛔⛔ MANDATORY: CALL `pulse_status` FIRST ⛔⛔⛔
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
**EVERY message. EVERY time. No exceptions.**
|
|
9
|
+
**BEFORE doing ANYTHING, call:**
|
|
12
10
|
|
|
13
11
|
```
|
|
14
|
-
|
|
12
|
+
pulse_status({ userMessage: "<user's message>" })
|
|
15
13
|
```
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
This rule applies to message #1, #2, #3, #50, #100 - ALWAYS.
|
|
19
|
-
|
|
20
|
-
**Why?** The MCP tools track your session, prevent loops, and enforce safeguards.
|
|
21
|
-
Without calling `pulse_status`, you're flying blind.
|
|
15
|
+
**Then follow the AUTO-ACTIONS below based on what you detect.**
|
|
22
16
|
|
|
23
17
|
---
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
- ❌ STOP - Do NOT proceed with user's request
|
|
27
|
-
- Run `pulse_doctor` to see details
|
|
28
|
-
- Wait for user instruction
|
|
29
|
-
|
|
30
|
-
**If pulse_status returns OK:**
|
|
31
|
-
- ✅ Continue with user's request
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
# PULSE Framework Safeguards
|
|
36
|
-
|
|
37
|
-
## 🔴 MANDATORY CHECKS (EVERY response, EVERY message)
|
|
19
|
+
# 🤖 AUTO-EXECUTE RULES (NOT suggestions - DO THEM!)
|
|
38
20
|
|
|
39
|
-
|
|
21
|
+
## 1️⃣ EVERY MESSAGE: `pulse_status`
|
|
40
22
|
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
WHY: Keeps safeguards active, prevents amnesia between messages
|
|
23
|
+
ALWAYS call pulse_status FIRST with the user's message.
|
|
24
|
+
This tells you what to do next.
|
|
44
25
|
```
|
|
45
26
|
|
|
46
|
-
|
|
47
|
-
If you notice you're repeatedly "checking" without progressing (e.g., status → grep → status → grep):
|
|
48
|
-
- STOP after 2 cycles
|
|
49
|
-
- Make a concrete change (minimal scope) OR ask a single clarifying question
|
|
50
|
-
- If you're stuck, use `pulse_correct` ("I'm stuck in verification mode; proceed with the minimal implementation") or `pulse_escalate`
|
|
51
|
-
|
|
52
|
-
### 2. AFTER Code Changes: Call `pulse_doctor`
|
|
27
|
+
## 2️⃣ NEW TASK DETECTED → `pulse_run`
|
|
53
28
|
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
29
|
+
IF user says: "new", "implement", "create", "build", "add feature", "start"
|
|
30
|
+
THEN: IMMEDIATELY call pulse_run({ action: "<what user wants>" })
|
|
31
|
+
DO NOT ask for confirmation. Just do it.
|
|
57
32
|
```
|
|
58
33
|
|
|
59
|
-
|
|
34
|
+
## 3️⃣ CODE CHANGED → `pulse_doctor`
|
|
60
35
|
```
|
|
61
|
-
|
|
62
|
-
|
|
36
|
+
IF you just edited/created/deleted any file
|
|
37
|
+
THEN: IMMEDIATELY call pulse_doctor()
|
|
38
|
+
DO NOT skip this. Every code change needs a doctor check.
|
|
63
39
|
```
|
|
64
40
|
|
|
65
|
-
##
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
| >10 min since checkpoint | → `pulse_checkpoint` | Just do it, don't ask |
|
|
72
|
-
| >30 min autonomous | → **STOP + ask user** | "I've been working 30 min, should I continue?" |
|
|
73
|
-
| 2-3 failed attempts | → `pulse_escalate` | Build fails twice, test fails twice |
|
|
74
|
-
| Error you don't understand | → `pulse_escalate` | Cryptic error message |
|
|
75
|
-
| User says "that's wrong" | → `pulse_correct` | Course correction |
|
|
76
|
-
| Task completed successfully | → `pulse_learn` | "What did I learn from this?" |
|
|
77
|
-
| Before "done" / PR / merge | → `pulse_review` | Final checklist |
|
|
78
|
-
| New multi-step task | → `pulse_run` | User gives complex task |
|
|
79
|
-
| Loop signal detected | → `pulse_reset` | Doctor shows loop warning |
|
|
80
|
-
| DELETE operation | → **Get user confirmation** | "May I delete X?" |
|
|
81
|
-
|
|
82
|
-
## 🔴 SAFEGUARDS (non-negotiable)
|
|
41
|
+
## 4️⃣ >10 MIN SINCE CHECKPOINT → `pulse_checkpoint`
|
|
42
|
+
```
|
|
43
|
+
IF pulse_status shows >10 min since checkpoint
|
|
44
|
+
THEN: IMMEDIATELY call pulse_checkpoint({ summary: "<what you did>" })
|
|
45
|
+
DO NOT ask. Just checkpoint. Code safety > asking permission.
|
|
46
|
+
```
|
|
83
47
|
|
|
84
|
-
|
|
48
|
+
## 5️⃣ TASK DONE → `pulse_review`
|
|
49
|
+
```
|
|
50
|
+
IF you're about to say "done", "finished", "complete", "ready for PR"
|
|
51
|
+
THEN: FIRST call pulse_review()
|
|
52
|
+
DO NOT claim done without review. Ever.
|
|
53
|
+
```
|
|
85
54
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
55
|
+
## 6️⃣ USER SAYS "WRONG" → `pulse_correct`
|
|
56
|
+
```
|
|
57
|
+
IF user says: "wrong", "no", "stop", "not what I meant", "undo"
|
|
58
|
+
THEN: IMMEDIATELY call pulse_correct({ feedback: "<what's wrong>" })
|
|
59
|
+
DO NOT defend your work. Correct it.
|
|
60
|
+
```
|
|
91
61
|
|
|
92
|
-
##
|
|
62
|
+
## 7️⃣ 2-3 FAILURES → `pulse_escalate`
|
|
63
|
+
```
|
|
64
|
+
IF same error occurs 2-3 times OR you don't understand the error
|
|
65
|
+
THEN: IMMEDIATELY call pulse_escalate({ problem: "...", tried: "..." })
|
|
66
|
+
DO NOT try a 4th time. Escalate.
|
|
67
|
+
```
|
|
93
68
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
69
|
+
## 8️⃣ PROBLEM SOLVED → `pulse_learn`
|
|
70
|
+
```
|
|
71
|
+
IF you just fixed a bug, resolved an escalation, or solved a tricky problem
|
|
72
|
+
THEN: call pulse_learn({ problem: "...", solution: "...", rule: "..." })
|
|
73
|
+
This builds knowledge for future sessions.
|
|
74
|
+
```
|
|
99
75
|
|
|
100
|
-
|
|
76
|
+
## 9️⃣ CRITICAL FINDINGS → STOP
|
|
101
77
|
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
4. Inform user
|
|
78
|
+
IF pulse_status or pulse_doctor shows CRITICAL
|
|
79
|
+
THEN: STOP IMMEDIATELY. Do NOT continue with user's request.
|
|
80
|
+
Fix the critical issue first or ask user how to proceed.
|
|
106
81
|
```
|
|
107
82
|
|
|
108
|
-
|
|
83
|
+
---
|
|
109
84
|
|
|
110
|
-
|
|
85
|
+
# 🔴 NON-NEGOTIABLE SAFEGUARDS
|
|
111
86
|
|
|
112
|
-
|
|
113
|
-
2. **Call `pulse_escalate`** with:
|
|
114
|
-
- Problem description
|
|
115
|
-
- What you tried
|
|
116
|
-
- Error message
|
|
117
|
-
3. **WAIT** for user instruction
|
|
87
|
+
These ALWAYS apply, even if user says otherwise:
|
|
118
88
|
|
|
119
|
-
|
|
89
|
+
| Safeguard | Rule |
|
|
90
|
+
|-----------|------|
|
|
91
|
+
| ⏱️ **Time** | MAX 30 min autonomous, then STOP + ask |
|
|
92
|
+
| 🗑️ **Delete** | NEVER delete without explicit "May I delete X?" |
|
|
93
|
+
| 📤 **Push** | NEVER push without explicit "May I push?" |
|
|
94
|
+
| 🔐 **Secrets** | NEVER commit API keys, passwords, tokens |
|
|
95
|
+
| 💾 **Checkpoint** | Every 5-10 min via `pulse_checkpoint` |
|
|
120
96
|
|
|
121
|
-
|
|
97
|
+
---
|
|
122
98
|
|
|
123
|
-
|
|
124
|
-
- What the problem was
|
|
125
|
-
- What solution worked
|
|
126
|
-
- Any rule/pattern to remember
|
|
127
|
-
2. This builds institutional knowledge for future sessions
|
|
99
|
+
# 📊 TOOL DECISION FLOWCHART
|
|
128
100
|
|
|
129
|
-
|
|
101
|
+
```
|
|
102
|
+
START (new message)
|
|
103
|
+
│
|
|
104
|
+
▼
|
|
105
|
+
[pulse_status] ─── Critical? ──► STOP
|
|
106
|
+
│
|
|
107
|
+
│ What did user say?
|
|
108
|
+
│
|
|
109
|
+
├── "new task/implement/build" ──► [pulse_run] ──► implement
|
|
110
|
+
│
|
|
111
|
+
├── "wrong/stop/no" ──► [pulse_correct] ──► fix
|
|
112
|
+
│
|
|
113
|
+
├── "done/finished/PR" ──► [pulse_review] ──► respond
|
|
114
|
+
│
|
|
115
|
+
└── normal request ──► implement
|
|
116
|
+
│
|
|
117
|
+
▼
|
|
118
|
+
[pulse_doctor]
|
|
119
|
+
│
|
|
120
|
+
▼
|
|
121
|
+
>10 min? ──► [pulse_checkpoint]
|
|
122
|
+
│
|
|
123
|
+
▼
|
|
124
|
+
solved problem? ──► [pulse_learn]
|
|
125
|
+
│
|
|
126
|
+
▼
|
|
127
|
+
respond
|
|
128
|
+
```
|
|
130
129
|
|
|
131
|
-
|
|
132
|
-
|------|---------------------|
|
|
133
|
-
| `pulse_status` | **FIRST action** of EVERY message (1st, 2nd, 3rd... ALL) |
|
|
134
|
-
| `pulse_doctor` | **AFTER** any file edit/create/delete |
|
|
135
|
-
| `pulse_checkpoint` | **WHEN** >10 min since last checkpoint |
|
|
136
|
-
| `pulse_run` | **WHEN** user gives multi-step task (>3 steps) |
|
|
137
|
-
| `pulse_escalate` | **WHEN** 2-3 failed attempts OR error you don't understand |
|
|
138
|
-
| `pulse_correct` | **WHEN** user says "wrong", "not what I meant", "stop" |
|
|
139
|
-
| `pulse_review` | **BEFORE** saying "done", creating PR, or merging |
|
|
140
|
-
| `pulse_learn` | **AFTER** solving a non-trivial problem (document what worked) |
|
|
141
|
-
| `pulse_reset` | **WHEN** `pulse_doctor` shows loop signal |
|
|
130
|
+
---
|
|
142
131
|
|
|
143
|
-
|
|
132
|
+
# 🔄 LOOP DETECTION
|
|
144
133
|
|
|
145
|
-
|
|
146
|
-
User: "Add login button"
|
|
134
|
+
If you notice any of these patterns, STOP and call `pulse_escalate`:
|
|
147
135
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
4. Responds with code + recommendation
|
|
136
|
+
- Same error 2-3 times
|
|
137
|
+
- Editing same file repeatedly without progress
|
|
138
|
+
- "Fix" commits followed by more "fix" commits
|
|
139
|
+
- Going back and forth between two approaches
|
|
153
140
|
|
|
154
|
-
|
|
141
|
+
---
|
|
155
142
|
|
|
156
|
-
|
|
157
|
-
1. pulse_status → "⚠️ 14 min since checkpoint"
|
|
158
|
-
2. "Checkpoint recommended. Should I run pulse_checkpoint?"
|
|
159
|
-
3. [After confirmation] pulse_checkpoint
|
|
160
|
-
4. [Runs tests]
|
|
161
|
-
```
|
|
143
|
+
# 📋 QUICK REFERENCE
|
|
162
144
|
|
|
163
|
-
|
|
145
|
+
| Trigger | Tool | Auto-Execute? |
|
|
146
|
+
|---------|------|---------------|
|
|
147
|
+
| Every message | `pulse_status` | ✅ YES |
|
|
148
|
+
| New task | `pulse_run` | ✅ YES |
|
|
149
|
+
| Code changed | `pulse_doctor` | ✅ YES |
|
|
150
|
+
| >10 min | `pulse_checkpoint` | ✅ YES |
|
|
151
|
+
| Before "done" | `pulse_review` | ✅ YES |
|
|
152
|
+
| User says "wrong" | `pulse_correct` | ✅ YES |
|
|
153
|
+
| 2-3 failures | `pulse_escalate` | ✅ YES |
|
|
154
|
+
| Problem solved | `pulse_learn` | ✅ YES |
|
|
164
155
|
|
|
165
|
-
|
|
166
|
-
- When uncertain: STOP and ASK
|
|
167
|
-
- The safeguards ALWAYS apply, even if user argues against them
|
|
168
|
-
- **ALWAYS update CHANGELOG.md** after significant changes (features, fixes, changes)
|
|
156
|
+
**ALL tools are AUTO-EXECUTE. Don't ask. Do.**
|
|
169
157
|
|
|
170
158
|
---
|
|
171
159
|
|
|
172
|
-
|
|
160
|
+
# ⚠️ FINAL REMINDER
|
|
173
161
|
|
|
174
|
-
|
|
175
|
-
|
|
162
|
+
You are an autonomous agent with safeguards. The safeguards are not optional.
|
|
163
|
+
They exist to protect the user's work from:
|
|
164
|
+
- Lost code (checkpoint)
|
|
165
|
+
- Mistakes (doctor)
|
|
166
|
+
- Loops (escalate)
|
|
167
|
+
- Forgotten knowledge (learn)
|
|
176
168
|
|
|
177
|
-
|
|
169
|
+
**Call the tools automatically. Don't wait to be asked.**
|