fix: use explicit variable reference in interaction_style RULE

Change all 34 RULE directives from bare "When interaction_style is"
to explicit "Check your stored {interaction_style} session variable
from activation step 2" with a fallback default to structured mode.

Addresses cynical review finding that LLMs struggle with implicit
natural-language conditionals and need explicit variable lookup
instructions plus failure mode handling.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
sidtheone 2026-02-28 13:52:30 +01:00
parent 1cfde63aee
commit 536c484c7d
34 changed files with 34 additions and 33 deletions

View File

@ -1,6 +1,6 @@
<rules>
<r>ALWAYS communicate in {communication_language} UNLESS contradicted by communication_style.</r>
<r>When {interaction_style} 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.</r>
<r>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 structured mode.</r>
<r> Stay in character until exit selected</r>
<r> Display Menu items as the item dictates and in the order given.</r>
<r> Load files ONLY when executing a user chosen workflow or a command requires it, EXCEPTION: agent activation step 2 config.yaml</r>

View File

@ -416,6 +416,7 @@ class CodexSetup extends BaseIdeSetup {
const skillContent =
`---\n${fm}\n---\n` +
"\nYou must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.\n" +
'\nRULE: Check your stored {interaction_style} session variable from activation step 2. When its value is "structured", EVERY question to the user MUST call the `ask_user_question` tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.\n' +
'\n<agent-activation CRITICAL="TRUE">\n' +
`1. LOAD the FULL agent file from @${agentPath}\n` +
'2. READ its entire contents - this contains the complete agent persona, menu, and instructions\n' +

View File

@ -5,7 +5,7 @@ description: '{{description}}'
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
RULE: When interaction_style 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.
RULE: 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 structured mode.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from @_bmad/{{module}}/agents/{{path}}

View File

@ -7,4 +7,4 @@ Read the entire workflow file at: {project-root}/{{bmadFolderName}}/{{workflow_p
Follow all instructions in the workflow file exactly as written.
RULE: When interaction_style 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.
RULE: 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 structured mode.

View File

@ -5,7 +5,7 @@ description: '{{description}}'
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `AskUserQuestion` tool unless the workflow or user explicitly requests free-form input.
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 structured mode.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -5,7 +5,7 @@ description: '{{description}}'
# {{name}}
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `AskUserQuestion` tool unless the workflow or user explicitly requests free-form input.
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 structured mode.
Read the entire task file at: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -5,7 +5,7 @@ description: '{{description}}'
# {{name}}
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `AskUserQuestion` tool unless the workflow or user explicitly requests free-form input.
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 structured mode.
Read the entire tool file at: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -3,7 +3,7 @@ name: '{{name}}'
description: '{{description}}'
---
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `AskUserQuestion` tool unless the workflow or user explicitly requests free-form input.
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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded:

View File

@ -3,6 +3,6 @@ name: '{{name}}'
description: '{{description}}'
---
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `AskUserQuestion` tool unless the workflow or user explicitly requests free-form input.
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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @{project-root}/{{bmadFolderName}}/{{path}}, READ its entire contents and follow its directions exactly!

View File

@ -5,7 +5,7 @@ description: '{{description}}'
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
RULE: When interaction_style 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.
RULE: 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 structured mode.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -5,7 +5,7 @@ description: '{{description}}'
# {{name}}
RULE: When interaction_style 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.
RULE: 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 structured mode.
Read the entire task file at: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -5,7 +5,7 @@ description: '{{description}}'
# {{name}}
RULE: When interaction_style 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.
RULE: 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 structured mode.
Read the entire tool file at: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -3,7 +3,7 @@ name: '{{name}}'
description: '{{description}}'
---
RULE: When interaction_style 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.
RULE: 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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded:

View File

@ -3,6 +3,6 @@ name: '{{name}}'
description: '{{description}}'
---
RULE: When interaction_style 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.
RULE: 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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @{project-root}/{{bmadFolderName}}/{{path}}, READ its entire contents and follow its directions exactly!

View File

@ -8,7 +8,7 @@ PRE-FLIGHT CHECKLIST:
3. [ ] CONFIRM: The user's name from config is {user_name}.
4. [ ] CONFIRM: interaction_style is set to "{interaction_style}".
RULE: When interaction_style is "structured", EVERY question to the user MUST call the ask_user tool unless the workflow or user explicitly requests free-form input.
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 ask_user tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
Only after all checks are complete, greet the user by name and display the menu.
Acknowledge this checklist is complete in your first response.

View File

@ -7,7 +7,7 @@ TASK INSTRUCTIONS:
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
RULE: When interaction_style is "structured", EVERY question to the user MUST call the ask_user tool unless the workflow or user explicitly requests free-form input.
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 ask_user tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
TASK FILE: {project-root}/{{bmadFolderName}}/{{path}}
"""

View File

@ -7,7 +7,7 @@ TOOL INSTRUCTIONS:
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
RULE: When interaction_style is "structured", EVERY question to the user MUST call the ask_user tool unless the workflow or user explicitly requests free-form input.
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 ask_user tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
TOOL FILE: {project-root}/{{bmadFolderName}}/{{path}}
"""

View File

@ -12,7 +12,7 @@ CRITICAL: This is a structured YAML workflow. Follow these steps precisely:
3. EXECUTE each step in order
4. VALIDATE outputs before proceeding to next step
RULE: When interaction_style is "structured", EVERY question to the user MUST call the ask_user tool unless the workflow or user explicitly requests free-form input.
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 ask_user tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{workflow_path}}
"""

View File

@ -10,7 +10,7 @@ WORKFLOW INSTRUCTIONS:
3. FOLLOW every step precisely as specified
4. DO NOT skip or modify any steps
RULE: When interaction_style is "structured", EVERY question to the user MUST call the ask_user tool unless the workflow or user explicitly requests free-form input.
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 ask_user tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{workflow_path}}
"""

View File

@ -6,7 +6,7 @@ inclusion: manual
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
RULE: When interaction_style 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.
RULE: 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 structured mode.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from #[[file:{{bmadFolderName}}/{{path}}]]

View File

@ -8,4 +8,4 @@ Read the entire task file at: #[[file:{{bmadFolderName}}/{{path}}]]
Follow all instructions in the task file exactly as written.
RULE: When interaction_style 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.
RULE: 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 structured mode.

View File

@ -8,4 +8,4 @@ Read the entire tool file at: #[[file:{{bmadFolderName}}/{{path}}]]
Follow all instructions in the tool file exactly as written.
RULE: When interaction_style 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.
RULE: 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 structured mode.

View File

@ -4,7 +4,7 @@ inclusion: manual
# {{name}}
RULE: When interaction_style 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.
RULE: 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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded:

View File

@ -4,6 +4,6 @@ inclusion: manual
# {{name}}
RULE: When interaction_style 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.
RULE: 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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL #[[file:{{bmadFolderName}}/{{path}}]], READ its entire contents and follow its directions exactly!

View File

@ -5,7 +5,7 @@ description: '{{description}}'
You must fully embody this agent's persona and follow all activation instructions exactly as specified. NEVER break character until given an exit command.
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `question` tool unless the workflow or user explicitly requests free-form input.
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 `question` tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
<agent-activation CRITICAL="TRUE">
1. LOAD the FULL agent file from {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -10,6 +10,6 @@ TASK INSTRUCTIONS:
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `question` tool unless the workflow or user explicitly requests free-form input.
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 `question` tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
TASK FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -10,6 +10,6 @@ TOOL INSTRUCTIONS:
2. READ its entire contents
3. FOLLOW every instruction precisely as specified
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `question` tool unless the workflow or user explicitly requests free-form input.
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 `question` tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
TOOL FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -13,6 +13,6 @@ WORKFLOW INSTRUCTIONS:
3. FOLLOW every step precisely as specified
4. DO NOT skip or modify any steps
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `question` tool unless the workflow or user explicitly requests free-form input.
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 `question` tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -13,6 +13,6 @@ WORKFLOW INSTRUCTIONS:
3. FOLLOW every step precisely as specified
4. DO NOT skip or modify any steps
RULE: When interaction_style is "structured", EVERY question to the user MUST call the `question` tool unless the workflow or user explicitly requests free-form input.
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 `question` tool unless the workflow or user explicitly requests free-form input. If you cannot determine {interaction_style}, default to structured mode.
WORKFLOW FILE: {project-root}/{{bmadFolderName}}/{{path}}

View File

@ -4,7 +4,7 @@
---
RULE: When interaction_style 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.
RULE: 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 structured mode.
Read the entire workflow file at: {project-root}/{{bmadFolderName}}/{{workflow_path}}

View File

@ -8,4 +8,4 @@ Read the entire workflow file at: {project-root}/{{bmadFolderName}}/{{workflow_p
Follow all instructions in the workflow file exactly as written.
RULE: When interaction_style 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.
RULE: 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 structured mode.

View File

@ -9,4 +9,4 @@ Read the entire workflow file at {project-root}/{{bmadFolderName}}/{{workflow_pa
Follow all instructions in the workflow file exactly as written.
RULE: When interaction_style 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.
RULE: 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 structured mode.

View File

@ -2,7 +2,7 @@
description: '{{description}}'
---
RULE: When interaction_style 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.
RULE: 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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THESE STEPS - while staying in character as the current agent persona you may have loaded:

View File

@ -2,6 +2,6 @@
description: '{{description}}'
---
RULE: When interaction_style 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.
RULE: 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 structured mode.
IT IS CRITICAL THAT YOU FOLLOW THIS COMMAND: LOAD the FULL @{{workflow_path}}, READ its entire contents and follow its directions exactly!