Skip to content

Fix SKILL.md limit, audit rules/memory, add framework + network-performance rules, CI checks, and slash commands - #2

Open
b3sty191 wants to merge 5 commits into
mainfrom
claude/intelligent-curie-udyv8o
Open

b3sty191 wants to merge 5 commits into
mainfrom
claude/intelligent-curie-udyv8o

Conversation

@b3sty191

@b3sty191 b3sty191 commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR has five commits.

  1. SKILL.md description was over the 1024-char limit. The frontmatter description was 1185 characters, which failed skill-creator quick_validate.py. It is now under the limit and keeps every trigger keyword. scripts/validate_b3sty_skill.py now enforces the limit. The README was also tidied.

  2. Content audit. I audited skills/, memory/, references/server.cfg.example and the packaging docs. Before any fix, a separate skeptic checked each finding against the native references and the FXServer, oxmysql and ox_lib sources. A second review then checked the resulting diff for regressions and contradictions between files.

  3. Framework rules and two slash commands.

    • skills/common/frameworks.md covers ESX, QBCore, Qbox, VORP and RSG: player lookup, character IDs, overdraft-safe money handling, items, jobs, lifecycle events, and a minimal server bridge. Each API was checked against the framework's current source.
    • /b3sty-review reviews a resource and reports findings by severity.
    • /b3sty-new-resource scaffolds a resource that follows the rules.
    • Both ship as plugin commands in commands/. A nested SKILL.md would break single-skill upload, and the validator now rejects one.
  4. CI checks for Lua examples and native references.

    • scripts/check_lua_examples.py compiles every lua block with Lua 5.4. It first rewrites the CfxLua compound operators and backtick hashes. CI installs lua5.4 and runs it.
    • The validator now requires every native hash and CAPS native name cited in the rules to exist in references/natives/. This check caught one native that does not exist, and the example was fixed.
  5. Network performance rules and /b3sty-perf.

    • skills/common/network-performance.md covers:
      • the net event cost model
      • FXServer rate limiters and what each does when exceeded (drop vs kick)
      • latent events: per-target bps and reassembly
      • payload shape
      • snapshot-then-deltas caching
      • picking the smallest audience
      • state bag cost
    • debugging.md now covers netEventLog, netgraph, cl_drawPerf, the developer-mode gate, and server vs network thread hitches. It also corrects an earlier claim: server resmon exists only in the Windows GUI.
    • New CPU hot-path rules: GetGamePool scans, per-frame allocations, GetHashKey in loops, and yielding long server loops.
    • /b3sty-perf runs a performance pass and reports each figure as measured or estimated.
    • These facts were checked against the citizenfx/fivem source and fivem-docs.

Notable corrections (commit 2)

  • Security
    • The buy example granted items even when the conditional debit matched 0 rows.
    • explosionEvent compared a string sender with a number.
    • The in-flight lock leaked when a call errored.
    • math.floor(nil) crashed input validation.
    • The server-origin source guard now checks "", not 65535.
    • weaponType is an unsigned hash.
    • Corrected the convar descriptions.
    • Bans now prefer license2.
  • Natives
    • BOOL results come back as 1/false.
    • Int-returning hash calls need ResultAsInteger().
    • Float coercion is required for named calls too.
    • Corrected PointerValue* behavior and RDR3 struct packing.
    • Server-side build gates use sv_enforceGameBuild.
  • NUI / networking
    • SetNuiFocus(hasFocus, hasCursor).
    • A missing cb makes the NUI request time out.
    • Built-in events that exist only on FiveM are now marked as such.
    • Corrected routing-bucket inheritance.
    • NetworkGetEntityOwner can return -1.
    • Documented the sv_filterRequestControl modes.
  • Runtime / database / style
    • ensure vs start.
    • The exports proxy is never nil.
    • Stock require cannot load resource files.
    • oxmysql error semantics.
    • ^= is XOR.
  • Memory: onResourceStop flush does not yield, the save-failure path is reachable, and the ammo wrapper is corrected.
  • server.cfg.example: secrets are exec'd first, semicolons are removed from comments, and the sv_master1, sv_endpointPrivacy and sv_filterRequestControl 4 notes are corrected.

Verification

  • python scripts/validate_b3sty_skill.py passes locally and in CI.
  • python scripts/check_lua_examples.py passes all 45 blocks, locally and in CI.
  • skill-creator quick_validate.py . reports Skill is valid!.
  • The Lua example check covers syntax only. Runtime behavior of the examples, and the slash commands on a real resource, have not been exercised.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VSf2U7JNwmAocuwkaxZQyP

The frontmatter description was 1185 characters, which fails the
skill-creator quick_validate check (max 1024). Shorten it while keeping
the trigger keywords, add a length check to validate_b3sty_skill.py so
CI catches it, and tidy the README (list server.cfg.example, group the
Memory section with the structure docs, drop the user-specific path).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSf2U7JNwmAocuwkaxZQyP
Full content audit of skills/, memory/, references/server.cfg.example
and packaging docs. Each finding was independently verified against the
native references and FXServer/oxmysql/ox_lib sources before fixing, then
the resulting diff was reviewed again for regressions and cross-file
contradictions.

Highlights:
- security-performance: fix buy example that granted items on a 0-row
  conditional debit, string `sender` in explosionEvent, lock leak on
  error, math.floor(nil) validation, server-origin `source` guard
  ("" not 65535), weaponType unsigned hash, convar descriptions.
- natives: correct BOOL/int result marshalling (1/false, ResultAsInteger),
  float coercion for named calls, PointerValue* behavior, RDR3 struct
  packing, server-side build gating, shared ammo-by-type hashes.
- nui/networking: SetNuiFocus hasCursor, FiveM-only built-in events,
  `for` keyword in msgpack scope data, routing bucket inheritance,
  NetworkGetEntityOwner -1, sv_filterRequestControl modes.
- runtime/database/style: ensure vs start, exports proxy never nil,
  CfxLua require cannot load resource files, oxmysql error semantics,
  transaction 0-row caveat, `^=` is XOR, license2 preference.
- memory: non-yielding onResourceStop flush, reachable save-failure path,
  corrected ammo wrapper, state bag clear, dated entries.
- server.cfg.example: secrets first, no semicolons in comments,
  sv_endpointPrivacy/sv_master1/sv_authMinTrust/sv_requestParanoia
  descriptions corrected, sv_filterRequestControl 4 audit warning.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSf2U7JNwmAocuwkaxZQyP
- skills/common/frameworks.md: ESX, QBCore, Qbox, VORP, and RSG player
  lookup, character IDs, overdraft-safe money handling, items, jobs,
  lifecycle events, and a minimal server bridge. API shapes checked
  against each framework's current source.
- commands/b3sty-review.md: /b3sty-review walks entry points in the
  SKILL.md review priority order and reports verified findings by
  severity.
- commands/b3sty-new-resource.md: /b3sty-new-resource scaffolds a
  resource that follows the rules (manifest, controllers, validated
  prefixed events, cleanup, optional bridge/NUI/DB).
- Shipped as plugin commands, not nested SKILL.md files, so the root
  skill still uploads as a single skill; the validator now rejects
  nested SKILL.md files and checks command frontmatter.
- Wire the new files into SKILL.md routing, README, and AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSf2U7JNwmAocuwkaxZQyP
@b3sty191 b3sty191 changed the title Fix SKILL.md description limit and audit/correct skill rules, memory, and server.cfg baseline Fix SKILL.md limit, audit rules/memory, add framework rules and review/scaffold commands Sep 29, 2026
- scripts/check_lua_examples.py compiles every ```lua block in the rule,
  memory, and command docs with Lua 5.4 after rewriting CfxLua compound
  assignment and backtick hashes; CI installs lua5.4 and runs it.
- validate_b3sty_skill.py now requires every native hash and CAPS native
  name cited in the rules to exist in references/natives/ (CFX natives
  cited with their docs link and a short list of non-native constants
  are exempt).
- The new check caught a non-existent native in the native-usage name
  conversion examples; replaced it with SET_PED_AMMO_BY_TYPE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSf2U7JNwmAocuwkaxZQyP
- skills/common/network-performance.md: net event cost model, FXServer
  rate limiters and what each does when exceeded (drop vs kick), latent
  events (per-target bps, reassembly), msgpack payload shape,
  snapshot-then-deltas caching, audience, and state bag cost.
- debugging.md: netEventLog/netgraph/net_statsFile/cl_drawPerf, the
  developer-mode gate, server vs network thread hitches, measured vs
  estimated figures; server resmon is Windows GUI only.
- security-performance.md Performance Rules: GetGamePool scans,
  per-frame allocations, GetHashKey in loops, yielding long server loops.
- commands/b3sty-perf.md: /b3sty-perf performance pass with a
  measured/estimated report.

Facts were checked against the citizenfx/fivem source and fivem-docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSf2U7JNwmAocuwkaxZQyP
@b3sty191 b3sty191 changed the title Fix SKILL.md limit, audit rules/memory, add framework rules and review/scaffold commands Fix SKILL.md limit, audit rules/memory, add framework + network-performance rules, CI checks, and slash commands Sep 29, 2026
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.

2 participants