Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Generated with mux

Adds support for Tool: <tool_name> syntax in instruction files to inject tool-specific instructions into tool descriptions.

Changes

  • Markdown parsing: Added extractToolSection() to parse Tool: <name> sections and updated stripScopedInstructionSections().
  • System message: Added extractToolInstructions() and readToolInstructions() to read and extract tool instructions from global and context sources.
  • Tooling: Modified getToolsForModel() to accept tool instructions and added augmentToolDescription() to append instructions to tool descriptions.
  • Integration: Updated aiService to wire everything together.
  • Documentation: Updated docs/instruction-files.md with new syntax rules and examples.
  • Tests: Added comprehensive tests for extraction and stripping logic.

Behavior

  • Works like Mode: and Model: prompts.
  • Context (workspace) instructions override/augment global instructions (first match wins per tool).
  • Instructions are stripped from the main system message and appended to the specific tool's description.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent ammar-agent force-pushed the add-tool-prompt-syntax branch from 8211af9 to e1b1c94 Compare November 24, 2025 01:43
- Add extractToolSection() to markdown.ts for parsing Tool: <name> sections
- Update stripScopedInstructionSections() to remove Tool sections from general instructions
- Add readToolInstructions() helper to systemMessage.ts
- Modify getToolsForModel() to accept and inject tool-specific instructions into descriptions
- Add comprehensive tests for extractToolSection and stripScopedInstructionSections
- Document Tool prompt syntax in docs/instruction-files.md

Tool sections work like Mode and Model sections: context (workspace/project) is
checked first, then global (~/.mux/AGENTS.md). Instructions are appended to the
tool's description, allowing customization without cluttering general instructions.
@ammar-agent ammar-agent force-pushed the add-tool-prompt-syntax branch from e3a06e9 to 0f4f92a Compare November 24, 2025 16:26
@ammario ammario merged commit af9d7ea into main Nov 24, 2025
16 checks passed
@ammario ammario deleted the add-tool-prompt-syntax branch November 24, 2025 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants