* feat: add AutoFix config schema and reader module Implements AutoFixConfigSchema (Zod v4) with validation for lint/test commands, maxRetries (0-10, default 3), and timeout (1000-300000ms, default 30000). Adds getAutoFixConfig helper that returns null for disabled or invalid configs. All 9 unit tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add autoFix runner with lint/test command execution Implements AutoFixRunner (Task 2) - executes lint and test shell commands sequentially, short-circuits on lint failure, handles timeouts, and produces structured AutoFixResult with AI-friendly error summaries. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add autoFix field to SettingsSchema with integration tests Integrates AutoFixConfigSchema into SettingsSchema so autoFix settings are validated at the settings layer. Adds two integration tests verifying that valid configs are accepted and invalid configs (enabled with no commands) are rejected. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: add autoFix hook integration helpers (Task 4) Implements shouldRunAutoFix and buildAutoFixContext functions used by the PostToolUse hook to determine when to run auto-fix and format errors as AI-readable context for injection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: wire autoFix into PostToolUse hook flow (Task 5) Add auto-fix lint/test check after existing PostToolUse hooks in runPostToolUseHooks. When autoFix is configured in settings, runs lint/test commands after file_edit/file_write tools and yields errors as hook_additional_context for the model to act on. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat: add /auto-fix slash command Adds the /auto-fix prompt command that helps users configure autoFix settings (lint/test commands, maxRetries, timeout) in .claude/settings.json. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: remove unused imports in autoFixRunner test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address review feedback — enforce maxRetries, wire abort signal, use cross-platform shell 1. Enforce maxRetries: track auto-fix attempts per query chain in toolHooks.ts and stop feeding errors back after the configured limit is reached. 2. Wire abort signal to subprocess: subscribe to AbortController signal in runCommand() and kill the process tree on abort. Uses detached process groups on Unix to ensure child processes are also terminated. 3. Replace hardcoded bash with shell:true: use Node's cross-platform shell resolution instead of spawn('bash', ['-c', ...]) so auto-fix commands work on Windows and non-bash environments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
4.2 KiB
4.2 KiB