Skip to content

Commit 14b16ed

Browse files
committed
fix: lint and formatting issues
1 parent b63d97b commit 14b16ed

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

docs/instruction-files.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ mux supports **Scoped Instructions** that activate only in specific contexts. Yo
2222
### General Rules
2323

2424
- **Precedence**: Workspace instructions (`<workspace>/AGENTS.md`) are checked first, then global instructions (`~/.mux/AGENTS.md`).
25-
- **First Match Wins**: Only the *first* matching section found is used. Overriding global defaults is as simple as defining the same section in your workspace.
25+
- **First Match Wins**: Only the _first_ matching section found is used. Overriding global defaults is as simple as defining the same section in your workspace.
2626
- **Isolation**: These sections are **stripped** from the general `<custom-instructions>` block. Their content is injected only where it belongs (e.g., into a specific tool's description or a special XML tag).
2727
- **Boundaries**: A section's content includes everything until the next heading of the same or higher level.
2828

@@ -38,19 +38,24 @@ Use mode-specific sections to optimize context and customize behavior for specif
3838

3939
```markdown
4040
# General Instructions
41+
4142
- Be concise
4243

4344
## Mode: Plan
45+
4446
When planning:
47+
4548
- Focus on goals and trade-offs
4649
- Propose alternatives with pros/cons
4750

4851
## Mode: Compact
52+
4953
- Preserve key decisions
5054
- Be extremely concise
5155
```
5256

5357
**Available modes**:
58+
5459
- **exec** (default) — Normal operations.
5560
- **plan** — Active in Plan Mode.
5661
- **compact** — Used during `/compact` to guide history summarization.
@@ -60,16 +65,19 @@ When planning:
6065
Scope instructions to specific models or families using regex matching. The matched content is injected via a `<model-...>` tag.
6166

6267
**Syntax**: `Model: <regex>`
68+
6369
- Regexes are case-insensitive by default.
6470
- Use `/pattern/flags` for custom flags (e.g., `/openai:.*codex/i`).
6571

6672
**Example**:
6773

6874
```markdown
6975
## Model: sonnet
76+
7077
Be terse and to the point.
7178

72-
## Model: openai:.*codex
79+
## Model: openai:.\*codex
80+
7381
Use status reporting tools every few minutes.
7482
```
7583

@@ -78,19 +86,23 @@ Use status reporting tools every few minutes.
7886
Customize how the AI uses specific tools by appending instructions to their descriptions.
7987

8088
**Syntax**: `Tool: <tool_name>`
89+
8190
- Tool names must match exactly (case-insensitive).
8291
- Only tools available for the active model are augmented.
8392

8493
**Example**:
8594

8695
```markdown
8796
## Tool: bash
97+
8898
- Use `rg` instead of `grep` for file searching
8999

90100
## Tool: file_edit_replace_string
101+
91102
- Run `prettier --write` after editing files
92103

93104
# Tool: status_set
105+
94106
- Set status url to the Pull Request once opened
95107
```
96108

src/common/utils/tools/tools.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ function augmentToolDescription(baseTool: Tool, additionalInstructions: string):
4747
// Access the tool as a record to get its properties
4848
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4949
const baseToolRecord = baseTool as any as Record<string, unknown>;
50-
const augmentedDescription = `${String(baseToolRecord.description ?? "")}\n\n${additionalInstructions}`;
50+
const originalDescription =
51+
typeof baseToolRecord.description === "string" ? baseToolRecord.description : "";
52+
const augmentedDescription = `${originalDescription}\n\n${additionalInstructions}`;
5153

5254
// Return a new tool with the augmented description
5355
return tool({
5456
description: augmentedDescription,
55-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
57+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
5658
inputSchema: baseToolRecord.inputSchema as any,
57-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
59+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment
5860
execute: baseToolRecord.execute as any,
5961
});
6062
}

0 commit comments

Comments
 (0)