hashiiiii-zig
Skill10 starsChanged 3 months agoMITView on GitHub
Use when writing, editing, or reviewing Zig implementation, tests, build files, or CI.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- hallmarkSkill
- hashiiiii-explain-prSkill
- hashiiiii-gitSkill
- hashiiiii-imagesSkill
- hashiiiii-issuesSkill
- hashiiiii-localeSkill
- hashiiiii-pull-requestSkill
- hashiiiii-write-enSkill
- hashiiiii-write-jaSkill
- show-meSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Write the smallest implementation that preserves required behavior.
- Very specific: line 12
Keep unit tests in the implementation file.
- Distinctive: line 14
Ensure the test root references test files.
- Very specific: line 18
Prefer concrete types, const, inferred .{...} literals, structs, enums, tagged unions, exhaustive switch statements, ordinary functions, …
- Distinctive: line 19
Use file imports within a module and named imports across modules.
- Very specific: line 21
Use defer for cleanup and errdefer for error returns.
- Very specific: line 23
Use undefined only for storage initialized before reading.
- Distinctive: line 27
Add or keep a test only when at least 80% confident it is necessary, based on user impact, regression risk, and overlap with existing tests.
- Very specific: line 28
Use native test blocks and std.testing.
- Distinctive: line 29
Keep each test self-contained with literal inputs and expected values.
- Very specific: line 42
Keep build.zig direct; run unit and end-to-end tests with zig build test.
- Distinctive: line 43
Keep test-only imports or generators out of consumer builds with a separate test module.
- Very specific: line 45
Run zig fmt --check on changed Zig files and zig build test with the project toolchain.
- Distinctive: line 46
Keep CI jobs focused on distinct risks.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Zig
Write the smallest implementation that preserves required behavior. Use the project's Zig version and check matching standard-library examples before choosing syntax or APIs.
Structure
- Keep unit tests in the implementation file. Put end-to-end tests in root
e2e/and exercise public API flows. - Export libraries from
src/root.zigand executables fromsrc/main.zig. - Ensure the test root references test files; Zig does not discover every source file automatically.
Implementation
- Prefer concrete types,
const, inferred.{...}literals, structs, enums, tagged unions, exhaustiveswitchstatements, ordinary functions, and runtime loops. Usecomptime,inline,anytype, or reflection only when required. - Use file imports within a module and named imports across modules.
- Propagate errors with
try; usecatchfor recovery or translation. Reserveunreachablefor proven invariants. - Use
deferfor cleanup anderrdeferfor error returns. A union-valued failure does not runerrdefer. - Accept allocators explicitly. Make ownership clear, copy retained input when needed, and store resource owners by value unless a stable address is required.
- Use
undefinedonly for storage initialized before reading; cast only when inference or representation requires it.
Tests
- Add or keep a test only when at least 80% confident it is necessary, based on user impact, regression risk, and overlap with existing tests. This threshold concerns necessity, not coverage.
- Use native
testblocks andstd.testing; name and assert the public behavior under test, not private layout or dependency guarantees. - Keep each test self-contained with literal inputs and expected values. Avoid shared fixtures, computed expectations, and case tables that obscure the assertion.
- Comment on why behavior matters. Use real dependencies; never use mocks or stubs.
- For allocations, use
std.testing.allocatorand release owned resources withdefer.
test "parse rejects duplicate modifiers" {
// Duplicate modifiers can hide configuration mistakes.
try std.testing.expectError(error.InvalidKey, KeySpec.parse("Ctrl+Ctrl+x"));
}Build and CI
- Keep
build.zigdirect; run unit and end-to-end tests withzig build test. - Keep test-only imports or generators out of consumer builds with a separate test module. After changing module wiring, build a real consumer and inspect its dependency steps.
- List distributed source paths in
build.zig.zon.paths, includinge2e/when used. - Run
zig fmt --checkon changed Zig files andzig build testwith the project toolchain. Check Debug and ReleaseSafe when changing ownership or error paths. - Keep CI jobs focused on distinct risks; avoid duplicate push and pull-request runs for the same change.
References: Zig sources, Readable Test Code.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

