autoworkflow 3.9.1 → 3.11.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.md CHANGED
@@ -124,6 +124,41 @@ All state stored in `.claude/.autoworkflow/`:
124
124
 
125
125
  ---
126
126
 
127
+ ## Logging System
128
+
129
+ Real-time visibility into hook execution, gates, and workflow events.
130
+
131
+ **Log Location:** `.claude/.autoworkflow/logs/aw.log`
132
+
133
+ **CLI Commands:**
134
+ ```bash
135
+ npx autoworkflow logs # Watch logs in real-time
136
+ npx autoworkflow logs --recent # Show last 50 entries
137
+ npx autoworkflow logs --all # Show all logs
138
+ npx autoworkflow logs --clear # Clear logs
139
+ npx autoworkflow logs --stats # Show statistics
140
+ ```
141
+
142
+ **Or use tail directly:**
143
+ ```bash
144
+ tail -f .claude/.autoworkflow/logs/aw.log
145
+ ```
146
+
147
+ **Log Categories:**
148
+ | Category | Events |
149
+ |----------|--------|
150
+ | HOOK | Hook start/complete |
151
+ | PHASE | Phase transitions |
152
+ | GATE | Gate checks (pass/block) |
153
+ | VERIFY | Verification iterations |
154
+ | MEMORY | Memory update prompts |
155
+ | COMMIT | Commit events |
156
+ | ERROR | Errors and failures |
157
+
158
+ **Debug Mode:** Set `AUTOWORKFLOW_DEBUG=1` to see logs in terminal.
159
+
160
+ ---
161
+
127
162
  ## Memory System (Serena-inspired)
128
163
 
129
164
  Persistent context that survives across sessions. **Claude edits files directly** + hooks prompt at key moments.
@@ -246,6 +281,7 @@ npm run format # Prettier
246
281
  | `phase-transition.sh` | Manual call | State management |
247
282
  | `audit-runner.sh` | Manual call | Run UI + cycle audits |
248
283
  | `blueprint-generator.sh` | Manual call | Enhanced project discovery (8 scans) |
284
+ | `logger.sh` | Sourced by hooks | Centralized logging system |
249
285
 
250
286
  ---
251
287
 
package/bin/cli.js CHANGED
@@ -72,6 +72,12 @@ Commands:
72
72
  ${colors.cyan('update')} Smart update - core files only, preserve user files
73
73
  ${colors.cyan('status')} Show installed version and what would change
74
74
 
75
+ ${colors.cyan('logs')} View AutoWorkflow logs (real-time)
76
+ ${colors.cyan('logs --recent')} Show last 50 log entries
77
+ ${colors.cyan('logs --all')} Show all logs
78
+ ${colors.cyan('logs --clear')} Clear all logs
79
+ ${colors.cyan('logs --stats')} Show log statistics
80
+
75
81
  ${colors.cyan('help')} Show this help message
76
82
 
77
83
  Options:
@@ -82,7 +88,7 @@ Examples:
82
88
  npx autoworkflow init # Fresh install
83
89
  npx autoworkflow update # Update core files only
84
90
  npx autoworkflow status # Check what would change
85
- npx autoworkflow init --force # Full reinstall
91
+ npx autoworkflow logs # Watch logs in real-time
86
92
  `);
87
93
  }
88
94
 
@@ -453,6 +459,62 @@ function init(options = {}) {
453
459
  console.log(`${colors.dim('Optional: Edit instructions/AI_RULES.md to customize coding standards')}\n`);
454
460
  }
455
461
 
462
+ // Logs command
463
+ import { spawn } from 'child_process';
464
+
465
+ function logs() {
466
+ const cwd = process.cwd();
467
+ const loggerScript = join(cwd, '.claude', 'hooks', 'logger.sh');
468
+
469
+ // Check if logger exists
470
+ if (!existsSync(loggerScript)) {
471
+ console.log(`${colors.yellow('⚠')} AutoWorkflow not initialized in this directory.`);
472
+ console.log(` Run: npx autoworkflow init`);
473
+ process.exit(1);
474
+ }
475
+
476
+ // Determine subcommand
477
+ const subCommand = args[1] || 'live';
478
+
479
+ let loggerArg;
480
+ switch (subCommand) {
481
+ case '--recent':
482
+ case '-r':
483
+ loggerArg = 'recent';
484
+ break;
485
+ case '--all':
486
+ case '-a':
487
+ loggerArg = 'all';
488
+ break;
489
+ case '--clear':
490
+ case '-c':
491
+ loggerArg = 'clear';
492
+ break;
493
+ case '--stats':
494
+ case '-s':
495
+ loggerArg = 'stats';
496
+ break;
497
+ default:
498
+ loggerArg = 'live';
499
+ }
500
+
501
+ // Run the logger script
502
+ const child = spawn('bash', [loggerScript, loggerArg], {
503
+ cwd: cwd,
504
+ stdio: 'inherit',
505
+ env: { ...process.env, CLAUDE_PROJECT_DIR: cwd }
506
+ });
507
+
508
+ child.on('error', (err) => {
509
+ console.error(`${colors.red('Error:')} ${err.message}`);
510
+ process.exit(1);
511
+ });
512
+
513
+ child.on('exit', (code) => {
514
+ process.exit(code || 0);
515
+ });
516
+ }
517
+
456
518
  // Main
457
519
  switch (command) {
458
520
  case 'init':
@@ -464,6 +526,10 @@ switch (command) {
464
526
  case 'status':
465
527
  status();
466
528
  break;
529
+ case 'logs':
530
+ case 'log':
531
+ logs();
532
+ break;
467
533
  case 'help':
468
534
  case '--help':
469
535
  case '-h':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autoworkflow",
3
- "version": "3.9.1",
3
+ "version": "3.11.0",
4
4
  "description": "Automated workflow enforcement for Claude Code via hooks and system prompts",
5
5
  "type": "module",
6
6
  "bin": {