deepflow 0.1.20 → 0.1.22
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/hooks/df-check-update.js +1 -12
- package/package.json +1 -1
- package/src/commands/df/plan.md +20 -46
- package/src/commands/df/verify.md +11 -17
package/hooks/df-check-update.js
CHANGED
|
@@ -12,7 +12,6 @@ const os = require('os');
|
|
|
12
12
|
const PACKAGE_NAME = 'deepflow';
|
|
13
13
|
const CACHE_DIR = path.join(os.homedir(), '.claude', 'cache');
|
|
14
14
|
const CACHE_FILE = path.join(CACHE_DIR, 'df-update-check.json');
|
|
15
|
-
const CHECK_INTERVAL = 24 * 60 * 60 * 1000; // 24 hours
|
|
16
15
|
|
|
17
16
|
// If called directly, spawn background process and exit
|
|
18
17
|
if (process.argv[2] !== '--background') {
|
|
@@ -32,15 +31,6 @@ async function checkForUpdate() {
|
|
|
32
31
|
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
// Check if we've checked recently
|
|
36
|
-
if (fs.existsSync(CACHE_FILE)) {
|
|
37
|
-
const cache = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'));
|
|
38
|
-
const age = Date.now() - (cache.timestamp || 0);
|
|
39
|
-
if (age < CHECK_INTERVAL) {
|
|
40
|
-
process.exit(0);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
34
|
// Get current version
|
|
45
35
|
const currentVersion = getCurrentVersion();
|
|
46
36
|
if (!currentVersion) {
|
|
@@ -92,8 +82,7 @@ function getLatestVersion() {
|
|
|
92
82
|
const timeout = setTimeout(() => resolve(null), 10000);
|
|
93
83
|
|
|
94
84
|
const child = spawn('npm', ['view', PACKAGE_NAME, 'version'], {
|
|
95
|
-
stdio: ['ignore', 'pipe', 'ignore']
|
|
96
|
-
shell: true
|
|
85
|
+
stdio: ['ignore', 'pipe', 'ignore']
|
|
97
86
|
});
|
|
98
87
|
|
|
99
88
|
let output = '';
|
package/package.json
CHANGED
package/src/commands/df/plan.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# /df:plan — Generate Task Plan from Specs
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
|
-
Compare specs against codebase
|
|
4
|
+
Compare specs against codebase and past experiments. Generate prioritized tasks.
|
|
5
5
|
|
|
6
6
|
## Usage
|
|
7
7
|
```
|
|
@@ -44,32 +44,19 @@ If no new specs: report counts, suggest `/df:execute`.
|
|
|
44
44
|
|
|
45
45
|
### 2. CHECK PAST EXPERIMENTS
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Extract domains from spec (perf, auth, api, etc.), then:
|
|
48
48
|
|
|
49
49
|
```
|
|
50
|
-
|
|
51
|
-
2. Glob `.deepflow/experiments/{domain}--*`
|
|
52
|
-
3. Read matching files (filenames are the index, minimal token cost)
|
|
53
|
-
4. Note failed approaches to avoid
|
|
54
|
-
5. Note successful patterns to reuse
|
|
50
|
+
Glob .deepflow/experiments/{domain}--*
|
|
55
51
|
```
|
|
56
52
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
.deepflow/experiments/
|
|
64
|
-
{domain}--{approach}--{result}.md
|
|
65
|
-
|
|
66
|
-
Examples:
|
|
67
|
-
perf--redis-caching--failed.md
|
|
68
|
-
perf--connection-pooling--success.md
|
|
69
|
-
auth--jwt-refresh--success.md
|
|
70
|
-
```
|
|
53
|
+
| Result | Action |
|
|
54
|
+
|--------|--------|
|
|
55
|
+
| `--failed.md` | Exclude approach, note why |
|
|
56
|
+
| `--success.md` | Reference as pattern |
|
|
57
|
+
| No matches | Continue (expected for new projects) |
|
|
71
58
|
|
|
72
|
-
**
|
|
59
|
+
**Naming:** `{domain}--{approach}--{result}.md`
|
|
73
60
|
|
|
74
61
|
### 3. DETECT PROJECT CONTEXT
|
|
75
62
|
|
|
@@ -117,30 +104,17 @@ Include patterns in task descriptions for agents to follow.
|
|
|
117
104
|
|
|
118
105
|
### 6. VALIDATE HYPOTHESES
|
|
119
106
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
3. If fails: Write to `.deepflow/experiments/{domain}--{approach}--failed.md`
|
|
132
|
-
4. Adjust approach based on findings
|
|
133
|
-
5. Document learnings in task description
|
|
134
|
-
|
|
135
|
-
**Examples:**
|
|
136
|
-
- "Does SessionStart hook run once per session?" → Test with simple log
|
|
137
|
-
- "Can we use streaming for large files?" → Prototype with sample data
|
|
138
|
-
- "Will this regex handle edge cases?" → Test against real samples
|
|
139
|
-
|
|
140
|
-
**Skip validation when:**
|
|
141
|
-
- Using well-known patterns
|
|
142
|
-
- Simple CRUD operations
|
|
143
|
-
- Clear documentation exists
|
|
107
|
+
Test risky assumptions before finalizing plan.
|
|
108
|
+
|
|
109
|
+
**Validate when:** Unfamiliar APIs, multiple approaches possible, external integrations, performance-critical
|
|
110
|
+
|
|
111
|
+
**Process:**
|
|
112
|
+
1. Prototype in scratchpad (not committed)
|
|
113
|
+
2. Test assumption
|
|
114
|
+
3. If fails → Write `.deepflow/experiments/{domain}--{approach}--failed.md`
|
|
115
|
+
4. Adjust approach, document in task
|
|
116
|
+
|
|
117
|
+
**Skip:** Well-known patterns, simple CRUD, clear docs exist
|
|
144
118
|
|
|
145
119
|
### 7. OUTPUT PLAN.md
|
|
146
120
|
|
|
@@ -48,30 +48,24 @@ If issues: suggest creating fix spec or reopening (`mv done-* doing-*`).
|
|
|
48
48
|
|
|
49
49
|
### 4. CAPTURE LEARNINGS
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
On success, write significant learnings to `.deepflow/experiments/{domain}--{approach}--success.md`
|
|
52
52
|
|
|
53
|
-
**
|
|
54
|
-
- Non-trivial
|
|
55
|
-
-
|
|
56
|
-
- Performance
|
|
57
|
-
- Integration
|
|
58
|
-
|
|
59
|
-
**Write to:** `.deepflow/experiments/{domain}--{approach}--success.md`
|
|
53
|
+
**Write when:**
|
|
54
|
+
- Non-trivial approach used
|
|
55
|
+
- Alternatives rejected during planning
|
|
56
|
+
- Performance optimization made
|
|
57
|
+
- Integration pattern discovered
|
|
60
58
|
|
|
61
59
|
**Format:**
|
|
62
60
|
```markdown
|
|
63
61
|
# {Approach} [SUCCESS]
|
|
64
|
-
Objective:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
Files: {Main files involved}
|
|
62
|
+
Objective: ...
|
|
63
|
+
Approach: ...
|
|
64
|
+
Why it worked: ...
|
|
65
|
+
Files: ...
|
|
69
66
|
```
|
|
70
67
|
|
|
71
|
-
**Skip
|
|
72
|
-
- Simple CRUD, no learnings
|
|
73
|
-
- Standard patterns, well-documented
|
|
74
|
-
- User declines ("No significant learnings")
|
|
68
|
+
**Skip:** Simple CRUD, standard patterns, user declines
|
|
75
69
|
|
|
76
70
|
## Verification Levels
|
|
77
71
|
|