gala-ast
Work with Gala's AST — add node types, implement visitors, maintain CST/AST separation
Skill by gala-pl
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/gala-pl-gala-ast
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/gala-ast
Tools it pre-approves 9
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Bash(cargobuild*)testReadWriteEditGlobGrep
What's inside
- Skill name
gala-ast- Description
- Work with Gala's AST — add node types, implement visitors, maintain CST/AST separation
- License
- Apache-2.0
- Allowed tools
- Bash(cargo, build, *), Bash(cargo, test, *), Read, Write, Edit, Glob, Grep
- Instructions
- 124 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves some shell commands
Files (1)
- SKILL.md
SKILL.md (first lines)
## Task
$ARGUMENTS
## Context
Gala's AST (`crates/gala-ast`) defines the **abstract syntax tree** nodes used after parsing. It is separate from the CST (concrete syntax tree) used by the formatter. The AST is the input to HIR lowering.
> **Note on file layout:** The crate currently lives in a single `crates/gala-ast/src/lib.rs`. As it matures it may be split into `node.rs`, `visit.rs`, `span.rs`, `token.rs` (see `docs/ARCHITECTURE.md`). When in doubt, search for the relevant code in `lib.rs`.
Key files:
- `crates/gala-ast/src/lib.rs` — Core AST node definitions (`Item`, `Expr`, `Stmt`, `Type`, `Pattern`), `Ident`, `Spanned`
## Common Tasks
### Add new AST node type
1. Add variant to appropriate enum in `lib.rs` (e.g., `ExprKind`, `StmtKind`, `ItemKind`)
2. Derive `Clone`, `Debug`, `PartialEq`, `Hash` as needed
3. Update parser in `gala-parser` to produce the new node
4. Update HIR lowering in `gala-hir` to handle the new node
5. Update formatter in `gala-fmt` if syntax-affecting
6. Add tests in `gala-ast/tests/` and conformance tests
### Implement visitor for analysis/transformation
```rust
// Visitors are typically implemented inline via pattern matching
// in the consuming crate (e.g., Desugarer in gala-hir)
fn walk_expr(expr: &Expr, f: &mut impl FnMut(&Expr)) {
match expr {
Expr::Binary(b) => { walk_expr(&b.lhs, f); walk_expr(&b.rhs, f); }
Expr::Call(c) => { walk_expr(&c.callee, f); for a in &c.args { walk_expr(a, f); } }
// ...
}
}
```
### Maintain AST vs CST separation
- **AST** (`gala-ast`): Semantic structure, no whitespace/comments, used for type checking
- **CST** (in `gala-parser`): Lossless syntax tree with trivia, used by `gala-fmt` and LSP
- Never put formatting info in AST; never put semantic info only in CST
## Testing
```bash
cargo test -p gala-ast # Unit tests
cargo test --workspace ast # All AST-related tests
```
## Conventions
- Node IDs: `NodeId` (u32) from `gala-span` for stable identity across passes
- Spans: `Span` (byte offset + length) from `gala-span` for diagnostics
- All public nodes documented with `///`
- No `unwrap()` on user paths
- Follow Rust edition 2021, max_width 100
## Key Types
```rust
// Core expressions
enum Expr {
Literal(Literal),
Ident(Ident),
Binary(BinaryExpr),
Unary(UnaryExpr),
Call(CallExpr),
MethodCall(MethodCallExpr),
If(IfExpr),
Match(MatchExpr),
For(ForExpr),
While(WhileExpr),
Block(Block),
Tuple(Vec<Expr>),
Array(Vec<Expr>),
Lambda(LambdaExpr),
Field(FieldExpr),
Index(IndexExpr),
Let(LetExpr),
}
// Core statements
enum Stmt {
Let(LetStmt),
Expr(Expr),
Item(Item),
Return(Option<Expr>),
}
// Top-level items
enum Item {
FnDef(FnDef),
StructDef(StructDef),
EnumDef(EnumDef),
TraitDef(TraitDef),
ImplBlock(ImplBlock),
TypeAlias(TypeAlias),
ConstDef(ConstDef),
Import(Import),
}
// Types
enum Type {
Path(Path),
Qubit,
Qubits(Box<ConstExpr>),
Measured(Box<Type>),
Tuple(Vec<Type>),
Array(Box<Type>, Box<ConstExpr>),
Named(Ident, Vec<TypeArg>),
Fn { params: Vec<Type>, ret: Box<Type>, effect: Option<Effect> },
}
// Patterns
enum Pattern {
Ident(Ident),
Literal(Literal),
Tuple(Vec<Pattern>),
Array(Vec<Pattern>),
Struct { path: Path, fields: Vec<(Ident, Pattern)>, rest: bool },From gala-pl/gala, Apache-2.0.
More from gala-pl/gala
- 0.584score
gala-diff
gala-pl
Work with Gala's native differentiation — parameter-shift for quantum params, reverse-mode autodiff for classical, chain-rule composition
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-hardware-backends
gala-pl
Run Gala programs on quantum hardware — backend selection, capability checking, QIR emission, vendor SDKs
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-language-basics
gala-pl
Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-noise-modeling
gala-pl
Model and simulate noise in Gala — typed noise models, QuEST noise channels, error mitigation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-performance
gala-pl
Optimize Gala program performance — gate count, circuit depth, gradient cost, compilation time
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-python-interop
gala-pl
Call Gala from Python — PyO3 bridge, Jupyter kernel, PyTorch integration, NumPy arrays
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-quantum-algorithms
gala-pl
Implement quantum algorithms in Gala — QFT, Grover, phase estimation, adders, oracles
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-vqa-programming
gala-pl
Build variational quantum algorithms in Gala — encoders, ansätze, optimizers, native grad
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-codegen-classical
gala-pl
Work with Gala's classical codegen — Cranelift (debug) and LLVM (release) for orchestration layer
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-driver
gala-pl
Work with Gala's compilation driver — salsa DB orchestration, incremental queries, pipeline wiring
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
debug-compiler
gala-pl
Debug a compiler error or unexpected behavior in Gala source code
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-cookbook
gala-pl
Gala recipes — common patterns, idioms, algorithms, VQA templates, error handling
SkillAFreshness: A★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Oct 23, 2026 (5 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- Apache-2.0
- Repository
- github.com/gala-pl/gala
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from gala-pl
- 0.584score
gala-diff
gala-pl
Work with Gala's native differentiation — parameter-shift for quantum params, reverse-mode autodiff for classical, chain-rule composition
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-language-basics
gala-pl
Learn Gala language fundamentals — syntax, types, effects, linear qubits, basic quantum operations
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-noise-modeling
gala-pl
Model and simulate noise in Gala — typed noise models, QuEST noise channels, error mitigation
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-performance
gala-pl
Optimize Gala program performance — gate count, circuit depth, gradient cost, compilation time
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-python-interop
gala-pl
Call Gala from Python — PyO3 bridge, Jupyter kernel, PyTorch integration, NumPy arrays
SkillAFreshness: A★ 1Claude Code +9 - 0.581score
gala-hardware-backends
gala-pl
Run Gala programs on quantum hardware — backend selection, capability checking, QIR emission, vendor SDKs
SkillAFreshness: A★ 1Claude Code +9
Cite this page
gala-ast skill. Agent Mart. https://agentmart.dev/skills/gala-pl-gala-ast (last updated 2026-10-24)