From 3f08e63f2e13bbf0810f34b18d1cd6a167295ed9 Mon Sep 17 00:00:00 2001 From: itdove Date: Tue, 31 Mar 2026 11:58:27 -0400 Subject: [PATCH] fix: remove command templates from analysis session prompts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove command templates from daf jira new and daf git new prompts that were bypassing skill file learning. Templates created cognitive shortcuts that discouraged AI agents from reading comprehensive skill documentation, leading to improper command usage. Changes: - Replaced explicit command templates with instructions to read skill files - Updated both single-project and multi-project prompt builders - Modified test to verify new instruction format - Verified skill files contain sufficient examples (they do) Benefits: - AI agents learn tools properly from authoritative skill documentation - Skill files remain single source of truth - No risk of templates becoming outdated - Better understanding of command nuances and options Fixes itdove/devaiflow#344 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- devflow/cli/commands/git_new_command.py | 14 ++++---------- devflow/cli/commands/jira_new_command.py | 14 ++++---------- tests/test_jira_new_command.py | 5 +++-- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/devflow/cli/commands/git_new_command.py b/devflow/cli/commands/git_new_command.py index ddb22d8..b0c7867 100644 --- a/devflow/cli/commands/git_new_command.py +++ b/devflow/cli/commands/git_new_command.py @@ -882,12 +882,9 @@ def _build_issue_creation_prompt( ]) prompt_parts.extend([ - "⚠️ CRITICAL: Use EXACTLY this command format (do not modify syntax):", + "⚠️ CRITICAL: Read the daf-git skill to understand the correct command syntax for creating GitHub/GitLab issues.", "", - example_command, - "", - "⚠️ The command above is the EXACT format you MUST use. Do not attempt alternative formats.", - " Use this template precisely, filling in your analysis and findings.", + "Use the `daf git create` command to create your issue based on your analysis.", "", "After you create the issue, the session will be automatically renamed to 'creation-'", "for easy identification. Users can reopen with: daf open creation-", @@ -1010,12 +1007,9 @@ def _build_multiproject_issue_creation_prompt( "3. Determine clear, testable acceptance criteria considering all projects", f"4. Create the GitHub/GitLab issue in {target_repo_name} with your cross-project analysis", "", - "⚠️ CRITICAL: Use EXACTLY this command format (do not modify syntax):", - "", - example_command, + "⚠️ CRITICAL: Read the daf-git skill to understand the correct command syntax for creating GitHub/GitLab issues.", "", - "⚠️ The command above is the EXACT format you MUST use. Do not attempt alternative formats.", - " Use this template precisely, filling in your cross-project analysis and findings.", + "Use the `daf git create` command to create your issue based on your cross-project analysis.", "", "After you create the issue, the session will be automatically renamed to 'creation-'", "for easy identification. Users can reopen with: daf open creation-", diff --git a/devflow/cli/commands/jira_new_command.py b/devflow/cli/commands/jira_new_command.py index 3545ed2..c6ecec8 100644 --- a/devflow/cli/commands/jira_new_command.py +++ b/devflow/cli/commands/jira_new_command.py @@ -883,12 +883,9 @@ def _build_ticket_creation_prompt( ]) prompt_parts.extend([ - "⚠️ CRITICAL: Use EXACTLY this command format (do not modify syntax):", + "⚠️ CRITICAL: Read the daf-jira skill to understand the correct command syntax for creating JIRA issues.", "", - example_command, - "", - "⚠️ The command above is the EXACT format you MUST use. Do not attempt alternative formats.", - " Use this template precisely, filling in your analysis and findings.", + "Use the `daf jira create` command to create your ticket based on your analysis.", "", parent_note, ]) @@ -987,12 +984,9 @@ def _build_multiproject_ticket_creation_prompt( f"5. Use project: {project}; configured defaults: {defaults_str}", "6. Include detailed description and acceptance criteria based on cross-project analysis", "", - "⚠️ CRITICAL: Use EXACTLY this command format (do not modify syntax):", - "", - example_command, + "⚠️ CRITICAL: Read the daf-jira skill to understand the correct command syntax for creating JIRA issues.", "", - "⚠️ The command above is the EXACT format you MUST use. Do not attempt alternative formats.", - " Use this template precisely, filling in your cross-project analysis and findings.", + "Use the `daf jira create` command to create your ticket based on your cross-project analysis.", "", parent_note, ] diff --git a/tests/test_jira_new_command.py b/tests/test_jira_new_command.py index 3a3470d..94958cd 100644 --- a/tests/test_jira_new_command.py +++ b/tests/test_jira_new_command.py @@ -774,8 +774,9 @@ def test_mock_mode_creates_claude_session(self, temp_daf_home): # Verify initial prompt contains ticket creation instructions initial_prompt = claude_session["messages"][0]["content"] assert "ANALYSIS-ONLY" in initial_prompt - # Issue type is now capitalized (Story instead of story) - assert "daf jira create Story" in initial_prompt + # Verify the prompt instructs to read skill files instead of providing template + assert "Read the daf-jira skill" in initial_prompt + assert "`daf jira create`" in initial_prompt # Verify assistant response mentions ticket creation assistant_response = claude_session["messages"][1]["content"]