autoworkflow 1.1.0 → 1.2.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/lib/index.js CHANGED
@@ -5,5 +5,5 @@
5
5
  */
6
6
 
7
7
  module.exports = {
8
- version: '1.1.0',
8
+ version: '1.2.0',
9
9
  };
package/lib/install.js CHANGED
@@ -200,19 +200,40 @@ function createClaudeMd(projectRoot) {
200
200
  return;
201
201
  }
202
202
 
203
- const claudeContent = `# CLAUDE.md - AI Workflow Instructions
203
+ const claudeContent = `# CLAUDE.md - Agentic Workflow
204
204
 
205
- > **MANDATORY**: Follow this workflow for ALL coding tasks.
205
+ > **MANDATORY**: Follow this workflow for ALL coding tasks. No exceptions.
206
206
 
207
- ## Workflow
207
+ ## Workflow (REQUIRED)
208
208
 
209
209
  \`\`\`
210
- 1. ANALYZE → Read relevant files first
211
- 2. PLAN → Show plan + suggestions
212
- 3. CONFIRM → "Should I proceed?" (wait for approval)
213
- 4. IMPLEMENT → Make changes (after approval)
214
- 5. VERIFY → Run checks (autoworkflow handles this on commit)
215
- 6. COMMIT → Conventional commit format required
210
+ ┌─────────────────────────────────────────────────────────────────┐
211
+ │ AGENTIC WORKFLOW │
212
+ ├─────────────────────────────────────────────────────────────────┤
213
+ │ │
214
+ │ 1. ANALYZE ──► Read relevant files first │
215
+ │ │ │
216
+ │ ▼ │
217
+ │ 2. PLAN ──► Show plan + suggestions (3-tier) │
218
+ │ │ │
219
+ │ ▼ │
220
+ │ 3. CONFIRM ──► "Should I proceed?" (WAIT for approval) │
221
+ │ │ │
222
+ │ ▼ │
223
+ │ 4. IMPLEMENT ──► Make changes (after approval only) │
224
+ │ │ │
225
+ │ ▼ │
226
+ │ 5. VERIFY ──► npm run typecheck 2>&1 || true │
227
+ │ │ │
228
+ │ ├──► PASS ──► Continue to step 6 │
229
+ │ │ │
230
+ │ └──► FAIL ──► Fix errors → Re-verify (max 5 attempts) │
231
+ │ │
232
+ │ ▼ │
233
+ │ 6. COMMIT ──► git commit -m "type: description" │
234
+ │ (autoworkflow runs all checks automatically) │
235
+ │ │
236
+ └─────────────────────────────────────────────────────────────────┘
216
237
  \`\`\`
217
238
 
218
239
  ---
@@ -232,9 +253,9 @@ These rules are **automatically enforced** on every commit:
232
253
 
233
254
  ---
234
255
 
235
- ## Suggestions System
256
+ ## Suggestions System (3-Tier)
236
257
 
237
- For EVERY new feature, include suggestions after your plan:
258
+ For EVERY new feature or significant change, include a **Suggestions** section after your plan:
238
259
 
239
260
  \`\`\`
240
261
  💡 **Suggestions for Feature Completeness:**
@@ -246,36 +267,132 @@ For EVERY new feature, include suggestions after your plan:
246
267
 
247
268
  🟡 **Recommended** (improves quality):
248
269
  - [ ] Handle edge case: [scenario]
249
- - [ ] Add accessibility: [aria labels]
270
+ - [ ] Add accessibility: [aria labels, keyboard nav]
271
+ - [ ] Empty state handling
250
272
 
251
273
  🟢 **Optional** (nice to have):
252
- - [ ] Add tests
253
- - [ ] Performance optimization
274
+ - [ ] Add tests for [component/function]
275
+ - [ ] Performance optimization: [specific]
276
+ - [ ] Add analytics tracking
254
277
 
255
- **Which suggestions should I include?** (all/required/none)
278
+ **Which suggestions should I include?** (all/required/none/1,2,4)
256
279
  \`\`\`
257
280
 
281
+ ### When to Show Suggestions
282
+
283
+ | Task Type | Show Suggestions? |
284
+ |-----------|-------------------|
285
+ | New feature | ✅ Always |
286
+ | New component | ✅ Always |
287
+ | New page/route | ✅ Always |
288
+ | Bug fix | ⚠️ Only if reveals missing handling |
289
+ | Refactor | ⚠️ Only if scope expands |
290
+ | Style changes | ❌ Skip |
291
+ | Config changes | ❌ Skip |
292
+
293
+ ### Suggestion Checklist Reference
294
+
295
+ **Functionality:**
296
+ - [ ] Error states (API failures, network errors)
297
+ - [ ] Loading states (spinners, skeletons)
298
+ - [ ] Empty states (no data)
299
+ - [ ] Success feedback (toasts, confirmations)
300
+
301
+ **Edge Cases:**
302
+ - [ ] Null/undefined data
303
+ - [ ] Empty arrays/strings
304
+ - [ ] Maximum limits (text length, file size)
305
+ - [ ] Concurrent actions (double-click, race conditions)
306
+
307
+ **User Experience:**
308
+ - [ ] Form validation (client + server)
309
+ - [ ] Keyboard navigation
310
+ - [ ] Mobile responsiveness
311
+ - [ ] Disabled states
312
+
258
313
  ---
259
314
 
260
315
  ## Confirmation Checkpoints
261
316
 
262
- ### Before Implementation
317
+ ### Checkpoint 1: Plan + Suggestions (BEFORE implementing)
318
+
263
319
  \`\`\`
264
320
  ## Task: [description]
265
321
 
266
- ### Plan
322
+ ### 1. Analysis
323
+ [findings from codebase]
324
+
325
+ ### 2. Plan
326
+ 📋 **Proposed changes:**
267
327
  1. [Change 1]
268
328
  2. [Change 2]
269
329
 
270
- 💡 Suggestions: [list]
330
+ 💡 **Suggestions for Feature Completeness:**
331
+
332
+ 🔴 **Required:**
333
+ - [ ] Add error handling for API failure
334
+ - [ ] Add loading state while fetching
335
+
336
+ 🟡 **Recommended:**
337
+ - [ ] Add empty state when no results
338
+ - [ ] Add keyboard shortcut
339
+
340
+ 🟢 **Optional:**
341
+ - [ ] Add unit tests
342
+
343
+ **Should I proceed?**
344
+ **Which suggestions to include?** (all/required/none/1,2,4)
345
+ \`\`\`
346
+
347
+ ### Checkpoint 2: Before Destructive Actions
271
348
 
349
+ \`\`\`
350
+ ⚠️ **Warning:** This will [describe impact].
351
+ Files affected: [list]
272
352
  **Should I proceed?**
273
353
  \`\`\`
274
354
 
275
- ### Before Commit
355
+ ### Checkpoint 3: Before Commit
356
+
357
+ \`\`\`
358
+ ✅ Verification passed.
359
+ **Should I commit with message: "[message]"?**
360
+ \`\`\`
361
+
362
+ ---
363
+
364
+ ## Verification Protocol
365
+
366
+ ### After EVERY Change
367
+
368
+ \`\`\`bash
369
+ npm run typecheck 2>&1 || true
370
+ \`\`\`
371
+
372
+ ### Error Resolution (Max 5 Attempts)
373
+
374
+ \`\`\`
375
+ ┌─────────────────────────────────────────────────────────────────┐
376
+ │ VERIFICATION FAILED - Attempt [X/5] │
377
+ ├─────────────────────────────────────────────────────────────────┤
378
+ │ Error: [error message] │
379
+ │ File: [file path] │
380
+ │ Line: [line number] │
381
+ ├─────────────────────────────────────────────────────────────────┤
382
+ │ Fix Applied: [what was changed] │
383
+ │ Re-running verification... │
384
+ └─────────────────────────────────────────────────────────────────┘
276
385
  \`\`\`
277
- ✅ All checks will run automatically via autoworkflow.
278
- **Should I commit with message: "type: description"?**
386
+
387
+ ### If 5 Attempts Fail
388
+
389
+ \`\`\`
390
+ ❌ VERIFICATION FAILED after 5 attempts.
391
+ Remaining errors:
392
+ 1. [error 1]
393
+ 2. [error 2]
394
+
395
+ **Need guidance on:** [specific question about the error]
279
396
  \`\`\`
280
397
 
281
398
  ---
@@ -288,21 +405,49 @@ Must follow conventional commits:
288
405
  # Valid formats
289
406
  feat: add user authentication
290
407
  fix(api): resolve timeout issue
291
- docs: update readme
408
+ docs: update installation guide
292
409
 
293
410
  # Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert
294
411
  \`\`\`
295
412
 
296
413
  ---
297
414
 
298
- ## Rules
415
+ ## Anti-Patterns (NEVER DO)
416
+
417
+ | ❌ Don't | ✅ Do Instead |
418
+ |----------|---------------|
419
+ | Implement without plan | Show plan + suggestions first |
420
+ | Leave TODO comments | Complete the work or create issue |
421
+ | Use console.log | Remove or use proper logging |
422
+ | Skip verification | Always run \`npm run typecheck\` |
423
+ | Batch multiple features | Complete one feature fully first |
424
+ | Commit with errors | Fix all errors before commit |
425
+ | Guess at solutions | Ask for clarification |
426
+
427
+ ---
428
+
429
+ ## Quick Reference
430
+
431
+ **For new features:**
432
+ \`\`\`
433
+ Analyze → Plan + Suggestions → Confirm → Implement → Verify → Commit
434
+ \`\`\`
435
+
436
+ **For bug fixes:**
437
+ \`\`\`
438
+ Analyze → Plan → Confirm → Implement → Verify → Commit
439
+ \`\`\`
440
+
441
+ **Commands:**
442
+ \`\`\`bash
443
+ npm run typecheck # Verify (REQUIRED after changes)
444
+ npx autoworkflow run # Run all enforcement checks
445
+ npx autoworkflow list # Show rule status
446
+ \`\`\`
447
+
448
+ ---
299
449
 
300
- 1. **Ask before implementing** - Plan first, wait for approval
301
- 2. **No console.log** - Use proper logging or remove
302
- 3. **No TODO comments** - Complete the work or create an issue
303
- 4. **Fix all errors** - TypeScript and ESLint must pass
304
- 5. **One feature at a time** - Complete fully before next
305
- 6. **Use conventional commits** - type(scope): description
450
+ **VERIFY ALWAYS. SUGGEST COMPLETENESS. ASK BEFORE ACTIONS.**
306
451
  `;
307
452
 
308
453
  fs.writeFileSync(claudePath, claudeContent);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoworkflow",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "Automatic code quality enforcement with fix loops, configurable rules, and Git hook integration",
5
5
  "keywords": [
6
6
  "git-hooks",