deepflow 0.1.0
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/.claude/agents/reasoner.md +60 -0
- package/.claude/commands/df/execute.md +190 -0
- package/.claude/commands/df/plan.md +171 -0
- package/.claude/commands/df/spec.md +99 -0
- package/.claude/commands/df/verify.md +169 -0
- package/.claude/skills/atomic-commits/SKILL.md +64 -0
- package/.claude/skills/code-completeness/SKILL.md +63 -0
- package/.claude/skills/gap-discovery/SKILL.md +45 -0
- package/LICENSE +21 -0
- package/README.md +138 -0
- package/VERSION +1 -0
- package/bin/install.js +187 -0
- package/hooks/df-check-update.js +129 -0
- package/hooks/df-statusline.js +111 -0
- package/package.json +40 -0
- package/templates/config-template.yaml +42 -0
- package/templates/plan-template.md +41 -0
- package/templates/spec-template.md +40 -0
- package/templates/state-template.md +47 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* deepflow statusline for Claude Code
|
|
4
|
+
* Displays: model | project | context usage
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const fs = require('fs');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const os = require('os');
|
|
10
|
+
|
|
11
|
+
// ANSI colors
|
|
12
|
+
const colors = {
|
|
13
|
+
reset: '\x1b[0m',
|
|
14
|
+
dim: '\x1b[2m',
|
|
15
|
+
green: '\x1b[32m',
|
|
16
|
+
yellow: '\x1b[33m',
|
|
17
|
+
orange: '\x1b[38;5;208m',
|
|
18
|
+
red: '\x1b[31m',
|
|
19
|
+
blink: '\x1b[5m',
|
|
20
|
+
cyan: '\x1b[36m'
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Read JSON from stdin
|
|
24
|
+
let input = '';
|
|
25
|
+
process.stdin.setEncoding('utf8');
|
|
26
|
+
process.stdin.on('data', chunk => input += chunk);
|
|
27
|
+
process.stdin.on('end', () => {
|
|
28
|
+
try {
|
|
29
|
+
const data = JSON.parse(input);
|
|
30
|
+
console.log(buildStatusLine(data));
|
|
31
|
+
} catch (e) {
|
|
32
|
+
// Fail silently to avoid breaking statusline
|
|
33
|
+
console.log('');
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
function buildStatusLine(data) {
|
|
38
|
+
const parts = [];
|
|
39
|
+
|
|
40
|
+
// Check for updates
|
|
41
|
+
const updateInfo = checkForUpdate();
|
|
42
|
+
if (updateInfo && updateInfo.updateAvailable) {
|
|
43
|
+
parts.push(`${colors.yellow}⬆ /df:update${colors.reset}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Model name
|
|
47
|
+
const model = formatModel(data.model || 'unknown');
|
|
48
|
+
parts.push(model);
|
|
49
|
+
|
|
50
|
+
// Project name (from cwd)
|
|
51
|
+
const project = path.basename(data.cwd || process.cwd());
|
|
52
|
+
parts.push(`${colors.cyan}${project}${colors.reset}`);
|
|
53
|
+
|
|
54
|
+
// Context window meter
|
|
55
|
+
const contextMeter = buildContextMeter(data.tokenUsage || {});
|
|
56
|
+
parts.push(contextMeter);
|
|
57
|
+
|
|
58
|
+
return parts.join(` ${colors.dim}│${colors.reset} `);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function formatModel(model) {
|
|
62
|
+
// Shorten model names
|
|
63
|
+
const modelMap = {
|
|
64
|
+
'claude-opus-4-5-20251101': 'Opus 4.5',
|
|
65
|
+
'claude-sonnet-4-20250514': 'Sonnet 4',
|
|
66
|
+
'claude-haiku-3-5-20241022': 'Haiku 3.5'
|
|
67
|
+
};
|
|
68
|
+
return modelMap[model] || model.replace('claude-', '').replace(/-\d+$/, '');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function buildContextMeter(tokenUsage) {
|
|
72
|
+
const used = tokenUsage.total || 0;
|
|
73
|
+
const limit = tokenUsage.limit || 200000;
|
|
74
|
+
|
|
75
|
+
// Scale so 80% shows as 100% (enforce 80% limit visually)
|
|
76
|
+
const effectiveLimit = limit * 0.8;
|
|
77
|
+
const percentage = Math.min(100, Math.round((used / effectiveLimit) * 100));
|
|
78
|
+
|
|
79
|
+
// Build 10-segment bar
|
|
80
|
+
const segments = 10;
|
|
81
|
+
const filled = Math.round((percentage / 100) * segments);
|
|
82
|
+
const bar = '█'.repeat(filled) + '░'.repeat(segments - filled);
|
|
83
|
+
|
|
84
|
+
// Color based on usage
|
|
85
|
+
let color;
|
|
86
|
+
if (percentage < 63) {
|
|
87
|
+
color = colors.green;
|
|
88
|
+
} else if (percentage < 81) {
|
|
89
|
+
color = colors.yellow;
|
|
90
|
+
} else if (percentage < 95) {
|
|
91
|
+
color = colors.orange;
|
|
92
|
+
} else {
|
|
93
|
+
color = colors.blink + colors.red;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return `${color}${bar}${colors.reset} ${percentage}%`;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function checkForUpdate() {
|
|
100
|
+
try {
|
|
101
|
+
const cacheDir = path.join(os.homedir(), '.claude', 'cache');
|
|
102
|
+
const cachePath = path.join(cacheDir, 'df-update-check.json');
|
|
103
|
+
|
|
104
|
+
if (!fs.existsSync(cachePath)) return null;
|
|
105
|
+
|
|
106
|
+
const cache = JSON.parse(fs.readFileSync(cachePath, 'utf8'));
|
|
107
|
+
return cache;
|
|
108
|
+
} catch (e) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "deepflow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Stay in flow state - lightweight spec-driven task orchestration for Claude Code",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"claude",
|
|
7
|
+
"claude-code",
|
|
8
|
+
"ai",
|
|
9
|
+
"flow",
|
|
10
|
+
"deep-work",
|
|
11
|
+
"orchestration",
|
|
12
|
+
"specs",
|
|
13
|
+
"tasks",
|
|
14
|
+
"automation",
|
|
15
|
+
"productivity"
|
|
16
|
+
],
|
|
17
|
+
"author": "saidwafiq",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/saidwafiq/deepflow.git"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/saidwafiq/deepflow#readme",
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/saidwafiq/deepflow/issues"
|
|
26
|
+
},
|
|
27
|
+
"bin": {
|
|
28
|
+
"deepflow": "bin/install.js"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"bin/",
|
|
32
|
+
".claude/",
|
|
33
|
+
"hooks/",
|
|
34
|
+
"templates/",
|
|
35
|
+
"VERSION"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=16.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# deepflow configuration
|
|
2
|
+
|
|
3
|
+
project:
|
|
4
|
+
name: my-project
|
|
5
|
+
source_dir: src/
|
|
6
|
+
specs_dir: specs/
|
|
7
|
+
|
|
8
|
+
planning:
|
|
9
|
+
# Patterns to search for incomplete work
|
|
10
|
+
search_patterns:
|
|
11
|
+
- "TODO"
|
|
12
|
+
- "FIXME"
|
|
13
|
+
- "HACK"
|
|
14
|
+
- "stub"
|
|
15
|
+
- "placeholder"
|
|
16
|
+
- "it.skip"
|
|
17
|
+
- "test.skip"
|
|
18
|
+
|
|
19
|
+
parallelism:
|
|
20
|
+
# Agent limits by operation type
|
|
21
|
+
search:
|
|
22
|
+
max: 100
|
|
23
|
+
per_files: 20 # 1 agent per N files
|
|
24
|
+
analyze:
|
|
25
|
+
max: 20
|
|
26
|
+
per_specs: 2 # 1 agent per N specs
|
|
27
|
+
execute:
|
|
28
|
+
max: 5
|
|
29
|
+
per_file: 1 # Never parallel on same file
|
|
30
|
+
test:
|
|
31
|
+
max: 1 # Always sequential
|
|
32
|
+
|
|
33
|
+
models:
|
|
34
|
+
search: sonnet # Fast, cheap
|
|
35
|
+
implement: sonnet # Good balance
|
|
36
|
+
reason: opus # Complex decisions
|
|
37
|
+
debug: opus # Problem solving
|
|
38
|
+
|
|
39
|
+
commits:
|
|
40
|
+
format: "feat({spec}): {description}"
|
|
41
|
+
atomic: true # One task = one commit
|
|
42
|
+
push_after: complete # Or "each" for every commit
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Plan
|
|
2
|
+
|
|
3
|
+
Generated: {timestamp}
|
|
4
|
+
|
|
5
|
+
## Summary
|
|
6
|
+
|
|
7
|
+
| Metric | Count |
|
|
8
|
+
|--------|-------|
|
|
9
|
+
| Specs analyzed | 0 |
|
|
10
|
+
| Tasks created | 0 |
|
|
11
|
+
| Ready (no blockers) | 0 |
|
|
12
|
+
| Blocked | 0 |
|
|
13
|
+
|
|
14
|
+
## Spec Gaps
|
|
15
|
+
|
|
16
|
+
[Issues found in specs that need clarification]
|
|
17
|
+
|
|
18
|
+
- [ ] `specs/example.md`: [Gap description]
|
|
19
|
+
|
|
20
|
+
## Tasks
|
|
21
|
+
|
|
22
|
+
### {spec-name}
|
|
23
|
+
|
|
24
|
+
- [ ] **T1**: {Task description}
|
|
25
|
+
- Files: {files to create or modify}
|
|
26
|
+
- Blocked by: none
|
|
27
|
+
|
|
28
|
+
- [ ] **T2**: {Task description}
|
|
29
|
+
- Files: {files}
|
|
30
|
+
- Blocked by: T1
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<!--
|
|
35
|
+
Plan Guidelines:
|
|
36
|
+
- One task = one atomic commit
|
|
37
|
+
- Tasks should be 15-60 min of work
|
|
38
|
+
- Blocked by references task IDs (T1, T2, etc.)
|
|
39
|
+
- Mark complete with [x] and commit hash
|
|
40
|
+
- Example completed: [x] **T1**: Create API ✓ (abc1234)
|
|
41
|
+
-->
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# {Name}
|
|
2
|
+
|
|
3
|
+
## Objective
|
|
4
|
+
|
|
5
|
+
[One sentence: what this achieves for the user]
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- **REQ-1**: [Requirement description]
|
|
10
|
+
- **REQ-2**: [Requirement description]
|
|
11
|
+
- **REQ-3**: [Requirement description]
|
|
12
|
+
|
|
13
|
+
## Constraints
|
|
14
|
+
|
|
15
|
+
- [Constraint 1: e.g., "Max file size 10MB"]
|
|
16
|
+
- [Constraint 2: e.g., "Must work offline"]
|
|
17
|
+
|
|
18
|
+
## Out of Scope
|
|
19
|
+
|
|
20
|
+
- [Explicitly excluded: e.g., "Video upload is NOT included"]
|
|
21
|
+
|
|
22
|
+
## Acceptance Criteria
|
|
23
|
+
|
|
24
|
+
- [ ] [Testable criterion: e.g., "User can upload jpg/png/webp files"]
|
|
25
|
+
- [ ] [Testable criterion: e.g., "Files over 10MB show clear error"]
|
|
26
|
+
- [ ] [Testable criterion: e.g., "Upload progress is visible"]
|
|
27
|
+
|
|
28
|
+
## Technical Notes
|
|
29
|
+
|
|
30
|
+
[Optional: implementation hints, preferred libraries, architectural decisions]
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<!--
|
|
35
|
+
Spec Guidelines:
|
|
36
|
+
- Keep under 100 lines
|
|
37
|
+
- Requirements must be testable
|
|
38
|
+
- Acceptance criteria must be verifiable
|
|
39
|
+
- Be explicit about what's OUT of scope
|
|
40
|
+
-->
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# State
|
|
2
|
+
|
|
3
|
+
Project context and learnings for LLM continuity.
|
|
4
|
+
|
|
5
|
+
## Current Status
|
|
6
|
+
|
|
7
|
+
- **Phase**: [ideation | planning | executing | verifying]
|
|
8
|
+
- **Active spec**: [spec name or "none"]
|
|
9
|
+
- **Progress**: [X/Y tasks complete]
|
|
10
|
+
|
|
11
|
+
## Decisions
|
|
12
|
+
|
|
13
|
+
[Key decisions made during development]
|
|
14
|
+
|
|
15
|
+
| Decision | Rationale | Date |
|
|
16
|
+
|----------|-----------|------|
|
|
17
|
+
| [Decision] | [Why] | [Date] |
|
|
18
|
+
|
|
19
|
+
## Learnings
|
|
20
|
+
|
|
21
|
+
[Things discovered that future sessions should know]
|
|
22
|
+
|
|
23
|
+
- [Learning 1]
|
|
24
|
+
- [Learning 2]
|
|
25
|
+
|
|
26
|
+
## Blockers
|
|
27
|
+
|
|
28
|
+
[Current blockers and workarounds]
|
|
29
|
+
|
|
30
|
+
- [ ] [Blocker]: [Workaround if any]
|
|
31
|
+
|
|
32
|
+
## Session Log
|
|
33
|
+
|
|
34
|
+
### {Date}
|
|
35
|
+
- [What was done]
|
|
36
|
+
- [What's next]
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
<!--
|
|
41
|
+
State Guidelines:
|
|
42
|
+
- Keep concise - this loads into every session
|
|
43
|
+
- Focus on CONTEXT, not history
|
|
44
|
+
- Decisions = things that affect future work
|
|
45
|
+
- Learnings = "if I knew this earlier..."
|
|
46
|
+
- Clean up resolved blockers
|
|
47
|
+
-->
|