Source profileQuality 91/100

artalis-io/hull/.claude/skills/lua-audit/SKILL.md

lua-audit

Audit Lua stdlib code for security, correctness, and sandbox safety. Use when reviewing or hardening Lua modules.

Source repository stars
17
Declared platforms
0
Static risk flags
0
Last source update
2026-08-24
Source checked
2026-08-25

Decision brief

What it does: where it fits

Perform comprehensive security, correctness, and quality audits on Hull Lua stdlib code.

Best for

  • Use when reviewing or hardening Lua modules.

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/artalis-io/hull --skill ".claude/skills/lua-audit"
Safe inspection promptEditorial

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

What the source asks the agent to do

  1. 01

    Usage

    Review the “Usage” section in the pinned source before continuing.

    Review and apply the “Usage” source section.
  2. 02

    Audit Procedure

    When /lua-audit is invoked:

    Locate FilesScan for Critical IssuesSearch for load(, loadstring(, dofile(, loadfile( — sandbox escapes
  3. 03

    Hull Lua Context

    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…

    Removed globals: io, os, loadfile, dofile, loadAvailable libs: base, table, string, math, utf8, coroutineCustom require(): resolves only from embedded stdlib registry
  4. 04

    Audit Categories

    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.Lua truthiness pitfalls:Constant-time comparison:
  5. 05

    1. Sandbox Safety (Critical)

    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

Static risk signals and limitations

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

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars17SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
artalis-io/hull
Skill path
.claude/skills/lua-audit/SKILL.md
Commit
9d96662f3cb2055f1ed3c1e85de2d7fdca2cfc4a
License
AGPL-3.0
Collected
2026-08-25
Default branch
main
View the original SKILL.md

Lua Code Audit Skill

Perform comprehensive security, correctness, and quality audits on Hull Lua stdlib code.

Target: $ARGUMENTS (default: all stdlib/lua/hull/*.lua files)

Usage

/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 Context

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 capabilities: db, crypto, time, env, fs, http — accessed through hull globals, NOT Lua standard libs

Audit Categories

1. Sandbox Safety (Critical)

IssuePattern to FindSeverity
Sandbox escapeUse of load(), loadstring(), dofile(), loadfile()Critical
Unsafe evalString-to-code conversion outside C bridge _compile()Critical
Module smugglingrequire() of non-hull modulesCritical
Global pollutionWriting to _G or global scope without localHigh
Metatable abusesetmetatable on shared objects that could affect other modulesHigh
Debug libraryUse of debug.* (not loaded, but check for attempts)Critical
rawget/rawset bypassCircumventing metatables to access restricted dataMedium

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.

2. Input Validation & Injection

IssuePattern to FindSeverity
SQL injectionString concatenation in SQL queriesCritical
XSS via templateUnescaped user data in template outputHigh
Path traversalUnsanitized paths passed to fs.*High
Header injection\r\n in HTTP header valuesHigh
Command injectionUser input in tool.spawn() argumentsCritical
HMAC timing attackNon-constant-time string comparison of secrets/tokensHigh
Regex DoS (ReDoS)Unbounded string.find/string.gmatch on user inputMedium

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)

3. Error Handling

IssuePattern to FindSeverity
Unchecked nilFunction return used without nil checkHigh
Silent failurepcall that discards error messageMedium
Missing error propagationError condition not returned to callerMedium
Bare error()Error without context messageLow
Unprotected external callsdb.query(), http.get() without error handlingMedium

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

4. Type Safety

IssuePattern to FindSeverity
Missing type checksFunction params not validated with type()Medium
Nil propagationNil values passed through chains without checksMedium
Table/string confusion# operator on potentially nil valuesMedium
Number coercionString used where number expected (or vice versa)Low
Boolean truthiness0 and "" are truthy in Lua; {} is truthyMedium

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

5. Resource Management

IssuePattern to FindSeverity
Unbounded table growthTables that grow without limit (caches, logs)High
Missing cache evictionCaches without TTL or size limitMedium
Closure leaksClosures capturing large upvalues unnecessarilyMedium
String concatenation in loopss = s .. chunk in loops (O(n^2))Medium
Large intermediate tablesBuilding tables that could exceed memory limitMedium

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)

6. Crypto & Auth Safety

IssuePattern to FindSeverity
Hardcoded secretsLiteral strings used as HMAC/JWT secretsCritical
Weak secretsShort or predictable secret valuesHigh
Timing attacks== comparison on HMAC digests or tokensHigh
Missing expiryTokens/sessions without TTLMedium
Insecure defaultsSecure flag missing on cookies, HttpOnly not setMedium
Nonce reuseSame nonce/IV used for multiple encryptionsCritical

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

7. API Consistency (Lua vs JS parity)

IssueWhat to CheckSeverity
Missing APIFunction exists in JS but not Lua (or vice versa)Medium
Different behaviorSame function returns different types or formatsHigh
Naming mismatchAPI names don't follow convention (Lua: snake_case, JS: camelCase)Low
Different defaultsDefault option values differ between runtimesMedium
Error formatDifferent error message formatsLow

8. Template Engine Specific

IssuePattern to FindSeverity
Code injection in codegenUser data interpolated into generated Lua sourceCritical
Circular inheritance{% extends %} chains without cycle detectionHigh
Unbounded recursionDeeply nested includes without depth limitHigh
Cache poisoningTemplate cache key collision or manipulationMedium
Filter bypassCustom filter that returns unescaped HTMLMedium
Denial of serviceTemplate that generates unbounded outputMedium

9. Dead Code & Style

PatternIssueFix
Unreachable code after returnDead codeRemove
Unused local variablesDead variableRemove
Unused function parametersDead parameterPrefix with _
Commented-out code blocksDead codeRemove
require of unused moduleDead importRemove
Empty if/else blocksDead branchRemove

Audit Procedure

When /lua-audit is invoked:

  1. Locate Files

    stdlib/lua/hull/*.lua                   # All Lua stdlib modules
    examples/*/app.lua                      # Example apps (reference patterns)
    tests/fixtures/*/app.lua                # Test fixture apps
    
  2. Scan for Critical Issues

    • Search for load(, loadstring(, dofile(, loadfile( — sandbox escapes
    • Search for string concatenation in SQL: "SELECT.*".. or "INSERT.*"..
    • Search for {{{ in template strings — raw output of user data
    • Search for == comparison of secrets, tokens, hashes
    • Search for hardcoded secret strings
    • Search for _G. or _G[ — global pollution
    • Search for missing local on function-scoped variables
  3. Review Each Module

    • Check public API functions for input validation
    • Check error handling (nil returns, pcall usage)
    • Check resource cleanup (cache sizes, table growth)
    • Verify API parity with JS equivalent
  4. Check Template Engine

    • Verify codegen never interpolates user data into generated source
    • Verify HTML escaping covers & < > " '
    • Verify nil-safe dot paths
    • Verify circular extends detection
    • Verify include depth limit
  5. Generate Report Format as markdown table with findings, severity, file:line, and suggested fix.

Report Format

## 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. ...

Fix Mode (--fix)

When --fix is specified:

  1. Generate the audit report first
  2. For each fixable issue, apply the transformation
  3. Rebuild (make)
  4. Re-run tests (make test && make e2e-templates)
  5. Report any test failures

Auto-fixable Issues:

  • SQL string concatenation -> parameterized queries
  • Missing local declarations -> add local
  • Unused variables -> remove or prefix with _
  • s = s .. x in loops -> table.concat pattern
  • Missing nil checks -> add guard clause
  • Commented-out code blocks -> remove

NOT Auto-fixable (require manual review):

  • Logic errors
  • Crypto/auth design flaws
  • API parity mismatches (may require JS changes too)
  • Template codegen injection paths
  • Resource leak in complex control flow

Frequently asked questions

What to verify before installation and use

What does the lua-audit source document cover?

Perform comprehensive security, correctness, and quality audits on Hull Lua stdlib code.

How do I install lua-audit?

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

Compare before choosing

Computed 10045,511

coreyhaines31/marketingskills

ab-testing

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

Computed 10029,034

garrytan/gbrain

bulk-ingestion

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.

Computed 10024,921

alirezarezvani/claude-skills

app-store-optimization

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

Computed 1005,241

dotnet/skills

migrate-vstest-to-mtp

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