devflow-kit 0.1.2 → 0.3.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.
@@ -118,20 +118,20 @@ For each approach, document:
118
118
  ```bash
119
119
  echo "=== DOCUMENTATION RESEARCH ==="
120
120
 
121
- # Look for package.json or requirements to understand current stack
122
- if [ -f "package.json" ]; then
123
- echo "Node.js project detected"
124
- cat package.json | grep -A 20 "dependencies"
125
- elif [ -f "requirements.txt" ]; then
126
- echo "Python project detected"
127
- cat requirements.txt
128
- elif [ -f "Cargo.toml" ]; then
129
- echo "Rust project detected"
130
- cat Cargo.toml | grep -A 10 "dependencies"
131
- elif [ -f "go.mod" ]; then
132
- echo "Go project detected"
133
- cat go.mod
134
- fi
121
+ # Auto-detect project stack from common manifest files
122
+ echo "Detecting project stack..."
123
+ for manifest in package.json requirements.txt Pipfile Cargo.toml go.mod Gemfile pom.xml build.gradle composer.json Package.swift; do
124
+ if [ -f "$manifest" ]; then
125
+ echo "=== Found: $manifest ==="
126
+ head -30 "$manifest" | grep -i "depend\|version\|name" || head -30 "$manifest"
127
+ echo ""
128
+ fi
129
+ done
130
+
131
+ # Show detected languages from git (file extensions)
132
+ echo "Primary file types in project:"
133
+ find . -type f ! -path "*/.*" ! -path "*/node_modules/*" ! -path "*/vendor/*" ! -path "*/target/*" ! -path "*/build/*" ! -path "*/dist/*" 2>/dev/null \
134
+ | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -10
135
135
  ```
136
136
 
137
137
  **For each relevant library/framework**:
@@ -185,17 +185,23 @@ echo "=== CODEBASE PATTERN ANALYSIS ==="
185
185
  # Find similar existing implementations
186
186
  echo "Searching for similar patterns..."
187
187
 
188
- # Example: If implementing auth, search for existing auth patterns
189
- # grep -r "auth\|Auth\|authenticate" --include="*.js" --include="*.ts" . | head -20
188
+ # Generic search across all source files (language-agnostic)
189
+ # Example: If implementing auth, adapt the search term below
190
+ # find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.py" -o -name "*.go" -o -name "*.rs" \
191
+ # -o -name "*.java" -o -name "*.rb" -o -name "*.php" -o -name "*.cs" -o -name "*.cpp" \) \
192
+ # ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/vendor/*" ! -path "*/target/*" \
193
+ # -exec grep -l "auth\|authenticate" {} \; | head -20
190
194
 
191
195
  # Find architectural patterns
192
196
  echo "Analyzing project structure..."
193
197
  ls -la | head -20
194
- find . -type f -name "*.config.*" -o -name "*.json" | head -10
198
+ find . -type f \( -name "*.config.*" -o -name "*.json" -o -name "*.yaml" -o -name "*.yml" -o -name "*.toml" \) \
199
+ ! -path "*/node_modules/*" ! -path "*/.git/*" | head -15
195
200
 
196
- # Look for test patterns
201
+ # Look for test patterns (language-agnostic)
197
202
  echo "Checking test patterns..."
198
- find . -type f -name "*.test.*" -o -name "*.spec.*" | head -10
203
+ find . -type f \( -name "*test*" -o -name "*spec*" -o -name "*Test*" -o -name "*Spec*" \) \
204
+ ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/vendor/*" | head -15
199
205
  ```
200
206
 
201
207
  **Analysis Areas**:
@@ -217,17 +223,22 @@ find . -type f -name "*.test.*" -o -name "*.spec.*" | head -10
217
223
  ### 4.2 Code Style & Conventions
218
224
 
219
225
  ```bash
220
- # Check TypeScript/JavaScript patterns
221
- if [ -f "tsconfig.json" ]; then
222
- echo "TypeScript configuration:"
223
- cat tsconfig.json | head -30
224
- fi
225
-
226
- # Check linting rules
227
- if [ -f ".eslintrc.js" ] || [ -f ".eslintrc.json" ]; then
228
- echo "ESLint configuration found"
229
- cat .eslintrc.* | head -20
230
- fi
226
+ # Auto-detect language configuration files
227
+ echo "=== DETECTING CODE STYLE & CONVENTIONS ==="
228
+
229
+ # Check for common configuration files across languages
230
+ for config in tsconfig.json jsconfig.json .eslintrc* .prettierrc* pyproject.toml setup.cfg .pylintrc \
231
+ .rubocop.yml Cargo.toml rustfmt.toml .editorconfig .clang-format checkstyle.xml; do
232
+ if [ -f "$config" ] || ls $config 2>/dev/null | grep -q .; then
233
+ echo "=== Found: $config ==="
234
+ head -30 "$config" 2>/dev/null
235
+ echo ""
236
+ fi
237
+ done
238
+
239
+ # Look for linter/formatter patterns
240
+ echo "Checking for linting/formatting tools..."
241
+ ls -la | grep -E "lint|format|style" | head -10
231
242
  ```
232
243
 
233
244
  **Document**:
@@ -247,9 +258,17 @@ fi
247
258
  # Find similar features already implemented
248
259
  echo "Looking for similar existing features..."
249
260
 
250
- # Example searches - adapt to specific research topic
251
- # grep -r "export.*function" --include="*.ts" --include="*.js" . | head -10
252
- # grep -r "export.*class" --include="*.ts" --include="*.js" . | head -10
261
+ # Generic pattern search across all source files (adapt search term to research topic)
262
+ # Example: searching for function/class definitions across common languages
263
+ # find . -type f \( -name "*.js" -o -name "*.ts" -o -name "*.jsx" -o -name "*.tsx" \
264
+ # -o -name "*.py" -o -name "*.go" -o -name "*.rs" -o -name "*.java" -o -name "*.rb" \
265
+ # -o -name "*.php" -o -name "*.cs" -o -name "*.cpp" -o -name "*.c" -o -name "*.h" \) \
266
+ # ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/vendor/*" ! -path "*/target/*" \
267
+ # -exec grep -H "^export\|^public\|^def\|^func\|^fn\|^function\|^class" {} \; 2>/dev/null | head -20
268
+
269
+ # Show most commonly edited files (good candidates for similar patterns)
270
+ echo "Frequently modified files (likely contain patterns to follow):"
271
+ git log --pretty=format: --name-only --since="6 months ago" 2>/dev/null | sort | uniq -c | sort -rn | head -15
253
272
  ```
254
273
 
255
274
  **Analyze and document**:
@@ -7,6 +7,13 @@ allowed-tools: Task, Bash, Read, Write, Grep, Glob
7
7
 
8
8
  Perform a comprehensive review of uncommitted changes by orchestrating multiple specialized sub-agents in parallel. This provides quick feedback before committing changes.
9
9
 
10
+ **Audit Strategy**:
11
+ - **Always Run** (5 core audits): Security, Performance, Architecture, Tests, Complexity
12
+ - **Language-Specific** (conditional): TypeScript (runs only if .ts/.tsx files changed or tsconfig.json exists)
13
+ - **Available on demand**: Documentation, Dependencies, Database (use `/pre-pr` for full audit)
14
+
15
+ This lightweight approach provides fast feedback for individual commits. Use `/pre-pr` for comprehensive branch reviews before creating pull requests.
16
+
10
17
  ### Step 1: Analyze Current Changes
11
18
 
12
19
  First, check what changes are available for review:
@@ -32,10 +39,15 @@ echo ""
32
39
  Launch these sub-agents in parallel:
33
40
 
34
41
  1. audit-security sub-agent
35
- 2. audit-performance sub-agent
36
- 3. audit-architecture sub-agent
37
- 4. audit-tests sub-agent
38
- 5. audit-complexity sub-agent
42
+ 2. audit-typescript sub-agent (automatically skips if not applicable)
43
+ 3. audit-performance sub-agent
44
+ 4. audit-architecture sub-agent
45
+ 5. audit-tests sub-agent
46
+ 6. audit-complexity sub-agent
47
+
48
+ **Note**: The audit-typescript agent contains built-in detection logic and will automatically skip if:
49
+ - No .ts/.tsx files were changed AND
50
+ - No tsconfig.json exists in the project
39
51
 
40
52
  ### Step 3: Synthesize Review Findings
41
53
 
@@ -78,6 +90,9 @@ Create a comprehensive review document at `.docs/reviews/diff-{YYYY-MM-DD_HHMM}.
78
90
  ### Security Review (audit-security)
79
91
  {security findings with file:line references}
80
92
 
93
+ ### TypeScript Review (audit-typescript)
94
+ {type safety findings, or "⏭️ Skipped - not applicable" if no TS files}
95
+
81
96
  ### Performance Review (audit-performance)
82
97
  {performance findings with specific optimizations}
83
98
 
@@ -53,27 +53,52 @@ git log --oneline $BASE_BRANCH..HEAD
53
53
  echo ""
54
54
  ```
55
55
 
56
- ### Step 2: Launch Specialized Sub-Agents in Parallel
56
+ ### Step 2: Detect Change Categories
57
57
 
58
- Launch these sub-agents in parallel:
58
+ Analyze what types of changes are in this branch to determine which specialized agents are needed:
59
59
 
60
+ ```bash
61
+ # Check if database-related files changed
62
+ DB_CHANGES=$(git diff --name-only $BASE_BRANCH...HEAD | grep -E '\.(sql|prisma|migration|knex|sequelize|db)' || true)
63
+ DB_CHANGES+=$(git diff --name-only $BASE_BRANCH...HEAD | grep -iE '(migration|schema|database|models/)' || true)
64
+
65
+ if [ -n "$DB_CHANGES" ]; then
66
+ echo "🗄️ Database changes detected - will run database audit"
67
+ INCLUDE_DB_AUDIT=true
68
+ else
69
+ echo "ℹ️ No database changes detected - skipping database audit"
70
+ INCLUDE_DB_AUDIT=false
71
+ fi
72
+ echo ""
73
+ ```
74
+
75
+ ### Step 3: Launch Specialized Sub-Agents in Parallel
76
+
77
+ Launch these sub-agents in parallel based on change detection:
78
+
79
+ **Core Audits (Always Run)**:
60
80
  1. audit-security sub-agent
61
81
  2. audit-performance sub-agent
62
82
  3. audit-architecture sub-agent
63
83
  4. audit-tests sub-agent
64
84
  5. audit-complexity sub-agent
65
85
  6. audit-dependencies sub-agent
86
+ 7. audit-documentation sub-agent
66
87
 
67
- ### Step 3: Synthesize Comprehensive Review
88
+ **Conditional Audits** (automatically detect and skip if not applicable):
89
+ 8. audit-typescript sub-agent (only if .ts/.tsx files changed or tsconfig.json exists)
90
+ 9. audit-database sub-agent (only if database changes detected)
91
+
92
+ ### Step 4: Synthesize Comprehensive Review
68
93
 
69
94
  After all sub-agents complete their analysis:
70
95
 
71
- 1. **Collect Results**: Gather findings from all 6 specialized sub-agents
96
+ 1. **Collect Results**: Gather findings from all 7-8 specialized sub-agents (depending on change types)
72
97
  2. **Cross-Reference Issues**: Identify overlapping concerns between domains
73
98
  3. **Prioritize for PR**: Focus on merge-blocking vs nice-to-have improvements
74
99
  4. **Create PR-Ready Review**: Structure for easy consumption by human reviewers
75
100
 
76
- ### Step 4: Save Comprehensive Review Document
101
+ ### Step 5: Save Comprehensive Review Document
77
102
 
78
103
  Create a detailed review document at `.docs/reviews/branch-{BRANCH_NAME}-{YYYY-MM-DD_HHMM}.md`:
79
104
 
@@ -133,6 +158,16 @@ Create a detailed review document at `.docs/reviews/branch-{BRANCH_NAME}-{YYYY-M
133
158
  #### Security Recommendations
134
159
  {specific security improvements needed}
135
160
 
161
+ ### 📘 TypeScript Analysis (audit-typescript)
162
+ **Type Safety**: {Excellent/Good/Acceptable/Poor}
163
+ **Note**: Only included if TypeScript files changed or project uses TypeScript
164
+
165
+ #### TypeScript Issues Found
166
+ {detailed type safety findings with file:line references}
167
+
168
+ #### TypeScript Recommendations
169
+ {specific type safety improvements needed}
170
+
136
171
  ### ⚡ Performance Analysis (audit-performance)
137
172
  **Performance Impact**: {Positive/Neutral/Negative}
138
173
 
@@ -178,6 +213,25 @@ Create a detailed review document at `.docs/reviews/branch-{BRANCH_NAME}-{YYYY-M
178
213
  #### Dependency Recommendations
179
214
  {specific dependency management improvements}
180
215
 
216
+ ### 📚 Documentation Analysis (audit-documentation)
217
+ **Documentation Quality**: {Excellent/Good/Acceptable/Poor}
218
+
219
+ #### Documentation Issues Found
220
+ {detailed documentation drift, missing docs, stale examples}
221
+
222
+ #### Documentation Recommendations
223
+ {specific documentation updates needed}
224
+
225
+ ### 🗄️ Database Analysis (audit-database)
226
+ **Database Health**: {Excellent/Good/Acceptable/Poor}
227
+ **Note**: Only included if database changes detected
228
+
229
+ #### Database Issues Found
230
+ {detailed database design, migration, and query issues}
231
+
232
+ #### Database Recommendations
233
+ {specific database improvements needed}
234
+
181
235
  ---
182
236
 
183
237
  ## 🎯 Action Plan
@@ -204,11 +258,14 @@ Create a detailed review document at `.docs/reviews/branch-{BRANCH_NAME}-{YYYY-M
204
258
 
205
259
  **Breakdown**:
206
260
  - Security: {score}/10
261
+ - TypeScript: {score}/10 (if applicable)
207
262
  - Performance: {score}/10
208
263
  - Architecture: {score}/10
209
264
  - Test Coverage: {score}/10
210
265
  - Maintainability: {score}/10
211
266
  - Dependencies: {score}/10
267
+ - Documentation: {score}/10
268
+ - Database: {score}/10 (if applicable)
212
269
 
213
270
  ### Comparison to {BASE_BRANCH}
214
271
  - Quality Trend: {Improving/Stable/Declining}
@@ -253,7 +310,7 @@ Based on sub-agent analysis, human reviewers should focus on:
253
310
  *Next: Address blocking issues, then create PR with this review as reference*
254
311
  ```
255
312
 
256
- ### Step 5: Provide Executive Summary
313
+ ### Step 6: Provide Executive Summary
257
314
 
258
315
  Give the developer a clear, actionable summary:
259
316
 
@@ -0,0 +1,251 @@
1
+ ---
2
+ description: Automated release workflow with version management and publishing
3
+ allowed-tools: Task, Bash, Read, Write, Edit, Grep, Glob
4
+ ---
5
+
6
+ ## Your Task
7
+
8
+ Orchestrate a complete release workflow using the release sub-agent. This command guides you through creating a professional release with version management, changelog generation, building, testing, and publishing.
9
+
10
+ **Workflow**: User input → Release agent automation → User confirmations at critical steps
11
+
12
+ ### Step 1: Determine Release Type
13
+
14
+ First, ask the user what type of release they want to create:
15
+
16
+ ```bash
17
+ echo "🚀 DEVFLOW RELEASE AUTOMATION"
18
+ echo ""
19
+ echo "This will guide you through creating a new release."
20
+ echo ""
21
+ ```
22
+
23
+ Present options to the user:
24
+
25
+ ```
26
+ What type of release do you want to create?
27
+
28
+ 1. **patch** - Bug fixes and maintenance (0.1.2 → 0.1.3)
29
+ 2. **minor** - New features, backwards compatible (0.1.2 → 0.2.0)
30
+ 3. **major** - Breaking changes (0.1.2 → 1.0.0)
31
+ 4. **custom** - Specify exact version (e.g., 2.0.0-beta.1)
32
+ 5. **analyze** - Analyze changes and get recommendation first
33
+
34
+ Please specify the release type (patch/minor/major/custom/analyze):
35
+ ```
36
+
37
+ ### Step 2: Launch Release Agent
38
+
39
+ Once the user provides input, launch the release sub-agent with the appropriate prompt:
40
+
41
+ **If user chose "analyze"**:
42
+ ```
43
+ Invoke the release sub-agent with this prompt:
44
+
45
+ "Analyze the current repository state and recent commits. Execute through Step 3 (Determine New Version) and provide a recommendation for the version bump type. Show:
46
+ - Current version
47
+ - Commits since last release
48
+ - Breaking changes, features, and fixes detected
49
+ - Recommended version bump with reasoning
50
+
51
+ Stop and wait for user decision before proceeding with the release."
52
+ ```
53
+
54
+ **If user chose "patch", "minor", or "major"**:
55
+ ```
56
+ Invoke the release sub-agent with this prompt:
57
+
58
+ "Create a {bump_type} release. Follow the complete release workflow:
59
+ 1. Detect project type and configuration
60
+ 2. Verify clean working directory
61
+ 3. Analyze recent changes since last release
62
+ 4. Calculate new version as {bump_type} bump
63
+ 5. Generate changelog entry from commits
64
+ 6. Update version files
65
+ 7. Build project (if applicable)
66
+ 8. Run tests (if applicable)
67
+
68
+ STOP before Step 8 (Commit Version Bump) and show me:
69
+ - Current version → New version
70
+ - Generated changelog entry
71
+ - Files that will be modified
72
+ - Build/test results
73
+
74
+ Wait for my confirmation before proceeding with commit, push, publish, and tagging."
75
+ ```
76
+
77
+ **If user chose "custom"**:
78
+ ```
79
+ Ask user: "Please specify the exact version number (e.g., 2.0.0-beta.1):"
80
+
81
+ Then invoke the release sub-agent with this prompt:
82
+
83
+ "Create a release with custom version {specified_version}. Follow the complete release workflow:
84
+ 1. Detect project type and configuration
85
+ 2. Verify clean working directory
86
+ 3. Analyze recent changes since last release
87
+ 4. Use the specified version: {specified_version}
88
+ 5. Generate changelog entry from commits
89
+ 6. Update version files
90
+ 7. Build project (if applicable)
91
+ 8. Run tests (if applicable)
92
+
93
+ STOP before Step 8 (Commit Version Bump) and show me:
94
+ - Current version → New version
95
+ - Generated changelog entry
96
+ - Files that will be modified
97
+ - Build/test results
98
+
99
+ Wait for my confirmation before proceeding with commit, push, publish, and tagging."
100
+ ```
101
+
102
+ ### Step 3: Review and Confirm
103
+
104
+ After the release agent completes the preparation phase and stops, present the summary to the user:
105
+
106
+ ```
107
+ 📋 RELEASE READY FOR REVIEW
108
+
109
+ Current Version: {current_version}
110
+ New Version: {new_version}
111
+ Project Type: {project_type}
112
+
113
+ 📝 Changelog Entry:
114
+ {generated_changelog}
115
+
116
+ 📄 Files to be Modified:
117
+ - {version_file}
118
+ - {changelog_file}
119
+
120
+ ✅ Build Status: {build_result}
121
+ ✅ Test Status: {test_result}
122
+
123
+ ---
124
+
125
+ The release agent will now:
126
+ 1. Commit version bump
127
+ 2. Push to remote
128
+ 3. Publish package (if applicable)
129
+ 4. Create git tag
130
+ 5. Create GitHub/GitLab release (if available)
131
+
132
+ ⚠️ WARNING: Steps 3-5 are PERMANENT and PUBLIC
133
+
134
+ Do you want to proceed with the release? (yes/no):
135
+ ```
136
+
137
+ ### Step 4: Complete Release (After Confirmation)
138
+
139
+ If user confirms, continue with the release agent:
140
+
141
+ ```
142
+ Invoke the release sub-agent again with this prompt:
143
+
144
+ "Continue the release process from Step 8 (Commit Version Bump):
145
+ 8. Commit version bump
146
+ 9. Push to remote
147
+ 10. Publish package (if applicable) - STOP and ask for confirmation before publishing
148
+ 11. Create git tag
149
+ 12. Create GitHub/GitLab release
150
+ 13. Provide final summary
151
+
152
+ Execute these steps sequentially. Before Step 10 (publishing to package registry), STOP and explicitly ask for confirmation as this is permanent and public."
153
+ ```
154
+
155
+ ### Step 5: Publish Confirmation
156
+
157
+ When the agent reaches the publish step, ask for explicit confirmation:
158
+
159
+ ```
160
+ ⚠️ FINAL CONFIRMATION REQUIRED
161
+
162
+ The package is ready to be published to the public registry.
163
+
164
+ Project: {project_name}
165
+ Version: {new_version}
166
+ Registry: {registry_name}
167
+ Command: {publish_command}
168
+
169
+ This action is PERMANENT and IRREVERSIBLE.
170
+
171
+ Do you want to publish to the public registry? (yes/no):
172
+ ```
173
+
174
+ ### Step 6: Final Summary
175
+
176
+ After the release is complete, the agent will provide a final summary. Display it to the user and provide next steps:
177
+
178
+ ```
179
+ The release agent will show:
180
+ - Release summary with all completed steps
181
+ - Links to package registry
182
+ - Links to GitHub/GitLab release
183
+ - Links to tag and commits
184
+ - Verification steps for the user
185
+
186
+ Next steps for you:
187
+ 1. Verify package appears in registry
188
+ 2. Test installation in fresh environment
189
+ 3. Announce release to users/team
190
+ 4. Update documentation if needed
191
+ ```
192
+
193
+ ## Error Handling
194
+
195
+ If the release agent encounters an error at any step:
196
+
197
+ 1. **Before commit**: Changes can be rolled back easily
198
+ ```bash
199
+ git checkout {version_files}
200
+ ```
201
+
202
+ 2. **After commit, before push**: Can amend or reset
203
+ ```bash
204
+ git reset --hard HEAD~1
205
+ ```
206
+
207
+ 3. **After push, before publish**: Can remove tag and revert
208
+ ```bash
209
+ git tag -d {tag}
210
+ git push origin :{tag}
211
+ git revert HEAD
212
+ ```
213
+
214
+ 4. **After publish**: Cannot unpublish in most registries
215
+ - npm: Can only deprecate, not unpublish after 24h
216
+ - Document issue and create patch release
217
+
218
+ Always provide clear recovery instructions if something fails.
219
+
220
+ ## Safety Features
221
+
222
+ - ✅ Verify clean working directory before starting
223
+ - ✅ Show preview of all changes before committing
224
+ - ✅ Require explicit confirmation before publishing
225
+ - ✅ Provide rollback instructions at each step
226
+ - ✅ Stop and ask before any permanent/public action
227
+ - ✅ Generate proper semantic versioning
228
+ - ✅ Run build and tests before releasing
229
+
230
+ ## Quick Reference
231
+
232
+ ```bash
233
+ # Standard releases
234
+ /release # Interactive - asks for release type
235
+
236
+ # With specific type (if supported in future)
237
+ /release patch
238
+ /release minor
239
+ /release major
240
+
241
+ # Analyze first
242
+ /release analyze # Show recommendations without releasing
243
+ ```
244
+
245
+ ## Notes
246
+
247
+ - The release sub-agent handles all the technical details
248
+ - This command provides the user interaction layer
249
+ - Critical steps require explicit user confirmation
250
+ - All actions are logged and can be audited
251
+ - Works with any programming language/ecosystem