Skip to content

Commit b2d50e5

Browse files
committed
fix(prompt): align zi docs guidance with pi-mono
Session-Id: 810ab30d-639a-48a6-b9d1-1d4ff507366c
1 parent ff01738 commit b2d50e5

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

src/coding_agent/system_prompt.zig

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,13 @@ fn containsGuideline(list: []const []const u8, needle: []const u8) bool {
165165

166166
fn writeZiDocsSection(w: *std.Io.Writer) !void {
167167
try w.writeAll(
168-
"\nZi help (lazy progressive eval):\n" ++
169-
"- `zi --help` prints CLI usage and actions\n" ++
170-
"- `zi --docs <query>` searches embedded zi docs\n" ++
171-
"- `zi --man [topic]` lists topics or prints one embedded doc\n",
168+
"\nZi documentation (read only when the user asks about zi itself, its CLI, config, tools, sessions, skills, or TUI):\n" ++
169+
"- Search documentation: `zi --docs <query>`\n" ++
170+
"- Read documentation topics: `zi --man [topic]`\n" ++
171+
"- CLI usage and actions: `zi --help`\n" ++
172+
"- When asked about: CLI usage, configuration, tools, sessions, skills, TUI, keybindings, providers, adding models, or zi internals\n" ++
173+
"- When working on zi topics, use `zi --docs <query>` and `zi --man [topic]` before implementing\n" ++
174+
"- Follow cross-references from `zi --man` topics to related embedded docs\n",
172175
);
173176
}
174177

@@ -215,7 +218,7 @@ test "default prompt includes zi identity help and cwd" {
215218
defer std.testing.allocator.free(result);
216219

217220
try std.testing.expect(std.mem.indexOf(u8, result, "operating inside zi, a coding agent harness") != null);
218-
try std.testing.expect(std.mem.indexOf(u8, result, "Zi help (lazy progressive eval)") != null);
221+
try std.testing.expect(std.mem.indexOf(u8, result, "Zi documentation (read only when the user asks about zi itself") != null);
219222
try std.testing.expect(std.mem.indexOf(u8, result, "docs/README.md") == null);
220223
try std.testing.expect(std.mem.indexOf(u8, result, "Current working directory: /home/user/project") != null);
221224
try std.testing.expect(std.mem.indexOf(u8, result, "Be concise in your responses") != null);
@@ -287,7 +290,7 @@ test "default prompt orders zi help append context and read-gated skills" {
287290
defer std.testing.allocator.free(with_read);
288291

289292
try expectOrderedSubstrings(with_read, &.{
290-
"Zi help (lazy progressive eval)",
293+
"Zi documentation (read only when the user asks about zi itself",
291294
"appended guidance",
292295
"# Project Context",
293296
"<available_skills>",

0 commit comments

Comments
 (0)