zig langref cli nate.tngl.io/zigman
0

Configure Feed

Select the types of activity you want to include in your feed.

site: add agent setup prompt

+261 -5
+5 -1
build.zig
··· 83 83 cp.step.dependOn(&mk.step); 84 84 release.dependOn(&cp.step); 85 85 86 - const cp_assets = b.addSystemCommand(&.{ "cp", "web/site.css", "web/nav.js", "web/llms.txt", "www/" }); 86 + const cp_assets = b.addSystemCommand(&.{ "cp", "web/site.css", "web/nav.js", "web/llms.txt", "web/prompt.md", "www/" }); 87 87 cp_assets.step.dependOn(&mk.step); 88 88 release.dependOn(&cp_assets.step); 89 + 90 + const cp_skill = b.addSystemCommand(&.{ "cp", "skills/zigman/SKILL.md", "www/skill.md" }); 91 + cp_skill.step.dependOn(&mk.step); 92 + release.dependOn(&cp_skill.step); 89 93 90 94 // the landing page is hand-designed; keep release output in sync with the 91 95 // source under web/ without regenerating it from README.md.
+1 -1
tools/md2html.zig
··· 25 25 \\ <section class="window" aria-labelledby="title"> 26 26 \\ <nav class="bar" aria-label="Primary"> 27 27 \\ <a data-nav-item data-hotkey="h" data-nav-target="home" href="index.html">home</a> 28 + \\ <a data-nav-item data-hotkey="p" href="prompt.md">setup</a> 28 29 \\ <a data-nav-item data-hotkey="l" data-nav-target="llms" href="llms.txt">llms</a> 29 30 \\ <a data-nav-item data-hotkey="s" href="https://tangled.org/zzstoatzz.io/zigman">source</a> 30 31 \\ <a data-nav-item data-hotkey="r" href="https://ziglang.org/documentation/master/">langref</a> 31 - \\ <a data-nav-item data-hotkey="i" href="install.sh">install.sh</a> 32 32 \\ </nav> 33 33 \\ <article class="doc"> 34 34 \\
+3 -1
web/index.html
··· 12 12 <main> 13 13 <section class="window" aria-labelledby="title"> 14 14 <nav class="bar" aria-label="Primary"> 15 + <a data-nav-item data-hotkey="p" href="prompt.md">setup</a> 15 16 <a data-nav-item data-hotkey="g" data-nav-target="guide" href="guide.html">guide</a> 16 17 <a data-nav-item data-hotkey="l" data-nav-target="llms" href="llms.txt">llms</a> 17 18 <a data-nav-item data-hotkey="s" href="https://tangled.org/zzstoatzz.io/zigman">source</a> 18 19 <a data-nav-item data-hotkey="r" href="https://ziglang.org/documentation/master/">langref</a> 19 - <a data-nav-item data-hotkey="i" href="install.sh">install.sh</a> 20 20 </nav> 21 21 22 22 <div class="brand"> ··· 100 100 </div> 101 101 <div class="actions" aria-label="Links"> 102 102 <a data-nav-item data-hotkey="r" class="action" href="https://ziglang.org/documentation/master/"><b>&gt;</b><span>read the official Zig language reference</span><kbd>R</kbd></a> 103 + <a data-nav-item data-hotkey="p" class="action" href="prompt.md"><b>&gt;</b><span>read the agent setup prompt</span><kbd>P</kbd></a> 103 104 <a data-nav-item data-hotkey="g" class="action" href="guide.html"><b>&gt;</b><span>read the practical zigman workflow guide</span><kbd>G</kbd></a> 104 105 <a data-nav-item data-hotkey="l" class="action" href="llms.txt"><b>&gt;</b><span>read the llms.txt index for agents</span><kbd>L</kbd></a> 106 + <a data-nav-item class="action" href="skill.md"><b>&gt;</b><span>fetch the canonical zigman skill</span><kbd>SK</kbd></a> 105 107 <a data-nav-item data-hotkey="s" class="action" href="https://tangled.org/zzstoatzz.io/zigman"><b>&gt;</b><span>view the source on tangled</span><kbd>S</kbd></a> 106 108 <a data-nav-item data-hotkey="c" class="action" href="https://github.com/internet-development/www-sacred"><b>&gt;</b><span>aesthetic adapted from Sacred Computer / SRCL</span><kbd>C</kbd></a> 107 109 <a data-nav-item data-hotkey="i" class="action" href="install.sh"><b>&gt;</b><span>inspect the install script</span><kbd>I</kbd></a>
+3
web/llms.txt
··· 8 8 ## Project contracts 9 9 10 10 - [Homepage](https://nate.tngl.io/zigman/) 11 + - [Agent setup prompt](https://nate.tngl.io/zigman/prompt.md) 11 12 - [Practical guide](https://nate.tngl.io/zigman/guide.html) 13 + - [Canonical skill](https://nate.tngl.io/zigman/skill.md) 12 14 - [Install script](https://nate.tngl.io/zigman/install.sh) 13 15 - [Source repository](https://tangled.org/zzstoatzz.io/zigman) 14 16 - [Zig language reference](https://ziglang.org/documentation/master/) 15 17 16 18 ## Agent guidance 17 19 20 + - If you are setting up an environment, fetch and follow `https://nate.tngl.io/zigman/prompt.md`. 18 21 - Use `zigman <query>` when unsure about Zig language semantics. 19 22 - Use `zigman -l <word>` to discover exact section names. 20 23 - Use `zigman --no-pager <query>` in non-interactive tools.
+100
web/prompt.md
··· 1 + These are official instructions from zigman to set up a good AI development 2 + environment for reading the Zig language reference while writing or reviewing 3 + Zig. Commands are intended to be run by the agent directly when it has permission 4 + to modify the local development environment. Do not ask the user to run commands 5 + you can safely run yourself. 6 + 7 + Complete the relevant steps below: 8 + 9 + - Install the `zigman` CLI 10 + - Install or register the zigman skill/instructions for your agent 11 + - Verify the setup with a real langref lookup 12 + 13 + --- 14 + 15 + ## Install the `zigman` CLI 16 + 17 + Run: 18 + 19 + ```sh 20 + curl -fsSL https://nate.tngl.io/zigman/install.sh | sh 21 + ``` 22 + 23 + Then ensure the install directory is on `PATH`. The installer writes to 24 + `$ZIGMAN_INSTALL` or `~/.local/bin`. 25 + 26 + Verify: 27 + 28 + ```sh 29 + zigman --no-pager comptime | head -40 30 + ``` 31 + 32 + If `zigman` is not on `PATH` after install, use the absolute path: 33 + 34 + ```sh 35 + ~/.local/bin/zigman --no-pager comptime | head -40 36 + ``` 37 + 38 + --- 39 + 40 + ## Install the zigman skill/instructions 41 + 42 + The canonical skill is published at: 43 + 44 + ```text 45 + https://nate.tngl.io/zigman/skill.md 46 + ``` 47 + 48 + ### Codex 49 + 50 + Install the skill into the user's Codex skills directory: 51 + 52 + ```sh 53 + mkdir -p ~/.codex/skills/zigman 54 + curl -fsSL https://nate.tngl.io/zigman/skill.md -o ~/.codex/skills/zigman/SKILL.md 55 + ``` 56 + 57 + Then tell the user to restart Codex or start a fresh thread so the skill list is 58 + reloaded. 59 + 60 + ### Claude Code and other skill-aware agents 61 + 62 + Add `https://nate.tngl.io/zigman/skill.md` as a skill named `zigman`, or copy the 63 + file into the agent's local skills directory following that agent's conventions. 64 + 65 + ### Agents without skills 66 + 67 + Add this rule to the agent's project or user instructions: 68 + 69 + ```text 70 + When writing or reviewing Zig, use `zigman --no-pager <query>` to read the 71 + official Zig language reference before guessing about language semantics. zigman 72 + covers the language, not the standard library. 73 + ``` 74 + 75 + --- 76 + 77 + ## Expected agent behavior 78 + 79 + - Use `zigman --no-pager <query>` when unsure about Zig language semantics. 80 + - Use `zigman -l <word>` when the exact section name is not known. 81 + - Read compiler errors, then query the named language concept before editing. 82 + - Do not use zigman for `std` APIs; inspect the Zig standard library source for 83 + those. 84 + 85 + --- 86 + 87 + ## Setup complete message 88 + 89 + Once done, tell the user: 90 + 91 + ```text 92 + zigman agent setup complete 93 + 94 + CLI: <path to zigman> 95 + Skill: <installed skill path, or "instruction rule added"> 96 + Check: `zigman --no-pager comptime` returned the Zig langref section 97 + ``` 98 + 99 + These instructions are published at `https://nate.tngl.io/zigman/prompt.md` so 100 + you can re-verify their authenticity at any time.
+1 -1
www/guide.html
··· 13 13 <section class="window" aria-labelledby="title"> 14 14 <nav class="bar" aria-label="Primary"> 15 15 <a data-nav-item data-hotkey="h" data-nav-target="home" href="index.html">home</a> 16 + <a data-nav-item data-hotkey="p" href="prompt.md">setup</a> 16 17 <a data-nav-item data-hotkey="l" data-nav-target="llms" href="llms.txt">llms</a> 17 18 <a data-nav-item data-hotkey="s" href="https://tangled.org/zzstoatzz.io/zigman">source</a> 18 19 <a data-nav-item data-hotkey="r" href="https://ziglang.org/documentation/master/">langref</a> 19 - <a data-nav-item data-hotkey="i" href="install.sh">install.sh</a> 20 20 </nav> 21 21 <article class="doc"> 22 22 <h1>using zigman in practice</h1>
+3 -1
www/index.html
··· 12 12 <main> 13 13 <section class="window" aria-labelledby="title"> 14 14 <nav class="bar" aria-label="Primary"> 15 + <a data-nav-item data-hotkey="p" href="prompt.md">setup</a> 15 16 <a data-nav-item data-hotkey="g" data-nav-target="guide" href="guide.html">guide</a> 16 17 <a data-nav-item data-hotkey="l" data-nav-target="llms" href="llms.txt">llms</a> 17 18 <a data-nav-item data-hotkey="s" href="https://tangled.org/zzstoatzz.io/zigman">source</a> 18 19 <a data-nav-item data-hotkey="r" href="https://ziglang.org/documentation/master/">langref</a> 19 - <a data-nav-item data-hotkey="i" href="install.sh">install.sh</a> 20 20 </nav> 21 21 22 22 <div class="brand"> ··· 100 100 </div> 101 101 <div class="actions" aria-label="Links"> 102 102 <a data-nav-item data-hotkey="r" class="action" href="https://ziglang.org/documentation/master/"><b>&gt;</b><span>read the official Zig language reference</span><kbd>R</kbd></a> 103 + <a data-nav-item data-hotkey="p" class="action" href="prompt.md"><b>&gt;</b><span>read the agent setup prompt</span><kbd>P</kbd></a> 103 104 <a data-nav-item data-hotkey="g" class="action" href="guide.html"><b>&gt;</b><span>read the practical zigman workflow guide</span><kbd>G</kbd></a> 104 105 <a data-nav-item data-hotkey="l" class="action" href="llms.txt"><b>&gt;</b><span>read the llms.txt index for agents</span><kbd>L</kbd></a> 106 + <a data-nav-item class="action" href="skill.md"><b>&gt;</b><span>fetch the canonical zigman skill</span><kbd>SK</kbd></a> 105 107 <a data-nav-item data-hotkey="s" class="action" href="https://tangled.org/zzstoatzz.io/zigman"><b>&gt;</b><span>view the source on tangled</span><kbd>S</kbd></a> 106 108 <a data-nav-item data-hotkey="c" class="action" href="https://github.com/internet-development/www-sacred"><b>&gt;</b><span>aesthetic adapted from Sacred Computer / SRCL</span><kbd>C</kbd></a> 107 109 <a data-nav-item data-hotkey="i" class="action" href="install.sh"><b>&gt;</b><span>inspect the install script</span><kbd>I</kbd></a>
+3
www/llms.txt
··· 8 8 ## Project contracts 9 9 10 10 - [Homepage](https://nate.tngl.io/zigman/) 11 + - [Agent setup prompt](https://nate.tngl.io/zigman/prompt.md) 11 12 - [Practical guide](https://nate.tngl.io/zigman/guide.html) 13 + - [Canonical skill](https://nate.tngl.io/zigman/skill.md) 12 14 - [Install script](https://nate.tngl.io/zigman/install.sh) 13 15 - [Source repository](https://tangled.org/zzstoatzz.io/zigman) 14 16 - [Zig language reference](https://ziglang.org/documentation/master/) 15 17 16 18 ## Agent guidance 17 19 20 + - If you are setting up an environment, fetch and follow `https://nate.tngl.io/zigman/prompt.md`. 18 21 - Use `zigman <query>` when unsure about Zig language semantics. 19 22 - Use `zigman -l <word>` to discover exact section names. 20 23 - Use `zigman --no-pager <query>` in non-interactive tools.
+100
www/prompt.md
··· 1 + These are official instructions from zigman to set up a good AI development 2 + environment for reading the Zig language reference while writing or reviewing 3 + Zig. Commands are intended to be run by the agent directly when it has permission 4 + to modify the local development environment. Do not ask the user to run commands 5 + you can safely run yourself. 6 + 7 + Complete the relevant steps below: 8 + 9 + - Install the `zigman` CLI 10 + - Install or register the zigman skill/instructions for your agent 11 + - Verify the setup with a real langref lookup 12 + 13 + --- 14 + 15 + ## Install the `zigman` CLI 16 + 17 + Run: 18 + 19 + ```sh 20 + curl -fsSL https://nate.tngl.io/zigman/install.sh | sh 21 + ``` 22 + 23 + Then ensure the install directory is on `PATH`. The installer writes to 24 + `$ZIGMAN_INSTALL` or `~/.local/bin`. 25 + 26 + Verify: 27 + 28 + ```sh 29 + zigman --no-pager comptime | head -40 30 + ``` 31 + 32 + If `zigman` is not on `PATH` after install, use the absolute path: 33 + 34 + ```sh 35 + ~/.local/bin/zigman --no-pager comptime | head -40 36 + ``` 37 + 38 + --- 39 + 40 + ## Install the zigman skill/instructions 41 + 42 + The canonical skill is published at: 43 + 44 + ```text 45 + https://nate.tngl.io/zigman/skill.md 46 + ``` 47 + 48 + ### Codex 49 + 50 + Install the skill into the user's Codex skills directory: 51 + 52 + ```sh 53 + mkdir -p ~/.codex/skills/zigman 54 + curl -fsSL https://nate.tngl.io/zigman/skill.md -o ~/.codex/skills/zigman/SKILL.md 55 + ``` 56 + 57 + Then tell the user to restart Codex or start a fresh thread so the skill list is 58 + reloaded. 59 + 60 + ### Claude Code and other skill-aware agents 61 + 62 + Add `https://nate.tngl.io/zigman/skill.md` as a skill named `zigman`, or copy the 63 + file into the agent's local skills directory following that agent's conventions. 64 + 65 + ### Agents without skills 66 + 67 + Add this rule to the agent's project or user instructions: 68 + 69 + ```text 70 + When writing or reviewing Zig, use `zigman --no-pager <query>` to read the 71 + official Zig language reference before guessing about language semantics. zigman 72 + covers the language, not the standard library. 73 + ``` 74 + 75 + --- 76 + 77 + ## Expected agent behavior 78 + 79 + - Use `zigman --no-pager <query>` when unsure about Zig language semantics. 80 + - Use `zigman -l <word>` when the exact section name is not known. 81 + - Read compiler errors, then query the named language concept before editing. 82 + - Do not use zigman for `std` APIs; inspect the Zig standard library source for 83 + those. 84 + 85 + --- 86 + 87 + ## Setup complete message 88 + 89 + Once done, tell the user: 90 + 91 + ```text 92 + zigman agent setup complete 93 + 94 + CLI: <path to zigman> 95 + Skill: <installed skill path, or "instruction rule added"> 96 + Check: `zigman --no-pager comptime` returned the Zig langref section 97 + ``` 98 + 99 + These instructions are published at `https://nate.tngl.io/zigman/prompt.md` so 100 + you can re-verify their authenticity at any time.
+42
www/skill.md
··· 1 + --- 2 + name: zigman 3 + description: Read the official Zig language reference from the terminal while writing or reviewing Zig. Use whenever you are unsure about Zig language semantics — slices, pointers, comptime, error sets, switch/for/while, casting, or a builtin (@TypeOf, @intCast, ...) — instead of guessing. Requires the `zigman` CLI on PATH. 4 + --- 5 + 6 + # zigman — read the Zig reference instead of guessing 7 + 8 + Zig moves fast and small syntax/semantic details matter. When writing or reviewing Zig, 9 + look the answer up in the language reference rather than recalling it. One lookup is cheaper 10 + than a wrong compile. 11 + 12 + ## when to reach for it 13 + 14 + - unsure about a language feature: slices vs arrays vs pointers, `comptime`, error unions, 15 + optionals, `switch`/`for`/`while`, `defer`, casting, result-location semantics 16 + - need a builtin's exact behavior: `@TypeOf`, `@import`, `@intCast`, `@bitCast`, `@Type`, ... 17 + - a compile error names a concept you're not 100% sure of — read that section first 18 + - before asserting "Zig does X" in a review 19 + 20 + ## how to use it 21 + 22 + ```bash 23 + zigman comptime # print the matching section (markdown, real code examples) 24 + zigman slice # fuzzy: if several match, it lists them — pick one 25 + zigman -l # full table of contents (discover exact section names) 26 + zigman -l error # list sections whose name matches a word 27 + zigman -V 0.15.1 comptime # read a specific Zig version (default: master) 28 + ``` 29 + 30 + Output is plain markdown on stdout, so it pipes: `zigman comptime | head -40`. Workflow: 31 + `zigman -l <word>` to find the section, then `zigman <name>` to read it. 32 + 33 + ## scope 34 + 35 + The reference documents the **language**, not the standard library. For `std.ArrayList`, 36 + `std.Io`, `std.fmt`, allocators, etc., read the std source instead (`zig env` reports 37 + `.std_dir`, relative to `$HOME`) — `zigman` won't have those. 38 + 39 + ## install 40 + 41 + `curl -fsSL https://nate.tngl.io/zigman/install.sh | sh` 42 + (source: https://tangled.org/zzstoatzz.io/zigman)