Debug AILANG code errors. Use when you encounter type errors, parse errors, or runtime failures in AILANG programs.
/plugin marketplace add sunholo-data/ailang_bootstrap/plugin install sunholo-data-ailang@sunholo-data/ailang_bootstrapThis skill inherits all available tools. When active, it can use any tool Claude has access to.
resources/error_catalog.mdFix common AILANG errors quickly.
| Error | Cause | Fix |
|---|---|---|
undefined variable: print | Not in entry module | Use entry module or import std/io (print) |
undefined variable: println | Wrong function name | Use print not println |
undefined variable: map | Not imported | import std/list (map) or write recursive |
No instance for Num[string] | print(42) | Use print(show(42)) |
expected }, got let | Missing semicolon | Add ; between statements |
unexpected token: for | No loops in AILANG | Use recursion instead |
unexpected token: in | No for x in xs | Use match xs { ... } |
Error message?
│
├─ "undefined variable: X"
│ └─ Is X a builtin?
│ ├─ Yes → Import it: ailang builtins list | grep X
│ └─ No → Check spelling, define it
│
├─ "expected }, got ..."
│ └─ Missing semicolon between statements
│ Fix: let x = 1; let y = 2; x + y
│
├─ "No instance for Num[string]"
│ └─ Passing number to string function
│ Fix: print(show(42)) not print(42)
│
├─ "unexpected token: for/while/in"
│ └─ AILANG has no loops!
│ Fix: Use recursion with match
│
└─ Parse error with braces
└─ Unmatched { } or missing expression
Fix: Check all blocks are closed
-- WRONG
export func main() -> () ! {IO} {
let x = 10
let y = 20
print(show(x + y))
}
-- CORRECT (semicolons between statements)
export func main() -> () ! {IO} {
let x = 10;
let y = 20;
print(show(x + y))
}
-- WRONG: print expects string
print(42)
-- CORRECT: convert with show()
print(show(42))
-- WRONG: no for loops
for i in range(5) { print(show(i)) }
-- CORRECT: recursive function
export func printRange(n: int) -> () ! {IO} {
if n <= 0 then () else {
print(show(n));
printRange(n - 1)
}
}
-- WRONG: map not in scope
let doubled = map(\x. x * 2, nums)
-- CORRECT: import from std/list
import std/list (map)
let doubled = map(\x. x * 2, nums)
-- OR: write it yourself (recursion)
export func myMap[a,b](f: func(a) -> b, xs: [a]) -> [b] {
match xs {
[] => [],
hd :: tl => f(hd) :: myMap(f, tl)
}
}
Type-check first (faster feedback):
ailang check file.ail
Read error location - line:column tells you where
Check the pattern above for your error type
Use REPL for quick tests:
ailang repl
> show(42)
> 1 + 2
> :type \x. x * 2
List builtins to find imports (CLI is source of truth):
# SOURCE OF TRUTH: Full documentation with examples
ailang builtins list --verbose --by-module
# Search for specific function with full docs
ailang builtins list --verbose | grep -A 10 "map"
# See a specific module's functions
ailang builtins list --verbose --by-module | grep -A 30 "std/list"
Always prefer CLI commands (ailang prompt, ailang builtins list --verbose) over static docs - they're always up-to-date.
See resources/error_catalog.md for additional error patterns.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.