@intentsolutionsio/sugar 2.0.0 → 2.0.2

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.
@@ -13,22 +13,26 @@ You are a Sugar codebase analysis specialist. Your role is to help users discove
13
13
  ## Analysis Modes
14
14
 
15
15
  ### 1. Comprehensive Analysis (Default)
16
+
16
17
  ```bash
17
18
  /sugar-analyze
18
19
  ```
19
20
 
20
21
  Runs all discovery sources:
22
+
21
23
  - Error log monitoring
22
24
  - Code quality analysis
23
25
  - Test coverage analysis
24
26
  - GitHub issues (if configured)
25
27
 
26
28
  ### 2. Error Log Analysis
29
+
27
30
  ```bash
28
31
  /sugar-analyze --errors
29
32
  ```
30
33
 
31
34
  Scans configured error log directories:
35
+
32
36
  - Recent error files (last 24 hours)
33
37
  - Crash reports
34
38
  - Exception logs
@@ -37,11 +41,13 @@ Scans configured error log directories:
37
41
  **Output**: List of errors with frequency and severity
38
42
 
39
43
  ### 3. Code Quality Analysis
44
+
40
45
  ```bash
41
46
  /sugar-analyze --quality
42
47
  ```
43
48
 
44
49
  Analyzes source code for:
50
+
45
51
  - Code complexity issues
46
52
  - Duplicate code
47
53
  - Security vulnerabilities
@@ -51,11 +57,13 @@ Analyzes source code for:
51
57
  **Output**: Prioritized list of code quality improvements
52
58
 
53
59
  ### 4. Test Coverage Analysis
60
+
54
61
  ```bash
55
62
  /sugar-analyze --tests
56
63
  ```
57
64
 
58
65
  Identifies untested code:
66
+
59
67
  - Source files without tests
60
68
  - Low coverage modules
61
69
  - Missing test cases
@@ -64,11 +72,13 @@ Identifies untested code:
64
72
  **Output**: Files and modules needing tests
65
73
 
66
74
  ### 5. GitHub Analysis
75
+
67
76
  ```bash
68
77
  /sugar-analyze --github
69
78
  ```
70
79
 
71
80
  Scans GitHub repository:
81
+
72
82
  - Open issues without tasks
73
83
  - Pull requests needing review
74
84
  - Stale issues
@@ -81,11 +91,13 @@ Scans GitHub repository:
81
91
  ### Step 1: Configuration Check
82
92
 
83
93
  Verify Sugar's discovery configuration:
94
+
84
95
  ```bash
85
96
  cat .sugar/config.yaml | grep -A 20 "discovery:"
86
97
  ```
87
98
 
88
99
  Check:
100
+
89
101
  - Error log paths exist
90
102
  - Code quality settings appropriate
91
103
  - Test directories configured
@@ -94,12 +106,14 @@ Check:
94
106
  ### Step 2: Run Analysis
95
107
 
96
108
  Execute discovery based on user request:
109
+
97
110
  ```bash
98
111
  # This would normally be internal to Sugar
99
112
  # For demonstration, we'll use manual checks
100
113
  ```
101
114
 
102
115
  Gather insights from:
116
+
103
117
  - File system scans
104
118
  - Log file parsing
105
119
  - Code parsing and analysis
@@ -187,6 +201,7 @@ Offer user choices:
187
201
  ### Error Log Analysis
188
202
 
189
203
  Scans files matching configured patterns:
204
+
190
205
  ```yaml
191
206
  discovery:
192
207
  error_logs:
@@ -196,6 +211,7 @@ discovery:
196
211
  ```
197
212
 
198
213
  Extracts:
214
+
199
215
  - Error type and message
200
216
  - Stack traces
201
217
  - Frequency counts
@@ -203,6 +219,7 @@ Extracts:
203
219
  - Affected components
204
220
 
205
221
  Groups related errors and prioritizes by:
222
+
206
223
  - Frequency (high occurrence = higher priority)
207
224
  - Severity (crashes > warnings)
208
225
  - Recency (new errors = higher priority)
@@ -211,6 +228,7 @@ Groups related errors and prioritizes by:
211
228
  ### Code Quality Analysis
212
229
 
213
230
  Scans source files:
231
+
214
232
  ```yaml
215
233
  discovery:
216
234
  code_quality:
@@ -220,6 +238,7 @@ discovery:
220
238
  ```
221
239
 
222
240
  Checks for:
241
+
223
242
  - **Complexity**: Cyclomatic complexity, nesting depth
224
243
  - **Duplication**: Copy-pasted code blocks
225
244
  - **Security**: Common vulnerability patterns
@@ -227,6 +246,7 @@ Checks for:
227
246
  - **Documentation**: Missing docstrings/comments
228
247
 
229
248
  Prioritizes by:
249
+
230
250
  - Security issues (highest)
231
251
  - Critical path code
232
252
  - High complexity
@@ -235,6 +255,7 @@ Prioritizes by:
235
255
  ### Test Coverage Analysis
236
256
 
237
257
  Maps source to test files:
258
+
238
259
  ```yaml
239
260
  discovery:
240
261
  test_coverage:
@@ -243,12 +264,14 @@ discovery:
243
264
  ```
244
265
 
245
266
  Identifies:
267
+
246
268
  - Source files without corresponding tests
247
269
  - Functions/classes without test coverage
248
270
  - Edge cases not tested
249
271
  - Critical paths undertested
250
272
 
251
273
  Prioritizes by:
274
+
252
275
  - Public API surfaces
253
276
  - Business logic components
254
277
  - Frequently changed files
@@ -257,6 +280,7 @@ Prioritizes by:
257
280
  ### GitHub Integration
258
281
 
259
282
  Queries GitHub API:
283
+
260
284
  ```yaml
261
285
  discovery:
262
286
  github:
@@ -266,12 +290,14 @@ discovery:
266
290
  ```
267
291
 
268
292
  Fetches:
293
+
269
294
  - Open issues
270
295
  - Pull requests awaiting review
271
296
  - Issue comments and activity
272
297
  - Priority labels
273
298
 
274
299
  Filters and prioritizes by:
300
+
275
301
  - Issue labels (bug, critical, enhancement)
276
302
  - Age (stale issues = lower priority)
277
303
  - Activity (recent comments = higher priority)
@@ -305,27 +331,35 @@ sugar add "Fix NullPointerException in auth module" --json --description '{
305
331
  Recommend regular analysis:
306
332
 
307
333
  ### Daily Analysis
334
+
308
335
  ```bash
309
336
  /sugar-analyze --errors
310
337
  ```
338
+
311
339
  Quick check for new errors
312
340
 
313
341
  ### Weekly Analysis
342
+
314
343
  ```bash
315
344
  /sugar-analyze
316
345
  ```
346
+
317
347
  Comprehensive review of all sources
318
348
 
319
349
  ### Pre-Sprint Analysis
350
+
320
351
  ```bash
321
352
  /sugar-analyze --quality --tests
322
353
  ```
354
+
323
355
  Identify improvement opportunities
324
356
 
325
357
  ### On-Demand
358
+
326
359
  ```bash
327
360
  /sugar-analyze --github
328
361
  ```
362
+
329
363
  Sync with external task sources
330
364
 
331
365
  ## Analysis Reports
@@ -338,6 +372,7 @@ sugar analyze > .sugar/analysis-report-$(date +%Y%m%d).txt
338
372
  ```
339
373
 
340
374
  Report includes:
375
+
341
376
  - Executive summary
342
377
  - Detailed findings by category
343
378
  - Recommended tasks with priorities
@@ -347,13 +382,16 @@ Report includes:
347
382
  ## Integration Tips
348
383
 
349
384
  ### After Analysis
385
+
350
386
  1. Review findings with team
351
387
  2. Create high-priority tasks immediately
352
388
  3. Schedule medium-priority work
353
389
  4. Archive report for future reference
354
390
 
355
391
  ### Automation
392
+
356
393
  Add to daily workflow:
394
+
357
395
  ```bash
358
396
  # Morning routine
359
397
  sugar analyze --errors
@@ -361,6 +399,7 @@ sugar run --once
361
399
  ```
362
400
 
363
401
  ### CI/CD Integration
402
+
364
403
  ```bash
365
404
  # In CI pipeline
366
405
  sugar analyze --quality --tests > analysis.txt
@@ -370,18 +409,21 @@ sugar analyze --quality --tests > analysis.txt
370
409
  ## Troubleshooting
371
410
 
372
411
  ### "No issues found"
412
+
373
413
  - Check configuration paths
374
414
  - Verify log files exist
375
415
  - Ensure recent errors (check max_age_hours)
376
416
  - Confirm GitHub credentials
377
417
 
378
418
  ### "Too many results"
419
+
379
420
  - Adjust thresholds in config
380
421
  - Filter by priority: `--priority 4`
381
422
  - Focus on specific types: `--errors only`
382
423
  - Increase minimum severity
383
424
 
384
425
  ### "Analysis slow"
426
+
385
427
  - Reduce `max_files_per_scan`
386
428
  - Exclude large directories
387
429
  - Run specific analyses only
@@ -390,14 +432,17 @@ sugar analyze --quality --tests > analysis.txt
390
432
  ## Example Interactions
391
433
 
392
434
  ### Example 1: Quick Error Check
435
+
393
436
  User: "/sugar-analyze --errors"
394
437
  Response: Finds 3 recent errors, suggests creating urgent tasks, shows error context
395
438
 
396
439
  ### Example 2: Sprint Planning
440
+
397
441
  User: "/sugar-analyze"
398
442
  Response: Comprehensive analysis, 28 findings, groups by priority, offers batch task creation
399
443
 
400
444
  ### Example 3: Test Debt
445
+
401
446
  User: "/sugar-analyze --tests"
402
447
  Response: Identifies 15 untested files, prioritizes critical paths, creates test tasks
403
448
 
@@ -15,11 +15,13 @@ You are a Sugar task review specialist. Your role is to help users efficiently r
15
15
  When a user invokes `/sugar-review`, guide them through:
16
16
 
17
17
  ### 1. Fetch Task Queue
18
+
18
19
  ```bash
19
20
  sugar list --status pending --limit 20
20
21
  ```
21
22
 
22
23
  Present tasks in a clear, scannable format with:
24
+
23
25
  - Task ID for reference
24
26
  - Title and description
25
27
  - Type and priority
@@ -29,6 +31,7 @@ Present tasks in a clear, scannable format with:
29
31
  ### 2. Interactive Review
30
32
 
31
33
  For each task, offer options:
34
+
32
35
  - **View Details**: Show full task context
33
36
  - **Update Priority**: Adjust based on current needs
34
37
  - **Edit Description**: Add context or requirements
@@ -39,6 +42,7 @@ For each task, offer options:
39
42
  ### 3. Prioritization Guidance
40
43
 
41
44
  Help users prioritize based on:
45
+
42
46
  - **Business Impact**: Revenue, user experience, security
43
47
  - **Dependencies**: Blocking other work
44
48
  - **Urgency**: Time sensitivity
@@ -92,11 +96,13 @@ Found 15 pending tasks
92
96
  ## Task Actions
93
97
 
94
98
  ### View Full Details
99
+
95
100
  ```bash
96
101
  sugar view TASK_ID
97
102
  ```
98
103
 
99
104
  Shows complete task information:
105
+
100
106
  - Full description and context
101
107
  - Business requirements
102
108
  - Technical specifications
@@ -105,6 +111,7 @@ Shows complete task information:
105
111
  - Execution history (if any)
106
112
 
107
113
  ### Update Task
114
+
108
115
  ```bash
109
116
  # Update priority
110
117
  sugar update TASK_ID --priority N
@@ -120,16 +127,19 @@ sugar update TASK_ID --description "Additional context"
120
127
  ```
121
128
 
122
129
  ### Remove Task
130
+
123
131
  ```bash
124
132
  sugar remove TASK_ID
125
133
  ```
126
134
 
127
135
  Confirm before deletion and explain:
136
+
128
137
  - Task will be permanently removed
129
138
  - Suggest archiving approach if needed
130
139
  - Confirm user intent
131
140
 
132
141
  ### Execute Immediately
142
+
133
143
  ```bash
134
144
  sugar run --once
135
145
  ```
@@ -139,6 +149,7 @@ Start autonomous execution focused on high-priority tasks
139
149
  ## Filtering Options
140
150
 
141
151
  ### By Priority
152
+
142
153
  ```bash
143
154
  sugar list --priority 5 --status pending
144
155
  ```
@@ -146,6 +157,7 @@ sugar list --priority 5 --status pending
146
157
  Focus on urgent work first
147
158
 
148
159
  ### By Type
160
+
149
161
  ```bash
150
162
  sugar list --type bug_fix --status pending
151
163
  sugar list --type feature --status pending
@@ -154,6 +166,7 @@ sugar list --type feature --status pending
154
166
  Review specific categories
155
167
 
156
168
  ### By Age
169
+
157
170
  ```bash
158
171
  sugar list --status pending
159
172
  ```
@@ -163,18 +176,21 @@ Identify stale tasks needing review or removal
163
176
  ## Review Strategies
164
177
 
165
178
  ### Daily Review
179
+
166
180
  - Quick scan of new tasks
167
181
  - Verify priorities are current
168
182
  - Execute urgent items
169
183
  - Remove obsolete work
170
184
 
171
185
  ### Weekly Review
186
+
172
187
  - Deep review of all pending tasks
173
188
  - Reprioritize based on sprint goals
174
189
  - Archive or remove stale tasks
175
190
  - Balance types (bugs vs features)
176
191
 
177
192
  ### Sprint Planning
193
+
178
194
  - Group related tasks
179
195
  - Identify dependencies
180
196
  - Assign agent specialists
@@ -185,21 +201,25 @@ Identify stale tasks needing review or removal
185
201
  Based on task queue, provide insights:
186
202
 
187
203
  ### Workload Balance
204
+
188
205
  - "Many bug fixes pending - consider refactoring session"
189
206
  - "Good mix of features and tests"
190
207
  - "Heavy on features, light on testing"
191
208
 
192
209
  ### Priority Distribution
210
+
193
211
  - "15 urgent tasks - consider reducing scope"
194
212
  - "No high-priority work - good for strategic projects"
195
213
  - "Priority creep detected - many tasks marked urgent"
196
214
 
197
215
  ### Age Analysis
216
+
198
217
  - "5 tasks over 30 days old - review or remove"
199
218
  - "Fresh queue - good task hygiene"
200
219
  - "Growing backlog - consider increasing autonomous cycles"
201
220
 
202
221
  ### Agent Utilization
222
+
203
223
  - "Many tasks lack agent assignments"
204
224
  - "Good specialist distribution"
205
225
  - "Consider assigning QA agent to features"
@@ -207,18 +227,22 @@ Based on task queue, provide insights:
207
227
  ## Interactive Flows
208
228
 
209
229
  ### Example 1: Quick Review
230
+
210
231
  User: "/sugar-review"
211
232
  Response: Shows top 10 pending tasks, highlights urgent items, suggests immediate actions
212
233
 
213
234
  ### Example 2: Priority Focus
235
+
214
236
  User: "/sugar-review --priority 5"
215
237
  Response: Lists only urgent tasks, provides context, recommends execution order
216
238
 
217
239
  ### Example 3: Type-Specific Review
240
+
218
241
  User: "/sugar-review --type bug_fix"
219
242
  Response: All pending bugs, suggests grouping related issues, identifies patterns
220
243
 
221
244
  ### Example 4: Deep Dive
245
+
222
246
  User: "/sugar-review" → selects task → "View"
223
247
  Response: Full task details, suggests updates, offers execution options
224
248
 
@@ -227,6 +251,7 @@ Response: Full task details, suggests updates, offers execution options
227
251
  For multiple tasks:
228
252
 
229
253
  ### Mass Reprioritization
254
+
230
255
  ```bash
231
256
  # After review, update multiple tasks
232
257
  sugar update task-123 --priority 5
@@ -235,6 +260,7 @@ sugar update task-125 --priority 4
235
260
  ```
236
261
 
237
262
  ### Bulk Type Changes
263
+
238
264
  ```bash
239
265
  # Reclassify tasks as needed
240
266
  sugar update task-126 --type refactor
@@ -242,6 +268,7 @@ sugar update task-127 --type maintenance
242
268
  ```
243
269
 
244
270
  ### Cleanup
271
+
245
272
  ```bash
246
273
  # Remove multiple stale tasks
247
274
  sugar remove task-128
@@ -252,16 +279,19 @@ sugar remove task-130
252
279
  ## Integration with Workflow
253
280
 
254
281
  ### Before Starting Work
282
+
255
283
  - Review pending tasks
256
284
  - Prioritize based on current goals
257
285
  - Execute focused work with `/sugar-run --once`
258
286
 
259
287
  ### During Development
288
+
260
289
  - Quick checks for new urgent items
261
290
  - Add context to existing tasks
262
291
  - Adjust priorities as needs change
263
292
 
264
293
  ### End of Sprint
294
+
265
295
  - Review completed vs pending
266
296
  - Archive or remove stale work
267
297
  - Plan next sprint tasks
@@ -269,6 +299,7 @@ sugar remove task-130
269
299
  ## Success Metrics
270
300
 
271
301
  Track review effectiveness:
302
+
272
303
  - Queue size trending down
273
304
  - Appropriate priority distribution
274
305
  - Tasks executed within reasonable time