Skip to content

Commit 86f1d78

Browse files
committed
added AGENTS.md and prompts support along with other tweaks
1 parent c7ef03e commit 86f1d78

File tree

4 files changed

+428
-34
lines changed

4 files changed

+428
-34
lines changed

SemanticDeveloper/SemanticDeveloper/README.md renamed to README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,17 @@ A cross‑platform desktop UI (Avalonia/.NET 8) for driving the Codex CLI using
3838
- Verbose logging (show suppressed output)
3939
- Enable MCP support (loads MCP servers from your JSON config and passes them directly to Codex)
4040
- Config path: `~/.config/SemanticDeveloper/mcp_servers.json` (Linux/macOS) or `%AppData%/SemanticDeveloper/mcp_servers.json` (Windows)
41-
- Use API Key for Codex CLI (runs `codex login --api-key <key>` before sessions; does not rely on existing CLI auth)
41+
- Use API Key for Codex CLI (runs `codex login --api-key <key>` before sessions; does not rely on existing CLI auth)
4242
- Allow network access for tools (sets sandbox_policy.network_access=true on turns so MCP tools can reach the network)
4343
- Without API key enabled, the app proactively authenticates with `codex auth login` (falling back to `codex login`) before sessions so your chat/GPT token is used.
4444

45+
### Directory Guardrails with `AGENTS.md`
46+
47+
- Right-click any folder in the workspace tree and choose **Create AGENTS.md** to seed a directory-specific instruction file.
48+
- The file is created inside the chosen folder (or opened if it already exists) and loaded into the editor so you can tailor the guidance.
49+
- Codex CLI automatically honors the closest `AGENTS.md` when editing files: deeper files override parent folders, and rules apply to the entire subtree beneath the file.
50+
- Use these files to capture coding conventions, test commands, or “do/don’t” rules that the agent must follow for that part of the repo.
51+
4552
### Profiles (config.toml) example
4653

4754
Example `config.toml` profiles:
@@ -170,6 +177,11 @@ Notes
170177

171178
- Clear Log clears both the on‑screen log and the underlying editor document; it does not affect the session.
172179

180+
- Prompts button (bottom-right toolbar):
181+
- Lists every markdown prompt file in `$CODEX_HOME/prompts` (defaults to `~/.codex/prompts`).
182+
- Selecting a prompt sends `/filename.md` through the active session—exactly like typing it in the CLI—without leaving the UI.
183+
- Prompts are sorted alphabetically; create or edit them directly on disk.
184+
173185
## MCP Servers Panel
174186

175187
- The left pane includes an MCP section below the file tree:

SemanticDeveloper/SemanticDeveloper/MainWindow.axaml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,24 @@
1414
<Grid RowDefinitions="Auto,*" ColumnDefinitions="*">
1515
<!-- Top toolbar -->
1616
<Border Background="#2B2B2B" Padding="12">
17-
<Grid ColumnDefinitions="Auto,12,*,Auto,8,Auto,12,Auto,8,Auto,8,Auto,8,Auto">
17+
<Grid ColumnDefinitions="Auto,12,*,Auto,8,Auto,8,Auto,12,Auto,8,Auto,8,Auto,8,Auto">
1818
<Button x:Name="SelectWorkspaceButton" Foreground="#E6E6E6" Click="OnSelectWorkspaceClick">Select Workspace…</Button>
1919
<Border Grid.Column="1"/>
2020
<TextBlock Grid.Column="2" TextTrimming="CharacterEllipsis" VerticalAlignment="Center" Foreground="#E6E6E6">
2121
<Run Text="Workspace: "/>
2222
<Run Text="{Binding CurrentWorkspacePath}"/>
2323
</TextBlock>
24-
<TextBlock Grid.Column="3" VerticalAlignment="Center" Foreground="#E6E6E6" IsVisible="{Binding IsGitRepo}">
24+
<TextBlock Grid.Column="3" VerticalAlignment="Center" Foreground="#E6E6E6" IsVisible="{Binding HasSelectedProfile}">
25+
<Run Text=" • Profile: "/>
26+
<Run Text="{Binding SelectedProfile}"/>
27+
</TextBlock>
28+
<Border Grid.Column="4"/>
29+
<TextBlock Grid.Column="5" VerticalAlignment="Center" Foreground="#E6E6E6" IsVisible="{Binding IsGitRepo}">
2530
<Run Text=" • Branch: "/>
2631
<Run Text="{Binding CurrentBranch}"/>
2732
</TextBlock>
28-
<Border Grid.Column="4"/>
29-
<Button Grid.Column="5" x:Name="GitMenuButton" Foreground="#E6E6E6" IsVisible="{Binding IsGitRepo}">Git ▾
33+
<Border Grid.Column="6"/>
34+
<Button Grid.Column="7" x:Name="GitMenuButton" Foreground="#E6E6E6" IsVisible="{Binding IsGitRepo}">Git ▾
3035
<Button.Flyout>
3136
<MenuFlyout>
3237
<MenuItem Header="Commit…" Click="OnGitCommitClick"/>
@@ -37,14 +42,14 @@
3742
</MenuFlyout>
3843
</Button.Flyout>
3944
</Button>
40-
<Button Grid.Column="5" x:Name="InitGitButton" Foreground="#E6E6E6" IsVisible="{Binding CanInitGit}" Click="OnGitInitClick">Initialize Git…</Button>
41-
<Button Grid.Column="7" x:Name="OpenInFileManagerButton" Foreground="#E6E6E6" Click="OnOpenInFileManagerClick" IsEnabled="{Binding HasWorkspace}">Open in File Manager</Button>
42-
<Border Grid.Column="8"/>
43-
<Button Grid.Column="9" x:Name="OpenCliSettingsButton" Foreground="#E6E6E6" Click="OnOpenCliSettingsClick">CLI Settings</Button>
45+
<Button Grid.Column="7" x:Name="InitGitButton" Foreground="#E6E6E6" IsVisible="{Binding CanInitGit}" Click="OnGitInitClick">Initialize Git…</Button>
46+
<Button Grid.Column="9" x:Name="OpenInFileManagerButton" Foreground="#E6E6E6" Click="OnOpenInFileManagerClick" IsEnabled="{Binding HasWorkspace}">Open in File Manager</Button>
4447
<Border Grid.Column="10"/>
45-
<Button Grid.Column="11" x:Name="OpenAboutButton" Foreground="#E6E6E6" Click="OnOpenAboutClick">About</Button>
48+
<Button Grid.Column="11" x:Name="OpenCliSettingsButton" Foreground="#E6E6E6" Click="OnOpenCliSettingsClick">CLI Settings</Button>
4649
<Border Grid.Column="12"/>
47-
<Button Grid.Column="13" x:Name="OpenReadmeButton" Foreground="#E6E6E6"
50+
<Button Grid.Column="13" x:Name="OpenAboutButton" Foreground="#E6E6E6" Click="OnOpenAboutClick">About</Button>
51+
<Border Grid.Column="14"/>
52+
<Button Grid.Column="15" x:Name="OpenReadmeButton" Foreground="#E6E6E6"
4853
Click="OnOpenReadmeClick" ToolTip.Tip="Open README">?</Button>
4954
</Grid>
5055
</Border>
@@ -66,6 +71,15 @@
6671
<TreeView.DataTemplates>
6772
<TreeDataTemplate DataType="models:FileTreeItem" ItemsSource="{Binding Children}">
6873
<Grid ColumnDefinitions="Auto,6,*" VerticalAlignment="Center">
74+
<Grid.ContextMenu>
75+
<ContextMenu>
76+
<MenuItem Header="Create AGENTS.md"
77+
IsVisible="{Binding IsDirectory}"
78+
CommandParameter="{Binding}"
79+
Click="OnCreateAgentsFileClick"/>
80+
<MenuItem Header="Delete" CommandParameter="{Binding}" Click="OnDeleteTreeItemClick"/>
81+
</ContextMenu>
82+
</Grid.ContextMenu>
6983
<Grid Width="16" Height="16" VerticalAlignment="Center" ClipToBounds="True">
7084
<Path Width="16" Height="16"
7185
Data="{Binding IconGeometry}"
@@ -224,18 +238,21 @@
224238
ResizeDirection="Columns" ShowsPreview="True"/>
225239

226240
<!-- Right: CLI session area -->
227-
<Grid x:Name="RightPaneGrid" Grid.Column="4" RowDefinitions="Auto,*,Auto" MinWidth="400" SizeChanged="OnRightPaneSizeChanged">
241+
<Grid x:Name="RightPaneGrid" Grid.Column="4" RowDefinitions="Auto,Auto,*,Auto" MinWidth="440" SizeChanged="OnRightPaneSizeChanged">
228242
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Margin="10" Spacing="8">
229243
<TextBlock FontWeight="SemiBold" Text="Codex CLI Session"/>
230244
<TextBlock Text=""/>
231245
<TextBlock Text="{Binding SessionStatus}"/>
232-
<ProgressBar Width="60" Height="6" IsIndeterminate="True" IsVisible="{Binding IsBusy}" Margin="8,0,0,0" Opacity="0.35"/>
233246
<TextBlock Text="" Margin="8,0,0,0"/>
234247
<TextBlock Text="{Binding TokenStats}"/>
235248

236249
</StackPanel>
237250

238-
<Border Grid.Row="1" Margin="10" BorderBrush="#DDD" BorderThickness="1" CornerRadius="4">
251+
<ProgressBar Grid.Row="1" Height="4" Margin="10,0,10,4" IsIndeterminate="True"
252+
IsVisible="{Binding IsBusy}" Foreground="#AA76FF03" Background="#10FFFFFF"
253+
Opacity="0.15" IsHitTestVisible="False"/>
254+
255+
<Border Grid.Row="2" Margin="10" BorderBrush="#DDD" BorderThickness="1" CornerRadius="4">
239256
<ae:TextEditor x:Name="LogEditor"
240257
Document="{Binding CliLogDocument, Mode=OneWay}"
241258
IsReadOnly="True"
@@ -247,12 +264,13 @@
247264
FontSize="13" />
248265
</Border>
249266

250-
<StackPanel Grid.Row="2" Orientation="Vertical" Margin="10" Spacing="8">
267+
<StackPanel Grid.Row="3" Orientation="Vertical" Margin="10" Spacing="8">
251268
<StackPanel Orientation="Horizontal" Spacing="8">
252269
<Button x:Name="RestartCliButton" Click="OnRestartCliClick" IsEnabled="{Binding HasWorkspace}">Restart Session</Button>
253270
<Button x:Name="StopCliButton" Click="OnStopCliClick" IsEnabled="{Binding IsCliRunning}">Stop</Button>
254271
<Button x:Name="ClearLogButton" Click="OnClearLogClick">Clear Log</Button>
255272
<Button x:Name="RunAppButton" Click="OnRunAppClick" IsEnabled="{Binding HasWorkspace}">Run App</Button>
273+
<Button x:Name="PromptsButton" Click="OnPromptsButtonClick" IsEnabled="{Binding IsCliRunning}">Prompts ▾</Button>
256274
<Button x:Name="OpenShellButton" Click="OnOpenShellClick">Shell</Button>
257275
</StackPanel>
258276
<Grid ColumnDefinitions="*,Auto" ColumnSpacing="8">

0 commit comments

Comments
 (0)