Best for
- Use when reviewing or hardening Lua modules.
artalis-io/hull/.claude/skills/lua-audit/SKILL.md
Audit Lua stdlib code for security, correctness, and sandbox safety. Use when reviewing or hardening Lua modules.
Decision brief
Perform comprehensive security, correctness, and quality audits on Hull Lua stdlib code.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/artalis-io/hull --skill ".claude/skills/lua-audit"Inspect the Agent Skill "lua-audit" from https://github.com/artalis-io/hull/blob/9d96662f3cb2055f1ed3c1e85de2d7fdca2cfc4a/.claude/skills/lua-audit/SKILL.md at commit 9d96662f3cb2055f1ed3c1e85de2d7fdca2cfc4a. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
Review the “Usage” section in the pinned source before continuing.
When /lua-audit is invoked:
Hull Lua code runs inside a sandboxed Lua 5.4 interpreter: - Removed globals: io, os, loadfile, dofile, load - Available libs: base, table, string, math, utf8, coroutine - Custom require(): resolves only from embedded stdlib registry - Memory limit: 64 MB (custom allocator) - C…
Hull-specific: The template engine's template.compile() uses luaLloadbuffer via C bridge — this is the ONLY allowed code compilation path. Verify no Lua-level code compilation exists.
Hull-specific: The template engine's template.compile() uses luaLloadbuffer via C bridge — this is the ONLY allowed code compilation path. Verify no Lua-level code compilation exists.
Permission review
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 17 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Perform comprehensive security, correctness, and quality audits on Hull Lua stdlib code.
Target: $ARGUMENTS (default: all stdlib/lua/hull/*.lua files)
/lua-audit # Audit all Lua stdlib modules
/lua-audit stdlib/lua/hull/template.lua # Audit a specific module
/lua-audit --fix # Audit and apply fixes
Hull Lua code runs inside a sandboxed Lua 5.4 interpreter:
io, os, loadfile, dofile, loadrequire(): resolves only from embedded stdlib registrydb, crypto, time, env, fs, http — accessed through hull globals, NOT Lua standard libs| Issue | Pattern to Find | Severity |
|---|---|---|
| Sandbox escape | Use of load(), loadstring(), dofile(), loadfile() | Critical |
| Unsafe eval | String-to-code conversion outside C bridge _compile() | Critical |
| Module smuggling | require() of non-hull modules | Critical |
| Global pollution | Writing to _G or global scope without local | High |
| Metatable abuse | setmetatable on shared objects that could affect other modules | High |
| Debug library | Use of debug.* (not loaded, but check for attempts) | Critical |
| rawget/rawset bypass | Circumventing metatables to access restricted data | Medium |
Hull-specific: The template engine's _template._compile() uses luaL_loadbuffer via C bridge — this is the ONLY allowed code compilation path. Verify no Lua-level code compilation exists.
| Issue | Pattern to Find | Severity |
|---|---|---|
| SQL injection | String concatenation in SQL queries | Critical |
| XSS via template | Unescaped user data in template output | High |
| Path traversal | Unsanitized paths passed to fs.* | High |
| Header injection | \r\n in HTTP header values | High |
| Command injection | User input in tool.spawn() arguments | Critical |
| HMAC timing attack | Non-constant-time string comparison of secrets/tokens | High |
| Regex DoS (ReDoS) | Unbounded string.find/string.gmatch on user input | Medium |
SQL safety check:
-- BAD: string concatenation
db.query("SELECT * FROM users WHERE id = " .. id)
-- GOOD: parameterized
db.query("SELECT * FROM users WHERE id = ?", {id})
Template safety check:
-- BAD: raw output of user data
template.render_string("{{{ user_input }}}", data)
-- GOOD: auto-escaped output
template.render_string("{{ user_input }}", data)
| Issue | Pattern to Find | Severity |
|---|---|---|
| Unchecked nil | Function return used without nil check | High |
| Silent failure | pcall that discards error message | Medium |
| Missing error propagation | Error condition not returned to caller | Medium |
Bare error() | Error without context message | Low |
| Unprotected external calls | db.query(), http.get() without error handling | Medium |
Patterns to check:
-- BAD: unchecked
local result = db.query("SELECT * FROM users WHERE id = ?", {id})
local name = result[1].name -- crashes if result is empty
-- GOOD: nil-safe
local result = db.query("SELECT * FROM users WHERE id = ?", {id})
if not result or #result == 0 then return nil, "not found" end
local name = result[1].name
| Issue | Pattern to Find | Severity |
|---|---|---|
| Missing type checks | Function params not validated with type() | Medium |
| Nil propagation | Nil values passed through chains without checks | Medium |
| Table/string confusion | # operator on potentially nil values | Medium |
| Number coercion | String used where number expected (or vice versa) | Low |
| Boolean truthiness | 0 and "" are truthy in Lua; {} is truthy | Medium |
Lua truthiness pitfalls:
-- BAD: 0 is truthy in Lua!
if count then -- true even when count == 0
-- GOOD:
if count and count > 0 then
-- BAD: empty table is truthy!
if items then -- true even when items == {}
-- GOOD:
if items and #items > 0 then
| Issue | Pattern to Find | Severity |
|---|---|---|
| Unbounded table growth | Tables that grow without limit (caches, logs) | High |
| Missing cache eviction | Caches without TTL or size limit | Medium |
| Closure leaks | Closures capturing large upvalues unnecessarily | Medium |
| String concatenation in loops | s = s .. chunk in loops (O(n^2)) | Medium |
| Large intermediate tables | Building tables that could exceed memory limit | Medium |
Performance patterns:
-- BAD: O(n^2) string building
local s = ""
for _, item in ipairs(items) do
s = s .. item -- copies entire string each iteration
end
-- GOOD: table.concat
local parts = {}
for _, item in ipairs(items) do
parts[#parts + 1] = item
end
local s = table.concat(parts)
| Issue | Pattern to Find | Severity |
|---|---|---|
| Hardcoded secrets | Literal strings used as HMAC/JWT secrets | Critical |
| Weak secrets | Short or predictable secret values | High |
| Timing attacks | == comparison on HMAC digests or tokens | High |
| Missing expiry | Tokens/sessions without TTL | Medium |
| Insecure defaults | Secure flag missing on cookies, HttpOnly not set | Medium |
| Nonce reuse | Same nonce/IV used for multiple encryptions | Critical |
Constant-time comparison:
-- BAD: early-exit comparison
if token == expected then
-- GOOD: use crypto.verify_password or HMAC-then-compare
-- Hull's jwt.verify and csrf.verify use constant-time internally
| Issue | What to Check | Severity |
|---|---|---|
| Missing API | Function exists in JS but not Lua (or vice versa) | Medium |
| Different behavior | Same function returns different types or formats | High |
| Naming mismatch | API names don't follow convention (Lua: snake_case, JS: camelCase) | Low |
| Different defaults | Default option values differ between runtimes | Medium |
| Error format | Different error message formats | Low |
| Issue | Pattern to Find | Severity |
|---|---|---|
| Code injection in codegen | User data interpolated into generated Lua source | Critical |
| Circular inheritance | {% extends %} chains without cycle detection | High |
| Unbounded recursion | Deeply nested includes without depth limit | High |
| Cache poisoning | Template cache key collision or manipulation | Medium |
| Filter bypass | Custom filter that returns unescaped HTML | Medium |
| Denial of service | Template that generates unbounded output | Medium |
| Pattern | Issue | Fix |
|---|---|---|
Unreachable code after return | Dead code | Remove |
| Unused local variables | Dead variable | Remove |
| Unused function parameters | Dead parameter | Prefix with _ |
| Commented-out code blocks | Dead code | Remove |
require of unused module | Dead import | Remove |
Empty if/else blocks | Dead branch | Remove |
When /lua-audit is invoked:
Locate Files
stdlib/lua/hull/*.lua # All Lua stdlib modules
examples/*/app.lua # Example apps (reference patterns)
tests/fixtures/*/app.lua # Test fixture apps
Scan for Critical Issues
load(, loadstring(, dofile(, loadfile( — sandbox escapes"SELECT.*".. or "INSERT.*"..{{{ in template strings — raw output of user data== comparison of secrets, tokens, hashes_G. or _G[ — global pollutionlocal on function-scoped variablesReview Each Module
Check Template Engine
& < > " 'Generate Report Format as markdown table with findings, severity, file:line, and suggested fix.
## Lua Audit Report: Hull
**Date:** YYYY-MM-DD
**Files Scanned:** N
**Issues Found:** N (Critical: N, High: N, Medium: N, Low: N)
### Critical Issues
| # | File:Line | Issue | Current Code | Suggested Fix |
|---|-----------|-------|--------------|---------------|
| C1 | stdlib/lua/hull/auth.lua:42 | SQL injection | `db.query("... " .. id)` | `db.query("... ?", {id})` |
### High Issues
...
### Medium Issues
...
### Low Issues
...
### Recommendations
1. ...
When --fix is specified:
make)make test && make e2e-templates)Auto-fixable Issues:
local declarations -> add local_s = s .. x in loops -> table.concat patternNOT Auto-fixable (require manual review):
Frequently asked questions
Perform comprehensive security, correctness, and quality audits on Hull Lua stdlib code.
The source record exposes this install command: npx skills add https://github.com/artalis-io/hull --skill ".claude/skills/lua-audit". Inspect the command and pinned source before running it.
Alternatives
coreyhaines31/marketingskills
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
garrytan/gbrain
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing