Synthèse automatique
Assiste le développement en Zig (sources, build.zig, dépendances, tests, optimisation, migration, revue) en ancrant systématiquement les réponses sur la version de compilateur ciblée par le dépôt.
Points forts
- Impose une discipline de version : version cible déduite des pins du dépôt, du CI ou du manifeste avant toute proposition de code
- Distingue clairement version minimale, plage supportée, compilateur actif et version du formateur, et refuse de coder en dur une version « de mémoire »
- Couvre le spectre complet : syntaxe, API de la stdlib, Build API, allocation et propriété, error unions, interop C, cross-compilation et diagnostics
- Prévoit une vérification des publications officielles et un refus explicite de migrer un projet à cause d'un compilateur local plus récent
Limites
- S'appuie sur des scripts et pages web externes (ziglang.org) : sans réseau ni preuve de version, la skill demande l'information plutôt que de répondre
- Le texte fourni est tronqué, la partie sur le style, les tests et la revue n'est donc pas entièrement couverte ici
- Fortement orientée processus et vérification : plus lente qu'une réponse directe pour une simple question de syntaxe
À utiliser dès qu'une tâche touche du code Zig, un build.zig, une dépendance, une erreur de compilation ou une question de compatibilité de version.
À éviter pour des demandes sans lien avec Zig ou quand la version cible est indispensable mais introuvable et que l'utilisateur ne peut pas la fournir.
Analyse de sécurité
SûrThe skill is a conventional language-tooling guide. It contains no destructive commands, no secret or token handling, no obfuscated payloads, and no attempt to bypass safety controls; in fact it repeatedly tells the agent to verify against the toolchain rather than acting from memory, and to avoid automatic migrations. The only execution surface is running the Zig compiler/formatter and an optional network-based release-verification script, both legitimate for the stated purpose and low risk.
- •Delegates version checks to a bundled script (`scripts/verify-official-release.mjs`) that performs network requests and optional link verification; the script body is not included in this excerpt and was not audited
- •Instructs the agent to run local toolchain commands (`zig env`, `zig fmt`, `zig <cmd> --help`) and to consult external ziglang.org pages, but only for read-only verification and never to mutate the project automatically
Exemples
Add a fixed-buffer string pool to src/pool.zig in this repo. First read build.zig and build.zig.zon to determine the Zig version we target, then make the change and verify with `zig build test` on that compiler.My build fails with 'no field named ...' after upgrading Zig. Check build.zig.zon and the CI matrix to see which version this project supports, then explain and fix the breakage without migrating the whole project.Set up `zig build` targets for x86_64-linux-musl and aarch64-macos in build.zig, keeping the current Zig version pinned by the repo, and add a short note on how to verify both targets.name: zig
description: "Build, modify, debug, test, optimize, migrate, and review Zig applications and libraries. Use for .zig source, coding style, API design, build.zig, build.zig.zon, dependencies, the Zig build system, comptime, allocators and ownership, error unions, C interoperability, cross-compilation, performance diagnostics, compiler diagnostics, and Zig package maintenance. Coding style, best practices, syntax, standard library APIs, Build API, compiler options, and target behavior must match the target Zig version; when neither the user nor the repository specifies a version, query the Zig website and use the latest stable release at that time."
Zig development
General workflow
Establish the repository and version boundaries
- Before proposing changes, read the repository instructions,
git status,build.zig,build.zig.zon, version-pinning files, adjacent source, and tests. - Determine the task's target Zig version or supported range in this order: an explicit user requirement; otherwise repository version pins, manifest constraints, CI configuration, or the project toolchain; when none of that evidence exists, query the official Zig Download or Learn page and use the latest stable release at that time.
- Distinguish the minimum version, supported range, active compiler version, and formatter version. A lower bound such as
minimum_zig_versionis not an exact pin. When a project supports multiple versions, preserve its CI matrix and select an explicit compiler for each verification run. By default, verify at least the minimum supported release and the latest stable release within the supported range. - Use the formatter version specified by the repository. When none is specified separately, run
zig fmtwith the compiler used for the current verification. If different compilers produce different formatting, follow the repository-specified version and report the difference. - When there is no version evidence, do not use a version number from memory or treat master/nightly as the "latest version"; target master/nightly only when the user explicitly requests a development release.
- When Zig is available locally, compare
zig versionwith the target version. If the local version conflicts with the user or repository version, treat it as a different environment rather than migrating the project automatically. - If the official website is unavailable and there is no other version evidence, report that the latest stable release could not be verified and request version information instead of silently falling back to a historical release.
- Preserve the compiler versions and existing conventions supported by the project. Treat a newer local compiler as a different environment, not as a reason to migrate the project automatically.
- When the request is unrelated to Zig source, build configuration, toolchains, or diagnostics, complete it directly without introducing Zig-specific process.
Complete this step when the target files, supported version range, active compiler, formatter version, version evidence, existing command entrypoints, and request scope are all explicit.
Use version-matched evidence
For exact syntax, standard library APIs, Build API, compiler options, target behavior, or version compatibility, rely on official evidence that matches the target version:
- Use
zig envand the standard library source bundled with the installed compiler to verify the toolchain actually in use. - To confirm the current stable release on the official website, run the official release verification script; add
--verify-linksbefore publishing or refreshing version data. This network check proves only the state of the official index and links at query time. - For a stable release, use the target version's language reference, its Style Guide, standard library documentation, release notes, and compiler-bundled source. Use master documentation only when the user explicitly targets master. Do not let another version's Style Guide override the target version's rules.
- Use the official build system guide for concepts, then verify the API against the target compiler; the Build API evolves continuously.
- Use
zig <command> --helpand the build steps and options declared by the project instead of applying options remembered from another version. - When the language reference is insufficient, inspect the official Zig source and label conclusions derived from source as implementation details.
When reporting a version-sensitive conclusion, state the target version, the basis for choosing it, and the documentation source, and distinguish verified facts, engineering defaults, and migration recommendations.
Load task-specific rules
- When writing, refactoring, or reviewing Zig code, or when the user asks about best practices, coding style, runtime safety, or illegal behavior boundaries, read Coding best practices and style.
- When modifying
build.zig,build.zig.zon, dependencies, package metadata, version constraints, or the Zig version, read Builds, dependencies, and version migrations. - When using C headers, C libraries,
@cImport,zig translate-c,extern, callbacks, or data across an ABI, read C interoperability boundaries.
Complete this step after performing the checks required by the detailed rules and reflecting every applicable boundary in the design, implementation, and verification plan.
Design ownership and failure paths
- Define the public contract, error behavior, allocation strategy, and lifetime boundaries before implementation.
- Make the owner and release mechanism of every allocation explicit. Prefer caller-provided allocators at reusable boundaries, and pair cleanup with resource acquisition using
deferorerrdefer. - Distinguish borrowed slices from owned slices through names, documentation, or return types. Copy data when it must outlive its backing storage.
- Keep error unions meaningful and handle expected failures explicitly. Use
catch unreachableonly for invariants already proven at that location. - Use optionals for absence and error unions for failure; preserve that distinction across adapters and public APIs.
Complete this step when every return value, allocation, borrowed view, error, and cleanup path has an explicit owner and a testable contract.
Make build and test evidence explicit
- Treat
build.zigas executable project code;zig build --helpalso loads the build graph. For an untrusted project, inspect build scripts, dependency declarations, and every reachable system-command step before running anyzig buildsubcommand. - Derive step names and
-Doptions from the currentbuild.zigandzig build --help, and preserve the project's existing target and optimization option model. - Distinguish a test artifact that compiled from one that executed and one that passed. Confirm that the test step depends on the step that runs the artifact; report tests as passing only after the artifact actually runs and succeeds.
- Before dependency resolution, downloads, global toolchain changes, package publication, or other out-of-scope external side effects, make the impact explicit and confirm authorization.
Complete this step when the build steps, test execution path, dependency side effects, and success criteria can all be explained.
Apply measurement-driven performance optimization
- Establish a reproducible performance baseline first, fixing the Zig version, target, optimization mode, inputs, warm-up procedure, execution environment, and sampling method.
- Locate the bottleneck before proposing a change; vary one major factor at a time while retaining correctness tests.
- Repeat measurements under the same conditions and report the distribution or variance rather than comparing only the single fastest result.
- Treat compile time, binary size, memory, throughput, and latency as separate metrics; optimize only the metrics the user cares about and that have been measured.
Claim a performance improvement only when the baseline, bottleneck evidence, post-change measurements, and correctness regression results are all available.
Implement the smallest compatible change
- Follow adjacent code and every applicable rule in Coding best practices and style.
- Keep the first change small enough that one targeted compile or test can reject it quickly.
- Add tests next to the behavior they protect; cover failure and cleanup paths for allocation or I/O changes.
- Run
zig fmtonly on modified Zig paths; usezig fmt --checkfor a read-only check. - Preserve the existing language version and change boundary unless the request includes a version migration or broad rewrite.
Complete this step when the code, tests, and documentation contain only the smallest compatible change required by the request.
Expand verification in layers
Prefer the repository's existing commands. Otherwise, expand verification only within the range supported by the project:
- Run
zig fmt --checkon modified Zig files. - Run the smallest applicable
zig testcommand, or run a namedzig buildtest step and verify that it actually executes the test artifact. - Run the project build and remaining tests with the compiler pinned by the project.
- When a change affects portability, safety, ABI, or performance, cover the target and optimization combinations declared by the project.
- Run generated binaries or integration tests in a compatible environment. A successful cross-compilation does not prove correctness on the target runtime.
When validating this skill's minimal examples, run the toolchain smoke script for each representative toolchain. It checks formatting, the build graph, and actual test execution in an isolated temporary directory; it does not replace the target repository's test matrix.
Report the exact Zig version, commands, target, optimization mode, and observations. Mark compiled, executed, passed, and currently unavailable checks separately.
Diagnostic order
- Reproduce the failure with the project-pinned compiler and the smallest command.
- Read the first causal diagnostic and its compile-time reference trace before addressing later errors.
- Classify the failure as language semantics, version drift, ownership/lifetime,
comptimeevaluation, build graph, dependency resolution, C ABI/linking, target behavior, or performance regression. - Narrow the failing boundary while preserving the relevant allocator, target, optimization mode, and external dependencies.
- For disputed behavior, check the version-matched language reference, local standard library source, Build API, release notes, or compiler source.
- Handle caches only when evidence points to them; scope the action to a specific project or isolated cache path and preserve unrelated artifacts.
Conclude with the root cause, the smallest verified fix, regression coverage, and any platform, runtime, or performance boundary that remains unverified.
Du fichier au premier essai
Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.
Consulter la source et ses fichiers annexesCe téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.
1. Télécharger le fichier
Télécharger SKILL.mdDepuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/zig-development-msshywnz/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.
Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.
mkdir -p '.skill-downloads/zig-development-msshywnz' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/zig-development-msshywnz/download' --output '.skill-downloads/zig-development-msshywnz/SKILL.md.part' && mv '.skill-downloads/zig-development-msshywnz/SKILL.md.part' '.skill-downloads/zig-development-msshywnz/SKILL.md'2. Vérifier les prérequis
Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.
Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.
Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.
3. Charger la skill
Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.
Claude Code
test -f '.skill-downloads/zig-development-msshywnz/SKILL.md' && test -s '.skill-downloads/zig-development-msshywnz/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/zig' && cp -R '.skill-downloads/zig-development-msshywnz' '.claude/skills/zig'Cursor
test -f '.skill-downloads/zig-development-msshywnz/SKILL.md' && test -s '.skill-downloads/zig-development-msshywnz/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/zig' && cp -R '.skill-downloads/zig-development-msshywnz' '.cursor/skills/zig'Codex
test -f '.skill-downloads/zig-development-msshywnz/SKILL.md' && test -s '.skill-downloads/zig-development-msshywnz/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/zig' && cp -R '.skill-downloads/zig-development-msshywnz' '.agents/skills/zig'OpenSkills
OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.
Installation officielle d’OpenSkillsopenskills install './.skill-downloads/zig-development-msshywnz'openskills read 'zig-development-msshywnz'La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.
Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.
openskills syncMode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.
4. Faire un premier essai
Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :
Lis .skill-downloads/zig-development-msshywnz/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.
Bonnes pratiques React Hook Form
Developpement
Maîtrisez React Hook Form : évitez les anti-patterns, gérez les abonnements, et traitez correctement reset, dirty state et entrées contrôlées.
Migration Emotion vers Mantine
Developpement
Migrer les styled-components Emotion vers des composants Mantine avec style props et modules CSS. Pour convertir .styled.tsx ou supprimer les imports @emotion.
Détecteur de dérive de périmètre
Developpement
Analyse les diffs git par rapport à une intention pour détecter la dérive de périmètre, fichiers non liés et PR trop larges, puis suggère de garder, diviser ou justifier.