Skip to content

docs: add AGENTS.md with contributor and agent guidance - #11

Merged
mschmicking merged 1 commit into
masterfrom
docs-agents
Aug 8, 2026
Merged

docs: add AGENTS.md with contributor and agent guidance#11
mschmicking merged 1 commit into
masterfrom
docs-agents

Conversation

@mschmicking

Copy link
Copy Markdown
Owner

Guidance for AI agents and new contributors, covering what is not discoverable by reading the code.

Conventions in src/

  • vendor/ is a verbatim upstream copy and must not be patched — that is what keeps a Lua upgrade a file copy rather than a merge
  • Argument validation goes through CheckArgs; Lua errors through ThrowLuaError, which owns the lua_pop that is easy to forget
  • Relative stack indices must be resolved with abs_index before pushing — this was a real bug, where SetField(-1, ...) assigned into the value it had just pushed
  • Unprotected Lua errors abort the process rather than throwing, so types must be guarded first
  • No C++ exceptions through Lua frames: Lua unwinds with longjmp, which skips destructors

Workflow rules that caused real friction here

  • Branch from the default branch, never stack. Merges are squash-only, so a squashed parent leaves duplicate commits and guaranteed conflicts. This cost two rebases during the recent work.
  • DIRTY and BEHIND are different. One is a conflict, the other just needs "Update branch".
  • Read CodeQL results from a default-branch analysis. PR analyses only report alerts new relative to the base, so results=0 on a PR reads as clean when the branch has open alerts. That misled this repo once already.
  • Rebuild after changing src/npm test runs against the last compiled binary and will pass on stale output.

Verified

  • No personal information: scanned for emails, names and account handles — none present
  • All local links resolve
  • Every factual claim checked against the repo: 287 tab-indented lines and 0 space-indented, NAPI_DISABLE_CPP_EXCEPTIONS present in binding.gyp, all five helper names exist, 29 vendored Lua sources, files allowlist present

🤖 Generated with Claude Code

Captures the conventions that are not discoverable from the code: that
vendor/ is a verbatim upstream copy and must not be patched, that argument
validation goes through CheckArgs and Lua errors through ThrowLuaError, that
relative stack indices must be resolved before pushing, and that unprotected
Lua errors abort the process rather than throwing.

Also records the workflow rules that caused real friction: branch from the
default branch rather than stacking, since merges are squash-only; PR titles
drive the release version; and CodeQL results must be read from a default-branch
analysis, because pull-request analyses only report alerts new relative to the
base and so read as clean when they are not.

Contains no personal information.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mschmicking
mschmicking merged commit 4312d6f into master Aug 8, 2026
13 checks passed
@mschmicking
mschmicking deleted the docs-agents branch August 8, 2026 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant