plugins/tiger-style/skills/tiger-check/SKILL.md
Audit Zig source files for Tiger Style violations -- functions > 70 lines, lines > 100 columns, usize usage, direct recursion, compound assert(a and b), and bare while (true) without an adjacent assert.
npx skillsauth add kelp/kelp-claude-plugins plugins/tiger-style/skills/tiger-checkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit Zig source files for mechanical Tiger Style
violations. If a file path is given, check that file.
Otherwise check all *.zig files that were modified in
the current git diff (staged and unstaged).
Only mechanical, statically-detectable rules are
covered. Subjective rules (naming quality, prose,
"simplicity") are not. For those, lean on the patterns
in ${CLAUDE_PLUGIN_ROOT}/docs/TIGER_STYLE_REFERENCE.md.
If argument provided:
If no argument:
git diff --name-only and
git diff --cached --name-only.*.zig files (include any path, not just
src/*.zig).Use the Read tool to read the full contents.
Apply each check below to each file. Report every violation with file path, line number (or line range for function-length), and a one-line fix suggestion.
For each function definition (fn name(...) or
pub fn name(...)), measure from the opening { line
through the matching closing }. If the body spans
more than 70 lines (closing line minus opening line
70), flag it.
Report: WARN: <start>-<end>: function '<name>' is <N> lines (limit 70).
Fix: "Split into helper functions. Push fors down
into helpers; keep branching in the parent."
For each line whose character length exceeds 100, flag it.
Caveats:
const), since
wrapping would change semantics. Flag with a note
rather than as a violation.Report: WARN: <line>: line is <N> columns (limit 100).
Fix: "Wrap with zig fmt (add trailing comma to the
preceding signature/call) or extract the long
expression into a named const."
usize usageGrep each file for the token usize. For each
occurrence, flag it.
Caveats:
usize is required when interfacing with stdlib APIs
that return it (.len, allocator sizes, etc.). The
rule is "avoid where you control the type," not "ban
outright." Include a note encouraging the user to
verify whether the use site is constrained by an
external API.Report: WARN: <line>: 'usize' used; prefer explicitly- sized type (u32, u64) unless required by stdlib API.
Fix: "Use u32 or u64 if you control the type; keep
usize only when bound by an external API
signature."
For each function definition, scan its body for calls to the function's own name. Flag any match.
Caveats:
inline fn recursion bounded at comptime is
sometimes acceptable; flag with a note rather than
bare violation when the function is inline fn.Report: WARN: <line>: function '<name>' recurses directly; Tiger Style requires iteration with an explicit stack.
Fix: "Convert to iteration with a bounded stack
(std.ArrayListUnmanaged of frames, sized at init)."
Grep for assert( calls whose argument contains a
top-level and or or (outside nested
parentheses or string literals). Flag each.
Report: WARN: <line>: compound assertion -- split into separate asserts for clearer failure messages.
Fix: "Replace assert(a and b); with assert(a); and
assert(b); on separate lines."
while (true) without adjacent assertFor each while (true) (and equivalent like
while (true) : ()), read the loop body. If the body
does not contain at least one assert( call within
the loop's direct scope (not inside a deeply nested
function), flag it.
Report: WARN: <line>: 'while (true)' without an assertion in the loop body; non-terminating loops must assert their invariant.
Fix: "Add assert(<invariant>); near the top of the
loop body to document why the loop is allowed to
never terminate."
Format output as:
## /tiger-check Results
### <file_path>
WARN: <line>: <description>
Fix: <suggestion>
WARN: <line>: <description>
Fix: <suggestion>
### <file_path>
No violations found.
---
Summary: X warnings across Z files
If no violations across all files:
## /tiger-check Results
All files pass. No Tiger Style violations found.
Always append:
---
Note: /tiger-check covers mechanical rules only. It
does not check naming quality, comment prose, scope
minimization, mutual recursion, or dynamic allocator
usage after init. Review against
`${CLAUDE_PLUGIN_ROOT}/docs/TIGER_STYLE_REFERENCE.md`
for those.
tools
Correct Zig 0.15.x patterns for I/O, ArrayList, format strings, and build.zig. Use when writing or reviewing any Zig code -- Claude's training data is outdated for these APIs.
tools
Add Zig 0.15.x training corrections to this project's CLAUDE.md. Run this in any Zig project to fix Claude's outdated patterns for I/O, ArrayList, format strings, build.zig, BoundedArray, and usingnamespace.
tools
Audit Zig source files for Zig 0.15.x mistakes -- checks for removed APIs (getStdOut, usingnamespace, BoundedArray, async), missing flush, wrong ArrayList usage, ambiguous format strings, signed division, and renamed stdlib functions.
tools
Tiger Style rules for Zig: assertions (2+ per fn, paired positive/negative space), bounded loops (no recursion), static memory after init, snake_case naming with unit suffixes, 70-line function limit, 100-column line limit, zig fmt. Use when writing or reviewing Zig in a project that follows Tiger Style.