Synthèse automatique
LiquidIL compile les modèles Liquid en un langage intermédiaire basé sur une pile pour inspection et optimisation, et fournit une CLI pour analyser les modèles et générer du code Ruby.
Points forts
- Permet une inspection détaillée de la compilation des modèles Liquid
- Offre un ensemble complet d'instructions IL pour le débogage
- Prend en charge à la fois la sortie IL et le code Ruby
- Permet de désactiver les optimisations pour voir l'IL brut
Limites
- Nécessite une compréhension de l'exécution basée sur une pile
- Peut être excessif pour un débogage simple de modèles
- Limité aux modèles Liquid uniquement
Utilisez LiquidIL lorsque vous avez besoin de comprendre, déboguer ou optimiser l'exécution de modèles Liquid complexes au niveau des instructions.
Évitez LiquidIL pour les erreurs de modèle simples qui peuvent être détectées par la validation syntaxique Liquid standard.
Analyse de sécurité
SûrThe skill provides documentation for a command-line tool that inspects intermediate language representations of Liquid templates. The commands shown are purely for analysis and do not perform any destructive actions, network calls, or handle sensitive data.
Aucun point d'attention détecté
Comment cette analyse est faiteExemples
Show me the IL for the Liquid template {{ user.name | upcase }}Explain the difference between WRITE_RAW and WRITE_VALUE in Liquid ILCompile a for loop in Liquid to IL and show me the generated Ruby codeLiquidIL Intermediate Language
LiquidIL compiles Liquid templates to a stack-based intermediate language (IL) before execution. The IL is defined in lib/liquid_il/il.rb.
Inspecting IL
Use the liquidil CLI to inspect IL for templates:
# Parse a template and show IL
./bin/liquidil parse "{{ name | upcase }}"
# Also show generated Ruby code
./bin/liquidil parse "{% for i in (1..3) %}{{ i }}{% endfor %}" --print-ruby
# Inspect specs from benchmarks
./bin/liquidil inspect bench_ecommerce -s benchmarks/partials.yml --print-il
# Inspect with Ruby code generation
./bin/liquidil inspect bench_product_listing -s benchmarks/suite.yml --print-ruby
# Disable optimizations to see raw IL
./bin/liquidil parse "{{ 1 | plus: 2 }}" --no-optimize
IL Instruction Reference
All instructions are arrays: [:OPCODE, arg1, arg2, ...]
Output
| Instruction | Format | Description |
|-------------|--------|-------------|
| WRITE_RAW | [:WRITE_RAW, string] | Output literal string |
| WRITE_VALUE | [:WRITE_VALUE] | Pop stack, output as string |
Constants (push to stack)
| Instruction | Format | Description |
|-------------|--------|-------------|
| CONST_NIL | [:CONST_NIL] | Push nil |
| CONST_TRUE | [:CONST_TRUE] | Push true |
| CONST_FALSE | [:CONST_FALSE] | Push false |
| CONST_INT | [:CONST_INT, value] | Push integer |
| CONST_FLOAT | [:CONST_FLOAT, value] | Push float |
| CONST_STRING | [:CONST_STRING, value] | Push string |
| CONST_RANGE | [:CONST_RANGE, start, end] | Push range literal |
| CONST_EMPTY | [:CONST_EMPTY] | Push empty literal |
| CONST_BLANK | [:CONST_BLANK] | Push blank literal |
Variable Access
| Instruction | Format | Description |
|-------------|--------|-------------|
| FIND_VAR | [:FIND_VAR, name] | Look up variable, push to stack |
| FIND_VAR_PATH | [:FIND_VAR_PATH, name, [path]] | Look up variable with path |
| FIND_VAR_DYNAMIC | [:FIND_VAR_DYNAMIC] | Pop name from stack, look up |
| LOOKUP_KEY | [:LOOKUP_KEY] | Pop key, pop object, push object[key] |
| LOOKUP_CONST_KEY | [:LOOKUP_CONST_KEY, name] | Pop object, push object[name] |
| LOOKUP_CONST_PATH | [:LOOKUP_CONST_PATH, [names]] | Pop object, traverse path |
| LOOKUP_COMMAND | [:LOOKUP_COMMAND, name] | Optimized for size/first/last |
Control Flow
| Instruction | Format | Description |
|-------------|--------|-------------|
| LABEL | [:LABEL, id] | Jump target marker |
| JUMP | [:JUMP, label_id] | Unconditional jump |
| JUMP_IF_FALSE | [:JUMP_IF_FALSE, label_id] | Jump if stack top is falsy |
| JUMP_IF_TRUE | [:JUMP_IF_TRUE, label_id] | Jump if stack top is truthy |
| JUMP_IF_EMPTY | [:JUMP_IF_EMPTY, label_id] | Jump if stack top is empty |
| JUMP_IF_INTERRUPT | [:JUMP_IF_INTERRUPT, label_id] | Jump if break/continue pending |
| HALT | [:HALT] | End execution |
Comparison & Logic
| Instruction | Format | Description |
|-------------|--------|-------------|
| COMPARE | [:COMPARE, op] | Pop two values, push comparison result. op: :eq/:ne/:lt/:le/:gt/:ge |
| CASE_COMPARE | [:CASE_COMPARE] | Case/when comparison (stricter blank/empty) |
| CONTAINS | [:CONTAINS] | Pop needle, pop haystack, push boolean |
| BOOL_NOT | [:BOOL_NOT] | Logical negation |
| IS_TRUTHY | [:IS_TRUTHY] | Convert to boolean |
Scope & Assignment
| Instruction | Format | Description |
|-------------|--------|-------------|
| PUSH_SCOPE | [:PUSH_SCOPE] | Enter new variable scope |
| POP_SCOPE | [:POP_SCOPE] | Exit variable scope |
| ASSIGN | [:ASSIGN, name] | Pop value, assign to variable |
| ASSIGN_LOCAL | [:ASSIGN_LOCAL, name] | Assign to current scope only (loop vars) |
Filters
| Instruction | Format | Description |
|-------------|--------|-------------|
| CALL_FILTER | [:CALL_FILTER, name, argc] | Pop argc args, pop input, push result |
Loops
| Instruction | Format | Description |
|-------------|--------|-------------|
| FOR_INIT | [:FOR_INIT, var, loop_name, has_limit, has_offset, offset_continue, reversed] | Initialize for loop |
| FOR_NEXT | [:FOR_NEXT, continue_label, break_label] | Advance iterator or jump to break |
| FOR_END | [:FOR_END] | Clean up for loop |
| PUSH_FORLOOP | [:PUSH_FORLOOP] | Create forloop drop |
| POP_FORLOOP | [:POP_FORLOOP] | Remove forloop drop |
| PUSH_INTERRUPT | [:PUSH_INTERRUPT, type] | Signal break/continue |
| POP_INTERRUPT | [:POP_INTERRUPT] | Clear interrupt |
Tablerow
| Instruction | Format | Description |
|-------------|--------|-------------|
| TABLEROW_INIT | [:TABLEROW_INIT, var, loop_name, has_limit, has_offset, cols] | Initialize tablerow |
| TABLEROW_NEXT | [:TABLEROW_NEXT, continue_label, break_label] | Advance with <tr>/<td> output |
| TABLEROW_END | [:TABLEROW_END] | Clean up tablerow |
Counters
| Instruction | Format | Description |
|-------------|--------|-------------|
| INCREMENT | [:INCREMENT, name] | Increment counter, push new value |
| DECREMENT | [:DECREMENT, name] | Decrement counter, push new value |
Cycle
| Instruction | Format | Description |
|-------------|--------|-------------|
| CYCLE_STEP | [:CYCLE_STEP, identity, values] | Advance cycle, push current value |
| CYCLE_STEP_VAR | [:CYCLE_STEP_VAR, var_name, values] | Cycle with variable group |
Capture
| Instruction | Format | Description |
|-------------|--------|-------------|
| PUSH_CAPTURE | [:PUSH_CAPTURE] | Start capturing output |
| POP_CAPTURE | [:POP_CAPTURE] | End capture, push captured string |
Partials
| Instruction | Format | Description |
|-------------|--------|-------------|
| RENDER_PARTIAL | [:RENDER_PARTIAL, name, args] | Render partial (isolated scope) |
| INCLUDE_PARTIAL | [:INCLUDE_PARTIAL, name, args] | Include partial (shared scope) |
| CONST_RENDER | [:CONST_RENDER, name, args] | Compile-time render (lowered) |
| CONST_INCLUDE | [:CONST_INCLUDE, name, args] | Compile-time include (lowered) |
Stack Operations
| Instruction | Format | Description |
|-------------|--------|-------------|
| DUP | [:DUP] | Duplicate stack top |
| POP | [:POP] | Discard stack top |
| BUILD_HASH | [:BUILD_HASH, count] | Pop count*2 items, push Hash |
| STORE_TEMP | [:STORE_TEMP, index] | Pop and store in temp slot |
| LOAD_TEMP | [:LOAD_TEMP, index] | Push from temp slot |
Range
| Instruction | Format | Description |
|-------------|--------|-------------|
| NEW_RANGE | [:NEW_RANGE] | Pop end, pop start, push range |
Misc
| Instruction | Format | Description |
|-------------|--------|-------------|
| IFCHANGED_CHECK | [:IFCHANGED_CHECK, tag_id] | Pop captured, output if changed |
| NOOP | [:NOOP] | No operation |
Example: Simple Output
{{ name | upcase }}
FIND_VAR "name"
CALL_FILTER "upcase", 0
WRITE_VALUE
HALT
Example: For Loop
{% for item in items %}{{ item }}{% endfor %}
FIND_VAR "items"
FOR_INIT "item", "item-items", false, false, false, false
LABEL 1
PUSH_FORLOOP
FOR_NEXT 2, 3
ASSIGN_LOCAL "item"
FIND_VAR "item"
WRITE_VALUE
JUMP 1
LABEL 2
POP_FORLOOP
JUMP 1
LABEL 3
FOR_END
POP_FORLOOP
HALT
Optimization Passes
The compiler applies several optimization passes (see lib/liquid_il/compiler.rb):
- Constant folding - Evaluate constant expressions at compile time
- Filter folding - Fold filters on constants (e.g.,
{{ "hello" | upcase }}→"HELLO") - Dead code elimination - Remove unreachable code after jumps
- WRITE_RAW merging - Combine consecutive raw writes
- Loop invariant hoisting - Move invariant lookups outside loops
- Constant propagation - Replace variables with known constant values
Use --no-optimize to see unoptimized IL.
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/liquidil-intermediate-language-mm5t89jr/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/liquidil-intermediate-language-mm5t89jr' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/liquidil-intermediate-language-mm5t89jr/download' --output '.skill-downloads/liquidil-intermediate-language-mm5t89jr/SKILL.md.part' && mv '.skill-downloads/liquidil-intermediate-language-mm5t89jr/SKILL.md.part' '.skill-downloads/liquidil-intermediate-language-mm5t89jr/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
Le fichier ne fournit pas un en-tête name/description exploitable pour cette procédure native. Le téléchargement reste disponible pour lecture ; utilisez le mode manuel ci-dessous.
Mode 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/liquidil-intermediate-language-mm5t89jr/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.