This file tells AI coding agents how the CFX Developer Tools repo works and how to contribute correctly.
Documentation site: https://tmhsdigital.github.io/CFX-Developer-Tools/ (auto-deployed on push to main)
This is a Cursor IDE plugin for FiveM/RedM (CFX) resource development. It contains:
.cursor-plugin/plugin.json-- plugin manifest (version, skills, rules)skills/-- 9 SKILL.md files teaching the AI domain-specific CFX knowledgerules/-- 6 .mdc rule files enforcing coding conventionssnippets/-- 24 code snippet files (Lua, JS, C#)templates/-- 11 resource starter templates (standalone, ESX, QBCore, Qbox, ox_core, VORP, RSG, JS, C#, NUI Vite, NUI Svelte)mcp-server/-- Python MCP server with 6 tools and JSON data filesdocs/-- ARCHITECTURE.md, ROADMAP.md, CONTRIBUTING.md, GETTING-STARTED.md, index.md (docs site landing page)CHANGELOG.md-- manually maintained release history (not auto-generated)mkdocs.yml-- MkDocs Material configuration for the documentation site.github/workflows/-- CI/CD automation
- Single branch:
mainonly. No develop/release branches. - Conventional commits are required. The release workflow parses them:
feat:orfeat(scope):-- triggers a minor version bumpfeat!:orBREAKING CHANGE-- triggers a major version bump- Everything else (
fix:,chore:,docs:,refactor:, etc.) -- triggers a patch bump
- Commit messages should be concise and describe the "why", not the "what".
Checks:
- JSON validity for plugin.json, mcp.json, native databases, events
- Plugin manifest required fields, kebab-case name, skill/rule file existence
- Content counts in README match actual files on disk (skills, rules, snippets, templates)
- Em dash and en dash detection (use hyphens, not em/en dashes)
- Hardcoded credential patterns
- Deprecated
lua54 'yes'directive in templates - fxmanifest.lua templates have
fx_version,games,'cerulean' - Python syntax for all MCP server modules
Automatic flow:
- Reads current version from
plugin.json - Determines bump type from conventional commit messages since last tag
- Computes new semver version
- Updates
plugin.jsonversion andREADME.mdversion badge - Commits with
[skip ci]to prevent re-triggering - Creates git tag
vX.Y.Z - Creates GitHub Release with grouped release notes
Has a concurrency guard -- only one release can run at a time to prevent race conditions.
After a successful release, the workflow also syncs the GitHub repository "About" section (description, homepage URL, and topics) via gh repo edit. The description is dynamically generated from live artifact counts (skills, rules, snippets, templates, events, MCP tools).
Do not manually edit the version in plugin.json or the README badge. The release workflow owns both.
Do not manually edit the GitHub repo About section (description, homepage, topics). The release workflow syncs it automatically on every release.
CHANGELOG.md is manually maintained. Update it when making significant changes. The release workflow does not auto-update it.
- Fetches compiled native JSON from
runtime.fivem.net/doc/(GTA5, RDR3, and CFX platform natives) - Transforms via
.github/scripts/transform_natives.pyinto the plugin's flat schema - Validates the output (checks required fields, types, counts)
- If changed, commits and pushes directly to main with
chore:prefix
- Runs
.github/scripts/build_docs_index.pyto crawl ~80 pages from docs.fivem.net - Writes result to
mcp-server/data/docs_index.json - Validates structure (title, url, section, snippet required)
- If changed, commits and pushes directly to main with
chore:prefix
Builds the MkDocs Material documentation site from the repository's Markdown files and deploys it to GitHub Pages via actions/deploy-pages. The site URL is https://tmhsdigital.github.io/CFX-Developer-Tools/.
Marks issues/PRs as stale after inactivity and closes them after further inactivity.
- The source of truth for the current version is
.cursor-plugin/plugin.json. - The release workflow auto-bumps it and the README badge on every qualifying push to main.
- Never manually change the version unless you know the release workflow won't run (e.g., docs-only changes).
- No em dashes or en dashes -- use hyphens or rewrite. CI will reject them.
- No
lua54 'yes'-- it is deprecated. Lua 5.4 is the only CFX runtime. CI will reject this in templates. - No hardcoded credentials -- CI scans for password/token/api_key patterns.
- fxmanifest.lua must use
fx_version 'cerulean'and includegames. - Python code in
mcp-server/must passpy_compile. - Snippets, templates, and skills should be accurate to the current FiveM/RedM APIs.
- Create
skills/<skill-name>/SKILL.mdwith YAML frontmatter (title, description, globs) - Add the path to
plugin.jsonunder"skills" - Update counts in README.md stats line and skills table
- Use
fix:orfeat:commit prefix depending on scope
- Create
rules/<rule-name>.mdcwith frontmatter (description,globs,alwaysApply) - Add the path to
plugin.jsonunder"rules"
- Add the file to
snippets/<language>/(lua, javascript, csharp) - Include a header comment explaining what the snippet does
- Update counts in README.md stats line and relevant snippet tables
- CI will fail if README counts don't match actual file counts
- Create
templates/<template-name>/with at minimumfxmanifest.lua - Include working client/server scripts
- Do not include
lua54 'yes'
Do not manually edit mcp-server/data/natives_*.json. The update-natives.yml workflow handles this automatically. If you need to change the transformation logic, edit .github/scripts/transform_natives.py.
- Entry point:
mcp-server/server.py - Tools:
mcp-server/tools/(scaffold.py, natives.py, manifest_gen.py, event_search.py, docs_search.py, detect_framework.py) - Shared logic:
mcp-server/tools/manifest_common.py - Data:
mcp-server/data/(natives_gta5.json, natives_rdr3.json, events.json, docs_index.json) - Dependencies:
mcp-server/requirements.txt(pinned ranges)
The MCP server is configured in .cursor/mcp.json and starts automatically when Cursor invokes a tool.
- FiveM and RedM only support Lua 5.4 (5.3 removed). The
lua54 'yes'directive is deprecated and ignored. - C# resources compile to a single DLL referenced in both
client_scriptsandserver_scripts. Wait(0)in Lua loops is a performance anti-pattern in most cases; use appropriate wait times.- Server-side event handlers must validate
sourceto prevent spoofing. - The native databases use a flat JSON array schema with
name,hash,params,return_type,description,category,side,deprecated,examples. - Native data is sourced from
runtime.fivem.net/doc/-- GTA5, RDR3, and CFX platform natives are merged per game file. - The
lookup_native_toolsupports keyword search, hash lookup, category browsing, and side filtering. - Events use
{ "name", "side", "description", "params", "game", "framework" }. 101 events across cfx, baseevents, chat, esx, qbcore, qbox, oxcore, vorp, rsg frameworks. docs_index.jsonis a searchable index of ~80 FiveM/RedM docs pages, rebuilt monthly by CI. Schema:{ "title", "url", "section", "snippet" }.- The
detect_framework_toolscans fxmanifest.lua dependencies (highest weight) and code patterns (exports['es_extended'],QBCore = exports,exports['qbx_core'],require '@ox_core',exports.vorp_core,exports['rsg-core']) to report framework, confidence, and evidence. Supports ESX, QBCore, Qbox, ox_core, VORP, RSG, and standalone.
CC-BY-NC-ND-4.0. All contributions fall under this license.