devflow-kit 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.
Files changed (34) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/LICENSE +21 -0
  3. package/README.md +144 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +32 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/commands/init.d.ts +3 -0
  9. package/dist/commands/init.d.ts.map +1 -0
  10. package/dist/commands/init.js +338 -0
  11. package/dist/commands/init.js.map +1 -0
  12. package/dist/commands/uninstall.d.ts +3 -0
  13. package/dist/commands/uninstall.d.ts.map +1 -0
  14. package/dist/commands/uninstall.js +74 -0
  15. package/dist/commands/uninstall.js.map +1 -0
  16. package/package.json +54 -0
  17. package/src/claude/agents/devflow/audit-architecture.md +84 -0
  18. package/src/claude/agents/devflow/audit-complexity.md +102 -0
  19. package/src/claude/agents/devflow/audit-database.md +104 -0
  20. package/src/claude/agents/devflow/audit-dependencies.md +109 -0
  21. package/src/claude/agents/devflow/audit-performance.md +85 -0
  22. package/src/claude/agents/devflow/audit-security.md +75 -0
  23. package/src/claude/agents/devflow/audit-tests.md +107 -0
  24. package/src/claude/agents/devflow/catch-up.md +352 -0
  25. package/src/claude/agents/devflow/commit.md +347 -0
  26. package/src/claude/commands/devflow/catch-up.md +29 -0
  27. package/src/claude/commands/devflow/commit.md +28 -0
  28. package/src/claude/commands/devflow/debug.md +228 -0
  29. package/src/claude/commands/devflow/devlog.md +370 -0
  30. package/src/claude/commands/devflow/plan-next-steps.md +212 -0
  31. package/src/claude/commands/devflow/pre-commit.md +138 -0
  32. package/src/claude/commands/devflow/pre-pr.md +286 -0
  33. package/src/claude/scripts/statusline.sh +115 -0
  34. package/src/claude/settings.json +6 -0
@@ -0,0 +1,286 @@
1
+ ---
2
+ description: Comprehensive branch review using specialized sub-agents for PR readiness
3
+ allowed-tools: Task, Bash, Read, Write, Grep, Glob
4
+ ---
5
+
6
+ ## Your Task
7
+
8
+ Perform a comprehensive review of this entire feature branch by orchestrating multiple specialized sub-agents in parallel. This is designed for thorough analysis before creating pull requests or merging branches.
9
+
10
+ ### Step 1: Analyze Branch Changes
11
+
12
+ First, determine the branch and base for comparison:
13
+
14
+ ```bash
15
+ # Get current branch
16
+ CURRENT_BRANCH=$(git branch --show-current)
17
+ if [ -z "$CURRENT_BRANCH" ]; then
18
+ echo "❌ Not on a branch (detached HEAD). Checkout a feature branch first."
19
+ exit 1
20
+ fi
21
+
22
+ # Determine base branch (main, master, or develop)
23
+ BASE_BRANCH=""
24
+ for branch in main master develop; do
25
+ if git show-ref --verify --quiet refs/heads/$branch; then
26
+ BASE_BRANCH=$branch
27
+ break
28
+ fi
29
+ done
30
+
31
+ if [ -z "$BASE_BRANCH" ]; then
32
+ echo "❌ Could not find base branch (main/master/develop). Specify manually."
33
+ exit 1
34
+ fi
35
+
36
+ echo "=== BRANCH REVIEW SCOPE ==="
37
+ echo "Current branch: $CURRENT_BRANCH"
38
+ echo "Base branch: $BASE_BRANCH"
39
+ echo ""
40
+
41
+ # Check if there are changes to review
42
+ if git diff --quiet $BASE_BRANCH...HEAD; then
43
+ echo "No changes between $BASE_BRANCH and $CURRENT_BRANCH"
44
+ exit 0
45
+ fi
46
+
47
+ # Show comprehensive change summary
48
+ echo "=== CHANGES TO REVIEW ==="
49
+ git diff --stat $BASE_BRANCH...HEAD
50
+ echo ""
51
+ echo "=== COMMIT HISTORY ==="
52
+ git log --oneline $BASE_BRANCH..HEAD
53
+ echo ""
54
+ ```
55
+
56
+ ### Step 2: Launch Specialized Sub-Agents in Parallel
57
+
58
+ Launch these sub-agents in parallel:
59
+
60
+ 1. audit-security sub-agent
61
+ 2. audit-performance sub-agent
62
+ 3. audit-architecture sub-agent
63
+ 4. audit-tests sub-agent
64
+ 5. audit-complexity sub-agent
65
+ 6. audit-dependencies sub-agent
66
+
67
+ ### Step 3: Synthesize Comprehensive Review
68
+
69
+ After all sub-agents complete their analysis:
70
+
71
+ 1. **Collect Results**: Gather findings from all 6 specialized sub-agents
72
+ 2. **Cross-Reference Issues**: Identify overlapping concerns between domains
73
+ 3. **Prioritize for PR**: Focus on merge-blocking vs nice-to-have improvements
74
+ 4. **Create PR-Ready Review**: Structure for easy consumption by human reviewers
75
+
76
+ ### Step 4: Save Comprehensive Review Document
77
+
78
+ Create a detailed review document at `.docs/reviews/branch-{BRANCH_NAME}-{YYYY-MM-DD_HHMM}.md`:
79
+
80
+ ```markdown
81
+ # Branch Review - {BRANCH_NAME}
82
+ **Date**: {current_date}
83
+ **Time**: {current_time}
84
+ **Type**: Branch Review (PR Readiness Assessment)
85
+ **Branch**: {CURRENT_BRANCH}
86
+ **Base**: {BASE_BRANCH}
87
+ **Reviewer**: AI Sub-Agent Orchestra
88
+
89
+ ---
90
+
91
+ ## πŸ“Š Branch Overview
92
+
93
+ **Commits**: {commit_count} commits
94
+ **Files Changed**: {files_changed}
95
+ **Lines Added**: {lines_added}
96
+ **Lines Removed**: {lines_removed}
97
+ **Review Duration**: {duration}
98
+
99
+ ### Change Categories
100
+ - 🎯 **Features**: {feature_changes}
101
+ - πŸ› **Bug Fixes**: {bug_fixes}
102
+ - πŸ”§ **Refactoring**: {refactoring}
103
+ - πŸ“š **Documentation**: {doc_changes}
104
+ - πŸ§ͺ **Tests**: {test_changes}
105
+
106
+ ---
107
+
108
+ ## 🎯 PR Readiness Assessment
109
+
110
+ ### 🚦 MERGE RECOMMENDATION
111
+ **Status**: {βœ… READY TO MERGE | ⚠️ ISSUES TO ADDRESS | 🚫 NOT READY}
112
+
113
+ **Confidence Level**: {High/Medium/Low}
114
+
115
+ ### Blocking Issues (Must Fix Before Merge)
116
+ - πŸ”΄ {critical_issue_1} in {file:line}
117
+ - πŸ”΄ {critical_issue_2} in {file:line}
118
+
119
+ ### High Priority (Should Fix Before Merge)
120
+ - 🟠 {high_issue_1} in {file:line}
121
+ - 🟠 {high_issue_2} in {file:line}
122
+
123
+ ---
124
+
125
+ ## πŸ” Detailed Sub-Agent Analysis
126
+
127
+ ### πŸ”’ Security Analysis (audit-security)
128
+ **Risk Level**: {Low/Medium/High/Critical}
129
+
130
+ #### Security Issues Found
131
+ {detailed security findings with file:line references}
132
+
133
+ #### Security Recommendations
134
+ {specific security improvements needed}
135
+
136
+ ### ⚑ Performance Analysis (audit-performance)
137
+ **Performance Impact**: {Positive/Neutral/Negative}
138
+
139
+ #### Performance Issues Found
140
+ {detailed performance findings with optimizations}
141
+
142
+ #### Performance Recommendations
143
+ {specific performance improvements}
144
+
145
+ ### πŸ—οΈ Architecture Analysis (audit-architecture)
146
+ **Architecture Quality**: {Excellent/Good/Acceptable/Poor}
147
+
148
+ #### Architectural Issues Found
149
+ {detailed architecture findings and design concerns}
150
+
151
+ #### Architecture Recommendations
152
+ {specific architectural improvements}
153
+
154
+ ### πŸ§ͺ Test Coverage Analysis (audit-tests)
155
+ **Coverage Assessment**: {Excellent/Good/Adequate/Insufficient}
156
+
157
+ #### Testing Issues Found
158
+ {detailed test coverage gaps and quality issues}
159
+
160
+ #### Testing Recommendations
161
+ {specific tests that should be added}
162
+
163
+ ### 🧠 Complexity Analysis (audit-complexity)
164
+ **Maintainability Score**: {Excellent/Good/Acceptable/Poor}
165
+
166
+ #### Complexity Issues Found
167
+ {detailed complexity and maintainability concerns}
168
+
169
+ #### Complexity Recommendations
170
+ {specific refactoring suggestions}
171
+
172
+ ### πŸ“¦ Dependency Analysis (audit-dependencies)
173
+ **Dependency Health**: {Excellent/Good/Acceptable/Poor}
174
+
175
+ #### Dependency Issues Found
176
+ {detailed dependency concerns and security issues}
177
+
178
+ #### Dependency Recommendations
179
+ {specific dependency management improvements}
180
+
181
+ ---
182
+
183
+ ## 🎯 Action Plan
184
+
185
+ ### Pre-Merge Checklist (Blocking)
186
+ - [ ] {blocking_action_1} - {estimated_effort}
187
+ - [ ] {blocking_action_2} - {estimated_effort}
188
+ - [ ] {blocking_action_3} - {estimated_effort}
189
+
190
+ ### Post-Merge Improvements (Non-Blocking)
191
+ - [ ] {improvement_1} - {estimated_effort}
192
+ - [ ] {improvement_2} - {estimated_effort}
193
+ - [ ] {improvement_3} - {estimated_effort}
194
+
195
+ ### Follow-Up Tasks
196
+ - [ ] {followup_1}
197
+ - [ ] {followup_2}
198
+
199
+ ---
200
+
201
+ ## πŸ“ˆ Quality Metrics
202
+
203
+ ### Code Quality Score: {score}/10
204
+
205
+ **Breakdown**:
206
+ - Security: {score}/10
207
+ - Performance: {score}/10
208
+ - Architecture: {score}/10
209
+ - Test Coverage: {score}/10
210
+ - Maintainability: {score}/10
211
+ - Dependencies: {score}/10
212
+
213
+ ### Comparison to {BASE_BRANCH}
214
+ - Quality Trend: {Improving/Stable/Declining}
215
+ - Technical Debt: {Reduced/Neutral/Increased}
216
+ - Test Coverage: {Increased/Maintained/Decreased}
217
+
218
+ ---
219
+
220
+ ## πŸ”— Related Resources
221
+
222
+ ### Files Requiring Attention
223
+ - {file1} - {reason}
224
+ - {file2} - {reason}
225
+ - {file3} - {reason}
226
+
227
+ ### Similar Issues in Codebase
228
+ - {related_issue_1} in {location}
229
+ - {related_issue_2} in {location}
230
+
231
+ ### Documentation Updates Needed
232
+ - {doc_update_1}
233
+ - {doc_update_2}
234
+
235
+ ---
236
+
237
+ ## πŸ’‘ Reviewer Notes
238
+
239
+ ### Human Review Focus Areas
240
+ Based on sub-agent analysis, human reviewers should focus on:
241
+ 1. {focus_area_1} - {reason}
242
+ 2. {focus_area_2} - {reason}
243
+ 3. {focus_area_3} - {reason}
244
+
245
+ ### Discussion Points
246
+ - {discussion_point_1}
247
+ - {discussion_point_2}
248
+ - {discussion_point_3}
249
+
250
+ ---
251
+
252
+ *Comprehensive review generated by DevFlow sub-agent orchestration*
253
+ *Next: Address blocking issues, then create PR with this review as reference*
254
+ ```
255
+
256
+ ### Step 5: Provide Executive Summary
257
+
258
+ Give the developer a clear, actionable summary:
259
+
260
+ ```
261
+ πŸ” BRANCH REVIEW COMPLETE: {BRANCH_NAME}
262
+
263
+ πŸ“Š ANALYSIS SUMMARY:
264
+ - Files analyzed: {X} files, {Y} commits
265
+ - Issues found: {Critical} critical, {High} high, {Medium} medium, {Low} low
266
+ - Review confidence: {High/Medium/Low}
267
+
268
+ 🚦 PR READINESS: {βœ… READY | ⚠️ ISSUES TO ADDRESS | 🚫 NOT READY}
269
+
270
+ 🎯 CRITICAL ACTIONS BEFORE MERGE:
271
+ 1. {Most critical blocking issue}
272
+ 2. {Second most critical blocking issue}
273
+ 3. {Third most critical blocking issue}
274
+
275
+ ⚑ QUICK WINS:
276
+ - {Easy fix 1} ({estimated time})
277
+ - {Easy fix 2} ({estimated time})
278
+
279
+ πŸ“„ Full review: .docs/reviews/branch-{branch}-{timestamp}.md
280
+
281
+ πŸ”„ NEXT STEPS:
282
+ 1. Address blocking issues above
283
+ 2. Run `/pre-commit` after fixes to verify
284
+ 3. Create PR using this review as reference
285
+ 4. Share review with team for human review focus
286
+ ```
@@ -0,0 +1,115 @@
1
+ #!/bin/bash
2
+
3
+ # Claude Code Status Line Script
4
+ # Receives JSON input via stdin with session context
5
+
6
+ # Read JSON input
7
+ INPUT=$(cat)
8
+
9
+ # Parse values using jq (with fallbacks if jq is not available or fields are missing)
10
+ if command -v jq &> /dev/null; then
11
+ MODEL=$(echo "$INPUT" | jq -r '.model.display_name // .model.id // "claude"' 2>/dev/null)
12
+ CWD=$(echo "$INPUT" | jq -r '.cwd // "~"' 2>/dev/null)
13
+ TOTAL_COST=$(echo "$INPUT" | jq -r '.cost.total_cost_usd // 0' 2>/dev/null)
14
+ LINES_ADDED=$(echo "$INPUT" | jq -r '.cost.total_lines_added // 0' 2>/dev/null)
15
+ LINES_REMOVED=$(echo "$INPUT" | jq -r '.cost.total_lines_removed // 0' 2>/dev/null)
16
+ TOTAL_DURATION_MS=$(echo "$INPUT" | jq -r '.cost.total_duration_ms // 0' 2>/dev/null)
17
+ API_DURATION_MS=$(echo "$INPUT" | jq -r '.cost.total_api_duration_ms // 0' 2>/dev/null)
18
+ EXCEEDS_200K=$(echo "$INPUT" | jq -r '.exceeds_200k_tokens // false' 2>/dev/null)
19
+ VERSION=$(echo "$INPUT" | jq -r '.version // ""' 2>/dev/null)
20
+ OUTPUT_STYLE=$(echo "$INPUT" | jq -r '.output_style.name // ""' 2>/dev/null)
21
+ else
22
+ MODEL="claude"
23
+ CWD=$(pwd)
24
+ TOTAL_COST="0.00"
25
+ LINES_ADDED="0"
26
+ LINES_REMOVED="0"
27
+ TOTAL_DURATION_MS="0"
28
+ API_DURATION_MS="0"
29
+ EXCEEDS_200K="false"
30
+ VERSION=""
31
+ OUTPUT_STYLE=""
32
+ fi
33
+
34
+ # Get current directory name
35
+ DIR_NAME=$(basename "$CWD")
36
+
37
+ # Get git branch and last commit if in a git repo
38
+ GIT_BRANCH=$(cd "$CWD" 2>/dev/null && git branch --show-current 2>/dev/null || echo "")
39
+ if [ -z "$GIT_BRANCH" ]; then
40
+ GIT_INFO=""
41
+ else
42
+ # Get last commit message (first line, truncated to 50 chars)
43
+ LAST_COMMIT_MSG=$(cd "$CWD" 2>/dev/null && git log -1 --pretty=format:"%s" 2>/dev/null | cut -c1-50 || echo "")
44
+
45
+ # Check if there are uncommitted changes
46
+ if [ -n "$(cd "$CWD" 2>/dev/null && git status --porcelain 2>/dev/null)" ]; then
47
+ GIT_INFO=" / \033[1;33m$GIT_BRANCH*\033[0m"
48
+ else
49
+ GIT_INFO=" / \033[1;32m$GIT_BRANCH\033[0m"
50
+ fi
51
+
52
+ # Add commit message if available
53
+ if [ -n "$LAST_COMMIT_MSG" ]; then
54
+ GIT_INFO="$GIT_INFO \033[1;90m($LAST_COMMIT_MSG)\033[0m"
55
+ fi
56
+ fi
57
+
58
+ # Format cost with 2 decimal places
59
+ COST_FORMATTED=$(printf "%.2f" "$TOTAL_COST" 2>/dev/null || echo "0.00")
60
+
61
+ # Format session duration from milliseconds to human readable
62
+ format_duration() {
63
+ local ms=$1
64
+ local seconds=$((ms / 1000))
65
+ local minutes=$((seconds / 60))
66
+ local hours=$((minutes / 60))
67
+ local remaining_minutes=$((minutes % 60))
68
+
69
+ if [ "$hours" -gt 0 ]; then
70
+ echo "${hours}h${remaining_minutes}m"
71
+ elif [ "$minutes" -gt 0 ]; then
72
+ echo "${minutes}m"
73
+ else
74
+ echo "${seconds}s"
75
+ fi
76
+ }
77
+
78
+ SESSION_DURATION=$(format_duration "$TOTAL_DURATION_MS")
79
+ API_DURATION=$(format_duration "$API_DURATION_MS")
80
+
81
+ # Calculate API efficiency percentage
82
+ if [ "$TOTAL_DURATION_MS" -gt 0 ]; then
83
+ API_EFFICIENCY=$(echo "$API_DURATION_MS $TOTAL_DURATION_MS" | awk '{printf "%.0f", ($1/$2)*100}')
84
+ else
85
+ API_EFFICIENCY="0"
86
+ fi
87
+
88
+ # Build status line with colors - show components conditionally
89
+ STATUS_LINE="\033[1;34m$DIR_NAME\033[0m$GIT_INFO"
90
+
91
+ # Add session duration if meaningful
92
+ # if [ "$TOTAL_DURATION_MS" -gt 60000 ]; then # > 1 minute
93
+ # STATUS_LINE="$STATUS_LINE \033[1;33m$SESSION_DURATION\033[0m"
94
+ # fi
95
+
96
+ # Add API efficiency if session is long enough and efficiency is notable
97
+ if [ "$TOTAL_DURATION_MS" -gt 300000 ] && [ "$API_EFFICIENCY" -gt 10 ]; then # > 5 min and >10% API time
98
+ STATUS_LINE="$STATUS_LINE \033[1;91mapi:${API_EFFICIENCY}%\033[0m"
99
+ fi
100
+
101
+ # Add large context warning
102
+ if [ "$EXCEEDS_200K" = "true" ]; then
103
+ STATUS_LINE="$STATUS_LINE \033[1;93m⚠️large\033[0m"
104
+ fi
105
+
106
+ # Add cost if non-zero and meaningful (> $0.01)
107
+ COST_CENTS=$(echo "$TOTAL_COST" | awk '{printf "%.0f", $1*100}')
108
+ if [ "$COST_CENTS" -gt 1 ]; then
109
+ STATUS_LINE="$STATUS_LINE \033[1;32m\$$COST_FORMATTED\033[0m"
110
+ fi
111
+
112
+ # Add model at the end
113
+ # STATUS_LINE="$STATUS_LINE \033[1;36m$MODEL\033[0m"
114
+
115
+ echo -e "$STATUS_LINE"
@@ -0,0 +1,6 @@
1
+ {
2
+ "statusLine": {
3
+ "type": "command",
4
+ "command": "~/.devflow/scripts/statusline.sh"
5
+ }
6
+ }