AILANG Debug
Debug AILANG code errors. Use when you encounter type errors, parse errors, or runtime failures in AILANG programs.
Best use case
AILANG Debug is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Debug AILANG code errors. Use when you encounter type errors, parse errors, or runtime failures in AILANG programs.
Teams using AILANG Debug should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/ailang-debug/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How AILANG Debug Compares
| Feature / Agent | AILANG Debug | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Debug AILANG code errors. Use when you encounter type errors, parse errors, or runtime failures in AILANG programs.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# AILANG Debug
Fix common AILANG errors quickly.
## Quick Reference
| 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 { ... }` |
## Decision Tree
```
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
```
## Common Fixes
### 1. Missing Semicolons
```ailang
-- 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))
}
```
### 2. Print Needs String
```ailang
-- WRONG: print expects string
print(42)
-- CORRECT: convert with show()
print(show(42))
```
### 3. No Loops - Use Recursion
```ailang
-- 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)
}
}
```
### 4. Import Standard Library
```ailang
-- 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)
}
}
```
## Debugging Workflow
1. **Type-check first** (faster feedback):
```bash
ailang check file.ail
```
2. **Read error location** - line:column tells you where
3. **Check the pattern** above for your error type
4. **Use REPL** for quick tests:
```bash
ailang repl
> show(42)
> 1 + 2
> :type \x. x * 2
```
5. **List builtins** to find imports (**CLI is source of truth**):
```bash
# 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"
```
## Resources
**Always prefer CLI commands** (`ailang prompt`, `ailang builtins list --verbose`) over static docs - they're always up-to-date.
See [resources/error_catalog.md](resources/error_catalog.md) for additional error patterns.Related Skills
AILANG Sprint Planner
Analyze design docs, calculate velocity from recent work, and create realistic sprint plans with day-by-day breakdowns. Use when user asks to "plan sprint", "create sprint plan", or wants to estimate development timeline.
k8s-debug
Comprehensive Kubernetes debugging and troubleshooting toolkit. Use this skill when diagnosing Kubernetes cluster issues, debugging failing pods, investigating network connectivity problems, analyzing resource usage, troubleshooting deployments, or performing cluster health checks.
error-debugging-error-trace
You are an error tracking and observability expert specializing in implementing comprehensive error monitoring solutions. Set up error tracking systems, configure alerts, implement structured loggi...
debugging-dags
Comprehensive DAG failure diagnosis and root cause analysis. Use for complex debugging requests requiring deep investigation like "diagnose and fix the pipeline", "full root cause analysis", "why is this failing and how to prevent it". For simple debugging ("why did dag fail", "show logs"), the airflow entrypoint skill handles it directly. This skill provides structured investigation and prevention recommendations.
debug:kubernetes
Debug Kubernetes clusters and workloads systematically with this comprehensive troubleshooting skill. Covers CrashLoopBackOff, ImagePullBackOff, OOMKilled, pending pods, service connectivity issues, PVC binding failures, and RBAC permission errors. Provides structured four-phase debugging methodology with kubectl commands, ephemeral debug containers, and essential one-liners for diagnosing pod, service, network, and storage problems across namespaces.
user-state-debugging
Expert knowledge on debugging user account issues, diagnostic scripts (inspect-user-state.js), fix scripts (fix-user-billing-state.js, reset-user-onboarding.js), onboarding problems, billing sync issues, and Clerk vs database mismatches. Use this skill when user asks about "user stuck", "onboarding broken", "billing out of sync", "debug user", "reset user", or "user state".
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
sentry-debugger
Debug production issues using Sentry error tracking API. Use when Claude needs to investigate production errors, crashes, or issues by fetching error data from Sentry - including stack traces, user context, breadcrumbs, and error frequency. Triggers on requests like "check Sentry for errors", "debug this production issue", "what's causing crashes", "investigate errors in [project]", or when users share Sentry issue URLs.
qa-debugging
Systematic debugging methodologies, troubleshooting workflows, logging strategies, error tracking, performance profiling, stack trace analysis, and debugging tools across languages and environments. Covers local debugging, distributed systems, production issues, and root cause analysis.
python-automated-debugging
Use when fixing a Python test that has failed multiple attempts, when print-debugging hasn't revealed the issue, or when you need to investigate runtime state systematically
nextjs-production-debugger
Advanced debugging guide for Next.js App Router production issues including SSR/CSR bugs, hydration errors, runtime mismatches, performance, and caching.
methodical-debugging
Systematic debugging approach using parallel investigation and test-driven validation. Use when debugging issues, when stuck in a loop of trying different fixes, or when facing complex bugs that resist standard debugging approaches.