From 8d690da99a6027d646db1d52ebbb1fadcfc83b45 Mon Sep 17 00:00:00 2001 From: sidtheone Date: Sat, 28 Feb 2026 16:35:37 +0100 Subject: [PATCH] feat: add Claude Code hotfix for interaction_style variable reference Standalone instruction file that patches existing BMAD installations to use explicit {interaction_style} session variable lookup with open-mode default fallback. Co-Authored-By: Claude Opus 4.6 --- .../claude-hotfix-interaction-style.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 tools/cli/installers/lib/ide/templates/combined/claude-hotfix-interaction-style.md diff --git a/tools/cli/installers/lib/ide/templates/combined/claude-hotfix-interaction-style.md b/tools/cli/installers/lib/ide/templates/combined/claude-hotfix-interaction-style.md new file mode 100644 index 000000000..bb6432abe --- /dev/null +++ b/tools/cli/installers/lib/ide/templates/combined/claude-hotfix-interaction-style.md @@ -0,0 +1,67 @@ +--- +name: 'BMAD Hotfix: interaction_style variable reference' +description: 'Patches all interaction_style RULE directives to use explicit session variable lookup with open-mode default' +--- + +# Hotfix: interaction_style explicit variable reference + +You are applying a hotfix to this BMAD installation. Follow these steps exactly. + +## What this fixes + +Old RULE directives use bare text like `When interaction_style is "structured"` which LLMs fail to evaluate reliably. This hotfix: +1. Replaces all bare conditionals with explicit variable lookup: `Check your stored {interaction_style} session variable from activation step 2` +2. Adds fallback: `If you cannot determine {interaction_style}, default to open mode` +3. Ensures Claude Code files reference the `AskUserQuestion` tool by name + +## Steps + +### Step 1 — Find all affected files + +Search the entire project for files containing `interaction_style`. Target these locations: +- `_bmad/` — agent `.md` files, `tasks/workflow.xml`, handler files +- `.claude/commands/` — all slash command entry points + +### Step 2 — Replace RULE directives in `.claude/commands/` files + +For every file in `.claude/commands/` that contains an interaction_style RULE, replace the RULE line with: + +``` +RULE: Check your stored {interaction_style} session variable from activation step 2. When its value is "structured", EVERY question to the user MUST call the `AskUserQuestion` tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to open mode. +``` + +Common old patterns to find and replace: +- `RULE: When interaction_style is "structured", EVERY question to the user MUST call the AskUserQuestion tool...` +- `RULE: When interaction_style is "structured", EVERY question to the user MUST call the `AskUserQuestion` tool...` +- `RULE: When interaction_style is "structured", EVERY question to the user MUST use structured options with a numbered list...` +- Any line starting with `RULE:` that contains `interaction_style` + +### Step 3 — Fix `_bmad/core/tasks/workflow.xml` + +Find the `` containing `interaction_style` and replace it with: + +```xml +RULE: Check your stored {interaction_style} session variable from activation step 2. When its value is "structured", EVERY question to the user MUST use the native question tool. No exceptions. No inline prompts. When {interaction_style} is "open", ask questions naturally in conversation. If you cannot determine {interaction_style}, default to open mode. +``` + +### Step 4 — Fix agent `` blocks + +In all agent `.md` files under `_bmad/*/agents/`, find the `` rule containing `interaction_style` and replace with: + +```xml +Check your stored {interaction_style} session variable from activation step 2. When its value is "structured", EVERY question to the user MUST use structured options with a numbered list unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to open mode. +``` + +### Step 5 — Fix handler rules in agent files + +In agent `.md` files, find handler RULE lines containing `interaction_style` and replace with: + +``` +RULE: Check your stored {interaction_style} session variable from activation step 2. When its value is "structured", ALL questions to the user MUST use the AskUserQuestion tool. No plain text prompts. If you cannot determine {interaction_style}, default to open mode. +``` + +### Step 6 — Verify + +Run a search for `When interaction_style is` across the entire project. There should be ZERO matches remaining. Every reference should now start with `Check your stored {interaction_style}`. + +Report the total number of files modified.