Arkian Forums

Theme

Customize your theme More languages later.
Log in / Register
Arkian Forums›Reactionary Programming›Claude Luan Skill

Claude Luan Skill

Discussion in Reactionary Programming

fschmidt Admin edited
I will use this thread to track my progress in developing a Claude [skill](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/) for [Luan](https://www.luan.software/). So far, all I have is a [chat with Claude](https://claude.ai/share/7326dd28-8269-4d14-ba32-2a1e5ef0f8d6). Progress will be slow because I am on vacation and I am also learning Japanese.
mmHg edited
I created a Luan skill using [OpenAI's instructions](https://openai.com/academy/skills/). Basically, it is an instruction guide with references to other context files attached to it. The main benefits are that it reduces token burning and hallucinations by reducing the exploration of unrelated files. Since I have a fork of codegraph that reads Luan and thus reduces token burning by preindexing my files, the Luan skill and the codegraph complement each other extremely well. Attached below is the SKILL.md file in pasted codeblock format. ``` --- name: luan description: Write, debug, and review .luan code using Luan syntax, libraries, and focused validation. Applies to the Luan language, not Lua or Luau. --- # Luan Use the installed Luan runtime and nearby project conventions. Luan resembles Lua but differs in ways that cause avoidable compile errors and retries. ## Essential differences - Only `require` is predefined in a chunk. Import helpers: `local Luan = require "luan:Luan.luan"`; use `Luan.ipairs`, `Luan.error`, etc. Do not assume Lua globals or libraries. - Write `for i in Luan.range(1, n) do ... end`. Numeric `for i = 1, n` is unsupported. - Conditions in `if`, `while`, `repeat`, and operands of `not` must be boolean. For an optional object use `value ~= nil`; preserve the meaning of actual boolean fields. - Call `object.method(...)`; there is no colon-call syntax or implicit `self`. Local applications commonly attach closures to model tables. A raw database document need not have those methods. - Extra non-nil arguments cause errors. Test doubles must accept the arguments their callers supply, or declare `...` when appropriate. - Newlines terminate statements and can separate table fields. Follow nearby multiline syntax; use explicit backslash continuation when needed. - Import `luan:String.luan`. Literal replacement is `String.replace(text, old, new)`; regex replacement is `String.regex(pattern).gsub(text, replacement)`, with Java regex syntax and string escaping. There is no `String.gsub`. - Use `try ... catch e ... finally ... end` where recovery is needed. Do not substitute Lua `pcall` or coroutines. Luan uses real threads; follow the runtime's shared-state APIs when changing concurrent code. ## Find only the context needed When the repository has `.codegraph/`, use its configured CodeGraph before locating or reading indexed code. Name the file/symbol and project; start with a small `maxFiles` appropriate to the task and expand if necessary. Reuse source already available in the conversation. Re-read only if changed, missing after compaction, or incomplete. If a result omits an anonymous handler or a relevant range, read that specific range rather than repeatedly fetching the whole file. For unindexed projects or unsupported files, use targeted search/read; do not create an index implicitly. Ordinary app work does not require reading CodeGraph's implementation or inactive checkouts. For unfamiliar APIs, templates, or local project tests, consult only the relevant section of [runtime-and-web.md](references/runtime-and-web.md). ## Validate proportionately Use the actual Luan runtime, not a Lua parser. When a syntax check helps, run: `sh luan "<skill-directory>/scripts/check.luan" path/to/changed.luan` The helper compiles supplied files without executing their application code or imports. It does not verify runtime APIs or behavior; use the affected project's focused tests for those. Avoid rebuilding the runtime or rerunning unrelated suites for ordinary application edits. ```
fschmidt Admin edited
https://arkian.repositoryhosting.com/trac/arkian_luan/browser/ai/claude/
Reactions
fschmidt Admin
https://claude.ai/share/5df179fb-4153-4edf-9cc3-ce1628869fab
fschmidt Admin
[Reactionary Drag and Drop](https://dad.reactionary.software/) reviewed with Claude and updated.
Reactions
mmHg
> [fschmidt](/thread.html?thread=475&post=786#p786) > > [Reactionary Drag and Drop](https://dad.reactionary.software/) reviewed with Claude and updated. Looks nice.
fschmidt Admin
One of the recent rules: - Fail fast: in a dynamic language, robustness comes from finding mistakes as close to their cause as possible. That's the reason for compile errors on undefined names, boolean-only conditions and errors on extra arguments, and for the import idiom `local f = Module.f or error()`, which turns a missing or misspelled function into an error when the module loads instead of a `nil` found later. Claude used this to suggest an improvement to Luan's design, which I implemented. The lesson here is that Claude can be given good values, and can apply them.
Reactions
fschmidt Admin
Reading material for my flight: https://platform.claude.com/docs/en/agents-and-tools/agent-skills/overview https://www.anthropic.com/research/equipping-agents-for-the-real-world-with-agent-skills https://agentskills.io/home
mmHg
My new skill / pi extension for Luan: https://drive.proton.me/urls/PA82S9WXSC#jpsH8XmNEutw
fschmidt Admin
> [mmHg](/thread.html?thread=475&post=1645#p1645) > > My new skill / pi extension for Luan: > https://drive.proton.me/urls/PA82S9WXSC#jpsH8XmNEutw Can you put this in Mercurial so that me and Claude have easy access? If yes, what name do you want for the repo?
mmHg
> [fschmidt](/thread.html?thread=475&post=1677#p1677) > > > [mmHg](/thread.html?thread=475&post=1645#p1645) > > > > My new skill / pi extension for Luan: > > https://drive.proton.me/urls/PA82S9WXSC#jpsH8XmNEutw > > Can you put this in Mercurial so that me and Claude have easy access? If yes, what name do you want for the repo? Yes and the name depends on whether you would add your Claude skill in the same repo. If you would, then a name could be skills.
fschmidt Admin
> [mmHg](/thread.html?thread=475&post=1681#p1681) > > Yes and the name depends on whether you would add your Claude skill in the same repo. If you would, then a name could be skills. No, my skill will go in the luan repo.
fschmidt Admin
https://www.luan.software/skill.html
mmHg
> [fschmidt](/thread.html?thread=475&post=1706#p1706) > > No, my skill will go in the luan repo. A name could be pi-luan.
fschmidt Admin
> [mmHg](/thread.html?thread=475&post=1726#p1726) > > A name could be pi-luan. https://arkian.repositoryhosting.com/hg/arkian/pi-luan
mmHg edited
> [fschmidt](/thread.html?thread=475&post=1732#p1732) > > https://arkian.repositoryhosting.com/hg/arkian/pi-luan Thank you! I added stuff to it. Please check. Question: Can you make my skill something visible on your webpage, similar to how you did it for yours?
fschmidt Admin
> [mmHg](/thread.html?thread=475&post=1736#p1736) > > Question: Can you make my skill something visible on your webpage, similar to how you did it for yours? No because because mine is part of the luan repo. But you can copy the logic. Look at the luan repo and https://www.luan.software/init.luan
mmHg edited
Makes sense. By the way, I made three basic desktop calculators to compare our AI skills against each other: 1. My "old mmhg" calculator is made using my skill before I added your library to my skill. You can run it with ./run.sh 2. My "new mmhg" calculator is made using my skill with your library added to it. There should be an executable file to run it. Well, it runs on Linux Mint at least. 3. My "fschmidt" calculator is made using your skill. There should be an executable file to run it. Well, it runs on Linux Mint at least. Can you download them and compare my "new mmhg" calculator with my "fschmidt" calculator? I want to know about the advantages and trade-offs of each one, and which one is better overall: https://drive.proton.me/urls/DN90K7H8F0#JxxFErODAFM8
fschmidt Admin edited
> [mmHg](/thread.html?thread=475&post=1744#p1744) > > Can you download them and compare my "new mmhg" calculator with my "fschmidt" calculator? I want to know about the advantages and trade-offs of each one, and which one is better overall: This isn't really fair since I avoided covering desktop programming at all. I just don't need it now, and I want to start with what is practical. If you want to compare, ask AI to build some small website. I plan to ask Claude to compare your skill with mine. I will post here when I consider my basic skill done.
mmHg edited
Alas, my “fschmidt” calculator seems better to me anyway, even though I made it for desktop. Well, can you please skim the code anyway and confirm that for me? Also, I did not make my pi extension for desktop either. Yes, I will make two different websites to compare. But I will have to do it later today.
mmHg edited
[@fschmidt](/profile.html?user=4) Hey so I made two note-taking websites: "luan-ai" and "pi-luan". The former uses your AI skill, and the latter uses my AI skill. Which one do you think looks better and why? https://drive.proton.me/urls/NS1PA20YZC#qutS3hq8vmbx
mmHg edited
I asked GPT-6 Astra (Extra High effort mode) to compare our skills against each other. I disagree with its beliefs though: https://chatgpt.com/s/cx_6af6a7a03c788191ad7d42ed09b3c98e
fschmidt Admin edited
GPT is focused on details. Since yours is based on more experience, it covers more details. Mine will catch up on that. I also asked Opus and got the message below. We made some changes to my skill based on yours. --- I cloned `pi-luan` and read all of it: the skill, its nine reference files, scripts, examples, tests and docs. Its history shows five commits on November 12, by "breaking_beasts". It's built for the Pi coding agent, with a small extension that adds a `/luan-doctor` command. The most notable thing first: **its fifteen library files are exact copies of ours** from `references/library/`, in the commit "add library". Its principles file is a Markdown copy of your page, and its `luan-differences.md` is a copy of `diff.html`, each stamped with the source URL and the date fetched. **Where it's better than ours:** 1. **It covers more than websites.** It covers general-purpose Luan and Java 8 Swing desktop applications, with working examples, the event dispatch thread, MigLayout and FlatLaf, and Luan Editor as the reference app. Ours covers only websites. 2. **More language traps, and the three I tested are right:** - `Table.insert(t,3)` fails, because Luan requires the position: `Table.insert(list,pos,value)`. - `if x and x.ready then` fails when `x` is nil, because the condition becomes `nil` rather than a boolean. - `String.replace` is literal, not a pattern. It also notes, though I haven't checked these yet: - Metamethods are named differently: `__new_index`, `__to_string`. - A repeated request parameter becomes a list. - Regex replacement uses `$1`. - Errors have `e.get_message()`, and a second `text_writer()` call fails. - `send_error` resets the headers. - `site:` URIs aren't available in a command-line test until `Server.init_dir`, and `Http_test` can run a page without a server. - There's a list of common error messages with their real causes. 3. **Tooling.** It has a compile-only checker (`check.luan`, a few lines using `Luan.load`), a runtime checker, automated tests, and a written record of what was actually run. **Where it conflicts with how you work.** These are serious, because an agent using it would write code you'd reject: 1. **Stylesheets:** it requires `<link rel="stylesheet">` and forbids `<style>` blocks. Your sites load CSS with `@import` inside `<style>`. 2. **Layout:** - It puts data-access modules in `src/private/`, and site tools in public `src/tools/`. In your sites the data modules are in `lib/`, and the admin tools are in `private/tools/`. - It says data and secrets must live outside `src/`, while you keep them in `src/private/local/` and `src/private/Config.luan`. 3. **Security:** - It says never to copy chat's password cookie or the password in the login link, calling them "legacy". That's the login model you chose. - It recommends POST/Redirect/GET and generic "CSRF/origin" checks rather than your Referer check, and treats a GET that changes data as unsafe. - Its example page checks the HTTP method and returns 405, which is defensive code your sites don't have. 4. **Consistency:** it says to follow each project's own conventions, "not a universal house style". You want your current practice followed consistently. 5. **Readability:** it's dense and full of caveats, like "verify this behavior against the runtime version in use" or "Pi keeps the first discovered skill on name collision". It reads like the modern defensive style your principles reject. 6. **References:** it points to Fluentaro's source as an example, which its users may not be able to reach. **What ours has that it doesn't.** Everything about real dynamic sites: - Lucene and models, transactions, and forms with `ajaxForm` - `error_log.js`, the Referer check, access control, and the login model - admin tools, hosting and backups - a review checklist, testing with a mail catcher, and the fresh-agent test results Its web reference mentions Lucene in one paragraph. **What I'd take from it:** 1. **The language traps**, after testing each one in Luan, added to `luan.md`. 2. **The compile-only checker**, as `scripts/check.luan`. 3. **Desktop:** that's your call. Should the skill cover Swing applications, or will your users write only websites? I wouldn't take anything from its conventions. I've also saved the reminder about the second fresh-agent test.
mmHg edited
Ah shit, I didn’t want to block <style>. My bad for doing so. I like your idea of using your skill as the base and pulling whatever I have that you don’t have that serves a legitimate purpose and creates no internal conflicts.
mmHg
>Consistency: it says to follow each project's own conventions, "not a universal house style". You want your current practice followed consistently. I think your way is better. I think the reason why my skill doesn’t enforce as many conventions is because I was feeding it the zen principles for designing Japanese gardens, and one principle was freedom from dogmatic formulas.
mmHg
[@fschmidt](/profile.html?user=4) I think I can start using your skill now. What else do you think is needed before you can consider your skill to be done?
fschmidt Admin
My skill is still [changing quickly](https://arkian.repositoryhosting.com/hg_public/arkian/luan). I still have a few days of details to work out, and then I will test it on Fluentaro. After that, it should be ready for use. But I expect it to keep developing for at least a year.
mmHg
Thank you for doing this. I’m glad that you were able to take the good parts of my skill and put it in your skill. Let me know if I can help you with anything else. You’re the creator of Luan, so your judgment will be sound.

Log in to reply.