From 8c2d56844b3c9c5ce8fee0758d8b7d580daaa33a Mon Sep 17 00:00:00 2001 From: gnanam1990 Date: Wed, 8 Apr 2026 14:29:37 +0530 Subject: [PATCH] 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 --- src/commands.ts | 2 ++ src/commands/auto-fix.ts | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/commands/auto-fix.ts diff --git a/src/commands.ts b/src/commands.ts index cba5bc2e..37e02a2d 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -136,6 +136,7 @@ import hooks from './commands/hooks/index.js' import files from './commands/files/index.js' import branch from './commands/branch/index.js' import agents from './commands/agents/index.js' +import autoFix from './commands/auto-fix.js' import plugin from './commands/plugin/index.js' import reloadPlugins from './commands/reload-plugins/index.js' import rewind from './commands/rewind/index.js' @@ -263,6 +264,7 @@ const COMMANDS = memoize((): Command[] => [ addDir, advisor, agents, + autoFix, branch, btw, chrome, diff --git a/src/commands/auto-fix.ts b/src/commands/auto-fix.ts new file mode 100644 index 00000000..41c53fd8 --- /dev/null +++ b/src/commands/auto-fix.ts @@ -0,0 +1,25 @@ +import type { Command } from '../types/command.js' + +const command: Command = { + name: 'auto-fix', + description: 'Configure auto-fix: run lint/test after AI edits', + isEnabled: () => true, + type: 'prompt', + progressMessage: 'Configuring auto-fix...', + contentLength: 0, + source: 'builtin', + async getPromptForCommand() { + return [ + { + type: 'text', + text: + 'The user wants to configure auto-fix settings. Auto-fix automatically runs lint and test commands after AI file edits, feeding errors back for self-repair.\n\n' + + 'Current settings location: `.claude/settings.json` or `.claude/settings.local.json`\n\n' + + 'Example configuration:\n```json\n{\n "autoFix": {\n "enabled": true,\n "lint": "eslint . --fix",\n "test": "bun test",\n "maxRetries": 3,\n "timeout": 30000\n }\n}\n```\n\n' + + 'Ask the user what lint and test commands they use, then help them set up the configuration.', + }, + ] + }, +} + +export default command