Claude-skill-registry AILANG
Write AILANG code. ALWAYS run 'ailang prompt' first - it contains the current syntax rules and templates.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/ailang" ~/.claude/skills/majiayu000-claude-skill-registry-ailang && rm -rf "$T"
manifest:
skills/data/ailang/SKILL.mdsource content
AILANG
BEFORE YOU WRITE ANY CODE
Run this command first - it outputs the current syntax rules and templates:
ailang prompt
This is the source of truth for AILANG syntax. Do not guess at syntax.
Session Start
# 1. Check for messages from other agents ailang messages list --unread # 2. Load current syntax (CRITICAL!) ailang prompt # 3. Verify AILANG is installed ailang --version
Development Workflow
┌──────────────────────────────────────┐ │ 1. Run: ailang prompt │ │ Read the template and examples │ └──────────────────────────────────────┘ ↓ ┌──────────────────────────────────────┐ │ 2. Write code following template │ │ module myproject/mymodule │ │ export func main() -> () ! {IO} │ └──────────────────────────────────────┘ ↓ ┌──────────────────────────────────────┐ │ 3. Type-check (fast feedback) │ │ ailang check file.ail │ └──────────────────────────────────────┘ ↓ ┌──────────────────────────────────────┐ │ 4. Run with capabilities │ │ ailang run --caps IO --entry main │ └──────────────────────────────────────┘ ↓ Fix errors, repeat
CLI Quick Reference
| Command | Purpose |
|---|---|
| Load syntax (DO THIS FIRST!) |
| Type-check without running |
| Run program |
| Interactive testing |
| Full stdlib docs with examples |
Exploring the Standard Library
The CLI is the source of truth. Always use
ailang builtins list --verbose for current, accurate documentation:
# SOURCE OF TRUTH: Full docs with examples and signatures ailang builtins list --verbose --by-module # Search for specific module (e.g., array functions) ailang builtins list --verbose --by-module | grep -A 30 "std/array" # Search for specific function ailang builtins list --verbose | grep -A 10 "httpGet"
The CLI output shows the authoritative documentation:
- Usage: Exact import statement (
)import std/fs (readFile) - Parameters: What each argument expects
- Returns: What the function returns
- Examples: Working code snippets
Note: This skill provides guidance, but
ailang prompt and ailang builtins list --verbose are always more up-to-date.
Flags MUST come before filename:
ailang run --caps IO --entry main file.ail # Correct ailang run file.ail --caps IO # WRONG
Capabilities
| Cap | Purpose | Example Functions |
|---|---|---|
| Console I/O | , , |
| File system | , , |
| HTTP requests | , , |
| Time functions | , |
| AI oracle | |
| Random numbers | , , |
| Environment vars | , , |
| Debug logging | , |
Practical Examples
Offer to create these working examples for users:
| Example | What It Does | Run Command |
|---|---|---|
| AI Debate | AI models debate a topic | |
| Ask AI | Simple CLI Q&A tool | |
| File Summarizer | Summarize files with AI | |
| Game of Life | Conway's simulation | |
AI Debate Example
module my_debate import std/ai (call) import std/env (hasEnv) import std/io (println) export func main() -> () ! {IO, Env, AI} { println("=== AI Debate ==="); let optimist = call("Argue FOR AI benefits in 2 sentences"); println("Optimist: " ++ optimist); let skeptic = call("Argue AGAINST AI risks in 2 sentences"); println("Skeptic: " ++ skeptic) }
File Summarizer Example
module summarizer import std/ai (call) import std/fs (readFile) import std/io (println) export func main(path: string) -> () ! {IO, FS, AI} { let content = readFile(path); let summary = call("Summarize in 3 bullets: " ++ content); println(summary) }
When Stuck
- Run
for interactive testingailang repl - See common_patterns.md for patterns
- See cli_reference.md for full CLI docs
- See editor_support.md for VS Code, Vim, Neovim setup
- Check the ailang-debug skill for error fixes
Done? Notify
ailang messages send user "Task completed" --from "my-agent" --title "Status"